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