mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-11-24 22:24:35 +00:00
All devs and contributors should use the provided formatter settings. If your IDE does not support the format, the rules are simple, it is the default java formatting rules, with 200char line lengths and 1 extra line after class definitions.
32 lines
860 B
Java
32 lines
860 B
Java
package com.cricketcraft.chisel.item;
|
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
import net.minecraft.item.ItemStack;
|
|
import net.minecraft.world.World;
|
|
|
|
import com.cricketcraft.chisel.entity.EntityCloudInABottle;
|
|
|
|
public class ItemCloudInABottle extends BaseItem {
|
|
|
|
public ItemCloudInABottle() {
|
|
super();
|
|
setUnlocalizedName("cloudBottle");
|
|
}
|
|
|
|
@Override
|
|
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
|
if (!par3EntityPlayer.capabilities.isCreativeMode) {
|
|
--par1ItemStack.stackSize;
|
|
}
|
|
|
|
if (par2World.isRemote)
|
|
par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
|
|
|
|
if (!par2World.isRemote) {
|
|
par2World.spawnEntityInWorld(new EntityCloudInABottle(par2World, par3EntityPlayer));
|
|
}
|
|
|
|
return par1ItemStack;
|
|
}
|
|
}
|