From 635175049684feabe4700344eb3ae4664c38db28 Mon Sep 17 00:00:00 2001 From: Picono435 Date: Sat, 24 Dec 2022 11:09:32 +0000 Subject: [PATCH] Fixed issues with biome random teleportation --- .../java/com/gmail/picono435/randomtp/api/RandomTPAPI.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/com/gmail/picono435/randomtp/api/RandomTPAPI.java b/common/src/main/java/com/gmail/picono435/randomtp/api/RandomTPAPI.java index adfd443..b475c3a 100644 --- a/common/src/main/java/com/gmail/picono435/randomtp/api/RandomTPAPI.java +++ b/common/src/main/java/com/gmail/picono435/randomtp/api/RandomTPAPI.java @@ -55,7 +55,7 @@ public static void randomTeleport(ServerPlayer player, ServerLevel world, Resour mutableBlockPos.setY(50); mutableBlockPos.setZ(z); } else { - Pair> pair = world.findNearestBiome(biomeHolder -> biomeHolder.is(biomeResourceKey), mutableBlockPos.immutable(), 6400, 8); + Pair> pair = world.findNearestBiome(biomeHolder -> biomeHolder.is(biomeResourceKey), player.getOnPos(), 6400, 8); if(pair == null) { TextComponent msg = new TextComponent(Messages.getMaxTries().replaceAll("\\{playerName\\}", player.getName().getString()).replaceAll("&", "§")); player.sendMessage(msg, player.getUUID()); @@ -72,7 +72,7 @@ public static void randomTeleport(ServerPlayer player, ServerLevel world, Resour mutableBlockPos.setY(y); if(mutableBlockPos.getY() >= 200 || !isInBiomeWhitelist(world.getBiome(mutableBlockPos.immutable()).unwrapKey().get().location())) { if(biomeResourceKey != null) { - Pair> pair = world.findNearestBiome(biomeHolder -> biomeHolder.is(biomeResourceKey), mutableBlockPos.immutable(), 6400, 8); + Pair> pair = world.findNearestBiome(biomeHolder -> biomeHolder.is(biomeResourceKey), player.getOnPos(), 6400, 8); if(pair == null) { TextComponent msg = new TextComponent(Messages.getMaxTries().replaceAll("\\{playerName\\}", player.getName().getString()).replaceAll("&", "§")); player.sendMessage(msg, player.getUUID());