Fixed mixin errors

This commit is contained in:
Frank 2022-03-17 17:19:26 +01:00
parent 824e78abf7
commit e2c4f91f58
4 changed files with 3 additions and 33 deletions

View file

@ -15,13 +15,13 @@ public abstract class EnchantingTableBlockMixin extends Block {
super(settings);
}
@Redirect(method = "animateTick", at = @At(
@Redirect(method = "isValidBookShelf", at = @At(
value = "INVOKE",
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 static boolean bclib_isBookshelf(BlockState state, Block block) {
return block == Blocks.BOOKSHELF ? state.is(CommonBlockTags.BOOKSHELVES) : state.is(block);
}
}

View file

@ -32,7 +32,7 @@ public class DimensionTypeMixin {
locals = LocalCapture.CAPTURE_FAILHARD,
at = @At("TAIL")
)
private static void bclib_updateDimensions(RegistryAccess registryAccess, long seed, boolean bl, CallbackInfoReturnable<MappedRegistry<LevelStem>> info, @NotNull MappedRegistry<LevelStem> writableRegistry, Registry<DimensionType> registry, Registry<Biome> biomeRegistry, Registry<StructureSet> structureRegistry, Registry<NoiseGeneratorSettings> noiseSettingsRegistry, Registry<NormalNoise.NoiseParameters> noiseParamRegistry) {
private static void bclib_updateDimensions(RegistryAccess registryAccess, long seed, boolean bl, CallbackInfoReturnable<Registry> info, WritableRegistry writableRegistry, Registry registry, Registry biomeRegistry, Registry structureRegistry, Registry noiseSettingsRegistry, Registry noiseParamRegistry) {
int id = writableRegistry.getId(writableRegistry.get(LevelStem.NETHER));
writableRegistry.register(
LevelStem.NETHER,

View file

@ -1,29 +0,0 @@
package ru.bclib.mixin.common;
import net.minecraft.world.inventory.AbstractContainerMenu;
import net.minecraft.world.inventory.EnchantmentMenu;
import net.minecraft.world.inventory.MenuType;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.state.BlockState;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
import ru.bclib.api.tag.CommonBlockTags;
@Mixin(EnchantmentMenu.class)
public abstract class EnchantmentMenuMixin extends AbstractContainerMenu {
protected EnchantmentMenuMixin(MenuType<?> type, int syncId) {
super(type, syncId);
}
@Redirect(method = "lambda$slotsChanged$0(Lnet/minecraft/world/item/ItemStack;Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;)V", at = @At(
value = "INVOKE",
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) {
return block == Blocks.BOOKSHELF ? state.is(CommonBlockTags.BOOKSHELVES) : state.is(block);
}
}

View file

@ -21,7 +21,6 @@
"RecipeManagerAccessor",
"DiggerItemAccessor",
"shears.SnowGolemMixin",
"EnchantmentMenuMixin",
"MinecraftServerMixin",
"NetherBiomeDataMixin",
"PistonBaseBlockMixin",