From ba0db4d03373bda5be0bd62d2e1b8ba07ce01e14 Mon Sep 17 00:00:00 2001 From: xGinko Date: Thu, 12 Sep 2024 19:23:47 +0200 Subject: [PATCH] change path and rename book-ban module --- .../patches/{BookBan.java => ItemDataBan.java} | 14 +++++++++----- .../patches/{BookBan.java => ItemDataBan.java} | 14 +++++++++----- 2 files changed, 18 insertions(+), 10 deletions(-) rename AnarchyExploitFixesFolia/src/main/java/me/xginko/aef/modules/patches/{BookBan.java => ItemDataBan.java} (94%) rename AnarchyExploitFixesLegacy/src/main/java/me/xginko/aef/modules/patches/{BookBan.java => ItemDataBan.java} (93%) diff --git a/AnarchyExploitFixesFolia/src/main/java/me/xginko/aef/modules/patches/BookBan.java b/AnarchyExploitFixesFolia/src/main/java/me/xginko/aef/modules/patches/ItemDataBan.java similarity index 94% rename from AnarchyExploitFixesFolia/src/main/java/me/xginko/aef/modules/patches/BookBan.java rename to AnarchyExploitFixesFolia/src/main/java/me/xginko/aef/modules/patches/ItemDataBan.java index 49d0197ca..130b1502d 100755 --- a/AnarchyExploitFixesFolia/src/main/java/me/xginko/aef/modules/patches/BookBan.java +++ b/AnarchyExploitFixesFolia/src/main/java/me/xginko/aef/modules/patches/ItemDataBan.java @@ -24,14 +24,18 @@ import java.time.Duration; import java.util.UUID; -public class BookBan extends AEFModule implements Listener { +public class ItemDataBan extends AEFModule implements Listener { private final Cache cachedItemSizes, cachedInventorySizes; private final int maxBookSize, maxItemSize, maxInventorySize, maxAuthorChars, maxTitleChars, maxPages; private final boolean useUTF16, kickOnBigBook; - public BookBan() { - super("patches.anti-book-ban"); + public ItemDataBan() { + super("patches.anti-item-ban"); + this.config.addComment(configPath+".enable", """ + More commonly known as book-ban:\s + Prevents player's getting banned from items with big nbt/compound data.\s + This check applies to all item data, not just books."""); this.useUTF16 = config.getBoolean(configPath + ".use-UTF-16", false, """ If set to false, will use UTF-8.\s Charset to use to encode the result of NBTCompound#toString into\s @@ -41,8 +45,8 @@ public BookBan() { this.maxBookSize = config.getInt(configPath + ".max-book-size", 56000); this.kickOnBigBook = config.getBoolean(configPath + ".kick-on-too-large-book-edit", true, "Kicks players when they try to create a book bigger than the limit."); - this.maxAuthorChars = config.getInt(configPath + ".max-author-chars", 32); - this.maxTitleChars = config.getInt(configPath + ".max-title-chars", 32); + this.maxAuthorChars = config.getInt(configPath + ".max-author-chars", 30); + this.maxTitleChars = config.getInt(configPath + ".max-title-chars", 30); this.maxPages = config.getInt(configPath + ".max-pages", 100); this.maxItemSize = config.getInt(configPath + ".max-item-size", 56000); this.maxInventorySize = config.getInt(configPath + ".max-inventory-size", 2050000); diff --git a/AnarchyExploitFixesLegacy/src/main/java/me/xginko/aef/modules/patches/BookBan.java b/AnarchyExploitFixesLegacy/src/main/java/me/xginko/aef/modules/patches/ItemDataBan.java similarity index 93% rename from AnarchyExploitFixesLegacy/src/main/java/me/xginko/aef/modules/patches/BookBan.java rename to AnarchyExploitFixesLegacy/src/main/java/me/xginko/aef/modules/patches/ItemDataBan.java index 708efe73d..d132c5846 100755 --- a/AnarchyExploitFixesLegacy/src/main/java/me/xginko/aef/modules/patches/BookBan.java +++ b/AnarchyExploitFixesLegacy/src/main/java/me/xginko/aef/modules/patches/ItemDataBan.java @@ -23,14 +23,18 @@ import java.time.Duration; import java.util.UUID; -public class BookBan extends AEFModule implements Listener { +public class ItemDataBan extends AEFModule implements Listener { private final Cache cachedItemSizes, cachedInventorySizes; private final int maxBookSize, maxItemSize, maxInventorySize, maxAuthorChars, maxTitleChars, maxPages; private final boolean useUTF16, kickOnBigBook; - public BookBan() { - super("patches.anti-book-ban"); + public ItemDataBan() { + super("patches.anti-item-ban"); + this.config.addComment(configPath+".enable", + "More commonly known as book-ban: \n" + + "Prevents player's getting banned from items with big nbt/compound data. \n" + + "This check applies to all item data, not just books."); this.useUTF16 = config.getBoolean(configPath + ".use-UTF-16", false, "If set to false, will use UTF-8. \n" + "Charset to use to encode the result of NBTCompound#toString into \n" + @@ -40,8 +44,8 @@ public BookBan() { this.maxBookSize = config.getInt(configPath + ".max-book-size", 56000); this.kickOnBigBook = config.getBoolean(configPath + ".kick-on-too-large-book-edit", true, "Kicks players when they try to create a book bigger than the limit."); - this.maxAuthorChars = config.getInt(configPath + ".max-author-chars", 32); - this.maxTitleChars = config.getInt(configPath + ".max-title-chars", 32); + this.maxAuthorChars = config.getInt(configPath + ".max-author-chars", 30); + this.maxTitleChars = config.getInt(configPath + ".max-title-chars", 30); this.maxPages = config.getInt(configPath + ".max-pages", 100); this.maxItemSize = config.getInt(configPath + ".max-item-size", 56000); this.maxInventorySize = config.getInt(configPath + ".max-inventory-size", 2050000);