Skip to content

Commit

Permalink
change path and rename book-ban module
Browse files Browse the repository at this point in the history
  • Loading branch information
xGinko committed Sep 12, 2024
1 parent 97d90f6 commit ba0db4d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<UUID, Integer> 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
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<UUID, Integer> 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" +
Expand All @@ -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);
Expand Down

0 comments on commit ba0db4d

Please sign in to comment.