From 655cc902d3df19a1ac2bfaa38cc928ed629d0171 Mon Sep 17 00:00:00 2001 From: BlueWeabo Date: Sat, 1 Apr 2023 17:06:06 +0300 Subject: Implement Power Logic, Pollution Logic and Processing Logic for MuTEs and many other things (#1823) * update bs 2 * fuel consumption and energy implementation. clean up * don't register XD * some clean up * coke oven work * semi-working coke oven somehow i broke the activating of the multiblock * power logic * PowerLogic * clean up, saving loading nbt * small cleanup and pollution * pollution working :P * Energy mostly working, wallsharing * processing logic * fix npe and deregister * review requests * missed one * remove extra 0 --- src/main/java/gregtech/client/GT_SoundLoop.java | 26 ++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'src/main/java/gregtech/client') diff --git a/src/main/java/gregtech/client/GT_SoundLoop.java b/src/main/java/gregtech/client/GT_SoundLoop.java index 6b6546ced5..6692775d20 100644 --- a/src/main/java/gregtech/client/GT_SoundLoop.java +++ b/src/main/java/gregtech/client/GT_SoundLoop.java @@ -9,6 +9,7 @@ import net.minecraft.world.World; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.multitileentity.machine.MultiTileBasicMachine; @SideOnly(Side.CLIENT) public class GT_SoundLoop extends MovingSound { @@ -32,6 +33,19 @@ public class GT_SoundLoop extends MovingSound { volume = VOLUME_RAMP; } + public GT_SoundLoop(ResourceLocation sound, MultiTileBasicMachine base, boolean stopWhenActive, + boolean stopWhenInactive) { + super(sound); + this.whileActive = stopWhenActive; + this.whileInactive = stopWhenInactive; + xPosF = base.getXCoord(); + yPosF = base.getYCoord(); + zPosF = base.getZCoord(); + worldID = base.getWorld().provider.dimensionId; + repeat = true; + volume = VOLUME_RAMP; + } + @Override public void update() { if (donePlaying) { @@ -51,10 +65,16 @@ public class GT_SoundLoop extends MovingSound { .checkChunksExist((int) xPosF, (int) yPosF, (int) zPosF, (int) xPosF, (int) yPosF, (int) zPosF); if (donePlaying) return; TileEntity tile = world.getTileEntity((int) xPosF, (int) yPosF, (int) zPosF); - if (!(tile instanceof IGregTechTileEntity)) { - donePlaying = true; + if ((tile instanceof IGregTechTileEntity)) { + fadeMe |= ((IGregTechTileEntity) tile).isActive() ? whileActive : whileInactive; return; } - fadeMe |= ((IGregTechTileEntity) tile).isActive() ? whileActive : whileInactive; + + if ((tile instanceof MultiTileBasicMachine)) { + fadeMe |= ((MultiTileBasicMachine) tile).isActive() ? whileActive : whileInactive; + return; + } + + donePlaying = true; } } -- cgit