aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/client
diff options
context:
space:
mode:
authorBlueWeabo <ilia.iliev2005@gmail.com>2023-04-01 17:06:06 +0300
committerGitHub <noreply@github.com>2023-04-01 16:06:06 +0200
commit655cc902d3df19a1ac2bfaa38cc928ed629d0171 (patch)
tree25e34b45705b8473e20af3f9b92af25cc87a1e0d /src/main/java/gregtech/client
parenta01d019ed97101936210f16c7a362d852f081f09 (diff)
downloadGT5-Unofficial-655cc902d3df19a1ac2bfaa38cc928ed629d0171.tar.gz
GT5-Unofficial-655cc902d3df19a1ac2bfaa38cc928ed629d0171.tar.bz2
GT5-Unofficial-655cc902d3df19a1ac2bfaa38cc928ed629d0171.zip
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
Diffstat (limited to 'src/main/java/gregtech/client')
-rw-r--r--src/main/java/gregtech/client/GT_SoundLoop.java26
1 files changed, 23 insertions, 3 deletions
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;
}
}