Allow crystal flowers to be placed in flower pots

This commit is contained in:
Electroblob77
2020-05-22 16:43:24 +01:00
parent e1df468d93
commit 6696be59a4
8 changed files with 212 additions and 2 deletions
@@ -55,6 +55,7 @@ public final class WizardryBlocks {
public static final Block thorns = placeholder();
public static final Block obsidian_crust = placeholder();
public static final Block dry_frosted_ice = placeholder();
public static final Block crystal_flower_pot = placeholder();
public static final Block runestone = placeholder();
public static final Block runestone_pedestal = placeholder();
@@ -116,6 +117,7 @@ public final class WizardryBlocks {
registerBlock(registry, "thorns", new BlockThorns());
registerBlock(registry, "obsidian_crust", new BlockObsidianCrust());
registerBlock(registry, "dry_frosted_ice", new BlockDryFrostedIce());
registerBlock(registry, "crystal_flower_pot", new BlockCrystalFlowerPot());
registerBlock(registry, "runestone", new BlockRunestone(Material.ROCK));
registerBlock(registry, "runestone_pedestal", new BlockPedestal(Material.ROCK));
@@ -370,8 +370,15 @@ public final class WizardryItems {
* also automatically adds it to the order list for its creative tab if that tab is a {@link CreativeTabListed},
* meaning the order can be defined simply by the order in which the items are registered in this class. */
private static void registerItemBlock(IForgeRegistry<Item> registry, Block block){
registerItemBlock(registry, block, new ItemBlock(block));
}
/** Registers the given ItemBlock for the given block, with the same registry name as that block. This
* also automatically adds it to the order list for its creative tab if that tab is a {@link CreativeTabListed},
* meaning the order can be defined simply by the order in which the items are registered in this class. */
private static void registerItemBlock(IForgeRegistry<Item> registry, Block block, ItemBlock itemblock){
// We don't need to keep a reference to the ItemBlock
Item itemblock = new ItemBlock(block).setRegistryName(block.getRegistryName());
itemblock.setRegistryName(block.getRegistryName());
registry.register(itemblock);
if(block.getCreativeTab() instanceof CreativeTabListed){
@@ -400,7 +407,7 @@ public final class WizardryItems {
// Not all blocks need an ItemBlock
registerItemBlock(registry, WizardryBlocks.arcane_workbench);
registerItemBlock(registry, WizardryBlocks.crystal_ore);
registerItemBlock(registry, WizardryBlocks.crystal_flower);
registerItemBlock(registry, WizardryBlocks.crystal_flower, new ItemCrystalFlower());
registerItemBlock(registry, WizardryBlocks.transportation_stone);
String[] elements = Arrays.stream(Element.values()).map(Element::getName).toArray(String[]::new);