Skip to content

Commit

Permalink
Prevent previous portal from being 'down'
Browse files Browse the repository at this point in the history
  • Loading branch information
Direwolf20-MC committed Nov 2, 2024
1 parent 468af60 commit c984989
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ public static void setFavorites(ItemStack itemStack, List<NBTHelpers.PortalDesti
public static void setPrevious(Player player, ItemStack itemStack) {
Vec3 position = player.position();
Direction facing = MiscHelpers.getFacingDirection(player);
if (facing == Direction.DOWN) facing = Direction.NORTH; //Down is bad
ResourceKey<Level> dimension = player.level().dimension();
NBTHelpers.PortalDestination newDestination = new NBTHelpers.PortalDestination(new NBTHelpers.GlobalVec3(dimension, position), facing, "previous");
itemStack.set(JustDireDataComponents.PORTAL_GUN_PREVIOUS, newDestination);
Expand Down

0 comments on commit c984989

Please sign in to comment.