use of uk.co.wehavecookies56.kk.common.world.dimension.DimensionTeleporter in project Kingdom-Keys-Re-Coded by Wehavecookies56.
the class EntityEvents method playerRespawn.
@SubscribeEvent
public void playerRespawn(net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerRespawnEvent event) {
if (event.isEndConquered()) {
BlockPos spawn = new BlockPos(192, 5, 161);
new DimensionTeleporter(event.player.world.getMinecraftServer().getServer().getWorld(Utils.getDimensionIDAndBlockPos(Strings.TraverseTown).id), Strings.TraverseTown, spawn).teleport((EntityPlayer) event.player);
}
}
use of uk.co.wehavecookies56.kk.common.world.dimension.DimensionTeleporter in project Kingdom-Keys-Re-Coded by Wehavecookies56.
the class ItemHandHeldGummiShip method onItemRightClick.
@Override
public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand) {
if (!player.world.isRemote) {
String nextDimension = "";
if (player.dimension == ModDimensions.destinyIslandsID) {
nextDimension = Strings.TraverseTown;
} else if (player.dimension == ModDimensions.traverseTownID) {
new TeleporterOverworld(player.world.getMinecraftServer().getServer().getWorld(0)).teleport((player), player.world);
return super.onItemRightClick(world, player, hand);
} else {
nextDimension = Strings.DestinyIslands;
}
new DimensionTeleporter(player.world.getMinecraftServer().getServer().getWorld(Utils.getDimensionIDAndBlockPos(nextDimension).id), nextDimension, Utils.getDimensionIDAndBlockPos(nextDimension).pos).teleport((EntityPlayer) player);
}
return super.onItemRightClick(world, player, hand);
}
Aggregations