Add RecipeUpdateEvent

This commit is contained in:
shedaniel
2020-11-22 00:44:29 +08:00
parent 6cbd3967ff
commit edd3a0e909
3 changed files with 49 additions and 0 deletions

View File

@@ -24,6 +24,7 @@ import me.shedaniel.architectury.event.events.*;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.IGuiEventListener;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.network.play.server.SUpdateRecipesPacket;
import net.minecraft.util.ActionResult;
import net.minecraft.util.ActionResultType;
import net.minecraft.util.text.ITextComponent;
@@ -140,6 +141,11 @@ public class EventHandlerImplClient {
InteractionEvent.CLIENT_LEFT_CLICK_AIR.invoker().click(event.getPlayer(), event.getHand());
}
@SubscribeEvent
public static void event(RecipesUpdatedEvent event) {
RecipeUpdateEvent.EVENT.invoker().update(event.getRecipeManager());
}
@OnlyIn(Dist.CLIENT)
public static class ModBasedEventHandler {
@SubscribeEvent