Forge really should have always supported the concept of an "exact spawn". Individual world providers can still

change this behaviour of course, but for default maps it makes sense to support it as a config option.
This commit is contained in:
cpw 2015-04-03 10:31:25 -04:00
parent e837b2e2cd
commit 38b9febfe5
2 changed files with 20 additions and 13 deletions

View File

@ -168,7 +168,7 @@
+ int spawnFuzz = field_76577_b.getSpawnFuzz();
+ int spawnFuzzHalf = spawnFuzz / 2;
+
+ if (!field_76576_e && !isAdventure)
+ if (!field_76576_e && !isAdventure && net.minecraftforge.common.ForgeModContainer.defaultHasSpawnFuzz)
+ {
+ chunkcoordinates.field_71574_a += this.field_76579_a.field_73012_v.nextInt(spawnFuzz) - spawnFuzzHalf;
+ chunkcoordinates.field_71573_c += this.field_76579_a.field_73012_v.nextInt(spawnFuzz) - spawnFuzzHalf;

View File

@ -68,6 +68,7 @@ public class ForgeModContainer extends DummyModContainer implements WorldAccessC
public static boolean shouldSortRecipies = true;
public static boolean disableVersionCheck = false;
public static int defaultSpawnFuzz = 20;
public static boolean defaultHasSpawnFuzz = true;
private static Configuration config;
@ -225,6 +226,12 @@ public class ForgeModContainer extends DummyModContainer implements WorldAccessC
defaultSpawnFuzz = prop.getInt(20);
propOrder.add(prop.getName());
prop = config.get(Configuration.CATEGORY_GENERAL, "spawnHasFuzz", Boolean.TRUE,
"If the overworld has ANY spawn fuzz at all. If not, the spawn will always be the exact same location.");
prop.setLanguageKey("forge.configgui.hasspawnfuzz").setRequiresWorldRestart(false);
defaultHasSpawnFuzz = prop.getBoolean(Boolean.TRUE);
propOrder.add(prop.getName());
config.setCategoryPropertyOrder(CATEGORY_GENERAL, propOrder);
if (config.hasChanged())