Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.lyesdoesmods.ieeps;
- import com.lyesdoesmods.lib.ReferenceVariables;
- import net.minecraft.entity.Entity;
- import net.minecraft.nbt.NBTTagCompound;
- import net.minecraft.world.World;
- import net.minecraftforge.common.IExtendedEntityProperties;
- public class BloodLiquidEEP implements IExtendedEntityProperties{
- public static final String EXT_PROP_NAME = "BloodLiquid_IEEP";
- private final Entity entity;
- private boolean inBloodLiquid = false;
- public BloodLiquidEEP(Entity en)
- {
- this.entity = en;
- }
- public static final void register(Entity en)
- {
- en.registerExtendedProperties(BloodLiquidEEP.EXT_PROP_NAME, new BloodLiquidEEP(en));
- }
- public static final BloodLiquidEEP get(Entity en)
- {
- return (BloodLiquidEEP) en.getExtendedProperties(EXT_PROP_NAME);
- }
- @Override
- public void saveNBTData(NBTTagCompound compound)
- {
- NBTTagCompound properties = new NBTTagCompound();
- properties.setBoolean("isInBloodLiquid", inBloodLiquid);
- compound.setTag(EXT_PROP_NAME, properties);
- }
- @Override
- public void loadNBTData(NBTTagCompound compound)
- {
- NBTTagCompound properties = (NBTTagCompound)compound.getTag(EXT_PROP_NAME);
- this.inBloodLiquid = properties.getBoolean("isInBloodLiquid");
- }
- @Override
- public void init(Entity entity, World world) {
- }
- public void checkIfInLiquid()
- {
- World world = this.entity.worldObj;
- if(world.isAABBInMaterial(this.entity.getBoundingBox(), ReferenceVariables.bloodLiq))
- {
- this.inBloodLiquid = true;
- }
- else
- {
- this.inBloodLiquid = false;
- }
- }
- public boolean getIsInLiquid()
- {
- return this.inBloodLiquid;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement