diff --git a/gradle.properties b/gradle.properties index 7b238974..8f986070 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,7 +8,7 @@ yarn_mappings=6 loader_version=0.11.3 # Mod Properties -mod_version = 0.1.9 +mod_version = 0.1.10 maven_group = ru.bclib archives_base_name = bclib diff --git a/src/main/java/ru/bclib/blocks/BasePathBlock.java b/src/main/java/ru/bclib/blocks/BasePathBlock.java index a6cb716d..1c675fd1 100644 --- a/src/main/java/ru/bclib/blocks/BasePathBlock.java +++ b/src/main/java/ru/bclib/blocks/BasePathBlock.java @@ -30,14 +30,11 @@ import ru.bclib.client.models.BasePatterns; import ru.bclib.client.models.ModelsHelper; import ru.bclib.client.models.PatternsHelper; -public class BasePathBlock extends BaseBlockNotFull { +public abstract class BasePathBlock extends BaseBlockNotFull { private static final VoxelShape SHAPE = Block.box(0, 0, 0, 16, 15, 16); - - private final Block base; public BasePathBlock(Block source) { super(FabricBlockSettings.copyOf(source).isValidSpawn((state, world, pos, type) -> { return false; })); - this.base = source; if (source instanceof BaseTerrainBlock) { BaseTerrainBlock terrain = (BaseTerrainBlock) source; terrain.setPathBlock(this); @@ -71,8 +68,9 @@ public class BasePathBlock extends BaseBlockNotFull { @Override public @Nullable BlockModel getBlockModel(ResourceLocation resourceLocation, BlockState blockState) { String name = resourceLocation.getPath(); - ResourceLocation baseId = Registry.BLOCK.getKey(base); - String bottom = baseId.getNamespace() + ":block/" + baseId.getPath(); + Block bottomBlock = getBottomBlock(); + ResourceLocation bottomId = Registry.BLOCK.getKey(bottomBlock); + String bottom = bottomId.getNamespace() + ":block/" + bottomId.getPath(); Map textures = Maps.newHashMap(); textures.put("%modid%", resourceLocation.getNamespace()); textures.put("%top%", name + "_top"); @@ -88,4 +86,6 @@ public class BasePathBlock extends BaseBlockNotFull { registerBlockModel(stateId, modelId, blockState, modelCache); return ModelsHelper.createRandomTopModel(modelId); } + + protected abstract Block getBottomBlock(); }