use of uk.co.wehavecookies56.kk.common.network.packet.server.OrgPortal in project Kingdom-Keys-Re-Coded by Wehavecookies56.
the class InputHandler method summonPortal.
private void summonPortal(EntityPlayer player, PortalCoords coords) {
IOrganizationXIII orgXIII = player.getCapability(ModCapabilities.ORGANIZATION_XIII, null);
RayTraceResult rtr = InputHandler.getMouseOverExtended(100);
if (rtr != null) {
if (rtr.typeOfHit == rtr.typeOfHit.BLOCK) {
double distanceSq = player.getDistanceSq(rtr.getBlockPos());
double reachSq = 100 * 100;
if (reachSq >= distanceSq) {
BlockPos pos = rtr.getBlockPos();
BlockPos destination = new BlockPos(coords.getX(), coords.getY(), coords.getZ());
PacketDispatcher.sendToServer(new OrgPortal(rtr.getBlockPos(), destination, coords.getDimID()));
player.world.playSound((EntityPlayer) player, player.getPosition(), ModSounds.lockon, SoundCategory.MASTER, 1.0f, 1.0f);
}
}
}
}
Aggregations