From 2bc76661b04cd0f12f9d2069f3af2efcee991f07 Mon Sep 17 00:00:00 2001 From: Boblet Date: Mon, 2 Sep 2024 16:44:24 +0200 Subject: [PATCH] fixes --- changelog | 6 +++++- src/main/java/com/hbm/blocks/network/FluidValve.java | 2 +- .../com/hbm/hazard/type/HazardTypeHydroactive.java | 3 ++- .../com/hbm/render/tileentity/RenderSolarBoiler.java | 2 +- .../hbm/tileentity/network/TileEntityFluidValve.java | 11 ++++++++++- .../hbm/tileentity/network/TileEntityPipeBaseNT.java | 5 ++--- 6 files changed, 21 insertions(+), 8 deletions(-) diff --git a/changelog b/changelog index b675028b3..c337927d4 100644 --- a/changelog +++ b/changelog @@ -9,4 +9,8 @@ ## Fixed * Fixed pumpjack gauges not syncing properly * Fixed some concrete variants not being revertable into uncolored concrete -* Fixed the ore density scanner not using proper translations for the HUD \ No newline at end of file +* Fixed the ore density scanner not using proper translations for the HUD +* Fixed the solar boiler's rays rendering on fast graphics instead of on fancy graphics +* Fixed hydroreactive items not exploding when submerged in water +* Fixed fluid valves visually disconnecting when switching state +* Fixed fluid valves no visually connecting when type is set \ No newline at end of file diff --git a/src/main/java/com/hbm/blocks/network/FluidValve.java b/src/main/java/com/hbm/blocks/network/FluidValve.java index 5a0b3d5b3..bfea2582e 100644 --- a/src/main/java/com/hbm/blocks/network/FluidValve.java +++ b/src/main/java/com/hbm/blocks/network/FluidValve.java @@ -54,6 +54,7 @@ public class FluidValve extends FluidDuctBase implements ILookOverlay { if(!player.isSneaking()) { int meta = world.getBlockMetadata(x, y, z); + TileEntityFluidValve te = (TileEntityFluidValve) world.getTileEntity(x, y, z); if(meta == 0) { world.setBlockMetadataWithNotify(x, y, z, 1, 2); world.playSoundEffect(x, y, z, "hbm:block.reactorStart", 1.0F, 1.0F); @@ -62,7 +63,6 @@ public class FluidValve extends FluidDuctBase implements ILookOverlay { world.playSoundEffect(x, y, z, "hbm:block.reactorStart", 1.0F, 0.85F); } - TileEntityFluidValve te = (TileEntityFluidValve) world.getTileEntity(x, y, z); te.updateState(); return true; diff --git a/src/main/java/com/hbm/hazard/type/HazardTypeHydroactive.java b/src/main/java/com/hbm/hazard/type/HazardTypeHydroactive.java index f7d6a3c49..a716f925c 100644 --- a/src/main/java/com/hbm/hazard/type/HazardTypeHydroactive.java +++ b/src/main/java/com/hbm/hazard/type/HazardTypeHydroactive.java @@ -6,6 +6,7 @@ import com.hbm.config.RadiationConfig; import com.hbm.hazard.modifier.HazardModifier; import com.hbm.util.I18nUtil; +import net.minecraft.block.material.Material; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; @@ -32,7 +33,7 @@ public class HazardTypeHydroactive extends HazardTypeBase { if(RadiationConfig.disableHydro) return; - if(item.isWet()) { + if(item.isWet() || item.worldObj.getBlock((int) Math.floor(item.posX), (int) Math.floor(item.posY), (int) Math.floor(item.posZ)).getMaterial() == Material.water) { item.setDead(); item.worldObj.newExplosion(null, item.posX, item.posY + item.height * 0.5, item.posZ, level, false, true); } diff --git a/src/main/java/com/hbm/render/tileentity/RenderSolarBoiler.java b/src/main/java/com/hbm/render/tileentity/RenderSolarBoiler.java index 54c3c1ad1..f15a7d778 100644 --- a/src/main/java/com/hbm/render/tileentity/RenderSolarBoiler.java +++ b/src/main/java/com/hbm/render/tileentity/RenderSolarBoiler.java @@ -38,7 +38,7 @@ public class RenderSolarBoiler extends TileEntitySpecialRenderer { GL11.glShadeModel(GL11.GL_FLAT); GL11.glPopMatrix(); - if(te instanceof TileEntitySolarBoiler && !Minecraft.getMinecraft().gameSettings.fancyGraphics) { + if(te instanceof TileEntitySolarBoiler && Minecraft.getMinecraft().gameSettings.fancyGraphics) { TileEntitySolarBoiler boiler = (TileEntitySolarBoiler) te; Tessellator tess = Tessellator.instance; diff --git a/src/main/java/com/hbm/tileentity/network/TileEntityFluidValve.java b/src/main/java/com/hbm/tileentity/network/TileEntityFluidValve.java index 6e1a226dd..7d6ff74d8 100644 --- a/src/main/java/com/hbm/tileentity/network/TileEntityFluidValve.java +++ b/src/main/java/com/hbm/tileentity/network/TileEntityFluidValve.java @@ -1,16 +1,20 @@ package com.hbm.tileentity.network; import api.hbm.fluid.PipeNet; +import net.minecraft.block.Block; +import net.minecraft.world.World; public class TileEntityFluidValve extends TileEntityPipeBaseNT { @Override - public boolean canUpdate() { + public boolean shouldConnect() { return this.worldObj != null && this.getBlockMetadata() == 1 && super.canUpdate(); } public void updateState() { + this.blockMetadata = -1; // delete cache + if(this.getBlockMetadata() == 0 && this.network != null) { this.network.destroy(); this.network = null; @@ -24,4 +28,9 @@ public class TileEntityFluidValve extends TileEntityPipeBaseNT { } } } + + @Override + public boolean shouldRefresh(Block oldBlock, Block newBlock, int oldMeta, int newMeta, World world, int x, int y, int z) { + return oldBlock != newBlock; + } } diff --git a/src/main/java/com/hbm/tileentity/network/TileEntityPipeBaseNT.java b/src/main/java/com/hbm/tileentity/network/TileEntityPipeBaseNT.java index 4db863014..b3004d9b0 100644 --- a/src/main/java/com/hbm/tileentity/network/TileEntityPipeBaseNT.java +++ b/src/main/java/com/hbm/tileentity/network/TileEntityPipeBaseNT.java @@ -28,7 +28,7 @@ public class TileEntityPipeBaseNT extends TileEntity implements IFluidConductor lastType = type; } - if(!worldObj.isRemote && canUpdate()) { + if(!worldObj.isRemote && shouldConnect()) { //we got here either because the net doesn't exist or because it's not valid, so that's safe to assume this.setPipeNet(type, null); @@ -101,8 +101,7 @@ public class TileEntityPipeBaseNT extends TileEntity implements IFluidConductor /** * Only update until a power net is formed, in >99% of the cases it should be the first tick. Everything else is handled by neighbors and the net itself. */ - @Override - public boolean canUpdate() { + public boolean shouldConnect() { return (this.network == null || !this.network.isValid()) && !this.isInvalid(); }