コード例 #1
0
ファイル: BlockListener.java プロジェクト: Grafe/BukkitBridge
 @EventHandler
 public void onSignChange(SignUpdateEvent event) {
   if (event.isCancelled()) {
     return;
   }
   if (!(event.getSource() instanceof Player)) {
     return;
   }
   SignChangeEvent signChangeEvent =
       new SignChangeEvent(
           BukkitUtil.fromBlock(event.getSign().getBlock()),
           new BridgePlayer((Player) event.getSource()),
           event.getLines());
   Bukkit.getPluginManager().callEvent(signChangeEvent);
   event.setLines(signChangeEvent.getLines());
   event.setCancelled(signChangeEvent.isCancelled());
 }
コード例 #2
0
 @EventHandler
 public Message onSignUpdate(SignUpdateEvent event) {
   Block block = (Block) event.getSign().getPlacedBlock();
   return new SignMessage(block.getX(), block.getY(), block.getZ(), event.getLines());
 }