mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
spiralpoint visualization, less console spam from pollution handler
This commit is contained in:
parent
07cf03b365
commit
2ff5096562
@ -6,10 +6,14 @@ import java.util.HashMap;
|
|||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.hbm.packet.AuxParticlePacketNT;
|
||||||
|
import com.hbm.packet.PacketDispatcher;
|
||||||
import com.hbm.util.fauxpointtwelve.BlockPos;
|
import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.init.Blocks;
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.util.Vec3;
|
import net.minecraft.util.Vec3;
|
||||||
import net.minecraft.world.ChunkCoordIntPair;
|
import net.minecraft.world.ChunkCoordIntPair;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
@ -76,6 +80,8 @@ public class ExplosionNukeRayBatched {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void collectTip(int count) {
|
public void collectTip(int count) {
|
||||||
|
|
||||||
|
//count = Math.min(count, 10);
|
||||||
|
|
||||||
int amountProcessed = 0;
|
int amountProcessed = 0;
|
||||||
|
|
||||||
@ -119,7 +125,16 @@ public class ExplosionNukeRayBatched {
|
|||||||
chunkCoords.add(chunkPos);
|
chunkCoords.add(chunkPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(res <= 0 || i + 1 >= this.length) {
|
if(res <= 0 || i + 1 >= this.length || i == length - 1) {
|
||||||
|
|
||||||
|
/*NBTTagCompound fx = new NBTTagCompound();
|
||||||
|
fx.setString("type", "debugline");
|
||||||
|
fx.setDouble("mX", vec.xCoord * i);
|
||||||
|
fx.setDouble("mY", vec.yCoord * i);
|
||||||
|
fx.setDouble("mZ", vec.zCoord * i);
|
||||||
|
fx.setInteger("color", 0xff0000);
|
||||||
|
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(fx, posX, posY, posZ), new TargetPoint(world.provider.dimensionId, posX, posY, posZ, 200));*/
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -142,8 +142,11 @@ public class PollutionHandler {
|
|||||||
try {
|
try {
|
||||||
if(!pollutionFile.getParentFile().exists()) pollutionFile.getParentFile().mkdirs();
|
if(!pollutionFile.getParentFile().exists()) pollutionFile.getParentFile().mkdirs();
|
||||||
if(!pollutionFile.exists()) pollutionFile.createNewFile();
|
if(!pollutionFile.exists()) pollutionFile.createNewFile();
|
||||||
NBTTagCompound data = perWorld.get(world).writeToNBT();
|
PollutionPerWorld ppw = perWorld.get(world);
|
||||||
CompressedStreamTools.writeCompressed(data, new FileOutputStream(pollutionFile));
|
if(ppw != null) {
|
||||||
|
NBTTagCompound data = ppw.writeToNBT();
|
||||||
|
CompressedStreamTools.writeCompressed(data, new FileOutputStream(pollutionFile));
|
||||||
|
}
|
||||||
} catch(Exception ex) {
|
} catch(Exception ex) {
|
||||||
System.out.println("Failed to write " + pollutionFile.getAbsolutePath());
|
System.out.println("Failed to write " + pollutionFile.getAbsolutePath());
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
|
|||||||
@ -1833,6 +1833,15 @@ public class ClientProxy extends ServerProxy {
|
|||||||
Minecraft.getMinecraft().effectRenderer.addEffect(text);
|
Minecraft.getMinecraft().effectRenderer.addEffect(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if("debugline".equals(type)) {
|
||||||
|
double mX = data.getDouble("mX");
|
||||||
|
double mY = data.getDouble("mY");
|
||||||
|
double mZ = data.getDouble("mZ");
|
||||||
|
int color = data.getInteger("color");
|
||||||
|
ParticleDebugLine text = new ParticleDebugLine(world, x, y, z, mX, mY, mZ, color);
|
||||||
|
Minecraft.getMinecraft().effectRenderer.addEffect(text);
|
||||||
|
}
|
||||||
|
|
||||||
if("network".equals(type)) {
|
if("network".equals(type)) {
|
||||||
ParticleDebug debug = null;
|
ParticleDebug debug = null;
|
||||||
double mX = data.getDouble("mX");
|
double mX = data.getDouble("mX");
|
||||||
|
|||||||
72
src/main/java/com/hbm/particle/ParticleDebugLine.java
Normal file
72
src/main/java/com/hbm/particle/ParticleDebugLine.java
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
package com.hbm.particle;
|
||||||
|
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
import net.minecraft.client.particle.EntityFX;
|
||||||
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
public class ParticleDebugLine extends EntityFX {
|
||||||
|
|
||||||
|
int color;
|
||||||
|
|
||||||
|
public ParticleDebugLine(World world, double x, double y, double z, double lx, double ly, double lz, int color) {
|
||||||
|
super(world, x, y, z, lx, ly, lz);
|
||||||
|
this.motionX = lx;
|
||||||
|
this.motionY = ly;
|
||||||
|
this.motionZ = lz;
|
||||||
|
this.color = color;
|
||||||
|
this.particleMaxAge = 60;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onUpdate() {
|
||||||
|
this.prevPosX = this.posX;
|
||||||
|
this.prevPosY = this.posY;
|
||||||
|
this.prevPosZ = this.posZ;
|
||||||
|
|
||||||
|
if(this.particleAge++ >= this.particleMaxAge) {
|
||||||
|
this.setDead();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getFXLayer() {
|
||||||
|
return 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void renderParticle(Tessellator tess, float interp, float x, float y, float z, float tx, float tz) {
|
||||||
|
|
||||||
|
double pX = this.prevPosX + (this.posX - this.prevPosX) * (double) interp - interpPosX;
|
||||||
|
double pY = this.prevPosY + (this.posY - this.prevPosY) * (double) interp - interpPosY;
|
||||||
|
double pZ = this.prevPosZ + (this.posZ - this.prevPosZ) * (double) interp - interpPosZ;
|
||||||
|
|
||||||
|
double mX = pX + motionX;
|
||||||
|
double mY = pY + motionY;
|
||||||
|
double mZ = pZ + motionZ;
|
||||||
|
|
||||||
|
GL11.glPushMatrix();
|
||||||
|
GL11.glDisable(GL11.GL_COLOR_MATERIAL);
|
||||||
|
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||||
|
GL11.glDisable(GL11.GL_LIGHTING);
|
||||||
|
GL11.glEnable(GL11.GL_POINT_SMOOTH);
|
||||||
|
GL11.glEnable(GL11.GL_BLEND);
|
||||||
|
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||||
|
GL11.glBlendFunc(GL11.GL_SRC_ALPHA,GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||||
|
|
||||||
|
tess.startDrawing(GL11.GL_LINES);
|
||||||
|
tess.setBrightness((int) (240 - (240 * (this.particleAge + interp) / this.particleMaxAge)));
|
||||||
|
tess.setColorOpaque_I(color);
|
||||||
|
tess.addVertex(pX, pY, pZ);
|
||||||
|
tess.addVertex(mX, mY, mZ);
|
||||||
|
tess.draw();
|
||||||
|
|
||||||
|
GL11.glEnable(GL11.GL_COLOR_MATERIAL);
|
||||||
|
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||||
|
GL11.glDisable(GL11.GL_POINT_SMOOTH);
|
||||||
|
GL11.glDisable(GL11.GL_BLEND);
|
||||||
|
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||||
|
GL11.glPopMatrix();
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user