initial commit
This commit is contained in:
parent
3c9ee26b06
commit
22186c33b9
1458 changed files with 282792 additions and 0 deletions
35
java/src/game/item/ItemEgg.java
Executable file
35
java/src/game/item/ItemEgg.java
Executable file
|
@ -0,0 +1,35 @@
|
|||
package game.item;
|
||||
|
||||
import game.entity.npc.EntityNPC;
|
||||
import game.entity.projectile.EntityEgg;
|
||||
import game.init.SoundEvent;
|
||||
import game.world.World;
|
||||
|
||||
public class ItemEgg extends Item
|
||||
{
|
||||
public ItemEgg()
|
||||
{
|
||||
this.setTab(CheatTab.tabTools);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
|
||||
*/
|
||||
public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityNPC playerIn)
|
||||
{
|
||||
// if (!playerIn.creative)
|
||||
// {
|
||||
--itemStackIn.stackSize;
|
||||
// }
|
||||
|
||||
worldIn.playSoundAtEntity(playerIn, SoundEvent.THROW, 0.5F, 0.4F / (itemRand.floatv() * 0.4F + 0.8F));
|
||||
|
||||
if (!worldIn.client)
|
||||
{
|
||||
worldIn.spawnEntityInWorld(new EntityEgg(worldIn, playerIn));
|
||||
}
|
||||
|
||||
// playerIn.triggerAchievement(StatRegistry.objectUseStats[ItemRegistry.getIdFromItem(this)]);
|
||||
return itemStackIn;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue