From c3349f8b4c9e12f81371b39d83d99028bcc6ee60 Mon Sep 17 00:00:00 2001 From: ProfElements Date: Fri, 19 Feb 2021 13:20:02 -0600 Subject: [PATCH] Actually comment the file --- .../items/electric/machines/BookBinder.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/BookBinder.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/BookBinder.java index 6129fd0cb..1b7f2dbfa 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/BookBinder.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/BookBinder.java @@ -63,6 +63,7 @@ public class BookBinder extends AContainer { enchantMeta.addStoredEnchant(entry.getKey(), entry.getValue(), bypassVanillaMaxLevel.getValue()); } + //Make sure we never return a no enchant enchanted book. if (enchantMeta.getStoredEnchants().isEmpty()) { return null; } @@ -113,6 +114,8 @@ public class BookBinder extends AContainer { for (Map.Entry entry : ech2.entrySet()) { for (Map.Entry conflictsWith : enchantments.entrySet()) { + + //Check if entry enchantments and conflictsWith enchantment conflict, and confirms that the enchantsments aren't the exact same. if (entry.getKey().conflictsWith(conflictsWith.getKey()) && entry.getKey() != conflictsWith.getKey()) { conflicts = true; } @@ -123,7 +126,9 @@ public class BookBinder extends AContainer { int enchantMaxLevel = entry.getKey().getMaxLevel(); if (a.intValue() == b.intValue()) { - if (enchantMaxLevel <= a) { + + //Confirm the entries enchant level doesnt go over the maximums unless it uses bypass-vanilla-max-level + if (enchantMaxLevel <= a && !bypassVanillaMaxLevel.getValue()) { return enchantMaxLevel; } else if (hasCustomMaxLevel.getValue()) { @@ -134,7 +139,8 @@ public class BookBinder extends AContainer { } else { int highestLevel = Math.max(a, b); - if (enchantMaxLevel <= highestLevel) { + //Confirm the entries enchant level doesnt go over the maximums unless it uses bypass-vanilla-max-level + if (enchantMaxLevel <= highestLevel && !bypassVanillaMaxLevel.getValue()) { return enchantMaxLevel; } else if (hasCustomMaxLevel.getValue()) {