Unicopia/src/main/java/com/minelittlepony/unicopia/block/UBlocks.java

171 lines
8.9 KiB
Java
Raw Normal View History

2020-04-15 19:06:45 +02:00
package com.minelittlepony.unicopia.block;
2020-04-15 12:37:14 +02:00
2020-04-22 20:23:54 +02:00
import com.minelittlepony.unicopia.TreeType;
import com.minelittlepony.unicopia.gas.CloudAnvilBlock;
import com.minelittlepony.unicopia.gas.CloudBlock;
import com.minelittlepony.unicopia.gas.CloudDoorBlock;
import com.minelittlepony.unicopia.gas.CloudFarmlandBlock;
import com.minelittlepony.unicopia.gas.CloudFenceBlock;
import com.minelittlepony.unicopia.gas.CloudSlabBlock;
2020-05-03 16:59:20 +02:00
import com.minelittlepony.unicopia.gas.CloudSoilBlock;
import com.minelittlepony.unicopia.gas.CloudStairsBlock;
2020-05-03 16:59:20 +02:00
import com.minelittlepony.unicopia.gas.CoverableCloudBlock;
import com.minelittlepony.unicopia.gas.GasState;
import com.minelittlepony.unicopia.gas.PillarCloudBlock;
import com.minelittlepony.unicopia.item.UItems;
import com.minelittlepony.unicopia.structure.CustomSaplingGenerator;
2020-04-15 12:37:14 +02:00
import net.fabricmc.fabric.api.block.FabricBlockSettings;
2020-04-27 00:15:49 +02:00
import net.fabricmc.fabric.api.tools.FabricToolTags;
2020-04-15 12:37:14 +02:00
import net.minecraft.block.Block;
import net.minecraft.block.Blocks;
2020-04-27 17:28:22 +02:00
import net.minecraft.block.FallingBlock;
2020-04-15 12:37:14 +02:00
import net.minecraft.block.Material;
2020-04-27 00:15:49 +02:00
import net.minecraft.block.MaterialColor;
2020-04-15 12:37:14 +02:00
import net.minecraft.block.SaplingBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.sound.BlockSoundGroup;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;
public interface UBlocks {
2020-04-27 18:09:19 +02:00
CloudFarmlandBlock CLOUD_FARMLAND = register("cloud_farmland", new CloudFarmlandBlock(GasState.NORMAL.configure().build()));
2020-05-03 16:59:20 +02:00
CloudBlock CLOUD_BLOCK = register("cloud_block", new CloudSoilBlock(GasState.NORMAL));
CloudBlock ENCHANTED_CLOUD_BLOCK = register("enchanted_cloud_block", new CoverableCloudBlock(GasState.ENCHANTED));
2020-04-27 18:09:19 +02:00
CloudBlock DENSE_CLOUD_BLOCK = register("dense_cloud_block", new CloudBlock(GasState.DENSE));
CloudBlock DENSE_CLOUD_PILLAR = register("dense_cloud_pillar", new PillarCloudBlock(GasState.DENSE));
2020-04-27 18:09:19 +02:00
CloudStairsBlock CLOUD_STAIRS = register("cloud_stairs", new CloudStairsBlock(CLOUD_BLOCK.getDefaultState(), GasState.NORMAL.configure().build()));
2020-05-06 00:08:23 +02:00
CloudStairsBlock ENCHANTED_CLOUD_STAIRS = register("enchanted_cloud_stairs", new CloudStairsBlock(ENCHANTED_CLOUD_BLOCK.getDefaultState(), GasState.ENCHANTED.configure().build()));
CloudStairsBlock DENSE_CLOUD_STAIRS = register("dense_cloud_stairs", new CloudStairsBlock(DENSE_CLOUD_BLOCK.getDefaultState(), GasState.DENSE.configure().build()));
2020-04-27 18:09:19 +02:00
CloudSlabBlock CLOUD_SLAB = register("cloud_slab", new CloudSlabBlock(CLOUD_BLOCK.getDefaultState(), GasState.NORMAL.configure().build()));
CloudSlabBlock ENCHANTED_CLOUD_SLAB = register("enchanted_cloud_slab", new CloudSlabBlock(ENCHANTED_CLOUD_BLOCK.getDefaultState(), GasState.ENCHANTED.configure().build()));
CloudSlabBlock DENSE_CLOUD_SLAB = register("dense_cloud_slab", new CloudSlabBlock(DENSE_CLOUD_BLOCK.getDefaultState(), GasState.DENSE.configure().build()));
2020-04-27 18:09:19 +02:00
2020-05-03 16:59:20 +02:00
CloudDoorBlock MISTED_GLASS_DOOR = register("misted_glass_door", new CloudDoorBlock(FabricBlockSettings.of(Material.GLASS)
.sounds(BlockSoundGroup.GLASS)
.hardness(3)
.resistance(200)
.nonOpaque()
.breakByTool(FabricToolTags.PICKAXES, 0)
.build()));
2020-04-27 18:09:19 +02:00
DutchDoorBlock LIBRARY_DOOR = register("library_door", new DutchDoorBlock(FabricBlockSettings.of(Material.WOOD).
sounds(BlockSoundGroup.WOOD)
.hardness(3)
2020-05-03 16:59:20 +02:00
.nonOpaque()
2020-04-27 18:09:19 +02:00
.build()));
DutchDoorBlock BAKERY_DOOR = register("bakery_door", new DutchDoorBlock(FabricBlockSettings.of(Material.WOOD)
.sounds(BlockSoundGroup.WOOD)
.hardness(3)
2020-05-03 16:59:20 +02:00
.nonOpaque()
.build()));
DiamondDoorBlock DIAMOND_DOOR = register("diamond_door", new DiamondDoorBlock(FabricBlockSettings.of(Material.METAL)
.sounds(BlockSoundGroup.METAL)
.materialColor(MaterialColor.DIAMOND)
.strength(6, 20)
.nonOpaque()
2020-04-27 18:09:19 +02:00
.build()));
GemTorchBlock ENCHANTED_TORCH = register("enchanted_torch", new GemTorchBlock(FabricBlockSettings.of(Material.PART)
.noCollision()
.breakInstantly()
.ticksRandomly()
.lightLevel(1).sounds(BlockSoundGroup.GLASS).build()));
GemTorchBlock ENCHANTED_WALL_TORCH = register("enchanted_wall_torch", new WallGemTorchBlock(FabricBlockSettings.of(Material.PART)
.noCollision()
.breakInstantly()
.ticksRandomly()
.lightLevel(1).sounds(BlockSoundGroup.GLASS).build()));
CloudAnvilBlock CLOUD_ANVIL = register("cloud_anvil", new CloudAnvilBlock(GasState.NORMAL.configure()
.strength(0.025F, 1)
.resistance(2000)
.breakByTool(FabricToolTags.SHOVELS, 0)
.ticksRandomly()
.build()));
CloudFenceBlock CLOUD_FENCE = register("cloud_fence", new CloudFenceBlock(GasState.NORMAL));
TallCropBlock ALFALFA_CROPS = register("alfalfa_crops", new TallCropBlock(FabricBlockSettings.of(Material.PLANT)
.noCollision()
.ticksRandomly()
.breakInstantly()
.sounds(BlockSoundGroup.CROP).build()));
StickBlock STICK = register("stick", new StickBlock(FabricBlockSettings.of(Material.WOOD)
.noCollision()
.strength(0.2F, 0.2F)
.build()));
TomatoPlantBlock TOMATO_PLANT = register("tomato_plant", new TomatoPlantBlock(FabricBlockSettings.of(Material.PLANT)
.noCollision()
.strength(0.2F, 0.2F)
.ticksRandomly()
.lightLevel(1)
.sounds(BlockSoundGroup.WOOD)
.build()));
HiveWallBlock HIVE_WALL_BLOCK = register("hive_wall_block", new HiveWallBlock(FabricBlockSettings.of(UMaterials.HIVE)
.strength(10, 10)
.hardness(2)
.ticksRandomly()
2020-05-03 19:20:51 +02:00
.lightLevel(3)
2020-04-27 18:09:19 +02:00
.sounds(BlockSoundGroup.SAND)
2020-05-03 16:59:20 +02:00
.breakByTool(FabricToolTags.SHOVELS, 1)
2020-04-27 18:09:19 +02:00
.build()));
ChitinBlock CHITIN_SHELL_BLOCK = register("chitin_shell_block", new ChitinBlock(FabricBlockSettings.of(UMaterials.CHITIN)
2020-05-03 16:59:20 +02:00
.strength(50, 2000)
.breakByTool(FabricToolTags.PICKAXES, 2)
2020-04-27 18:09:19 +02:00
.build()));
Block CHISELED_CHITIN_SHELL_BLOCK = register("chiseled_chitin_shell_block", new ChiselledChitinBlock(FabricBlockSettings.of(UMaterials.CHITIN)
.strength(50, 2000)
2020-05-03 16:59:20 +02:00
.breakByTool(FabricToolTags.PICKAXES, 2)
2020-04-27 18:09:19 +02:00
.build()));
SlimeDropBlock SLIME_DROP = register("slime_drop", new SlimeDropBlock(FabricBlockSettings.of(UMaterials.HIVE, MaterialColor.GRASS)
.ticksRandomly()
.breakInstantly()
.lightLevel(9)
.slipperiness(0.5F)
.sounds(BlockSoundGroup.SLIME)
.breakByTool(FabricToolTags.SHOVELS, 2)
.build()));
SlimeLayerBlock SLIME_LAYER = register("slime_layer", new SlimeLayerBlock(FabricBlockSettings.of(Material.CLAY, MaterialColor.GRASS)
.sounds(BlockSoundGroup.SLIME)
.slipperiness(0.8F)
.nonOpaque()
.build()));
Block SUGAR_BLOCK = register("sugar_block", new FallingBlock(FabricBlockSettings.of(Material.SAND)
.strength(10, 10)
.hardness(0.7F)
.sounds(BlockSoundGroup.SAND)
2020-05-03 16:59:20 +02:00
.breakByTool(FabricToolTags.SHOVELS)
2020-04-27 18:09:19 +02:00
.build()));
Block APPLE_LEAVES = register("apple_leaves", new FruitLeavesBlock(FabricBlockSettings.of(Material.LEAVES)
.strength(0.2F, 0.2F)
.ticksRandomly()
.sounds(BlockSoundGroup.GRASS)
.build())
.growthChance(1200)
.tint(0xFFEE81)
.fruit(W -> TreeType.OAK.pickRandomStack())
.compost(w -> new ItemStack(UItems.ROTTEN_APPLE)));
SaplingBlock APPLE_SAPLING = register("apple_sapling", new SaplingBlock(
new CustomSaplingGenerator(5, Blocks.OAK_LOG.getDefaultState(), APPLE_LEAVES.getDefaultState()),
FabricBlockSettings.of(Material.WOOD)
.noCollision()
.ticksRandomly()
.breakInstantly()
.sounds(BlockSoundGroup.GRASS)
.build()) {});
static <T extends Block> T register(String name, T block) {
2020-04-25 13:32:33 +02:00
return Registry.BLOCK.add(new Identifier("unicopia", name), block);
2020-04-15 12:37:14 +02:00
}
static void bootstrap() { }
}