From f40e1e0a91a399de3e421926194a7924a38006a5 Mon Sep 17 00:00:00 2001 From: SenseiKiwi Date: Thu, 13 Mar 2014 05:43:26 -0400 Subject: [PATCH] Change to Dungeon Exits Chances Changed dungeon exits so that they have a minimum 15% chance of exiting to the Overworld if a dungeon's root dimension isn't the Overworld. Also made a minor change to the existing special case for the Nether - the minimum 20% chance only applies if the root dimension isn't the Nether. --- .../StevenDimDoors/mod_pocketDim/core/DDTeleporter.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/StevenDimDoors/mod_pocketDim/core/DDTeleporter.java b/src/main/java/StevenDimDoors/mod_pocketDim/core/DDTeleporter.java index 89051408..bdb7fd71 100644 --- a/src/main/java/StevenDimDoors/mod_pocketDim/core/DDTeleporter.java +++ b/src/main/java/StevenDimDoors/mod_pocketDim/core/DDTeleporter.java @@ -40,9 +40,12 @@ public class DDTeleporter { private static final Random random = new Random(); private static final int NETHER_DIMENSION_ID = -1; + private static final int OVERWORLD_DIMENSION_ID = 0; private static final int END_DIMENSION_ID = 1; private static final int MAX_NETHER_EXIT_CHANCE = 100; private static final int NETHER_EXIT_CHANCE = 20; //20% chance to compensate for frequent exit failures - the Nether often doesn't have enough space for an exit + private static final int MAX_OVERWORLD_EXIT_CHANCE = 100; + private static final int OVERWORLD_EXIT_CHANCE = 15; private static final int MAX_ROOT_SHIFT_CHANCE = 100; private static final int START_ROOT_SHIFT_CHANCE = 0; private static final int ROOT_SHIFT_CHANCE_PER_LEVEL = 5; @@ -633,7 +636,11 @@ public class DDTeleporter if (random.nextInt(MAX_ROOT_SHIFT_CHANCE) < shiftChance) { - if (random.nextInt(MAX_NETHER_EXIT_CHANCE) < NETHER_EXIT_CHANCE) + if (current.root().id() != OVERWORLD_DIMENSION_ID && random.nextInt(MAX_OVERWORLD_EXIT_CHANCE) < OVERWORLD_EXIT_CHANCE) + { + return generateSafeExit(PocketManager.getDimensionData(OVERWORLD_DIMENSION_ID), link, properties); + } + if (current.root().id() != NETHER_DIMENSION_ID && random.nextInt(MAX_NETHER_EXIT_CHANCE) < NETHER_EXIT_CHANCE) { return generateSafeExit(PocketManager.getDimensionData(NETHER_DIMENSION_ID), link, properties); }