예제 #1
0
 @Override
 public void onInteract(Entity entity, Action type) {
   super.onInteract(entity, type);
   if (type == Action.RIGHT_CLICK && entity.getController() instanceof VanillaPlayerController) {
     this.open((VanillaPlayerController) entity.getController());
   }
 }
예제 #2
0
 @Override
 public void onAttached() {
   super.onAttached();
   getHealth().setSpawnHealth(40);
   if (getDataMap().containsKey(Data.HELD_ITEM)) {
     heldItem = getDataMap().get(Data.HELD_ITEM);
   }
   getParent().setCollision(new CollisionModel(new BoundingBox(1, 3, 1, 2, 3, 1)));
   getDrops().addRange(VanillaMaterials.ENDER_PEARL, 1);
 }
예제 #3
0
 @Override
 public void finalizeTick() {
   super.finalizeTick();
   this.lastHeldItem = heldItem;
 }
예제 #4
0
 @Override
 public void onSave() {
   super.onSave();
   getDataMap().put(Data.HELD_ITEM, heldItem);
 }
예제 #5
0
 @Override
 public void onAttached() {
   super.onAttached();
   getHealth().setSpawnHealth(20);
 }