Compare commits

..

No commits in common. "daf7b7c836e1e72d96469261764a2a1d53fc1ac4" and "33ffbd765f4b11b3731a0afdddda2a6df46c72b3" have entirely different histories.

27 changed files with 154 additions and 233 deletions

View File

@ -6,8 +6,8 @@ import net.minecraft.block.enums.DoorHinge;
import net.minecraft.block.enums.DoubleBlockHalf; import net.minecraft.block.enums.DoubleBlockHalf;
import net.minecraft.util.math.Direction; import net.minecraft.util.math.Direction;
public class CherryDoorBlock extends DoorBlock{ public class CherryDoor extends DoorBlock{
public CherryDoorBlock(Settings settings) { public CherryDoor(Settings settings) {
super(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)); 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

@ -1,15 +0,0 @@
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,12 +12,10 @@ import net.minecraft.block.FenceBlock;
import net.minecraft.block.FenceGateBlock; import net.minecraft.block.FenceGateBlock;
import net.minecraft.block.LeavesBlock; import net.minecraft.block.LeavesBlock;
import net.minecraft.block.PillarBlock; import net.minecraft.block.PillarBlock;
import net.minecraft.block.SlabBlock;
import net.minecraft.client.render.RenderLayer; import net.minecraft.client.render.RenderLayer;
import net.minecraft.util.Identifier; import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry; import net.minecraft.util.registry.Registry;
import net.parsell.cherry.common.blocks.CherryDoorBlock; import net.parsell.cherry.common.blocks.CherryDoor;
import net.parsell.cherry.common.blocks.CherryTrapdoorBlock;
import net.parsell.cherry.mixin.AxeItemAccessor; import net.parsell.cherry.mixin.AxeItemAccessor;
public class CherryBlocks { public class CherryBlocks {
@ -31,9 +29,7 @@ public class CherryBlocks {
public static final Block CHERRYPLANKS = registerBlock("cherry_planks", FabricBlockSettings.copyOf(Blocks.OAK_PLANKS), 5, 20); 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 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 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: 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 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) { private static Block registerBlock(String blockID, FabricBlockSettings settings, int burnChance, int burnSpread) {
Block block = new Block(settings); Block block = new Block(settings);
@ -42,13 +38,6 @@ public class CherryBlocks {
return block; 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) { private static Block registerFence(String blockID, FabricBlockSettings settings, int burnChance, int burnSpread) {
Block block = new FenceBlock(settings); Block block = new FenceBlock(settings);
Registry.register(Registry.BLOCK, new Identifier("cherry", blockID), block); Registry.register(Registry.BLOCK, new Identifier("cherry", blockID), block);
@ -89,15 +78,7 @@ public class CherryBlocks {
} }
private static Block registerDoor(String blockID, FabricBlockSettings settings, int burnChance, int burnSpread){ private static Block registerDoor(String blockID, FabricBlockSettings settings, int burnChance, int burnSpread){
Block block = new CherryDoorBlock(settings); Block block = new CherryDoor(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); Registry.register(Registry.BLOCK, new Identifier("cherry", blockID), block);
FlammableBlockRegistry.getDefaultInstance().add(block, burnChance, burnSpread); FlammableBlockRegistry.getDefaultInstance().add(block, burnChance, burnSpread);
BlockRenderLayerMap.INSTANCE.putBlock(block, RenderLayer.getCutout()); BlockRenderLayerMap.INSTANCE.putBlock(block, RenderLayer.getCutout());

View File

@ -19,8 +19,6 @@ public class CherryItems {
registerBlockItem("cherry_fence", CherryBlocks.CHERRYFENCE, ItemGroup.BUILDING_BLOCKS); registerBlockItem("cherry_fence", CherryBlocks.CHERRYFENCE, ItemGroup.BUILDING_BLOCKS);
registerBlockItem("cherry_fence_gate", CherryBlocks.CHERRYFENCEGATE, ItemGroup.BUILDING_BLOCKS); registerBlockItem("cherry_fence_gate", CherryBlocks.CHERRYFENCEGATE, ItemGroup.BUILDING_BLOCKS);
registerBlockItem("cherry_door", CherryBlocks.CHERRYDOOR, 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 // Register a standard blockItem

View File

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

View File

@ -1,13 +0,0 @@
{
"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

@ -1,69 +0,0 @@
{
"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,7 +7,5 @@
"block.cherry.cherry_planks": "Cherry Planks", "block.cherry.cherry_planks": "Cherry Planks",
"block.cherry.cherry_fence": "Cherry Fence", "block.cherry.cherry_fence": "Cherry Fence",
"block.cherry.cherry_fence_gate": "Cherry Fence Gate", "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_bottom", "parent": "minecraft:block/door_top",
"textures": { "textures": {
"top": "cherry:block/cherry_door_top", "top": "minecraft:block/acacia_door_top",
"bottom": "cherry:block/cherry_door_bottom" "bottom": "minecraft:block/acacia_door_bottom"
}
} }
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB