Package powercrystals.minefactoryreloaded.farmables.drinkhandlers

Source Code of powercrystals.minefactoryreloaded.farmables.drinkhandlers.DrinkHandlerWater

package powercrystals.minefactoryreloaded.farmables.drinkhandlers;

import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import powercrystals.minefactoryreloaded.api.ILiquidDrinkHandler;

public class DrinkHandlerWater implements ILiquidDrinkHandler
{
  @Override
  public void onDrink(EntityPlayer player)
  {
    player.extinguish();
    NBTTagCompound tag = player.getEntityData();
    World world = player.worldObj;
    if (tag.hasKey("drankLavaTime") && (world.getTotalWorldTime() - tag.getLong("drankLavaTime")) < 100)
    {
      player.dropPlayerItem(new ItemStack(Block.obsidian));
      tag.setLong("drankLavaTime", -100);
      world.playSoundAtEntity(player, "random.burp", 1.5F, world.rand.nextFloat() * 0.1F + 0.9F);
    }
  }
}
TOP

Related Classes of powercrystals.minefactoryreloaded.farmables.drinkhandlers.DrinkHandlerWater

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.