Skip to content

Commit

Permalink
Server side crash fix
Browse files Browse the repository at this point in the history
  • Loading branch information
paulevsGitch committed Jun 20, 2021
1 parent a15a01b commit b0922d9
Show file tree
Hide file tree
Showing 15 changed files with 42 additions and 4 deletions.
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
3 changes: 3 additions & 0 deletions src/main/java/ru/betterend/blocks/BulbVineLanternBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -57,6 +59,7 @@ public BCLRenderLayer getRenderLayer() {
}

@Override
@Environment(EnvType.CLIENT)
public @Nullable BlockModel getBlockModel(ResourceLocation resourceLocation, BlockState blockState) {
Map<String, String> textures = Maps.newHashMap();
textures.put("%glow%", getGlowTexture());
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/ru/betterend/blocks/ChandelierBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<String> pattern;
switch (blockState.getValue(FACING)) {
Expand All @@ -67,6 +71,7 @@ public BlockModel getItemModel(ResourceLocation blockId) {
}

@Override
@Environment(EnvType.CLIENT)
public UnbakedModel getModelVariant(ResourceLocation stateId, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
String state = "_wall";
BlockModelRotation rotation = BlockModelRotation.X0_Y0;
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/ru/betterend/blocks/EmeraldIceBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -85,6 +87,7 @@ public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
}

@Override
@Environment(EnvType.CLIENT)
public BlockModel getItemModel(ResourceLocation resourceLocation) {
return getBlockModel(resourceLocation, defaultBlockState());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<String> pattern = Patterns.createJson(Patterns.BLOCK_PETAL_COLORED, path, path);
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/ru/betterend/blocks/JellyshroomCapBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -71,11 +73,13 @@ public List<ItemStack> 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<String> pattern = Patterns.createJson(Patterns.BLOCK_COLORED, "jellyshroom_cap");
return ModelsHelper.fromPattern(pattern);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/ru/betterend/blocks/basis/EndLanternBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -125,6 +127,7 @@ public FluidState getFluidState(BlockState state) {
}

@Override
@Environment(EnvType.CLIENT)
public UnbakedModel getModelVariant(ResourceLocation stateId, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
String floor = blockState.getValue(IS_FLOOR) ? "_floor" : "";
ResourceLocation modelId = new ResourceLocation(stateId.getNamespace(),
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/ru/betterend/blocks/basis/PedestalBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<String, String> textures = createTexturesMap();
PedestalState state = blockState.getValue(STATE);
Expand All @@ -401,6 +405,7 @@ public BlockModel getItemModel(ResourceLocation blockId) {
}

@Override
@Environment(EnvType.CLIENT)
public UnbakedModel getModelVariant(ResourceLocation stateId, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
PedestalState state = blockState.getValue(STATE);
ResourceLocation modelId = new ResourceLocation(stateId.getNamespace(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<String> pattern = blockState.getValue(IS_FLOOR) ?
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/ru/betterend/item/EnchantedItem.java
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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);
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/ru/betterend/item/EndAnvilItem.java
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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);
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/ru/betterend/item/tool/EndHammerItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -133,6 +135,7 @@ public Multimap<Attribute, AttributeModifier> getDefaultAttributeModifiers(Equip
}

@Override
@Environment(EnvType.CLIENT)
public BlockModel getItemModel(ResourceLocation resourceLocation) {
return ModelsHelper.createHandheldItem(resourceLocation);
}
Expand Down
1 change: 0 additions & 1 deletion src/main/java/ru/betterend/rituals/InfusionRitual.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit b0922d9

Please sign in to comment.