fix: added additional check for placing event see #19

This commit is contained in:
2025-04-13 20:09:08 +02:00
parent e592db1ea2
commit 083d39562a

View File

@@ -32,7 +32,8 @@ public class BlockItemMixin {
) )
) )
private static void placeBlockWithOffHandCamo(World world, PlayerEntity player, BlockPos pos, ItemStack stack, CallbackInfoReturnable<Boolean> cir, @Local LocalRef<NbtCompound> compound) { private static void placeBlockWithOffHandCamo(World world, PlayerEntity player, BlockPos pos, ItemStack stack, CallbackInfoReturnable<Boolean> cir, @Local LocalRef<NbtCompound> compound) {
if (compound.get() != null if (player == null
|| compound.get() != null
|| player.getOffHandStack().isEmpty() || player.getOffHandStack().isEmpty()
|| player.getMainHandStack().isEmpty() || player.getMainHandStack().isEmpty()
|| !(player.getMainHandStack().getItem() instanceof BlockItem frame) || !(player.getMainHandStack().getItem() instanceof BlockItem frame)