public static void sendPacketToAllAround(IMessage packet, TargetPoint tp) {
for (EntityPlayerMP player : (List<EntityPlayerMP>) FMLCommonHandler.instance().getMinecraftServerInstance().getPlayerList().getPlayers()) {
if (player.dimension == tp.dimension) {
double d4 = tp.x - player.posX;
double d6 = tp.z - player.posZ;
// base distance only on the x & Z axis so you can see machines way above / below you. (blast a machine up and you'll understand why
if (d4 * d4 + d6 * d6 < tp.range * tp.range) {
ModNetwork.simpleNetworkWrapper.sendTo(packet, player);
}
}
}
}
ModNetwork.java 文件源码
java
阅读 17
收藏 0
点赞 0
评论 0
项目:TechStack-s-HeavyMachineryMod
作者:
评论列表
文章目录