mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-12 16:27:29 +00:00
A bit of work on flamethrower sound effect handling
This commit is contained in:
1 parent
cdeb25803c
commit
ee789547c6
3 files changed
+57
-26
No files matched your search
@@ -9,6 +9,7 @@ import java.util.Set;
|
||||
|
||||
import mekanism.api.EnumColor;
|
||||
import mekanism.api.IClientTicker;
|
||||
import mekanism.client.sound.FlamethrowerSound;
|
||||
import mekanism.client.sound.GasMaskSound;
|
||||
import mekanism.client.sound.JetpackSound;
|
||||
import mekanism.client.sound.SoundHandler;
|
||||
@@ -19,6 +20,7 @@ import mekanism.common.block.BlockMachine.MachineType;
|
||||
import mekanism.common.item.ItemBlockMachine;
|
||||
import mekanism.common.item.ItemConfigurator;
|
||||
import mekanism.common.item.ItemElectricBow;
|
||||
import mekanism.common.item.ItemFlamethrower;
|
||||
import mekanism.common.item.ItemFreeRunners;
|
||||
import mekanism.common.item.ItemGasMask;
|
||||
import mekanism.common.item.ItemJetpack;
|
||||
@@ -404,6 +406,14 @@ public class ClientTickHandler
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(EntityPlayer player : (List<EntityPlayer>)mc.theWorld.playerEntities)
|
||||
{
|
||||
if(hasFlamethrower(player))
|
||||
{
|
||||
new FlamethrowerSound(MekanismClient.audioHandler.getIdentifier(), player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(mc.thePlayer.getEquipmentInSlot(3) != null && mc.thePlayer.getEquipmentInSlot(3).getItem() instanceof ItemJetpack)
|
||||
@@ -533,6 +543,21 @@ public class ClientTickHandler
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean hasFlamethrower(EntityPlayer player)
|
||||
{
|
||||
if(player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() instanceof ItemJetpack)
|
||||
{
|
||||
ItemFlamethrower flamethrower = (ItemFlamethrower)player.getCurrentEquippedItem().getItem();
|
||||
|
||||
if(flamethrower.getGas(player.getCurrentEquippedItem()) != null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void tickEnd()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user