Bug fixes
This commit is contained in:
parent
539411ffec
commit
c10ea55d7e
6 changed files with 16 additions and 24 deletions
2
pom.xml
2
pom.xml
|
@ -90,7 +90,7 @@
|
|||
<dependency>
|
||||
<groupId>com.github.cryptomorin</groupId>
|
||||
<artifactId>XSeries</artifactId>
|
||||
<version>8.2.0</version>
|
||||
<version>8.4.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sk89q.worldguard</groupId>
|
||||
|
|
|
@ -2,7 +2,6 @@ package nl.iobyte.themepark.api.database.objects;
|
|||
|
||||
import nl.iobyte.themepark.scheduler.ThemeParkScheduler;
|
||||
import nl.iobyte.themepark.scheduler.Task;
|
||||
|
||||
import java.sql.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
|
|
@ -22,25 +22,23 @@ public class SignDataLoader implements IDataLoader {
|
|||
ConfigurationManager manager = api.getConfigurationManager();
|
||||
|
||||
for(Attraction attraction : api.getAttractionService().getAttractions().values()) {
|
||||
if(attraction == null) {
|
||||
return;
|
||||
}
|
||||
if(attraction == null)
|
||||
continue;
|
||||
|
||||
if(!manager.contains(StorageLocation.SIGN_DATA, "signs." + attraction.getID())) {
|
||||
return;
|
||||
}
|
||||
if(!manager.contains(StorageLocation.SIGN_DATA, "signs." + attraction.getID()))
|
||||
continue;
|
||||
|
||||
List<String> locations = manager.getStringList(StorageLocation.SIGN_DATA, "signs." + attraction.getID());
|
||||
for(String string : locations) {
|
||||
Location location = LocationUtil.fromString(string);
|
||||
if(location == null) {
|
||||
if(location == null)
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if(!(location.getBlock().getState() instanceof Sign)) {
|
||||
if(location.getBlock() == null)
|
||||
continue;
|
||||
|
||||
if(!(location.getBlock().getState() instanceof Sign))
|
||||
continue;
|
||||
}
|
||||
|
||||
api.getSignManager().addSign(new StatusSign(attraction, location));
|
||||
}
|
||||
|
|
|
@ -27,11 +27,7 @@ public class StatusSign {
|
|||
|
||||
public void update() {
|
||||
Status status = attraction.getStatus();
|
||||
boolean b = location.getChunk().isLoaded();
|
||||
if(!b)
|
||||
location.getChunk().load(true);
|
||||
|
||||
if(!location.getChunk().isLoaded())
|
||||
if(location.getBlock() == null)
|
||||
return;
|
||||
|
||||
if(!(location.getBlock().getState() instanceof Sign)) {
|
||||
|
@ -42,10 +38,7 @@ public class StatusSign {
|
|||
Sign sign = (Sign) location.getBlock().getState();
|
||||
sign.setLine(1, Text.color(attraction.getName()));
|
||||
sign.setLine(2, Text.color(status.getColor()+status.getName()));
|
||||
sign.update();
|
||||
|
||||
if(!b)
|
||||
location.getChunk().unload();
|
||||
sign.update(true);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,5 +1,7 @@
|
|||
package nl.iobyte.themepark.logger;
|
||||
|
||||
import nl.iobyte.themepark.ThemePark;
|
||||
|
||||
public class ThemeParkLogger {
|
||||
|
||||
/**
|
||||
|
@ -7,7 +9,7 @@ public class ThemeParkLogger {
|
|||
* @param msg Message string
|
||||
*/
|
||||
public static void toConsole(String msg) {
|
||||
System.out.println("[ThemePark] "+msg);
|
||||
ThemePark.getInstance().getLogger().info(msg);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Reference in a new issue