use of ladysnake.gaspunk.item.SkinItem in project Gaspunk by Ladysnake.
the class EntityGrenade method onUpdate.
@Override
public void onUpdate() {
super.onUpdate();
if (world.isRemote)
return;
int countdown = getCountdown();
if (countdown == 1)
explode();
setCountdown(getCountdown() - 1);
// after exploding, the countdown is used to track the time before cloud expiration
if (countdown <= -cloudMaxLifeSpan) {
if (canPickup) {
ItemStack stack = getGrenade();
ItemGrenade grenadeItem = (ItemGrenade) stack.getItem();
ItemStack emptyGrenade = new ItemStack(ModItems.EMPTY_GRENADE);
((SkinItem) ModItems.EMPTY_GRENADE).setSkin(emptyGrenade, grenadeItem.getSkin(stack));
world.spawnEntity(new EntityItem(world, posX, posY, posZ, emptyGrenade));
}
setDead();
}
}
Aggregations