Various Updates #143

Merged
SenseiKiwi merged 14 commits from master into master 2014-03-14 19:30:44 +00:00
Showing only changes of commit f40e1e0a91 - Show all commits

View File

@@ -40,9 +40,12 @@ public class DDTeleporter
{ {
private static final Random random = new Random(); private static final Random random = new Random();
private static final int NETHER_DIMENSION_ID = -1; 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 END_DIMENSION_ID = 1;
private static final int MAX_NETHER_EXIT_CHANCE = 100; 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 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 MAX_ROOT_SHIFT_CHANCE = 100;
private static final int START_ROOT_SHIFT_CHANCE = 0; private static final int START_ROOT_SHIFT_CHANCE = 0;
private static final int ROOT_SHIFT_CHANCE_PER_LEVEL = 5; 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_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); return generateSafeExit(PocketManager.getDimensionData(NETHER_DIMENSION_ID), link, properties);
} }