// when an item spawns...
 @EventHandler(priority = EventPriority.LOWEST)
 public void onItemSpawn(ItemSpawnEvent event) {
   // if in a creative world, cancel the event (don't drop items on the ground)
   if (GriefPrevention.instance.creativeRulesApply(event.getLocation())) {
     event.setCancelled(true);
   }
 }
Esempio n. 2
0
 @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
 public void onItemSpawn(ItemSpawnEvent event) {
   Location loc = event.getLocation();
   if (dropOffCenter != null
       && loc.getX() > dropOffCenter.getX() - 80
       && loc.getX() < dropOffCenter.getX() + 80
       && loc.getZ() > dropOffCenter.getZ() - 80
       && loc.getZ() < dropOffCenter.getZ() + 80) {
     event.setCancelled(true);
   }
 }
Esempio n. 3
0
 @Override
 public void dropBIM(ItemSpawnEvent event) {
   String id = Core.getBIMStore().getBIMIdentity(event.getEntity().getItemStack());
   if (Core.getBIMStore().isBIMActiv(id)) {
     Player p = Core.getBIMStore().getBIMStorePlayerHoldPlayer(id);
     p.sendMessage("Deactivate BIM first");
     ItemHelper.pickUpItem(p, Core.btooom.getExsistingBIMItem(id));
     event.setCancelled(true);
   } else {
     Core.getBIMStore().BIMDropLikeDrop(event);
   }
 }