mirror of
https://github.com/GTNewHorizons/StorageDrawers.git
synced 2026-11-19 11:59:19 +00:00
Merge branch 'addon-api'
Conflicts: build.gradle packs/BiomesOPlenty/src/com/jaquadro/minecraft/storagedrawers/packs/bop/core/ModRecipes.java
This commit is contained in:
commit
e39af9b2c3
14 files changed
+316
-89
No files matched your search
+1
-1
@@ -17,7 +17,7 @@ buildscript {
|
||||
|
||||
apply plugin: 'forge'
|
||||
|
||||
version = "1.7.10-1.6.0"
|
||||
version = "1.7.10-1.5.6"
|
||||
group= "com.jaquadro.minecraft.storagedrawers" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||
archivesBaseName = "StorageDrawers"
|
||||
|
||||
|
||||
+23
-18
@@ -1,12 +1,12 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.packs.bop.core;
|
||||
|
||||
import com.jaquadro.minecraft.storagedrawers.StorageDrawers;
|
||||
import com.jaquadro.minecraft.storagedrawers.api.IStorageDrawersApi;
|
||||
import com.jaquadro.minecraft.storagedrawers.api.StorageDrawersApi;
|
||||
import com.jaquadro.minecraft.storagedrawers.api.config.IBlockConfig;
|
||||
import com.jaquadro.minecraft.storagedrawers.api.config.IUserConfig;
|
||||
import com.jaquadro.minecraft.storagedrawers.api.pack.BlockConfiguration;
|
||||
import com.jaquadro.minecraft.storagedrawers.api.pack.IPackBlockFactory;
|
||||
import com.jaquadro.minecraft.storagedrawers.api.pack.IPackDataResolver;
|
||||
import com.jaquadro.minecraft.storagedrawers.config.ConfigManager;
|
||||
import com.jaquadro.minecraft.storagedrawers.integration.notenoughitems.NEIStorageDrawersConfig;
|
||||
import com.jaquadro.minecraft.storagedrawers.packs.bop.StorageDrawersPack;
|
||||
import cpw.mods.fml.common.registry.GameData;
|
||||
import net.minecraft.block.Block;
|
||||
@@ -21,7 +21,11 @@ public class ModBlocks
|
||||
public static Block trim;
|
||||
|
||||
public void init () {
|
||||
IPackBlockFactory factory = StorageDrawersApi.instance().packFactory();
|
||||
IStorageDrawersApi api = StorageDrawersApi.instance();
|
||||
if (api == null)
|
||||
return;
|
||||
|
||||
IPackBlockFactory factory = api.packFactory();
|
||||
IPackDataResolver resolver = StorageDrawersPack.instance.resolver;
|
||||
|
||||
fullDrawers1 = factory.createBlock(BlockConfiguration.BasicFull1, resolver);
|
||||
@@ -31,28 +35,29 @@ public class ModBlocks
|
||||
halfDrawers4 = factory.createBlock(BlockConfiguration.BasicHalf4, resolver);
|
||||
trim = factory.createBlock(BlockConfiguration.Trim, resolver);
|
||||
|
||||
ConfigManager config = StorageDrawers.config;
|
||||
IUserConfig config = api.userConfig();
|
||||
IBlockConfig blockConfig = config.blockConfig();
|
||||
|
||||
if (config.isBlockEnabled("fulldrawers1"))
|
||||
if (blockConfig.isBlockEnabled(blockConfig.getBlockConfigName(BlockConfiguration.BasicFull1)))
|
||||
factory.registerBlock(fullDrawers1, "fullDrawers1");
|
||||
if (config.isBlockEnabled("fulldrawers2"))
|
||||
if (blockConfig.isBlockEnabled(blockConfig.getBlockConfigName(BlockConfiguration.BasicFull2)))
|
||||
factory.registerBlock(fullDrawers2, "fullDrawers2");
|
||||
if (config.isBlockEnabled("fulldrawers4"))
|
||||
if (blockConfig.isBlockEnabled(blockConfig.getBlockConfigName(BlockConfiguration.BasicFull4)))
|
||||
factory.registerBlock(fullDrawers4, "fullDrawers4");
|
||||
if (config.isBlockEnabled("halfdrawers2"))
|
||||
if (blockConfig.isBlockEnabled(blockConfig.getBlockConfigName(BlockConfiguration.BasicHalf2)))
|
||||
factory.registerBlock(halfDrawers2, "halfDrawers2");
|
||||
if (config.isBlockEnabled("halfdrawers4"))
|
||||
if (blockConfig.isBlockEnabled(blockConfig.getBlockConfigName(BlockConfiguration.BasicHalf4)))
|
||||
factory.registerBlock(halfDrawers4, "halfDrawers4");
|
||||
if (config.isBlockEnabled("trim"))
|
||||
if (blockConfig.isBlockEnabled(blockConfig.getBlockConfigName(BlockConfiguration.Trim)))
|
||||
factory.registerBlock(trim, "trim");
|
||||
|
||||
if (!config.cache.addonShowNEI) {
|
||||
NEIStorageDrawersConfig.hideBlock(getQualifiedName(fullDrawers1));
|
||||
NEIStorageDrawersConfig.hideBlock(getQualifiedName(fullDrawers2));
|
||||
NEIStorageDrawersConfig.hideBlock(getQualifiedName(fullDrawers4));
|
||||
NEIStorageDrawersConfig.hideBlock(getQualifiedName(halfDrawers2));
|
||||
NEIStorageDrawersConfig.hideBlock(getQualifiedName(halfDrawers4));
|
||||
NEIStorageDrawersConfig.hideBlock(getQualifiedName(trim));
|
||||
if (!config.addonConfig().showAddonItemsNEI()) {
|
||||
factory.hideBlock(getQualifiedName(fullDrawers1));
|
||||
factory.hideBlock(getQualifiedName(fullDrawers2));
|
||||
factory.hideBlock(getQualifiedName(fullDrawers4));
|
||||
factory.hideBlock(getQualifiedName(halfDrawers2));
|
||||
factory.hideBlock(getQualifiedName(halfDrawers4));
|
||||
factory.hideBlock(getQualifiedName(trim));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+14
-8
@@ -1,7 +1,9 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.packs.bop.core;
|
||||
|
||||
import com.jaquadro.minecraft.storagedrawers.StorageDrawers;
|
||||
import com.jaquadro.minecraft.storagedrawers.config.ConfigManager;
|
||||
import com.jaquadro.minecraft.storagedrawers.api.IStorageDrawersApi;
|
||||
import com.jaquadro.minecraft.storagedrawers.api.StorageDrawersApi;
|
||||
import com.jaquadro.minecraft.storagedrawers.api.config.IBlockConfig;
|
||||
import com.jaquadro.minecraft.storagedrawers.api.pack.BlockConfiguration;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
@@ -26,17 +28,21 @@ public final class ModCreativeTabs
|
||||
};
|
||||
|
||||
private static Item getTabItem () {
|
||||
ConfigManager config = StorageDrawers.config;
|
||||
IStorageDrawersApi api = StorageDrawersApi.instance();
|
||||
if (api == null)
|
||||
return Item.getItemFromBlock(Blocks.chest);
|
||||
|
||||
if (config.isBlockEnabled("fulldrawers2"))
|
||||
IBlockConfig blockConfig = api.userConfig().blockConfig();
|
||||
|
||||
if (blockConfig.isBlockEnabled(blockConfig.getBlockConfigName(BlockConfiguration.BasicFull2)))
|
||||
return Item.getItemFromBlock(ModBlocks.fullDrawers2);
|
||||
if (config.isBlockEnabled("fulldrawers4"))
|
||||
if (blockConfig.isBlockEnabled(blockConfig.getBlockConfigName(BlockConfiguration.BasicFull4)))
|
||||
return Item.getItemFromBlock(ModBlocks.fullDrawers4);
|
||||
if (config.isBlockEnabled("fulldrawers1"))
|
||||
if (blockConfig.isBlockEnabled(blockConfig.getBlockConfigName(BlockConfiguration.BasicFull1)))
|
||||
return Item.getItemFromBlock(ModBlocks.fullDrawers1);
|
||||
if (config.isBlockEnabled("halfdrawers2"))
|
||||
if (blockConfig.isBlockEnabled(blockConfig.getBlockConfigName(BlockConfiguration.BasicHalf2)))
|
||||
return Item.getItemFromBlock(ModBlocks.halfDrawers2);
|
||||
if (config.isBlockEnabled("halfdrawers4"))
|
||||
if (blockConfig.isBlockEnabled(blockConfig.getBlockConfigName(BlockConfiguration.BasicHalf4)))
|
||||
return Item.getItemFromBlock(ModBlocks.halfDrawers4);
|
||||
|
||||
return Item.getItemFromBlock(Blocks.chest);
|
||||
|
||||
+47
-33
@@ -1,21 +1,33 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.packs.bop.core;
|
||||
|
||||
import com.jaquadro.minecraft.storagedrawers.StorageDrawers;
|
||||
import com.jaquadro.minecraft.storagedrawers.api.IStorageDrawersApi;
|
||||
import com.jaquadro.minecraft.storagedrawers.api.StorageDrawersApi;
|
||||
import com.jaquadro.minecraft.storagedrawers.api.config.IBlockConfig;
|
||||
import com.jaquadro.minecraft.storagedrawers.api.pack.BlockConfiguration;
|
||||
import com.jaquadro.minecraft.storagedrawers.api.pack.IPackDataResolver;
|
||||
import com.jaquadro.minecraft.storagedrawers.config.ConfigManager;
|
||||
import com.jaquadro.minecraft.storagedrawers.core.ModItems;
|
||||
import com.jaquadro.minecraft.storagedrawers.packs.bop.StorageDrawersPack;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
|
||||
public class ModRecipes
|
||||
{
|
||||
public void init () {
|
||||
ConfigManager config = StorageDrawers.config;
|
||||
IStorageDrawersApi api = StorageDrawersApi.instance();
|
||||
if (api == null)
|
||||
return;
|
||||
|
||||
IBlockConfig blockConfig = api.userConfig().blockConfig();
|
||||
|
||||
String nameFull1 = blockConfig.getBlockConfigName(BlockConfiguration.BasicFull1);
|
||||
String nameFull2 = blockConfig.getBlockConfigName(BlockConfiguration.BasicFull2);
|
||||
String nameFull4 = blockConfig.getBlockConfigName(BlockConfiguration.BasicFull4);
|
||||
String nameHalf2 = blockConfig.getBlockConfigName(BlockConfiguration.BasicHalf2);
|
||||
String nameHalf4 = blockConfig.getBlockConfigName(BlockConfiguration.BasicHalf4);
|
||||
String nameTrim = blockConfig.getBlockConfigName(BlockConfiguration.Trim);
|
||||
|
||||
Block planks = GameRegistry.findBlock("BiomesOPlenty", "planks");
|
||||
Block slab1 = GameRegistry.findBlock("BiomesOPlenty", "woodenSingleSlab1");
|
||||
@@ -28,46 +40,48 @@ public class ModRecipes
|
||||
continue;
|
||||
|
||||
if (planks != null) {
|
||||
if (config.isBlockEnabled("fulldrawers1"))
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.fullDrawers1, config.getBlockRecipeOutput("fulldrawers1"), i), "xxx", " y ", "xxx",
|
||||
if (blockConfig.isBlockEnabled(nameFull1))
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.fullDrawers1, blockConfig.getBlockRecipeOutput(nameFull1), i), "xxx", " y ", "xxx",
|
||||
'x', new ItemStack(planks, 1, i), 'y', Blocks.chest);
|
||||
if (config.isBlockEnabled("fulldrawers2"))
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.fullDrawers2, config.getBlockRecipeOutput("fulldrawers2"), i), "xyx", "xxx", "xyx",
|
||||
if (blockConfig.isBlockEnabled(nameFull2))
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.fullDrawers2, blockConfig.getBlockRecipeOutput(nameFull2), i), "xyx", "xxx", "xyx",
|
||||
'x', new ItemStack(planks, 1, i), 'y', Blocks.chest);
|
||||
if (config.isBlockEnabled("fulldrawers4"))
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.fullDrawers4, config.getBlockRecipeOutput("fulldrawers4"), i), "yxy", "xxx", "yxy",
|
||||
if (blockConfig.isBlockEnabled(nameFull4))
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.fullDrawers4, blockConfig.getBlockRecipeOutput(nameFull4), i), "yxy", "xxx", "yxy",
|
||||
'x', new ItemStack(planks, 1, i), 'y', Blocks.chest);
|
||||
if (config.isBlockEnabled("trim")) {
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.trim, config.getBlockRecipeOutput("trim"), i), "xyx", "yyy", "xyx",
|
||||
'x', "stickWood", 'y', new ItemStack(planks, 1, i)));
|
||||
if (blockConfig.isBlockEnabled(nameTrim)) {
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.trim, blockConfig.getBlockRecipeOutput(nameTrim), i), "xyx", "yyy", "xyx",
|
||||
'x', Items.stick, 'y', new ItemStack(planks, 1, i));
|
||||
}
|
||||
}
|
||||
|
||||
Block recipeSlab = (i < 8) ? slab1 : slab2;
|
||||
if (recipeSlab != null) {
|
||||
if (config.isBlockEnabled("halfdrawers2"))
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.halfDrawers2, config.getBlockRecipeOutput("halfdrawers2"), i), "xyx", "xxx", "xyx",
|
||||
if (blockConfig.isBlockEnabled(nameHalf2))
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.halfDrawers2, blockConfig.getBlockRecipeOutput(nameHalf2), i), "xyx", "xxx", "xyx",
|
||||
'x', new ItemStack(recipeSlab, 1, i), 'y', Blocks.chest);
|
||||
if (config.isBlockEnabled("halfdrawers4"))
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.halfDrawers4, config.getBlockRecipeOutput("halfdrawers4"), i), "yxy", "xxx", "yxy",
|
||||
if (blockConfig.isBlockEnabled(nameHalf4))
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.halfDrawers4, blockConfig.getBlockRecipeOutput(nameHalf4), i), "yxy", "xxx", "yxy",
|
||||
'x', new ItemStack(recipeSlab, 1, i), 'y', Blocks.chest);
|
||||
}
|
||||
}
|
||||
|
||||
if (config.isBlockEnabled("fulldrawers1"))
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.upgradeTemplate, 2), "xxx", "xyx", "xxx",
|
||||
'x', "stickWood", 'y', new ItemStack(ModBlocks.fullDrawers1, 1, OreDictionary.WILDCARD_VALUE)));
|
||||
if (config.isBlockEnabled("fulldrawers2"))
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.upgradeTemplate, 2), "xxx", "xyx", "xxx",
|
||||
'x', "stickWood", 'y', new ItemStack(ModBlocks.fullDrawers2, 1, OreDictionary.WILDCARD_VALUE)));
|
||||
if (config.isBlockEnabled("halfdrawers2"))
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.upgradeTemplate, 2), "xxx", "xyx", "xxx",
|
||||
'x', "stickWood", 'y', new ItemStack(ModBlocks.halfDrawers2, 1, OreDictionary.WILDCARD_VALUE)));
|
||||
if (config.isBlockEnabled("fulldrawers4"))
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.upgradeTemplate, 2), "xxx", "xyx", "xxx",
|
||||
'x', "stickWood", 'y', new ItemStack(ModBlocks.fullDrawers4, 1, OreDictionary.WILDCARD_VALUE)));
|
||||
if (config.isBlockEnabled("halfdrawers4"))
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.upgradeTemplate, 2), "xxx", "xyx", "xxx",
|
||||
'x', "stickWood", 'y', new ItemStack(ModBlocks.halfDrawers4, 1, OreDictionary.WILDCARD_VALUE)));
|
||||
ItemStack itemTemplate = new ItemStack(GameRegistry.findItem("StorageDrawers", "upgradeTemplate"), 2);
|
||||
|
||||
if (blockConfig.isBlockEnabled(nameFull1))
|
||||
GameRegistry.addRecipe(itemTemplate, "xxx", "xyx", "xxx",
|
||||
'x', Items.stick, 'y', new ItemStack(ModBlocks.fullDrawers1, 1, OreDictionary.WILDCARD_VALUE));
|
||||
if (blockConfig.isBlockEnabled(nameFull2))
|
||||
GameRegistry.addRecipe(itemTemplate, "xxx", "xyx", "xxx",
|
||||
'x', Items.stick, 'y', new ItemStack(ModBlocks.fullDrawers2, 1, OreDictionary.WILDCARD_VALUE));
|
||||
if (blockConfig.isBlockEnabled(nameFull4))
|
||||
GameRegistry.addRecipe(itemTemplate, "xxx", "xyx", "xxx",
|
||||
'x', Items.stick, 'y', new ItemStack(ModBlocks.halfDrawers2, 1, OreDictionary.WILDCARD_VALUE));
|
||||
if (blockConfig.isBlockEnabled(nameHalf2))
|
||||
GameRegistry.addRecipe(itemTemplate, "xxx", "xyx", "xxx",
|
||||
'x', Items.stick, 'y', new ItemStack(ModBlocks.fullDrawers4, 1, OreDictionary.WILDCARD_VALUE));
|
||||
if (blockConfig.isBlockEnabled(nameHalf4))
|
||||
GameRegistry.addRecipe(itemTemplate, "xxx", "xyx", "xxx",
|
||||
'x', Items.stick, 'y', new ItemStack(ModBlocks.halfDrawers4, 1, OreDictionary.WILDCARD_VALUE));
|
||||
}
|
||||
}
|
||||
+38
-29
@@ -1,13 +1,12 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.packs.bop.core;
|
||||
|
||||
import com.jaquadro.minecraft.storagedrawers.StorageDrawers;
|
||||
import com.jaquadro.minecraft.storagedrawers.api.IStorageDrawersApi;
|
||||
import com.jaquadro.minecraft.storagedrawers.api.StorageDrawersApi;
|
||||
import com.jaquadro.minecraft.storagedrawers.api.config.IBlockConfig;
|
||||
import com.jaquadro.minecraft.storagedrawers.api.config.IUserConfig;
|
||||
import com.jaquadro.minecraft.storagedrawers.api.pack.BlockConfiguration;
|
||||
import com.jaquadro.minecraft.storagedrawers.api.pack.IPackBlockFactory;
|
||||
import com.jaquadro.minecraft.storagedrawers.api.pack.IPackDataResolver;
|
||||
import com.jaquadro.minecraft.storagedrawers.config.ConfigManager;
|
||||
import com.jaquadro.minecraft.storagedrawers.integration.notenoughitems.NEIStorageDrawersConfig;
|
||||
import com.jaquadro.minecraft.storagedrawers.integration.refinedrelocation.*;
|
||||
import com.jaquadro.minecraft.storagedrawers.packs.bop.StorageDrawersPack;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
@@ -24,8 +23,11 @@ public class RefinedRelocation
|
||||
public static Block halfDrawers4;
|
||||
|
||||
public static void init () {
|
||||
ConfigManager config = StorageDrawers.config;
|
||||
if (!Loader.isModLoaded("RefinedRelocation") || !config.cache.enableRefinedRelocationIntegration)
|
||||
IStorageDrawersApi api = StorageDrawersApi.instance();
|
||||
if (api == null)
|
||||
return;
|
||||
|
||||
if (!Loader.isModLoaded("RefinedRelocation") || !api.userConfig().integrationConfig().isRefinedRelocationEnabled())
|
||||
return;
|
||||
|
||||
IPackBlockFactory factory = StorageDrawersApi.instance().packFactory();
|
||||
@@ -37,56 +39,63 @@ public class RefinedRelocation
|
||||
halfDrawers2 = factory.createBlock(BlockConfiguration.SortingHalf2, resolver);
|
||||
halfDrawers4 = factory.createBlock(BlockConfiguration.SortingHalf4, resolver);
|
||||
|
||||
SortingBlockRegistry.register(ModBlocks.fullDrawers1, fullDrawers1);
|
||||
SortingBlockRegistry.register(ModBlocks.fullDrawers2, fullDrawers2);
|
||||
SortingBlockRegistry.register(ModBlocks.fullDrawers4, fullDrawers4);
|
||||
SortingBlockRegistry.register(ModBlocks.halfDrawers2, halfDrawers2);
|
||||
SortingBlockRegistry.register(ModBlocks.halfDrawers4, halfDrawers4);
|
||||
factory.bindSortingBlock(ModBlocks.fullDrawers1, fullDrawers1);
|
||||
factory.bindSortingBlock(ModBlocks.fullDrawers2, fullDrawers2);
|
||||
factory.bindSortingBlock(ModBlocks.fullDrawers4, fullDrawers4);
|
||||
factory.bindSortingBlock(ModBlocks.halfDrawers2, halfDrawers2);
|
||||
factory.bindSortingBlock(ModBlocks.halfDrawers4, halfDrawers4);
|
||||
|
||||
if (config.isBlockEnabled("fulldrawers1"))
|
||||
IUserConfig config = api.userConfig();
|
||||
IBlockConfig blockConfig = config.blockConfig();
|
||||
|
||||
if (blockConfig.isBlockEnabled(blockConfig.getBlockConfigName(BlockConfiguration.SortingFull1)))
|
||||
factory.registerBlock(fullDrawers1, "fullDrawersSort1");
|
||||
if (config.isBlockEnabled("fulldrawers2"))
|
||||
if (blockConfig.isBlockEnabled(blockConfig.getBlockConfigName(BlockConfiguration.SortingFull2)))
|
||||
factory.registerBlock(fullDrawers2, "fullDrawersSort2");
|
||||
if (config.isBlockEnabled("fulldrawers4"))
|
||||
if (blockConfig.isBlockEnabled(blockConfig.getBlockConfigName(BlockConfiguration.SortingFull4)))
|
||||
factory.registerBlock(fullDrawers4, "fullDrawersSort4");
|
||||
if (config.isBlockEnabled("halfdrawers2"))
|
||||
if (blockConfig.isBlockEnabled(blockConfig.getBlockConfigName(BlockConfiguration.SortingHalf2)))
|
||||
factory.registerBlock(halfDrawers2, "halfDrawersSort2");
|
||||
if (config.isBlockEnabled("halfdrawers4"))
|
||||
if (blockConfig.isBlockEnabled(blockConfig.getBlockConfigName(BlockConfiguration.SortingHalf4)))
|
||||
factory.registerBlock(halfDrawers4, "halfDrawersSort4");
|
||||
|
||||
if (!config.cache.addonShowNEI) {
|
||||
NEIStorageDrawersConfig.hideBlock(ModBlocks.getQualifiedName(fullDrawers1));
|
||||
NEIStorageDrawersConfig.hideBlock(ModBlocks.getQualifiedName(fullDrawers2));
|
||||
NEIStorageDrawersConfig.hideBlock(ModBlocks.getQualifiedName(fullDrawers4));
|
||||
NEIStorageDrawersConfig.hideBlock(ModBlocks.getQualifiedName(halfDrawers2));
|
||||
NEIStorageDrawersConfig.hideBlock(ModBlocks.getQualifiedName(halfDrawers4));
|
||||
if (!config.addonConfig().showAddonItemsNEI()) {
|
||||
factory.hideBlock(ModBlocks.getQualifiedName(fullDrawers1));
|
||||
factory.hideBlock(ModBlocks.getQualifiedName(fullDrawers2));
|
||||
factory.hideBlock(ModBlocks.getQualifiedName(fullDrawers4));
|
||||
factory.hideBlock(ModBlocks.getQualifiedName(halfDrawers2));
|
||||
factory.hideBlock(ModBlocks.getQualifiedName(halfDrawers4));
|
||||
}
|
||||
}
|
||||
|
||||
public static void postInit () {
|
||||
ConfigManager config = StorageDrawers.config;
|
||||
if (!Loader.isModLoaded("RefinedRelocation") || !config.cache.enableRefinedRelocationIntegration)
|
||||
IStorageDrawersApi api = StorageDrawersApi.instance();
|
||||
if (api == null)
|
||||
return;
|
||||
|
||||
if (!Loader.isModLoaded("RefinedRelocation") || !api.userConfig().integrationConfig().isRefinedRelocationEnabled())
|
||||
return;
|
||||
|
||||
IPackDataResolver resolver = StorageDrawersPack.instance.resolver;
|
||||
IBlockConfig blockConfig = api.userConfig().blockConfig();
|
||||
|
||||
for (int i = 0; i < 16; i++) {
|
||||
if (!resolver.isValidMetaValue(i))
|
||||
continue;
|
||||
|
||||
if (config.isBlockEnabled("fulldrawers1"))
|
||||
if (blockConfig.isBlockEnabled(blockConfig.getBlockConfigName(BlockConfiguration.SortingFull1)))
|
||||
GameRegistry.addRecipe(new ItemStack(fullDrawers1, 1, i), "x x", " y ", "x x",
|
||||
'x', Items.gold_nugget, 'y', new ItemStack(ModBlocks.fullDrawers1, 1, i));
|
||||
if (config.isBlockEnabled("fulldrawers2"))
|
||||
if (blockConfig.isBlockEnabled(blockConfig.getBlockConfigName(BlockConfiguration.SortingFull2)))
|
||||
GameRegistry.addRecipe(new ItemStack(fullDrawers2, 1, i), "x x", " y ", "x x",
|
||||
'x', Items.gold_nugget, 'y', new ItemStack(ModBlocks.fullDrawers2, 1, i));
|
||||
if (config.isBlockEnabled("halfdrawers2"))
|
||||
if (blockConfig.isBlockEnabled(blockConfig.getBlockConfigName(BlockConfiguration.SortingFull4)))
|
||||
GameRegistry.addRecipe(new ItemStack(halfDrawers2, 1, i), "x x", " y ", "x x",
|
||||
'x', Items.gold_nugget, 'y', new ItemStack(ModBlocks.halfDrawers2, 1, i));
|
||||
if (config.isBlockEnabled("fulldrawers4"))
|
||||
if (blockConfig.isBlockEnabled(blockConfig.getBlockConfigName(BlockConfiguration.SortingHalf2)))
|
||||
GameRegistry.addRecipe(new ItemStack(fullDrawers4, 1, i), "x x", " y ", "x x",
|
||||
'x', Items.gold_nugget, 'y', new ItemStack(ModBlocks.fullDrawers4, 1, i));
|
||||
if (config.isBlockEnabled("halfdrawers4"))
|
||||
if (blockConfig.isBlockEnabled(blockConfig.getBlockConfigName(BlockConfiguration.SortingHalf4)))
|
||||
GameRegistry.addRecipe(new ItemStack(halfDrawers4, 1, i), "x x", " y ", "x x",
|
||||
'x', Items.gold_nugget, 'y', new ItemStack(ModBlocks.halfDrawers4, 1, i));
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.api;
|
||||
|
||||
import com.jaquadro.minecraft.storagedrawers.api.config.IUserConfig;
|
||||
import com.jaquadro.minecraft.storagedrawers.api.pack.IPackBlockFactory;
|
||||
import com.jaquadro.minecraft.storagedrawers.api.registry.IRecipeHandlerRegistry;
|
||||
import com.jaquadro.minecraft.storagedrawers.api.registry.IRenderRegistry;
|
||||
@@ -17,4 +18,9 @@ public interface IStorageDrawersApi
|
||||
IWailaRegistry wailaRegistry ();
|
||||
|
||||
IPackBlockFactory packFactory ();
|
||||
|
||||
/**
|
||||
* User-managed configuration for the Storage Drawers mod.
|
||||
*/
|
||||
IUserConfig userConfig ();
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.api.config;
|
||||
|
||||
public interface IAddonConfig
|
||||
{
|
||||
/**
|
||||
* Gets whether the user has configured a preference for addon packs to hide their blocks and items from Vanilla
|
||||
* creative tabs.
|
||||
*/
|
||||
boolean showAddonItemsNEI ();
|
||||
|
||||
/**
|
||||
* Gets whether the user has configured a preference for addon packs to hide their blocks and items from NEI.
|
||||
*/
|
||||
boolean showAddonItemsVanilla ();
|
||||
|
||||
/**
|
||||
* Gets whether the user has configured a preference for addon packs to provide their blocks and items through
|
||||
* their own vanilla tab.
|
||||
*/
|
||||
boolean addonItemsUseSeparateTab ();
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.api.config;
|
||||
|
||||
import com.jaquadro.minecraft.storagedrawers.api.pack.BlockConfiguration;
|
||||
|
||||
public interface IBlockConfig
|
||||
{
|
||||
String getBlockConfigName (BlockConfiguration blockConfig);
|
||||
|
||||
boolean isBlockEnabled (String blockConfigName);
|
||||
|
||||
int getBlockRecipeOutput (String blockConfigName);
|
||||
|
||||
int getBaseCapacity (String blockConfigName);
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.api.config;
|
||||
|
||||
public interface IIntegrationConfig
|
||||
{
|
||||
boolean isRefinedRelocationEnabled ();
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.api.config;
|
||||
|
||||
/**
|
||||
* The main hub for user-managed mod configuration.
|
||||
*/
|
||||
public interface IUserConfig
|
||||
{
|
||||
/**
|
||||
* Configuration options related to third party addon packs for Storage Drawers.
|
||||
*/
|
||||
IAddonConfig addonConfig ();
|
||||
|
||||
/**
|
||||
* Configuration options related to individual blocks.
|
||||
*/
|
||||
IBlockConfig blockConfig ();
|
||||
|
||||
/**
|
||||
* Configuration options related to third party mod integration.
|
||||
*/
|
||||
IIntegrationConfig integrationConfig ();
|
||||
}
|
||||
@@ -7,5 +7,18 @@ public interface IPackBlockFactory
|
||||
{
|
||||
Block createBlock (BlockConfiguration blockConfig, IPackDataResolver dataResolver);
|
||||
|
||||
/**
|
||||
* Registers a factory-produced block with an appropriate item class.
|
||||
*/
|
||||
void registerBlock (Block block, String name);
|
||||
|
||||
/**
|
||||
* Associates a sorting variant of a block with its corresponding basic block.
|
||||
*/
|
||||
void bindSortingBlock (Block basicBlock, Block sortingBlock);
|
||||
|
||||
/**
|
||||
* Hides block from NEI if NEI is active.
|
||||
*/
|
||||
void hideBlock (String blockID);
|
||||
}
|
||||
@@ -1,5 +1,10 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.config;
|
||||
|
||||
import com.jaquadro.minecraft.storagedrawers.api.config.IAddonConfig;
|
||||
import com.jaquadro.minecraft.storagedrawers.api.config.IBlockConfig;
|
||||
import com.jaquadro.minecraft.storagedrawers.api.config.IIntegrationConfig;
|
||||
import com.jaquadro.minecraft.storagedrawers.api.config.IUserConfig;
|
||||
import com.jaquadro.minecraft.storagedrawers.api.pack.BlockConfiguration;
|
||||
import net.minecraftforge.common.config.ConfigCategory;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
|
||||
@@ -81,6 +86,89 @@ public class ConfigManager
|
||||
public boolean addonShowVanilla;
|
||||
}
|
||||
|
||||
private class AddonConfig implements IAddonConfig {
|
||||
@Override
|
||||
public boolean showAddonItemsNEI () {
|
||||
return cache.addonShowNEI;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean showAddonItemsVanilla () {
|
||||
return cache.addonShowVanilla;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addonItemsUseSeparateTab () {
|
||||
return cache.addonSeparateVanilla;
|
||||
}
|
||||
}
|
||||
|
||||
private class BlockConfig implements IBlockConfig {
|
||||
@Override
|
||||
public String getBlockConfigName (BlockConfiguration blockConfig) {
|
||||
switch (blockConfig) {
|
||||
case BasicFull1:
|
||||
case SortingFull1:
|
||||
return "fulldrawers1";
|
||||
case BasicFull2:
|
||||
case SortingFull2:
|
||||
return "fulldrawers2";
|
||||
case BasicFull4:
|
||||
case SortingFull4:
|
||||
return "fulldrawers4";
|
||||
case BasicHalf2:
|
||||
case SortingHalf2:
|
||||
return "halfdrawers2";
|
||||
case BasicHalf4:
|
||||
case SortingHalf4:
|
||||
return "halfdrawers4";
|
||||
case Trim:
|
||||
return "trim";
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBlockEnabled (String blockConfigName) {
|
||||
return ConfigManager.this.isBlockEnabled(blockConfigName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBlockRecipeOutput (String blockConfigName) {
|
||||
return ConfigManager.this.getBlockRecipeOutput(blockConfigName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBaseCapacity (String blockConfigName) {
|
||||
return ConfigManager.this.getBlockBaseStorage(blockConfigName);
|
||||
}
|
||||
}
|
||||
|
||||
private class IntegrationConfig implements IIntegrationConfig {
|
||||
@Override
|
||||
public boolean isRefinedRelocationEnabled () {
|
||||
return cache.enableRefinedRelocationIntegration;
|
||||
}
|
||||
}
|
||||
|
||||
private class UserConfig implements IUserConfig {
|
||||
@Override
|
||||
public IAddonConfig addonConfig () {
|
||||
return addonConfig;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockConfig blockConfig () {
|
||||
return blockConfig;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIntegrationConfig integrationConfig () {
|
||||
return integrationConfig;
|
||||
}
|
||||
}
|
||||
|
||||
private static final String LANG_PREFIX = "storageDrawers.config.";
|
||||
|
||||
private final Configuration config;
|
||||
@@ -106,6 +194,11 @@ public class ConfigManager
|
||||
|
||||
public Map<String, ConfigSection> blockSectionsMap = new HashMap<String, ConfigSection>();
|
||||
|
||||
public IAddonConfig addonConfig = new AddonConfig();
|
||||
public IBlockConfig blockConfig = new BlockConfig();
|
||||
public IIntegrationConfig integrationConfig = new IntegrationConfig();
|
||||
public IUserConfig userConfig = new UserConfig();
|
||||
|
||||
//private Property itemRenderType;
|
||||
|
||||
public ConfigManager (File file) {
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.jaquadro.minecraft.storagedrawers.core;
|
||||
|
||||
import com.jaquadro.minecraft.storagedrawers.StorageDrawers;
|
||||
import com.jaquadro.minecraft.storagedrawers.api.IStorageDrawersApi;
|
||||
import com.jaquadro.minecraft.storagedrawers.api.config.IUserConfig;
|
||||
import com.jaquadro.minecraft.storagedrawers.api.pack.IPackBlockFactory;
|
||||
import com.jaquadro.minecraft.storagedrawers.api.registry.IRecipeHandlerRegistry;
|
||||
import com.jaquadro.minecraft.storagedrawers.api.registry.IRenderRegistry;
|
||||
@@ -37,4 +38,9 @@ public class Api implements IStorageDrawersApi
|
||||
public IPackBlockFactory packFactory () {
|
||||
return packFactory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IUserConfig userConfig () {
|
||||
return StorageDrawers.config.userConfig;
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,8 @@ import com.jaquadro.minecraft.storagedrawers.integration.IntegrationRegistry;
|
||||
import com.jaquadro.minecraft.storagedrawers.block.pack.BlockDrawersPack;
|
||||
import com.jaquadro.minecraft.storagedrawers.block.pack.BlockSortingDrawersPack;
|
||||
import com.jaquadro.minecraft.storagedrawers.block.pack.BlockTrimPack;
|
||||
import com.jaquadro.minecraft.storagedrawers.integration.notenoughitems.NEIStorageDrawersConfig;
|
||||
import com.jaquadro.minecraft.storagedrawers.integration.refinedrelocation.SortingBlockRegistry;
|
||||
import com.jaquadro.minecraft.storagedrawers.item.pack.ItemDrawersPack;
|
||||
import com.jaquadro.minecraft.storagedrawers.item.pack.ItemSortingDrawersPack;
|
||||
import com.jaquadro.minecraft.storagedrawers.item.pack.ItemTrimPack;
|
||||
@@ -40,4 +42,14 @@ public class PackFactory implements IPackBlockFactory
|
||||
else if (block instanceof BlockTrimPack)
|
||||
GameRegistry.registerBlock(block, ItemTrimPack.class, name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bindSortingBlock (Block basicBlock, Block sortingBlock) {
|
||||
SortingBlockRegistry.register(basicBlock, sortingBlock);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void hideBlock (String blockID) {
|
||||
NEIStorageDrawersConfig.hideBlock(blockID);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user