Advertisement
Guest User

Untitled

a guest
Jul 29th, 2015
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 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 void onUpdate()
  56. {
  57. super.onUpdate();
  58. }
  59.  
  60. @Override
  61. public boolean canBePushed()
  62. {
  63. return false;
  64. }
  65.  
  66. @Override
  67. public AxisAlignedBB getCollisionBox(Entity entityIn)
  68. {
  69. return entityIn.boundingBox;
  70. }
  71.  
  72. @Override
  73. public AxisAlignedBB getBoundingBox()
  74. {
  75. return this.boundingBox;
  76. }
  77.  
  78. @Override
  79. protected void readEntityFromNBT(NBTTagCompound tagCompound)
  80. {
  81. this.doorOpen = tagCompound.getBoolean("doorOpen");
  82. }
  83.  
  84. @Override
  85. protected void writeEntityToNBT(NBTTagCompound tagCompound)
  86. {
  87. tagCompound.setBoolean("doorOpen", this.doorOpen);
  88. }
  89. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement