From 853bc8850b1c56825375b5cecd8db6d43347e881 Mon Sep 17 00:00:00 2001 From: Alcater Date: Wed, 26 Apr 2023 21:21:53 +0200 Subject: [PATCH] Version 1.9.4 Release: RBMK Console Changed Stacksize of fuse and heat element to 16 Fixed Silo rotation Fixed RBMK Steam Channel Capacity Fixed Digamma Diagnostic Coords --- src/main/java/com/hbm/items/ModItems.java | 4 +- src/main/java/com/hbm/lib/RefStrings.java | 4 +- .../java/com/hbm/main/ModEventHandler.java | 2 +- .../hbm/render/misc/RenderScreenOverlay.java | 2 +- .../render/tileentity/RenderSiloHatch.java | 10 ++-- .../hbm/tileentity/TileEntityDoorGeneric.java | 38 +++++++++--- .../machine/TileEntityBlastDoor.java | 32 ++++++---- .../machine/TileEntitySiloHatch.java | 29 ++++++++-- .../machine/TileEntityVaultDoor.java | 58 +++++++++---------- .../machine/rbmk/TileEntityRBMKBoiler.java | 6 +- 10 files changed, 115 insertions(+), 70 deletions(-) diff --git a/src/main/java/com/hbm/items/ModItems.java b/src/main/java/com/hbm/items/ModItems.java index 0689dd1df6..561169f03f 100644 --- a/src/main/java/com/hbm/items/ModItems.java +++ b/src/main/java/com/hbm/items/ModItems.java @@ -448,7 +448,7 @@ public class ModItems { public static final Item blades_schrabidium = new ItemBlades("blades_schrabidium", 250); public static final Item blades_desh = new ItemBlades("blades_desh", 0).setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab); - public static final Item fuse = new ItemCustomLore("fuse").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab); + public static final Item fuse = new ItemCustomLore("fuse").setMaxStackSize(16).setCreativeTab(MainRegistry.controlTab); public static final Item screwdriver = new ItemTooling(ToolType.SCREWDRIVER, 100, "screwdriver"); public static final Item hand_drill = new ItemTooling(ToolType.HAND_DRILL, 100, "hand_drill"); public static final Item redcoil_capacitor = new ItemCapacitor(10, "redcoil_capacitor").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab); @@ -460,7 +460,7 @@ public class ModItems { public static final Item bismuth_tool = new ItemAmatExtractor("bismuth_tool").setMaxStackSize(1).setFull3D().setCreativeTab(MainRegistry.controlTab); public static final Item overfuse = new ItemCustomLore("overfuse").setMaxStackSize(1).setFull3D(); public static final Item piston_selenium = new ItemBase("piston_selenium").setCreativeTab(MainRegistry.controlTab).setMaxStackSize(1); - public static final Item thermo_element = new ItemBase("thermo_element").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab); + public static final Item thermo_element = new ItemBase("thermo_element").setMaxStackSize(16).setCreativeTab(MainRegistry.controlTab); public static final Item antiknock = new ItemBase("antiknock").setCreativeTab(MainRegistry.controlTab); public static final Item part_lithium = new ItemBase("part_lithium").setCreativeTab(MainRegistry.controlTab); public static final Item part_beryllium = new ItemBase("part_beryllium").setCreativeTab(MainRegistry.controlTab); diff --git a/src/main/java/com/hbm/lib/RefStrings.java b/src/main/java/com/hbm/lib/RefStrings.java index 9b936a7b0d..e1d8c82c81 100644 --- a/src/main/java/com/hbm/lib/RefStrings.java +++ b/src/main/java/com/hbm/lib/RefStrings.java @@ -3,8 +3,8 @@ public class RefStrings { public static final String MODID = "hbm"; public static final String NAME = "Hbm's Nuclear Tech - Extended Edition"; - public static final String VERSION = "NTM-Extended-1.12.2-1.9.3-d"; - public static final String CHANGELOG = "$§2Added Colorable FEnSU$§3Changed Crystalizer texture$§3Changed Vortex Gun texture$§6Fixed Sellaline Bedrock Flood$§6Fixed Geiger Sounds"; + public static final String VERSION = "NTM-Extended-1.12.2-1.9.4"; + public static final String CHANGELOG = "$§2Added RBMk Lid jumping$§2Added RBMK Console Upgrade$§2Added Craftweaker Support$§2Added changelog print config$§2Added Geiger gui position config$§2Added Performance optimizations$§2Added Gradients to Fallout$§2Added acceleration to missiles$§2Added rocket sounds to missiles$§2Added ItemContam Rad threshold of 5 RAD/s$§3Changed PAA armor color to white$§3Changed Doors to be open on redstone signal$§3Changed WasteLeaves to be actual leaves$§6Fixed Gas moving lag$§6Fixed DFC Fuel balance$§6Fixed assembler recipe found$§6Fixed too long mushroom clouds$§6Fixed Gas and Explosive Gas Spawning$§6Fixed Crystallizer fluid acceptance$§6Fixed rocket exaust culling issues"; //HBM's Beta Naming Convention: //V T (X) //V -> next release version diff --git a/src/main/java/com/hbm/main/ModEventHandler.java b/src/main/java/com/hbm/main/ModEventHandler.java index 706c347b8c..15a5c25896 100644 --- a/src/main/java/com/hbm/main/ModEventHandler.java +++ b/src/main/java/com/hbm/main/ModEventHandler.java @@ -1200,7 +1200,7 @@ public void clientJoinServer(PlayerLoggedInEvent e) { } if(HTTPHandler.newVersion && GeneralConfig.changelog) { - e.player.sendMessage(new TextComponentString("§eNICE - §aNew§e version §3" + HTTPHandler.versionNumber + "§e is available§r")); + e.player.sendMessage(new TextComponentString("§aNew§e version §3" + HTTPHandler.versionNumber + "§e is available§r")); e.player.sendMessage(new TextComponentString("§ePlaying on version §7" + RefStrings.VERSION + "§e right now§r")); if(HTTPHandler.changes != ""){ String[] lines = HTTPHandler.changes.split("\\$"); diff --git a/src/main/java/com/hbm/render/misc/RenderScreenOverlay.java b/src/main/java/com/hbm/render/misc/RenderScreenOverlay.java index b9c48a55de..62de229cb9 100644 --- a/src/main/java/com/hbm/render/misc/RenderScreenOverlay.java +++ b/src/main/java/com/hbm/render/misc/RenderScreenOverlay.java @@ -123,7 +123,7 @@ public static void renderDigCounter(ScaledResolution resolution, float in, Gui g // bar -= (1 + Minecraft.getMinecraft().theWorld.rand.nextInt(3)); int posX = RadiationConfig.digammaX; - int posY = resolution.getScaledHeight() - 36 - RadiationConfig.digammaY; + int posY = resolution.getScaledHeight() - 18 - RadiationConfig.digammaY; Minecraft.getMinecraft().renderEngine.bindTexture(misc); gui.drawTexturedModalRect(posX, posY, 0, 218, 94, 18); diff --git a/src/main/java/com/hbm/render/tileentity/RenderSiloHatch.java b/src/main/java/com/hbm/render/tileentity/RenderSiloHatch.java index a30a0539f6..68ea5313e1 100644 --- a/src/main/java/com/hbm/render/tileentity/RenderSiloHatch.java +++ b/src/main/java/com/hbm/render/tileentity/RenderSiloHatch.java @@ -23,12 +23,12 @@ public void render(TileEntitySiloHatch te, double x, double y, double z, float p GL11.glPushMatrix(); GL11.glTranslated(x+0.5, y+0.595, z+0.5); switch(te.getBlockMetadata()-2) { - case 0: GL11.glRotatef(90, 0F, 1F, 0F); break; - case 1: GL11.glRotatef(270, 0F, 1F, 0F); break; - case 2: GL11.glRotatef(180, 0F, 1F, 0F); break; - case 3: GL11.glRotatef(0, 0F, 1F, 0F); break; + case 0: GL11.glRotatef(270, 0F, 1F, 0F); break; + case 1: GL11.glRotatef(90, 0F, 1F, 0F); break; + case 2: GL11.glRotatef(0, 0F, 1F, 0F); break; + case 3: GL11.glRotatef(180, 0F, 1F, 0F); break; } - GL11.glTranslated(-3, 0, 0); + GL11.glTranslated(3, 0, 0); GlStateManager.enableLighting(); GlStateManager.shadeModel(GL11.GL_SMOOTH); bindTexture(ResourceManager.hatch_tex); diff --git a/src/main/java/com/hbm/tileentity/TileEntityDoorGeneric.java b/src/main/java/com/hbm/tileentity/TileEntityDoorGeneric.java index dd8144bb26..448bc89354 100644 --- a/src/main/java/com/hbm/tileentity/TileEntityDoorGeneric.java +++ b/src/main/java/com/hbm/tileentity/TileEntityDoorGeneric.java @@ -62,9 +62,7 @@ public void update(){ } } - if(world.isRemote) { - - } else { + if(!world.isRemote) { int[][] ranges = doorType.getDoorOpenRanges(); ForgeDirection dir = ForgeDirection.getOrientation(getBlockMetadata() - BlockDummyable.offset); if(state == 3) { @@ -144,10 +142,10 @@ public void update(){ } PacketDispatcher.wrapper.sendToAllAround(new TEDoorAnimationPacket(pos, state, (byte)(shouldUseBB ? 1 : 0)), new TargetPoint(world.provider.getDimension(), pos.getX(), pos.getY(), pos.getZ(), 100)); - if(redstonePower == -1 && state == 0){ - tryToggle(-1); - } else if(redstonePower > 0 && state == 1){ - tryToggle(-1); + if(redstonePower > 0){ + tryOpen(-1); + } else { + tryClose(-1); } if(redstonePower == -1){ redstonePower = 0; @@ -202,6 +200,19 @@ public boolean tryToggle(EntityPlayer player){ return false; } + public boolean tryOpen(int passcode){ + if(this.isLocked() && passcode != this.lock) + return false; + if(this.state == 0) { + if(!world.isRemote) { + this.state = 3; + broadcastControlEvt(); + } + return true; + } + return false; + } + public boolean tryToggle(int passcode){ if(this.isLocked() && passcode != this.lock) return false; @@ -221,6 +232,19 @@ public boolean tryToggle(int passcode){ return false; } + public boolean tryClose(int passcode){ + if(this.isLocked() && passcode != this.lock) + return false; + if(this.state == 1) { + if(!world.isRemote) { + this.state = 2; + broadcastControlEvt(); + } + return true; + } + return false; + } + @Override public void open(){ if(state == 0) diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityBlastDoor.java b/src/main/java/com/hbm/tileentity/machine/TileEntityBlastDoor.java index 19d1448073..7ee0203355 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityBlastDoor.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityBlastDoor.java @@ -32,7 +32,6 @@ public class TileEntityBlastDoor extends TileEntityLockableBase implements ITick public int state = 0; public long sysTime; private int timer = 0; - public boolean redstoned = false; @Override public AxisAlignedBB getRenderBoundingBox() { @@ -50,15 +49,13 @@ public double getMaxRenderDistanceSquared() public void update() { if(!world.isRemote) { - if(!isLocked() && world.isBlockIndirectlyGettingPowered(pos) > 0 || world.isBlockIndirectlyGettingPowered(pos.up(6)) > 0) { + if(!isLocked()) { - if(!redstoned) { - this.tryToggle(); + if(world.isBlockIndirectlyGettingPowered(pos) > 0 || world.isBlockIndirectlyGettingPowered(pos.up(6)) > 0) { + this.tryOpen(); + } else { + this.tryClose(); } - redstoned = true; - - } else { - redstoned = false; } if(state != 1) { @@ -118,6 +115,7 @@ public void open() { PacketDispatcher.wrapper.sendToAllTracking(new TEVaultPacket(pos.getX(), pos.getY(), pos.getZ(), isOpening, state, 1, 0), new TargetPoint(world.provider.getDimension(), pos.getX(), pos.getY(), pos.getZ(), 150)); isOpening = true; state = 1; + timer = 0; broadcastControlEvt(); this.world.playSound(null, pos.getX(), pos.getY(), pos.getZ(), HBMSoundHandler.reactorStart, SoundCategory.BLOCKS, 0.5F, 0.75F); } @@ -136,6 +134,7 @@ public void close() { isOpening = false; state = 1; + timer = 0; broadcastControlEvt(); this.world.playSound(null, pos.getX(), pos.getY(), pos.getZ(), HBMSoundHandler.reactorStart, SoundCategory.BLOCKS, 0.5F, 0.75F); } @@ -289,6 +288,13 @@ public boolean canClose() { return state == 2; } + public void tryOpen() { + if(canOpen()) { + open(); + openNeigh(); + } + } + public void tryToggle() { if(canOpen()) { open(); @@ -298,6 +304,13 @@ public void tryToggle() { closeNeigh(); } } + + public void tryClose() { + if(canClose()) { + close(); + closeNeigh(); + } + } public boolean placeDummy(BlockPos pos) { @@ -331,7 +344,6 @@ public void readFromNBT(NBTTagCompound compound) { state = compound.getInteger("state"); sysTime = compound.getLong("sysTime"); timer = compound.getInteger("timer"); - redstoned = compound.getBoolean("redstoned"); super.readFromNBT(compound); } @@ -341,7 +353,6 @@ public NBTTagCompound writeToNBT(NBTTagCompound compound) { compound.setInteger("state", state); compound.setLong("sysTime", sysTime); compound.setInteger("timer", timer); - compound.setBoolean("redstoned", redstoned); return super.writeToNBT(compound); } @@ -383,5 +394,4 @@ public BlockPos getControlPos(){ public World getControlWorld(){ return getWorld(); } - } diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntitySiloHatch.java b/src/main/java/com/hbm/tileentity/machine/TileEntitySiloHatch.java index fb76c4761c..7d57c87e6c 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntitySiloHatch.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntitySiloHatch.java @@ -26,7 +26,6 @@ public class TileEntitySiloHatch extends TileEntityLockableBase implements ITick public byte state = 0; public long sysTime; public int timer = -1; - public boolean redstoned = false; public EnumFacing facing = null; public AxisAlignedBB renderBox = null; @@ -35,9 +34,11 @@ public void update() { if(!world.isRemote){ if(!this.isLocked()){ boolean rs = world.isBlockIndirectlyGettingPowered(pos) > 0; - if(rs && !redstoned) - tryToggle(); - redstoned = rs; + if(rs){ + tryOpen(); + } else { + tryClose(); + } } int oldState = state; if(timer < 0) @@ -101,6 +102,24 @@ public void tryToggle() { } } + public void tryOpen() { + if(this.state == 0) { + if(!world.isRemote) { + this.state = 3; + timer = -1; + } + } + } + + public void tryClose() { + if(this.state == 1) { + if(!world.isRemote) { + this.state = 2; + timer = -1; + } + } + } + public boolean placeDummy(BlockPos pos) { if(!world.getBlockState(pos).getBlock().isReplaceable(world, pos)) @@ -129,14 +148,12 @@ public void removeDummy(BlockPos pos) { @Override public void readFromNBT(NBTTagCompound compound) { state = compound.getByte("state"); - redstoned = compound.getBoolean("redstoned"); super.readFromNBT(compound); } @Override public NBTTagCompound writeToNBT(NBTTagCompound compound) { compound.setByte("state", state); - compound.setBoolean("redstoned", redstoned); return super.writeToNBT(compound); } diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityVaultDoor.java b/src/main/java/com/hbm/tileentity/machine/TileEntityVaultDoor.java index 74e2b6bdf2..1422c822cb 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityVaultDoor.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityVaultDoor.java @@ -28,7 +28,6 @@ public class TileEntityVaultDoor extends TileEntityLockableBase implements ITick private int timer = 0; public int type; public static final int maxTypes = 32; - public boolean redstoned = false; @Override public AxisAlignedBB getRenderBoundingBox() { @@ -68,30 +67,16 @@ public void update() { } if(world.getBlockState(pos).getValue(VaultDoor.FACING).getAxis() == Axis.Z) { - if(flagX) { - - if(!redstoned) { - this.tryToggle(); - } - - redstoned = true; - } else { - - redstoned = false; - } - } - if(world.getBlockState(pos).getValue(VaultDoor.FACING).getAxis() == Axis.X) { - if(flagZ) { - - if(!redstoned) { - this.tryToggle(); - } - - redstoned = true; - } else { - - redstoned = false; - } + if(flagX) + this.tryOpen(); + else + this.tryClose(); + + } else if(world.getBlockState(pos).getValue(VaultDoor.FACING).getAxis() == Axis.X) { + if(flagZ) + this.tryOpen(); + else + this.tryClose(); } } @@ -138,7 +123,7 @@ public void update() { if(timer == 80) this.world.playSound(null, pos.getX(), pos.getY(), pos.getZ(), HBMSoundHandler.vaultScrapeNew, SoundCategory.BLOCKS, 1.0F, 1.0F); } - + if(state != 1) { timer = 0; } else { @@ -152,7 +137,6 @@ public void update() { finishClose(); } } - PacketDispatcher.wrapper.sendToAllAround(new TEVaultPacket(pos.getX(), pos.getY(), pos.getZ(), isOpening, state, 0, type), new TargetPoint(world.provider.getDimension(), pos.getX(), pos.getY(), pos.getZ(), 300)); } } @@ -162,7 +146,7 @@ public void open() { PacketDispatcher.wrapper.sendToAllAround(new TEVaultPacket(pos.getX(), pos.getY(), pos.getZ(), isOpening, state, 1, type), new TargetPoint(world.provider.getDimension(), pos.getX(), pos.getY(), pos.getZ(), 300)); isOpening = true; state = 1; - + timer = 0; openHatch(); } } @@ -176,7 +160,7 @@ public void close() { PacketDispatcher.wrapper.sendToAllAround(new TEVaultPacket(pos.getX(), pos.getY(), pos.getZ(), isOpening, state, 1, type), new TargetPoint(world.provider.getDimension(), pos.getX(), pos.getY(), pos.getZ(), 300)); isOpening = false; state = 1; - + timer = 0; closeHatch(); } } @@ -192,7 +176,13 @@ public boolean canOpen() { public boolean canClose() { return state == 2 && isHatchFree(); } - + + public void tryOpen() { + + if(canOpen()) + open(); + } + public void tryToggle() { if(canOpen()) @@ -201,6 +191,12 @@ else if(canClose()) close(); } + public void tryClose() { + + if(canClose()) + close(); + } + public boolean placeDummy(int x, int y, int z){ return placeDummy(new BlockPos(x, y, z)); } @@ -337,7 +333,6 @@ public void readFromNBT(NBTTagCompound compound) { sysTime = compound.getLong("sysTime"); timer = compound.getInteger("timer"); type = compound.getInteger("type"); - redstoned = compound.getBoolean("redstoned"); super.readFromNBT(compound); } @@ -348,7 +343,6 @@ public NBTTagCompound writeToNBT(NBTTagCompound compound) { compound.setLong("sysTime", sysTime); compound.setInteger("timer", timer); compound.setInteger("type", type); - compound.setBoolean("redstoned", redstoned); return super.writeToNBT(compound); } } diff --git a/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKBoiler.java b/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKBoiler.java index 3fb63bcea5..0c61ceec2c 100644 --- a/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKBoiler.java +++ b/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKBoiler.java @@ -40,8 +40,8 @@ public class TileEntityRBMKBoiler extends TileEntityRBMKSlottedBase implements I public TileEntityRBMKBoiler() { super(0); - feed = new FluidTank(10000); - steam = new FluidTank(1000000); + feed = new FluidTank(10000*20); + steam = new FluidTank(1000000*20); steamType = ModForgeFluids.steam; } @@ -69,7 +69,7 @@ public void update() { gameruleBoilerHeatConsumption = RBMKDials.getBoilerHeatConsumption(world); } - if(feed.getFluidAmount() < 10000 || steam.getFluidAmount() > 0) + if(feed.getFluidAmount() < 10000*20 || steam.getFluidAmount() > 0) PacketDispatcher.wrapper.sendToAllAround(new FluidTankPacket(pos, feed, steam), new TargetPoint(world.provider.getDimension(), pos.getX(), pos.getY(), pos.getZ(), 50)); NBTTagCompound type = new NBTTagCompound(); type.setString("steamType2", steamType.getName());