diff --git a/src/main/java/ru/bclib/api/TagAPI.java b/src/main/java/ru/bclib/api/TagAPI.java index c3b04638..353acd4a 100644 --- a/src/main/java/ru/bclib/api/TagAPI.java +++ b/src/main/java/ru/bclib/api/TagAPI.java @@ -2,7 +2,8 @@ package ru.bclib.api; import com.google.common.collect.Maps; import com.google.common.collect.Sets; -import net.fabricmc.fabric.api.tag.TagRegistry; +import net.fabricmc.fabric.api.tag.TagFactory; +import net.fabricmc.fabric.impl.tag.extension.TagDelegate; import net.minecraft.core.Registry; import net.minecraft.resources.ResourceLocation; import net.minecraft.server.packs.resources.ResourceManager; @@ -60,7 +61,8 @@ public class TagAPI { */ public static Tag.Named makeTag(Supplier> containerSupplier, ResourceLocation id) { Tag tag = containerSupplier.get().getTag(id); - return tag == null ? TagRegistry.create(id, containerSupplier) : (Named) tag; + //return tag == null ? TagRegistry.create(id, containerSupplier) : (Named) tag; + return tag == null ? new TagDelegate<>(id, containerSupplier) : (Named) tag; } /** @@ -116,7 +118,8 @@ public class TagAPI { public static Tag.Named getMCBlockTag(String name) { ResourceLocation id = new ResourceLocation(name); Tag tag = BlockTags.getAllTags().getTag(id); - return tag == null ? (Named) TagRegistry.block(id) : (Named) tag; + //return tag == null ? (Named) TagRegistry.block(id) : (Named) tag; + return tag == null ? (Named) TagFactory.BLOCK.create(id): (Named) tag; } /** diff --git a/src/main/java/ru/bclib/blockentities/BaseBarrelBlockEntity.java b/src/main/java/ru/bclib/blockentities/BaseBarrelBlockEntity.java index 314503d4..f517d01b 100644 --- a/src/main/java/ru/bclib/blockentities/BaseBarrelBlockEntity.java +++ b/src/main/java/ru/bclib/blockentities/BaseBarrelBlockEntity.java @@ -35,14 +35,15 @@ public class BaseBarrelBlockEntity extends RandomizableContainerBlockEntity { public BaseBarrelBlockEntity(BlockPos blockPos, BlockState blockState) { this(BaseBlockEntities.BARREL, blockPos, blockState); } - - public CompoundTag save(CompoundTag tag) { - super.save(tag); + + @Override + public void saveAdditional(CompoundTag tag) { + super.saveAdditional(tag); if (!this.trySaveLootTable(tag)) { ContainerHelper.saveAllItems(tag, this.inventory); } - return tag; + //return tag; } public void load(CompoundTag tag) { diff --git a/src/main/java/ru/bclib/blocks/BaseLeavesBlock.java b/src/main/java/ru/bclib/blocks/BaseLeavesBlock.java index 4c6861bf..f414b269 100644 --- a/src/main/java/ru/bclib/blocks/BaseLeavesBlock.java +++ b/src/main/java/ru/bclib/blocks/BaseLeavesBlock.java @@ -54,7 +54,7 @@ public class BaseLeavesBlock extends LeavesBlock implements BlockModelProvider, } public BaseLeavesBlock(Block sapling, MaterialColor color, int light) { - super(makeLeaves(color).lightLevel(light)); + super(makeLeaves(color).luminance(light)); this.sapling = sapling; } diff --git a/src/main/java/ru/bclib/integration/ModIntegration.java b/src/main/java/ru/bclib/integration/ModIntegration.java index 869edc61..8597971f 100644 --- a/src/main/java/ru/bclib/integration/ModIntegration.java +++ b/src/main/java/ru/bclib/integration/ModIntegration.java @@ -1,6 +1,6 @@ package ru.bclib.integration; -import net.fabricmc.fabric.api.tag.TagRegistry; +import net.fabricmc.fabric.api.tag.TagFactory; import net.fabricmc.loader.api.FabricLoader; import net.minecraft.core.Registry; import net.minecraft.data.BuiltinRegistries; @@ -198,12 +198,15 @@ public abstract class ModIntegration { public Tag.Named getItemTag(String name) { ResourceLocation id = getID(name); Tag tag = ItemTags.getAllTags().getTag(id); - return tag == null ? (Named) TagRegistry.item(id) : (Named) tag; + + //return tag == null ? (Named) TagRegistry.item(id) : (Named) tag; + return tag == null ? (Named) TagFactory.ITEM.create(id) : (Named) tag; } public Tag.Named getBlockTag(String name) { ResourceLocation id = getID(name); Tag tag = BlockTags.getAllTags().getTag(id); - return tag == null ? (Named) TagRegistry.block(id) : (Named) tag; + //return tag == null ? (Named) TagRegistry.block(id) : (Named) tag; + return tag == null ? (Named) TagFactory.BLOCK.create(id) : (Named) tag; } }