diff --git a/src/main/java/ru/bclib/BCLib.java b/src/main/java/ru/bclib/BCLib.java index fc4704e9..1d918a36 100644 --- a/src/main/java/ru/bclib/BCLib.java +++ b/src/main/java/ru/bclib/BCLib.java @@ -3,6 +3,7 @@ package ru.bclib; import net.fabricmc.api.EnvType; import net.fabricmc.api.ModInitializer; import net.fabricmc.loader.api.FabricLoader; +import net.minecraft.resources.ResourceLocation; import ru.bclib.util.Logger; import ru.bclib.world.surface.BCLSurfaceBuilders; import ru.bclib.api.BCLibTags; @@ -24,4 +25,8 @@ public class BCLib implements ModInitializer { public static boolean isClient() { return FabricLoader.getInstance().getEnvironmentType() == EnvType.CLIENT; } + + public static ResourceLocation makeID(String path) { + return new ResourceLocation(MOD_ID, path); + } } diff --git a/src/main/java/ru/bclib/client/models/BasePatterns.java b/src/main/java/ru/bclib/client/models/BasePatterns.java new file mode 100644 index 00000000..575e3b27 --- /dev/null +++ b/src/main/java/ru/bclib/client/models/BasePatterns.java @@ -0,0 +1,61 @@ +package ru.bclib.client.models; + +import net.minecraft.resources.ResourceLocation; +import ru.bclib.BCLib; + +public class BasePatterns { + //Block Models + public final static ResourceLocation BLOCK_EMPTY = BCLib.makeID("patterns/block/empty.json"); + public final static ResourceLocation BLOCK_BASE = BCLib.makeID("patterns/block/block.json"); + public final static ResourceLocation BLOCK_SIDED = BCLib.makeID("patterns/block/block_sided.json"); + public final static ResourceLocation BLOCK_BOTTOM_TOP = BCLib.makeID("patterns/block/block_bottom_top.json"); + public final static ResourceLocation BLOCK_SLAB = BCLib.makeID("patterns/block/slab.json"); + public final static ResourceLocation BLOCK_STAIR = BCLib.makeID("patterns/block/stairs.json"); + public final static ResourceLocation BLOCK_STAIR_INNER = BCLib.makeID("patterns/block/stairs_inner.json"); + public final static ResourceLocation BLOCK_STAIR_OUTER = BCLib.makeID("patterns/block/stairs_outer.json"); + public final static ResourceLocation BLOCK_WALL_POST = BCLib.makeID("patterns/block/wall_post.json"); + public final static ResourceLocation BLOCK_WALL_SIDE = BCLib.makeID("patterns/block/wall_side.json"); + public final static ResourceLocation BLOCK_WALL_SIDE_TALL = BCLib.makeID("patterns/block/wall_side_tall.json"); + public final static ResourceLocation BLOCK_FENCE_POST = BCLib.makeID("patterns/block/fence_post.json"); + public final static ResourceLocation BLOCK_FENCE_SIDE = BCLib.makeID("patterns/block/fence_side.json"); + public final static ResourceLocation BLOCK_BUTTON = BCLib.makeID("patterns/block/button.json"); + public final static ResourceLocation BLOCK_BUTTON_PRESSED = BCLib.makeID("patterns/block/button_pressed.json"); + public final static ResourceLocation BLOCK_PILLAR = BCLib.makeID("patterns/block/pillar.json"); + public final static ResourceLocation BLOCK_PLATE_UP = BCLib.makeID("patterns/block/pressure_plate_up.json"); + public final static ResourceLocation BLOCK_PLATE_DOWN = BCLib.makeID("patterns/block/pressure_plate_down.json"); + public final static ResourceLocation BLOCK_DOOR_TOP = BCLib.makeID("patterns/block/door_top.json"); + public final static ResourceLocation BLOCK_DOOR_TOP_HINGE = BCLib.makeID("patterns/block/door_top_hinge.json"); + public final static ResourceLocation BLOCK_DOOR_BOTTOM = BCLib.makeID("patterns/block/door_bottom.json"); + public final static ResourceLocation BLOCK_DOOR_BOTTOM_HINGE = BCLib.makeID("patterns/block/door_bottom_hinge.json"); + public final static ResourceLocation BLOCK_CROSS = BCLib.makeID("patterns/block/cross.json"); + public final static ResourceLocation BLOCK_CROSS_SHADED = BCLib.makeID("patterns/block/cross_shaded.json"); + public final static ResourceLocation BLOCK_GATE_CLOSED = BCLib.makeID("patterns/block/fence_gate_closed.json"); + public final static ResourceLocation BLOCK_GATE_CLOSED_WALL = BCLib.makeID("patterns/block/wall_gate_closed.json"); + public final static ResourceLocation BLOCK_GATE_OPEN = BCLib.makeID("patterns/block/fence_gate_open.json"); + public final static ResourceLocation BLOCK_GATE_OPEN_WALL = BCLib.makeID("patterns/block/wall_gate_open.json"); + public final static ResourceLocation BLOCK_TRAPDOOR = BCLib.makeID("patterns/block/trapdoor.json"); + public final static ResourceLocation BLOCK_LADDER = BCLib.makeID("patterns/block/ladder.json"); + public final static ResourceLocation BLOCK_BARREL_OPEN = BCLib.makeID("patterns/block/barrel_open.json"); + public final static ResourceLocation BLOCK_BOOKSHELF = BCLib.makeID("patterns/block/bookshelf.json"); + public final static ResourceLocation BLOCK_COMPOSTER = BCLib.makeID("patterns/block/composter.json"); + public final static ResourceLocation BLOCK_COLORED = BCLib.makeID("patterns/block/block_colored.json"); + public final static ResourceLocation BLOCK_BARS_POST = BCLib.makeID("patterns/block/bars_post.json"); + public final static ResourceLocation BLOCK_BARS_SIDE = BCLib.makeID("patterns/block/bars_side.json"); + public final static ResourceLocation BLOCK_ANVIL = BCLib.makeID("patterns/block/anvil.json"); + public final static ResourceLocation BLOCK_CHAIN = BCLib.makeID("patterns/block/chain.json"); + public final static ResourceLocation BLOCK_FURNACE = BCLib.makeID("patterns/block/furnace.json"); + public final static ResourceLocation BLOCK_FURNACE_LIT = BCLib.makeID("patterns/block/furnace_glow.json"); + public final static ResourceLocation BLOCK_TOP_SIDE_BOTTOM = BCLib.makeID("patterns/block/top_side_bottom.json"); + public final static ResourceLocation BLOCK_PATH = BCLib.makeID("patterns/block/path.json"); + + //Item Models + public final static ResourceLocation ITEM_WALL = BCLib.makeID("patterns/item/pattern_wall.json"); + public final static ResourceLocation ITEM_FENCE = BCLib.makeID("patterns/item/pattern_fence.json"); + public final static ResourceLocation ITEM_BUTTON = BCLib.makeID("patterns/item/pattern_button.json"); + public final static ResourceLocation ITEM_CHEST = BCLib.makeID("patterns/item/pattern_chest.json"); + public final static ResourceLocation ITEM_BLOCK = BCLib.makeID("patterns/item/pattern_block_item.json"); + public final static ResourceLocation ITEM_GENERATED = BCLib.makeID("patterns/item/pattern_item_generated.json"); + public final static ResourceLocation ITEM_HANDHELD = BCLib.makeID("patterns/item/pattern_item_handheld.json"); + public final static ResourceLocation ITEM_SPAWN_EGG = BCLib.makeID("patterns/item/pattern_item_spawn_egg.json"); + +} diff --git a/src/main/java/ru/bclib/client/models/BlockModelProvider.java b/src/main/java/ru/bclib/client/models/BlockModelProvider.java new file mode 100644 index 00000000..f4bb00b1 --- /dev/null +++ b/src/main/java/ru/bclib/client/models/BlockModelProvider.java @@ -0,0 +1,40 @@ +package ru.bclib.client.models; + +import static net.minecraft.client.resources.model.ModelBakery.MISSING_MODEL_LOCATION; + +import java.util.Map; +import java.util.Optional; + +import org.jetbrains.annotations.Nullable; + +import net.minecraft.client.renderer.block.model.BlockModel; +import net.minecraft.client.resources.model.UnbakedModel; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.level.block.state.BlockState; +import ru.bclib.BCLib; + +public interface BlockModelProvider extends ItemModelProvider { + default @Nullable BlockModel getBlockModel(ResourceLocation resourceLocation, BlockState blockState) { + Optional pattern = PatternsHelper.createBlockSimple(resourceLocation); + return ModelsHelper.fromPattern(pattern); + } + + default UnbakedModel getModelVariant(ResourceLocation stateId, BlockState blockState, Map modelCache) { + ResourceLocation modelId = new ResourceLocation(stateId.getNamespace(), "block/" + stateId.getPath()); + registerBlockModel(stateId, modelId, blockState, modelCache); + return ModelsHelper.createBlockSimple(modelId); + } + + default void registerBlockModel(ResourceLocation stateId, ResourceLocation modelId, BlockState blockState, Map modelCache) { + if (!modelCache.containsKey(modelId)) { + BlockModel model = getBlockModel(stateId, blockState); + if (model != null) { + model.name = modelId.toString(); + modelCache.put(modelId, model); + } else { + BCLib.LOGGER.warning("Error loading model: {}", modelId); + modelCache.put(modelId, modelCache.get(MISSING_MODEL_LOCATION)); + } + } + } +} diff --git a/src/main/java/ru/bclib/client/models/ItemModelProvider.java b/src/main/java/ru/bclib/client/models/ItemModelProvider.java new file mode 100644 index 00000000..7374bd80 --- /dev/null +++ b/src/main/java/ru/bclib/client/models/ItemModelProvider.java @@ -0,0 +1,10 @@ +package ru.bclib.client.models; + +import net.minecraft.client.renderer.block.model.BlockModel; +import net.minecraft.resources.ResourceLocation; + +public interface ItemModelProvider { + default BlockModel getItemModel(ResourceLocation resourceLocation) { + return ModelsHelper.createItemModel(resourceLocation); + } +} \ No newline at end of file diff --git a/src/main/java/ru/bclib/client/models/ModelsHelper.java b/src/main/java/ru/bclib/client/models/ModelsHelper.java new file mode 100644 index 00000000..89b99050 --- /dev/null +++ b/src/main/java/ru/bclib/client/models/ModelsHelper.java @@ -0,0 +1,147 @@ +package ru.bclib.client.models; + +import java.util.List; +import java.util.Optional; +import java.util.function.Function; + +import com.google.common.collect.Lists; +import com.mojang.math.Transformation; + +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; +import net.minecraft.client.renderer.block.model.BlockModel; +import net.minecraft.client.renderer.block.model.MultiVariant; +import net.minecraft.client.renderer.block.model.Variant; +import net.minecraft.client.renderer.block.model.multipart.Condition; +import net.minecraft.client.renderer.block.model.multipart.MultiPart; +import net.minecraft.client.renderer.block.model.multipart.Selector; +import net.minecraft.client.resources.model.BlockModelRotation; +import net.minecraft.core.Direction; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.StateDefinition; + +@Environment(EnvType.CLIENT) +public class ModelsHelper { + @SuppressWarnings("OptionalUsedAsFieldOrParameterType") + public static BlockModel fromPattern(Optional pattern) { + return pattern.map(BlockModel::fromString).orElse(null); + } + + public static BlockModel createItemModel(ResourceLocation resourceLocation) { + return fromPattern(PatternsHelper.createItemGenerated(resourceLocation)); + } + + public static BlockModel createHandheldItem(ResourceLocation resourceLocation) { + return fromPattern(PatternsHelper.createItemHandheld(resourceLocation)); + } + + public static BlockModel createBlockItem(ResourceLocation resourceLocation) { + Optional pattern = PatternsHelper.createJson(BasePatterns.ITEM_BLOCK, resourceLocation); + return fromPattern(pattern); + } + + public static BlockModel createBlockEmpty(ResourceLocation resourceLocation) { + Optional pattern = PatternsHelper.createJson(BasePatterns.BLOCK_EMPTY, resourceLocation); + return fromPattern(pattern); + } + + public static MultiVariant createMultiVariant(ResourceLocation resourceLocation, Transformation transform, boolean uvLock) { + Variant variant = new Variant(resourceLocation, transform, uvLock, 1); + return new MultiVariant(Lists.newArrayList(variant)); + } + + public static MultiVariant createBlockSimple(ResourceLocation resourceLocation) { + return createMultiVariant(resourceLocation, Transformation.identity(), false); + } + + public static MultiVariant createFacingModel(ResourceLocation resourceLocation, Direction facing, boolean uvLock, boolean inverted) { + if (inverted) { + facing = facing.getOpposite(); + } + BlockModelRotation rotation = BlockModelRotation.by(0, (int) facing.toYRot()); + return createMultiVariant(resourceLocation, rotation.getRotation(), uvLock); + } + + public static MultiVariant createRotatedModel(ResourceLocation resourceLocation, Direction.Axis axis) { + BlockModelRotation rotation = BlockModelRotation.X0_Y0; + switch (axis) { + case X: rotation = BlockModelRotation.X90_Y90; break; + case Z: default: rotation = BlockModelRotation.X90_Y0; break; + } + return createMultiVariant(resourceLocation, rotation.getRotation(), false); + } + + public static MultiVariant createRandomTopModel(ResourceLocation resourceLocation) { + return new MultiVariant(Lists.newArrayList( + new Variant(resourceLocation, Transformation.identity(), false, 1), + new Variant(resourceLocation, BlockModelRotation.X0_Y90.getRotation(), false, 1), + new Variant(resourceLocation, BlockModelRotation.X0_Y180.getRotation(), false, 1), + new Variant(resourceLocation, BlockModelRotation.X0_Y270.getRotation(), false, 1) + )); + } + + public static class MultiPartBuilder { + + private final static MultiPartBuilder BUILDER = new MultiPartBuilder(); + + public static MultiPartBuilder create(StateDefinition stateDefinition) { + BUILDER.stateDefinition = stateDefinition; + BUILDER.modelParts.clear(); + return BUILDER; + } + + private final List modelParts = Lists.newArrayList(); + private StateDefinition stateDefinition; + + private MultiPartBuilder() {} + + public ModelPart part(ResourceLocation modelId) { + return new ModelPart(modelId); + } + + public MultiPart build() { + if (modelParts.size() > 0) { + List selectors = Lists.newArrayList(); + modelParts.forEach(modelPart -> { + MultiVariant variant = createMultiVariant(modelPart.modelId, modelPart.transform, modelPart.uvLock); + selectors.add(new Selector(modelPart.condition, variant)); + }); + modelParts.clear(); + return new MultiPart(stateDefinition, selectors); + } + throw new IllegalStateException("At least one model part need to be created."); + } + + public class ModelPart { + private final ResourceLocation modelId; + private Transformation transform = Transformation.identity(); + private Condition condition = Condition.TRUE; + private boolean uvLock = false; + + private ModelPart(ResourceLocation modelId) { + this.modelId = modelId; + } + + public ModelPart setCondition(Function condition) { + this.condition = stateDefinition -> condition::apply; + return this; + } + + public ModelPart setTransformation(Transformation transform) { + this.transform = transform; + return this; + } + + public ModelPart setUVLock(boolean value) { + this.uvLock = value; + return this; + } + + public void add() { + modelParts.add(this); + } + } + } +} diff --git a/src/main/java/ru/bclib/client/models/PatternsHelper.java b/src/main/java/ru/bclib/client/models/PatternsHelper.java new file mode 100644 index 00000000..8172da68 --- /dev/null +++ b/src/main/java/ru/bclib/client/models/PatternsHelper.java @@ -0,0 +1,65 @@ +package ru.bclib.client.models; + +import com.google.common.collect.Maps; +import net.minecraft.client.Minecraft; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.server.packs.resources.ResourceManager; + +import java.io.BufferedReader; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.nio.charset.StandardCharsets; +import java.util.Map; +import java.util.Optional; +import java.util.stream.Collectors; + +public class PatternsHelper { + public static Optional createItemGenerated(ResourceLocation itemId) { + return createJson(BasePatterns.ITEM_GENERATED, itemId); + } + + public static Optional createItemHandheld(ResourceLocation itemId) { + return createJson(BasePatterns.ITEM_HANDHELD, itemId); + } + + public static Optional createBlockSimple(ResourceLocation blockId) { + return createJson(BasePatterns.BLOCK_BASE, blockId); + } + + public static Optional createBlockEmpty(ResourceLocation blockId) { + return createJson(BasePatterns.BLOCK_EMPTY, blockId); + } + + public static Optional createBlockPillar(ResourceLocation blockId) { + return createJson(BasePatterns.BLOCK_PILLAR, blockId); + } + + public static Optional createBlockBottomTop(ResourceLocation blockId) { + return createJson(BasePatterns.BLOCK_BOTTOM_TOP, blockId); + } + + public static Optional createBlockColored(ResourceLocation blockId) { + return createJson(BasePatterns.BLOCK_COLORED, blockId); + } + + public static Optional createJson(ResourceLocation patternId, ResourceLocation blockId) { + Map textures = Maps.newHashMap(); + textures.put("%modid%", blockId.getNamespace()); + textures.put("%texture%", blockId.getPath()); + return createJson(patternId, textures); + } + + public static Optional createJson(ResourceLocation patternId, Map textures) { + ResourceManager resourceManager = Minecraft.getInstance().getResourceManager(); + try (InputStream input = resourceManager.getResource(patternId).getInputStream()) { + String json = new BufferedReader(new InputStreamReader(input, StandardCharsets.UTF_8)) + .lines().collect(Collectors.joining()); + for (Map.Entry texture : textures.entrySet()) { + json = json.replace(texture.getKey(), texture.getValue()); + } + return Optional.of(json); + } catch (Exception ex) { + return Optional.empty(); + } + } +} diff --git a/src/main/java/ru/bclib/mixin/client/ModelBakeryMixin.java b/src/main/java/ru/bclib/mixin/client/ModelBakeryMixin.java new file mode 100644 index 00000000..c821e6fb --- /dev/null +++ b/src/main/java/ru/bclib/mixin/client/ModelBakeryMixin.java @@ -0,0 +1,107 @@ +package ru.bclib.mixin.client; + +import java.util.List; +import java.util.Map; +import java.util.Optional; + +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.ModifyVariable; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import net.minecraft.client.renderer.block.BlockModelShaper; +import net.minecraft.client.renderer.block.model.BlockModel; +import net.minecraft.client.renderer.block.model.multipart.MultiPart; +import net.minecraft.client.resources.model.ModelBakery; +import net.minecraft.client.resources.model.ModelResourceLocation; +import net.minecraft.client.resources.model.UnbakedModel; +import net.minecraft.core.Registry; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.server.packs.resources.ResourceManager; +import net.minecraft.world.item.BlockItem; +import net.minecraft.world.item.Item; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.state.BlockState; +import ru.bclib.BCLib; +import ru.bclib.client.models.BlockModelProvider; +import ru.bclib.client.models.ItemModelProvider; + +@Mixin(ModelBakery.class) +public abstract class ModelBakeryMixin { + @Final + @Shadow + private ResourceManager resourceManager; + @Final + @Shadow + private Map unbakedCache; + + @Shadow + protected abstract void cacheAndQueueDependencies(ResourceLocation resourceLocation, UnbakedModel unbakedModel); + + @Inject(method = "loadModel", at = @At("HEAD"), cancellable = true) + private void bclib_loadModels(ResourceLocation resourceLocation, CallbackInfo info) { + if (resourceLocation instanceof ModelResourceLocation) { + String modId = resourceLocation.getNamespace(); + String path = resourceLocation.getPath(); + ResourceLocation clearLoc = new ResourceLocation(modId, path); + ModelResourceLocation modelId = (ModelResourceLocation) resourceLocation; + if ("inventory".equals(modelId.getVariant())) { + ResourceLocation itemLoc = new ResourceLocation(modId, "item/" + path); + ResourceLocation itemModelLoc = new ResourceLocation(modId, "models/" + itemLoc.getPath() + ".json"); + if (!resourceManager.hasResource(itemModelLoc)) { + Item item = Registry.ITEM.get(clearLoc); + ItemModelProvider modelProvider = null; + if (item instanceof ItemModelProvider) { + modelProvider = (ItemModelProvider) item; + } else if (item instanceof BlockItem) { + Block block = Registry.BLOCK.get(clearLoc); + if (block instanceof ItemModelProvider) { + modelProvider = (ItemModelProvider) block; + } + } + if (modelProvider != null) { + BlockModel model = modelProvider.getItemModel(clearLoc); + if (model != null) { + model.name = itemLoc.toString(); + cacheAndQueueDependencies(modelId, model); + unbakedCache.put(itemLoc, model); + } else { + BCLib.LOGGER.warning("Error loading model: {}", itemLoc); + } + info.cancel(); + } + } + } else { + ResourceLocation stateLoc = new ResourceLocation(modId, "blockstates/" + path + ".json"); + if (!resourceManager.hasResource(stateLoc)) { + Block block = Registry.BLOCK.get(clearLoc); + if (block instanceof BlockModelProvider) { + List possibleStates = block.getStateDefinition().getPossibleStates(); + Optional possibleState = possibleStates.stream() + .filter(state -> modelId.equals(BlockModelShaper.stateToModelLocation(clearLoc, state))) + .findFirst(); + if (possibleState.isPresent()) { + UnbakedModel modelVariant = ((BlockModelProvider) block).getModelVariant(modelId, possibleState.get(), unbakedCache); + if (modelVariant != null) { + if (modelVariant instanceof MultiPart) { + possibleStates.forEach(state -> { + ResourceLocation stateId = BlockModelShaper.stateToModelLocation(clearLoc, state); + cacheAndQueueDependencies(stateId, modelVariant); + }); + } else { + cacheAndQueueDependencies(modelId, modelVariant); + } + } else { + BCLib.LOGGER.warning("Error loading variant: {}", modelId); + } + info.cancel(); + } + } + } + } + } + } +} diff --git a/src/main/resources/assets/bclib/models/block/ladder.json b/src/main/resources/assets/bclib/models/block/ladder.json new file mode 100644 index 00000000..65ea537b --- /dev/null +++ b/src/main/resources/assets/bclib/models/block/ladder.json @@ -0,0 +1,441 @@ +{ + "__comment": "Designed by Paulevs with Cubik Studio - https://cubik.studio", + "elements": [ + { + "__comment": "Box1", + "faces": { + "down": { + "cullface": "down", + "rotation": 180, + "texture": "#texture", + "uv": [ + 2, + 15, + 4, + 16 + ] + }, + "east": { + "texture": "#texture", + "uv": [ + 2, + 0, + 3, + 16 + ] + }, + "north": { + "texture": "#texture", + "uv": [ + 2, + 0, + 4, + 16 + ] + }, + "south": { + "cullface": "north", + "texture": "#texture", + "uv": [ + 2, + 0, + 4, + 16 + ] + }, + "up": { + "cullface": "up", + "rotation": 180, + "texture": "#texture", + "uv": [ + 2, + 0, + 4, + 1 + ] + }, + "west": { + "texture": "#texture", + "uv": [ + 3, + 0, + 4, + 16 + ] + } + }, + "from": [ + 12, + 0, + 15 + ], + "to": [ + 14, + 16, + 16 + ] + }, + { + "__comment": "Box1", + "faces": { + "down": { + "cullface": "down", + "rotation": 180, + "texture": "#texture", + "uv": [ + 12, + 15, + 14, + 16 + ] + }, + "east": { + "texture": "#texture", + "uv": [ + 2, + 0, + 3, + 16 + ] + }, + "north": { + "texture": "#texture", + "uv": [ + 12, + 0, + 14, + 16 + ] + }, + "south": { + "cullface": "north", + "texture": "#texture", + "uv": [ + 12, + 0, + 14, + 16 + ] + }, + "up": { + "cullface": "up", + "rotation": 180, + "texture": "#texture", + "uv": [ + 12, + 0, + 14, + 1 + ] + }, + "west": { + "texture": "#texture", + "uv": [ + 3, + 0, + 4, + 16 + ] + } + }, + "from": [ + 2, + 0, + 15 + ], + "to": [ + 4, + 16, + 16 + ] + }, + { + "__comment": "Box3", + "faces": { + "down": { + "rotation": 180, + "texture": "#texture", + "uv": [ + 1, + 14, + 15, + 15 + ] + }, + "east": { + "texture": "#texture", + "uv": [ + 1, + 13, + 2, + 15 + ] + }, + "north": { + "texture": "#texture", + "uv": [ + 1, + 13, + 15, + 15 + ] + }, + "south": { + "texture": "#texture", + "uv": [ + 1, + 13, + 15, + 15 + ] + }, + "up": { + "rotation": 180, + "texture": "#texture", + "uv": [ + 1, + 13, + 15, + 14 + ] + }, + "west": { + "texture": "#texture", + "uv": [ + 14, + 13, + 15, + 15 + ] + } + }, + "from": [ + 1, + 1, + 14.5 + ], + "to": [ + 15, + 3, + 15.5 + ] + }, + { + "__comment": "Box3", + "faces": { + "down": { + "rotation": 180, + "texture": "#texture", + "uv": [ + 1, + 10, + 15, + 11 + ] + }, + "east": { + "texture": "#texture", + "uv": [ + 1, + 9, + 2, + 11 + ] + }, + "north": { + "texture": "#texture", + "uv": [ + 1, + 9, + 15, + 11 + ] + }, + "south": { + "texture": "#texture", + "uv": [ + 1, + 9, + 15, + 11 + ] + }, + "up": { + "rotation": 180, + "texture": "#texture", + "uv": [ + 1, + 9, + 15, + 10 + ] + }, + "west": { + "texture": "#texture", + "uv": [ + 14, + 9, + 15, + 11 + ] + } + }, + "from": [ + 1, + 5, + 14.5 + ], + "to": [ + 15, + 7, + 15.5 + ] + }, + { + "__comment": "Box3", + "faces": { + "down": { + "rotation": 180, + "texture": "#texture", + "uv": [ + 1, + 6, + 15, + 7 + ] + }, + "east": { + "texture": "#texture", + "uv": [ + 1, + 5, + 2, + 7 + ] + }, + "north": { + "texture": "#texture", + "uv": [ + 1, + 5, + 15, + 7 + ] + }, + "south": { + "texture": "#texture", + "uv": [ + 1, + 5, + 15, + 7 + ] + }, + "up": { + "rotation": 180, + "texture": "#texture", + "uv": [ + 1, + 5, + 15, + 6 + ] + }, + "west": { + "texture": "#texture", + "uv": [ + 14, + 5, + 15, + 7 + ] + } + }, + "from": [ + 1, + 9, + 14.5 + ], + "to": [ + 15, + 11, + 15.5 + ] + }, + { + "__comment": "Box3", + "faces": { + "down": { + "rotation": 180, + "texture": "#texture", + "uv": [ + 1, + 2, + 15, + 3 + ] + }, + "east": { + "texture": "#texture", + "uv": [ + 1, + 1, + 2, + 3 + ] + }, + "north": { + "texture": "#texture", + "uv": [ + 1, + 1, + 15, + 3 + ] + }, + "south": { + "texture": "#texture", + "uv": [ + 1, + 1, + 15, + 3 + ] + }, + "up": { + "rotation": 180, + "texture": "#texture", + "uv": [ + 1, + 1, + 15, + 2 + ] + }, + "west": { + "texture": "#texture", + "uv": [ + 14, + 1, + 15, + 3 + ] + } + }, + "from": [ + 1, + 13, + 14.5 + ], + "to": [ + 15, + 15, + 15.5 + ] + } + ], + "parent": "block/ladder", + "textures": { + "particle": "#texture" + } +} diff --git a/src/main/resources/assets/bclib/models/block/path.json b/src/main/resources/assets/bclib/models/block/path.json new file mode 100644 index 00000000..04fed330 --- /dev/null +++ b/src/main/resources/assets/bclib/models/block/path.json @@ -0,0 +1,18 @@ +{ "parent": "block/block", + "textures": { + "particle": "#bottom" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 15, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#bottom", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 0, 1, 16, 16 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 0, 1, 16, 16 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 0, 1, 16, 16 ], "texture": "#side", "cullface": "west" }, + "east": { "uv": [ 0, 1, 16, 16 ], "texture": "#side", "cullface": "east" } + } + } + ] +} diff --git a/src/main/resources/assets/bclib/models/block/sided_door_bottom.json b/src/main/resources/assets/bclib/models/block/sided_door_bottom.json new file mode 100644 index 00000000..6fddf595 --- /dev/null +++ b/src/main/resources/assets/bclib/models/block/sided_door_bottom.json @@ -0,0 +1,18 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "#facade" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 3, 16, 16 ], + "faces": { + "down": { "uv": [ 13, 0, 16, 16 ], "texture": "#side", "cullface": "down" }, + "north": { "uv": [ 3, 0, 0, 16 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 0, 0, 3, 16 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#facade", "cullface": "west" }, + "east": { "uv": [ 16, 0, 0, 16 ], "texture": "#facade" } + } + } + ] +} diff --git a/src/main/resources/assets/bclib/models/block/sided_door_bottom_rh.json b/src/main/resources/assets/bclib/models/block/sided_door_bottom_rh.json new file mode 100644 index 00000000..e6294d19 --- /dev/null +++ b/src/main/resources/assets/bclib/models/block/sided_door_bottom_rh.json @@ -0,0 +1,18 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "#facade" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 3, 16, 16 ], + "faces": { + "down": { "uv": [ 13, 0, 16, 16 ], "texture": "#side", "cullface": "down" }, + "north": { "uv": [ 3, 0, 0, 16 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 0, 0, 3, 16 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 16, 0, 0, 16 ], "texture": "#facade", "cullface": "west" }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#facade" } + } + } + ] +} diff --git a/src/main/resources/assets/bclib/models/block/sided_door_top.json b/src/main/resources/assets/bclib/models/block/sided_door_top.json new file mode 100644 index 00000000..4a646108 --- /dev/null +++ b/src/main/resources/assets/bclib/models/block/sided_door_top.json @@ -0,0 +1,18 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "#facade" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 3, 16, 16 ], + "faces": { + "up": { "uv": [ 13, 0, 16, 16 ], "texture": "#side", "cullface": "up" }, + "north": { "uv": [ 3, 0, 0, 16 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 0, 0, 3, 16 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#facade", "cullface": "west" }, + "east": { "uv": [ 16, 0, 0, 16 ], "texture": "#facade" } + } + } + ] +} diff --git a/src/main/resources/assets/bclib/models/block/sided_door_top_rh.json b/src/main/resources/assets/bclib/models/block/sided_door_top_rh.json new file mode 100644 index 00000000..c706fe16 --- /dev/null +++ b/src/main/resources/assets/bclib/models/block/sided_door_top_rh.json @@ -0,0 +1,18 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "#facade" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 3, 16, 16 ], + "faces": { + "up": { "uv": [ 13, 0, 16, 16 ], "texture": "#side", "cullface": "up" }, + "north": { "uv": [ 3, 0, 0, 16 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 0, 0, 3, 16 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 16, 0, 0, 16 ], "texture": "#facade", "cullface": "west" }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#facade" } + } + } + ] +} diff --git a/src/main/resources/assets/bclib/models/block/sided_trapdoor.json b/src/main/resources/assets/bclib/models/block/sided_trapdoor.json new file mode 100644 index 00000000..9f776427 --- /dev/null +++ b/src/main/resources/assets/bclib/models/block/sided_trapdoor.json @@ -0,0 +1,18 @@ +{ "parent": "block/thin_block", + "textures": { + "particle": "#texture" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 3, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" }, + "north": { "uv": [ 16, 0, 13, 16 ], "texture": "#side", "cullface": "north", "rotation": 90 }, + "south": { "uv": [ 16, 0, 13, 16 ], "texture": "#side", "cullface": "south", "rotation": 90 }, + "west": { "uv": [ 16, 0, 13, 16 ], "texture": "#side", "cullface": "west", "rotation": 90 }, + "east": { "uv": [ 16, 0, 13, 16 ], "texture": "#side", "cullface": "east", "rotation": 90 } + } + } + ] +} diff --git a/src/main/resources/assets/bclib/models/block/tint_cube.json b/src/main/resources/assets/bclib/models/block/tint_cube.json new file mode 100644 index 00000000..f65b5c05 --- /dev/null +++ b/src/main/resources/assets/bclib/models/block/tint_cube.json @@ -0,0 +1,21 @@ +{ + "parent": "block/block", + "textures": { + "particle": "#texture" + }, + "elements": [ + { + "__comment": "Box1", + "from": [ 0, 0, 0 ], + "to": [ 16, 16, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "cullface": "down", "tintindex": 0 }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "cullface": "up", "tintindex": 0 }, + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "cullface": "north", "tintindex": 0 }, + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "cullface": "south", "tintindex": 0 }, + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "cullface": "west", "tintindex": 0 }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "cullface": "east", "tintindex": 0 } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/bclib/patterns/block/anvil.json b/src/main/resources/assets/bclib/patterns/block/anvil.json new file mode 100644 index 00000000..7710c9a1 --- /dev/null +++ b/src/main/resources/assets/bclib/patterns/block/anvil.json @@ -0,0 +1,68 @@ +{ + "parent": "block/block", + "textures": { + "particle": "%modid%:block/%anvil%_front", + "front": "%modid%:block/%anvil%_front", + "back": "%modid%:block/%anvil%_back", + "top": "%modid%:block/%top%", + "panel": "%modid%:block/%anvil%_panel", + "bottom": "%modid%:block/%anvil%_bottom" + }, + "elements": [ + { + "__comment": "Bottom", + "from": [ 2, 0, 2 ], + "to": [ 14, 4, 14 ], + "faces": { + "down": { "uv": [ 2, 2, 14, 14 ], "texture": "#bottom", "cullface": "down" }, + "up": { "uv": [ 2, 2, 14, 14 ], "texture": "#panel" }, + "north": { "uv": [ 2, 12, 14, 16 ], "texture": "#back" }, + "south": { "uv": [ 2, 12, 14, 16 ], "texture": "#back" }, + "west": { "uv": [ 2, 12, 14, 16 ], "texture": "#front" }, + "east": { "uv": [ 2, 12, 14, 16 ], "texture": "#front" } + } + }, + { + "__comment": "Plate", + "from": [ 4, 4, 3 ], + "to": [ 12, 5, 13 ], + "faces": { + "up": { "uv": [ 4, 3, 12, 13 ], "texture": "#panel" }, + "north": { "uv": [ 4, 11, 12, 12 ], "texture": "#back" }, + "south": { "uv": [ 4, 11, 12, 12 ], "texture": "#back" }, + "west": { "uv": [ 3, 11, 13, 12 ], "texture": "#front" }, + "east": { "uv": [ 3, 11, 13, 12 ], "texture": "#front" } + } + }, + { + "__comment": "Support", + "from": [ 6, 5, 4 ], + "to": [ 10, 10, 12 ], + "faces": { + "north": { "uv": [ 6, 6, 10, 11 ], "texture": "#back" }, + "south": { "uv": [ 6, 6, 10, 11 ], "texture": "#back" }, + "west": { "uv": [ 4, 6, 12, 11 ], "texture": "#front" }, + "east": { "uv": [ 4, 6, 12, 11 ], "texture": "#front" } + } + }, + { + "__comment": "Top", + "from": [ 3, 10, 0 ], + "to": [ 13, 16, 16 ], + "faces": { + "down": { "uv": [ 3, 0, 13, 16 ], "texture": "#top" }, + "up": { "uv": [ 3, 0, 13, 16 ], "texture": "#top" }, + "north": { "uv": [ 3, 0, 13, 6 ], "texture": "#back" }, + "south": { "uv": [ 3, 0, 13, 6 ], "texture": "#back" }, + "west": { "uv": [ 0, 0, 16, 6 ], "texture": "#front" }, + "east": { "uv": [ 0, 0, 16, 6 ], "texture": "#front" } + } + } + ], + "display": { + "fixed": { + "rotation": [ 0, 90, 0 ], + "scale": [ 0.5, 0.5, 0.5 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/bclib/patterns/block/barrel_open.json b/src/main/resources/assets/bclib/patterns/block/barrel_open.json new file mode 100644 index 00000000..b81ad7da --- /dev/null +++ b/src/main/resources/assets/bclib/patterns/block/barrel_open.json @@ -0,0 +1,8 @@ +{ + "parent": "block/cube_bottom_top", + "textures": { + "bottom": "%modid%:block/%texture%_bottom", + "side": "%modid%:block/%texture%_side", + "top": "%modid%:block/%texture%_top_open" + } +} diff --git a/src/main/resources/assets/bclib/patterns/block/bars_post.json b/src/main/resources/assets/bclib/patterns/block/bars_post.json new file mode 100644 index 00000000..0dee124c --- /dev/null +++ b/src/main/resources/assets/bclib/patterns/block/bars_post.json @@ -0,0 +1,22 @@ +{ + "__comment": "Designed by Paulevs with Cubik Studio - https://cubik.studio", + "textures": { + "top": "%modid%:block/%texture%_top", + "particle": "#top" + }, + "elements": [ + { + "__comment": "Box1", + "from": [ 7, 0, 7 ], + "to": [ 9, 16, 9 ], + "faces": { + "down": { "uv": [ 7, 7, 9, 9 ], "texture": "#top", "cullface": "down" }, + "up": { "uv": [ 7, 7, 9, 9 ], "texture": "#top", "cullface": "up" }, + "north": { "uv": [ 7, 0, 9, 16 ], "texture": "#top" }, + "south": { "uv": [ 7, 0, 9, 16 ], "texture": "#top" }, + "west": { "uv": [ 7, 0, 9, 16 ], "texture": "#top" }, + "east": { "uv": [ 7, 0, 9, 16 ], "texture": "#top" } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/bclib/patterns/block/bars_side.json b/src/main/resources/assets/bclib/patterns/block/bars_side.json new file mode 100644 index 00000000..44794f8e --- /dev/null +++ b/src/main/resources/assets/bclib/patterns/block/bars_side.json @@ -0,0 +1,23 @@ +{ + "__comment": "Designed by Paulevs with Cubik Studio - https://cubik.studio", + "textures": { + "side": "%modid%:block/%texture%", + "top": "%modid%:block/%texture%_top", + "particle": "#side" + }, + "elements": [ + { + "__comment": "Box1", + "from": [ 7, 0, 0 ], + "to": [ 9, 16, 9 ], + "faces": { + "down": { "uv": [ 7, 7, 9, 16 ], "texture": "#top", "cullface": "down" }, + "up": { "uv": [ 7, 0, 9, 9 ], "texture": "#top", "cullface": "up" }, + "north": { "uv": [ 7, 0, 9, 16 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 7, 0, 9, 16 ], "texture": "#side" }, + "west": { "uv": [ 0, 0, 9, 16 ], "texture": "#side" }, + "east": { "uv": [ 7, 0, 16, 16 ], "texture": "#side" } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/bclib/patterns/block/block.json b/src/main/resources/assets/bclib/patterns/block/block.json new file mode 100644 index 00000000..431bc5cf --- /dev/null +++ b/src/main/resources/assets/bclib/patterns/block/block.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "%modid%:block/%texture%" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/bclib/patterns/block/block_bottom_top.json b/src/main/resources/assets/bclib/patterns/block/block_bottom_top.json new file mode 100644 index 00000000..713f190b --- /dev/null +++ b/src/main/resources/assets/bclib/patterns/block/block_bottom_top.json @@ -0,0 +1,8 @@ +{ + "parent": "block/cube_bottom_top", + "textures": { + "bottom": "%modid%:block/%texture%_bottom", + "side": "%modid%:block/%texture%_side", + "top": "%modid%:block/%texture%_top" + } +} diff --git a/src/main/resources/assets/bclib/patterns/block/block_colored.json b/src/main/resources/assets/bclib/patterns/block/block_colored.json new file mode 100644 index 00000000..7020afb1 --- /dev/null +++ b/src/main/resources/assets/bclib/patterns/block/block_colored.json @@ -0,0 +1,6 @@ +{ + "parent": "bclib:block/tint_cube", + "textures": { + "texture": "%modid%:block/%texture%" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/bclib/patterns/block/block_sided.json b/src/main/resources/assets/bclib/patterns/block/block_sided.json new file mode 100644 index 00000000..4dd385ac --- /dev/null +++ b/src/main/resources/assets/bclib/patterns/block/block_sided.json @@ -0,0 +1,12 @@ +{ + "parent": "block/cube", + "textures": { + "particle": "%modid%:block/%particle%", + "down": "%modid%:block/%down%", + "up": "%modid%:block/%up%", + "north": "%modid%:block/%north%", + "south": "%modid%:block/%south%", + "west": "%modid%:block/%west%", + "east": "%modid%:block/%east%" + } +} diff --git a/src/main/resources/assets/bclib/patterns/block/bookshelf.json b/src/main/resources/assets/bclib/patterns/block/bookshelf.json new file mode 100644 index 00000000..d8821c3d --- /dev/null +++ b/src/main/resources/assets/bclib/patterns/block/bookshelf.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cube_column", + "textures": { + "end": "%modid%:block/%texture%_planks", + "side": "%modid%:block/%texture%_bookshelf" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/bclib/patterns/block/button.json b/src/main/resources/assets/bclib/patterns/block/button.json new file mode 100644 index 00000000..e09625cd --- /dev/null +++ b/src/main/resources/assets/bclib/patterns/block/button.json @@ -0,0 +1,6 @@ +{ + "parent": "block/button", + "textures": { + "texture": "%modid%:block/%texture%" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/bclib/patterns/block/button_pressed.json b/src/main/resources/assets/bclib/patterns/block/button_pressed.json new file mode 100644 index 00000000..dfe04d40 --- /dev/null +++ b/src/main/resources/assets/bclib/patterns/block/button_pressed.json @@ -0,0 +1,6 @@ +{ + "parent": "block/button_pressed", + "textures": { + "texture": "%modid%:block/%texture%" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/bclib/patterns/block/chain.json b/src/main/resources/assets/bclib/patterns/block/chain.json new file mode 100644 index 00000000..c108d99c --- /dev/null +++ b/src/main/resources/assets/bclib/patterns/block/chain.json @@ -0,0 +1,7 @@ +{ + "parent": "block/chain", + "textures": { + "particle": "%modid%:block/%texture%", + "all": "%modid%:block/%texture%" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/bclib/patterns/block/composter.json b/src/main/resources/assets/bclib/patterns/block/composter.json new file mode 100644 index 00000000..cddf7792 --- /dev/null +++ b/src/main/resources/assets/bclib/patterns/block/composter.json @@ -0,0 +1,60 @@ +{ + "parent": "block/block", + "textures": { + "particle": "%modid%:block/%texture%_side", + "top": "%modid%:block/%texture%_top", + "bottom": "%modid%:block/%texture%_bottom", + "side": "%modid%:block/%texture%_side", + "inside": "%modid%:block/%texture%_bottom" + }, + "elements": [ + { + "from": [ 0, 0, 0 ], + "to": [ 16, 2, 16 ], + "faces": { + "up": { "texture": "#inside", "cullface": "up" }, + "down": { "texture": "#bottom", "cullface": "down" } + } + }, + { + "from": [ 0, 0, 0 ], + "to": [ 2, 16, 16 ], + "faces": { + "up": { "texture": "#top", "cullface": "up" }, + "north": { "texture": "#side", "cullface": "north" }, + "south": { "texture": "#side", "cullface": "south" }, + "west": { "texture": "#side", "cullface": "west" }, + "east": { "texture": "#side", "cullface": "up" } + } + }, + { + "from": [ 14, 0, 0 ], + "to": [ 16, 16, 16 ], + "faces": { + "up": { "texture": "#top", "cullface": "up" }, + "north": { "texture": "#side", "cullface": "north" }, + "south": { "texture": "#side", "cullface": "south" }, + "west": { "texture": "#side", "cullface": "up" }, + "east": { "texture": "#side", "cullface": "east" } + } + }, + { + "from": [ 2, 0, 0 ], + "to": [ 14, 16, 2 ], + "faces": { + "up": { "texture": "#top", "cullface": "up" }, + "north": { "texture": "#side", "cullface": "north" }, + "south": { "texture": "#side", "cullface": "up" } + } + }, + { + "from": [ 2, 0, 14 ], + "to": [ 14, 16, 16 ], + "faces": { + "up": { "texture": "#top", "cullface": "up" }, + "north": { "texture": "#side", "cullface": "up" }, + "south": { "texture": "#side", "cullface": "south" } + } + } + ] +} diff --git a/src/main/resources/assets/bclib/patterns/block/cross.json b/src/main/resources/assets/bclib/patterns/block/cross.json new file mode 100644 index 00000000..deb3d1a1 --- /dev/null +++ b/src/main/resources/assets/bclib/patterns/block/cross.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "%modid%:block/%texture%" + } +} diff --git a/src/main/resources/assets/bclib/patterns/block/cross_shaded.json b/src/main/resources/assets/bclib/patterns/block/cross_shaded.json new file mode 100644 index 00000000..1db00d86 --- /dev/null +++ b/src/main/resources/assets/bclib/patterns/block/cross_shaded.json @@ -0,0 +1,25 @@ +{ + "ambientocclusion": false, + "textures": { + "cross": "%modid%:block/%texture%", + "particle": "#cross" + }, + "elements": [ + { "from": [ 0.8, 0, 8 ], + "to": [ 15.2, 16, 8 ], + "rotation": { "origin": [ 8, 8, 8 ], "axis": "y", "angle": 45, "rescale": true }, + "faces": { + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#cross" }, + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#cross" } + } + }, + { "from": [ 8, 0, 0.8 ], + "to": [ 8, 16, 15.2 ], + "rotation": { "origin": [ 8, 8, 8 ], "axis": "y", "angle": 45, "rescale": true }, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#cross" }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#cross" } + } + } + ] +} diff --git a/src/main/resources/assets/bclib/patterns/block/door_bottom.json b/src/main/resources/assets/bclib/patterns/block/door_bottom.json new file mode 100644 index 00000000..0af8ff69 --- /dev/null +++ b/src/main/resources/assets/bclib/patterns/block/door_bottom.json @@ -0,0 +1,7 @@ +{ + "parent": "bclib:block/sided_door_bottom", + "textures": { + "facade": "%modid%:block/%texture%_bottom", + "side": "%modid%:block/%texture%_side" + } +} diff --git a/src/main/resources/assets/bclib/patterns/block/door_bottom_hinge.json b/src/main/resources/assets/bclib/patterns/block/door_bottom_hinge.json new file mode 100644 index 00000000..7921c6b1 --- /dev/null +++ b/src/main/resources/assets/bclib/patterns/block/door_bottom_hinge.json @@ -0,0 +1,7 @@ +{ + "parent": "bclib:block/sided_door_bottom_rh", + "textures": { + "facade": "%modid%:block/%texture%_bottom", + "side": "%modid%:block/%texture%_side" + } +} diff --git a/src/main/resources/assets/bclib/patterns/block/door_top.json b/src/main/resources/assets/bclib/patterns/block/door_top.json new file mode 100644 index 00000000..1ca0cc7a --- /dev/null +++ b/src/main/resources/assets/bclib/patterns/block/door_top.json @@ -0,0 +1,7 @@ +{ + "parent": "bclib:block/sided_door_top", + "textures": { + "facade": "%modid%:block/%texture%_top", + "side": "%modid%:block/%texture%_side" + } +} diff --git a/src/main/resources/assets/bclib/patterns/block/door_top_hinge.json b/src/main/resources/assets/bclib/patterns/block/door_top_hinge.json new file mode 100644 index 00000000..1dcbb7f7 --- /dev/null +++ b/src/main/resources/assets/bclib/patterns/block/door_top_hinge.json @@ -0,0 +1,7 @@ +{ + "parent": "bclib:block/sided_door_top_rh", + "textures": { + "facade": "%modid%:block/%texture%_top", + "side": "%modid%:block/%texture%_side" + } +} diff --git a/src/main/resources/assets/bclib/patterns/block/empty.json b/src/main/resources/assets/bclib/patterns/block/empty.json new file mode 100644 index 00000000..618890a2 --- /dev/null +++ b/src/main/resources/assets/bclib/patterns/block/empty.json @@ -0,0 +1,5 @@ +{ + "textures": { + "particle": "%modid%:block/%texture%" + } +} diff --git a/src/main/resources/assets/bclib/patterns/block/fence_gate_closed.json b/src/main/resources/assets/bclib/patterns/block/fence_gate_closed.json new file mode 100644 index 00000000..f3a97640 --- /dev/null +++ b/src/main/resources/assets/bclib/patterns/block/fence_gate_closed.json @@ -0,0 +1,6 @@ +{ + "parent": "block/template_fence_gate", + "textures": { + "texture": "%modid%:block/%texture%" + } +} diff --git a/src/main/resources/assets/bclib/patterns/block/fence_gate_open.json b/src/main/resources/assets/bclib/patterns/block/fence_gate_open.json new file mode 100644 index 00000000..52396ef6 --- /dev/null +++ b/src/main/resources/assets/bclib/patterns/block/fence_gate_open.json @@ -0,0 +1,6 @@ +{ + "parent": "block/template_fence_gate_open", + "textures": { + "texture": "%modid%:block/%texture%" + } +} diff --git a/src/main/resources/assets/bclib/patterns/block/fence_post.json b/src/main/resources/assets/bclib/patterns/block/fence_post.json new file mode 100644 index 00000000..90719373 --- /dev/null +++ b/src/main/resources/assets/bclib/patterns/block/fence_post.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_post", + "textures": { + "texture": "%modid%:block/%texture%" + } +} diff --git a/src/main/resources/assets/bclib/patterns/block/fence_side.json b/src/main/resources/assets/bclib/patterns/block/fence_side.json new file mode 100644 index 00000000..2569375e --- /dev/null +++ b/src/main/resources/assets/bclib/patterns/block/fence_side.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_side", + "textures": { + "texture": "%modid%:block/%texture%" + } +} diff --git a/src/main/resources/assets/bclib/patterns/block/furnace.json b/src/main/resources/assets/bclib/patterns/block/furnace.json new file mode 100644 index 00000000..ee2fc463 --- /dev/null +++ b/src/main/resources/assets/bclib/patterns/block/furnace.json @@ -0,0 +1,9 @@ +{ + "parent": "block/orientable_with_bottom", + "textures": { + "top": "%modid%:block/%top%", + "front": "%modid%:block/%front%", + "side": "%modid%:block/%side%", + "bottom": "%modid%:block/%top%" + } +} diff --git a/src/main/resources/assets/bclib/patterns/block/furnace_glow.json b/src/main/resources/assets/bclib/patterns/block/furnace_glow.json new file mode 100644 index 00000000..caa5ffdc --- /dev/null +++ b/src/main/resources/assets/bclib/patterns/block/furnace_glow.json @@ -0,0 +1,38 @@ +{ + "parent": "block/block", + "textures": { + "top": "%modid%:block/%top%", + "front": "%modid%:block/%front%", + "side": "%modid%:block/%side%", + "glow": "%modid%:block/%glow%" + }, + "display": { + "firstperson_righthand": { + "rotation": [ 0, 135, 0 ], + "translation": [ 0, 0, 0 ], + "scale": [ 0.40, 0.40, 0.40 ] + } + }, + "elements": [ + { + "from": [ 0, 0, 0 ], + "to": [ 16, 16, 16 ], + "faces": { + "down": { "texture": "#top", "cullface": "down" }, + "up": { "texture": "#top", "cullface": "up" }, + "north": { "texture": "#front", "cullface": "north" }, + "south": { "texture": "#side", "cullface": "south" }, + "west": { "texture": "#side", "cullface": "west" }, + "east": { "texture": "#side", "cullface": "east" } + } + }, + { + "from": [ 0, 0, 0 ], + "to": [ 16, 16, 16 ], + "shade": false, + "faces": { + "north": { "texture": "#glow", "cullface": "north" } + } + } + ] +} diff --git a/src/main/resources/assets/bclib/patterns/block/ladder.json b/src/main/resources/assets/bclib/patterns/block/ladder.json new file mode 100644 index 00000000..791c7a59 --- /dev/null +++ b/src/main/resources/assets/bclib/patterns/block/ladder.json @@ -0,0 +1,6 @@ +{ + "parent": "bclib:block/ladder", + "textures": { + "texture": "%modid%:block/%texture%" + } +} diff --git a/src/main/resources/assets/bclib/patterns/block/path.json b/src/main/resources/assets/bclib/patterns/block/path.json new file mode 100644 index 00000000..780986a2 --- /dev/null +++ b/src/main/resources/assets/bclib/patterns/block/path.json @@ -0,0 +1,7 @@ +{ "parent": "bclib:block/path", + "textures": { + "top": "%modid%:block/%top%", + "side": "%modid%:block/%side%", + "bottom": "%modid%:block/%bottom%" + } +} diff --git a/src/main/resources/assets/bclib/patterns/block/pillar.json b/src/main/resources/assets/bclib/patterns/block/pillar.json new file mode 100644 index 00000000..3585815c --- /dev/null +++ b/src/main/resources/assets/bclib/patterns/block/pillar.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cube_column", + "textures": { + "end": "%modid%:block/%texture%_top", + "side": "%modid%:block/%texture%_side" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/bclib/patterns/block/pressure_plate_down.json b/src/main/resources/assets/bclib/patterns/block/pressure_plate_down.json new file mode 100644 index 00000000..60147e84 --- /dev/null +++ b/src/main/resources/assets/bclib/patterns/block/pressure_plate_down.json @@ -0,0 +1,6 @@ +{ + "parent": "block/pressure_plate_down", + "textures": { + "texture": "%modid%:block/%texture%" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/bclib/patterns/block/pressure_plate_up.json b/src/main/resources/assets/bclib/patterns/block/pressure_plate_up.json new file mode 100644 index 00000000..66c028a3 --- /dev/null +++ b/src/main/resources/assets/bclib/patterns/block/pressure_plate_up.json @@ -0,0 +1,6 @@ +{ + "parent": "block/pressure_plate_up", + "textures": { + "texture": "%modid%:block/%texture%" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/bclib/patterns/block/slab.json b/src/main/resources/assets/bclib/patterns/block/slab.json new file mode 100644 index 00000000..7012e909 --- /dev/null +++ b/src/main/resources/assets/bclib/patterns/block/slab.json @@ -0,0 +1,8 @@ +{ + "parent": "block/slab", + "textures": { + "bottom": "%modid%:block/%texture%", + "side": "%modid%:block/%texture%", + "top": "%modid%:block/%texture%" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/bclib/patterns/block/stairs.json b/src/main/resources/assets/bclib/patterns/block/stairs.json new file mode 100644 index 00000000..af694555 --- /dev/null +++ b/src/main/resources/assets/bclib/patterns/block/stairs.json @@ -0,0 +1,8 @@ +{ + "parent": "block/stairs", + "textures": { + "bottom": "%modid%:block/%texture%", + "side": "%modid%:block/%texture%", + "top": "%modid%:block/%texture%" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/bclib/patterns/block/stairs_inner.json b/src/main/resources/assets/bclib/patterns/block/stairs_inner.json new file mode 100644 index 00000000..30b7d9bf --- /dev/null +++ b/src/main/resources/assets/bclib/patterns/block/stairs_inner.json @@ -0,0 +1,8 @@ +{ + "parent": "block/inner_stairs", + "textures": { + "bottom": "%modid%:block/%texture%", + "side": "%modid%:block/%texture%", + "top": "%modid%:block/%texture%" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/bclib/patterns/block/stairs_outer.json b/src/main/resources/assets/bclib/patterns/block/stairs_outer.json new file mode 100644 index 00000000..3544d10f --- /dev/null +++ b/src/main/resources/assets/bclib/patterns/block/stairs_outer.json @@ -0,0 +1,8 @@ +{ + "parent": "block/outer_stairs", + "textures": { + "bottom": "%modid%:block/%texture%", + "side": "%modid%:block/%texture%", + "top": "%modid%:block/%texture%" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/bclib/patterns/block/top_side_bottom.json b/src/main/resources/assets/bclib/patterns/block/top_side_bottom.json new file mode 100644 index 00000000..9fc15bd3 --- /dev/null +++ b/src/main/resources/assets/bclib/patterns/block/top_side_bottom.json @@ -0,0 +1,8 @@ +{ + "parent": "block/cube_bottom_top", + "textures": { + "bottom": "%bottom%", + "side": "%side%", + "top": "%top%" + } +} diff --git a/src/main/resources/assets/bclib/patterns/block/trapdoor.json b/src/main/resources/assets/bclib/patterns/block/trapdoor.json new file mode 100644 index 00000000..b6309aa2 --- /dev/null +++ b/src/main/resources/assets/bclib/patterns/block/trapdoor.json @@ -0,0 +1,7 @@ +{ + "parent": "bclib:block/sided_trapdoor", + "textures": { + "texture": "%modid%:block/%texture%", + "side": "%modid%:block/%side%" + } +} diff --git a/src/main/resources/assets/bclib/patterns/block/wall_gate_closed.json b/src/main/resources/assets/bclib/patterns/block/wall_gate_closed.json new file mode 100644 index 00000000..1fa4886b --- /dev/null +++ b/src/main/resources/assets/bclib/patterns/block/wall_gate_closed.json @@ -0,0 +1,6 @@ +{ + "parent": "block/template_fence_gate_wall", + "textures": { + "texture": "%modid%:block/%texture%" + } +} diff --git a/src/main/resources/assets/bclib/patterns/block/wall_gate_open.json b/src/main/resources/assets/bclib/patterns/block/wall_gate_open.json new file mode 100644 index 00000000..eac542cb --- /dev/null +++ b/src/main/resources/assets/bclib/patterns/block/wall_gate_open.json @@ -0,0 +1,6 @@ +{ + "parent": "block/template_fence_gate_wall_open", + "textures": { + "texture": "%modid%:block/%texture%" + } +} diff --git a/src/main/resources/assets/bclib/patterns/block/wall_inventory.json b/src/main/resources/assets/bclib/patterns/block/wall_inventory.json new file mode 100644 index 00000000..85d64810 --- /dev/null +++ b/src/main/resources/assets/bclib/patterns/block/wall_inventory.json @@ -0,0 +1,6 @@ +{ + "parent": "block/wall_inventory", + "textures": { + "wall": "%modid%:block/%texture%" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/bclib/patterns/block/wall_post.json b/src/main/resources/assets/bclib/patterns/block/wall_post.json new file mode 100644 index 00000000..466b91eb --- /dev/null +++ b/src/main/resources/assets/bclib/patterns/block/wall_post.json @@ -0,0 +1,6 @@ +{ + "parent": "block/template_wall_post", + "textures": { + "wall": "%modid%:block/%texture%" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/bclib/patterns/block/wall_side.json b/src/main/resources/assets/bclib/patterns/block/wall_side.json new file mode 100644 index 00000000..e93fd118 --- /dev/null +++ b/src/main/resources/assets/bclib/patterns/block/wall_side.json @@ -0,0 +1,6 @@ +{ + "parent": "block/template_wall_side", + "textures": { + "wall": "%modid%:block/%texture%" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/bclib/patterns/block/wall_side_tall.json b/src/main/resources/assets/bclib/patterns/block/wall_side_tall.json new file mode 100644 index 00000000..86451081 --- /dev/null +++ b/src/main/resources/assets/bclib/patterns/block/wall_side_tall.json @@ -0,0 +1,6 @@ +{ + "parent": "block/template_wall_side_tall", + "textures": { + "wall": "%modid%:block/%texture%" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/bclib/patterns/item/pattern_block_item.json b/src/main/resources/assets/bclib/patterns/item/pattern_block_item.json new file mode 100644 index 00000000..79412c0a --- /dev/null +++ b/src/main/resources/assets/bclib/patterns/item/pattern_block_item.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "betterend:block/%texture%" + } +} diff --git a/src/main/resources/assets/bclib/patterns/item/pattern_button.json b/src/main/resources/assets/bclib/patterns/item/pattern_button.json new file mode 100644 index 00000000..a9af699c --- /dev/null +++ b/src/main/resources/assets/bclib/patterns/item/pattern_button.json @@ -0,0 +1,6 @@ +{ + "parent": "block/button_inventory", + "textures": { + "texture": "betterend:block/%texture%" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/bclib/patterns/item/pattern_chest.json b/src/main/resources/assets/bclib/patterns/item/pattern_chest.json new file mode 100644 index 00000000..1febc69c --- /dev/null +++ b/src/main/resources/assets/bclib/patterns/item/pattern_chest.json @@ -0,0 +1,6 @@ +{ + "parent": "betterend:block/chest_item", + "textures": { + "texture": "betterend:entity/chest/%texture%" + } +} diff --git a/src/main/resources/assets/bclib/patterns/item/pattern_fence.json b/src/main/resources/assets/bclib/patterns/item/pattern_fence.json new file mode 100644 index 00000000..c3906066 --- /dev/null +++ b/src/main/resources/assets/bclib/patterns/item/pattern_fence.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_inventory", + "textures": { + "texture": "betterend:block/%texture%" + } +} diff --git a/src/main/resources/assets/bclib/patterns/item/pattern_item_generated.json b/src/main/resources/assets/bclib/patterns/item/pattern_item_generated.json new file mode 100644 index 00000000..65ac21fc --- /dev/null +++ b/src/main/resources/assets/bclib/patterns/item/pattern_item_generated.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "betterend:item/%texture%" + } +} diff --git a/src/main/resources/assets/bclib/patterns/item/pattern_item_handheld.json b/src/main/resources/assets/bclib/patterns/item/pattern_item_handheld.json new file mode 100644 index 00000000..0e621762 --- /dev/null +++ b/src/main/resources/assets/bclib/patterns/item/pattern_item_handheld.json @@ -0,0 +1,6 @@ +{ + "parent": "item/handheld", + "textures": { + "layer0": "betterend:item/%texture%" + } +} diff --git a/src/main/resources/assets/bclib/patterns/item/pattern_item_spawn_egg.json b/src/main/resources/assets/bclib/patterns/item/pattern_item_spawn_egg.json new file mode 100644 index 00000000..765225c9 --- /dev/null +++ b/src/main/resources/assets/bclib/patterns/item/pattern_item_spawn_egg.json @@ -0,0 +1,3 @@ +{ + "parent": "item/template_spawn_egg" +} diff --git a/src/main/resources/assets/bclib/patterns/item/pattern_wall.json b/src/main/resources/assets/bclib/patterns/item/pattern_wall.json new file mode 100644 index 00000000..90c7ea9a --- /dev/null +++ b/src/main/resources/assets/bclib/patterns/item/pattern_wall.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/wall_inventory", + "textures": { + "wall": "betterend:block/%texture%" + } +} \ No newline at end of file diff --git a/src/main/resources/bclib.mixins.client.json b/src/main/resources/bclib.mixins.client.json index fd357b79..9e2748ea 100644 --- a/src/main/resources/bclib.mixins.client.json +++ b/src/main/resources/bclib.mixins.client.json @@ -3,7 +3,9 @@ "minVersion": "0.8", "package": "ru.bclib.mixin.client", "compatibilityLevel": "JAVA_8", - "client": [], + "client": [ + "ModelBakeryMixin" + ], "injectors": { "defaultRequire": 1 }