Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -57,13 +58,14 @@ public static BDEResult importProject(int exportID) throws IOException, Interrup
HttpResponse<String> 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);
}

/**
Expand Down
11 changes: 4 additions & 7 deletions plugin/src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
Loading