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:
parent
e837b2e2cd
commit
38b9febfe5
2 changed files with 20 additions and 13 deletions
|
@ -51,11 +51,11 @@
|
||||||
+ private IRenderHandler skyRenderer = null;
|
+ private IRenderHandler skyRenderer = null;
|
||||||
+ private IRenderHandler cloudRenderer = null;
|
+ private IRenderHandler cloudRenderer = null;
|
||||||
+ private IRenderHandler weatherRenderer = null;
|
+ private IRenderHandler weatherRenderer = null;
|
||||||
+
|
+
|
||||||
+ /**
|
+ /**
|
||||||
+ * Sets the providers current dimension ID, used in default getSaveFolder()
|
+ * Sets the providers current dimension ID, used in default getSaveFolder()
|
||||||
+ * Added to allow default providers to be registered for multiple dimensions.
|
+ * Added to allow default providers to be registered for multiple dimensions.
|
||||||
+ *
|
+ *
|
||||||
+ * @param dim Dimension ID
|
+ * @param dim Dimension ID
|
||||||
+ */
|
+ */
|
||||||
+ public void setDimension(int dim)
|
+ public void setDimension(int dim)
|
||||||
|
@ -105,7 +105,7 @@
|
||||||
+ else if (this instanceof WorldProviderHell)
|
+ else if (this instanceof WorldProviderHell)
|
||||||
+ {
|
+ {
|
||||||
+ return "Leaving the Nether";
|
+ return "Leaving the Nether";
|
||||||
+ }
|
+ }
|
||||||
+ return null;
|
+ return null;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
|
@ -168,7 +168,7 @@
|
||||||
+ int spawnFuzz = field_76577_b.getSpawnFuzz();
|
+ int spawnFuzz = field_76577_b.getSpawnFuzz();
|
||||||
+ int spawnFuzzHalf = spawnFuzz / 2;
|
+ 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_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;
|
+ chunkcoordinates.field_71573_c += this.field_76579_a.field_73012_v.nextInt(spawnFuzz) - spawnFuzzHalf;
|
||||||
|
@ -177,10 +177,10 @@
|
||||||
+
|
+
|
||||||
+ return chunkcoordinates;
|
+ return chunkcoordinates;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ /**
|
+ /**
|
||||||
+ * Determine if the cusor on the map should 'spin' when rendered, like it does for the player in the nether.
|
+ * Determine if the cusor on the map should 'spin' when rendered, like it does for the player in the nether.
|
||||||
+ *
|
+ *
|
||||||
+ * @param entity The entity holding the map, playername, or frame-ENTITYID
|
+ * @param entity The entity holding the map, playername, or frame-ENTITYID
|
||||||
+ * @param x X Position
|
+ * @param x X Position
|
||||||
+ * @param y Y Position
|
+ * @param y Y Position
|
||||||
|
@ -194,7 +194,7 @@
|
||||||
+
|
+
|
||||||
+ /**
|
+ /**
|
||||||
+ * Determines the dimension the player will be respawned in, typically this brings them back to the overworld.
|
+ * Determines the dimension the player will be respawned in, typically this brings them back to the overworld.
|
||||||
+ *
|
+ *
|
||||||
+ * @param player The player that is respawning
|
+ * @param player The player that is respawning
|
||||||
+ * @return The dimension to respawn the player in
|
+ * @return The dimension to respawn the player in
|
||||||
+ */
|
+ */
|
||||||
|
@ -214,20 +214,20 @@
|
||||||
+ {
|
+ {
|
||||||
+ return field_76579_a.field_73008_k < 4;
|
+ return field_76579_a.field_73008_k < 4;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ /**
|
+ /**
|
||||||
+ * The current sun brightness factor for this dimension.
|
+ * The current sun brightness factor for this dimension.
|
||||||
+ * 0.0f means no light at all, and 1.0f means maximum sunlight.
|
+ * 0.0f means no light at all, and 1.0f means maximum sunlight.
|
||||||
+ * This will be used for the "calculateSkylightSubtracted"
|
+ * This will be used for the "calculateSkylightSubtracted"
|
||||||
+ * which is for Sky light value calculation.
|
+ * which is for Sky light value calculation.
|
||||||
+ *
|
+ *
|
||||||
+ * @return The current brightness factor
|
+ * @return The current brightness factor
|
||||||
+ * */
|
+ * */
|
||||||
+ public float getSunBrightnessFactor(float par1)
|
+ public float getSunBrightnessFactor(float par1)
|
||||||
+ {
|
+ {
|
||||||
+ return field_76579_a.getSunBrightnessFactor(par1);
|
+ return field_76579_a.getSunBrightnessFactor(par1);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ /**
|
+ /**
|
||||||
+ * Calculates the current moon phase factor.
|
+ * Calculates the current moon phase factor.
|
||||||
+ * This factor is effective for slimes.
|
+ * This factor is effective for slimes.
|
||||||
|
@ -258,7 +258,7 @@
|
||||||
+ {
|
+ {
|
||||||
+ return field_76579_a.getSunBrightnessBody(par1);
|
+ return field_76579_a.getSunBrightnessBody(par1);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ /**
|
+ /**
|
||||||
+ * Gets the Star Brightness for rendering sky.
|
+ * Gets the Star Brightness for rendering sky.
|
||||||
+ * */
|
+ * */
|
||||||
|
|
|
@ -68,6 +68,7 @@ public class ForgeModContainer extends DummyModContainer implements WorldAccessC
|
||||||
public static boolean shouldSortRecipies = true;
|
public static boolean shouldSortRecipies = true;
|
||||||
public static boolean disableVersionCheck = false;
|
public static boolean disableVersionCheck = false;
|
||||||
public static int defaultSpawnFuzz = 20;
|
public static int defaultSpawnFuzz = 20;
|
||||||
|
public static boolean defaultHasSpawnFuzz = true;
|
||||||
|
|
||||||
private static Configuration config;
|
private static Configuration config;
|
||||||
|
|
||||||
|
@ -225,6 +226,12 @@ public class ForgeModContainer extends DummyModContainer implements WorldAccessC
|
||||||
defaultSpawnFuzz = prop.getInt(20);
|
defaultSpawnFuzz = prop.getInt(20);
|
||||||
propOrder.add(prop.getName());
|
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);
|
config.setCategoryPropertyOrder(CATEGORY_GENERAL, propOrder);
|
||||||
|
|
||||||
if (config.hasChanged())
|
if (config.hasChanged())
|
||||||
|
@ -253,7 +260,7 @@ public class ForgeModContainer extends DummyModContainer implements WorldAccessC
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void playerLogin(PlayerEvent.PlayerLoggedInEvent event)
|
public void playerLogin(PlayerEvent.PlayerLoggedInEvent event)
|
||||||
{
|
{
|
||||||
|
@ -280,7 +287,7 @@ public class ForgeModContainer extends DummyModContainer implements WorldAccessC
|
||||||
MinecraftForge.EVENT_BUS.register(MinecraftForge.INTERNAL_HANDLER);
|
MinecraftForge.EVENT_BUS.register(MinecraftForge.INTERNAL_HANDLER);
|
||||||
ForgeChunkManager.captureConfig(evt.getModConfigurationDirectory());
|
ForgeChunkManager.captureConfig(evt.getModConfigurationDirectory());
|
||||||
FMLCommonHandler.instance().bus().register(this);
|
FMLCommonHandler.instance().bus().register(this);
|
||||||
|
|
||||||
if (!ForgeModContainer.disableVersionCheck)
|
if (!ForgeModContainer.disableVersionCheck)
|
||||||
{
|
{
|
||||||
ForgeVersion.startVersionCheck();
|
ForgeVersion.startVersionCheck();
|
||||||
|
|
Loading…
Reference in a new issue