From 73714ca187802a10a2ad04e3abd33e6a2562a0d7 Mon Sep 17 00:00:00 2001 From: quat1024 Date: Sat, 8 Jul 2023 04:10:44 -0400 Subject: [PATCH] CONTENT FOR THE CONTENT GODS! --- .../github/cottonmc/templates/Templates.java | 89 +++++++------ .../cottonmc/templates/TemplatesClient.java | 38 ++++-- .../templates/block/TemplateButtonBlock.java | 89 +++++++++++++ .../templates/block/TemplateCarpetBlock.java | 78 ++++++++++++ .../block/TemplateFenceGateBlock.java | 85 +++++++++++++ .../templates/block/TemplateLeverBlock.java | 84 +++++++++++++ .../block/TemplatePressurePlateBlock.java | 86 +++++++++++++ .../assets/templates/blockstates/button.json | 118 ++++++++++++++++++ .../assets/templates/blockstates/carpet.json | 7 ++ .../templates/blockstates/fence_gate.json | 80 ++++++++++++ .../assets/templates/blockstates/lever.json | 110 ++++++++++++++++ .../templates/blockstates/pressure_plate.json | 10 ++ .../assets/templates/lang/en_us.json | 5 + .../assets/templates/models/block/button.json | 44 +++++++ .../models/block/button_inventory.json | 43 +++++++ .../models/block/button_pressed.json | 44 +++++++ .../assets/templates/models/block/carpet.json | 48 +++++++ .../templates/models/block/fence_gate.json | 112 +++++++++++++++++ .../models/block/fence_gate_open.json | 100 +++++++++++++++ .../models/block/fence_gate_wall.json | 101 +++++++++++++++ .../models/block/fence_gate_wall_open.json | 101 +++++++++++++++ .../assets/templates/models/block/lever.json | 77 ++++++++++++ .../templates/models/block/lever_on.json | 77 ++++++++++++ .../models/block/pressure_plate_down.json | 44 +++++++ .../models/block/pressure_plate_up.json | 44 +++++++ .../minecraft/tags/blocks/fence_gates.json | 6 + .../minecraft/tags/blocks/wooden_buttons.json | 6 + .../minecraft/tags/blocks/wool_carpets.json | 6 + .../recipes/decorations/templates.json | 3 + .../templates/loot_tables/blocks/carpet.json | 19 +++ .../loot_tables/blocks/fence_gate.json | 19 +++ .../templates/loot_tables/blocks/lever.json | 19 +++ .../loot_tables/blocks/pressure_plate.json | 19 +++ .../data/templates/recipes/button.json | 20 +++ .../data/templates/recipes/carpet.json | 20 +++ .../data/templates/recipes/fence_gate.json | 20 +++ .../data/templates/recipes/lever.json | 24 ++++ .../templates/recipes/pressure_plate.json | 20 +++ 38 files changed, 1869 insertions(+), 46 deletions(-) create mode 100644 src/main/java/io/github/cottonmc/templates/block/TemplateButtonBlock.java create mode 100644 src/main/java/io/github/cottonmc/templates/block/TemplateCarpetBlock.java create mode 100644 src/main/java/io/github/cottonmc/templates/block/TemplateFenceGateBlock.java create mode 100644 src/main/java/io/github/cottonmc/templates/block/TemplateLeverBlock.java create mode 100644 src/main/java/io/github/cottonmc/templates/block/TemplatePressurePlateBlock.java create mode 100644 src/main/resources/assets/templates/blockstates/button.json create mode 100644 src/main/resources/assets/templates/blockstates/carpet.json create mode 100644 src/main/resources/assets/templates/blockstates/fence_gate.json create mode 100644 src/main/resources/assets/templates/blockstates/lever.json create mode 100644 src/main/resources/assets/templates/blockstates/pressure_plate.json create mode 100644 src/main/resources/assets/templates/models/block/button.json create mode 100644 src/main/resources/assets/templates/models/block/button_inventory.json create mode 100644 src/main/resources/assets/templates/models/block/button_pressed.json create mode 100644 src/main/resources/assets/templates/models/block/carpet.json create mode 100644 src/main/resources/assets/templates/models/block/fence_gate.json create mode 100644 src/main/resources/assets/templates/models/block/fence_gate_open.json create mode 100644 src/main/resources/assets/templates/models/block/fence_gate_wall.json create mode 100644 src/main/resources/assets/templates/models/block/fence_gate_wall_open.json create mode 100644 src/main/resources/assets/templates/models/block/lever.json create mode 100644 src/main/resources/assets/templates/models/block/lever_on.json create mode 100644 src/main/resources/assets/templates/models/block/pressure_plate_down.json create mode 100644 src/main/resources/assets/templates/models/block/pressure_plate_up.json create mode 100644 src/main/resources/data/minecraft/tags/blocks/fence_gates.json create mode 100644 src/main/resources/data/minecraft/tags/blocks/wooden_buttons.json create mode 100644 src/main/resources/data/minecraft/tags/blocks/wool_carpets.json create mode 100644 src/main/resources/data/templates/loot_tables/blocks/carpet.json create mode 100644 src/main/resources/data/templates/loot_tables/blocks/fence_gate.json create mode 100644 src/main/resources/data/templates/loot_tables/blocks/lever.json create mode 100644 src/main/resources/data/templates/loot_tables/blocks/pressure_plate.json create mode 100644 src/main/resources/data/templates/recipes/button.json create mode 100644 src/main/resources/data/templates/recipes/carpet.json create mode 100644 src/main/resources/data/templates/recipes/fence_gate.json create mode 100644 src/main/resources/data/templates/recipes/lever.json create mode 100644 src/main/resources/data/templates/recipes/pressure_plate.json diff --git a/src/main/java/io/github/cottonmc/templates/Templates.java b/src/main/java/io/github/cottonmc/templates/Templates.java index ba040b1..1599eec 100644 --- a/src/main/java/io/github/cottonmc/templates/Templates.java +++ b/src/main/java/io/github/cottonmc/templates/Templates.java @@ -2,56 +2,77 @@ package io.github.cottonmc.templates; import io.github.cottonmc.templates.api.TemplateInteractionUtil; import io.github.cottonmc.templates.block.TemplateBlock; +import io.github.cottonmc.templates.block.TemplateButtonBlock; +import io.github.cottonmc.templates.block.TemplateCarpetBlock; import io.github.cottonmc.templates.block.TemplateFenceBlock; +import io.github.cottonmc.templates.block.TemplateFenceGateBlock; +import io.github.cottonmc.templates.block.TemplateLeverBlock; import io.github.cottonmc.templates.block.TemplatePostBlock; +import io.github.cottonmc.templates.block.TemplatePressurePlateBlock; import io.github.cottonmc.templates.block.TemplateSlabBlock; import io.github.cottonmc.templates.block.TemplateSlopeBlock; import io.github.cottonmc.templates.block.TemplateEntity; import io.github.cottonmc.templates.block.TemplateWallBlock; -import io.github.cottonmc.templates.block.WaterloggableTemplateBlock; import net.fabricmc.api.ModInitializer; import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroup; import net.fabricmc.fabric.api.object.builder.v1.block.entity.FabricBlockEntityTypeBuilder; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.entity.BlockEntityType; +import net.minecraft.block.piston.PistonBehavior; import net.minecraft.item.BlockItem; import net.minecraft.item.Item; -import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemStack; import net.minecraft.registry.Registries; import net.minecraft.registry.Registry; +import net.minecraft.sound.BlockSoundGroup; import net.minecraft.text.Text; import net.minecraft.util.Identifier; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import java.util.ArrayList; +import java.util.List; import java.util.function.BiConsumer; +import java.util.stream.Collectors; public class Templates implements ModInitializer { public static final String MODID = "templates"; - public static final Block CUBE = Registry.register(Registries.BLOCK, id("cube"), new TemplateBlock(TemplateInteractionUtil.makeSettings())); - public static final Block FENCE = Registry.register(Registries.BLOCK, id("fence"), new TemplateFenceBlock(TemplateInteractionUtil.makeSettings())); - public static final Block POST = Registry.register(Registries.BLOCK, id("post"), new TemplatePostBlock(TemplateInteractionUtil.makeSettings())); - public static final Block SLAB = Registry.register(Registries.BLOCK, id("slab"), new TemplateSlabBlock(TemplateInteractionUtil.makeSettings())); - public static final Block SLOPE = Registry.register(Registries.BLOCK, id("slope"), new TemplateSlopeBlock(TemplateInteractionUtil.makeSettings())); - public static final Block WALL = Registry.register(Registries.BLOCK, id("wall"), new TemplateWallBlock(TemplateInteractionUtil.makeSettings())); + public static final List BLOCKS = new ArrayList<>(); + private static B reg(String id, B block) { + B b = Registry.register(Registries.BLOCK, id(id), block); + BLOCKS.add(b); + return b; + } - //N.B. it's fine to make your own block entity type instead of gluing additional blocks to this one + public static final Block BUTTON = reg("button", new TemplateButtonBlock(TemplateInteractionUtil.makeSettings().pistonBehavior(PistonBehavior.DESTROY))); + //candle? (lol) + public static final Block CARPET = reg("carpet", new TemplateCarpetBlock(TemplateInteractionUtil.makeSettings().sounds(BlockSoundGroup.WOOL).pistonBehavior(PistonBehavior.DESTROY))); + public static final Block CUBE = reg("cube", new TemplateBlock(TemplateInteractionUtil.makeSettings())); + //door? (hard cause its a multiblock) + public static final Block FENCE = reg("fence", new TemplateFenceBlock(TemplateInteractionUtil.makeSettings())); + public static final Block FENCE_GATE = reg("fence_gate", new TemplateFenceGateBlock(TemplateInteractionUtil.makeSettings())); + public static final Block LEVER = reg("lever", new TemplateLeverBlock(TemplateInteractionUtil.makeSettings().pistonBehavior(PistonBehavior.DESTROY))); + //pane + public static final Block POST = reg("post", new TemplatePostBlock(TemplateInteractionUtil.makeSettings())); + public static final Block PRESSURE_PLATE = reg("pressure_plate", new TemplatePressurePlateBlock(TemplateInteractionUtil.makeSettings().noCollision().pistonBehavior(PistonBehavior.DESTROY))); + public static final Block SLAB = reg("slab", new TemplateSlabBlock(TemplateInteractionUtil.makeSettings())); + //stair + //trapdoor + public static final Block WALL = reg("wall", new TemplateWallBlock(TemplateInteractionUtil.makeSettings())); + + public static final Block SLOPE = reg("slope", new TemplateSlopeBlock(TemplateInteractionUtil.makeSettings())); + //30 degree slope (shallow/deep) + //60 degree slope + //wall slopes + //corner slopes + //quarter slabs???? + + //for addon devs: it's fine to make your own block entity type instead of gluing additional blocks to this one public static final BlockEntityType TEMPLATE_BLOCK_ENTITY = Registry.register( Registries.BLOCK_ENTITY_TYPE, id("slope"), - FabricBlockEntityTypeBuilder.create(Templates::makeTemplateBlockEntity, CUBE, FENCE, POST, SLAB, SLOPE, WALL).build(null) - ); - - @SuppressWarnings("unused") - public static final ItemGroup TAB = Registry.register( - Registries.ITEM_GROUP, id("tab"), - FabricItemGroup.builder() - .displayName(Text.translatable("itemGroup.templates.tab")) - .icon(() -> new ItemStack(SLOPE)) - .entries(Templates::fillItemGroup) - .build() + FabricBlockEntityTypeBuilder.create(Templates::makeTemplateBlockEntity, BLOCKS.toArray(new Block[0])).build(null) ); //Overridden in TemplatesClient @@ -59,12 +80,19 @@ public class Templates implements ModInitializer { @Override public void onInitialize() { - Registry.register(Registries.ITEM, id("cube"), new BlockItem(CUBE, new Item.Settings())); - Registry.register(Registries.ITEM, id("fence"), new BlockItem(FENCE, new Item.Settings())); - Registry.register(Registries.ITEM, id("post"), new BlockItem(POST, new Item.Settings())); - Registry.register(Registries.ITEM, id("slab"), new BlockItem(SLAB, new Item.Settings())); - Registry.register(Registries.ITEM, id("slope"), new BlockItem(SLOPE, new Item.Settings())); - Registry.register(Registries.ITEM, id("wall"), new BlockItem(WALL, new Item.Settings())); + Registry.register( + Registries.ITEM_GROUP, id("tab"), + FabricItemGroup.builder() + .displayName(Text.translatable("itemGroup.templates.tab")) + .icon(() -> new ItemStack(SLOPE)) + .entries((ctx, ent) -> ent.addAll(BLOCKS.stream().map(ItemStack::new).collect(Collectors.toList()))) + .build() + ); + + for(Block b : BLOCKS) { + Identifier id = Registries.BLOCK.getId(b); + Registry.register(Registries.ITEM, id, new BlockItem(b, new Item.Settings())); + } } public static Identifier id(String path) { @@ -75,13 +103,4 @@ public class Templates implements ModInitializer { private static TemplateEntity makeTemplateBlockEntity(BlockPos pos, BlockState state) { return new TemplateEntity(TEMPLATE_BLOCK_ENTITY, pos, state); } - - private static void fillItemGroup(ItemGroup.DisplayContext ctx, ItemGroup.Entries ent) { - ent.add(CUBE); - ent.add(FENCE); - ent.add(POST); - ent.add(SLAB); - ent.add(SLOPE); - ent.add(WALL); - } } diff --git a/src/main/java/io/github/cottonmc/templates/TemplatesClient.java b/src/main/java/io/github/cottonmc/templates/TemplatesClient.java index f2c8796..534bcef 100644 --- a/src/main/java/io/github/cottonmc/templates/TemplatesClient.java +++ b/src/main/java/io/github/cottonmc/templates/TemplatesClient.java @@ -10,6 +10,7 @@ import net.fabricmc.fabric.api.renderer.v1.Renderer; import net.fabricmc.fabric.api.renderer.v1.RendererAccess; import net.fabricmc.fabric.api.resource.ResourceManagerHelper; import net.fabricmc.fabric.api.resource.SimpleSynchronousResourceReloadListener; +import net.minecraft.block.Block; import net.minecraft.client.MinecraftClient; import net.minecraft.client.render.RenderLayer; import net.minecraft.resource.ResourceManager; @@ -54,30 +55,45 @@ public class TemplatesClient implements ClientModInitializer { ModelLoadingRegistry.INSTANCE.registerResourceProvider(rm -> provider); //block models ModelLoadingRegistry.INSTANCE.registerVariantProvider(rm -> provider); //item models - BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(), - Templates.CUBE, - Templates.FENCE, - Templates.POST, - Templates.SLAB, - Templates.SLOPE, - Templates.WALL - ); + BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(), Templates.BLOCKS.toArray(new Block[0])); + //vanilla style + provider.addTemplateModel(Templates.id("button_special"), new RetexturedJsonModelUnbakedModel(Templates.id("block/button"))); + provider.addTemplateModel(Templates.id("button_pressed_special"), new RetexturedJsonModelUnbakedModel(Templates.id("block/button_pressed"))); + provider.addTemplateModel(Templates.id("carpet_special"), new RetexturedJsonModelUnbakedModel(Templates.id("block/carpet"))); provider.addTemplateModel(Templates.id("cube_special"), new RetexturedJsonModelUnbakedModel(Templates.id("block/cube"))); provider.addTemplateModel(Templates.id("fence_post_special"), new RetexturedJsonModelUnbakedModel(Templates.id("block/fence_post"))); provider.addTemplateModel(Templates.id("fence_side_special"), new RetexturedJsonModelUnbakedModel(Templates.id("block/fence_side"))); - provider.addTemplateModel(Templates.id("fence_inventory_special"), new RetexturedJsonModelUnbakedModel(Templates.id("block/fence_inventory"))); + provider.addTemplateModel(Templates.id("fence_gate_special"), new RetexturedJsonModelUnbakedModel(Templates.id("block/fence_gate"))); + provider.addTemplateModel(Templates.id("fence_gate_open_special"), new RetexturedJsonModelUnbakedModel(Templates.id("block/fence_gate_open"))); + provider.addTemplateModel(Templates.id("fence_gate_wall_special"), new RetexturedJsonModelUnbakedModel(Templates.id("block/fence_gate_wall"))); + provider.addTemplateModel(Templates.id("fence_gate_wall_open_special"), new RetexturedJsonModelUnbakedModel(Templates.id("block/fence_gate_wall_open"))); + provider.addTemplateModel(Templates.id("lever_special"), new RetexturedJsonModelUnbakedModel(Templates.id("block/lever"))); + provider.addTemplateModel(Templates.id("lever_on_special"), new RetexturedJsonModelUnbakedModel(Templates.id("block/lever_on"))); + provider.addTemplateModel(Templates.id("pressure_plate_up_special"), new RetexturedJsonModelUnbakedModel(Templates.id("block/pressure_plate_up"))); + provider.addTemplateModel(Templates.id("pressure_plate_down_special"), new RetexturedJsonModelUnbakedModel(Templates.id("block/pressure_plate_down"))); provider.addTemplateModel(Templates.id("slab_bottom_special"), new RetexturedJsonModelUnbakedModel(Templates.id("block/slab_bottom"))); provider.addTemplateModel(Templates.id("slab_top_special"), new RetexturedJsonModelUnbakedModel(Templates.id("block/slab_top"))); - provider.addTemplateModel(Templates.id("slope_special"), new RetexturedMeshUnbakedModel(Templates.id("block/slope_base"), SlopeBaseMesh::make)); - provider.addTemplateModel(Templates.id("wall_inventory_special"), new RetexturedJsonModelUnbakedModel(Templates.id("block/wall_inventory"))); provider.addTemplateModel(Templates.id("wall_post_special"), new RetexturedJsonModelUnbakedModel(Templates.id("block/wall_post"))); provider.addTemplateModel(Templates.id("wall_side_special"), new RetexturedJsonModelUnbakedModel(Templates.id("block/wall_side"))); provider.addTemplateModel(Templates.id("wall_side_tall_special"), new RetexturedJsonModelUnbakedModel(Templates.id("block/wall_side_tall"))); + //meshes + provider.addTemplateModel(Templates.id("slope_special"), new RetexturedMeshUnbakedModel(Templates.id("block/slope_base"), SlopeBaseMesh::make)); + + //item only models -- TODO move to item/ prolly + provider.addTemplateModel(Templates.id("button_inventory_special"), new RetexturedJsonModelUnbakedModel(Templates.id("block/button_inventory"))); + provider.addTemplateModel(Templates.id("fence_inventory_special"), new RetexturedJsonModelUnbakedModel(Templates.id("block/fence_inventory"))); + provider.addTemplateModel(Templates.id("wall_inventory_special"), new RetexturedJsonModelUnbakedModel(Templates.id("block/wall_inventory"))); + + provider.assignItemModel(Templates.id("button_special"), Templates.BUTTON); + provider.assignItemModel(Templates.id("carpet_special"), Templates.CARPET); provider.assignItemModel(Templates.id("cube_special"), Templates.CUBE); provider.assignItemModel(Templates.id("fence_inventory_special"), Templates.FENCE); + provider.assignItemModel(Templates.id("fence_gate_special"), Templates.FENCE_GATE); + provider.assignItemModel(Templates.id("lever_special"), Templates.LEVER); //TODO vanilla uses its own item model provider.assignItemModel(Templates.id("fence_post_special"), Templates.POST); + provider.assignItemModel(Templates.id("pressure_plate_up_special"), Templates.PRESSURE_PLATE); provider.assignItemModel(Templates.id("slope_special"), Templates.SLOPE); provider.assignItemModel(Templates.id("slab_bottom_special"), Templates.SLAB); provider.assignItemModel(Templates.id("wall_inventory_special"), Templates.WALL); diff --git a/src/main/java/io/github/cottonmc/templates/block/TemplateButtonBlock.java b/src/main/java/io/github/cottonmc/templates/block/TemplateButtonBlock.java new file mode 100644 index 0000000..97638f9 --- /dev/null +++ b/src/main/java/io/github/cottonmc/templates/block/TemplateButtonBlock.java @@ -0,0 +1,89 @@ +package io.github.cottonmc.templates.block; + +import com.google.common.base.MoreObjects; +import io.github.cottonmc.templates.Templates; +import io.github.cottonmc.templates.api.TemplateInteractionUtil; +import net.minecraft.block.Block; +import net.minecraft.block.BlockEntityProvider; +import net.minecraft.block.BlockSetType; +import net.minecraft.block.BlockState; +import net.minecraft.block.ButtonBlock; +import net.minecraft.block.ShapeContext; +import net.minecraft.block.entity.BlockEntity; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.item.ItemStack; +import net.minecraft.state.StateManager; +import net.minecraft.util.ActionResult; +import net.minecraft.util.Hand; +import net.minecraft.util.hit.BlockHitResult; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; +import net.minecraft.util.shape.VoxelShape; +import net.minecraft.world.BlockView; +import net.minecraft.world.World; +import org.jetbrains.annotations.Nullable; + +public class TemplateButtonBlock extends ButtonBlock implements BlockEntityProvider { + public TemplateButtonBlock(Settings settings) { + this(settings, BlockSetType.OAK, 30, true); + } + + public TemplateButtonBlock(Settings settings, BlockSetType blockSetType, int i, boolean bl) { + super(settings, blockSetType, i, bl); + setDefaultState(TemplateInteractionUtil.setDefaultStates(getDefaultState())); + } + + @Nullable + @Override + public BlockEntity createBlockEntity(BlockPos pos, BlockState state) { + return Templates.TEMPLATE_BLOCK_ENTITY.instantiate(pos, state); + } + + @Override + protected void appendProperties(StateManager.Builder builder) { + super.appendProperties(TemplateInteractionUtil.appendProperties(builder)); + } + + @Override + public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) { + ActionResult r = TemplateInteractionUtil.onUse(state, world, pos, player, hand, hit); + if(!r.isAccepted()) r = super.onUse(state, world, pos, player, hand, hit); + return r; + } + + @Override + public void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved) { + TemplateInteractionUtil.onStateReplaced(state, world, pos, newState, moved); + super.onStateReplaced(state, world, pos, newState, moved); + } + + @Override + public void onPlaced(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack stack) { + TemplateInteractionUtil.onPlaced(world, pos, state, placer, stack); + } + + @Override + public VoxelShape getCollisionShape(BlockState state, BlockView view, BlockPos pos, ShapeContext ctx) { + return MoreObjects.firstNonNull(TemplateInteractionUtil.getCollisionShape(state, view, pos, ctx), super.getCollisionShape(state, view, pos, ctx)); + } + + @Override + public boolean emitsRedstonePower(BlockState state) { + //return TemplateInteractionUtil.emitsRedstonePower(state); + return super.emitsRedstonePower(state); + } + + @Override + public int getWeakRedstonePower(BlockState state, BlockView view, BlockPos pos, Direction dir) { + boolean a = 0 != super.getWeakRedstonePower(state, view, pos, dir); + boolean b = 0 != TemplateInteractionUtil.getWeakRedstonePower(state, view, pos, dir); + return (a ^ b) ? 15 : 0; + } + + @Override + public int getStrongRedstonePower(BlockState state, BlockView view, BlockPos pos, Direction dir) { + if(getDirection(state) != dir) return 0; + else return getWeakRedstonePower(state, view, pos, dir); + } +} diff --git a/src/main/java/io/github/cottonmc/templates/block/TemplateCarpetBlock.java b/src/main/java/io/github/cottonmc/templates/block/TemplateCarpetBlock.java new file mode 100644 index 0000000..60e2054 --- /dev/null +++ b/src/main/java/io/github/cottonmc/templates/block/TemplateCarpetBlock.java @@ -0,0 +1,78 @@ +package io.github.cottonmc.templates.block; + +import com.google.common.base.MoreObjects; +import io.github.cottonmc.templates.Templates; +import io.github.cottonmc.templates.api.TemplateInteractionUtil; +import net.minecraft.block.Block; +import net.minecraft.block.BlockEntityProvider; +import net.minecraft.block.BlockState; +import net.minecraft.block.CarpetBlock; +import net.minecraft.block.ShapeContext; +import net.minecraft.block.entity.BlockEntity; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.item.ItemStack; +import net.minecraft.state.StateManager; +import net.minecraft.util.ActionResult; +import net.minecraft.util.Hand; +import net.minecraft.util.hit.BlockHitResult; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; +import net.minecraft.util.shape.VoxelShape; +import net.minecraft.world.BlockView; +import net.minecraft.world.World; +import org.jetbrains.annotations.Nullable; + +public class TemplateCarpetBlock extends CarpetBlock implements BlockEntityProvider { + public TemplateCarpetBlock(Settings settings) { + super(settings); + setDefaultState(TemplateInteractionUtil.setDefaultStates(getDefaultState())); + } + + @Nullable + @Override + public BlockEntity createBlockEntity(BlockPos pos, BlockState state) { + return Templates.TEMPLATE_BLOCK_ENTITY.instantiate(pos, state); + } + + @Override + protected void appendProperties(StateManager.Builder builder) { + super.appendProperties(TemplateInteractionUtil.appendProperties(builder)); + } + + @Override + public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) { + return TemplateInteractionUtil.onUse(state, world, pos, player, hand, hit); + } + + @Override + public void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved) { + TemplateInteractionUtil.onStateReplaced(state, world, pos, newState, moved); + super.onStateReplaced(state, world, pos, newState, moved); + } + + @Override + public void onPlaced(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack stack) { + TemplateInteractionUtil.onPlaced(world, pos, state, placer, stack); + } + + @Override + public VoxelShape getCollisionShape(BlockState state, BlockView view, BlockPos pos, ShapeContext ctx) { + return MoreObjects.firstNonNull(TemplateInteractionUtil.getCollisionShape(state, view, pos, ctx), super.getCollisionShape(state, view, pos, ctx)); + } + + @Override + public boolean emitsRedstonePower(BlockState state) { + return TemplateInteractionUtil.emitsRedstonePower(state); + } + + @Override + public int getWeakRedstonePower(BlockState state, BlockView view, BlockPos pos, Direction dir) { + return TemplateInteractionUtil.getWeakRedstonePower(state, view, pos, dir); + } + + @Override + public int getStrongRedstonePower(BlockState state, BlockView view, BlockPos pos, Direction dir) { + return TemplateInteractionUtil.getStrongRedstonePower(state, view, pos, dir); + } +} diff --git a/src/main/java/io/github/cottonmc/templates/block/TemplateFenceGateBlock.java b/src/main/java/io/github/cottonmc/templates/block/TemplateFenceGateBlock.java new file mode 100644 index 0000000..acf36a7 --- /dev/null +++ b/src/main/java/io/github/cottonmc/templates/block/TemplateFenceGateBlock.java @@ -0,0 +1,85 @@ +package io.github.cottonmc.templates.block; + +import com.google.common.base.MoreObjects; +import io.github.cottonmc.templates.Templates; +import io.github.cottonmc.templates.api.TemplateInteractionUtil; +import net.minecraft.block.Block; +import net.minecraft.block.BlockEntityProvider; +import net.minecraft.block.BlockState; +import net.minecraft.block.FenceGateBlock; +import net.minecraft.block.ShapeContext; +import net.minecraft.block.WoodType; +import net.minecraft.block.entity.BlockEntity; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.item.ItemStack; +import net.minecraft.state.StateManager; +import net.minecraft.util.ActionResult; +import net.minecraft.util.Hand; +import net.minecraft.util.hit.BlockHitResult; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; +import net.minecraft.util.shape.VoxelShape; +import net.minecraft.world.BlockView; +import net.minecraft.world.World; +import org.jetbrains.annotations.Nullable; + +public class TemplateFenceGateBlock extends FenceGateBlock implements BlockEntityProvider { + public TemplateFenceGateBlock(Settings settings, WoodType woodType) { + super(settings, woodType); + setDefaultState(TemplateInteractionUtil.setDefaultStates(getDefaultState())); + } + + public TemplateFenceGateBlock(Settings settings) { + this(settings, WoodType.OAK); + } + + @Nullable + @Override + public BlockEntity createBlockEntity(BlockPos pos, BlockState state) { + return Templates.TEMPLATE_BLOCK_ENTITY.instantiate(pos, state); + } + + @Override + protected void appendProperties(StateManager.Builder builder) { + super.appendProperties(TemplateInteractionUtil.appendProperties(builder)); + } + + @Override + public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) { + ActionResult r = TemplateInteractionUtil.onUse(state, world, pos, player, hand, hit); + if(!r.isAccepted()) r = super.onUse(state, world, pos, player, hand, hit); + return r; + } + + @Override + public void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved) { + TemplateInteractionUtil.onStateReplaced(state, world, pos, newState, moved); + super.onStateReplaced(state, world, pos, newState, moved); + } + + @Override + public void onPlaced(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack stack) { + TemplateInteractionUtil.onPlaced(world, pos, state, placer, stack); + } + + @Override + public VoxelShape getCollisionShape(BlockState state, BlockView view, BlockPos pos, ShapeContext ctx) { + return MoreObjects.firstNonNull(TemplateInteractionUtil.getCollisionShape(state, view, pos, ctx), super.getCollisionShape(state, view, pos, ctx)); + } + + @Override + public boolean emitsRedstonePower(BlockState state) { + return TemplateInteractionUtil.emitsRedstonePower(state); + } + + @Override + public int getWeakRedstonePower(BlockState state, BlockView view, BlockPos pos, Direction dir) { + return TemplateInteractionUtil.getWeakRedstonePower(state, view, pos, dir); + } + + @Override + public int getStrongRedstonePower(BlockState state, BlockView view, BlockPos pos, Direction dir) { + return TemplateInteractionUtil.getStrongRedstonePower(state, view, pos, dir); + } +} diff --git a/src/main/java/io/github/cottonmc/templates/block/TemplateLeverBlock.java b/src/main/java/io/github/cottonmc/templates/block/TemplateLeverBlock.java new file mode 100644 index 0000000..3b1c478 --- /dev/null +++ b/src/main/java/io/github/cottonmc/templates/block/TemplateLeverBlock.java @@ -0,0 +1,84 @@ +package io.github.cottonmc.templates.block; + +import com.google.common.base.MoreObjects; +import io.github.cottonmc.templates.Templates; +import io.github.cottonmc.templates.api.TemplateInteractionUtil; +import net.minecraft.block.Block; +import net.minecraft.block.BlockEntityProvider; +import net.minecraft.block.BlockState; +import net.minecraft.block.LeverBlock; +import net.minecraft.block.ShapeContext; +import net.minecraft.block.entity.BlockEntity; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.item.ItemStack; +import net.minecraft.state.StateManager; +import net.minecraft.util.ActionResult; +import net.minecraft.util.Hand; +import net.minecraft.util.hit.BlockHitResult; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; +import net.minecraft.util.shape.VoxelShape; +import net.minecraft.world.BlockView; +import net.minecraft.world.World; +import org.jetbrains.annotations.Nullable; + +public class TemplateLeverBlock extends LeverBlock implements BlockEntityProvider { + public TemplateLeverBlock(Settings settings) { + super(settings); + setDefaultState(TemplateInteractionUtil.setDefaultStates(getDefaultState())); + } + + @Nullable + @Override + public BlockEntity createBlockEntity(BlockPos pos, BlockState state) { + return Templates.TEMPLATE_BLOCK_ENTITY.instantiate(pos, state); + } + + @Override + protected void appendProperties(StateManager.Builder builder) { + super.appendProperties(TemplateInteractionUtil.appendProperties(builder)); + } + + @Override + public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) { + ActionResult r = TemplateInteractionUtil.onUse(state, world, pos, player, hand, hit); + if(!r.isAccepted()) r = super.onUse(state, world, pos, player, hand, hit); + return r; + } + + @Override + public void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved) { + TemplateInteractionUtil.onStateReplaced(state, world, pos, newState, moved); + super.onStateReplaced(state, world, pos, newState, moved); + } + + @Override + public void onPlaced(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack stack) { + TemplateInteractionUtil.onPlaced(world, pos, state, placer, stack); + } + + @Override + public VoxelShape getCollisionShape(BlockState state, BlockView view, BlockPos pos, ShapeContext ctx) { + return MoreObjects.firstNonNull(TemplateInteractionUtil.getCollisionShape(state, view, pos, ctx), super.getCollisionShape(state, view, pos, ctx)); + } + + @Override + public boolean emitsRedstonePower(BlockState state) { + //return TemplateInteractionUtil.emitsRedstonePower(state); + return super.emitsRedstonePower(state); + } + + @Override + public int getWeakRedstonePower(BlockState state, BlockView view, BlockPos pos, Direction dir) { + boolean a = 0 != super.getWeakRedstonePower(state, view, pos, dir); + boolean b = 0 != TemplateInteractionUtil.getWeakRedstonePower(state, view, pos, dir); + return (a ^ b) ? 15 : 0; + } + + @Override + public int getStrongRedstonePower(BlockState state, BlockView view, BlockPos pos, Direction dir) { + if(getDirection(state) != dir) return 0; + else return getWeakRedstonePower(state, view, pos, dir); + } +} diff --git a/src/main/java/io/github/cottonmc/templates/block/TemplatePressurePlateBlock.java b/src/main/java/io/github/cottonmc/templates/block/TemplatePressurePlateBlock.java new file mode 100644 index 0000000..5de148c --- /dev/null +++ b/src/main/java/io/github/cottonmc/templates/block/TemplatePressurePlateBlock.java @@ -0,0 +1,86 @@ +package io.github.cottonmc.templates.block; + +import com.google.common.base.MoreObjects; +import io.github.cottonmc.templates.Templates; +import io.github.cottonmc.templates.api.TemplateInteractionUtil; +import net.minecraft.block.Block; +import net.minecraft.block.BlockEntityProvider; +import net.minecraft.block.BlockSetType; +import net.minecraft.block.BlockState; +import net.minecraft.block.PressurePlateBlock; +import net.minecraft.block.ShapeContext; +import net.minecraft.block.entity.BlockEntity; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.item.ItemStack; +import net.minecraft.state.StateManager; +import net.minecraft.util.ActionResult; +import net.minecraft.util.Hand; +import net.minecraft.util.hit.BlockHitResult; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; +import net.minecraft.util.shape.VoxelShape; +import net.minecraft.world.BlockView; +import net.minecraft.world.World; +import org.jetbrains.annotations.Nullable; + +public class TemplatePressurePlateBlock extends PressurePlateBlock implements BlockEntityProvider { + public TemplatePressurePlateBlock(ActivationRule activationRule, Settings settings, BlockSetType blockSetType) { + super(activationRule, settings, blockSetType); + setDefaultState(TemplateInteractionUtil.setDefaultStates(getDefaultState())); + } + + public TemplatePressurePlateBlock(Settings settings) { + this(ActivationRule.EVERYTHING, settings, BlockSetType.OAK); + } + + @Override + public @Nullable BlockEntity createBlockEntity(BlockPos pos, BlockState state) { + return Templates.TEMPLATE_BLOCK_ENTITY.instantiate(pos, state); + } + + @Override + protected void appendProperties(StateManager.Builder builder) { + super.appendProperties(TemplateInteractionUtil.appendProperties(builder)); + } + + @Override + public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) { + return TemplateInteractionUtil.onUse(state, world, pos, player, hand, hit); + } + + @Override + public void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved) { + TemplateInteractionUtil.onStateReplaced(state, world, pos, newState, moved); + super.onStateReplaced(state, world, pos, newState, moved); + } + + @Override + public void onPlaced(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack stack) { + TemplateInteractionUtil.onPlaced(world, pos, state, placer, stack); + super.onPlaced(world, pos, state, placer, stack); + } + + @Override + public VoxelShape getCollisionShape(BlockState state, BlockView view, BlockPos pos, ShapeContext ctx) { + return MoreObjects.firstNonNull(TemplateInteractionUtil.getCollisionShape(state, view, pos, ctx), super.getCollisionShape(state, view, pos, ctx)); + } + + @Override + public boolean emitsRedstonePower(BlockState state) { + //return TemplateInteractionUtil.emitsRedstonePower(state); + return super.emitsRedstonePower(state); + } + + @Override + public int getWeakRedstonePower(BlockState state, BlockView view, BlockPos pos, Direction dir) { + boolean a = 0 != super.getWeakRedstonePower(state, view, pos, dir); + boolean b = 0 != TemplateInteractionUtil.getWeakRedstonePower(state, view, pos, dir); + return (a ^ b) ? 15 : 0; + } + + @Override + public int getStrongRedstonePower(BlockState state, BlockView view, BlockPos pos, Direction dir) { + return dir == Direction.UP ? getWeakRedstonePower(state, view, pos, dir) : 0; + } +} diff --git a/src/main/resources/assets/templates/blockstates/button.json b/src/main/resources/assets/templates/blockstates/button.json new file mode 100644 index 0000000..28c5d0d --- /dev/null +++ b/src/main/resources/assets/templates/blockstates/button.json @@ -0,0 +1,118 @@ +{ + "variants": { + "face=ceiling,facing=east,powered=false": { + "model": "templates:button_special", + "x": 180, + "y": 270 + }, + "face=ceiling,facing=east,powered=true": { + "model": "templates:button_pressed_special", + "x": 180, + "y": 270 + }, + "face=ceiling,facing=north,powered=false": { + "model": "templates:button_special", + "x": 180, + "y": 180 + }, + "face=ceiling,facing=north,powered=true": { + "model": "templates:button_pressed_special", + "x": 180, + "y": 180 + }, + "face=ceiling,facing=south,powered=false": { + "model": "templates:button_special", + "x": 180 + }, + "face=ceiling,facing=south,powered=true": { + "model": "templates:button_pressed_special", + "x": 180 + }, + "face=ceiling,facing=west,powered=false": { + "model": "templates:button_special", + "x": 180, + "y": 90 + }, + "face=ceiling,facing=west,powered=true": { + "model": "templates:button_pressed_special", + "x": 180, + "y": 90 + }, + "face=floor,facing=east,powered=false": { + "model": "templates:button_special", + "y": 90 + }, + "face=floor,facing=east,powered=true": { + "model": "templates:button_pressed_special", + "y": 90 + }, + "face=floor,facing=north,powered=false": { + "model": "templates:button_special" + }, + "face=floor,facing=north,powered=true": { + "model": "templates:button_pressed_special" + }, + "face=floor,facing=south,powered=false": { + "model": "templates:button_special", + "y": 180 + }, + "face=floor,facing=south,powered=true": { + "model": "templates:button_pressed_special", + "y": 180 + }, + "face=floor,facing=west,powered=false": { + "model": "templates:button_special", + "y": 270 + }, + "face=floor,facing=west,powered=true": { + "model": "templates:button_pressed_special", + "y": 270 + }, + "face=wall,facing=east,powered=false": { + "model": "templates:button_special", + "uvlock": true, + "x": 90, + "y": 90 + }, + "face=wall,facing=east,powered=true": { + "model": "templates:button_pressed_special", + "uvlock": true, + "x": 90, + "y": 90 + }, + "face=wall,facing=north,powered=false": { + "model": "templates:button_special", + "uvlock": true, + "x": 90 + }, + "face=wall,facing=north,powered=true": { + "model": "templates:button_pressed_special", + "uvlock": true, + "x": 90 + }, + "face=wall,facing=south,powered=false": { + "model": "templates:button_special", + "uvlock": true, + "x": 90, + "y": 180 + }, + "face=wall,facing=south,powered=true": { + "model": "templates:button_pressed_special", + "uvlock": true, + "x": 90, + "y": 180 + }, + "face=wall,facing=west,powered=false": { + "model": "templates:button_special", + "uvlock": true, + "x": 90, + "y": 270 + }, + "face=wall,facing=west,powered=true": { + "model": "templates:button_pressed_special", + "uvlock": true, + "x": 90, + "y": 270 + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/templates/blockstates/carpet.json b/src/main/resources/assets/templates/blockstates/carpet.json new file mode 100644 index 0000000..47953bf --- /dev/null +++ b/src/main/resources/assets/templates/blockstates/carpet.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "templates:carpet_special" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/templates/blockstates/fence_gate.json b/src/main/resources/assets/templates/blockstates/fence_gate.json new file mode 100644 index 0000000..c63acf5 --- /dev/null +++ b/src/main/resources/assets/templates/blockstates/fence_gate.json @@ -0,0 +1,80 @@ +{ + "variants": { + "facing=east,in_wall=false,open=false": { + "model": "templates:fence_gate_special", + "uvlock": true, + "y": 270 + }, + "facing=east,in_wall=false,open=true": { + "model": "templates:fence_gate_open_special", + "uvlock": true, + "y": 270 + }, + "facing=east,in_wall=true,open=false": { + "model": "templates:fence_gate_wall_special", + "uvlock": true, + "y": 270 + }, + "facing=east,in_wall=true,open=true": { + "model": "templates:fence_gate_wall_open_special", + "uvlock": true, + "y": 270 + }, + "facing=north,in_wall=false,open=false": { + "model": "templates:fence_gate_special", + "uvlock": true, + "y": 180 + }, + "facing=north,in_wall=false,open=true": { + "model": "templates:fence_gate_open_special", + "uvlock": true, + "y": 180 + }, + "facing=north,in_wall=true,open=false": { + "model": "templates:fence_gate_wall_special", + "uvlock": true, + "y": 180 + }, + "facing=north,in_wall=true,open=true": { + "model": "templates:fence_gate_wall_open_special", + "uvlock": true, + "y": 180 + }, + "facing=south,in_wall=false,open=false": { + "model": "templates:fence_gate_special", + "uvlock": true + }, + "facing=south,in_wall=false,open=true": { + "model": "templates:fence_gate_open_special", + "uvlock": true + }, + "facing=south,in_wall=true,open=false": { + "model": "templates:fence_gate_wall_special", + "uvlock": true + }, + "facing=south,in_wall=true,open=true": { + "model": "templates:fence_gate_wall_open_special", + "uvlock": true + }, + "facing=west,in_wall=false,open=false": { + "model": "templates:fence_gate_special", + "uvlock": true, + "y": 90 + }, + "facing=west,in_wall=false,open=true": { + "model": "templates:fence_gate_open_special", + "uvlock": true, + "y": 90 + }, + "facing=west,in_wall=true,open=false": { + "model": "templates:fence_gate_wall_special", + "uvlock": true, + "y": 90 + }, + "facing=west,in_wall=true,open=true": { + "model": "templates:fence_gate_wall_open_special", + "uvlock": true, + "y": 90 + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/templates/blockstates/lever.json b/src/main/resources/assets/templates/blockstates/lever.json new file mode 100644 index 0000000..73ce953 --- /dev/null +++ b/src/main/resources/assets/templates/blockstates/lever.json @@ -0,0 +1,110 @@ +{ + "variants": { + "face=ceiling,facing=east,powered=false": { + "model": "templates:lever_on_special", + "x": 180, + "y": 270 + }, + "face=ceiling,facing=east,powered=true": { + "model": "templates:lever_special", + "x": 180, + "y": 270 + }, + "face=ceiling,facing=north,powered=false": { + "model": "templates:lever_on_special", + "x": 180, + "y": 180 + }, + "face=ceiling,facing=north,powered=true": { + "model": "templates:lever_special", + "x": 180, + "y": 180 + }, + "face=ceiling,facing=south,powered=false": { + "model": "templates:lever_on_special", + "x": 180 + }, + "face=ceiling,facing=south,powered=true": { + "model": "templates:lever_special", + "x": 180 + }, + "face=ceiling,facing=west,powered=false": { + "model": "templates:lever_on_special", + "x": 180, + "y": 90 + }, + "face=ceiling,facing=west,powered=true": { + "model": "templates:lever_special", + "x": 180, + "y": 90 + }, + "face=floor,facing=east,powered=false": { + "model": "templates:lever_on_special", + "y": 90 + }, + "face=floor,facing=east,powered=true": { + "model": "templates:lever_special", + "y": 90 + }, + "face=floor,facing=north,powered=false": { + "model": "templates:lever_on_special" + }, + "face=floor,facing=north,powered=true": { + "model": "templates:lever_special" + }, + "face=floor,facing=south,powered=false": { + "model": "templates:lever_on_special", + "y": 180 + }, + "face=floor,facing=south,powered=true": { + "model": "templates:lever_special", + "y": 180 + }, + "face=floor,facing=west,powered=false": { + "model": "templates:lever_on_special", + "y": 270 + }, + "face=floor,facing=west,powered=true": { + "model": "templates:lever_special", + "y": 270 + }, + "face=wall,facing=east,powered=false": { + "model": "templates:lever_on_special", + "x": 90, + "y": 90 + }, + "face=wall,facing=east,powered=true": { + "model": "templates:lever_special", + "x": 90, + "y": 90 + }, + "face=wall,facing=north,powered=false": { + "model": "templates:lever_on_special", + "x": 90 + }, + "face=wall,facing=north,powered=true": { + "model": "templates:lever_special", + "x": 90 + }, + "face=wall,facing=south,powered=false": { + "model": "templates:lever_on_special", + "x": 90, + "y": 180 + }, + "face=wall,facing=south,powered=true": { + "model": "templates:lever_special", + "x": 90, + "y": 180 + }, + "face=wall,facing=west,powered=false": { + "model": "templates:lever_on_special", + "x": 90, + "y": 270 + }, + "face=wall,facing=west,powered=true": { + "model": "templates:lever_special", + "x": 90, + "y": 270 + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/templates/blockstates/pressure_plate.json b/src/main/resources/assets/templates/blockstates/pressure_plate.json new file mode 100644 index 0000000..cd28919 --- /dev/null +++ b/src/main/resources/assets/templates/blockstates/pressure_plate.json @@ -0,0 +1,10 @@ +{ + "variants": { + "powered=false": { + "model": "templates:pressure_plate_up_special" + }, + "powered=true": { + "model": "templates:pressure_plate_down_special" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/templates/lang/en_us.json b/src/main/resources/assets/templates/lang/en_us.json index 706f481..fc5ac87 100644 --- a/src/main/resources/assets/templates/lang/en_us.json +++ b/src/main/resources/assets/templates/lang/en_us.json @@ -1,9 +1,14 @@ { "itemGroup.templates.tab": "Templates", + "block.templates.button": "Button Template", + "block.templates.carpet": "Carpet Template", "block.templates.cube": "Cube Template", "block.templates.fence": "Fence Template", + "block.templates.fence_gate": "Fence Gate Template", + "block.templates.lever": "Lever Template", "block.templates.post": "Post Template", + "block.templates.pressure_plate": "Pressure Plate Template", "block.templates.slope": "Slope Template", "block.templates.slab": "Slab Template", "block.templates.wall": "Wall Template" diff --git a/src/main/resources/assets/templates/models/block/button.json b/src/main/resources/assets/templates/models/block/button.json new file mode 100644 index 0000000..5aa8409 --- /dev/null +++ b/src/main/resources/assets/templates/models/block/button.json @@ -0,0 +1,44 @@ +{ + "parent": "block/block", + "textures": { + "down": "templates:templates_special/down", + "up": "templates:templates_special/up", + "north": "templates:templates_special/north", + "south": "templates:templates_special/south", + "west": "templates:templates_special/west", + "east": "templates:templates_special/east" + }, + "elements": [ + { + "from": [5, 0, 6], + "to": [11, 2, 10], + "faces": { + "down": { + "uv": [5, 6, 11, 10], + "texture": "#down", + "cullface": "down" + }, + "up": { + "uv": [5, 6, 11, 10], + "texture": "#up" + }, + "north": { + "uv": [5, 14, 11, 16], + "texture": "#north" + }, + "south": { + "uv": [5, 14, 11, 16], + "texture": "#south" + }, + "west": { + "uv": [6, 14, 10, 16], + "texture": "#west" + }, + "east": { + "uv": [6, 14, 10, 16], + "texture": "#east" + } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/templates/models/block/button_inventory.json b/src/main/resources/assets/templates/models/block/button_inventory.json new file mode 100644 index 0000000..74d86c9 --- /dev/null +++ b/src/main/resources/assets/templates/models/block/button_inventory.json @@ -0,0 +1,43 @@ +{ + "parent": "block/block", + "textures": { + "down": "templates:templates_special/down", + "up": "templates:templates_special/up", + "north": "templates:templates_special/north", + "south": "templates:templates_special/south", + "west": "templates:templates_special/west", + "east": "templates:templates_special/east" + }, + "elements": [ + { + "from": [5, 6, 6], + "to": [11, 10, 10], + "faces": { + "down": { + "uv": [5, 6, 11, 10], + "texture": "#down" + }, + "up": { + "uv": [5, 10, 11, 6], + "texture": "#up" + }, + "north": { + "uv": [5, 12, 11, 16], + "texture": "#north" + }, + "south": { + "uv": [5, 12, 11, 16], + "texture": "#south" + }, + "west": { + "uv": [6, 12, 10, 16], + "texture": "#west" + }, + "east": { + "uv": [6, 12, 10, 16], + "texture": "#east" + } + } + } + ] +} diff --git a/src/main/resources/assets/templates/models/block/button_pressed.json b/src/main/resources/assets/templates/models/block/button_pressed.json new file mode 100644 index 0000000..1fbc78e --- /dev/null +++ b/src/main/resources/assets/templates/models/block/button_pressed.json @@ -0,0 +1,44 @@ +{ + "parent": "block/block", + "textures": { + "down": "templates:templates_special/down", + "up": "templates:templates_special/up", + "north": "templates:templates_special/north", + "south": "templates:templates_special/south", + "west": "templates:templates_special/west", + "east": "templates:templates_special/east" + }, + "elements": [ + { + "from": [5, 0, 6], + "to": [11, 1.02, 10], + "faces": { + "down": { + "uv": [5, 6, 11, 10], + "texture": "#down", + "cullface": "down" + }, + "up": { + "uv": [5, 6, 11, 10], + "texture": "#up" + }, + "north": { + "uv": [5, 14, 11, 15], + "texture": "#north" + }, + "south": { + "uv": [5, 14, 11, 15], + "texture": "#south" + }, + "west": { + "uv": [6, 14, 10, 15], + "texture": "#west" + }, + "east": { + "uv": [6, 14, 10, 15], + "texture": "#east" + } + } + } + ] +} diff --git a/src/main/resources/assets/templates/models/block/carpet.json b/src/main/resources/assets/templates/models/block/carpet.json new file mode 100644 index 0000000..a64bad0 --- /dev/null +++ b/src/main/resources/assets/templates/models/block/carpet.json @@ -0,0 +1,48 @@ +{ + "parent": "block/thin_block", + "textures": { + "down": "templates:templates_special/down", + "up": "templates:templates_special/up", + "north": "templates:templates_special/north", + "south": "templates:templates_special/south", + "west": "templates:templates_special/west", + "east": "templates:templates_special/east" + }, + "elements": [ + { + "from": [0, 0, 0], + "to": [16, 1, 16], + "faces": { + "down": { + "uv": [0, 0, 16, 16], + "texture": "#down", + "cullface": "down" + }, + "up": { + "uv": [0, 0, 16, 16], + "texture": "#up" + }, + "north": { + "uv": [0, 15, 16, 16], + "texture": "#north", + "cullface": "north" + }, + "south": { + "uv": [0, 15, 16, 16], + "texture": "#south", + "cullface": "south" + }, + "west": { + "uv": [0, 15, 16, 16], + "texture": "#west", + "cullface": "west" + }, + "east": { + "uv": [0, 15, 16, 16], + "texture": "#east", + "cullface": "east" + } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/templates/models/block/fence_gate.json b/src/main/resources/assets/templates/models/block/fence_gate.json new file mode 100644 index 0000000..275db27 --- /dev/null +++ b/src/main/resources/assets/templates/models/block/fence_gate.json @@ -0,0 +1,112 @@ +{ "parent": "block/block", + "display": { + "gui": { + "rotation": [ 30, 45, 0 ], + "translation": [ 0, -1, 0], + "scale":[ 0.8, 0.8, 0.8 ] + }, + "head": { + "rotation": [ 0, 0, 0 ], + "translation": [ 0, -3, -6], + "scale":[ 1, 1, 1] + } + }, + "textures": { + "down": "templates:templates_special/down", + "up": "templates:templates_special/up", + "north": "templates:templates_special/north", + "south": "templates:templates_special/south", + "west": "templates:templates_special/west", + "east": "templates:templates_special/east" + }, + "elements": [ + { "__comment": "Left-hand post", + "from": [ 0, 5, 7 ], + "to": [ 2, 16, 9 ], + "faces": { + "down": { "uv": [ 0, 7, 2, 9 ], "texture": "#down" }, + "up": { "uv": [ 0, 7, 2, 9 ], "texture": "#up" }, + "north": { "uv": [ 0, 0, 2, 11 ], "texture": "#north" }, + "south": { "uv": [ 0, 0, 2, 11 ], "texture": "#south" }, + "west": { "uv": [ 7, 0, 9, 11 ], "texture": "#west", "cullface": "west" }, + "east": { "uv": [ 7, 0, 9, 11 ], "texture": "#east" } + } + }, + { "__comment": "Right-hand post", + "from": [ 14, 5, 7 ], + "to": [ 16, 16, 9 ], + "faces": { + "down": { "uv": [ 14, 7, 16, 9 ], "texture": "#down" }, + "up": { "uv": [ 14, 7, 16, 9 ], "texture": "#up" }, + "north": { "uv": [ 14, 0, 16, 11 ], "texture": "#north" }, + "south": { "uv": [ 14, 0, 16, 11 ], "texture": "#south" }, + "west": { "uv": [ 7, 0, 9, 11 ], "texture": "#west" }, + "east": { "uv": [ 7, 0, 9, 11 ], "texture": "#east", "cullface": "east" } + } + }, + { "__comment": "Inner vertical post of left-hand gate door", + "from": [ 6, 6, 7 ], + "to": [ 8, 15, 9 ], + "faces": { + "down": { "uv": [ 6, 7, 8, 9 ], "texture": "#down" }, + "up": { "uv": [ 6, 7, 8, 9 ], "texture": "#up" }, + "north": { "uv": [ 6, 1, 8, 10 ], "texture": "#north" }, + "south": { "uv": [ 6, 1, 8, 10 ], "texture": "#south" }, + "west": { "uv": [ 7, 1, 9, 10 ], "texture": "#west" }, + "east": { "uv": [ 7, 1, 9, 10 ], "texture": "#east" } + } + }, + { "__comment": "Inner vertical post of right-hand gate door", + "from": [ 8, 6, 7 ], + "to": [ 10, 15, 9 ], + "faces": { + "down": { "uv": [ 8, 7, 10, 9 ], "texture": "#down" }, + "up": { "uv": [ 8, 7, 10, 9 ], "texture": "#up" }, + "north": { "uv": [ 8, 1, 10, 10 ], "texture": "#north" }, + "south": { "uv": [ 8, 1, 10, 10 ], "texture": "#south" }, + "west": { "uv": [ 7, 1, 9, 10 ], "texture": "#west" }, + "east": { "uv": [ 7, 1, 9, 10 ], "texture": "#east" } + } + }, + { "__comment": "Lower horizontal bar of left-hand gate door", + "from": [ 2, 6, 7 ], + "to": [ 6, 9, 9 ], + "faces": { + "down": { "uv": [ 2, 7, 6, 9 ], "texture": "#down" }, + "up": { "uv": [ 2, 7, 6, 9 ], "texture": "#up" }, + "north": { "uv": [ 2, 7, 6, 10 ], "texture": "#north" }, + "south": { "uv": [ 2, 7, 6, 10 ], "texture": "#south" } + } + }, + { "__comment": "Upper horizontal bar of left-hand gate door", + "from": [ 2, 12, 7 ], + "to": [ 6, 15, 9 ], + "faces": { + "down": { "uv": [ 2, 7, 6, 9 ], "texture": "#down" }, + "up": { "uv": [ 2, 7, 6, 9 ], "texture": "#up" }, + "north": { "uv": [ 2, 1, 6, 4 ], "texture": "#north" }, + "south": { "uv": [ 2, 1, 6, 4 ], "texture": "#south" } + } + }, + { "__comment": "Lower horizontal bar of right-hand gate door", + "from": [ 10, 6, 7 ], + "to": [ 14, 9, 9 ], + "faces": { + "down": { "uv": [ 10, 7, 14, 9 ], "texture": "#down" }, + "up": { "uv": [ 10, 7, 14, 9 ], "texture": "#up" }, + "north": { "uv": [ 10, 7, 14, 10 ], "texture": "#north" }, + "south": { "uv": [ 10, 7, 14, 10 ], "texture": "#south" } + } + }, + { "__comment": "Upper horizontal bar of right-hand gate door", + "from": [ 10, 12, 7 ], + "to": [ 14, 15, 9 ], + "faces": { + "down": { "uv": [ 10, 7, 14, 9 ], "texture": "#down" }, + "up": { "uv": [ 10, 7, 14, 9 ], "texture": "#up" }, + "north": { "uv": [ 10, 1, 14, 4 ], "texture": "#north" }, + "south": { "uv": [ 10, 1, 14, 4 ], "texture": "#south" } + } + } + ] +} diff --git a/src/main/resources/assets/templates/models/block/fence_gate_open.json b/src/main/resources/assets/templates/models/block/fence_gate_open.json new file mode 100644 index 0000000..dfe6ac8 --- /dev/null +++ b/src/main/resources/assets/templates/models/block/fence_gate_open.json @@ -0,0 +1,100 @@ +{ + "textures": { + "down": "templates:templates_special/down", + "up": "templates:templates_special/up", + "north": "templates:templates_special/north", + "south": "templates:templates_special/south", + "west": "templates:templates_special/west", + "east": "templates:templates_special/east" + }, + "elements": [ + { "__comment": "Left-hand post", + "from": [ 0, 5, 7 ], + "to": [ 2, 16, 9 ], + "faces": { + "down": { "uv": [ 0, 7, 2, 9 ], "texture": "#down" }, + "up": { "uv": [ 0, 7, 2, 9 ], "texture": "#up" }, + "north": { "uv": [ 0, 0, 2, 11 ], "texture": "#north" }, + "south": { "uv": [ 0, 0, 2, 11 ], "texture": "#south" }, + "west": { "uv": [ 7, 0, 9, 11 ], "texture": "#west", "cullface": "west" }, + "east": { "uv": [ 7, 0, 9, 11 ], "texture": "#east" } + } + }, + { "__comment": "Right-hand post", + "from": [ 14, 5, 7 ], + "to": [ 16, 16, 9 ], + "faces": { + "down": { "uv": [ 14, 7, 16, 9 ], "texture": "#down" }, + "up": { "uv": [ 14, 7, 16, 9 ], "texture": "#up" }, + "north": { "uv": [ 14, 0, 16, 11 ], "texture": "#north" }, + "south": { "uv": [ 14, 0, 16, 11 ], "texture": "#south" }, + "west": { "uv": [ 7, 0, 9, 11 ], "texture": "#west" }, + "east": { "uv": [ 7, 0, 9, 11 ], "texture": "#east", "cullface": "east" } + } + }, + { "__comment": "Inner vertical post of left-hand gate door", + "from": [ 0, 6, 13 ], + "to": [ 2, 15, 15 ], + "faces": { + "down": { "uv": [ 0, 13, 2, 15 ], "texture": "#down" }, + "up": { "uv": [ 0, 13, 2, 15 ], "texture": "#up" }, + "north": { "uv": [ 0, 1, 2, 10 ], "texture": "#north" }, + "south": { "uv": [ 0, 1, 2, 10 ], "texture": "#south" }, + "west": { "uv": [ 13, 1, 15, 10 ], "texture": "#west" }, + "east": { "uv": [ 13, 1, 15, 10 ], "texture": "#east" } + } + }, + { "__comment": "Inner vertical post of right-hand gate door", + "from": [ 14, 6, 13 ], + "to": [ 16, 15, 15 ], + "faces": { + "down": { "uv": [ 14, 13, 16, 15 ], "texture": "#down" }, + "up": { "uv": [ 14, 13, 16, 15 ], "texture": "#up" }, + "north": { "uv": [ 14, 1, 16, 10 ], "texture": "#north" }, + "south": { "uv": [ 14, 1, 16, 10 ], "texture": "#south" }, + "west": { "uv": [ 13, 1, 15, 10 ], "texture": "#west" }, + "east": { "uv": [ 13, 1, 15, 10 ], "texture": "#east" } + } + }, + { "__comment": "Lower horizontal bar of left-hand gate door", + "from": [ 0, 6, 9 ], + "to": [ 2, 9, 13 ], + "faces": { + "down": { "uv": [ 0, 9, 2, 13 ], "texture": "#down" }, + "up": { "uv": [ 0, 9, 2, 13 ], "texture": "#up" }, + "west": { "uv": [ 13, 7, 15, 10 ], "texture": "#north" }, + "east": { "uv": [ 13, 7, 15, 10 ], "texture": "#south" } + } + }, + { "__comment": "Upper horizontal bar of left-hand gate door", + "from": [ 0, 12, 9 ], + "to": [ 2, 15, 13 ], + "faces": { + "down": { "uv": [ 0, 9, 2, 13 ], "texture": "#down" }, + "up": { "uv": [ 0, 9, 2, 13 ], "texture": "#up" }, + "west": { "uv": [ 13, 1, 15, 4 ], "texture": "#north" }, + "east": { "uv": [ 13, 1, 15, 4 ], "texture": "#south" } + } + }, + { "__comment": "Lower horizontal bar of left-hand gate door", + "from": [ 14, 6, 9 ], + "to": [ 16, 9, 13 ], + "faces": { + "down": { "uv": [ 14, 9, 16, 13 ], "texture": "#down" }, + "up": { "uv": [ 14, 9, 16, 13 ], "texture": "#up" }, + "west": { "uv": [ 13, 7, 15, 10 ], "texture": "#north" }, + "east": { "uv": [ 13, 7, 15, 10 ], "texture": "#south" } + } + }, + { "__comment": "Upper horizontal bar of left-hand gate door", + "from": [ 14, 12, 9 ], + "to": [ 16, 15, 13 ], + "faces": { + "down": { "uv": [ 14, 9, 16, 13 ], "texture": "#down" }, + "up": { "uv": [ 14, 9, 16, 13 ], "texture": "#up" }, + "west": { "uv": [ 13, 1, 15, 4 ], "texture": "#north" }, + "east": { "uv": [ 13, 1, 15, 4 ], "texture": "#south" } + } + } + ] +} diff --git a/src/main/resources/assets/templates/models/block/fence_gate_wall.json b/src/main/resources/assets/templates/models/block/fence_gate_wall.json new file mode 100644 index 0000000..a900283 --- /dev/null +++ b/src/main/resources/assets/templates/models/block/fence_gate_wall.json @@ -0,0 +1,101 @@ +{ + "ambientocclusion": true, + "textures": { + "down": "templates:templates_special/down", + "up": "templates:templates_special/up", + "north": "templates:templates_special/north", + "south": "templates:templates_special/south", + "west": "templates:templates_special/west", + "east": "templates:templates_special/east" + }, + "elements": [ + { "__comment": "Left-hand post", + "from": [ 0, 2, 7 ], + "to": [ 2, 13, 9 ], + "faces": { + "down": { "uv": [ 0, 7, 2, 9 ], "texture": "#down" }, + "up": { "uv": [ 0, 7, 2, 9 ], "texture": "#up" }, + "north": { "uv": [ 0, 0, 2, 11 ], "texture": "#north" }, + "south": { "uv": [ 0, 0, 2, 11 ], "texture": "#south" }, + "west": { "uv": [ 7, 0, 9, 11 ], "texture": "#west", "cullface": "west" }, + "east": { "uv": [ 7, 0, 9, 11 ], "texture": "#east" } + } + }, + { "__comment": "Right-hand post", + "from": [ 14, 2, 7 ], + "to": [ 16, 13, 9 ], + "faces": { + "down": { "uv": [ 14, 7, 16, 9 ], "texture": "#down" }, + "up": { "uv": [ 14, 7, 16, 9 ], "texture": "#up" }, + "north": { "uv": [ 14, 0, 16, 11 ], "texture": "#north" }, + "south": { "uv": [ 14, 0, 16, 11 ], "texture": "#south" }, + "west": { "uv": [ 7, 0, 9, 11 ], "texture": "#west" }, + "east": { "uv": [ 7, 0, 9, 11 ], "texture": "#east", "cullface": "east" } + } + }, + { "__comment": "Inner vertical post of left-hand gate door", + "from": [ 6, 3, 7 ], + "to": [ 8, 12, 9 ], + "faces": { + "down": { "uv": [ 6, 7, 8, 9 ], "texture": "#down" }, + "up": { "uv": [ 6, 7, 8, 9 ], "texture": "#up" }, + "north": { "uv": [ 6, 1, 8, 10 ], "texture": "#north" }, + "south": { "uv": [ 6, 1, 8, 10 ], "texture": "#south" }, + "west": { "uv": [ 7, 1, 9, 10 ], "texture": "#west" }, + "east": { "uv": [ 7, 1, 9, 10 ], "texture": "#east" } + } + }, + { "__comment": "Inner vertical post of right-hand gate door", + "from": [ 8, 3, 7 ], + "to": [ 10, 12, 9 ], + "faces": { + "down": { "uv": [ 8, 7, 10, 9 ], "texture": "#down" }, + "up": { "uv": [ 8, 7, 10, 9 ], "texture": "#up" }, + "north": { "uv": [ 8, 1, 10, 10 ], "texture": "#north" }, + "south": { "uv": [ 8, 1, 10, 10 ], "texture": "#south" }, + "west": { "uv": [ 7, 1, 9, 10 ], "texture": "#west" }, + "east": { "uv": [ 7, 1, 9, 10 ], "texture": "#east" } + } + }, + { "__comment": "Lower horizontal bar of left-hand gate door", + "from": [ 2, 3, 7 ], + "to": [ 6, 6, 9 ], + "faces": { + "down": { "uv": [ 2, 7, 6, 9 ], "texture": "#down" }, + "up": { "uv": [ 2, 7, 6, 9 ], "texture": "#up" }, + "north": { "uv": [ 2, 7, 6, 10 ], "texture": "#north" }, + "south": { "uv": [ 2, 7, 6, 10 ], "texture": "#south" } + } + }, + { "__comment": "Upper horizontal bar of left-hand gate door", + "from": [ 2, 9, 7 ], + "to": [ 6, 12, 9 ], + "faces": { + "down": { "uv": [ 2, 7, 6, 9 ], "texture": "#down" }, + "up": { "uv": [ 2, 7, 6, 9 ], "texture": "#up" }, + "north": { "uv": [ 2, 1, 6, 4 ], "texture": "#north" }, + "south": { "uv": [ 2, 1, 6, 4 ], "texture": "#south" } + } + }, + { "__comment": "Lower horizontal bar of right-hand gate door", + "from": [ 10, 3, 7 ], + "to": [ 14, 6, 9 ], + "faces": { + "down": { "uv": [ 10, 7, 14, 9 ], "texture": "#down" }, + "up": { "uv": [ 10, 7, 14, 9 ], "texture": "#up" }, + "north": { "uv": [ 10, 7, 14, 10 ], "texture": "#north" }, + "south": { "uv": [ 10, 7, 14, 10 ], "texture": "#south" } + } + }, + { "__comment": "Upper horizontal bar of right-hand gate door", + "from": [ 10, 9, 7 ], + "to": [ 14, 12, 9 ], + "faces": { + "down": { "uv": [ 10, 7, 14, 9 ], "texture": "#down" }, + "up": { "uv": [ 10, 7, 14, 9 ], "texture": "#up" }, + "north": { "uv": [ 10, 1, 14, 4 ], "texture": "#north" }, + "south": { "uv": [ 10, 1, 14, 4 ], "texture": "#south" } + } + } + ] +} diff --git a/src/main/resources/assets/templates/models/block/fence_gate_wall_open.json b/src/main/resources/assets/templates/models/block/fence_gate_wall_open.json new file mode 100644 index 0000000..a45b9f1 --- /dev/null +++ b/src/main/resources/assets/templates/models/block/fence_gate_wall_open.json @@ -0,0 +1,101 @@ +{ + "ambientocclusion": true, + "textures": { + "down": "templates:templates_special/down", + "up": "templates:templates_special/up", + "north": "templates:templates_special/north", + "south": "templates:templates_special/south", + "west": "templates:templates_special/west", + "east": "templates:templates_special/east" + }, + "elements": [ + { "__comment": "Left-hand post", + "from": [ 0, 2, 7 ], + "to": [ 2, 13, 9 ], + "faces": { + "down": { "uv": [ 0, 7, 2, 9 ], "texture": "#down" }, + "up": { "uv": [ 0, 7, 2, 9 ], "texture": "#up" }, + "north": { "uv": [ 0, 0, 2, 11 ], "texture": "#north" }, + "south": { "uv": [ 0, 0, 2, 11 ], "texture": "#south" }, + "west": { "uv": [ 7, 0, 9, 11 ], "texture": "#west", "cullface": "west" }, + "east": { "uv": [ 7, 0, 9, 11 ], "texture": "#east" } + } + }, + { "__comment": "Right-hand post", + "from": [ 14, 2, 7 ], + "to": [ 16, 13, 9 ], + "faces": { + "down": { "uv": [ 14, 7, 16, 9 ], "texture": "#down" }, + "up": { "uv": [ 14, 7, 16, 9 ], "texture": "#up" }, + "north": { "uv": [ 14, 0, 16, 11 ], "texture": "#north" }, + "south": { "uv": [ 14, 0, 16, 11 ], "texture": "#south" }, + "west": { "uv": [ 7, 0, 9, 11 ], "texture": "#west" }, + "east": { "uv": [ 7, 0, 9, 11 ], "texture": "#east", "cullface": "east" } + } + }, + { "__comment": "Inner vertical post of left-hand gate door", + "from": [ 0, 3, 13 ], + "to": [ 2, 12, 15 ], + "faces": { + "down": { "uv": [ 0, 13, 2, 15 ], "texture": "#down" }, + "up": { "uv": [ 0, 13, 2, 15 ], "texture": "#up" }, + "north": { "uv": [ 0, 1, 2, 10 ], "texture": "#north" }, + "south": { "uv": [ 0, 1, 2, 10 ], "texture": "#south" }, + "west": { "uv": [ 13, 1, 15, 10 ], "texture": "#west" }, + "east": { "uv": [ 13, 1, 15, 10 ], "texture": "#east" } + } + }, + { "__comment": "Inner vertical post of right-hand gate door", + "from": [ 14, 3, 13 ], + "to": [ 16, 12, 15 ], + "faces": { + "down": { "uv": [ 14, 13, 16, 15 ], "texture": "#down" }, + "up": { "uv": [ 14, 13, 16, 15 ], "texture": "#up" }, + "north": { "uv": [ 14, 1, 16, 10 ], "texture": "#north" }, + "south": { "uv": [ 14, 1, 16, 10 ], "texture": "#south" }, + "west": { "uv": [ 13, 1, 15, 10 ], "texture": "#west" }, + "east": { "uv": [ 13, 1, 15, 10 ], "texture": "#east" } + } + }, + { "__comment": "Lower horizontal bar of left-hand gate door", + "from": [ 0, 3, 9 ], + "to": [ 2, 6, 13 ], + "faces": { + "down": { "uv": [ 0, 9, 2, 13 ], "texture": "#down" }, + "up": { "uv": [ 0, 9, 2, 13 ], "texture": "#up" }, + "west": { "uv": [ 13, 7, 15, 10 ], "texture": "#north" }, + "east": { "uv": [ 13, 7, 15, 10 ], "texture": "#south" } + } + }, + { "__comment": "Upper horizontal bar of left-hand gate door", + "from": [ 0, 9, 9 ], + "to": [ 2, 12, 13 ], + "faces": { + "down": { "uv": [ 0, 9, 2, 13 ], "texture": "#down" }, + "up": { "uv": [ 0, 9, 2, 13 ], "texture": "#up" }, + "west": { "uv": [ 13, 1, 15, 4 ], "texture": "#north" }, + "east": { "uv": [ 13, 1, 15, 4 ], "texture": "#south" } + } + }, + { "__comment": "Lower horizontal bar of left-hand gate door", + "from": [ 14, 3, 9 ], + "to": [ 16, 6, 13 ], + "faces": { + "down": { "uv": [ 14, 9, 16, 13 ], "texture": "#down" }, + "up": { "uv": [ 14, 9, 16, 13 ], "texture": "#up" }, + "west": { "uv": [ 13, 7, 15, 10 ], "texture": "#north" }, + "east": { "uv": [ 13, 7, 15, 10 ], "texture": "#south" } + } + }, + { "__comment": "Upper horizontal bar of left-hand gate door", + "from": [ 14, 9, 9 ], + "to": [ 16, 12, 13 ], + "faces": { + "down": { "uv": [ 14, 9, 16, 13 ], "texture": "#down" }, + "up": { "uv": [ 14, 9, 16, 13 ], "texture": "#up" }, + "west": { "uv": [ 13, 1, 15, 4 ], "texture": "#north" }, + "east": { "uv": [ 13, 1, 15, 4 ], "texture": "#south" } + } + } + ] +} diff --git a/src/main/resources/assets/templates/models/block/lever.json b/src/main/resources/assets/templates/models/block/lever.json new file mode 100644 index 0000000..37b4fcf --- /dev/null +++ b/src/main/resources/assets/templates/models/block/lever.json @@ -0,0 +1,77 @@ +{ + "parent": "block/block", + "ambientocclusion": false, + "textures": { + "down": "templates:templates_special/down", + "up": "templates:templates_special/up", + "north": "templates:templates_special/north", + "south": "templates:templates_special/south", + "west": "templates:templates_special/west", + "east": "templates:templates_special/east", + "lever": "block/lever" + }, + "elements": [ + { + "from": [5, -0.02, 4], + "to": [11, 2.98, 12], + "faces": { + "down": { + "uv": [5, 4, 11, 12], + "texture": "#down", + "cullface": "down" + }, + "up": { + "uv": [5, 4, 11, 12], + "texture": "#up" + }, + "north": { + "uv": [5, 0, 11, 3], + "texture": "#north" + }, + "south": { + "uv": [5, 0, 11, 3], + "texture": "#south" + }, + "west": { + "uv": [4, 0, 12, 3], + "texture": "#west" + }, + "east": { + "uv": [4, 0, 12, 3], + "texture": "#east" + } + } + }, + { + "from": [7, 1, 7], + "to": [9, 11, 9], + "rotation": { + "origin": [8, 1, 8], + "axis": "x", + "angle": -45 + }, + "faces": { + "up": { + "uv": [7, 6, 9, 8], + "texture": "#lever" + }, + "north": { + "uv": [7, 6, 9, 16], + "texture": "#lever" + }, + "south": { + "uv": [7, 6, 9, 16], + "texture": "#lever" + }, + "west": { + "uv": [7, 6, 9, 16], + "texture": "#lever" + }, + "east": { + "uv": [7, 6, 9, 16], + "texture": "#lever" + } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/templates/models/block/lever_on.json b/src/main/resources/assets/templates/models/block/lever_on.json new file mode 100644 index 0000000..0ca3d97 --- /dev/null +++ b/src/main/resources/assets/templates/models/block/lever_on.json @@ -0,0 +1,77 @@ +{ + "parent": "block/block", + "ambientocclusion": false, + "textures": { + "down": "templates:templates_special/down", + "up": "templates:templates_special/up", + "north": "templates:templates_special/north", + "south": "templates:templates_special/south", + "west": "templates:templates_special/west", + "east": "templates:templates_special/east", + "lever": "block/lever" + }, + "elements": [ + { + "from": [5, -0.02, 4], + "to": [11, 2.98, 12], + "faces": { + "down": { + "uv": [5, 4, 11, 12], + "texture": "#down", + "cullface": "down" + }, + "up": { + "uv": [5, 4, 11, 12], + "texture": "#up" + }, + "north": { + "uv": [5, 0, 11, 3], + "texture": "#north" + }, + "south": { + "uv": [5, 0, 11, 3], + "texture": "#south" + }, + "west": { + "uv": [4, 0, 12, 3], + "texture": "#west" + }, + "east": { + "uv": [4, 0, 12, 3], + "texture": "#east" + } + } + }, + { + "from": [7, 1, 7], + "to": [9, 11, 9], + "rotation": { + "origin": [8, 1, 8], + "axis": "x", + "angle": 45 + }, + "faces": { + "up": { + "uv": [7, 6, 9, 8], + "texture": "#lever" + }, + "north": { + "uv": [7, 6, 9, 16], + "texture": "#lever" + }, + "south": { + "uv": [7, 6, 9, 16], + "texture": "#lever" + }, + "west": { + "uv": [7, 6, 9, 16], + "texture": "#lever" + }, + "east": { + "uv": [7, 6, 9, 16], + "texture": "#lever" + } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/templates/models/block/pressure_plate_down.json b/src/main/resources/assets/templates/models/block/pressure_plate_down.json new file mode 100644 index 0000000..186a491 --- /dev/null +++ b/src/main/resources/assets/templates/models/block/pressure_plate_down.json @@ -0,0 +1,44 @@ +{ + "parent": "minecraft:block/thin_block", + "textures": { + "down": "templates:templates_special/down", + "up": "templates:templates_special/up", + "north": "templates:templates_special/north", + "south": "templates:templates_special/south", + "west": "templates:templates_special/west", + "east": "templates:templates_special/east" + }, + "elements": [ + { + "from": [1, 0, 1], + "to": [15, 0.5, 15], + "faces": { + "down": { + "uv": [1, 1, 15, 15], + "texture": "#down", + "cullface": "down" + }, + "up": { + "uv": [1, 1, 15, 15], + "texture": "#up" + }, + "north": { + "uv": [1, 15, 15, 15.5], + "texture": "#north" + }, + "south": { + "uv": [1, 15, 15, 15.5], + "texture": "#south" + }, + "west": { + "uv": [1, 15, 15, 15.5], + "texture": "#west" + }, + "east": { + "uv": [1, 15, 15, 15.5], + "texture": "#east" + } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/templates/models/block/pressure_plate_up.json b/src/main/resources/assets/templates/models/block/pressure_plate_up.json new file mode 100644 index 0000000..1987c1f --- /dev/null +++ b/src/main/resources/assets/templates/models/block/pressure_plate_up.json @@ -0,0 +1,44 @@ +{ + "parent": "minecraft:block/thin_block", + "textures": { + "down": "templates:templates_special/down", + "up": "templates:templates_special/up", + "north": "templates:templates_special/north", + "south": "templates:templates_special/south", + "west": "templates:templates_special/west", + "east": "templates:templates_special/east" + }, + "elements": [ + { + "from": [1, 0, 1], + "to": [15, 1, 15], + "faces": { + "down": { + "uv": [1, 1, 15, 15], + "texture": "#down", + "cullface": "down" + }, + "up": { + "uv": [1, 1, 15, 15], + "texture": "#up" + }, + "north": { + "uv": [1, 15, 15, 16], + "texture": "#north" + }, + "south": { + "uv": [1, 15, 15, 16], + "texture": "#south" + }, + "west": { + "uv": [1, 15, 15, 16], + "texture": "#west" + }, + "east": { + "uv": [1, 15, 15, 16], + "texture": "#east" + } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/blocks/fence_gates.json b/src/main/resources/data/minecraft/tags/blocks/fence_gates.json new file mode 100644 index 0000000..c0df1ae --- /dev/null +++ b/src/main/resources/data/minecraft/tags/blocks/fence_gates.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "templates:fence_gate" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/blocks/wooden_buttons.json b/src/main/resources/data/minecraft/tags/blocks/wooden_buttons.json new file mode 100644 index 0000000..9bfa516 --- /dev/null +++ b/src/main/resources/data/minecraft/tags/blocks/wooden_buttons.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "templates:button" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/blocks/wool_carpets.json b/src/main/resources/data/minecraft/tags/blocks/wool_carpets.json new file mode 100644 index 0000000..86d520d --- /dev/null +++ b/src/main/resources/data/minecraft/tags/blocks/wool_carpets.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "templates:carpet" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/templates/advancements/recipes/decorations/templates.json b/src/main/resources/data/templates/advancements/recipes/decorations/templates.json index a1e16cf..1ff4d06 100644 --- a/src/main/resources/data/templates/advancements/recipes/decorations/templates.json +++ b/src/main/resources/data/templates/advancements/recipes/decorations/templates.json @@ -2,8 +2,11 @@ "parent": "minecraft:recipes/root", "rewards": { "recipes": [ + "templates:button", + "templates:carpet", "templates:cube", "templates:fence", + "templates:fence_gate", "templates:post", "templates:slab", "templates:slope", diff --git a/src/main/resources/data/templates/loot_tables/blocks/carpet.json b/src/main/resources/data/templates/loot_tables/blocks/carpet.json new file mode 100644 index 0000000..22331de --- /dev/null +++ b/src/main/resources/data/templates/loot_tables/blocks/carpet.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "templates:carpet" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/templates/loot_tables/blocks/fence_gate.json b/src/main/resources/data/templates/loot_tables/blocks/fence_gate.json new file mode 100644 index 0000000..ccebdb8 --- /dev/null +++ b/src/main/resources/data/templates/loot_tables/blocks/fence_gate.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "templates:fence_gate" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/templates/loot_tables/blocks/lever.json b/src/main/resources/data/templates/loot_tables/blocks/lever.json new file mode 100644 index 0000000..2e0fec2 --- /dev/null +++ b/src/main/resources/data/templates/loot_tables/blocks/lever.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "templates:lever" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/templates/loot_tables/blocks/pressure_plate.json b/src/main/resources/data/templates/loot_tables/blocks/pressure_plate.json new file mode 100644 index 0000000..a4e49ae --- /dev/null +++ b/src/main/resources/data/templates/loot_tables/blocks/pressure_plate.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "templates:pressure_plate" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/templates/recipes/button.json b/src/main/resources/data/templates/recipes/button.json new file mode 100644 index 0000000..58d5d75 --- /dev/null +++ b/src/main/resources/data/templates/recipes/button.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "~", + "I" + ], + "key": { + "I": { + "item": "minecraft:bamboo" + }, + "~": { + "item": "minecraft:string" + } + }, + "result": { + "item": "templates:button", + "count": 1 + }, + "group": "templates" +} \ No newline at end of file diff --git a/src/main/resources/data/templates/recipes/carpet.json b/src/main/resources/data/templates/recipes/carpet.json new file mode 100644 index 0000000..19f4398 --- /dev/null +++ b/src/main/resources/data/templates/recipes/carpet.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "~~", + "II" + ], + "key": { + "I": { + "item": "minecraft:bamboo" + }, + "~": { + "item": "minecraft:string" + } + }, + "result": { + "item": "templates:carpet", + "count": 12 + }, + "group": "templates" +} \ No newline at end of file diff --git a/src/main/resources/data/templates/recipes/fence_gate.json b/src/main/resources/data/templates/recipes/fence_gate.json new file mode 100644 index 0000000..246e3cd --- /dev/null +++ b/src/main/resources/data/templates/recipes/fence_gate.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "~I~", + "~I~" + ], + "key": { + "I": { + "item": "minecraft:bamboo" + }, + "~": { + "item": "minecraft:string" + } + }, + "result": { + "item": "templates:fence_gate", + "count": 2 + }, + "group": "templates" +} \ No newline at end of file diff --git a/src/main/resources/data/templates/recipes/lever.json b/src/main/resources/data/templates/recipes/lever.json new file mode 100644 index 0000000..dc18f62 --- /dev/null +++ b/src/main/resources/data/templates/recipes/lever.json @@ -0,0 +1,24 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "~", + "I", + "C" + ], + "key": { + "I": { + "item": "minecraft:bamboo" + }, + "~": { + "item": "minecraft:string" + }, + "C": { + "item": "minecraft:cobblestone" + } + }, + "result": { + "item": "templates:lever", + "count": 1 + }, + "group": "templates" +} \ No newline at end of file diff --git a/src/main/resources/data/templates/recipes/pressure_plate.json b/src/main/resources/data/templates/recipes/pressure_plate.json new file mode 100644 index 0000000..9e155e2 --- /dev/null +++ b/src/main/resources/data/templates/recipes/pressure_plate.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "~ ", + "II" + ], + "key": { + "I": { + "item": "minecraft:bamboo" + }, + "~": { + "item": "minecraft:string" + } + }, + "result": { + "item": "templates:pressure_plate", + "count": 1 + }, + "group": "templates" +} \ No newline at end of file