From b0922d967fa76da6def15bdb93c6cea162484e0a Mon Sep 17 00:00:00 2001 From: paulevsGitch Date: Sun, 20 Jun 2021 18:49:53 +0300 Subject: [PATCH] Server side crash fix --- gradle.properties | 4 ++-- src/main/java/ru/betterend/blocks/BulbVineLanternBlock.java | 3 +++ src/main/java/ru/betterend/blocks/ChandelierBlock.java | 5 +++++ src/main/java/ru/betterend/blocks/EmeraldIceBlock.java | 3 +++ .../java/ru/betterend/blocks/HydraluxPetalColoredBlock.java | 3 +++ src/main/java/ru/betterend/blocks/JellyshroomCapBlock.java | 4 ++++ .../java/ru/betterend/blocks/UmbrellaTreeMembraneBlock.java | 1 + src/main/java/ru/betterend/blocks/basis/EndLanternBlock.java | 3 +++ src/main/java/ru/betterend/blocks/basis/PedestalBlock.java | 5 +++++ .../java/ru/betterend/blocks/basis/StoneLanternBlock.java | 3 +++ src/main/java/ru/betterend/item/EnchantedItem.java | 3 +++ src/main/java/ru/betterend/item/EndAnvilItem.java | 3 +++ src/main/java/ru/betterend/item/tool/EndHammerItem.java | 3 +++ src/main/java/ru/betterend/rituals/InfusionRitual.java | 1 - src/main/resources/fabric.mod.json | 2 +- 15 files changed, 42 insertions(+), 4 deletions(-) diff --git a/gradle.properties b/gradle.properties index f902a279e..a15787e2c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,7 +8,7 @@ yarn_mappings=6 loader_version=0.11.3 # Mod Properties -mod_version = 0.9.8-pre +mod_version = 0.9.8.1-pre maven_group = ru.betterend archives_base_name = better-end @@ -17,5 +17,5 @@ archives_base_name = better-end patchouli_version = 50-FABRIC fabric_version = 0.32.9+1.16 canvas_version = 1.0.+ -bclib_version = 0.1.38 +bclib_version = 0.1.42 rei_version = 5.8.10 \ No newline at end of file diff --git a/src/main/java/ru/betterend/blocks/BulbVineLanternBlock.java b/src/main/java/ru/betterend/blocks/BulbVineLanternBlock.java index 0302faabd..dc0ad6c33 100644 --- a/src/main/java/ru/betterend/blocks/BulbVineLanternBlock.java +++ b/src/main/java/ru/betterend/blocks/BulbVineLanternBlock.java @@ -7,6 +7,8 @@ import com.google.common.collect.Maps; +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags; import net.minecraft.client.renderer.block.model.BlockModel; @@ -57,6 +59,7 @@ public BCLRenderLayer getRenderLayer() { } @Override + @Environment(EnvType.CLIENT) public @Nullable BlockModel getBlockModel(ResourceLocation resourceLocation, BlockState blockState) { Map textures = Maps.newHashMap(); textures.put("%glow%", getGlowTexture()); diff --git a/src/main/java/ru/betterend/blocks/ChandelierBlock.java b/src/main/java/ru/betterend/blocks/ChandelierBlock.java index 21a906f77..622eeb5e6 100644 --- a/src/main/java/ru/betterend/blocks/ChandelierBlock.java +++ b/src/main/java/ru/betterend/blocks/ChandelierBlock.java @@ -8,6 +8,8 @@ import com.google.common.collect.Maps; +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.minecraft.client.renderer.block.model.BlockModel; import net.minecraft.client.resources.model.BlockModelRotation; @@ -46,11 +48,13 @@ public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, Col } @Override + @Environment(EnvType.CLIENT) public BlockModel getItemModel(ResourceLocation blockId) { return ModelsHelper.createItemModel(blockId); } @Override + @Environment(EnvType.CLIENT) public @Nullable BlockModel getBlockModel(ResourceLocation resourceLocation, BlockState blockState) { Optional pattern; switch (blockState.getValue(FACING)) { @@ -67,6 +71,7 @@ public BlockModel getItemModel(ResourceLocation blockId) { } @Override + @Environment(EnvType.CLIENT) public UnbakedModel getModelVariant(ResourceLocation stateId, BlockState blockState, Map modelCache) { String state = "_wall"; BlockModelRotation rotation = BlockModelRotation.X0_Y0; diff --git a/src/main/java/ru/betterend/blocks/EmeraldIceBlock.java b/src/main/java/ru/betterend/blocks/EmeraldIceBlock.java index f8c010f18..e4ebe572b 100644 --- a/src/main/java/ru/betterend/blocks/EmeraldIceBlock.java +++ b/src/main/java/ru/betterend/blocks/EmeraldIceBlock.java @@ -6,6 +6,8 @@ import org.jetbrains.annotations.Nullable; +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.minecraft.client.renderer.block.model.BlockModel; import net.minecraft.core.BlockPos; @@ -85,6 +87,7 @@ public List getDrops(BlockState state, LootContext.Builder builder) { } @Override + @Environment(EnvType.CLIENT) public BlockModel getItemModel(ResourceLocation resourceLocation) { return getBlockModel(resourceLocation, defaultBlockState()); } diff --git a/src/main/java/ru/betterend/blocks/HydraluxPetalColoredBlock.java b/src/main/java/ru/betterend/blocks/HydraluxPetalColoredBlock.java index f9a882b52..599bbe154 100644 --- a/src/main/java/ru/betterend/blocks/HydraluxPetalColoredBlock.java +++ b/src/main/java/ru/betterend/blocks/HydraluxPetalColoredBlock.java @@ -4,6 +4,8 @@ import org.jetbrains.annotations.Nullable; +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.minecraft.client.color.block.BlockColor; import net.minecraft.client.color.item.ItemColor; @@ -31,6 +33,7 @@ public ItemColor getItemProvider() { } @Override + @Environment(EnvType.CLIENT) public @Nullable BlockModel getBlockModel(ResourceLocation resourceLocation, BlockState blockState) { String path = "betterend:block/block_petal_colored"; Optional pattern = Patterns.createJson(Patterns.BLOCK_PETAL_COLORED, path, path); diff --git a/src/main/java/ru/betterend/blocks/JellyshroomCapBlock.java b/src/main/java/ru/betterend/blocks/JellyshroomCapBlock.java index caf38d89d..681e3578a 100644 --- a/src/main/java/ru/betterend/blocks/JellyshroomCapBlock.java +++ b/src/main/java/ru/betterend/blocks/JellyshroomCapBlock.java @@ -7,6 +7,8 @@ import com.google.common.collect.Lists; +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.minecraft.client.color.block.BlockColor; import net.minecraft.client.color.item.ItemColor; @@ -71,11 +73,13 @@ public List getDrops(BlockState state, LootContext.Builder builder) { } @Override + @Environment(EnvType.CLIENT) public BlockModel getItemModel(ResourceLocation resourceLocation) { return getBlockModel(resourceLocation, defaultBlockState()); } @Override + @Environment(EnvType.CLIENT) public @Nullable BlockModel getBlockModel(ResourceLocation resourceLocation, BlockState blockState) { Optional pattern = Patterns.createJson(Patterns.BLOCK_COLORED, "jellyshroom_cap"); return ModelsHelper.fromPattern(pattern); diff --git a/src/main/java/ru/betterend/blocks/UmbrellaTreeMembraneBlock.java b/src/main/java/ru/betterend/blocks/UmbrellaTreeMembraneBlock.java index 67ad0a060..b267bf842 100644 --- a/src/main/java/ru/betterend/blocks/UmbrellaTreeMembraneBlock.java +++ b/src/main/java/ru/betterend/blocks/UmbrellaTreeMembraneBlock.java @@ -81,6 +81,7 @@ public boolean skipRendering(BlockState state, BlockState stateFrom, Direction d } @Override + @Environment(EnvType.CLIENT) public BlockModel getItemModel(ResourceLocation resourceLocation) { return getBlockModel(resourceLocation, defaultBlockState()); } diff --git a/src/main/java/ru/betterend/blocks/basis/EndLanternBlock.java b/src/main/java/ru/betterend/blocks/basis/EndLanternBlock.java index f66fa6dc4..f4ada8b32 100644 --- a/src/main/java/ru/betterend/blocks/basis/EndLanternBlock.java +++ b/src/main/java/ru/betterend/blocks/basis/EndLanternBlock.java @@ -2,6 +2,8 @@ import java.util.Map; +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.minecraft.client.resources.model.UnbakedModel; import net.minecraft.core.BlockPos; @@ -125,6 +127,7 @@ public FluidState getFluidState(BlockState state) { } @Override + @Environment(EnvType.CLIENT) public UnbakedModel getModelVariant(ResourceLocation stateId, BlockState blockState, Map modelCache) { String floor = blockState.getValue(IS_FLOOR) ? "_floor" : ""; ResourceLocation modelId = new ResourceLocation(stateId.getNamespace(), diff --git a/src/main/java/ru/betterend/blocks/basis/PedestalBlock.java b/src/main/java/ru/betterend/blocks/basis/PedestalBlock.java index 886e84356..2f91a6822 100644 --- a/src/main/java/ru/betterend/blocks/basis/PedestalBlock.java +++ b/src/main/java/ru/betterend/blocks/basis/PedestalBlock.java @@ -10,6 +10,8 @@ import com.google.common.collect.Lists; +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.minecraft.client.renderer.block.model.BlockModel; import net.minecraft.client.resources.model.UnbakedModel; @@ -370,11 +372,13 @@ public int getAnalogOutputSignal(BlockState state, Level world, BlockPos pos) { } @Override + @Environment(EnvType.CLIENT) public BlockModel getItemModel(ResourceLocation blockId) { return getBlockModel(blockId, defaultBlockState()); } @Override + @Environment(EnvType.CLIENT) public @Nullable BlockModel getBlockModel(ResourceLocation resourceLocation, BlockState blockState) { Map textures = createTexturesMap(); PedestalState state = blockState.getValue(STATE); @@ -401,6 +405,7 @@ public BlockModel getItemModel(ResourceLocation blockId) { } @Override + @Environment(EnvType.CLIENT) public UnbakedModel getModelVariant(ResourceLocation stateId, BlockState blockState, Map modelCache) { PedestalState state = blockState.getValue(STATE); ResourceLocation modelId = new ResourceLocation(stateId.getNamespace(), diff --git a/src/main/java/ru/betterend/blocks/basis/StoneLanternBlock.java b/src/main/java/ru/betterend/blocks/basis/StoneLanternBlock.java index b7319079b..b8f2b7c9a 100644 --- a/src/main/java/ru/betterend/blocks/basis/StoneLanternBlock.java +++ b/src/main/java/ru/betterend/blocks/basis/StoneLanternBlock.java @@ -4,6 +4,8 @@ import org.jetbrains.annotations.Nullable; +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.minecraft.client.color.block.BlockColor; import net.minecraft.client.color.item.ItemColor; @@ -44,6 +46,7 @@ public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, Col } @Override + @Environment(EnvType.CLIENT) public @Nullable BlockModel getBlockModel(ResourceLocation resourceLocation, BlockState blockState) { String blockName = resourceLocation.getPath(); Optional pattern = blockState.getValue(IS_FLOOR) ? diff --git a/src/main/java/ru/betterend/item/EnchantedItem.java b/src/main/java/ru/betterend/item/EnchantedItem.java index d210c8551..814b9644e 100644 --- a/src/main/java/ru/betterend/item/EnchantedItem.java +++ b/src/main/java/ru/betterend/item/EnchantedItem.java @@ -1,5 +1,7 @@ package ru.betterend.item; +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; import net.minecraft.client.renderer.block.model.BlockModel; import net.minecraft.core.Registry; import net.minecraft.resources.ResourceLocation; @@ -25,6 +27,7 @@ public boolean isFoil(ItemStack stack) { } @Override + @Environment(EnvType.CLIENT) public BlockModel getItemModel(ResourceLocation resourceLocation) { ResourceLocation sourceId = Registry.ITEM.getKey(source); return ModelsHelper.createItemModel(sourceId); diff --git a/src/main/java/ru/betterend/item/EndAnvilItem.java b/src/main/java/ru/betterend/item/EndAnvilItem.java index 9b8b4d040..c1b1625cf 100644 --- a/src/main/java/ru/betterend/item/EndAnvilItem.java +++ b/src/main/java/ru/betterend/item/EndAnvilItem.java @@ -1,5 +1,7 @@ package ru.betterend.item; +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; import net.minecraft.client.renderer.block.model.BlockModel; import net.minecraft.core.Registry; import net.minecraft.resources.ResourceLocation; @@ -30,6 +32,7 @@ protected BlockState getPlacementState(BlockPlaceContext blockPlaceContext) { } @Override + @Environment(EnvType.CLIENT) public BlockModel getItemModel(ResourceLocation resourceLocation) { Block block = getBlock(); ResourceLocation blockId = Registry.BLOCK.getKey(block); diff --git a/src/main/java/ru/betterend/item/tool/EndHammerItem.java b/src/main/java/ru/betterend/item/tool/EndHammerItem.java index fa990cf98..0cef9ded5 100644 --- a/src/main/java/ru/betterend/item/tool/EndHammerItem.java +++ b/src/main/java/ru/betterend/item/tool/EndHammerItem.java @@ -8,6 +8,8 @@ import com.google.common.collect.Sets; import io.netty.util.internal.ThreadLocalRandom; +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; import net.fabricmc.fabric.api.tool.attribute.v1.DynamicAttributeTool; import net.minecraft.client.renderer.block.model.BlockModel; import net.minecraft.core.BlockPos; @@ -133,6 +135,7 @@ public Multimap getDefaultAttributeModifiers(Equip } @Override + @Environment(EnvType.CLIENT) public BlockModel getItemModel(ResourceLocation resourceLocation) { return ModelsHelper.createHandheldItem(resourceLocation); } diff --git a/src/main/java/ru/betterend/rituals/InfusionRitual.java b/src/main/java/ru/betterend/rituals/InfusionRitual.java index f240ec479..005e6b385 100644 --- a/src/main/java/ru/betterend/rituals/InfusionRitual.java +++ b/src/main/java/ru/betterend/rituals/InfusionRitual.java @@ -11,7 +11,6 @@ import net.minecraft.server.level.ServerLevel; import net.minecraft.world.Container; import net.minecraft.world.entity.player.Player; -import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.BlockEntity; diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index b880fc775..90a89ea6b 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -46,7 +46,7 @@ "fabricloader": ">=0.11.0", "fabric": ">=0.32.0", "minecraft": ">=1.16.4", - "bclib": ">=0.1.38" + "bclib": ">=0.1.42" }, "suggests": { "byg": ">=1.1.3",