Skip to content

Commit

Permalink
Use default item display if character limit is reached instead of blo…
Browse files Browse the repository at this point in the history
…cking
  • Loading branch information
LOOHP committed Sep 2, 2020
1 parent 226d0d8 commit 178bbef
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/com/loohp/interactivechat/Listeners/ChatPackets.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,8 @@ public void onPacketSending(PacketEvent event) {
} catch (Exception skip) {
return;
}
}

BaseComponent basecomponent = ChatComponentUtils.join(ComponentSerializer.parse(ChatColorUtils.filterIllegalColorCodes(ComponentSerializer.toString(basecomponentarray))));
}
BaseComponent basecomponent = ChatComponentUtils.join(ComponentSerializer.parse(ChatColorUtils.filterIllegalColorCodes(ComponentSerializer.toString(basecomponentarray))));
debug++;
try {
if (basecomponent.toLegacyText().equals("")) {
Expand Down
1 change: 1 addition & 0 deletions src/com/loohp/interactivechat/Listeners/Events.java
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ private void translateAltColorCode(AsyncPlayerChatEvent event) {

String message = ChatColorUtils.translateAlternateColorCodes(InteractiveChat.chatAltColorCode.get(), event.getMessage());
event.setMessage(message);
//Bukkit.getConsoleSender().sendMessage(message.replace(ChatColor.COLOR_CHAR, '&'));
}

private void translateAltColorCode(PlayerCommandPreprocessEvent event) {
Expand Down
2 changes: 1 addition & 1 deletion src/com/loohp/interactivechat/Modules/ItemDisplay.java
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public static BaseComponent process(BaseComponent basecomponent, Optional<Player
}
String itemJson = ItemNBTUtils.getNMSItemStackJson(item);
//Bukkit.getConsoleSender().sendMessage(itemJson.length() + "");
if (((InteractiveChat.version.isLegacy() || InteractiveChat.protocolManager.getProtocolVersion(reciever) < 393) && itemJson.length() > 30000) || (!InteractiveChat.version.isLegacy() && itemJson.length() > 200000)) {
if ((itemJson.length() > 30000 && InteractiveChat.block30000) || ((InteractiveChat.version.isLegacy() || InteractiveChat.protocolManager.getProtocolVersion(reciever) < 393) && itemJson.length() > 30000) || (!InteractiveChat.version.isLegacy() && itemJson.length() > 200000)) {
ItemStack trimedItem = new ItemStack(item.getType());
trimedItem.addUnsafeEnchantments(item.getEnchantments());
if (item.hasItemMeta() && item.getItemMeta().hasLore()) {
Expand Down

0 comments on commit 178bbef

Please sign in to comment.