More client side annotations

This commit is contained in:
paulevsGitch 2021-06-20 18:13:33 +03:00
parent 2686089835
commit 425458f0bd
37 changed files with 151 additions and 4 deletions

View file

@ -7,6 +7,8 @@ import java.util.Random;
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.client.resources.model.BlockModelRotation;
@ -97,11 +99,13 @@ public class BaseBarrelBlock extends BarrelBlock implements BlockModelProvider {
}
@Override
@Environment(EnvType.CLIENT)
public BlockModel getItemModel(ResourceLocation blockId) {
return getBlockModel(blockId, defaultBlockState());
}
@Override
@Environment(EnvType.CLIENT)
public @Nullable BlockModel getBlockModel(ResourceLocation blockId, BlockState blockState) {
Optional<String> pattern;
if (blockState.getValue(OPEN)) {
@ -113,6 +117,7 @@ public class BaseBarrelBlock extends BarrelBlock implements BlockModelProvider {
}
@Override
@Environment(EnvType.CLIENT)
public UnbakedModel getModelVariant(ResourceLocation stateId, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
String open = blockState.getValue(OPEN) ? "_open" : "";
ResourceLocation modelId = new ResourceLocation(stateId.getNamespace(),