more shit

This commit is contained in:
BallOfEnergy 2024-09-01 19:55:49 -05:00
parent 5a06075a9c
commit 8b5bfda162
3 changed files with 19 additions and 26 deletions

View File

@ -10,6 +10,7 @@ import java.util.List;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map.Entry; import java.util.Map.Entry;
import net.minecraft.block.Block;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Vec3; import net.minecraft.util.Vec3;
import net.minecraft.world.World; import net.minecraft.world.World;
@ -322,7 +323,7 @@ public class RBMKHandler {
if(!node.hasLid) if(!node.hasLid)
ChunkRadiationManager.proxy.incrementRad(worldObj, nodePos.getX(), nodePos.getY(), nodePos.getZ(), (float) (this.fluxQuantity * 0.05F)); ChunkRadiationManager.proxy.incrementRad(worldObj, nodePos.getX(), nodePos.getY(), nodePos.getZ(), (float) (this.fluxQuantity * 0.05F));
if (node.type == RBMKHandler.RBMKType.MODERATOR || nodeTE.isModerated()) { if (node.type == RBMKType.MODERATOR || nodeTE.isModerated()) {
moderatedCount++; moderatedCount++;
moderateStream(); moderateStream();
} }
@ -330,7 +331,7 @@ public class RBMKHandler {
if (nodeTE instanceof IRBMKFluxReceiver) { if (nodeTE instanceof IRBMKFluxReceiver) {
IRBMKFluxReceiver column = (IRBMKFluxReceiver)nodeTE; IRBMKFluxReceiver column = (IRBMKFluxReceiver)nodeTE;
if (node.type == RBMKHandler.RBMKType.ROD) { if (node.type == RBMKType.ROD) {
TileEntityRBMKRod rod = (TileEntityRBMKRod)column; TileEntityRBMKRod rod = (TileEntityRBMKRod)column;
if (rod.hasRod) { if (rod.hasRod) {
@ -347,7 +348,7 @@ public class RBMKHandler {
} }
} }
} else if (node.type == RBMKHandler.RBMKType.CONTROL_ROD) { } else if (node.type == RBMKType.CONTROL_ROD) {
TileEntityRBMKControl rod = (TileEntityRBMKControl) nodeTE; TileEntityRBMKControl rod = (TileEntityRBMKControl) nodeTE;
if (rod.level > 0.0D) { if (rod.level > 0.0D) {
@ -356,7 +357,7 @@ public class RBMKHandler {
continue; continue;
} }
return; return;
} else if (node.type == RBMKHandler.RBMKType.REFLECTOR) { } else if (node.type == RBMKType.REFLECTOR) {
if (this.origin.tile.isModerated()) if (this.origin.tile.isModerated())
moderatedCount++; moderatedCount++;
@ -372,7 +373,7 @@ public class RBMKHandler {
((TileEntityRBMKRod)originTE).receiveFlux(this); ((TileEntityRBMKRod)originTE).receiveFlux(this);
return; return;
} else if (node.type == RBMKHandler.RBMKType.ABSORBER) { } else if (node.type == RBMKType.ABSORBER) {
if (RBMKHandler.absorberEfficiency == 1) if (RBMKHandler.absorberEfficiency == 1)
return; return;
@ -380,16 +381,16 @@ public class RBMKHandler {
} }
} }
List<RBMKHandler.RBMKNode> nodes = getNodes(true); List<RBMKNode> nodes = getNodes(true);
if (nodes.isEmpty()) if (nodes.isEmpty())
return; return;
RBMKHandler.RBMKNode lastNode = nodes.get(nodes.size() - 1); RBMKNode lastNode = nodes.get(nodes.size() - 1);
if (lastNode.type != RBMKHandler.RBMKType.REFLECTOR && lastNode.type != RBMKHandler.RBMKType.ABSORBER && lastNode.type != RBMKHandler.RBMKType.CONTROL_ROD) if (lastNode.type != RBMKType.REFLECTOR && lastNode.type != RBMKType.ABSORBER && lastNode.type != RBMKType.CONTROL_ROD)
irradiateFromFlux((new BlockPos(lastNode.tile)).add(this.vector.xCoord, 0.0D, this.vector.zCoord)); irradiateFromFlux((new BlockPos(lastNode.tile)).add(this.vector.xCoord, 0.0D, this.vector.zCoord));
if (lastNode.type == RBMKHandler.RBMKType.CONTROL_ROD) { if (lastNode.type == RBMKType.CONTROL_ROD) {
TileEntityRBMKControl rod = (TileEntityRBMKControl)lastNode.tile; TileEntityRBMKControl rod = (TileEntityRBMKControl)lastNode.tile;
if (rod.getMult() > 0.0D) { if (rod.getMult() > 0.0D) {
this.fluxQuantity *= rod.getMult(); this.fluxQuantity *= rod.getMult();
@ -405,8 +406,9 @@ public class RBMKHandler {
// holy fucking shit // holy fucking shit
// I have had this one line cause me like tens of problems // I have had this one line cause me like tens of problems
// I FUCKING HATE THIS // I FUCKING HATE THIS
// total count of bugs fixed attributed to this function: 11 // total count of bugs fixed attributed to this function: 13
if (origin.tile.getWorldObj().getBlock(pos.getX(), pos.getY() + h, pos.getZ()).isOpaqueCube()) Block block = origin.tile.getWorldObj().getBlock(pos.getX(), pos.getY() + h, pos.getZ());
if (block.isOpaqueCube())
hits += 1; hits += 1;
} }

View File

@ -325,6 +325,7 @@ public abstract class TileEntityRBMKBase extends TileEntityLoadedBase implements
exceptions.add("z"); exceptions.add("z");
exceptions.add("items"); exceptions.add("items");
exceptions.add("id"); exceptions.add("id");
exceptions.add("muffled");
String title = "Dump of Ordered Data Diagnostic (DODD)"; String title = "Dump of Ordered Data Diagnostic (DODD)";
mc.fontRenderer.drawString(title, pX + 1, pZ - 19, 0x006000); mc.fontRenderer.drawString(title, pX + 1, pZ - 19, 0x006000);

View File

@ -212,9 +212,6 @@ public class TileEntityRBMKRod extends TileEntityRBMKSlottedBase implements IRBM
this.fluxRatio = nbt.getDouble("fluxFast") / fluxQuantity; this.fluxRatio = nbt.getDouble("fluxFast") / fluxQuantity;
else else
this.fluxRatio = 0; this.fluxRatio = 0;
nbt.removeTag("fluxSlow");
nbt.removeTag("fluxFast");
writeToNBT(nbt);
} else { } else {
this.fluxQuantity = nbt.getDouble("fluxQuantity"); this.fluxQuantity = nbt.getDouble("fluxQuantity");
this.fluxRatio = nbt.getDouble("fluxRatio"); this.fluxRatio = nbt.getDouble("fluxRatio");
@ -225,17 +222,8 @@ public class TileEntityRBMKRod extends TileEntityRBMKSlottedBase implements IRBM
public void writeToNBT(NBTTagCompound nbt) { public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt); super.writeToNBT(nbt);
nbt.setDouble("fluxQuantity", this.lastFluxQuantity); nbt.setDouble("fluxSlow", this.lastFluxQuantity * (1 - fluxRatio));
nbt.setDouble("fluxRatio", this.fluxRatio); nbt.setDouble("fluxFast", this.lastFluxQuantity * fluxRatio);
nbt.setBoolean("hasRod", this.hasRod);
}
// aaaaaaa
public void writeToNBTDiag(NBTTagCompound nbt) {
super.writeToNBT(nbt);
nbt.setDouble("fluxQuantity", this.fluxQuantity);
nbt.setDouble("fluxRatio", this.fluxRatio);
nbt.setBoolean("hasRod", this.hasRod); nbt.setBoolean("hasRod", this.hasRod);
} }
@ -256,7 +244,9 @@ public class TileEntityRBMKRod extends TileEntityRBMKSlottedBase implements IRBM
} }
public void getDiagData(NBTTagCompound nbt) { public void getDiagData(NBTTagCompound nbt) {
this.writeToNBTDiag(nbt); diag = true;
this.writeToNBT(nbt);
diag = false;
if(slots[0] != null && slots[0].getItem() instanceof ItemRBMKRod) { if(slots[0] != null && slots[0].getItem() instanceof ItemRBMKRod) {