Implement Vertical Slabs
Still have some bugs such as waterlogging not working and not all 1.17 blocks have been added
This commit is contained in:
@@ -6,6 +6,7 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.block.Material;
|
||||
import net.minecraft.sound.BlockSoundGroup;
|
||||
|
||||
//TODO Change platinum to saphire
|
||||
public class PlatinumBlock extends Block {
|
||||
public PlatinumBlock() {
|
||||
super(FabricBlockSettings.of(Material.STONE).breakByHand(false).breakByTool(FabricToolTags.PICKAXES).sounds(BlockSoundGroup.METAL).strength(30, 1000f));
|
||||
|
||||
@@ -22,6 +22,7 @@ public class VPBlocks {
|
||||
initializeBlocks();
|
||||
initializeBlockItems();
|
||||
initializeTorches();
|
||||
VPVerticalSlabs.vpVerticalSlabs();
|
||||
}
|
||||
|
||||
public static void initializeBlocks() {
|
||||
|
||||
180
src/main/java/tech/nevets/vplus/blocks/VPVerticalSlabs.java
Normal file
180
src/main/java/tech/nevets/vplus/blocks/VPVerticalSlabs.java
Normal file
@@ -0,0 +1,180 @@
|
||||
package tech.nevets.vplus.blocks;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.Material;
|
||||
import net.minecraft.item.BlockItem;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.sound.BlockSoundGroup;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
import tech.nevets.vplus.items.VPItemGroups;
|
||||
|
||||
public class VPVerticalSlabs {
|
||||
|
||||
//TODO add new 1.17 blocks
|
||||
|
||||
public static final Block VERTICAL_OAK_SLAB;
|
||||
public static final Block VERTICAL_SPRUCE_SLAB;
|
||||
public static final Block VERTICAL_BIRCH_SLAB;
|
||||
public static final Block VERTICAL_JUNGLE_SLAB;
|
||||
public static final Block VERTICAL_ACACIA_SLAB;
|
||||
public static final Block VERTICAL_DARK_OAK_SLAB;
|
||||
public static final Block VERTICAL_CRIMSON_SLAB;
|
||||
public static final Block VERTICAL_WARPED_SLAB;
|
||||
public static final Block VERTICAL_STONE_SLAB;
|
||||
public static final Block VERTICAL_SMOOTH_STONE_SLAB;
|
||||
public static final Block VERTICAL_SANDSTONE_SLAB;
|
||||
public static final Block VERTICAL_CUT_SANDSTONE_SLAB;
|
||||
public static final Block VERTICAL_COBBLESTONE_SLAB;
|
||||
public static final Block VERTICAL_BRICK_SLAB;
|
||||
public static final Block VERTICAL_STONE_BRICK_SLAB;
|
||||
public static final Block VERTICAL_NETHER_BRICK_SLAB;
|
||||
public static final Block VERTICAL_QUARTZ_SLAB;
|
||||
public static final Block VERTICAL_RED_SANDSTONE_SLAB;
|
||||
public static final Block VERTICAL_CUT_RED_SANDSTONE_SLAB;
|
||||
public static final Block VERTICAL_PURPUR_SLAB;
|
||||
public static final Block VERTICAL_PRISMARINE_SLAB;
|
||||
public static final Block VERTICAL_PRISMARINE_BRICK_SLAB;
|
||||
public static final Block VERTICAL_DARK_PRISMARINE_SLAB;
|
||||
public static final Block VERTICAL_POLISHED_GRANITE_SLAB;
|
||||
public static final Block VERTICAL_SMOOTH_RED_SANDSTONE_SLAB;
|
||||
public static final Block VERTICAL_MOSSY_STONE_BRICK_SLAB;
|
||||
public static final Block VERTICAL_POLISHED_DIORITE_SLAB;
|
||||
public static final Block VERTICAL_MOSSY_COBBLESTONE_SLAB;
|
||||
public static final Block VERTICAL_END_STONE_BRICK_SLAB;
|
||||
public static final Block VERTICAL_SMOOTH_SANDSTONE_SLAB;
|
||||
public static final Block VERTICAL_SMOOTH_QUARTZ_SLAB;
|
||||
public static final Block VERTICAL_GRANITE_SLAB;
|
||||
public static final Block VERTICAL_ANDESITE_SLAB;
|
||||
public static final Block VERTICAL_RED_NETHER_BRICK_SLAB;
|
||||
public static final Block VERTICAL_POLISHED_ANDESITE_SLAB;
|
||||
public static final Block VERTICAL_DIORITE_SLAB;
|
||||
public static final Block VERTICAL_BLACKSTONE_SLAB;
|
||||
public static final Block VERTICAL_POLISHED_BLACKSTONE_SLAB;
|
||||
public static final Block VERTICAL_POLISHED_BLACKSTONE_BRICK_SLAB;
|
||||
|
||||
public static void vpVerticalSlabs() {
|
||||
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_oak_slab"), VERTICAL_OAK_SLAB);
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_oak_slab"), new BlockItem(VERTICAL_OAK_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
|
||||
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_spruce_slab"), VERTICAL_SPRUCE_SLAB);
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_spruce_slab"), new BlockItem(VERTICAL_SPRUCE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
|
||||
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_birch_slab"), VERTICAL_BIRCH_SLAB);
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_birch_slab"), new BlockItem(VERTICAL_BIRCH_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
|
||||
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_jungle_slab"), VERTICAL_JUNGLE_SLAB);
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_jungle_slab"), new BlockItem(VERTICAL_JUNGLE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
|
||||
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_acacia_slab"), VERTICAL_ACACIA_SLAB);
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_acacia_slab"), new BlockItem(VERTICAL_ACACIA_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
|
||||
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_dark_oak_slab"), VERTICAL_DARK_OAK_SLAB);
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_dark_oak_slab"), new BlockItem(VERTICAL_DARK_OAK_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
|
||||
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_crimson_slab"), VERTICAL_CRIMSON_SLAB);
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_crimson_slab"), new BlockItem(VERTICAL_CRIMSON_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
|
||||
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_warped_slab"), VERTICAL_WARPED_SLAB);
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_warped_slab"), new BlockItem(VERTICAL_WARPED_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
|
||||
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_stone_slab"), VERTICAL_STONE_SLAB);
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_stone_slab"), new BlockItem(VERTICAL_STONE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
|
||||
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_smooth_stone_slab"), VERTICAL_SMOOTH_STONE_SLAB);
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_smooth_stone_slab"), new BlockItem(VERTICAL_SMOOTH_STONE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
|
||||
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_sandstone_slab"), VERTICAL_SANDSTONE_SLAB);
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_sandstone_slab"), new BlockItem(VERTICAL_SANDSTONE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
|
||||
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_cut_sandstone_slab"), VERTICAL_CUT_SANDSTONE_SLAB);
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_cut_sandstone_slab"), new BlockItem(VERTICAL_CUT_SANDSTONE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
|
||||
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_cobblestone_slab"), VERTICAL_COBBLESTONE_SLAB);
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_cobblestone_slab"), new BlockItem(VERTICAL_COBBLESTONE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
|
||||
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_brick_slab"), VERTICAL_BRICK_SLAB);
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_brick_slab"), new BlockItem(VERTICAL_BRICK_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
|
||||
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_stone_brick_slab"), VERTICAL_STONE_BRICK_SLAB);
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_stone_brick_slab"), new BlockItem(VERTICAL_STONE_BRICK_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
|
||||
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_nether_brick_slab"), VERTICAL_NETHER_BRICK_SLAB);
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_nether_brick_slab"), new BlockItem(VERTICAL_NETHER_BRICK_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
|
||||
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_quartz_slab"), VERTICAL_QUARTZ_SLAB);
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_quartz_slab"), new BlockItem(VERTICAL_QUARTZ_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
|
||||
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_red_sandstone_slab"), VERTICAL_RED_SANDSTONE_SLAB);
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_red_sandstone_slab"), new BlockItem(VERTICAL_RED_SANDSTONE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
|
||||
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_cut_red_sandstone_slab"), VERTICAL_CUT_RED_SANDSTONE_SLAB);
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_cut_red_sandstone_slab"), new BlockItem(VERTICAL_CUT_RED_SANDSTONE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
|
||||
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_purpur_slab"), VERTICAL_PURPUR_SLAB);
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_purpur_slab"), new BlockItem(VERTICAL_PURPUR_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
|
||||
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_prismarine_slab"), VERTICAL_PRISMARINE_SLAB);
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_prismarine_slab"), new BlockItem(VERTICAL_PRISMARINE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
|
||||
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_prismarine_brick_slab"), VERTICAL_PRISMARINE_BRICK_SLAB);
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_prismarine_brick_slab"), new BlockItem(VERTICAL_PRISMARINE_BRICK_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
|
||||
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_dark_prismarine_slab"), VERTICAL_DARK_PRISMARINE_SLAB);
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_dark_prismarine_slab"), new BlockItem(VERTICAL_DARK_PRISMARINE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
|
||||
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_polished_granite_slab"), VERTICAL_POLISHED_GRANITE_SLAB);
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_polished_granite_slab"), new BlockItem(VERTICAL_POLISHED_GRANITE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
|
||||
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_smooth_red_sandstone_slab"), VERTICAL_SMOOTH_RED_SANDSTONE_SLAB);
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_smooth_red_sandstone_slab"), new BlockItem(VERTICAL_SMOOTH_RED_SANDSTONE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
|
||||
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_mossy_stone_brick_slab"), VERTICAL_MOSSY_STONE_BRICK_SLAB);
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_mossy_stone_brick_slab"), new BlockItem(VERTICAL_MOSSY_STONE_BRICK_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
|
||||
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_polished_diorite_slab"), VERTICAL_POLISHED_DIORITE_SLAB);
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_polished_diorite_slab"), new BlockItem(VERTICAL_POLISHED_DIORITE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
|
||||
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_mossy_cobblestone_slab"), VERTICAL_MOSSY_COBBLESTONE_SLAB);
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_mossy_cobblestone_slab"), new BlockItem(VERTICAL_MOSSY_COBBLESTONE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
|
||||
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_end_stone_brick_slab"), VERTICAL_END_STONE_BRICK_SLAB);
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_end_stone_brick_slab"), new BlockItem(VERTICAL_END_STONE_BRICK_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
|
||||
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_smooth_sandstone_slab"), VERTICAL_SMOOTH_SANDSTONE_SLAB);
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_smooth_sandstone_slab"), new BlockItem(VERTICAL_SMOOTH_SANDSTONE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
|
||||
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_smooth_quartz_slab"), VERTICAL_SMOOTH_QUARTZ_SLAB);
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_smooth_quartz_slab"), new BlockItem(VERTICAL_SMOOTH_QUARTZ_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
|
||||
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_granite_slab"), VERTICAL_GRANITE_SLAB);
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_granite_slab"), new BlockItem(VERTICAL_GRANITE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
|
||||
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_andesite_slab"), VERTICAL_ANDESITE_SLAB);
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_andesite_slab"), new BlockItem(VERTICAL_ANDESITE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
|
||||
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_red_nether_brick_slab"), VERTICAL_RED_NETHER_BRICK_SLAB);
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_red_nether_brick_slab"), new BlockItem(VERTICAL_RED_NETHER_BRICK_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
|
||||
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_polished_andesite_slab"), VERTICAL_POLISHED_ANDESITE_SLAB);
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_polished_andesite_slab"), new BlockItem(VERTICAL_POLISHED_ANDESITE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
|
||||
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_diorite_slab"), VERTICAL_DIORITE_SLAB);
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_diorite_slab"), new BlockItem(VERTICAL_DIORITE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
|
||||
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_blackstone_slab"), VERTICAL_BLACKSTONE_SLAB);
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_blackstone_slab"), new BlockItem(VERTICAL_BLACKSTONE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
|
||||
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_polished_blackstone_slab"), VERTICAL_POLISHED_BLACKSTONE_SLAB);
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_polished_blackstone_slab"), new BlockItem(VERTICAL_POLISHED_BLACKSTONE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
|
||||
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_polished_blackstone_brick_slab"), VERTICAL_POLISHED_BLACKSTONE_BRICK_SLAB);
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_polished_blackstone_brick_slab"), new BlockItem(VERTICAL_POLISHED_BLACKSTONE_BRICK_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
|
||||
}
|
||||
|
||||
static {
|
||||
VERTICAL_OAK_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.WOOD).sounds(BlockSoundGroup.WOOD).hardness(2.0F).breakByTool(FabricToolTags.AXES));
|
||||
VERTICAL_SPRUCE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.WOOD).sounds(BlockSoundGroup.WOOD).hardness(2.0F).breakByTool(FabricToolTags.AXES));
|
||||
VERTICAL_BIRCH_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.WOOD).sounds(BlockSoundGroup.WOOD).hardness(2.0F).breakByTool(FabricToolTags.AXES));
|
||||
VERTICAL_JUNGLE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.WOOD).sounds(BlockSoundGroup.WOOD).hardness(2.0F).breakByTool(FabricToolTags.AXES));
|
||||
VERTICAL_ACACIA_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.WOOD).sounds(BlockSoundGroup.WOOD).hardness(2.0F).breakByTool(FabricToolTags.AXES));
|
||||
VERTICAL_DARK_OAK_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.WOOD).sounds(BlockSoundGroup.WOOD).hardness(2.0F).breakByTool(FabricToolTags.AXES));
|
||||
VERTICAL_CRIMSON_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.WOOD).sounds(BlockSoundGroup.WOOD).hardness(2.0F).breakByTool(FabricToolTags.AXES));
|
||||
VERTICAL_WARPED_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.WOOD).sounds(BlockSoundGroup.WOOD).hardness(2.0F).breakByTool(FabricToolTags.AXES));
|
||||
VERTICAL_STONE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES));
|
||||
VERTICAL_SMOOTH_STONE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES));
|
||||
VERTICAL_SANDSTONE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES));
|
||||
VERTICAL_CUT_SANDSTONE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES));
|
||||
VERTICAL_COBBLESTONE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES));
|
||||
VERTICAL_BRICK_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES));
|
||||
VERTICAL_STONE_BRICK_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES));
|
||||
VERTICAL_NETHER_BRICK_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES));
|
||||
VERTICAL_QUARTZ_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES));
|
||||
VERTICAL_RED_SANDSTONE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES));
|
||||
VERTICAL_CUT_RED_SANDSTONE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES));
|
||||
VERTICAL_PURPUR_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES));
|
||||
VERTICAL_PRISMARINE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES));
|
||||
VERTICAL_PRISMARINE_BRICK_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES));
|
||||
VERTICAL_DARK_PRISMARINE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES));
|
||||
VERTICAL_POLISHED_GRANITE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES));
|
||||
VERTICAL_SMOOTH_RED_SANDSTONE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES));
|
||||
VERTICAL_MOSSY_STONE_BRICK_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES));
|
||||
VERTICAL_POLISHED_DIORITE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES));
|
||||
VERTICAL_MOSSY_COBBLESTONE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES));
|
||||
VERTICAL_END_STONE_BRICK_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES));
|
||||
VERTICAL_SMOOTH_SANDSTONE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES));
|
||||
VERTICAL_SMOOTH_QUARTZ_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES));
|
||||
VERTICAL_GRANITE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES));
|
||||
VERTICAL_ANDESITE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES));
|
||||
VERTICAL_RED_NETHER_BRICK_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES));
|
||||
VERTICAL_POLISHED_ANDESITE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES));
|
||||
VERTICAL_DIORITE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES));
|
||||
VERTICAL_BLACKSTONE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES));
|
||||
VERTICAL_POLISHED_BLACKSTONE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES));
|
||||
VERTICAL_POLISHED_BLACKSTONE_BRICK_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES));
|
||||
}
|
||||
}
|
||||
86
src/main/java/tech/nevets/vplus/blocks/VerticalSlabs.java
Normal file
86
src/main/java/tech/nevets/vplus/blocks/VerticalSlabs.java
Normal file
@@ -0,0 +1,86 @@
|
||||
package tech.nevets.vplus.blocks;
|
||||
|
||||
import net.minecraft.block.*;
|
||||
import net.minecraft.fluid.FluidState;
|
||||
import net.minecraft.fluid.Fluids;
|
||||
import net.minecraft.item.ItemPlacementContext;
|
||||
import net.minecraft.state.StateManager;
|
||||
import net.minecraft.state.property.BooleanProperty;
|
||||
import net.minecraft.state.property.Properties;
|
||||
import net.minecraft.tag.FluidTags;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.shape.VoxelShape;
|
||||
import net.minecraft.util.shape.VoxelShapes;
|
||||
import net.minecraft.world.BlockView;
|
||||
|
||||
|
||||
public class VerticalSlabs extends HorizontalFacingBlock {
|
||||
private static final VoxelShape NORTH_SHAPE;
|
||||
private static final VoxelShape EAST_SHAPE;
|
||||
private static final VoxelShape SOUTH_SHAPE;
|
||||
private static final VoxelShape WEST_SHAPE;
|
||||
public static final BooleanProperty WATERLOGGED = Properties.WATERLOGGED;
|
||||
|
||||
public VerticalSlabs(Settings settings){
|
||||
super(settings);
|
||||
this.setDefaultState(this.stateManager.getDefaultState().with(WATERLOGGED, true).with(FACING, Direction.NORTH));
|
||||
}
|
||||
|
||||
//TODO Fix Waterlogging
|
||||
@Override
|
||||
public FluidState getFluidState(BlockState blockState_1) {
|
||||
return (Boolean)blockState_1.get(WATERLOGGED) ? Fluids.WATER.getStill(false) : super.getFluidState(blockState_1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockRenderType getRenderType(BlockState blockState_1) {
|
||||
return BlockRenderType.MODEL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState getPlacementState(ItemPlacementContext itemPlacementContext) {
|
||||
FluidState fluidState = itemPlacementContext.getWorld().getFluidState(itemPlacementContext.getBlockPos());
|
||||
boolean waterLog = fluidState.isIn(FluidTags.WATER) && fluidState.getLevel() == 8;
|
||||
return super.getPlacementState(itemPlacementContext).with(WATERLOGGED, waterLog)
|
||||
.with(FACING, itemPlacementContext.getPlayerFacing().getOpposite());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
|
||||
builder.add(WATERLOGGED, FACING);
|
||||
}
|
||||
|
||||
@Override
|
||||
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext context) {
|
||||
switch(state.get(FACING)) {
|
||||
case NORTH: return NORTH_SHAPE;
|
||||
case EAST: return EAST_SHAPE;
|
||||
case SOUTH: return SOUTH_SHAPE;
|
||||
case WEST: return WEST_SHAPE;
|
||||
default: return super.getOutlineShape(state, view, pos, context);
|
||||
}
|
||||
}
|
||||
|
||||
static {
|
||||
VoxelShape shape = createCuboidShape(0.0D, 0.0D, 0.0D, 8.0D, 16.0D, 16.0D);
|
||||
|
||||
EAST_SHAPE = shape;
|
||||
NORTH_SHAPE = rotate(Direction.EAST, Direction.NORTH, shape);
|
||||
SOUTH_SHAPE = rotate(Direction.EAST, Direction.SOUTH, shape);
|
||||
WEST_SHAPE = rotate(Direction.EAST, Direction.WEST, shape);
|
||||
}
|
||||
|
||||
private static VoxelShape rotate(Direction from, Direction to, VoxelShape shape) {
|
||||
VoxelShape[] buffer = new VoxelShape[]{ shape, VoxelShapes.empty() };
|
||||
|
||||
int times = (to.getHorizontal() - from.getHorizontal() + 4) % 4;
|
||||
for (int i = 0; i < times; i++) {
|
||||
buffer[0].forEachBox((minX, minY, minZ, maxX, maxY, maxZ) -> buffer[1] = VoxelShapes.union(buffer[1], VoxelShapes.cuboid(1-maxZ, minY, minX, 1-minZ, maxY, maxX)));
|
||||
buffer[0] = buffer[1];
|
||||
buffer[1] = VoxelShapes.empty();
|
||||
}
|
||||
|
||||
return buffer[0];
|
||||
}
|
||||
}
|
||||
@@ -27,5 +27,9 @@ public class VPItemGroups {
|
||||
//Food Tab
|
||||
public static final ItemGroup FOOD = FabricItemGroupBuilder.build(
|
||||
new Identifier("vplus", "food"),
|
||||
() -> new ItemStack((Items.ENCHANTED_GOLDEN_APPLE)));
|
||||
() -> new ItemStack(Items.ENCHANTED_GOLDEN_APPLE));
|
||||
//Vertical Slabs Tab
|
||||
public static final ItemGroup VERTICAL_SLABS = FabricItemGroupBuilder.build(
|
||||
new Identifier("vplus", "vert_slabs"),
|
||||
() -> new ItemStack(Items.BRICK_SLAB));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user