diff --git a/changelog b/changelog index 51f7bb159..aea9ce396 100644 --- a/changelog +++ b/changelog @@ -26,10 +26,13 @@ * Due to complaints, the MOX recipe was now made more expensive * Manual control rods now have the `extendrods` command, which allows the target setting to be adjusted without using an absolute value * Removed the legacy relay structure +* Placing RBMK fuel rods in the fuel channels by right click no longer consumes the item in creative mode ## Fixed * Fixed some damage categories not applying correctly, causing things like general energy resistance to not work against lasers * Fixed RoR components not being able to be attached to the top of reasim fuel rods * Fixed a crash in multiplayer regarding RBMK control rods * Fixed outdated QMAW description of some RBMK parts -* Fixed log spam when placing down a RoR controller \ No newline at end of file +* Fixed log spam when placing down a RoR controller +* Fixed the RBMK fuel crane being all jittery and awful +* Fixed RoR reader sending the xenon value on RBMK fuel rods that's 100x the intended value diff --git a/gradle.properties b/gradle.properties index 2a8110c95..cdef06045 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ mod_version=1.0.27 # Empty build number makes a release type -mod_build_number=5629 +mod_build_number=5634 credits=HbMinecraft,\ \ rodolphito (explosion algorithms),\ diff --git a/src/main/java/com/hbm/blocks/machine/rbmk/RBMKRod.java b/src/main/java/com/hbm/blocks/machine/rbmk/RBMKRod.java index aecc4318d..fb1093b42 100644 --- a/src/main/java/com/hbm/blocks/machine/rbmk/RBMKRod.java +++ b/src/main/java/com/hbm/blocks/machine/rbmk/RBMKRod.java @@ -82,7 +82,7 @@ public class RBMKRod extends RBMKBase { if(player.getHeldItem() != null && player.getHeldItem().getItem() instanceof ItemRBMKRod && rbmk.slots[0] == null) { rbmk.slots[0] = player.getHeldItem().copy(); rbmk.slots[0].stackSize = 1; - player.getHeldItem().stackSize--; + if(!player.capabilities.isCreativeMode) player.getHeldItem().stackSize--; world.playSoundEffect(x + 0.5, y + 0.5, z + 0.5, "hbm:item.upgradePlug", 1.0F, 1.0F); return false; } diff --git a/src/main/java/com/hbm/inventory/container/ContainerRBMKRod.java b/src/main/java/com/hbm/inventory/container/ContainerRBMKRod.java index a8a7d1533..b00410ac8 100644 --- a/src/main/java/com/hbm/inventory/container/ContainerRBMKRod.java +++ b/src/main/java/com/hbm/inventory/container/ContainerRBMKRod.java @@ -58,7 +58,7 @@ public class ContainerRBMKRod extends Container { var3 = var5.copy(); if(par2 <= rbmk.getSizeInventory() - 1) { - if(!rbmk.coldEnoughForManual()) return null; + if(!rbmk.coldEnoughForManual() && !player.capabilities.isCreativeMode) return null; if(!this.mergeItemStack(var5, rbmk.getSizeInventory(), this.inventorySlots.size(), true)) { return null; } diff --git a/src/main/java/com/hbm/lib/RefStrings.java b/src/main/java/com/hbm/lib/RefStrings.java index 35c0c0d8c..91949874c 100644 --- a/src/main/java/com/hbm/lib/RefStrings.java +++ b/src/main/java/com/hbm/lib/RefStrings.java @@ -3,7 +3,7 @@ package com.hbm.lib; public class RefStrings { public static final String MODID = "hbm"; public static final String NAME = "Hbm's Nuclear Tech Mod"; - public static final String VERSION = "1.0.27 BETA (5629)"; + public static final String VERSION = "1.0.27 BETA (5634)"; //HBM's Beta Naming Convention: //V T (X) //V -> next release version diff --git a/src/main/java/com/hbm/render/tileentity/RenderRBMKConsole.java b/src/main/java/com/hbm/render/tileentity/RenderRBMKConsole.java index 8360fc6ec..756aa56f5 100644 --- a/src/main/java/com/hbm/render/tileentity/RenderRBMKConsole.java +++ b/src/main/java/com/hbm/render/tileentity/RenderRBMKConsole.java @@ -73,6 +73,8 @@ public class RenderRBMKConsole extends TileEntitySpecialRenderer { double color = 0.65D + (i % 2) * 0.05D; tess.setColorOpaque_F((float) (color + ((1 - color) * heat)), (float) color, (float) color); } + + if(col.data.getByte("indicator") > 0) tess.setColorOpaque_F(1F, 1F, 0F); drawColumn(tess, kx, ky, kz, 0, 0); diff --git a/src/main/java/com/hbm/render/tileentity/RenderRBMKDisplay.java b/src/main/java/com/hbm/render/tileentity/RenderRBMKDisplay.java index 676e106f8..b10020828 100644 --- a/src/main/java/com/hbm/render/tileentity/RenderRBMKDisplay.java +++ b/src/main/java/com/hbm/render/tileentity/RenderRBMKDisplay.java @@ -61,6 +61,8 @@ public class RenderRBMKDisplay extends TileEntitySpecialRenderer { tess.setColorOpaque_F((float) (color + ((1 - color) * heat)), (float) color, (float) color); } + if(col.data.getByte("indicator") > 0) tess.setColorOpaque_F(1F, 1F, 0F); + drawColumn(tess, kx, ky, kz); switch(col.type) { diff --git a/src/main/java/com/hbm/render/tileentity/RenderRBMKGauge.java b/src/main/java/com/hbm/render/tileentity/RenderRBMKGauge.java index 5f70f03a6..398502319 100644 --- a/src/main/java/com/hbm/render/tileentity/RenderRBMKGauge.java +++ b/src/main/java/com/hbm/render/tileentity/RenderRBMKGauge.java @@ -46,11 +46,12 @@ public class RenderRBMKGauge extends TileEntitySpecialRenderer { GL11.glPushMatrix(); GL11.glColor3f(ColorUtil.fr(unit.color), ColorUtil.fg(unit.color), ColorUtil.fb(unit.color)); + double value = unit.lastRenderValue + (unit.renderValue - unit.lastRenderValue) * interp; int lower = Math.min(unit.min, unit.max); int upper = Math.max(unit.min, unit.max); if(lower == upper) upper += 1; int range = upper - lower; - double angle = (double) (unit.value - lower) / (double) range * 50D; + double angle = (double) (value - lower) / (double) range * 50D; if(unit.min > unit.max) angle = 50 - angle; angle = MathHelper.clamp_double(angle, 0, 80); diff --git a/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityCraneConsole.java b/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityCraneConsole.java index 2c3b4ebb4..56baaa762 100644 --- a/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityCraneConsole.java +++ b/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityCraneConsole.java @@ -52,16 +52,21 @@ public class TileEntityCraneConsole extends TileEntityLoadedBase implements Simp public double lastPosLeft = 0; public double posFront = 0; public double posLeft = 0; + public double syncFront = 0; + public double syncLeft = 0; private static final double speed = 0.05D; private boolean goesDown = false; public double lastProgress = 1D; public double progress = 1D; + public double syncProgress = 1D; private ItemStack loadedItem; private boolean hasLoaded = false; public double loadedHeat; public double loadedEnrichment; + + private int turnProgress; @Override public void updateEntity() { @@ -69,38 +74,58 @@ public class TileEntityCraneConsole extends TileEntityLoadedBase implements Simp if(worldObj.isRemote) { lastTiltFront = tiltFront; lastTiltLeft = tiltLeft; - } + + lastPosFront = posFront; + lastPosLeft = posLeft; + lastProgress = progress; - if(goesDown) { - - if(progress > 0) { - progress -= 0.04D; + if(this.turnProgress > 0) { + this.posFront = this.posFront + ((this.syncFront - this.posFront) / (double) this.turnProgress); + this.posLeft = this.posLeft + ((this.syncLeft - this.posLeft) / (double) this.turnProgress); + this.progress = this.progress + ((this.syncProgress - this.progress) / (double) this.turnProgress); + --this.turnProgress; } else { - progress = 0; - goesDown = false; - - if(!worldObj.isRemote && this.canTargetInteract()) { - IRBMKLoadable column = getColumnAtPos(); - if(column != null) { // canTargetInteract already assumes this, but there seems to be some freak race conditions that cause the column to be null anyway - if(this.loadedItem != null) { - column.load(this.loadedItem); - this.loadedItem = null; - } else { - this.loadedItem = column.provideNext(); - column.unload(); - } - - this.markDirty(); - } - } - + this.posFront = this.syncFront; + this.posLeft = this.syncLeft; + this.progress = this.syncProgress; } - } else if(progress != 1) { + } + + if(!worldObj.isRemote) { + TileEntityRBMKBase aboveColumn = this.getColumnAtPos(); + if(aboveColumn != null) aboveColumn.craneIndicator = 10; + + if(goesDown) { + + if(progress > 0) { + progress -= 0.04D; + } else { + progress = 0; + goesDown = false; + + if(aboveColumn instanceof IRBMKLoadable && this.canTargetInteract((IRBMKLoadable) aboveColumn)) { + IRBMKLoadable column = (IRBMKLoadable) aboveColumn; + if(column != null) { // canTargetInteract already assumes this, but there seems to be some freak race conditions that cause the column to be null anyway + if(this.loadedItem != null) { + column.load(this.loadedItem); + this.loadedItem = null; + } else { + this.loadedItem = column.provideNext(); + column.unload(); + } - progress += 0.04D; - - if(progress > 1D) { - progress = 1D; + this.markDirty(); + } + } + + } + } else if(progress != 1) { + + progress += 0.04D; + + if(progress > 1D) { + progress = 1D; + } } } @@ -181,12 +206,10 @@ public class TileEntityCraneConsole extends TileEntityLoadedBase implements Simp } public boolean isAboveValidTarget() { - return getColumnAtPos() != null; + return getLoadableAtPos() != null; } - public boolean canTargetInteract() { - - IRBMKLoadable column = getColumnAtPos(); + public boolean canTargetInteract(IRBMKLoadable column) { if(column == null) return false; @@ -198,7 +221,7 @@ public class TileEntityCraneConsole extends TileEntityLoadedBase implements Simp } } - public IRBMKLoadable getColumnAtPos() { + public TileEntityRBMKBase getColumnAtPos() { ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset); ForgeDirection left = dir.getRotation(ForgeDirection.DOWN); @@ -214,15 +237,19 @@ public class TileEntityCraneConsole extends TileEntityLoadedBase implements Simp int[] pos = ((BlockDummyable)b).findCore(worldObj, x, y, z); if(pos != null) { TileEntityRBMKBase column = (TileEntityRBMKBase)worldObj.getTileEntity(pos[0], pos[1], pos[2]); - if(column instanceof IRBMKLoadable) { - return (IRBMKLoadable) column; - } + return column; } } return null; } + public IRBMKLoadable getLoadableAtPos() { + TileEntityRBMKBase column = this.getColumnAtPos(); + if(column instanceof IRBMKLoadable) return (IRBMKLoadable) column; + return null; + } + @Override public void serialize(ByteBuf buf) { buf.writeBoolean(this.setUpCrane); @@ -239,6 +266,7 @@ public class TileEntityCraneConsole extends TileEntityLoadedBase implements Simp buf.writeInt(this.height); buf.writeDouble(this.posFront); buf.writeDouble(this.posLeft); + buf.writeDouble(this.progress); buf.writeBoolean(this.hasItemLoaded()); buf.writeDouble(this.loadedHeat); buf.writeDouble(this.loadedEnrichment); @@ -247,10 +275,6 @@ public class TileEntityCraneConsole extends TileEntityLoadedBase implements Simp @Override public void deserialize(ByteBuf buf) { - lastPosFront = posFront; - lastPosLeft = posLeft; - lastProgress = progress; - this.setUpCrane = buf.readBoolean(); if (this.setUpCrane) { this.craneRotationOffset = buf.readInt(); @@ -262,8 +286,9 @@ public class TileEntityCraneConsole extends TileEntityLoadedBase implements Simp this.spanL = buf.readInt(); this.spanR = buf.readInt(); this.height = buf.readInt(); - this.posFront = buf.readDouble(); - this.posLeft = buf.readDouble(); + this.syncFront = buf.readDouble(); + this.syncLeft = buf.readDouble(); + this.syncProgress = buf.readDouble(); this.hasLoaded = buf.readBoolean(); this.loadedHeat = buf.readDouble(); this.loadedEnrichment = buf.readDouble(); diff --git a/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKBase.java b/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKBase.java index 5394ac98b..cf69af51f 100644 --- a/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKBase.java +++ b/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKBase.java @@ -56,6 +56,7 @@ public abstract class TileEntityRBMKBase extends TileEntityLoadedBase { public static final int maxWater = 16000; public int reasimSteam; public static final int maxSteam = 16000; + public int craneIndicator; public static boolean explodeOnBroken = true; @@ -105,6 +106,8 @@ public abstract class TileEntityRBMKBase extends TileEntityLoadedBase { public void updateEntity() { if(!worldObj.isRemote) { + + if(this.craneIndicator > 0) this.craneIndicator--; this.worldObj.theProfiler.startSection("rbmkBase_heat_movement"); moveHeat(); @@ -288,6 +291,7 @@ public abstract class TileEntityRBMKBase extends TileEntityLoadedBase { buf.writeDouble(this.heat); buf.writeInt(this.reasimWater); buf.writeInt(this.reasimSteam); + buf.writeByte((byte) this.craneIndicator); } @Override @@ -295,6 +299,7 @@ public abstract class TileEntityRBMKBase extends TileEntityLoadedBase { this.heat = buf.readDouble(); this.reasimWater = buf.readInt(); this.reasimSteam = buf.readInt(); + this.craneIndicator = buf.readByte(); } public void getDiagData(NBTTagCompound nbt) { diff --git a/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKConsole.java b/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKConsole.java index 3f939388f..bf0478120 100644 --- a/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKConsole.java +++ b/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKConsole.java @@ -100,6 +100,7 @@ public class TileEntityRBMKConsole extends TileEntityMachineBase implements ICon columns[index] = new RBMKColumn(rbmk.getConsoleType(), rbmk.getNBTForConsole()); columns[index].data.setDouble("heat", rbmk.heat); columns[index].data.setDouble("maxHeat", rbmk.maxHeat()); + columns[index].data.setByte("indicator", (byte) rbmk.craneIndicator); if(rbmk.isModerated()) columns[index].data.setBoolean("moderated", true); //false is the default anyway and not setting it when we don't need to reduces cruft if(te instanceof TileEntityRBMKRod) { @@ -136,8 +137,7 @@ public class TileEntityRBMKConsole extends TileEntityMachineBase implements ICon RBMKColumn col = this.columns[i]; - if(col == null) - continue; + if(col == null) continue; switch(screen.type) { case COL_TEMP: diff --git a/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKDisplay.java b/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKDisplay.java index 6349419d0..5c0d5ac20 100644 --- a/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKDisplay.java +++ b/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKDisplay.java @@ -76,11 +76,12 @@ public class TileEntityRBMKDisplay extends TileEntityLoadedBase { if(te instanceof TileEntityRBMKBase) { - TileEntityRBMKBase rbmk = (TileEntityRBMKBase)te; + TileEntityRBMKBase rbmk = (TileEntityRBMKBase) te; columns[index] = new RBMKColumn(rbmk.getConsoleType(), rbmk.getNBTForConsole()); columns[index].data.setDouble("heat", rbmk.heat); columns[index].data.setDouble("maxHeat", rbmk.maxHeat()); + columns[index].data.setByte("indicator", (byte) rbmk.craneIndicator); if(te instanceof TileEntityRBMKControlManual) { TileEntityRBMKControlManual control = (TileEntityRBMKControlManual) te; diff --git a/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKGauge.java b/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKGauge.java index 96ce98b75..496b3571c 100644 --- a/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKGauge.java +++ b/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKGauge.java @@ -41,6 +41,9 @@ public class TileEntityRBMKGauge extends TileEntityLoadedBase implements IGUIPro for(int i = 0; i < 4; i++) this.gauges[i].update(); this.networkPackNT(50); + } else { + + for(int i = 0; i < 4; i++) this.gauges[i].updateClient(); } } @@ -86,6 +89,9 @@ public class TileEntityRBMKGauge extends TileEntityLoadedBase implements IGUIPro public int max = 100; /** The current read value of the gauge, i.e. the needle position */ public int value; + /** For smoothig */ + public double renderValue; + public double lastRenderValue; /** Whether this gauge is visible on the panel */ public boolean active; @@ -97,6 +103,12 @@ public class TileEntityRBMKGauge extends TileEntityLoadedBase implements IGUIPro label = "Gauge " + (initialIndex + 1); } + public void updateClient() { + this.lastRenderValue = this.renderValue; + double delta = value - renderValue; + this.renderValue += delta * 0.1D; + } + public void update() { if(!active) return; if(rtty == null || rtty.isEmpty()) return; diff --git a/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKRod.java b/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKRod.java index 550ccfbef..3c4c2a232 100644 --- a/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKRod.java +++ b/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKRod.java @@ -562,7 +562,7 @@ public class TileEntityRBMKRod extends TileEntityRBMKSlottedBase implements IRBM if(slots[0] != null && slots[0].getItem() instanceof ItemRBMKRod) { if((PREFIX_VALUE + "rodheat").equals(name)) return "" + (int) ItemRBMKRod.getHullHeat(slots[0]); if((PREFIX_VALUE + "depletion").equals(name)) return "" + (int) (100 - ItemRBMKRod.getEnrichment(slots[0]) * 100); - if((PREFIX_VALUE + "xenon").equals(name)) return "" + (int) (ItemRBMKRod.getPoison(slots[0]) * 100); + if((PREFIX_VALUE + "xenon").equals(name)) return "" + (int) (ItemRBMKRod.getPoison(slots[0])); } return null; }