mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2024-11-22 02:25:41 +01:00
Fixed MagicNumberCheck in MVWorld
This commit is contained in:
parent
76629ebd25
commit
d48927787b
@ -93,7 +93,9 @@
|
|||||||
</module>
|
</module>
|
||||||
<module name="IllegalInstantiation"/>
|
<module name="IllegalInstantiation"/>
|
||||||
<module name="InnerAssignment"/>
|
<module name="InnerAssignment"/>
|
||||||
<module name="MagicNumber"/>
|
<module name="MagicNumber">
|
||||||
|
<property name="ignoreNumbers" value="-1, 0, 1, 2, 8"/>
|
||||||
|
</module>
|
||||||
<module name="MissingSwitchDefault"/>
|
<module name="MissingSwitchDefault"/>
|
||||||
<module name="RedundantThrows"/>
|
<module name="RedundantThrows"/>
|
||||||
<module name="SimplifyBooleanExpression"/>
|
<module name="SimplifyBooleanExpression"/>
|
||||||
|
@ -830,6 +830,9 @@ public class MVWorld implements MultiverseWorld {
|
|||||||
this.saveConfig();
|
this.saveConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static final int SPAWN_LOCATION_SEARCH_TOLERANCE = 16;
|
||||||
|
private static final int SPAWN_LOCATION_SEARCH_RADIUS = 16;
|
||||||
|
|
||||||
private Location readSpawnFromConfig(World w) {
|
private Location readSpawnFromConfig(World w) {
|
||||||
Location spawnLocation = w.getSpawnLocation();
|
Location spawnLocation = w.getSpawnLocation();
|
||||||
Location configLocation = this.getSpawnLocation();
|
Location configLocation = this.getSpawnLocation();
|
||||||
@ -850,7 +853,8 @@ public class MVWorld implements MultiverseWorld {
|
|||||||
// If it's not, find a better one.
|
// If it's not, find a better one.
|
||||||
this.plugin.log(Level.WARNING, "Spawn location from world.dat file was unsafe. Adjusting...");
|
this.plugin.log(Level.WARNING, "Spawn location from world.dat file was unsafe. Adjusting...");
|
||||||
this.plugin.log(Level.WARNING, "Original Location: " + LocationManipulation.strCoordsRaw(spawnLocation));
|
this.plugin.log(Level.WARNING, "Original Location: " + LocationManipulation.strCoordsRaw(spawnLocation));
|
||||||
Location newSpawn = teleporter.getSafeLocation(spawnLocation, 16, 16);
|
Location newSpawn = teleporter.getSafeLocation(spawnLocation,
|
||||||
|
SPAWN_LOCATION_SEARCH_TOLERANCE, SPAWN_LOCATION_SEARCH_RADIUS);
|
||||||
// I think we could also do this, as I think this is what Notch does.
|
// I think we could also do this, as I think this is what Notch does.
|
||||||
// Not sure how it will work in the nether...
|
// Not sure how it will work in the nether...
|
||||||
//Location newSpawn = this.spawnLocation.getWorld().getHighestBlockAt(this.spawnLocation).getLocation();
|
//Location newSpawn = this.spawnLocation.getWorld().getHighestBlockAt(this.spawnLocation).getLocation();
|
||||||
|
Loading…
Reference in New Issue
Block a user