Mekanism-tilera-Edition/common/mekanism/client/sound/JetpackSound.java
Victor Robertson e5a6eadc45 Fix indentation and remove trailing whitespace
This patch provides common/mekanism/*.java with standardized
indentation (tabs) and also removes trailing whitespace.
2014-03-07 19:20:35 -06:00

51 lines
934 B
Java

package mekanism.client.sound;
import mekanism.client.ClientTickHandler;
import mekanism.common.item.ItemJetpack;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
public class JetpackSound extends PlayerSound
{
public JetpackSound(String id, EntityPlayer entity)
{
super(id, "Jetpack.ogg", entity);
}
@Override
public boolean update(World world)
{
if(!super.update(world))
{
return false;
}
else if(!hasJetpack(player))
{
return false;
}
else {
if(ClientTickHandler.isJetpackOn(player) != isPlaying)
{
if(ClientTickHandler.isJetpackOn(player))
{
play();
}
else {
stopLoop();
}
}
}
if(isPlaying)
{
ticksSincePlay++;
}
return true;
}
private boolean hasJetpack(EntityPlayer player)
{
return player.inventory.armorInventory[2] != null && player.inventory.armorInventory[2].getItem() instanceof ItemJetpack;
}
}