mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-20 04:09:40 +00:00
Move block registration out of constructors
This commit is contained in:
17 files changed
+127
-96
No files matched your search
@@ -175,8 +175,12 @@ import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import vazkii.botania.common.lib.LibOreDict;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
public final class ModBlocks {
|
||||
|
||||
public static final Set<Block> ALL_BLOCKS = new HashSet<>();
|
||||
public static Block flower;
|
||||
public static Block altar;
|
||||
public static Block livingrock;
|
||||
@@ -352,6 +356,14 @@ public final class ModBlocks {
|
||||
|
||||
ModFluffBlocks.init();
|
||||
|
||||
for (Block b : ALL_BLOCKS) {
|
||||
if (b instanceof IRegisterCallback) {
|
||||
((IRegisterCallback) b).register();
|
||||
} else {
|
||||
throw new RuntimeException(b.getRegistryName() + " doesn't have register callbacks!");
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < 16; i++)
|
||||
OreDictionary.registerOre(LibOreDict.FLOWER[i], new ItemStack(flower, 1, i));
|
||||
|
||||
|
||||
Reference in new issue
Block a user