aboutsummaryrefslogtreecommitdiff
path: root/forge
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2023-01-22 00:08:47 +0800
committershedaniel <daniel@shedaniel.me>2023-01-22 00:14:02 +0800
commit7dac5856acd5a1b4111f009d3c348a501f1bc397 (patch)
tree9bd05e823a6d6db0605ff81264be339d0deddd62 /forge
parent3426ed6edef377ad690c44be3997a9be73df1638 (diff)
downloadRoughlyEnoughItems-7dac5856acd5a1b4111f009d3c348a501f1bc397.tar.gz
RoughlyEnoughItems-7dac5856acd5a1b4111f009d3c348a501f1bc397.tar.bz2
RoughlyEnoughItems-7dac5856acd5a1b4111f009d3c348a501f1bc397.zip
Add support for c:hidden_from_recipe_viewers
Diffstat (limited to 'forge')
-rw-r--r--forge/src/main/java/me/shedaniel/rei/forge/PluginDetectorImpl.java2
-rw-r--r--forge/src/main/java/me/shedaniel/rei/mixin/forge/MixinClientPacketListener.java6
2 files changed, 8 insertions, 0 deletions
diff --git a/forge/src/main/java/me/shedaniel/rei/forge/PluginDetectorImpl.java b/forge/src/main/java/me/shedaniel/rei/forge/PluginDetectorImpl.java
index 64dbf3d72..0ec02248c 100644
--- a/forge/src/main/java/me/shedaniel/rei/forge/PluginDetectorImpl.java
+++ b/forge/src/main/java/me/shedaniel/rei/forge/PluginDetectorImpl.java
@@ -35,6 +35,7 @@ import me.shedaniel.rei.api.common.plugins.REIServerPlugin;
import me.shedaniel.rei.impl.init.PluginDetector;
import me.shedaniel.rei.plugin.client.forge.DefaultClientPluginImpl;
import me.shedaniel.rei.plugin.client.runtime.DefaultClientRuntimePlugin;
+import me.shedaniel.rei.plugin.client.runtime.HideIngredientsFromTagsPlugin;
import me.shedaniel.rei.plugin.common.forge.DefaultPluginImpl;
import me.shedaniel.rei.plugin.common.runtime.DefaultRuntimePlugin;
import net.minecraftforge.api.distmarker.Dist;
@@ -178,6 +179,7 @@ public class PluginDetectorImpl implements PluginDetector {
return () -> () -> {
PluginView.getClientInstance().registerPlugin(wrapPlugin(Collections.singletonList("roughlyenoughitems"), new DefaultClientPluginImpl()));
PluginView.getClientInstance().registerPlugin(wrapPlugin(Collections.singletonList("roughlyenoughitems"), new DefaultClientRuntimePlugin()));
+ PluginView.getClientInstance().registerPlugin(wrapPlugin(Collections.singletonList("roughlyenoughitems"), new HideIngredientsFromTagsPlugin()));
// Legacy Annotation
AnnotationUtils.<REIPlugin, REIClientPlugin>scanAnnotation(REIPlugin.class, REIClientPlugin.class::isAssignableFrom, (modId, plugin, clazz) -> {
diff --git a/forge/src/main/java/me/shedaniel/rei/mixin/forge/MixinClientPacketListener.java b/forge/src/main/java/me/shedaniel/rei/mixin/forge/MixinClientPacketListener.java
index 5911cb28d..989b0eb63 100644
--- a/forge/src/main/java/me/shedaniel/rei/mixin/forge/MixinClientPacketListener.java
+++ b/forge/src/main/java/me/shedaniel/rei/mixin/forge/MixinClientPacketListener.java
@@ -26,6 +26,7 @@ package me.shedaniel.rei.mixin.forge;
import me.shedaniel.rei.RoughlyEnoughItemsCoreClient;
import net.minecraft.client.multiplayer.ClientPacketListener;
import net.minecraft.network.protocol.game.ClientboundUpdateRecipesPacket;
+import net.minecraft.network.protocol.game.ClientboundUpdateTagsPacket;
import net.minecraft.world.item.crafting.RecipeManager;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
@@ -42,4 +43,9 @@ public class MixinClientPacketListener {
private void handleUpdateRecipes(ClientboundUpdateRecipesPacket clientboundUpdateRecipesPacket, CallbackInfo ci) {
RoughlyEnoughItemsCoreClient.PRE_UPDATE_RECIPES.invoker().update(recipeManager);
}
+
+ @Inject(method = "handleUpdateTags", at = @At("HEAD"))
+ private void handleUpdateTags(ClientboundUpdateTagsPacket packet, CallbackInfo ci) {
+ RoughlyEnoughItemsCoreClient.POST_UPDATE_TAGS.invoker().run();
+ }
} \ No newline at end of file