Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public ItemStack onItemUseFinish(ItemStack stack, World world, EntityPlayer player) {
- Vec3 vec3 = player.getPosition(1.0F);
- Vec3 vec3a = player.getLook(1.0F);
- Vec3 vec3b = vec3.addVector(vec3a.xCoord * 5, vec3a.yCoord * 5, vec3a.zCoord * 5);
- MovingObjectPosition movingobjectposition = world.rayTraceBlocks(vec3, vec3b);
- if (movingobjectposition != null) {
- Block block = world.getBlock(movingobjectposition.blockX, movingobjectposition.blockY, movingobjectposition.blockZ);
- if (block != null && block == Manager_Blocks.blockTestPlant) {
- stack.damageItem(1, player);
- world.playSoundAtEntity(player, Decimation.MOD_ID + ":" + soundLocation, 1, 1);
- world.spawnEntityInWorld(new EntityItem(world, player.posX, player.posY, player.posZ, new ItemStack(Manager_Items.itemCocaLeaves)));
- player.addChatMessage(new ChatComponentText(EnumChatFormatting.WHITE + "You used the trimmers..."));
- } else {
- player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "You cannot trim that!"));
- }
- }
- return stack;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement