|
|
@ -14,11 +14,19 @@ 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.PressurePlateBlock;
|
|
|
|
import net.minecraft.block.PressurePlateBlock;
|
|
|
|
|
|
|
|
import net.minecraft.block.SignBlock;
|
|
|
|
import net.minecraft.block.SlabBlock;
|
|
|
|
import net.minecraft.block.SlabBlock;
|
|
|
|
|
|
|
|
import net.minecraft.block.entity.BlockEntityType;
|
|
|
|
|
|
|
|
import net.minecraft.block.entity.SignBlockEntity;
|
|
|
|
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.SignType;
|
|
|
|
import net.minecraft.util.registry.Registry;
|
|
|
|
import net.minecraft.util.registry.Registry;
|
|
|
|
import net.parsell.cherry.common.blocks.*;
|
|
|
|
import net.parsell.cherry.common.blocks.CherryButtonBlock;
|
|
|
|
|
|
|
|
import net.parsell.cherry.common.blocks.CherryDoorBlock;
|
|
|
|
|
|
|
|
import net.parsell.cherry.common.blocks.CherryPressurePlate;
|
|
|
|
|
|
|
|
import net.parsell.cherry.common.blocks.CherryStairsBlock;
|
|
|
|
|
|
|
|
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,13 +39,14 @@ public class CherryBlocks {
|
|
|
|
public static final Block CHERRYLEAVES = registerLeaves("cherry_leaves", FabricBlockSettings.copyOf(Blocks.OAK_LEAVES), 30, 60, 6649929);
|
|
|
|
public static final Block CHERRYLEAVES = registerLeaves("cherry_leaves", FabricBlockSettings.copyOf(Blocks.OAK_LEAVES), 30, 60, 6649929);
|
|
|
|
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: tags (as required)
|
|
|
|
public static final Block CHERRYFENCE = registerFence("cherry_fence", FabricBlockSettings.copyOf(Blocks.OAK_FENCE), 5, 20); // TODO: tags (as required)
|
|
|
|
public static final Block CHERRYFENCEGATE = registerFenceGate("cherry_fence_gate", FabricBlockSettings.copyOf(Blocks.OAK_FENCE_GATE), 5, 20); // recipe, loot_tables, tags (as required)
|
|
|
|
public static final Block CHERRYFENCEGATE = registerFenceGate("cherry_fence_gate", FabricBlockSettings.copyOf(Blocks.OAK_FENCE_GATE), 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: 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 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)
|
|
|
|
public static final Block CHERRYSLAB = registerSlab("cherry_slab", FabricBlockSettings.copyOf(Blocks.OAK_SLAB), 5, 20); // TODO: recipe, loot tables, tags (as required)
|
|
|
|
public static final Block CHERRYSTAIRS = registerStair("cherry_stairs", CHERRYPLANKS.getDefaultState(), FabricBlockSettings.copyOf(Blocks.OAK_STAIRS), 5, 20); //TODO: recipe, loot tables, tags (as required)
|
|
|
|
public static final Block CHERRYSTAIRS = registerStair("cherry_stairs", CHERRYPLANKS.getDefaultState(), FabricBlockSettings.copyOf(Blocks.OAK_STAIRS), 5, 20); //TODO: recipe, loot tables, tags (as required)
|
|
|
|
public static final Block CHERRYBUTTON = registerButton("cherry_button", FabricBlockSettings.copyOf(Blocks.OAK_BUTTON), 5, 20);
|
|
|
|
public static final Block CHERRYBUTTON = registerButton("cherry_button", FabricBlockSettings.copyOf(Blocks.OAK_BUTTON), 5, 20); //TODO: recipe, loot tables, tags (as required)
|
|
|
|
public static final Block CHERRYPRESSUREPLATE = registerPressurePlate("cherry_pressure_plate", PressurePlateBlock.ActivationRule.EVERYTHING, FabricBlockSettings.copyOf(Blocks.OAK_PRESSURE_PLATE), 5, 20);
|
|
|
|
public static final Block CHERRYPRESSUREPLATE = registerPressurePlate("cherry_pressure_plate", PressurePlateBlock.ActivationRule.EVERYTHING, FabricBlockSettings.copyOf(Blocks.OAK_PRESSURE_PLATE), 5, 20); //TODO: recipe, loot tables, tags (as required)
|
|
|
|
|
|
|
|
public static final Block CHERRYSIGN = registerSign("cherry_sign", SignType.OAK, FabricBlockSettings.copyOf(Blocks.OAK_SIGN), 5, 20); // TODO: recipe, loot tables
|
|
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
@ -74,6 +83,14 @@ public class CherryBlocks {
|
|
|
|
return block;
|
|
|
|
return block;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static Block registerSign(String blockID, SignType type, FabricBlockSettings settings, int burnChance, int burnSpread) {
|
|
|
|
|
|
|
|
Block block = new SignBlock(settings, type);
|
|
|
|
|
|
|
|
Registry.register(Registry.BLOCK, new Identifier("cherry", blockID), block);
|
|
|
|
|
|
|
|
Registry.register(Registry.BLOCK_ENTITY_TYPE, new Identifier("cherry", blockID), BlockEntityType.Builder.create(SignBlockEntity::new, block).build(null));
|
|
|
|
|
|
|
|
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);
|
|
|
|