mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
add non worky code
This commit is contained in:
parent
5c33fa1707
commit
56e7d2d83c
@ -1,17 +1,8 @@
|
||||
package com.hbm.packet;
|
||||
|
||||
import com.hbm.interfaces.Spaghetti;
|
||||
import com.hbm.sound.SoundLoopAssembler;
|
||||
import com.hbm.sound.SoundLoopBroadcaster;
|
||||
import com.hbm.sound.SoundLoopCentrifuge;
|
||||
import com.hbm.sound.SoundLoopMiner;
|
||||
import com.hbm.sound.SoundLoopTurbofan;
|
||||
import com.hbm.tileentity.machine.TileEntityBroadcaster;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineAssembler;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineCentrifuge;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineGasCent;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineMiningDrill;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineTurbofan;
|
||||
import com.hbm.sound.*;
|
||||
import com.hbm.tileentity.machine.*;
|
||||
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
@ -137,6 +128,17 @@ public class LoopedSoundPacket implements IMessage {
|
||||
if(flag && te.getWorldObj().isRemote && ((TileEntityMachineGasCent)te).isProgressing)
|
||||
Minecraft.getMinecraft().getSoundHandler().playSound(new SoundLoopCentrifuge(new ResourceLocation("hbm:block.centrifugeOperate"), te));
|
||||
}
|
||||
|
||||
if (te != null && te instanceof TileEntityFEL) {
|
||||
boolean flag = true;
|
||||
for(int i = 0; i < SoundLoopFel.list.size(); i++) {
|
||||
if (SoundLoopFel.list.get(i).getTE() == te && !SoundLoopFel.list.get(i).isDonePlaying())
|
||||
flag = false;
|
||||
}
|
||||
|
||||
if(flag && te.getWorldObj().isRemote && ((TileEntityFEL)te).isOn)
|
||||
Minecraft.getMinecraft().getSoundHandler().playSound(new SoundLoopFel(new ResourceLocation("hbm:block.fel"), (TileEntityFEL) te));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
37
src/main/java/com/hbm/sound/SoundLoopFel.java
Normal file
37
src/main/java/com/hbm/sound/SoundLoopFel.java
Normal file
@ -0,0 +1,37 @@
|
||||
package com.hbm.sound;
|
||||
|
||||
import com.hbm.tileentity.machine.TileEntityFEL;
|
||||
import net.minecraft.client.audio.MovingSound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class SoundLoopFel extends SoundLoopMachine {
|
||||
|
||||
public static List<SoundLoopFel> list = new ArrayList<>();
|
||||
|
||||
private TileEntityFEL plant;
|
||||
|
||||
public SoundLoopFel(ResourceLocation path, TileEntityFEL te) {
|
||||
super(path, te);
|
||||
list.add(this);
|
||||
plant = te;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
super.update();
|
||||
|
||||
if(this.volume != 3)
|
||||
volume = 3;
|
||||
|
||||
if(!plant.isOn)
|
||||
this.donePlaying = true;
|
||||
}
|
||||
|
||||
public TileEntity getTE() {
|
||||
return te;
|
||||
}
|
||||
}
|
||||
BIN
src/main/resources/assets/hbm/sounds/block/fel.ogg
Normal file
BIN
src/main/resources/assets/hbm/sounds/block/fel.ogg
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user