FilterEvents.java 文件源码

java
阅读 23 收藏 0 点赞 0 评论 0

项目:Rixor 作者:
@SuppressWarnings("deprecation")
@EventHandler(priority = EventPriority.LOW)
public void onBucketEmpty(PlayerBucketEmptyEvent event) {
    Player player = event.getPlayer();
    Client client = Client.getClient(player);
    Block block = event.getBlockClicked().getRelative(event.getBlockFace());
    Map map = Rixor.getRotation().getSlot().getMap();

    BlockState newState = block.getState();
    Material update = Material.LAVA;
    if(event.getBucket() == Material.WATER_BUCKET) update = Material.WATER;
    newState.setData(new MaterialData(update, (byte) 0));

    BlockState oldState = block.getState();
    BlockChangeEvent change = new BlockChangeEvent(event, map, client, oldState, newState);
    Rixor.callEvent(change);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号