Changed models loading (Done)

This commit is contained in:
Aleksey 2021-05-24 15:04:16 +03:00
parent 831faeb306
commit 5da634fc73
63 changed files with 490 additions and 729 deletions

View file

@ -40,12 +40,12 @@ public class AeterniumAnvil extends EndAnvilBlock {
}
@Override
public UnbakedModel getModelVariant(ResourceLocation resourceLocation, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
public UnbakedModel getModelVariant(ResourceLocation stateId, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
int damage = getDamageState(blockState);
String modId = resourceLocation.getNamespace();
String modelId = "block/" + resourceLocation.getPath() + "_top_" + damage;
String modId = stateId.getNamespace();
String modelId = "block/" + stateId.getPath() + "_top_" + damage;
ResourceLocation modelLocation = new ResourceLocation(modId, modelId);
registerBlockModel(resourceLocation, modelLocation, blockState, modelCache);
registerBlockModel(stateId, modelLocation, blockState, modelCache);
return ModelsHelper.createFacingModel(modelLocation, blockState.getValue(FACING), false, false);
}

View file

@ -56,20 +56,6 @@ public class BulbVineLanternBlock extends EndLanternBlock implements IRenderType
return ERenderLayer.CUTOUT;
}
@Override
public Optional<String> getModelString(String block) {
ResourceLocation blockId = Registry.BLOCK.getKey(this);
Map<String, String> map = Maps.newHashMap();
map.put("%glow%", getGlowTexture());
map.put("%metal%", getMetalTexture(blockId));
if (block.contains("item") || block.contains("ceil")) {
return Patterns.createJson(Patterns.BLOCK_BULB_LANTERN_CEIL, map);
}
else {
return Patterns.createJson(Patterns.BLOCK_BULB_LANTERN_FLOOR, map);
}
}
@Override
public @Nullable BlockModel getBlockModel(ResourceLocation resourceLocation, BlockState blockState) {
Map<String, String> textures = Maps.newHashMap();

View file

@ -1,11 +1,15 @@
package ru.betterend.blocks;
import java.util.EnumMap;
import java.util.Map;
import java.util.Optional;
import com.google.common.collect.Maps;
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;
import net.minecraft.client.resources.model.UnbakedModel;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.core.Registry;
@ -16,7 +20,9 @@ import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape;
import org.jetbrains.annotations.Nullable;
import ru.betterend.blocks.basis.AttachedBlock;
import ru.betterend.client.models.ModelsHelper;
import ru.betterend.client.render.ERenderLayer;
import ru.betterend.interfaces.IRenderTypeable;
import ru.betterend.client.models.BlockModelProvider;
@ -40,20 +46,51 @@ public class ChandelierBlock extends AttachedBlock implements IRenderTypeable, B
}
@Override
public Optional<String> getModelString(String block) {
ResourceLocation blockId = Registry.BLOCK.getKey(this);
if (block.contains("item")) {
return Patterns.createJson(Patterns.ITEM_GENERATED, "item/" + blockId.getPath());
public BlockModel getItemModel(ResourceLocation blockId) {
return ModelsHelper.createItemModel(blockId.getPath());
}
@Override
public @Nullable BlockModel getBlockModel(ResourceLocation resourceLocation, BlockState blockState) {
Optional<String> pattern;
switch (blockState.getValue(FACING)) {
case UP:
pattern = Patterns.createJson(Patterns.BLOCK_CHANDELIER_FLOOR, resourceLocation.getPath());
break;
case DOWN:
pattern = Patterns.createJson(Patterns.BLOCK_CHANDELIER_CEIL, resourceLocation.getPath());
break;
default:
pattern = Patterns.createJson(Patterns.BLOCK_CHANDELIER_WALL, resourceLocation.getPath());
}
else if (block.contains("ceil")) {
return Patterns.createJson(Patterns.BLOCK_CHANDELIER_CEIL, blockId.getPath());
}
else if (block.contains("wall")) {
return Patterns.createJson(Patterns.BLOCK_CHANDELIER_WALL, blockId.getPath());
}
else {
return Patterns.createJson(Patterns.BLOCK_CHANDELIER_FLOOR, blockId.getPath());
return ModelsHelper.fromPattern(pattern);
}
@Override
public UnbakedModel getModelVariant(ResourceLocation stateId, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
String state = "_wall";
BlockModelRotation rotation = BlockModelRotation.X0_Y0;
switch (blockState.getValue(FACING)) {
case UP:
state = "_floor";
break;
case DOWN:
state = "_ceil";
break;
case EAST:
rotation = BlockModelRotation.X0_Y270;
break;
case NORTH:
rotation = BlockModelRotation.X0_Y180;
break;
case WEST:
rotation = BlockModelRotation.X0_Y90;
break;
}
ResourceLocation modelId = new ResourceLocation(stateId.getNamespace(),
"block/" + stateId.getPath() + state);
registerBlockModel(stateId, modelId, blockState, modelCache);
return ModelsHelper.createMultiVariant(modelId, rotation.getRotation(), false);
}
static {

View file

@ -5,6 +5,7 @@ import java.util.List;
import java.util.Optional;
import java.util.Random;
import net.minecraft.client.renderer.block.model.BlockModel;
import org.jetbrains.annotations.Nullable;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
@ -25,6 +26,7 @@ import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.Material;
import net.minecraft.world.level.storage.loot.LootContext;
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
import ru.betterend.client.models.ModelsHelper;
import ru.betterend.client.render.ERenderLayer;
import ru.betterend.interfaces.IRenderTypeable;
import ru.betterend.client.models.BlockModelProvider;
@ -87,9 +89,7 @@ public class EmeraldIceBlock extends HalfTransparentBlock implements IRenderType
}
@Override
public Optional<String> getModelString(String block) {
ResourceLocation blockId = Registry.BLOCK.getKey(this);
return Patterns.createJson(Patterns.BLOCK_BASE, blockId.getPath(), block);
public BlockModel getItemModel(ResourceLocation resourceLocation) {
return getBlockModel(resourceLocation, defaultBlockState());
}
}

View file

@ -5,6 +5,11 @@ import java.util.Optional;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.client.color.block.BlockColor;
import net.minecraft.client.color.item.ItemColor;
import net.minecraft.client.renderer.block.model.BlockModel;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.block.state.BlockState;
import org.jetbrains.annotations.Nullable;
import ru.betterend.client.models.ModelsHelper;
import ru.betterend.interfaces.IColorProvider;
import ru.betterend.client.models.Patterns;
import ru.betterend.util.BlocksHelper;
@ -29,9 +34,9 @@ public class HydraluxPetalColoredBlock extends HydraluxPetalBlock implements ICo
}
@Override
public Optional<String> getModelString(String block) {
public @Nullable BlockModel getBlockModel(ResourceLocation resourceLocation, BlockState blockState) {
String path = "betterend:block/block_petal_colored";
return Patterns.createJson(Patterns.BLOCK_PETAL_COLORED, path, path);
Optional<String> pattern = Patterns.createJson(Patterns.BLOCK_PETAL_COLORED, path, path);
return ModelsHelper.fromPattern(pattern);
}
}

View file

@ -8,7 +8,9 @@ import com.google.common.collect.Lists;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.client.color.block.BlockColor;
import net.minecraft.client.color.item.ItemColor;
import net.minecraft.client.renderer.block.model.BlockModel;
import net.minecraft.core.Vec3i;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.util.Mth;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.context.BlockPlaceContext;
@ -19,6 +21,8 @@ import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.StateDefinition;
import net.minecraft.world.level.block.state.properties.IntegerProperty;
import net.minecraft.world.level.storage.loot.LootContext;
import org.jetbrains.annotations.Nullable;
import ru.betterend.client.models.ModelsHelper;
import ru.betterend.client.render.ERenderLayer;
import ru.betterend.interfaces.IColorProvider;
import ru.betterend.interfaces.IRenderTypeable;
@ -65,8 +69,14 @@ public class JellyshroomCapBlock extends SlimeBlock implements IRenderTypeable,
}
@Override
public Optional<String> getModelString(String block) {
return Patterns.createJson(Patterns.BLOCK_COLORED, "jellyshroom_cap");
public BlockModel getItemModel(ResourceLocation resourceLocation) {
return getBlockModel(resourceLocation, defaultBlockState());
}
@Override
public @Nullable BlockModel getBlockModel(ResourceLocation resourceLocation, BlockState blockState) {
Optional<String> pattern = Patterns.createJson(Patterns.BLOCK_COLORED, "jellyshroom_cap");
return ModelsHelper.fromPattern(pattern);
}
@Override

View file

@ -9,6 +9,7 @@ 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.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.core.Registry;
@ -67,12 +68,6 @@ public class UmbrellaTreeMembraneBlock extends SlimeBlock implements IRenderType
}
}
@Override
public Optional<String> getModelString(String block) {
ResourceLocation blockId = Registry.BLOCK.getKey(this);
return Patterns.createJson(Patterns.BLOCK_BASE, blockId.getPath(), block);
}
@Override
public boolean propagatesSkylightDown(BlockState state, BlockGetter world, BlockPos pos) {
return state.getValue(COLOR) > 0;
@ -87,4 +82,9 @@ public class UmbrellaTreeMembraneBlock extends SlimeBlock implements IRenderType
return false;
}
}
@Override
public BlockModel getItemModel(ResourceLocation resourceLocation) {
return getBlockModel(resourceLocation, defaultBlockState());
}
}

View file

@ -25,13 +25,7 @@ public class BlockBase extends Block implements BlockModelProvider {
}
@Override
public Optional<String> getModelString(String block) {
ResourceLocation blockId = Registry.BLOCK.getKey(this);
return Patterns.createBlockSimple(blockId.getPath());
}
@Override
public BlockModel getModel(ResourceLocation blockId) {
public BlockModel getItemModel(ResourceLocation blockId) {
return getBlockModel(blockId, defaultBlockState());
}
}

View file

@ -58,15 +58,6 @@ public class EndAnvilBlock extends AnvilBlock implements BlockModelProvider {
return Collections.singletonList(stack);
}
@Override
public Optional<String> getModelString(String block) {
ResourceLocation blockId = Registry.BLOCK.getKey(this);
Map<String, String> map = Maps.newHashMap();
map.put("%anvil%", blockId.getPath());
map.put("%top%", getTop(blockId, block));
return Patterns.createJson(Patterns.BLOCK_ANVIL, map);
}
protected String getTop(ResourceLocation blockId, String block) {
if (block.contains("item")) {
return blockId.getPath() + "_top_0";
@ -76,7 +67,7 @@ public class EndAnvilBlock extends AnvilBlock implements BlockModelProvider {
}
@Override
public BlockModel getModel(ResourceLocation blockId) {
public BlockModel getItemModel(ResourceLocation blockId) {
return getBlockModel(blockId, defaultBlockState());
}
@ -93,13 +84,13 @@ public class EndAnvilBlock extends AnvilBlock implements BlockModelProvider {
}
@Override
public UnbakedModel getModelVariant(ResourceLocation resourceLocation, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
public UnbakedModel getModelVariant(ResourceLocation stateId, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
IntegerProperty destructionProperty = getDestructionProperty();
int destruction = blockState.getValue(destructionProperty);
String modId = resourceLocation.getNamespace();
String modelId = "block/" + resourceLocation.getPath() + "_top_" + destruction;
String modId = stateId.getNamespace();
String modelId = "block/" + stateId.getPath() + "_top_" + destruction;
ResourceLocation modelLocation = new ResourceLocation(modId, modelId);
registerBlockModel(resourceLocation, modelLocation, blockState, modelCache);
registerBlockModel(stateId, modelLocation, blockState, modelCache);
return ModelsHelper.createFacingModel(modelLocation, blockState.getValue(FACING), false, false);
}
}

View file

@ -96,16 +96,7 @@ public class EndBarrelBlock extends BarrelBlock implements BlockModelProvider {
}
@Override
public Optional<String> getModelString(String block) {
String texture = Registry.BLOCK.getKey(this).getPath();
if (block.contains("open")) {
return Patterns.createJson(Patterns.BLOCK_BARREL_OPEN, texture, texture);
}
return Patterns.createJson(Patterns.BLOCK_BOTTOM_TOP, texture, texture);
}
@Override
public BlockModel getModel(ResourceLocation blockId) {
public BlockModel getItemModel(ResourceLocation blockId) {
return getBlockModel(blockId, defaultBlockState());
}
@ -122,11 +113,11 @@ public class EndBarrelBlock extends BarrelBlock implements BlockModelProvider {
}
@Override
public UnbakedModel getModelVariant(ResourceLocation resourceLocation, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
public UnbakedModel getModelVariant(ResourceLocation stateId, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
String open = blockState.getValue(OPEN) ? "_open" : "";
ResourceLocation modelId = new ResourceLocation(resourceLocation.getNamespace(),
"block/" + resourceLocation.getPath() + open);
registerBlockModel(resourceLocation, modelId, blockState, modelCache);
ResourceLocation modelId = new ResourceLocation(stateId.getNamespace(),
"block/" + stateId.getPath() + open);
registerBlockModel(stateId, modelId, blockState, modelCache);
Direction facing = blockState.getValue(FACING);
BlockModelRotation rotation = BlockModelRotation.X0_Y0;
switch (facing) {

View file

@ -37,12 +37,6 @@ public class EndBookshelfBlock extends BlockBase {
return Collections.singletonList(new ItemStack(Items.BOOK, 3));
}
@Override
public Optional<String> getModelString(String block) {
ResourceLocation blockId = Registry.BLOCK.getKey(this);
return Patterns.createJson(Patterns.BLOCK_BOOKSHELF, getName(blockId), blockId.getPath());
}
@Override
public @Nullable BlockModel getBlockModel(ResourceLocation blockId, BlockState blockState) {
Optional<String> pattern = Patterns.createJson(Patterns.BLOCK_BOOKSHELF,

View file

@ -36,20 +36,7 @@ public abstract class EndButtonBlock extends ButtonBlock implements BlockModelPr
}
@Override
public Optional<String> getModelString(String block) {
ResourceLocation blockId = Registry.BLOCK.getKey(this);
ResourceLocation parentId = Registry.BLOCK.getKey(parent);
if (block.contains("item")) {
return Patterns.createJson(Patterns.ITEM_BUTTON, parentId.getPath(), blockId.getPath());
}
if (block.contains("pressed")) {
return Patterns.createJson(Patterns.BLOCK_BUTTON_PRESSED, parentId.getPath(), blockId.getPath());
}
return Patterns.createJson(Patterns.BLOCK_BUTTON, parentId.getPath(), blockId.getPath());
}
@Override
public BlockModel getModel(ResourceLocation blockId) {
public BlockModel getItemModel(ResourceLocation blockId) {
ResourceLocation parentId = Registry.BLOCK.getKey(parent);
Optional<String> pattern = Patterns.createJson(Patterns.ITEM_BUTTON, parentId.getPath(), blockId.getPath());
return ModelsHelper.fromPattern(pattern);
@ -66,11 +53,11 @@ public abstract class EndButtonBlock extends ButtonBlock implements BlockModelPr
}
@Override
public UnbakedModel getModelVariant(ResourceLocation resourceLocation, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
public UnbakedModel getModelVariant(ResourceLocation stateId, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
String powered = blockState.getValue(POWERED) ? "_powered" : "";
ResourceLocation modelId = new ResourceLocation(resourceLocation.getNamespace(),
"block/" + resourceLocation.getPath() + powered);
registerBlockModel(resourceLocation, modelId, blockState, modelCache);
ResourceLocation modelId = new ResourceLocation(stateId.getNamespace(),
"block/" + stateId.getPath() + powered);
registerBlockModel(stateId, modelId, blockState, modelCache);
AttachFace face = blockState.getValue(FACE);
boolean isCeiling = face == AttachFace.CEILING;
int x = 0, y = 0;

View file

@ -35,16 +35,7 @@ public class EndChainBlock extends ChainBlock implements BlockModelProvider, IRe
}
@Override
public Optional<String> getModelString(String block) {
ResourceLocation blockId = Registry.BLOCK.getKey(this);
if (block.contains("item")) {
return Patterns.createItemGenerated(block);
}
return Patterns.createJson(Patterns.BLOCK_CHAIN, blockId.getPath(), blockId.getPath());
}
@Override
public BlockModel getModel(ResourceLocation blockId) {
public BlockModel getItemModel(ResourceLocation blockId) {
return ModelsHelper.createItemModel(blockId.getPath());
}
@ -56,11 +47,11 @@ public class EndChainBlock extends ChainBlock implements BlockModelProvider, IRe
}
@Override
public UnbakedModel getModelVariant(ResourceLocation resourceLocation, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
public UnbakedModel getModelVariant(ResourceLocation stateId, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
Direction.Axis axis = blockState.getValue(AXIS);
ResourceLocation modelId = new ResourceLocation(resourceLocation.getNamespace(),
"block/" + resourceLocation.getPath());
registerBlockModel(resourceLocation, modelId, blockState, modelCache);
ResourceLocation modelId = new ResourceLocation(stateId.getNamespace(),
"block/" + stateId.getPath());
registerBlockModel(stateId, modelId, blockState, modelCache);
return ModelsHelper.createRotatedModel(modelId, axis);
}

View file

@ -43,17 +43,7 @@ public class EndChestBlock extends ChestBlock implements BlockModelProvider {
}
@Override
public Optional<String> getModelString(String path) {
ResourceLocation blockId = Registry.BLOCK.getKey(this);
ResourceLocation parentId = Registry.BLOCK.getKey(parent);
if (path.contains("item")) {
return Patterns.createJson(Patterns.ITEM_CHEST, blockId.getPath());
}
return Patterns.createJson(Patterns.BLOCK_EMPTY, parentId.getPath());
}
@Override
public BlockModel getModel(ResourceLocation blockId) {
public BlockModel getItemModel(ResourceLocation blockId) {
Optional<String> pattern = Patterns.createJson(Patterns.ITEM_CHEST, blockId.getPath());
return ModelsHelper.fromPattern(pattern);
}

View file

@ -32,14 +32,7 @@ public class EndComposterBlock extends ComposterBlock implements BlockModelProvi
}
@Override
public Optional<String> getModelString(String block) {
ResourceLocation blockId = Registry.BLOCK.getKey(this);
String blockName = blockId.getPath();
return Patterns.createJson(Patterns.BLOCK_COMPOSTER, blockName);
}
@Override
public BlockModel getModel(ResourceLocation resourceLocation) {
public BlockModel getItemModel(ResourceLocation resourceLocation) {
return getBlockModel(resourceLocation, defaultBlockState());
}
@ -50,28 +43,22 @@ public class EndComposterBlock extends ComposterBlock implements BlockModelProvi
}
@Override
public UnbakedModel getModelVariant(ResourceLocation resourceLocation, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
ResourceLocation modelId = new ResourceLocation(resourceLocation.getNamespace(), "block/" + resourceLocation.getPath());
registerBlockModel(resourceLocation, modelId, blockState, modelCache);
ResourceLocation content_1 = new ResourceLocation("block/composter_contents1");
ResourceLocation content_2 = new ResourceLocation("block/composter_contents2");
ResourceLocation content_3 = new ResourceLocation("block/composter_contents3");
ResourceLocation content_4 = new ResourceLocation("block/composter_contents4");
ResourceLocation content_5 = new ResourceLocation("block/composter_contents5");
ResourceLocation content_6 = new ResourceLocation("block/composter_contents6");
ResourceLocation content_7 = new ResourceLocation("block/composter_contents7");
ResourceLocation content_8 = new ResourceLocation("block/composter_contents_ready");
public UnbakedModel getModelVariant(ResourceLocation stateId, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
ResourceLocation modelId = new ResourceLocation(stateId.getNamespace(), "block/" + stateId.getPath());
registerBlockModel(stateId, modelId, blockState, modelCache);
MultiPartBuilder builder = MultiPartBuilder.create(stateDefinition);
builder.part(content_1).setCondition(state -> state.getValue(LEVEL) == 1).add();
builder.part(content_2).setCondition(state -> state.getValue(LEVEL) == 2).add();
builder.part(content_3).setCondition(state -> state.getValue(LEVEL) == 3).add();
builder.part(content_4).setCondition(state -> state.getValue(LEVEL) == 4).add();
builder.part(content_5).setCondition(state -> state.getValue(LEVEL) == 5).add();
builder.part(content_6).setCondition(state -> state.getValue(LEVEL) == 6).add();
builder.part(content_7).setCondition(state -> state.getValue(LEVEL) == 7).add();
builder.part(content_8).setCondition(state -> state.getValue(LEVEL) == 8).add();
LEVEL.getPossibleValues().forEach(level -> {
if (level > 0) {
ResourceLocation contentId;
if (level > 7) {
contentId = new ResourceLocation("block/composter_contents_ready");
} else {
contentId = new ResourceLocation("block/composter_contents" + level);
}
builder.part(contentId).setCondition(state -> state.getValue(LEVEL).equals(level)).add();
}
});
builder.part(modelId).add();
return builder.build();

View file

@ -30,25 +30,7 @@ public class EndCraftingTableBlock extends CraftingTableBlock implements BlockMo
}
@Override
public Optional<String> getModelString(String block) {
ResourceLocation blockId = Registry.BLOCK.getKey(this);
String blockName = blockId.getPath();
return Patterns.createJson(Patterns.BLOCK_SIDED, new HashMap<String, String>() {
private static final long serialVersionUID = 1L;
{
put("%particle%", blockName + "_front");
put("%down%", blockName + "_bottom");
put("%up%", blockName + "_top");
put("%north%", blockName + "_front");
put("%south%", blockName + "_side");
put("%west%", blockName + "_front");
put("%east%", blockName + "_side");
}
});
}
@Override
public BlockModel getModel(ResourceLocation resourceLocation) {
public BlockModel getItemModel(ResourceLocation resourceLocation) {
return getBlockModel(resourceLocation, defaultBlockState());
}

View file

@ -45,24 +45,6 @@ public class EndDoorBlock extends DoorBlock implements IRenderTypeable, BlockMod
return ERenderLayer.CUTOUT;
}
@Override
public Optional<String> getModelString(String block) {
String blockId = Registry.BLOCK.getKey(this).getPath();
if (block.contains("item")) {
return Patterns.createJson(Patterns.ITEM_GENERATED, block);
}
if (block.contains("top_hinge")) {
return Patterns.createJson(Patterns.BLOCK_DOOR_TOP_HINGE, blockId, blockId);
}
if (block.contains("bottom_hinge")) {
return Patterns.createJson(Patterns.BLOCK_DOOR_BOTTOM_HINGE, blockId, blockId);
}
if (block.contains("top")) {
return Patterns.createJson(Patterns.BLOCK_DOOR_TOP, blockId, blockId);
}
return Patterns.createJson(Patterns.BLOCK_DOOR_BOTTOM, blockId, blockId);
}
@Override
public @Nullable BlockModel getBlockModel(ResourceLocation resourceLocation, BlockState blockState) {
String blockName = resourceLocation.getPath();
@ -86,7 +68,7 @@ public class EndDoorBlock extends DoorBlock implements IRenderTypeable, BlockMod
}
@Override
public UnbakedModel getModelVariant(ResourceLocation resourceLocation, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
public UnbakedModel getModelVariant(ResourceLocation stateId, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
Direction facing = blockState.getValue(FACING);
DoorType doorType = getDoorType(blockState);
boolean open = blockState.getValue(OPEN);
@ -128,9 +110,9 @@ public class EndDoorBlock extends DoorBlock implements IRenderTypeable, BlockMod
break;
}
}
ResourceLocation modelId = new ResourceLocation(resourceLocation.getNamespace(),
"block/" + resourceLocation.getPath() + "_" + doorType);
registerBlockModel(resourceLocation, modelId, blockState, modelCache);
ResourceLocation modelId = new ResourceLocation(stateId.getNamespace(),
"block/" + stateId.getPath() + "_" + doorType);
registerBlockModel(stateId, modelId, blockState, modelCache);
return ModelsHelper.createMultiVariant(modelId, rotation.getRotation(), false);
}

View file

@ -36,20 +36,7 @@ public class EndFenceBlock extends FenceBlock implements BlockModelProvider {
}
@Override
public Optional<String> getModelString(String block) {
ResourceLocation blockId = Registry.BLOCK.getKey(this);
ResourceLocation parentId = Registry.BLOCK.getKey(parent);
if (block.contains("item")) {
return Patterns.createJson(Patterns.ITEM_FENCE, parentId.getPath(), blockId.getPath());
}
if (block.contains("side")) {
return Patterns.createJson(Patterns.BLOCK_FENCE_SIDE, parentId.getPath(), blockId.getPath());
}
return Patterns.createJson(Patterns.BLOCK_FENCE_POST, parentId.getPath(), blockId.getPath());
}
@Override
public BlockModel getModel(ResourceLocation blockId) {
public BlockModel getItemModel(ResourceLocation blockId) {
ResourceLocation parentId = Registry.BLOCK.getKey(parent);
Optional<String> pattern = Patterns.createJson(Patterns.ITEM_FENCE, parentId.getPath(), blockId.getPath());
return ModelsHelper.fromPattern(pattern);
@ -57,29 +44,24 @@ public class EndFenceBlock extends FenceBlock implements BlockModelProvider {
@Override
public @Nullable BlockModel getBlockModel(ResourceLocation blockId, BlockState blockState) {
ResourceLocation thisId = Registry.BLOCK.getKey(this);
ResourceLocation parentId = Registry.BLOCK.getKey(parent);
ResourceLocation postId = new ResourceLocation(thisId.getNamespace(),
"block/" + thisId.getPath() + "_post");
ResourceLocation sideId = new ResourceLocation(thisId.getNamespace(),
"block/" + thisId.getPath() + "_side");
if (blockId.equals(postId)) {
Optional<String> pattern = Patterns.createJson(Patterns.BLOCK_FENCE_POST, parentId.getPath(), blockId.getPath());
return ModelsHelper.fromPattern(pattern);
String path = blockId.getPath();
Optional<String> pattern = Optional.empty();
if (path.endsWith("_post")) {
pattern = Patterns.createJson(Patterns.BLOCK_FENCE_POST, parentId.getPath(), blockId.getPath());
}
if (blockId.equals(sideId)) {
Optional<String> pattern = Patterns.createJson(Patterns.BLOCK_FENCE_SIDE, parentId.getPath(), blockId.getPath());
return ModelsHelper.fromPattern(pattern);
if (path.endsWith("_side")) {
pattern = Patterns.createJson(Patterns.BLOCK_FENCE_SIDE, parentId.getPath(), blockId.getPath());
}
return null;
return ModelsHelper.fromPattern(pattern);
}
@Override
public UnbakedModel getModelVariant(ResourceLocation blockId, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
ResourceLocation postId = new ResourceLocation(blockId.getNamespace(),
"block/" + blockId.getPath() + "_post");
ResourceLocation sideId = new ResourceLocation(blockId.getNamespace(),
"block/" + blockId.getPath() + "_side");
public UnbakedModel getModelVariant(ResourceLocation stateId, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
ResourceLocation postId = new ResourceLocation(stateId.getNamespace(),
"block/" + stateId.getPath() + "_post");
ResourceLocation sideId = new ResourceLocation(stateId.getNamespace(),
"block/" + stateId.getPath() + "_side");
registerBlockModel(postId, postId, blockState, modelCache);
registerBlockModel(sideId, sideId, blockState, modelCache);

View file

@ -52,23 +52,6 @@ public class EndFurnaceBlock extends FurnaceBlock implements BlockModelProvider,
}
}
@Override
public Optional<String> getModelString(String block) {
ResourceLocation blockId = Registry.BLOCK.getKey(this);
Map<String, String> map = Maps.newHashMap();
map.put("%top%", blockId.getPath() + "_top");
map.put("%side%", blockId.getPath() + "_side");
if (block.contains("_on")) {
map.put("%front%", blockId.getPath() + "_front_on");
map.put("%glow%", blockId.getPath() + "_glow");
return Patterns.createJson(Patterns.BLOCK_FURNACE_LIT, map);
}
else {
map.put("%front%", blockId.getPath() + "_front");
return Patterns.createJson(Patterns.BLOCK_FURNACE, map);
}
}
@Override
public @Nullable BlockModel getBlockModel(ResourceLocation blockId, BlockState blockState) {
String blockName = blockId.getPath();
@ -88,16 +71,16 @@ public class EndFurnaceBlock extends FurnaceBlock implements BlockModelProvider,
}
@Override
public BlockModel getModel(ResourceLocation resourceLocation) {
public BlockModel getItemModel(ResourceLocation resourceLocation) {
return getBlockModel(resourceLocation, defaultBlockState());
}
@Override
public UnbakedModel getModelVariant(ResourceLocation resourceLocation, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
public UnbakedModel getModelVariant(ResourceLocation stateId, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
String lit = blockState.getValue(LIT) ? "_lit" : "";
ResourceLocation modelId = new ResourceLocation(resourceLocation.getNamespace(),
"block/" + resourceLocation.getPath() + lit);
registerBlockModel(resourceLocation, modelId, blockState, modelCache);
ResourceLocation modelId = new ResourceLocation(stateId.getNamespace(),
"block/" + stateId.getPath() + lit);
registerBlockModel(stateId, modelId, blockState, modelCache);
return ModelsHelper.createFacingModel(modelId, blockState.getValue(FACING), false, true);
}

View file

@ -34,20 +34,8 @@ public class EndGateBlock extends FenceGateBlock implements BlockModelProvider {
}
@Override
public Optional<String> getModelString(String block) {
ResourceLocation blockId = Registry.BLOCK.getKey(this);
ResourceLocation parentId = Registry.BLOCK.getKey(parent);
if (block.contains("wall")) {
if (block.contains("open")) {
return Patterns.createJson(Patterns.BLOCK_GATE_OPEN_WALL, parentId.getPath(), blockId.getPath());
} else {
return Patterns.createJson(Patterns.BLOCK_GATE_CLOSED_WALL, parentId.getPath(), blockId.getPath());
}
}
if (block.contains("open")) {
return Patterns.createJson(Patterns.BLOCK_GATE_OPEN, parentId.getPath(), blockId.getPath());
}
return Patterns.createJson(Patterns.BLOCK_GATE_CLOSED, parentId.getPath(), blockId.getPath());
public BlockModel getItemModel(ResourceLocation resourceLocation) {
return getBlockModel(resourceLocation, defaultBlockState());
}
@Override
@ -67,13 +55,13 @@ public class EndGateBlock extends FenceGateBlock implements BlockModelProvider {
}
@Override
public UnbakedModel getModelVariant(ResourceLocation resourceLocation, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
public UnbakedModel getModelVariant(ResourceLocation stateId, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
boolean inWall = blockState.getValue(IN_WALL);
boolean isOpen = blockState.getValue(OPEN);
String state = "" + (inWall ? "_wall" : "") + (isOpen ? "_open" : "_closed");
ResourceLocation modelId = new ResourceLocation(resourceLocation.getNamespace(),
"block/" + resourceLocation.getPath() + state);
registerBlockModel(resourceLocation, modelId, blockState, modelCache);
ResourceLocation modelId = new ResourceLocation(stateId.getNamespace(),
"block/" + stateId.getPath() + state);
registerBlockModel(stateId, modelId, blockState, modelCache);
return ModelsHelper.createFacingModel(modelId, blockState.getValue(FACING), true, false);
}
}

View file

@ -143,16 +143,7 @@ public class EndLadderBlock extends BlockBaseNotFull implements IRenderTypeable,
}
@Override
public Optional<String> getModelString(String block) {
ResourceLocation blockId = Registry.BLOCK.getKey(this);
if (block.contains("item")) {
return Patterns.createJson(Patterns.ITEM_BLOCK, blockId.getPath());
}
return Patterns.createJson(Patterns.BLOCK_LADDER, blockId.getPath());
}
@Override
public BlockModel getModel(ResourceLocation blockId) {
public BlockModel getItemModel(ResourceLocation blockId) {
return ModelsHelper.createBlockItem(blockId);
}
@ -163,9 +154,9 @@ public class EndLadderBlock extends BlockBaseNotFull implements IRenderTypeable,
}
@Override
public UnbakedModel getModelVariant(ResourceLocation resourceLocation, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
ResourceLocation modelId = new ResourceLocation(resourceLocation.getNamespace(), "block/" + resourceLocation.getPath());
registerBlockModel(resourceLocation, modelId, blockState, modelCache);
public UnbakedModel getModelVariant(ResourceLocation stateId, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
ResourceLocation modelId = new ResourceLocation(stateId.getNamespace(), "block/" + stateId.getPath());
registerBlockModel(stateId, modelId, blockState, modelCache);
return ModelsHelper.createFacingModel(modelId, blockState.getValue(FACING), false, true);
}
}

View file

@ -123,11 +123,11 @@ public class EndLanternBlock extends BlockBaseNotFull implements SimpleWaterlogg
}
@Override
public UnbakedModel getModelVariant(ResourceLocation resourceLocation, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
public UnbakedModel getModelVariant(ResourceLocation stateId, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
String floor = blockState.getValue(IS_FLOOR) ? "_floor" : "";
ResourceLocation modelId = new ResourceLocation(resourceLocation.getNamespace(),
"block/" + resourceLocation.getPath() + floor);
registerBlockModel(resourceLocation, modelId, blockState, modelCache);
ResourceLocation modelId = new ResourceLocation(stateId.getNamespace(),
"block/" + stateId.getPath() + floor);
registerBlockModel(stateId, modelId, blockState, modelCache);
return ModelsHelper.createBlockSimple(modelId);
}
}

View file

@ -8,7 +8,9 @@ import com.google.common.collect.Lists;
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;
import net.minecraft.core.Registry;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.enchantment.EnchantmentHelper;
import net.minecraft.world.item.enchantment.Enchantments;
@ -52,12 +54,6 @@ public class EndLeavesBlock extends LeavesBlock implements BlockModelProvider, I
this.sapling = sapling;
}
@Override
public Optional<String> getModelString(String block) {
String blockId = Registry.BLOCK.getKey(this).getPath();
return Patterns.createJson(Patterns.BLOCK_BASE, blockId, blockId);
}
@Override
public ERenderLayer getRenderLayer() {
return ERenderLayer.CUTOUT;
@ -78,4 +74,9 @@ public class EndLeavesBlock extends LeavesBlock implements BlockModelProvider, I
}
return MHelper.RANDOM.nextInt(16) == 0 ? Lists.newArrayList(new ItemStack(sapling)) : Lists.newArrayList();
}
@Override
public BlockModel getItemModel(ResourceLocation resourceLocation) {
return getBlockModel(resourceLocation, defaultBlockState());
}
}

View file

@ -2,11 +2,15 @@ package ru.betterend.blocks.basis;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Optional;
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;
import net.minecraft.client.resources.model.UnbakedModel;
import net.minecraft.core.Direction;
import net.minecraft.core.Registry;
import net.minecraft.resources.ResourceLocation;
@ -15,6 +19,8 @@ import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.IronBarsBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.storage.loot.LootContext;
import org.jetbrains.annotations.Nullable;
import ru.betterend.client.models.ModelsHelper;
import ru.betterend.client.render.ERenderLayer;
import ru.betterend.interfaces.IRenderTypeable;
import ru.betterend.client.models.BlockModelProvider;
@ -30,7 +36,6 @@ public class EndMetalPaneBlock extends IronBarsBlock implements BlockModelProvid
return Collections.singletonList(new ItemStack(this));
}
@Override
public Optional<String> getModelString(String block) {
ResourceLocation blockId = Registry.BLOCK.getKey(this);
if (block.contains("item")) {
@ -43,7 +48,50 @@ public class EndMetalPaneBlock extends IronBarsBlock implements BlockModelProvid
return Patterns.createJson(Patterns.BLOCK_BARS_SIDE, blockId.getPath(), blockId.getPath());
}
}
@Override
public BlockModel getItemModel(ResourceLocation resourceLocation) {
return ModelsHelper.createBlockItem(resourceLocation);
}
@Override
public @Nullable BlockModel getBlockModel(ResourceLocation blockId, BlockState blockState) {
ResourceLocation thisId = Registry.BLOCK.getKey(this);
String path = blockId.getPath();
Optional<String> pattern = Optional.empty();
if (path.endsWith("_post")) {
pattern = Patterns.createJson(Patterns.BLOCK_BARS_POST, thisId.getPath(), thisId.getPath());
}
if (path.endsWith("_side")) {
pattern = Patterns.createJson(Patterns.BLOCK_BARS_SIDE, thisId.getPath(), thisId.getPath());
}
return ModelsHelper.fromPattern(pattern);
}
@Override
public UnbakedModel getModelVariant(ResourceLocation stateId, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
ResourceLocation postId = new ResourceLocation(stateId.getNamespace(),
"block/" + stateId.getPath() + "_post");
ResourceLocation sideId = new ResourceLocation(stateId.getNamespace(),
"block/" + stateId.getPath() + "_side");
registerBlockModel(postId, postId, blockState, modelCache);
registerBlockModel(sideId, sideId, blockState, modelCache);
ModelsHelper.MultiPartBuilder builder = ModelsHelper.MultiPartBuilder.create(stateDefinition);
builder.part(postId).setCondition(state ->
!state.getValue(NORTH) && !state.getValue(EAST) &&
!state.getValue(SOUTH) && !state.getValue(WEST)).add();
builder.part(sideId).setCondition(state -> state.getValue(NORTH)).setUVLock(true).add();
builder.part(sideId).setCondition(state -> state.getValue(EAST))
.setTransformation(BlockModelRotation.X0_Y90.getRotation()).setUVLock(true).add();
builder.part(sideId).setCondition(state -> state.getValue(SOUTH))
.setTransformation(BlockModelRotation.X0_Y180.getRotation()).setUVLock(true).add();
builder.part(sideId).setCondition(state -> state.getValue(WEST))
.setTransformation(BlockModelRotation.X0_Y270.getRotation()).setUVLock(true).add();
return builder.build();
}
@Environment(EnvType.CLIENT)
public boolean skipRendering(BlockState state, BlockState stateFrom, Direction direction) {
if (direction.getAxis().isVertical() && stateFrom.getBlock().is(this) && !stateFrom.equals(state)) {

View file

@ -1,41 +0,0 @@
package ru.betterend.blocks.basis;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.core.Registry;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.WeightedPressurePlateBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.storage.loot.LootContext;
import ru.betterend.client.models.BlockModelProvider;
import ru.betterend.client.models.Patterns;
public class EndMetalPlateBlock extends WeightedPressurePlateBlock implements BlockModelProvider {
private final Block parent;
public EndMetalPlateBlock(Block source) {
super(15, FabricBlockSettings.copyOf(source).noCollission().noOcclusion().requiresCorrectToolForDrops().strength(0.5F));
this.parent = source;
}
@Override
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
return Collections.singletonList(new ItemStack(this));
}
@Override
public Optional<String> getModelString(String block) {
ResourceLocation blockId = Registry.BLOCK.getKey(this);
ResourceLocation parentId = Registry.BLOCK.getKey(parent);
if (block.contains("down")) {
return Patterns.createJson(Patterns.BLOCK_PLATE_DOWN, parentId.getPath(), blockId.getPath());
}
return Patterns.createJson(Patterns.BLOCK_PLATE_UP, parentId.getPath(), blockId.getPath());
}
}

View file

@ -2,11 +2,10 @@ package ru.betterend.blocks.basis;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.Random;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.core.Registry;
import net.minecraft.client.renderer.block.model.BlockModel;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.util.Mth;
import net.minecraft.world.item.Item;
@ -21,16 +20,15 @@ import net.minecraft.world.level.material.MaterialColor;
import net.minecraft.world.level.storage.loot.LootContext;
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
import ru.betterend.client.models.BlockModelProvider;
import ru.betterend.client.models.Patterns;
import ru.betterend.util.MHelper;
public class EndOreBlock extends OreBlock implements BlockModelProvider {
private final Item dropItem;
private final int minCount;
private final int maxCount;
private final int expirience;
private final int experience;
public EndOreBlock(Item drop, int minCount, int maxCount, int expirience) {
public EndOreBlock(Item drop, int minCount, int maxCount, int experience) {
super(FabricBlockSettings.of(Material.STONE, MaterialColor.SAND)
.hardness(3F)
.resistance(9F)
@ -39,12 +37,12 @@ public class EndOreBlock extends OreBlock implements BlockModelProvider {
this.dropItem = drop;
this.minCount = minCount;
this.maxCount = maxCount;
this.expirience = expirience;
this.experience = experience;
}
@Override
protected int xpOnDrop(Random random) {
return this.expirience > 0 ? random.nextInt(expirience) + 1 : 0;
return this.experience > 0 ? random.nextInt(experience) + 1 : 0;
}
@Override
@ -72,9 +70,7 @@ public class EndOreBlock extends OreBlock implements BlockModelProvider {
}
@Override
public Optional<String> getModelString(String block) {
ResourceLocation blockId = Registry.BLOCK.getKey(this);
return Patterns.createJson(Patterns.BLOCK_BASE, blockId.getPath(), block);
public BlockModel getItemModel(ResourceLocation resourceLocation) {
return getBlockModel(resourceLocation, defaultBlockState());
}
}

View file

@ -59,16 +59,7 @@ public class EndPathBlock extends BlockBaseNotFull {
}
@Override
public Optional<String> getModelString(String block) {
String name = Registry.BLOCK.getKey(this).getPath();
Map<String, String> map = Maps.newHashMap();
map.put("%top%", name + "_top");
map.put("%side%", name.replace("_path", "") + "_side");
return Patterns.createJson(Patterns.BLOCK_PATH, map);
}
@Override
public BlockModel getModel(ResourceLocation blockId) {
public BlockModel getItemModel(ResourceLocation blockId) {
return getBlockModel(blockId, defaultBlockState());
}
@ -83,8 +74,9 @@ public class EndPathBlock extends BlockBaseNotFull {
}
@Override
public UnbakedModel getModelVariant(ResourceLocation resourceLocation, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
ResourceLocation modelId = new ResourceLocation(resourceLocation.getNamespace(), "block/" + resourceLocation.getPath());
public UnbakedModel getModelVariant(ResourceLocation stateId, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
ResourceLocation modelId = new ResourceLocation(stateId.getNamespace(), "block/" + stateId.getPath());
registerBlockModel(stateId, modelId, blockState, modelCache);
return ModelsHelper.createRandomTopModel(modelId);
}
}

View file

@ -35,16 +35,10 @@ public class EndPillarBlock extends RotatedPillarBlock implements BlockModelProv
}
@Override
public BlockModel getModel(ResourceLocation blockId) {
public BlockModel getItemModel(ResourceLocation blockId) {
return getBlockModel(blockId, defaultBlockState());
}
@Override
public Optional<String> getModelString(String block) {
ResourceLocation blockId = Registry.BLOCK.getKey(this);
return createBlockPattern(blockId);
}
@Override
public @Nullable BlockModel getBlockModel(ResourceLocation blockId, BlockState blockState) {
Optional<String> pattern = createBlockPattern(blockId);
@ -52,10 +46,10 @@ public class EndPillarBlock extends RotatedPillarBlock implements BlockModelProv
}
@Override
public UnbakedModel getModelVariant(ResourceLocation resourceLocation, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
ResourceLocation modelId = new ResourceLocation(resourceLocation.getNamespace(),
"block/" + resourceLocation.getPath());
registerBlockModel(resourceLocation, modelId, blockState, modelCache);
public UnbakedModel getModelVariant(ResourceLocation stateId, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
ResourceLocation modelId = new ResourceLocation(stateId.getNamespace(),
"block/" + stateId.getPath());
registerBlockModel(stateId, modelId, blockState, modelCache);
return ModelsHelper.createRotatedModel(modelId, blockState.getValue(AXIS));
}

View file

@ -2,9 +2,12 @@ package ru.betterend.blocks.basis;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Optional;
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;
import net.minecraft.core.Registry;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.ItemStack;
@ -12,7 +15,9 @@ import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.PressurePlateBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.storage.loot.LootContext;
import org.jetbrains.annotations.Nullable;
import ru.betterend.client.models.BlockModelProvider;
import ru.betterend.client.models.ModelsHelper;
import ru.betterend.client.models.Patterns;
public class EndPlateBlock extends PressurePlateBlock implements BlockModelProvider {
@ -29,13 +34,28 @@ public class EndPlateBlock extends PressurePlateBlock implements BlockModelProvi
}
@Override
public Optional<String> getModelString(String block) {
ResourceLocation blockId = Registry.BLOCK.getKey(this);
ResourceLocation parentId = Registry.BLOCK.getKey(parent);
if (block.contains("down")) {
return Patterns.createJson(Patterns.BLOCK_PLATE_DOWN, parentId.getPath(), blockId.getPath());
}
return Patterns.createJson(Patterns.BLOCK_PLATE_UP, parentId.getPath(), blockId.getPath());
public BlockModel getItemModel(ResourceLocation resourceLocation) {
return getBlockModel(resourceLocation, defaultBlockState());
}
@Override
public @Nullable BlockModel getBlockModel(ResourceLocation resourceLocation, BlockState blockState) {
ResourceLocation parentId = Registry.BLOCK.getKey(parent);
Optional<String> pattern;
if (blockState.getValue(POWERED)) {
pattern = Patterns.createJson(Patterns.BLOCK_PLATE_DOWN, parentId.getPath(), resourceLocation.getPath());
} else {
pattern = Patterns.createJson(Patterns.BLOCK_PLATE_UP, parentId.getPath(), resourceLocation.getPath());
}
return ModelsHelper.fromPattern(pattern);
}
@Override
public UnbakedModel getModelVariant(ResourceLocation stateId, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
String state = blockState.getValue(POWERED) ? "_down" : "_up";
ResourceLocation modelId = new ResourceLocation(stateId.getNamespace(),
"block/" + stateId.getPath() + state);
registerBlockModel(stateId, modelId, blockState, modelCache);
return ModelsHelper.createBlockSimple(modelId);
}
}

View file

@ -147,15 +147,6 @@ public class EndSignBlock extends SignBlock implements BlockModelProvider, ISpet
return null;
}
@Override
public Optional<String> getModelString(String path) {
ResourceLocation parentId = Registry.BLOCK.getKey(parent);
if (path.contains("item")) {
return Patterns.createJson(Patterns.ITEM_GENERATED, path);
}
return Patterns.createJson(Patterns.BLOCK_EMPTY, parentId.getPath());
}
@Override
public @Nullable BlockModel getBlockModel(ResourceLocation resourceLocation, BlockState blockState) {
ResourceLocation parentId = Registry.BLOCK.getKey(parent);

View file

@ -36,10 +36,8 @@ public class EndSlabBlock extends SlabBlock implements BlockModelProvider {
}
@Override
public Optional<String> getModelString(String block) {
ResourceLocation blockId = Registry.BLOCK.getKey(this);
ResourceLocation parentId = Registry.BLOCK.getKey(parent);
return Patterns.createJson(Patterns.BLOCK_SLAB, parentId.getPath(), blockId.getPath());
public BlockModel getItemModel(ResourceLocation resourceLocation) {
return getBlockModel(resourceLocation, defaultBlockState());
}
@Override
@ -50,11 +48,11 @@ public class EndSlabBlock extends SlabBlock implements BlockModelProvider {
}
@Override
public UnbakedModel getModelVariant(ResourceLocation resourceLocation, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
public UnbakedModel getModelVariant(ResourceLocation stateId, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
SlabType type = blockState.getValue(TYPE);
ResourceLocation modelId = new ResourceLocation(resourceLocation.getNamespace(),
"block/" + resourceLocation.getPath() + "_" + type);
registerBlockModel(resourceLocation, modelId, blockState, modelCache);
ResourceLocation modelId = new ResourceLocation(stateId.getNamespace(),
"block/" + stateId.getPath() + "_" + type);
registerBlockModel(stateId, modelId, blockState, modelCache);
if (type == SlabType.TOP) {
return ModelsHelper.createMultiVariant(modelId, BlockModelRotation.X180_Y0.getRotation(), true);
}

View file

@ -38,21 +38,7 @@ public class EndStairsBlock extends StairBlock implements BlockModelProvider {
}
@Override
public Optional<String> getModelString(String block) {
ResourceLocation blockId = Registry.BLOCK.getKey(this);
ResourceLocation parentId = Registry.BLOCK.getKey(parent);
Optional<String> pattern = Patterns.createJson(Patterns.BLOCK_STAIR, parentId.getPath(), blockId.getPath());
if (block.contains("inner")) {
pattern = Patterns.createJson(Patterns.BLOCK_STAIR_INNER, parentId.getPath(), blockId.getPath());
}
if (block.contains("outer")) {
pattern = Patterns.createJson(Patterns.BLOCK_STAIR_OUTER, parentId.getPath(), blockId.getPath());
}
return pattern;
}
@Override
public BlockModel getModel(ResourceLocation resourceLocation) {
public BlockModel getItemModel(ResourceLocation resourceLocation) {
return getBlockModel(resourceLocation, defaultBlockState());
}

View file

@ -1,9 +1,9 @@
package ru.betterend.blocks.basis;
import net.minecraft.world.level.block.Block;
public class EndStonelateBlock extends EndPlateBlock {
public EndStonelateBlock(Block source) {
super(Sensitivity.MOBS, source);
}
}
package ru.betterend.blocks.basis;
import net.minecraft.world.level.block.Block;
public class EndStonePlateBlock extends EndPlateBlock {
public EndStonePlateBlock(Block source) {
super(Sensitivity.MOBS, source);
}
}

View file

@ -97,17 +97,7 @@ public class EndTerrainBlock extends BlockBase {
}
@Override
public Optional<String> getModelString(String block) {
String name = Registry.BLOCK.getKey(this).getPath();
Map<String, String> map = Maps.newHashMap();
map.put("%top%", "betterend:block/" + name + "_top");
map.put("%side%", "betterend:block/" + name + "_side");
map.put("%bottom%", "minecraft:block/end_stone");
return Patterns.createJson(Patterns.BLOCK_TOP_SIDE_BOTTOM, map);
}
@Override
public BlockModel getModel(ResourceLocation blockId) {
public BlockModel getItemModel(ResourceLocation blockId) {
return getBlockModel(blockId, defaultBlockState());
}
@ -118,13 +108,14 @@ public class EndTerrainBlock extends BlockBase {
textures.put("%top%", "betterend:block/" + name + "_top");
textures.put("%side%", "betterend:block/" + name + "_side");
textures.put("%bottom%", "minecraft:block/end_stone");
Optional<String> pattern = Patterns.createJson(Patterns.BLOCK_PATH, textures);
Optional<String> pattern = Patterns.createJson(Patterns.BLOCK_TOP_SIDE_BOTTOM, textures);
return ModelsHelper.fromPattern(pattern);
}
@Override
public UnbakedModel getModelVariant(ResourceLocation resourceLocation, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
ResourceLocation modelId = new ResourceLocation(resourceLocation.getNamespace(), "block/" + resourceLocation.getPath());
public UnbakedModel getModelVariant(ResourceLocation stateId, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
ResourceLocation modelId = new ResourceLocation(stateId.getNamespace(), "block/" + stateId.getPath());
registerBlockModel(stateId, modelId, blockState, modelCache);
return ModelsHelper.createRandomTopModel(modelId);
}
}

View file

@ -37,20 +37,7 @@ public class EndTrapdoorBlock extends TrapDoorBlock implements IRenderTypeable,
}
@Override
public Optional<String> getModelString(String block) {
ResourceLocation blockId = Registry.BLOCK.getKey(this);
String name = blockId.getPath();
return Patterns.createJson(Patterns.BLOCK_TRAPDOOR, new HashMap<String, String>() {
private static final long serialVersionUID = 1L;
{
put("%block%", name);
put("%texture%", name.replace("trapdoor", "door_side"));
}
});
}
@Override
public BlockModel getModel(ResourceLocation resourceLocation) {
public BlockModel getItemModel(ResourceLocation resourceLocation) {
return getBlockModel(resourceLocation, defaultBlockState());
}
@ -68,8 +55,9 @@ public class EndTrapdoorBlock extends TrapDoorBlock implements IRenderTypeable,
}
@Override
public UnbakedModel getModelVariant(ResourceLocation resourceLocation, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
ResourceLocation modelId = new ResourceLocation(resourceLocation.getNamespace(), "block/" + resourceLocation.getPath());
public UnbakedModel getModelVariant(ResourceLocation stateId, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
ResourceLocation modelId = new ResourceLocation(stateId.getNamespace(), "block/" + stateId.getPath());
registerBlockModel(stateId, modelId, blockState, modelCache);
boolean isTop = blockState.getValue(HALF) == Half.TOP;
boolean isOpen = blockState.getValue(OPEN);
int y = 0;

View file

@ -37,23 +37,7 @@ public class EndWallBlock extends WallBlock implements BlockModelProvider {
}
@Override
public Optional<String> getModelString(String block) {
ResourceLocation blockId = Registry.BLOCK.getKey(this);
ResourceLocation parentId = Registry.BLOCK.getKey(parent);
if (block.contains("item")) {
return Patterns.createJson(Patterns.ITEM_WALL, parentId.getPath(), blockId.getPath());
}
if (block.contains("side_tall")) {
return Patterns.createJson(Patterns.BLOCK_WALL_SIDE_TALL, parentId.getPath(), blockId.getPath());
}
if (block.contains("side")) {
return Patterns.createJson(Patterns.BLOCK_WALL_SIDE, parentId.getPath(), blockId.getPath());
}
return Patterns.createJson(Patterns.BLOCK_WALL_POST, parentId.getPath(), blockId.getPath());
}
@Override
public BlockModel getModel(ResourceLocation blockId) {
public BlockModel getItemModel(ResourceLocation blockId) {
ResourceLocation parentId = Registry.BLOCK.getKey(parent);
Optional<String> pattern = Patterns.createJson(Patterns.ITEM_WALL, parentId.getPath(), blockId.getPath());
return ModelsHelper.fromPattern(pattern);
@ -61,35 +45,29 @@ public class EndWallBlock extends WallBlock implements BlockModelProvider {
@Override
public @Nullable BlockModel getBlockModel(ResourceLocation blockId, BlockState blockState) {
ResourceLocation thisId = Registry.BLOCK.getKey(this);
ResourceLocation parentId = Registry.BLOCK.getKey(parent);
ResourceLocation postId = new ResourceLocation(thisId.getNamespace(),
"block/" + thisId.getPath() + "_post");
ResourceLocation sideId = new ResourceLocation(thisId.getNamespace(),
"block/" + thisId.getPath() + "_side");
ResourceLocation sideTallId = new ResourceLocation(thisId.getNamespace(),
"block/" + thisId.getPath() + "_side_tall");
String path = blockId.getPath();
Optional<String> pattern = Optional.empty();
if (blockId.equals(postId)) {
if (path.endsWith("_post")) {
pattern = Patterns.createJson(Patterns.BLOCK_WALL_POST, parentId.getPath(), blockId.getPath());
}
if (blockId.equals(sideId)) {
if (path.endsWith("_side")) {
pattern = Patterns.createJson(Patterns.BLOCK_WALL_SIDE, parentId.getPath(), blockId.getPath());
}
if (blockId.equals(sideTallId)) {
if (path.endsWith("_side_tall")) {
pattern = Patterns.createJson(Patterns.BLOCK_WALL_SIDE_TALL, parentId.getPath(), blockId.getPath());
}
return ModelsHelper.fromPattern(pattern);
}
@Override
public UnbakedModel getModelVariant(ResourceLocation blockId, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
ResourceLocation postId = new ResourceLocation(blockId.getNamespace(),
"block/" + blockId.getPath() + "_post");
ResourceLocation sideId = new ResourceLocation(blockId.getNamespace(),
"block/" + blockId.getPath() + "_side");
ResourceLocation sideTallId = new ResourceLocation(blockId.getNamespace(),
"block/" + blockId.getPath() + "_side_tall");
public UnbakedModel getModelVariant(ResourceLocation stateId, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
ResourceLocation postId = new ResourceLocation(stateId.getNamespace(),
"block/" + stateId.getPath() + "_post");
ResourceLocation sideId = new ResourceLocation(stateId.getNamespace(),
"block/" + stateId.getPath() + "_side");
ResourceLocation sideTallId = new ResourceLocation(stateId.getNamespace(),
"block/" + stateId.getPath() + "_side_tall");
registerBlockModel(postId, postId, blockState, modelCache);
registerBlockModel(sideId, sideId, blockState, modelCache);
registerBlockModel(sideTallId, sideTallId, blockState, modelCache);

View file

@ -0,0 +1,61 @@
package ru.betterend.blocks.basis;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Optional;
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;
import net.minecraft.core.Registry;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.WeightedPressurePlateBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.storage.loot.LootContext;
import org.jetbrains.annotations.Nullable;
import ru.betterend.client.models.BlockModelProvider;
import ru.betterend.client.models.ModelsHelper;
import ru.betterend.client.models.Patterns;
public class EndWeightedPlateBlock extends WeightedPressurePlateBlock implements BlockModelProvider {
private final Block parent;
public EndWeightedPlateBlock(Block source) {
super(15, FabricBlockSettings.copyOf(source).noCollission().noOcclusion().requiresCorrectToolForDrops().strength(0.5F));
this.parent = source;
}
@Override
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
return Collections.singletonList(new ItemStack(this));
}
@Override
public BlockModel getItemModel(ResourceLocation resourceLocation) {
return getBlockModel(resourceLocation, defaultBlockState());
}
@Override
public @Nullable BlockModel getBlockModel(ResourceLocation resourceLocation, BlockState blockState) {
ResourceLocation parentId = Registry.BLOCK.getKey(parent);
Optional<String> pattern;
if (blockState.getValue(POWER) > 0) {
pattern = Patterns.createJson(Patterns.BLOCK_PLATE_DOWN, parentId.getPath(), resourceLocation.getPath());
} else {
pattern = Patterns.createJson(Patterns.BLOCK_PLATE_UP, parentId.getPath(), resourceLocation.getPath());
}
return ModelsHelper.fromPattern(pattern);
}
@Override
public UnbakedModel getModelVariant(ResourceLocation stateId, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
String state = blockState.getValue(POWER) > 0 ? "_down" : "_up";
ResourceLocation modelId = new ResourceLocation(stateId.getNamespace(),
"block/" + stateId.getPath() + state);
registerBlockModel(stateId, modelId, blockState, modelCache);
return ModelsHelper.createBlockSimple(modelId);
}
}

View file

@ -110,16 +110,7 @@ public abstract class FeatureSaplingBlock extends SaplingBlock implements IRende
}
@Override
public Optional<String> getModelString(String block) {
if (block.contains("item")) {
block = block.split("/")[1];
return Patterns.createJson(Patterns.ITEM_BLOCK, block);
}
return Patterns.createJson(Patterns.BLOCK_CROSS, block);
}
@Override
public BlockModel getModel(ResourceLocation resourceLocation) {
public BlockModel getItemModel(ResourceLocation resourceLocation) {
return ModelsHelper.createBlockItem(resourceLocation);
}

View file

@ -338,24 +338,7 @@ public class PedestalBlock extends BlockBaseNotFull implements EntityBlock {
}
@Override
public Optional<String> getModelString(String block) {
Map<String, String> textures = createTexturesMap();
if (block.contains("column_top")) {
return Patterns.createJson(Patterns.BLOCK_PEDESTAL_COLUMN_TOP, textures);
} else if (block.contains("column")) {
return Patterns.createJson(Patterns.BLOKC_PEDESTAL_COLUMN, textures);
} else if (block.contains("top")) {
return Patterns.createJson(Patterns.BLOCK_PEDESTAL_TOP, textures);
} else if (block.contains("bottom")) {
return Patterns.createJson(Patterns.BLOCK_PEDESTAL_BOTTOM, textures);
} else if (block.contains("pillar")) {
return Patterns.createJson(Patterns.BLOCK_PEDESTAL_PILLAR, textures);
}
return Patterns.createJson(Patterns.BLOCK_PEDESTAL_DEFAULT, textures);
}
@Override
public BlockModel getModel(ResourceLocation blockId) {
public BlockModel getItemModel(ResourceLocation blockId) {
return getBlockModel(blockId, defaultBlockState());
}
@ -390,11 +373,11 @@ public class PedestalBlock extends BlockBaseNotFull implements EntityBlock {
}
@Override
public UnbakedModel getModelVariant(ResourceLocation resourceLocation, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
public UnbakedModel getModelVariant(ResourceLocation stateId, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
PedestalState state = blockState.getValue(STATE);
ResourceLocation modelId = new ResourceLocation(resourceLocation.getNamespace(),
"block/" + resourceLocation.getPath() + "_" + state);
registerBlockModel(resourceLocation, modelId, blockState, modelCache);
ResourceLocation modelId = new ResourceLocation(stateId.getNamespace(),
"block/" + stateId.getPath() + "_" + state);
registerBlockModel(stateId, modelId, blockState, modelCache);
return ModelsHelper.createBlockSimple(modelId);
}

View file

@ -35,12 +35,6 @@ public class SimpleLeavesBlock extends BlockBaseNotFull implements IRenderTypeab
.isViewBlocking((state, world, pos) -> false));
}
@Override
public Optional<String> getModelString(String block) {
String texture = Registry.BLOCK.getKey(this).getPath();
return Patterns.createJson(Patterns.BLOCK_BASE, texture, texture);
}
@Override
public ERenderLayer getRenderLayer() {
return ERenderLayer.CUTOUT;

View file

@ -1,6 +1,9 @@
package ru.betterend.blocks.basis;
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;
import net.minecraft.client.resources.model.UnbakedModel;
import net.minecraft.core.BlockPos;
import net.minecraft.core.BlockPos.MutableBlockPos;
import net.minecraft.core.Direction;
@ -28,11 +31,14 @@ import net.minecraft.world.level.material.FluidState;
import net.minecraft.world.level.material.Fluids;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
import org.jetbrains.annotations.Nullable;
import ru.betterend.blocks.BlockProperties;
import ru.betterend.client.models.ModelsHelper;
import ru.betterend.client.render.ERenderLayer;
import ru.betterend.interfaces.IRenderTypeable;
import ru.betterend.client.models.Patterns;
import java.util.Map;
import java.util.Optional;
public class StalactiteBlock extends BlockBaseNotFull implements SimpleWaterloggedBlock, LiquidBlockContainer, IRenderTypeable {
@ -194,12 +200,18 @@ public class StalactiteBlock extends BlockBaseNotFull implements SimpleWaterlogg
}
@Override
public Optional<String> getModelString(String block) {
ResourceLocation blockId = Registry.BLOCK.getKey(this);
if (block.contains("item")) {
return Patterns.createJson(Patterns.ITEM_GENERATED, "item/" + blockId.getPath());
}
return Patterns.createJson(Patterns.BLOCK_CROSS_SHADED, block);
public @Nullable BlockModel getBlockModel(ResourceLocation resourceLocation, BlockState blockState) {
Optional<String> pattern = Patterns.createJson(Patterns.BLOCK_CROSS_SHADED, resourceLocation.getPath());
return ModelsHelper.fromPattern(pattern);
}
@Override
public UnbakedModel getModelVariant(ResourceLocation stateId, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
BlockModelRotation rotation = blockState.getValue(IS_FLOOR) ? BlockModelRotation.X0_Y0 : BlockModelRotation.X180_Y0;
ResourceLocation modelId = new ResourceLocation(stateId.getNamespace(),
stateId.getPath() + "_" + blockState.getValue(SIZE));
registerBlockModel(modelId, modelId, blockState, modelCache);
return ModelsHelper.createMultiVariant(modelId, rotation.getRotation(), false);
}
@Override

View file

@ -65,15 +65,6 @@ public class StoneLanternBlock extends EndLanternBlock implements IColorProvider
return state.getValue(IS_FLOOR) ? SHAPE_FLOOR : SHAPE_CEIL;
}
@Override
public Optional<String> getModelString(String block) {
String texture = Registry.BLOCK.getKey(this).getPath();
if (block.contains("ceil")) {
return Patterns.createJson(Patterns.BLOCK_STONE_LANTERN_CEIL, texture, texture);
}
return Patterns.createJson(Patterns.BLOCK_STONE_LANTERN_FLOOR, texture, texture);
}
@Override
public @Nullable BlockModel getBlockModel(ResourceLocation resourceLocation, BlockState blockState) {
String blockName = resourceLocation.getPath();

View file

@ -105,20 +105,7 @@ public class TripleTerrainBlock extends EndTerrainBlock {
}
@Override
public Optional<String> getModelString(String block) {
String name = Registry.BLOCK.getKey(this).getPath();
if (block.endsWith("_middle")) {
return Patterns.createJson(Patterns.BLOCK_BASE, name + "_top", name + "_top");
}
Map<String, String> map = Maps.newHashMap();
map.put("%top%", "betterend:block/" + name + "_top");
map.put("%side%", "betterend:block/" + name + "_side");
map.put("%bottom%", "minecraft:block/end_stone");
return Patterns.createJson(Patterns.BLOCK_TOP_SIDE_BOTTOM, map);
}
@Override
public BlockModel getModel(ResourceLocation blockId) {
public BlockModel getItemModel(ResourceLocation blockId) {
return getBlockModel(blockId, defaultBlockState());
}
@ -139,12 +126,12 @@ public class TripleTerrainBlock extends EndTerrainBlock {
}
@Override
public UnbakedModel getModelVariant(ResourceLocation resourceLocation, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
public UnbakedModel getModelVariant(ResourceLocation stateId, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
boolean isMiddle = isMiddle(blockState);
String middle = isMiddle ? "_middle" : "";
ResourceLocation modelId = new ResourceLocation(resourceLocation.getNamespace(),
"block/" + resourceLocation.getPath() + middle);
registerBlockModel(resourceLocation, modelId, blockState, modelCache);
ResourceLocation modelId = new ResourceLocation(stateId.getNamespace(),
"block/" + stateId.getPath() + middle);
registerBlockModel(stateId, modelId, blockState, modelCache);
if (isMiddle) {
List<Variant> variants = Lists.newArrayList();
for (BlockModelRotation rotation : BlockModelRotation.values()) {

View file

@ -13,7 +13,7 @@ import ru.betterend.blocks.basis.EndPillarBlock;
import ru.betterend.blocks.basis.EndSlabBlock;
import ru.betterend.blocks.basis.EndStairsBlock;
import ru.betterend.blocks.basis.EndStoneButtonBlock;
import ru.betterend.blocks.basis.EndStonelateBlock;
import ru.betterend.blocks.basis.EndStonePlateBlock;
import ru.betterend.blocks.basis.EndWallBlock;
import ru.betterend.blocks.basis.StoneLanternBlock;
import ru.betterend.recipe.CraftingRecipes;
@ -54,7 +54,7 @@ public class StoneMaterial {
slab = EndBlocks.registerBlock(name + "_slab", new EndSlabBlock(stone));
wall = EndBlocks.registerBlock(name + "_wall", new EndWallBlock(stone));
button = EndBlocks.registerBlock(name + "_button", new EndStoneButtonBlock(stone));
pressure_plate = EndBlocks.registerBlock(name + "_plate", new EndStonelateBlock(stone));
pressure_plate = EndBlocks.registerBlock(name + "_plate", new EndStonePlateBlock(stone));
pedestal = EndBlocks.registerBlock(name + "_pedestal", new EndPedestal(stone));
lantern = EndBlocks.registerBlock(name + "_lantern", new StoneLanternBlock(stone));