3
0
Fork 0

Bug fixes

This commit is contained in:
thomas 2021-12-21 17:06:52 +01:00
parent 539411ffec
commit c10ea55d7e
6 changed files with 16 additions and 24 deletions

View file

@ -90,7 +90,7 @@
<dependency> <dependency>
<groupId>com.github.cryptomorin</groupId> <groupId>com.github.cryptomorin</groupId>
<artifactId>XSeries</artifactId> <artifactId>XSeries</artifactId>
<version>8.2.0</version> <version>8.4.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.sk89q.worldguard</groupId> <groupId>com.sk89q.worldguard</groupId>

View file

@ -2,7 +2,6 @@ package nl.iobyte.themepark.api.database.objects;
import nl.iobyte.themepark.scheduler.ThemeParkScheduler; import nl.iobyte.themepark.scheduler.ThemeParkScheduler;
import nl.iobyte.themepark.scheduler.Task; import nl.iobyte.themepark.scheduler.Task;
import java.sql.*; import java.sql.*;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;

View file

@ -22,25 +22,23 @@ public class SignDataLoader implements IDataLoader {
ConfigurationManager manager = api.getConfigurationManager(); ConfigurationManager manager = api.getConfigurationManager();
for(Attraction attraction : api.getAttractionService().getAttractions().values()) { for(Attraction attraction : api.getAttractionService().getAttractions().values()) {
if(attraction == null) { if(attraction == null)
return; continue;
}
if(!manager.contains(StorageLocation.SIGN_DATA, "signs." + attraction.getID())) { if(!manager.contains(StorageLocation.SIGN_DATA, "signs." + attraction.getID()))
return; continue;
}
List<String> locations = manager.getStringList(StorageLocation.SIGN_DATA, "signs." + attraction.getID()); List<String> locations = manager.getStringList(StorageLocation.SIGN_DATA, "signs." + attraction.getID());
for(String string : locations) { for(String string : locations) {
Location location = LocationUtil.fromString(string); Location location = LocationUtil.fromString(string);
if(location == null) { if(location == null)
continue; continue;
}
if(location.getBlock() == null)
if(!(location.getBlock().getState() instanceof Sign)) { continue;
if(!(location.getBlock().getState() instanceof Sign))
continue; continue;
}
api.getSignManager().addSign(new StatusSign(attraction, location)); api.getSignManager().addSign(new StatusSign(attraction, location));
} }

View file

@ -27,11 +27,7 @@ public class StatusSign {
public void update() { public void update() {
Status status = attraction.getStatus(); Status status = attraction.getStatus();
boolean b = location.getChunk().isLoaded(); if(location.getBlock() == null)
if(!b)
location.getChunk().load(true);
if(!location.getChunk().isLoaded())
return; return;
if(!(location.getBlock().getState() instanceof Sign)) { if(!(location.getBlock().getState() instanceof Sign)) {
@ -42,10 +38,7 @@ public class StatusSign {
Sign sign = (Sign) location.getBlock().getState(); Sign sign = (Sign) location.getBlock().getState();
sign.setLine(1, Text.color(attraction.getName())); sign.setLine(1, Text.color(attraction.getName()));
sign.setLine(2, Text.color(status.getColor()+status.getName())); sign.setLine(2, Text.color(status.getColor()+status.getName()));
sign.update(); sign.update(true);
if(!b)
location.getChunk().unload();
} }
} }

View file

@ -1,5 +1,7 @@
package nl.iobyte.themepark.logger; package nl.iobyte.themepark.logger;
import nl.iobyte.themepark.ThemePark;
public class ThemeParkLogger { public class ThemeParkLogger {
/** /**
@ -7,7 +9,7 @@ public class ThemeParkLogger {
* @param msg Message string * @param msg Message string
*/ */
public static void toConsole(String msg) { public static void toConsole(String msg) {
System.out.println("[ThemePark] "+msg); ThemePark.getInstance().getLogger().info(msg);
} }
} }

View file

@ -43,4 +43,4 @@ items:
data: 0 data: 0
material: JUKEBOX material: JUKEBOX
action: COMMAND action: COMMAND
command: /audio command: /audio