NetworkHelper.java 文件源码

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

项目:VillagerTweaks 作者:
/**
 * Send info about the golems (iron and snow) to all players around a certain radius of them.
 * 
 * Server -> Client
 * 
 */
public static void sendEnchantedGolemInfoMessage(EntityLiving golem, ExtendedGolem properties) {
    if (golem != null && properties != null) {
        int[] ids = GolemEnchantment.convert(properties.getEnchantments());

        if (ids.length > 0) {
            MessageGolemEnchantments message = new MessageGolemEnchantments(golem.getEntityId(), ids);
            TargetPoint target = new TargetPoint(golem.dimension, golem.posX, golem.posY, golem.posZ, 64.0D);

            // Debug
            LogHelper.info("~~Sending Message - Enchanted Iron Golem info~~");
            LogHelper.info("    target: " + target);
            LogHelper.info("    " + message.toString());

            // Sends a message to the player, with the golem extra info
            ModVillagerTweaks.NetworkWrapper.sendToAllAround(message, target);
        }
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号