Allow enchantment table mixins skip target

This commit is contained in:
paulevsGitch 2022-01-27 14:05:37 +03:00
parent 89c5cd215b
commit ebba0dde6c
2 changed files with 6 additions and 2 deletions

View file

@ -17,7 +17,9 @@ public abstract class EnchantingTableBlockMixin extends Block {
@Redirect(method = "animateTick", at = @At( @Redirect(method = "animateTick", at = @At(
value = "INVOKE", value = "INVOKE",
target = "Lnet/minecraft/world/level/block/state/BlockState;is(Lnet/minecraft/world/level/block/Block;)Z")//, target = "Lnet/minecraft/world/level/block/state/BlockState;is(Lnet/minecraft/world/level/block/Block;)Z"),
require = -1,
expect = -1
) )
private boolean bclib_isBookshelf(BlockState state, Block block) { private boolean bclib_isBookshelf(BlockState state, Block block) {
return block == Blocks.BOOKSHELF ? state.is(CommonBlockTags.BOOKSHELVES) : state.is(block); return block == Blocks.BOOKSHELF ? state.is(CommonBlockTags.BOOKSHELVES) : state.is(block);

View file

@ -19,7 +19,9 @@ public abstract class EnchantmentMenuMixin extends AbstractContainerMenu {
@Redirect(method = "lambda$slotsChanged$0(Lnet/minecraft/world/item/ItemStack;Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;)V", at = @At( @Redirect(method = "lambda$slotsChanged$0(Lnet/minecraft/world/item/ItemStack;Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;)V", at = @At(
value = "INVOKE", value = "INVOKE",
target = "Lnet/minecraft/world/level/block/state/BlockState;is(Lnet/minecraft/world/level/block/Block;)Z")//, target = "Lnet/minecraft/world/level/block/state/BlockState;is(Lnet/minecraft/world/level/block/Block;)Z"),
require = -1,
expect = -1
) )
private boolean bclib_isBookshelf(BlockState state, Block block) { private boolean bclib_isBookshelf(BlockState state, Block block) {
return block == Blocks.BOOKSHELF ? state.is(CommonBlockTags.BOOKSHELVES) : state.is(block); return block == Blocks.BOOKSHELF ? state.is(CommonBlockTags.BOOKSHELVES) : state.is(block);