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.
This commit is contained in:
SenseiKiwi 2014-03-13 05:43:26 -04:00
parent f1eff42a33
commit f40e1e0a91

View file

@ -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);
}