From c0e9e8f1055a90038ddbc0abb2fe81e5042fa2d5 Mon Sep 17 00:00:00 2001 From: Vincent Lee Date: Mon, 23 Dec 2019 15:52:19 -0600 Subject: [PATCH] Cleanup --- .../api/corporea/CorporeaRequestDefaultMatchers.java | 7 ++++--- .../botania/api/corporea/ICorporeaRequestMatcher.java | 8 +++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/main/java/vazkii/botania/api/corporea/CorporeaRequestDefaultMatchers.java b/src/main/java/vazkii/botania/api/corporea/CorporeaRequestDefaultMatchers.java index 86471451f..dfd938fd5 100644 --- a/src/main/java/vazkii/botania/api/corporea/CorporeaRequestDefaultMatchers.java +++ b/src/main/java/vazkii/botania/api/corporea/CorporeaRequestDefaultMatchers.java @@ -13,11 +13,12 @@ package vazkii.botania.api.corporea; import net.minecraft.item.ItemStack; import net.minecraft.nbt.CompoundNBT; +import java.util.function.Function; import java.util.regex.Pattern; /** * An interface for a Corporea Request matcher. Accepts an ItemStack and returns whether it fulfills the request. - * Needs to be registered over in {@link vazkii.botania.common.block.tile.corporea.TileCorporeaRetainer.corporeaMatchers}. + * Needs to be registered over in {@link vazkii.botania.common.block.tile.corporea.TileCorporeaRetainer#addCorporeaRequestMatcher}. */ public final class CorporeaRequestDefaultMatchers { @@ -78,12 +79,12 @@ public final class CorporeaRequestDefaultMatchers { tag.putBoolean(TAG_REQUEST_CONTAINS, contains); } - public boolean equalOrContain(String str) { + private boolean equalOrContain(String str) { return contains ? str.contains(expression) : str.equals(expression); } // Copy from StringUtils - public static String stripControlCodes(String str) { + private static String stripControlCodes(String str) { return patternControlCode.matcher(str).replaceAll(""); } } diff --git a/src/main/java/vazkii/botania/api/corporea/ICorporeaRequestMatcher.java b/src/main/java/vazkii/botania/api/corporea/ICorporeaRequestMatcher.java index b30fd0ae6..90b480748 100644 --- a/src/main/java/vazkii/botania/api/corporea/ICorporeaRequestMatcher.java +++ b/src/main/java/vazkii/botania/api/corporea/ICorporeaRequestMatcher.java @@ -13,9 +13,11 @@ package vazkii.botania.api.corporea; import net.minecraft.item.ItemStack; import net.minecraft.nbt.CompoundNBT; +import java.util.function.Function; + /** * An interface for a Corporea Request matcher. Accepts an ItemStack and returns whether it fulfills the request. - * Needs to be registered over in {@link vazkii.botania.common.block.tile.corporea.TileCorporeaRetainer.corporeaMatchers}. + * Needs to be registered over in {@link vazkii.botania.common.block.tile.corporea.TileCorporeaRetainer#addCorporeaRequestMatcher}. * Needs one additional (static) method for deserialization, which can't really go here because Java doesn't like static abstract's. */ public interface ICorporeaRequestMatcher { @@ -23,10 +25,10 @@ public interface ICorporeaRequestMatcher { /** * Returns whether the given stack matches the request's criteria. */ - public boolean isStackValid(ItemStack stack); + boolean isStackValid(ItemStack stack); /** * Serialize to NBT data, for the Corporea Retainer's benefit. */ - public void writeToNBT(CompoundNBT tag); + void writeToNBT(CompoundNBT tag); }