Files
TinkersConstruct/src/main/java/tconstruct/plugins/mfr/Drinkables.java
T
2023-09-24 22:57:55 +02:00

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));
}
}
}