Move all block registration to preinit to prevent creative tab issues

This commit is contained in:
tterrag1098 committed 2015-01-10 17:21:16 -05:00
1 parent 8dfe1df73d
commit de0b478160
3 files changed
+14 -22

No files matched your search

@@ -2331,26 +2331,21 @@ public enum Features {
;
public static void init() {
loadBlocks(true);
loadItems(true);
loadRecipes();
}
private static void loadBlocks(boolean init) {
private static void loadBlocks() {
for (Features f : values()) {
if (f.enabled() && f.shouldLoad(init)) {
if (f.enabled()) {
f.addBlocks();
}
}
if (!init) {
Chisel.proxy.registerTileEntities();
}
Chisel.proxy.registerTileEntities();
}
private static void loadItems(boolean init) {
private static void loadItems() {
for (Features f : values()) {
if (f.enabled() && f.shouldLoad(init)) {
if (f.enabled()) {
f.addItems();
}
}
@@ -2373,8 +2368,8 @@ public enum Features {
}
public static void preInit() {
loadBlocks(false);
loadItems(false);
loadBlocks();
loadItems();
}
private Features parent;
@@ -2424,10 +2419,6 @@ public enum Features {
return requiredMod;
}
private boolean shouldLoad(boolean init) {
return requiredMod == null ? !init : init && Loader.isModLoaded(requiredMod);
}
public static boolean oneModdedFeatureLoaded() {
for (Features f : values()) {
if (f.getRequiredMod() != null && Loader.isModLoaded(f.getRequiredMod())) {