コード例 #1
0
 // 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);
   }
 }
コード例 #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);
   }
 }