aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/shedaniel/rei/client
diff options
context:
space:
mode:
authorUnknown <shekwancheung0528@gmail.com>2019-03-30 20:21:18 +0800
committerUnknown <shekwancheung0528@gmail.com>2019-03-30 20:21:18 +0800
commit16e35bc7ddb5924008be5be1b60db29d461d72b5 (patch)
tree6b4405a47f6a902f4900e72d140304e3524ee0b5 /src/main/java/me/shedaniel/rei/client
parentd5b270a829f5488ba6ab72778745da1f64769ff8 (diff)
downloadRoughlyEnoughItems-16e35bc7ddb5924008be5be1b60db29d461d72b5.tar.gz
RoughlyEnoughItems-16e35bc7ddb5924008be5be1b60db29d461d72b5.tar.bz2
RoughlyEnoughItems-16e35bc7ddb5924008be5be1b60db29d461d72b5.zip
Using Cloth events instead of overwriting methods
Diffstat (limited to 'src/main/java/me/shedaniel/rei/client')
-rw-r--r--src/main/java/me/shedaniel/rei/client/RecipeHelperImpl.java6
-rw-r--r--src/main/java/me/shedaniel/rei/client/ScreenHelper.java14
2 files changed, 3 insertions, 17 deletions
diff --git a/src/main/java/me/shedaniel/rei/client/RecipeHelperImpl.java b/src/main/java/me/shedaniel/rei/client/RecipeHelperImpl.java
index 539897376..52f5721a8 100644
--- a/src/main/java/me/shedaniel/rei/client/RecipeHelperImpl.java
+++ b/src/main/java/me/shedaniel/rei/client/RecipeHelperImpl.java
@@ -167,7 +167,7 @@ public class RecipeHelperImpl implements RecipeHelper {
plugins.sort((first, second) -> {
return second.getPriority() - first.getPriority();
});
- RoughlyEnoughItemsCore.LOGGER.info("Loading %d REI plugins: %s", plugins.size(), String.join(", ", plugins.stream().map(plugin -> {
+ RoughlyEnoughItemsCore.LOGGER.info("[REI] Loading %d plugins: %s", plugins.size(), String.join(", ", plugins.stream().map(plugin -> {
return RoughlyEnoughItemsCore.getPluginIdentifier(plugin).map(Identifier::toString).orElseGet(() -> "null");
}).collect(Collectors.toList())));
Collections.reverse(plugins);
@@ -184,8 +184,8 @@ public class RecipeHelperImpl implements RecipeHelper {
if (pluginDisabler.isFunctionEnabled(identifier, PluginFunction.REGISTER_SPEED_CRAFT))
plugin.registerSpeedCraft(this);
});
- RoughlyEnoughItemsCore.LOGGER.info("Registered REI Categories: " + String.join(", ", categories.stream().map(RecipeCategory::getCategoryName).collect(Collectors.toList())));
- RoughlyEnoughItemsCore.LOGGER.info("Registered %d recipes for REI.", recipeCount.get());
+ RoughlyEnoughItemsCore.LOGGER.info("[REI] Registered Categories: " + String.join(", ", categories.stream().map(RecipeCategory::getCategoryName).collect(Collectors.toList())));
+ RoughlyEnoughItemsCore.LOGGER.info("[REI] Registered %d recipes.", recipeCount.get());
}
@Override
diff --git a/src/main/java/me/shedaniel/rei/client/ScreenHelper.java b/src/main/java/me/shedaniel/rei/client/ScreenHelper.java
index fa109b98d..a0bb52ae4 100644
--- a/src/main/java/me/shedaniel/rei/client/ScreenHelper.java
+++ b/src/main/java/me/shedaniel/rei/client/ScreenHelper.java
@@ -1,7 +1,6 @@
package me.shedaniel.rei.client;
import com.google.common.collect.Lists;
-import me.shedaniel.rei.RoughlyEnoughItemsCore;
import me.shedaniel.rei.gui.ContainerScreenOverlay;
import me.shedaniel.rei.gui.widget.TextFieldWidget;
import me.shedaniel.rei.listeners.ContainerScreenHooks;
@@ -9,9 +8,6 @@ import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.event.client.ClientTickCallback;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.ContainerScreen;
-import net.minecraft.client.gui.InputListener;
-import net.minecraft.client.gui.widget.ButtonWidget;
-import net.minecraft.client.gui.widget.RecipeBookButtonWidget;
import net.minecraft.client.util.Window;
import net.minecraft.item.ItemStack;
import org.apache.logging.log4j.util.TriConsumer;
@@ -47,16 +43,6 @@ public class ScreenHelper implements ClientModInitializer {
return getLastOverlay(false, false);
}
- public static void disableRecipeBook(ContainerScreen lastContainerScreen, List<InputListener> listeners, List<ButtonWidget> buttonWidgets) {
- RoughlyEnoughItemsCore.LOGGER.info("%d %d", listeners.size(), buttonWidgets.size());
- for(InputListener listener : listeners)
- if (listener instanceof RecipeBookButtonWidget)
- listeners.remove(listener);
- for(ButtonWidget buttonWidget : buttonWidgets)
- if (buttonWidget instanceof RecipeBookButtonWidget)
- buttonWidgets.remove(buttonWidget);
- }
-
public static ContainerScreen getLastContainerScreen() {
return lastContainerScreen;
}