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

81 lines
4.3 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;
2020-04-16 00:44:58 +02:00
import com.minelittlepony.unicopia.Unicopia;
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;
import com.minelittlepony.unicopia.gas.CloudStairsBlock;
2020-04-15 19:06:45 +02:00
import com.minelittlepony.unicopia.gas.CloudType;
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;
import net.minecraft.block.Block;
import net.minecraft.block.Blocks;
import net.minecraft.block.Material;
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-22 16:28:20 +02:00
CloudBlock normal_cloud = register(new CloudBlock(CloudType.NORMAL), "cloud_block");
CloudBlock enchanted_cloud = register(new CloudBlock(CloudType.ENCHANTED), "enchanted_cloud_block");
CloudBlock packed_cloud = register(new CloudBlock(CloudType.PACKED), "packed_cloud_block");
2020-04-15 12:37:14 +02:00
CloudStairsBlock cloud_stairs = register(new CloudStairsBlock(normal_cloud.getDefaultState(), FabricBlockSettings.of(UMaterials.CLOUD).build()), "cloud_stairs");
CloudSlabBlock<CloudBlock> cloud_slab = register(new CloudSlabBlock<>(normal_cloud, UMaterials.CLOUD), "cloud_slab");
CloudSlabBlock<CloudBlock> enchanted_cloud_slab = register(new CloudSlabBlock<>(enchanted_cloud, UMaterials.CLOUD), "enchanted_cloud_slab");
CloudSlabBlock<CloudBlock> packed_cloud_slab = register(new CloudSlabBlock<>(enchanted_cloud, UMaterials.CLOUD), "packed_cloud_slab");
CloudDoorBlock mist_door = register(new CloudDoorBlock(), "mist_door");
2020-04-15 12:37:14 +02:00
DutchDoorBlock library_door = register(new DutchDoorBlock(FabricBlockSettings.of(Material.WOOD).sounds(BlockSoundGroup.WOOD).hardness(3).build()), "library_door");
DutchDoorBlock bakery_door = register(new DutchDoorBlock(FabricBlockSettings.of(Material.WOOD).sounds(BlockSoundGroup.WOOD).hardness(3).build()), "bakery_door");
DiamondDoorBlock diamond_door = register(new DiamondDoorBlock(), "diamond_door");
GlowingGemBlock enchanted_torch = register(new GlowingGemBlock(), "enchanted_torch");
CloudAnvilBlock anvil = register(new CloudAnvilBlock(), "anvil");
2020-04-22 16:28:20 +02:00
CloudFenceBlock cloud_fence = register(new CloudFenceBlock(CloudType.NORMAL), "cloud_fence");
2020-04-15 12:37:14 +02:00
TallCropBlock alfalfa = register(new TallCropBlock(FabricBlockSettings.of(Material.PLANT).noCollision().ticksRandomly().breakInstantly().sounds(BlockSoundGroup.CROP).build()), "alfalfa");
StickBlock stick = register(new StickBlock(), "stick");
TomatoPlantBlock tomato_plant = register(new TomatoPlantBlock(), "tomato_plant");
2020-04-15 12:37:14 +02:00
CloudFarmlandBlock cloud_farmland = register(new CloudFarmlandBlock(FabricBlockSettings.of(UMaterials.CLOUD).noCollision().ticksRandomly().breakInstantly().sounds(BlockSoundGroup.WOOL).build()), "cloud_farmland");
HiveWallBlock hive = register(new HiveWallBlock(), "hive");
2020-04-22 22:23:47 +02:00
ChitinBlock chitin_block = register(new ChitinBlock(), "chitin_block");
2020-04-15 12:37:14 +02:00
Block chissled_chitin = register(new ChiselledChitinBlock(), "chissled_chitin");
BlockGrowingCuccoon cuccoon = register(new BlockGrowingCuccoon(), "cuccoon");
SlimeLayerBlock slime_layer = register(new SlimeLayerBlock(), "slime_layer");
Block sugar_block = register(new SugarBlock(), "sugar_block");
SaplingBlock apple_tree = register(new SaplingBlock(
new CustomSaplingGenerator(5, Blocks.OAK_LOG.getDefaultState(), UBlocks.apple_leaves.getDefaultState()),
FabricBlockSettings.of(Material.WOOD).build()
) {}, "apple_sapling");
Block apple_leaves = register(new FruitLeavesBlock()
.growthChance(1200)
.tint(0xFFEE81)
2020-04-22 20:23:54 +02:00
.fruit(W -> TreeType.OAK.pickRandomStack())
2020-04-15 12:37:14 +02:00
.compost(w -> new ItemStack(UItems.rotten_apple)), "apple_leaves");
static <T extends Block> T register(T block, String name) {
2020-04-16 00:44:58 +02:00
return Registry.BLOCK.add(new Identifier(Unicopia.MODID, name), block);
2020-04-15 12:37:14 +02:00
}
static void bootstrap() { }
}