diff --git a/api/src/main/java/net/donnypz/displayentityutils/managers/DisplayObjectInputStream.java b/api/src/main/java/net/donnypz/displayentityutils/managers/DisplayObjectInputStream.java index c3921046..86ce77a5 100644 --- a/api/src/main/java/net/donnypz/displayentityutils/managers/DisplayObjectInputStream.java +++ b/api/src/main/java/net/donnypz/displayentityutils/managers/DisplayObjectInputStream.java @@ -13,7 +13,7 @@ class DisplayObjectInputStream extends ObjectInputStream { private static final String OLD_PACKAGE = "com.pzdonny"; private static final String NEW_PACKAGE = "net.donnypz"; private static final String BUKKIT_SOUND_ENUM = "org.bukkit.Sound"; - private static final String ANIMATION_SOUND = "AnimationSound"; + private static final String ANIMATION_SOUND_CLASS = "AnimationSound"; DisplayObjectInputStream(InputStream in) throws IOException { super(in); } @@ -36,7 +36,7 @@ protected ObjectStreamClass readClassDescriptor() throws IOException, ClassNotFo if (name.equals(BUKKIT_SOUND_ENUM)){ //Because of old sound HashMaps using an enum return ObjectStreamClass.lookup(OldSound.class); } - if (name.endsWith(ANIMATION_SOUND)){ + if (name.endsWith(ANIMATION_SOUND_CLASS)){ return ObjectStreamClass.lookup(DEUSound.class); } return desc; diff --git a/api/src/main/java/net/donnypz/displayentityutils/utils/DisplayEntities/MannequinEntity.java b/api/src/main/java/net/donnypz/displayentityutils/utils/DisplayEntities/MannequinEntity.java index 6f79ccb4..fd168bc1 100644 --- a/api/src/main/java/net/donnypz/displayentityutils/utils/DisplayEntities/MannequinEntity.java +++ b/api/src/main/java/net/donnypz/displayentityutils/utils/DisplayEntities/MannequinEntity.java @@ -1,7 +1,6 @@ package net.donnypz.displayentityutils.utils.DisplayEntities; import net.donnypz.displayentityutils.DisplayAPI; -import net.donnypz.displayentityutils.utils.DisplayUtils; import net.donnypz.displayentityutils.utils.WorldUtils; import net.donnypz.displayentityutils.utils.packet.PacketAttributeContainer; import net.donnypz.displayentityutils.utils.packet.attributes.DisplayAttributes; diff --git a/api/src/main/java/net/donnypz/displayentityutils/utils/bdengine/BDEngineUtils.java b/api/src/main/java/net/donnypz/displayentityutils/utils/bdengine/BDEngineUtils.java index 078067be..99810966 100644 --- a/api/src/main/java/net/donnypz/displayentityutils/utils/bdengine/BDEngineUtils.java +++ b/api/src/main/java/net/donnypz/displayentityutils/utils/bdengine/BDEngineUtils.java @@ -30,6 +30,7 @@ public final class BDEngineUtils { private static final String BDENGINE_URL = "https://block-display.com/server-api/?id="; private static final HttpClient HTTP_CLIENT = HttpClient .newBuilder() + .followRedirects(HttpClient.Redirect.NORMAL) .connectTimeout(Duration.ofSeconds(TIMEOUT_TIME)) .build(); @@ -57,13 +58,14 @@ public static BDEResult importProject(int exportID) throws IOException, Interrup HttpResponse response = HTTP_CLIENT.send(getRequest, HttpResponse.BodyHandlers.ofString()); //Check for error this way since an error returns a 200 status code regardless + String responseBody = response.body(); try{ - BDEngineError error = GSON.fromJson(response.body(), BDEngineError.class); + BDEngineError error = GSON.fromJson(responseBody, BDEngineError.class); if (error.getError() != null) throw new IOException(error.getError()); } catch(JsonSyntaxException e){} - return BDEResult.create(response.body()); + return BDEResult.create(responseBody); } /** diff --git a/plugin/src/main/resources/config.yml b/plugin/src/main/resources/config.yml index 01bfad35..bdbe02a0 100644 --- a/plugin/src/main/resources/config.yml +++ b/plugin/src/main/resources/config.yml @@ -41,9 +41,8 @@ autoSelectGroups: false #The default persistence value that should be applied when spawning a group defaultPersistence: true -#Attempts to automatically detect Spawned Display Entity Groups on Server Start -#Also attempts to asynchronously detect groups when a chunk loads -#This feature may not work 100% work on worlds that keep spawn in memory, but will work after a world reload (unload -> load) +#Attempts to automatically detect spawned Display Entity Groups/Models on server start & chunk loads (asynchronously) +#This feature may not work on worlds that keep spawn in memory, but will work after a world reload (unload -> load) automaticGroupDetection: enabled: true @@ -87,10 +86,8 @@ automaticGroupDetection: #Enable this to allow overwriting of existing saved DisplayEntityGroups and Animations overwriteExistingSaves: true -#This setting attempts to automatically cull display groups/models, improving client performance for players: -#If entities are culled too early, try increasing the width and height culling adders -# -#Culling may not be 100% perfect due to different positioning of block/item/text displays, and varying block/item shapes +#This setting attempts to automatically cull display entity groups/models, improving client performance for players: +#If entities are culled too early/late, adjust the width and height culling adders accordingly autoCulling: enabled: false