Skip to content

Commit

Permalink
Fixes #210
Browse files Browse the repository at this point in the history
  • Loading branch information
LOOHP committed May 12, 2024
1 parent 46dd4e8 commit 1fa7c51
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public class InteractiveChatComponentSerializer {
.value(JSONOptions.EMIT_RGB, true)
.value(JSONOptions.EMIT_HOVER_EVENT_TYPE, JSONOptions.HoverEventValueMode.BOTH)
.value(JSONOptions.EMIT_DEFAULT_ITEM_HOVER_QUANTITY, true)
.value(JSONOptions.EMIT_HOVER_SHOW_ENTITY_ID_AS_INT_ARRAY, InteractiveChat.version.isNewerOrEqualTo(MCVersion.V1_20_3))
.value(JSONOptions.EMIT_HOVER_SHOW_ENTITY_ID_AS_INT_ARRAY, isProxyEnvironment() || InteractiveChat.version.isNewerOrEqualTo(MCVersion.V1_20_3))
.build()
)
.build()
Expand All @@ -104,6 +104,15 @@ public class InteractiveChatComponentSerializer {
LEGACY_COMPONENT_SERIALIZER = LegacyComponentSerializer.legacySection().toBuilder().hexColors().useUnusualXRepeatedCharacterHexFormat().build();
}

private static boolean isProxyEnvironment() {
try {
Class.forName("org.bukkit.plugin.java.JavaPlugin");
return true;
} catch (ClassNotFoundException e) {
return false;
}
}

public static InteractiveChatBungeecordAPILegacyComponentSerializer bungeecordApiLegacy() {
return BUNGEECORD_CHAT_LEGACY;
}
Expand Down

0 comments on commit 1fa7c51

Please sign in to comment.