mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-21 20:52:26 +00:00
28 lines
809 B
Java
28 lines
809 B
Java
package tconstruct.plugins.minefactoryreloaded.drinkable;
|
|
|
|
import net.minecraft.entity.EntityLivingBase;
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
import net.minecraft.potion.Potion;
|
|
import net.minecraft.potion.PotionEffect;
|
|
import powercrystals.minefactoryreloaded.api.ILiquidDrinkHandler;
|
|
|
|
public class Drinkables implements ILiquidDrinkHandler
|
|
{
|
|
|
|
@Override
|
|
public void onDrink (EntityPlayer player)
|
|
{
|
|
//boost health when drink
|
|
if (player != null)
|
|
{
|
|
PotionEffect potion = player.getActivePotionEffect(Potion.field_76434_w);
|
|
int duration = 0;
|
|
if (potion != null)
|
|
duration = potion.duration;
|
|
player.addPotionEffect(new PotionEffect(Potion.field_76434_w.id, duration + 20 * 30, 0));
|
|
}
|
|
|
|
}
|
|
|
|
}
|