Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.arisux.avp.entities;
- import scala.reflect.internal.Trees.This;
- import net.minecraft.entity.Entity;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.nbt.NBTTagCompound;
- import net.minecraft.util.AxisAlignedBB;
- import net.minecraft.world.World;
- public class EntityBlastdoor extends Entity
- {
- public boolean doorOpen = false;
- public EntityBlastdoor(World world)
- {
- super(world);
- this.preventEntitySpawning = false;
- this.setSize(1.0f, 4.0f);
- }
- public EntityBlastdoor(World world, double posX, double posY, double posZ)
- {
- super(world);
- this.setPosition(posX, posY, posZ);
- this.preventEntitySpawning = false;
- }
- @Override
- protected void entityInit()
- {
- ;
- }
- @Override
- public boolean canRiderInteract()
- {
- return true;
- }
- @Override
- public boolean interactFirst(EntityPlayer player)
- {
- System.out.println(this.worldObj.isRemote);
- this.doorOpen = !(this.doorOpen);
- return true;
- }
- @Override
- public boolean canBeCollidedWith()
- {
- return doorOpen;
- }
- @Override
- public void onUpdate()
- {
- super.onUpdate();
- }
- @Override
- public boolean canBePushed()
- {
- return false;
- }
- @Override
- public AxisAlignedBB getCollisionBox(Entity entityIn)
- {
- return entityIn.boundingBox;
- }
- @Override
- public AxisAlignedBB getBoundingBox()
- {
- return this.boundingBox;
- }
- @Override
- protected void readEntityFromNBT(NBTTagCompound tagCompound)
- {
- this.doorOpen = tagCompound.getBoolean("doorOpen");
- }
- @Override
- protected void writeEntityToNBT(NBTTagCompound tagCompound)
- {
- tagCompound.setBoolean("doorOpen", this.doorOpen);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement