@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()); }
@EventHandler public Message onSignUpdate(SignUpdateEvent event) { Block block = (Block) event.getSign().getPlacedBlock(); return new SignMessage(block.getX(), block.getY(), block.getZ(), event.getLines()); }