mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2025-03-12 14:39:12 +01:00
Fixed parsing incorrect weather.
This commit is contained in:
parent
32f5383f3e
commit
4aafc87b55
@ -353,17 +353,17 @@ public class Island {
|
||||
|
||||
public boolean isInBorder(Location blockLocation) {
|
||||
WorldManager worldManager = skyblock.getWorldManager();
|
||||
if(!isBorder()) {
|
||||
if (!isBorder()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Location islandLocation = getLocation(worldManager.getIslandWorld(blockLocation.getWorld()), IslandEnvironment.Island);
|
||||
double halfSize = Math.floor(getRadius());
|
||||
|
||||
if(blockLocation.getBlockX() > (islandLocation.getBlockX()+halfSize)
|
||||
|| blockLocation.getBlockX() < (islandLocation.getBlockX()-halfSize-1)
|
||||
|| blockLocation.getBlockZ() > (islandLocation.getBlockZ()+halfSize)
|
||||
|| blockLocation.getBlockZ() < (islandLocation.getBlockZ()-halfSize-1)) {
|
||||
if (blockLocation.getBlockX() > (islandLocation.getBlockX() + halfSize)
|
||||
|| blockLocation.getBlockX() < (islandLocation.getBlockX() - halfSize - 1)
|
||||
|| blockLocation.getBlockZ() > (islandLocation.getBlockZ() + halfSize)
|
||||
|| blockLocation.getBlockZ() < (islandLocation.getBlockZ() - halfSize - 1)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -413,10 +413,14 @@ public class Island {
|
||||
|
||||
WeatherType weatherType;
|
||||
|
||||
if (weatherTypeName == null || weatherTypeName.isEmpty() || WeatherType.valueOf(weatherTypeName) == null) {
|
||||
if (weatherTypeName == null || weatherTypeName.isEmpty()) {
|
||||
weatherType = WeatherType.CLEAR;
|
||||
} else {
|
||||
try {
|
||||
weatherType = WeatherType.valueOf(weatherTypeName);
|
||||
} catch (IllegalArgumentException e) {
|
||||
weatherType = WeatherType.CLEAR;
|
||||
}
|
||||
}
|
||||
|
||||
return weatherType;
|
||||
|
Loading…
Reference in New Issue
Block a user