Migrate the Carpet codebase to Mojang Mappings
This commit is contained in:
346 files changed
+8353
-8492
No files matched your search
@@ -1,18 +1,18 @@
|
||||
package carpet.mixins;
|
||||
|
||||
import carpet.fakes.ScreenHandlerInterface;
|
||||
import net.minecraft.recipe.Recipe;
|
||||
import net.minecraft.screen.AbstractRecipeScreenHandler;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.world.inventory.RecipeBookMenu;
|
||||
import net.minecraft.world.item.crafting.Recipe;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@Mixin(AbstractRecipeScreenHandler.class)
|
||||
@Mixin(RecipeBookMenu.class)
|
||||
public class AbstractRecipeScreenHandler_scarpetMixin {
|
||||
@Inject(method = "fillInputSlots",at = @At("HEAD"), cancellable = true)
|
||||
private void selectRecipeCallback(boolean craftAll, Recipe<?> recipe, ServerPlayerEntity player, CallbackInfo ci) {
|
||||
@Inject(method = "handlePlacement",at = @At("HEAD"), cancellable = true)
|
||||
private void selectRecipeCallback(boolean craftAll, Recipe<?> recipe, ServerPlayer player, CallbackInfo ci) {
|
||||
if(((ScreenHandlerInterface) this).callSelectRecipeListener(player,recipe,craftAll))
|
||||
ci.cancel();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user