Advertisement
Guest User

Untitled

a guest
Jul 29th, 2015
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.63 KB | None | 0 0
  1. package com.arisux.avp.entities;
  2.  
  3. import scala.reflect.internal.Trees.This;
  4. import net.minecraft.entity.Entity;
  5. import net.minecraft.entity.player.EntityPlayer;
  6. import net.minecraft.nbt.NBTTagCompound;
  7. import net.minecraft.util.AxisAlignedBB;
  8. import net.minecraft.world.World;
  9.  
  10. public class EntityBlastdoor extends Entity
  11. {
  12.     public boolean doorOpen = false;
  13.    
  14.     public EntityBlastdoor(World world)
  15.     {
  16.         super(world);
  17.         this.preventEntitySpawning = false;
  18.         this.setSize(1.0f, 4.0f);
  19.     }
  20.    
  21.     public EntityBlastdoor(World world, double posX, double posY, double posZ)
  22.     {
  23.         super(world);
  24.         this.setPosition(posX, posY, posZ);
  25.         this.preventEntitySpawning = false;
  26.     }
  27.  
  28.     @Override
  29.     protected void entityInit()
  30.     {
  31.         ;
  32.     }
  33.    
  34.     @Override
  35.     public boolean canRiderInteract()
  36.     {
  37.         return true;
  38.     }
  39.    
  40.     @Override
  41.     public boolean interactFirst(EntityPlayer player)
  42.     {
  43.         System.out.println(this.worldObj.isRemote);
  44.         this.doorOpen = !(this.doorOpen);
  45.         return true;
  46.     }
  47.    
  48.     @Override
  49.     public boolean canBeCollidedWith()
  50.     {
  51.         return doorOpen;
  52.     }
  53.    
  54.     @Override
  55.     public boolean canBePushed()
  56.     {
  57.         return false;
  58.     }
  59.    
  60.     @Override
  61.     public AxisAlignedBB getCollisionBox(Entity entityIn)
  62.     {
  63.         return entityIn.boundingBox;
  64.     }
  65.  
  66.     @Override
  67.     public AxisAlignedBB getBoundingBox()
  68.     {
  69.         return this.boundingBox;
  70.     }
  71.    
  72.     @Override
  73.     protected void readEntityFromNBT(NBTTagCompound tagCompound)
  74.     {
  75.         this.doorOpen = tagCompound.getBoolean("doorOpen");
  76.     }
  77.  
  78.     @Override
  79.     protected void writeEntityToNBT(NBTTagCompound tagCompound)
  80.     {
  81.         tagCompound.setBoolean("doorOpen", this.doorOpen);
  82.     }
  83. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement