Compare commits

...

7 Commits

27 changed files with 233 additions and 154 deletions

View File

@ -6,8 +6,8 @@ import net.minecraft.block.enums.DoorHinge;
import net.minecraft.block.enums.DoubleBlockHalf;
import net.minecraft.util.math.Direction;
public class CherryDoor extends DoorBlock{
public CherryDoor(Settings settings) {
public class CherryDoorBlock extends DoorBlock{
public CherryDoorBlock(Settings settings) {
super(settings);
this.setDefaultState((BlockState)((BlockState)((BlockState)((BlockState)((BlockState)((BlockState)this.stateManager.getDefaultState()).with(FACING, Direction.NORTH)).with(OPEN, false)).with(HINGE, DoorHinge.LEFT)).with(POWERED, false)).with(HALF, DoubleBlockHalf.LOWER));
}

View File

@ -0,0 +1,15 @@
package net.parsell.cherry.common.blocks;
import net.minecraft.block.BlockState;
import net.minecraft.block.TrapdoorBlock;
import net.minecraft.block.enums.BlockHalf;
import net.minecraft.util.math.Direction;
public class CherryTrapdoorBlock extends TrapdoorBlock{
public CherryTrapdoorBlock(Settings settings) {
super(settings);
this.setDefaultState((BlockState)((BlockState)((BlockState)((BlockState)((BlockState)((BlockState)this.stateManager.getDefaultState()).with(FACING, Direction.NORTH)).with(OPEN, false)).with(HALF, BlockHalf.BOTTOM)).with(POWERED, false)).with(WATERLOGGED, false));
}
}

View File

@ -12,10 +12,12 @@ import net.minecraft.block.FenceBlock;
import net.minecraft.block.FenceGateBlock;
import net.minecraft.block.LeavesBlock;
import net.minecraft.block.PillarBlock;
import net.minecraft.block.SlabBlock;
import net.minecraft.client.render.RenderLayer;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;
import net.parsell.cherry.common.blocks.CherryDoor;
import net.parsell.cherry.common.blocks.CherryDoorBlock;
import net.parsell.cherry.common.blocks.CherryTrapdoorBlock;
import net.parsell.cherry.mixin.AxeItemAccessor;
public class CherryBlocks {
@ -29,7 +31,9 @@ public class CherryBlocks {
public static final Block CHERRYPLANKS = registerBlock("cherry_planks", FabricBlockSettings.copyOf(Blocks.OAK_PLANKS), 5, 20);
public static final Block CHERRYFENCE = registerFence("cherry_fence", FabricBlockSettings.copyOf(Blocks.OAK_FENCE), 5, 20); // TODO: Textures, tags (as required)
public static final Block CHERRYFENCEGATE = registerFenceGate("cherry_fence_gate", FabricBlockSettings.copyOf(Blocks.OAK_FENCE_GATE), 5, 20); // Textures, recipe, loot_tables, tags (as required)
public static final Block CHERRYDOOR = registerDoor("cherry_door", FabricBlockSettings.copyOf(Blocks.OAK_DOOR), 5, 20); // TODO: Textures, recipe, loot_tables, tags (as required)
public static final Block CHERRYDOOR = registerDoor("cherry_door", FabricBlockSettings.copyOf(Blocks.OAK_DOOR), 5, 20); // TODO: recipe, loot_tables, tags (as required)
public static final Block CHERRYTRAPDOOR = registerTrapDoor("cherry_trapdoor", FabricBlockSettings.copyOf(Blocks.OAK_TRAPDOOR), 5, 20); //TODO: recipe, loot_tables, tags (as required)
public static final Block CHERRYSLAB = registerSlab("cherry_slab", FabricBlockSettings.copyOf(Blocks.OAK_SLAB), 5, 20); // TODO: recipe, loot tables, tags (as required)
private static Block registerBlock(String blockID, FabricBlockSettings settings, int burnChance, int burnSpread) {
Block block = new Block(settings);
@ -38,6 +42,13 @@ public class CherryBlocks {
return block;
}
private static Block registerSlab(String blockID, FabricBlockSettings settings, int burnChance, int burnSpread) {
Block block = new SlabBlock(settings);
Registry.register(Registry.BLOCK, new Identifier("cherry", blockID), block);
FlammableBlockRegistry.getDefaultInstance().add(block, burnChance, burnSpread);
return block;
}
private static Block registerFence(String blockID, FabricBlockSettings settings, int burnChance, int burnSpread) {
Block block = new FenceBlock(settings);
Registry.register(Registry.BLOCK, new Identifier("cherry", blockID), block);
@ -78,7 +89,15 @@ public class CherryBlocks {
}
private static Block registerDoor(String blockID, FabricBlockSettings settings, int burnChance, int burnSpread){
Block block = new CherryDoor(settings);
Block block = new CherryDoorBlock(settings);
Registry.register(Registry.BLOCK, new Identifier("cherry", blockID), block);
FlammableBlockRegistry.getDefaultInstance().add(block, burnChance, burnSpread);
BlockRenderLayerMap.INSTANCE.putBlock(block, RenderLayer.getCutout());
return block;
}
private static Block registerTrapDoor(String blockID, FabricBlockSettings settings, int burnChance, int burnSpread){
Block block = new CherryTrapdoorBlock(settings);
Registry.register(Registry.BLOCK, new Identifier("cherry", blockID), block);
FlammableBlockRegistry.getDefaultInstance().add(block, burnChance, burnSpread);
BlockRenderLayerMap.INSTANCE.putBlock(block, RenderLayer.getCutout());
@ -94,4 +113,4 @@ public class CherryBlocks {
// Register unique logs
AxeItemAccessor.setStrippedLogs(STRIPPABLE_BLOCKS.build());
}
}
}

View File

@ -19,6 +19,8 @@ public class CherryItems {
registerBlockItem("cherry_fence", CherryBlocks.CHERRYFENCE, ItemGroup.BUILDING_BLOCKS);
registerBlockItem("cherry_fence_gate", CherryBlocks.CHERRYFENCEGATE, ItemGroup.BUILDING_BLOCKS);
registerBlockItem("cherry_door", CherryBlocks.CHERRYDOOR, ItemGroup.BUILDING_BLOCKS);
registerBlockItem("cherry_trapdoor", CherryBlocks.CHERRYTRAPDOOR, ItemGroup.BUILDING_BLOCKS);
registerBlockItem("cherry_slab", CherryBlocks.CHERRYSLAB, ItemGroup.BUILDING_BLOCKS);
}
// Register a standard blockItem

View File

@ -1,124 +1,36 @@
{
"variants": {
"facing=east,half=lower,hinge=left,open=false": {
"model": "minecraft:block/oak_door_bottom"
},
"facing=east,half=lower,hinge=left,open=true": {
"model": "minecraft:block/oak_door_bottom_hinge",
"y": 90
},
"facing=east,half=lower,hinge=right,open=false": {
"model": "minecraft:block/oak_door_bottom_hinge"
},
"facing=east,half=lower,hinge=right,open=true": {
"model": "minecraft:block/oak_door_bottom",
"y": 270
},
"facing=east,half=upper,hinge=left,open=false": {
"model": "minecraft:block/oak_door_top"
},
"facing=east,half=upper,hinge=left,open=true": {
"model": "minecraft:block/oak_door_top_hinge",
"y": 90
},
"facing=east,half=upper,hinge=right,open=false": {
"model": "minecraft:block/oak_door_top_hinge"
},
"facing=east,half=upper,hinge=right,open=true": {
"model": "minecraft:block/oak_door_top",
"y": 270
},
"facing=north,half=lower,hinge=left,open=false": {
"model": "minecraft:block/oak_door_bottom",
"y": 270
},
"facing=north,half=lower,hinge=left,open=true": {
"model": "minecraft:block/oak_door_bottom_hinge"
},
"facing=north,half=lower,hinge=right,open=false": {
"model": "minecraft:block/oak_door_bottom_hinge",
"y": 270
},
"facing=north,half=lower,hinge=right,open=true": {
"model": "minecraft:block/oak_door_bottom",
"y": 180
},
"facing=north,half=upper,hinge=left,open=false": {
"model": "minecraft:block/oak_door_top",
"y": 270
},
"facing=north,half=upper,hinge=left,open=true": {
"model": "minecraft:block/oak_door_top_hinge"
},
"facing=north,half=upper,hinge=right,open=false": {
"model": "minecraft:block/oak_door_top_hinge",
"y": 270
},
"facing=north,half=upper,hinge=right,open=true": {
"model": "minecraft:block/oak_door_top",
"y": 180
},
"facing=south,half=lower,hinge=left,open=false": {
"model": "minecraft:block/oak_door_bottom",
"y": 90
},
"facing=south,half=lower,hinge=left,open=true": {
"model": "minecraft:block/oak_door_bottom_hinge",
"y": 180
},
"facing=south,half=lower,hinge=right,open=false": {
"model": "minecraft:block/oak_door_bottom_hinge",
"y": 90
},
"facing=south,half=lower,hinge=right,open=true": {
"model": "minecraft:block/oak_door_bottom"
},
"facing=south,half=upper,hinge=left,open=false": {
"model": "minecraft:block/oak_door_top",
"y": 90
},
"facing=south,half=upper,hinge=left,open=true": {
"model": "minecraft:block/oak_door_top_hinge",
"y": 180
},
"facing=south,half=upper,hinge=right,open=false": {
"model": "minecraft:block/oak_door_top_hinge",
"y": 90
},
"facing=south,half=upper,hinge=right,open=true": {
"model": "minecraft:block/oak_door_top"
},
"facing=west,half=lower,hinge=left,open=false": {
"model": "minecraft:block/oak_door_bottom",
"y": 180
},
"facing=west,half=lower,hinge=left,open=true": {
"model": "minecraft:block/oak_door_bottom_hinge",
"y": 270
},
"facing=west,half=lower,hinge=right,open=false": {
"model": "minecraft:block/oak_door_bottom_hinge",
"y": 180
},
"facing=west,half=lower,hinge=right,open=true": {
"model": "minecraft:block/oak_door_bottom",
"y": 90
},
"facing=west,half=upper,hinge=left,open=false": {
"model": "minecraft:block/oak_door_top",
"y": 180
},
"facing=west,half=upper,hinge=left,open=true": {
"model": "minecraft:block/oak_door_top_hinge",
"y": 270
},
"facing=west,half=upper,hinge=right,open=false": {
"model": "minecraft:block/oak_door_top_hinge",
"y": 180
},
"facing=west,half=upper,hinge=right,open=true": {
"model": "minecraft:block/oak_door_top",
"y": 90
}
}
}
"variants": {
"facing=east,half=lower,hinge=left,open=false": { "model": "cherry:block/cherry_door_bottom" },
"facing=south,half=lower,hinge=left,open=false": { "model": "cherry:block/cherry_door_bottom", "y": 90 },
"facing=west,half=lower,hinge=left,open=false": { "model": "cherry:block/cherry_door_bottom", "y": 180 },
"facing=north,half=lower,hinge=left,open=false": { "model": "cherry:block/cherry_door_bottom", "y": 270 },
"facing=east,half=lower,hinge=right,open=false": { "model": "cherry:block/cherry_door_bottom_hinge" },
"facing=south,half=lower,hinge=right,open=false": { "model": "cherry:block/cherry_door_bottom_hinge", "y": 90 },
"facing=west,half=lower,hinge=right,open=false": { "model": "cherry:block/cherry_door_bottom_hinge", "y": 180 },
"facing=north,half=lower,hinge=right,open=false": { "model": "cherry:block/cherry_door_bottom_hinge", "y": 270 },
"facing=east,half=lower,hinge=left,open=true": { "model": "cherry:block/cherry_door_bottom_hinge", "y": 90 },
"facing=south,half=lower,hinge=left,open=true": { "model": "cherry:block/cherry_door_bottom_hinge", "y": 180 },
"facing=west,half=lower,hinge=left,open=true": { "model": "cherry:block/cherry_door_bottom_hinge", "y": 270 },
"facing=north,half=lower,hinge=left,open=true": { "model": "cherry:block/cherry_door_bottom_hinge" },
"facing=east,half=lower,hinge=right,open=true": { "model": "cherry:block/cherry_door_bottom", "y": 270 },
"facing=south,half=lower,hinge=right,open=true": { "model": "cherry:block/cherry_door_bottom" },
"facing=west,half=lower,hinge=right,open=true": { "model": "cherry:block/cherry_door_bottom", "y": 90 },
"facing=north,half=lower,hinge=right,open=true": { "model": "cherry:block/cherry_door_bottom", "y": 180 },
"facing=east,half=upper,hinge=left,open=false": { "model": "cherry:block/cherry_door_top" },
"facing=south,half=upper,hinge=left,open=false": { "model": "cherry:block/cherry_door_top", "y": 90 },
"facing=west,half=upper,hinge=left,open=false": { "model": "cherry:block/cherry_door_top", "y": 180 },
"facing=north,half=upper,hinge=left,open=false": { "model": "cherry:block/cherry_door_top", "y": 270 },
"facing=east,half=upper,hinge=right,open=false": { "model": "cherry:block/cherry_door_top_hinge" },
"facing=south,half=upper,hinge=right,open=false": { "model": "cherry:block/cherry_door_top_hinge", "y": 90 },
"facing=west,half=upper,hinge=right,open=false": { "model": "cherry:block/cherry_door_top_hinge", "y": 180 },
"facing=north,half=upper,hinge=right,open=false": { "model": "cherry:block/cherry_door_top_hinge", "y": 270 },
"facing=east,half=upper,hinge=left,open=true": { "model": "cherry:block/cherry_door_top_hinge", "y": 90 },
"facing=south,half=upper,hinge=left,open=true": { "model": "cherry:block/cherry_door_top_hinge", "y": 180 },
"facing=west,half=upper,hinge=left,open=true": { "model": "cherry:block/cherry_door_top_hinge", "y": 270 },
"facing=north,half=upper,hinge=left,open=true": { "model": "cherry:block/cherry_door_top_hinge" },
"facing=east,half=upper,hinge=right,open=true": { "model": "cherry:block/cherry_door_top", "y": 270 },
"facing=south,half=upper,hinge=right,open=true": { "model": "cherry:block/cherry_door_top" },
"facing=west,half=upper,hinge=right,open=true": { "model": "cherry:block/cherry_door_top", "y": 90 },
"facing=north,half=upper,hinge=right,open=true": { "model": "cherry:block/cherry_door_top", "y": 180 }
}
}

View File

@ -0,0 +1,13 @@
{
"variants": {
"type=bottom": {
"model": "cherry:block/cherry_slab"
},
"type=double": {
"model": "cherry:block/cherry_planks"
},
"type=top": {
"model": "cherry:block/cherry_slab_top"
}
}
}

View File

@ -0,0 +1,69 @@
{
"variants": {
"facing=east,half=bottom,open=false": {
"model": "cherry:block/cherry_trapdoor_bottom",
"y": 90
},
"facing=east,half=bottom,open=true": {
"model": "cherry:block/cherry_trapdoor_open",
"y": 90
},
"facing=east,half=top,open=false": {
"model": "cherry:block/cherry_trapdoor_top",
"y": 90
},
"facing=east,half=top,open=true": {
"model": "cherry:block/cherry_trapdoor_open",
"x": 180,
"y": 270
},
"facing=north,half=bottom,open=false": {
"model": "cherry:block/cherry_trapdoor_bottom"
},
"facing=north,half=bottom,open=true": {
"model": "cherry:block/cherry_trapdoor_open"
},
"facing=north,half=top,open=false": {
"model": "cherry:block/cherry_trapdoor_top"
},
"facing=north,half=top,open=true": {
"model": "cherry:block/cherry_trapdoor_open",
"x": 180,
"y": 180
},
"facing=south,half=bottom,open=false": {
"model": "cherry:block/cherry_trapdoor_bottom",
"y": 180
},
"facing=south,half=bottom,open=true": {
"model": "cherry:block/cherry_trapdoor_open",
"y": 180
},
"facing=south,half=top,open=false": {
"model": "cherry:block/cherry_trapdoor_top",
"y": 180
},
"facing=south,half=top,open=true": {
"model": "cherry:block/cherry_trapdoor_open",
"x": 180,
"y": 0
},
"facing=west,half=bottom,open=false": {
"model": "cherry:block/cherry_trapdoor_bottom",
"y": 270
},
"facing=west,half=bottom,open=true": {
"model": "cherry:block/cherry_trapdoor_open",
"y": 270
},
"facing=west,half=top,open=false": {
"model": "cherry:block/cherry_trapdoor_top",
"y": 270
},
"facing=west,half=top,open=true": {
"model": "cherry:block/cherry_trapdoor_open",
"x": 180,
"y": 90
}
}
}

View File

@ -7,5 +7,7 @@
"block.cherry.cherry_planks": "Cherry Planks",
"block.cherry.cherry_fence": "Cherry Fence",
"block.cherry.cherry_fence_gate": "Cherry Fence Gate",
"block.cherry.cherry_door": "Cherry Door"
"block.cherry.cherry_door": "Cherry Door",
"block.cherry.cherry_trapdoor": "Cherry Trapdoor",
"block.cherry.cherry_slab": "Cherry Slab"
}

View File

@ -1,7 +1,7 @@
{
"parent": "minecraft:block/door_top",
"textures": {
"top": "minecraft:block/acacia_door_top",
"bottom": "minecraft:block/acacia_door_bottom"
}
}
"parent": "minecraft:block/door_bottom",
"textures": {
"top": "cherry:block/cherry_door_top",
"bottom": "cherry:block/cherry_door_bottom"
}
}

View File

@ -1,7 +1,7 @@
{
"parent": "minecraft:block/door_top_rh",
"textures": {
"top": "minecraft:block/acacia_door_top",
"bottom": "minecraft:block/acacia_door_bottom"
}
}
"parent": "minecraft:block/door_bottom_rh",
"textures": {
"top": "cherry:block/cherry_door_top",
"bottom": "cherry:block/cherry_door_bottom"
}
}

View File

@ -1,7 +1,7 @@
{
"parent": "minecraft:block/door_top",
"textures": {
"top": "minecraft:block/acacia_door_top",
"bottom": "minecraft:block/acacia_door_bottom"
}
}
"parent": "minecraft:block/door_top",
"textures": {
"top": "cherry:block/cherry_door_top",
"bottom": "cherry:block/cherry_door_bottom"
}
}

View File

@ -1,7 +1,7 @@
{
"parent": "minecraft:block/door_top_rh",
"textures": {
"top": "minecraft:block/acacia_door_top",
"bottom": "minecraft:block/acacia_door_bottom"
}
}
"parent": "minecraft:block/door_top_rh",
"textures": {
"top": "cherry:block/cherry_door_top",
"bottom": "cherry:block/cherry_door_bottom"
}
}

View File

@ -0,0 +1,8 @@
{
"parent": "minecraft:block/slab",
"textures": {
"bottom": "cherry:block/cherry_planks",
"top": "cherry:block/cherry_planks",
"side": "cherry:block/cherry_planks"
}
}

View File

@ -0,0 +1,8 @@
{
"parent": "minecraft:block/slab_top",
"textures": {
"bottom": "cherry:block/cherry_planks",
"top": "cherry:block/cherry_planks",
"side": "cherry:block/cherry_planks"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "minecraft:block/template_orientable_trapdoor_bottom",
"textures": {
"texture": "cherry:block/cherry_trapdoor"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "minecraft:block/template_orientable_trapdoor_open",
"textures": {
"texture": "cherry:block/cherry_trapdoor"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "minecraft:block/template_orientable_trapdoor_top",
"textures": {
"texture": "cherry:block/cherry_trapdoor"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "cherry:item/cherry_door"
}
}

View File

@ -0,0 +1,4 @@
{
"parent": "cherry:block/cherry_slab"
}

View File

@ -0,0 +1,3 @@
{
"parent": "cherry:block/cherry_trapdoor_bottom"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB