Skip to content

Commit

Permalink
Fix Cannot copy null stack issue. (Closes #1553)
Browse files Browse the repository at this point in the history
Signed-off-by: 秋雨落 <i@rain.cx>
  • Loading branch information
qyl27 committed Nov 17, 2024
1 parent 0490af1 commit ab1e5d2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 24 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
package io.izzel.arclight.common.mixin.bukkit.inventory;

import net.minecraft.world.item.ItemStack;
import org.bukkit.craftbukkit.v.inventory.CraftItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;

@Mixin(CraftItemStack.class)
@Mixin(value = CraftItemStack.class, remap = false)
public abstract class CraftItemStackMixin {
@Redirect(method = "asCraftMirror", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/item/ItemStack;isEmpty()Z"))
private static boolean arclight$asCraftMirror$ItemStack$isEmpty(ItemStack instance) {
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import net.minecraft.world.item.crafting.Recipe;
import net.minecraft.world.item.crafting.RecipeHolder;
import net.minecraft.world.item.crafting.RecipeInput;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.craftbukkit.v.inventory.CraftComplexRecipe;
import org.bukkit.craftbukkit.v.inventory.CraftItemStack;
Expand All @@ -17,7 +18,7 @@ public class ArclightSpecialRecipe extends CraftComplexRecipe {
private final Recipe<?> recipe;

public ArclightSpecialRecipe(NamespacedKey id, Recipe<?> recipe) {
super(id, null, null);
super(id, new ItemStack(Material.AIR), null);
this.recipe = recipe;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,4 @@

@Mixin(FireBlock.class)
public abstract class FireBlockMixin_Fabric {

// @Inject(method = "checkBurnOut", cancellable = true, at = @At(value = "INVOKE", ordinal = 1, target = "Lnet/minecraft/world/level/Level;getBlockState(Lnet/minecraft/core/BlockPos;)Lnet/minecraft/world/level/block/state/BlockState;"))
// private void arclight$blockBurn(Level worldIn, BlockPos pos, int i, RandomSource randomSource, int j, CallbackInfo ci) {
// Block theBlock = CraftBlock.at(worldIn, pos);
// Block sourceBlock = CraftBlock.at(worldIn, pos.relative(face));
// BlockBurnEvent event = new BlockBurnEvent(theBlock, sourceBlock);
// Bukkit.getPluginManager().callEvent(event);
// if (event.isCancelled()) {
// ci.cancel();
// return;
// }
// if (worldIn.getBlockState(pos).getBlock() instanceof TntBlock && !CraftEventFactory.callTNTPrimeEvent(worldIn, pos, TNTPrimeEvent.PrimeCause.FIRE, null, pos.relative(face))) {
// ci.cancel();
// }
// }
}

0 comments on commit ab1e5d2

Please sign in to comment.