mirror of
https://github.com/GTNewHorizons/StorageDrawers.git
synced 2026-11-13 00:47:31 +00:00
Forestry pack updates
This commit is contained in:
1 parent
104e79a09c
commit
bef4a21b9f
12 files changed
+258
-575
No files matched your search
@@ -17,7 +17,7 @@ buildscript {
|
||||
|
||||
apply plugin: 'forge'
|
||||
|
||||
version = "1.7.10-1.0.1"
|
||||
version = "1.7.10-1.0.3"
|
||||
group= "com.jaquadro.minecraft.storagedrawers" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||
archivesBaseName = "StorageDrawers-Forestry"
|
||||
|
||||
@@ -26,7 +26,7 @@ minecraft {
|
||||
assetDir = "../../runtime/assets"
|
||||
|
||||
replace '@VERSION@', project.version
|
||||
replace 'required-after:StorageDrawers', "required-after:StorageDrawers@[1.5.4,)"
|
||||
replace 'required-after:StorageDrawers', "required-after:StorageDrawers@[1.5.8,)"
|
||||
}
|
||||
|
||||
sourceSets.main {
|
||||
|
||||
+11
@@ -1,6 +1,9 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.packs.forestry;
|
||||
|
||||
import com.jaquadro.minecraft.storagedrawers.api.pack.IPackDataResolver;
|
||||
import com.jaquadro.minecraft.storagedrawers.api.pack.StandardDataResolver;
|
||||
import com.jaquadro.minecraft.storagedrawers.packs.forestry.core.ModBlocks;
|
||||
import com.jaquadro.minecraft.storagedrawers.packs.forestry.core.ModCreativeTabs;
|
||||
import com.jaquadro.minecraft.storagedrawers.packs.forestry.core.ModRecipes;
|
||||
import com.jaquadro.minecraft.storagedrawers.packs.forestry.core.RefinedRelocation;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
@@ -17,6 +20,14 @@ public class StorageDrawersPack
|
||||
public static final String MOD_VERSION = "@VERSION@";
|
||||
public static final String SOURCE_PATH = "com.jaquadro.minecraft.storagedrawers.packs.forestry.";
|
||||
|
||||
public IPackDataResolver resolver1 = new StandardDataResolver(MOD_ID, new String[] {
|
||||
"larch", "teak", "acacia", "lime", "chestnut", "wenge", "baobab", "sequoia", "kapok", "ebony", "mahogany", "balsa", "willow", "walnut", "greenheart", "cherry"
|
||||
}, ModCreativeTabs.tabStorageDrawers);
|
||||
|
||||
public IPackDataResolver resolver2 = new StandardDataResolver(MOD_ID, new String[] {
|
||||
"mahoe", "poplar", "palm", "papaya", "pine", "plum", "maple", "citrus", "giganteum", "ipe", "padauk", "cocobolo", "zebrawood"
|
||||
}, ModCreativeTabs.tabStorageDrawers);
|
||||
|
||||
public ModBlocks blocks = new ModBlocks();
|
||||
public ModRecipes recipes = new ModRecipes();
|
||||
|
||||
|
||||
-78
@@ -1,78 +0,0 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.packs.forestry.block;
|
||||
|
||||
import com.jaquadro.minecraft.storagedrawers.StorageDrawers;
|
||||
import com.jaquadro.minecraft.storagedrawers.block.BlockDrawers;
|
||||
import com.jaquadro.minecraft.storagedrawers.packs.forestry.StorageDrawersPack;
|
||||
import com.jaquadro.minecraft.storagedrawers.packs.forestry.core.ModCreativeTabs;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlockDrawersPack extends BlockDrawers
|
||||
{
|
||||
public static String[] textureNames1 = new String[] { "larch", "teak", "acacia", "lime", "chestnut", "wenge", "baobab", "sequoia", "kapok", "ebony", "mahogany", "balsa", "willow", "walnut", "greenheart", "cherry"};
|
||||
public static String[] textureNames2 = new String[] { "mahoe", "poplar", "palm", "papaya", "pine", "plum", "maple", "citrus", "giganteum", "ipe", "padauk", "cocobolo", "zebrawood" };
|
||||
|
||||
private String[] blockTextures;
|
||||
|
||||
public BlockDrawersPack (String blockName, int drawerCount, boolean halfDepth, int textureGroup) {
|
||||
super(Material.wood, blockName, drawerCount, halfDepth);
|
||||
|
||||
if (textureGroup == 0)
|
||||
blockTextures = textureNames1;
|
||||
else if (textureGroup == 1)
|
||||
blockTextures = textureNames2;
|
||||
|
||||
if (StorageDrawers.config.cache.addonSeparateVanilla)
|
||||
setCreativeTab(ModCreativeTabs.tabStorageDrawers);
|
||||
else
|
||||
setCreativeTab(com.jaquadro.minecraft.storagedrawers.core.ModCreativeTabs.tabStorageDrawers);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks (Item item, CreativeTabs creativeTabs, List list) {
|
||||
if (!StorageDrawers.config.cache.addonShowVanilla)
|
||||
return;
|
||||
|
||||
for (int i = 0; i < blockTextures.length; i++) {
|
||||
if (blockTextures[i] != null)
|
||||
list.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons (IIconRegister register) {
|
||||
super.registerBlockIcons(register);
|
||||
|
||||
String[] subtex = blockTextures;
|
||||
|
||||
iconSide = new IIcon[subtex.length];
|
||||
iconSideH = new IIcon[subtex.length];
|
||||
iconSideV = new IIcon[subtex.length];
|
||||
iconFront1 = new IIcon[subtex.length];
|
||||
iconFront2 = new IIcon[subtex.length];
|
||||
iconFront4 = new IIcon[subtex.length];
|
||||
iconTrim = new IIcon[subtex.length];
|
||||
|
||||
for (int i = 0; i < subtex.length; i++) {
|
||||
if (subtex[i] == null)
|
||||
continue;
|
||||
|
||||
iconFront1[i] = register.registerIcon(StorageDrawersPack.MOD_ID + ":drawers_" + subtex[i] + "_front_1");
|
||||
iconFront2[i] = register.registerIcon(StorageDrawersPack.MOD_ID + ":drawers_" + subtex[i] + "_front_2");
|
||||
iconFront4[i] = register.registerIcon(StorageDrawersPack.MOD_ID + ":drawers_" + subtex[i] + "_front_4");
|
||||
iconSide[i] = register.registerIcon(StorageDrawersPack.MOD_ID + ":drawers_" + subtex[i] + "_side");
|
||||
iconSideV[i] = register.registerIcon(StorageDrawersPack.MOD_ID + ":drawers_" + subtex[i] + "_side_v");
|
||||
iconSideH[i] = register.registerIcon(StorageDrawersPack.MOD_ID + ":drawers_" + subtex[i] + "_side_h");
|
||||
iconTrim[i] = register.registerIcon(StorageDrawersPack.MOD_ID + ":drawers_" + subtex[i] + "_trim");
|
||||
}
|
||||
}
|
||||
}
|
||||
-76
@@ -1,76 +0,0 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.packs.forestry.block;
|
||||
|
||||
import com.jaquadro.minecraft.storagedrawers.StorageDrawers;
|
||||
import com.jaquadro.minecraft.storagedrawers.integration.refinedrelocation.BlockSortingDrawers;
|
||||
import com.jaquadro.minecraft.storagedrawers.packs.forestry.core.ModCreativeTabs;
|
||||
import com.jaquadro.minecraft.storagedrawers.packs.forestry.StorageDrawersPack;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlockSortingDrawersPack extends BlockSortingDrawers
|
||||
{
|
||||
private String[] blockTextures;
|
||||
|
||||
public BlockSortingDrawersPack (String blockName, int drawerCount, boolean halfDepth, int textureGroup) {
|
||||
super(blockName, drawerCount, halfDepth);
|
||||
|
||||
if (textureGroup == 0)
|
||||
blockTextures = BlockDrawersPack.textureNames1;
|
||||
else if (textureGroup == 1)
|
||||
blockTextures = BlockDrawersPack.textureNames2;
|
||||
|
||||
if (StorageDrawers.config.cache.addonSeparateVanilla)
|
||||
setCreativeTab(ModCreativeTabs.tabStorageDrawers);
|
||||
else
|
||||
setCreativeTab(com.jaquadro.minecraft.storagedrawers.core.ModCreativeTabs.tabStorageDrawers);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks (Item item, CreativeTabs creativeTabs, List list) {
|
||||
if (!StorageDrawers.config.cache.addonShowVanilla)
|
||||
return;
|
||||
|
||||
for (int i = 0; i < blockTextures.length; i++) {
|
||||
if (blockTextures[i] != null)
|
||||
list.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons (IIconRegister register) {
|
||||
super.registerBlockIcons(register);
|
||||
|
||||
String[] subtex = blockTextures;
|
||||
|
||||
iconSide = new IIcon[subtex.length];
|
||||
iconSideH = new IIcon[subtex.length];
|
||||
iconSideV = new IIcon[subtex.length];
|
||||
iconFront1 = new IIcon[subtex.length];
|
||||
iconFront2 = new IIcon[subtex.length];
|
||||
iconFront4 = new IIcon[subtex.length];
|
||||
iconTrim = new IIcon[subtex.length];
|
||||
iconSort = new IIcon[subtex.length];
|
||||
|
||||
for (int i = 0; i < subtex.length; i++) {
|
||||
if (subtex[i] == null)
|
||||
continue;
|
||||
|
||||
iconFront1[i] = register.registerIcon(StorageDrawersPack.MOD_ID + ":drawers_" + subtex[i] + "_front_1");
|
||||
iconFront2[i] = register.registerIcon(StorageDrawersPack.MOD_ID + ":drawers_" + subtex[i] + "_front_2");
|
||||
iconFront4[i] = register.registerIcon(StorageDrawersPack.MOD_ID + ":drawers_" + subtex[i] + "_front_4");
|
||||
iconSide[i] = register.registerIcon(StorageDrawersPack.MOD_ID + ":drawers_" + subtex[i] + "_side");
|
||||
iconSideV[i] = register.registerIcon(StorageDrawersPack.MOD_ID + ":drawers_" + subtex[i] + "_side_v");
|
||||
iconSideH[i] = register.registerIcon(StorageDrawersPack.MOD_ID + ":drawers_" + subtex[i] + "_side_h");
|
||||
iconTrim[i] = register.registerIcon(StorageDrawersPack.MOD_ID + ":drawers_" + subtex[i] + "_trim");
|
||||
iconSort[i] = register.registerIcon(StorageDrawersPack.MOD_ID + ":drawers_" + subtex[i] + "_sort");
|
||||
}
|
||||
}
|
||||
}
|
||||
-53
@@ -1,53 +0,0 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.packs.forestry.block;
|
||||
|
||||
import com.jaquadro.minecraft.storagedrawers.StorageDrawers;
|
||||
import com.jaquadro.minecraft.storagedrawers.block.BlockTrim;
|
||||
import com.jaquadro.minecraft.storagedrawers.packs.forestry.core.ModBlocks;
|
||||
import com.jaquadro.minecraft.storagedrawers.packs.forestry.core.ModCreativeTabs;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlockTrimPack extends BlockTrim
|
||||
{
|
||||
private String[] blockTextures;
|
||||
|
||||
public BlockTrimPack (String name, int textureGroup) {
|
||||
super(name);
|
||||
|
||||
if (textureGroup == 0)
|
||||
blockTextures = BlockDrawersPack.textureNames1;
|
||||
else if (textureGroup == 1)
|
||||
blockTextures = BlockDrawersPack.textureNames2;
|
||||
|
||||
if (StorageDrawers.config.cache.addonSeparateVanilla)
|
||||
setCreativeTab(ModCreativeTabs.tabStorageDrawers);
|
||||
else
|
||||
setCreativeTab(com.jaquadro.minecraft.storagedrawers.core.ModCreativeTabs.tabStorageDrawers);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks (Item item, CreativeTabs creativeTabs, List list) {
|
||||
if (!StorageDrawers.config.cache.addonShowVanilla)
|
||||
return;
|
||||
|
||||
for (int i = 0; i < blockTextures.length; i++) {
|
||||
if (blockTextures[i] != null)
|
||||
list.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon (int side, int meta) {
|
||||
if (blockTextures == BlockDrawersPack.textureNames1)
|
||||
return ModBlocks.fullDrawers1A.getIcon(0, meta);
|
||||
else
|
||||
return ModBlocks.fullDrawers1B.getIcon(0, meta);
|
||||
}
|
||||
}
|
||||
+72
-69
@@ -1,98 +1,101 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.packs.forestry.core;
|
||||
|
||||
import com.jaquadro.minecraft.storagedrawers.StorageDrawers;
|
||||
import com.jaquadro.minecraft.storagedrawers.block.*;
|
||||
import com.jaquadro.minecraft.storagedrawers.config.ConfigManager;
|
||||
import com.jaquadro.minecraft.storagedrawers.integration.notenoughitems.NEIStorageDrawersConfig;
|
||||
import com.jaquadro.minecraft.storagedrawers.packs.forestry.block.BlockDrawersPack;
|
||||
import com.jaquadro.minecraft.storagedrawers.packs.forestry.item.ItemDrawersPack;
|
||||
import com.jaquadro.minecraft.storagedrawers.packs.forestry.item.ItemTrimPack;
|
||||
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.packs.forestry.StorageDrawersPack;
|
||||
import com.jaquadro.minecraft.storagedrawers.packs.forestry.block.BlockTrimPack;
|
||||
import cpw.mods.fml.common.registry.GameData;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
public class ModBlocks
|
||||
{
|
||||
public static BlockDrawers fullDrawers1A;
|
||||
public static BlockDrawers fullDrawers2A;
|
||||
public static BlockDrawers fullDrawers4A;
|
||||
public static BlockDrawers halfDrawers2A;
|
||||
public static BlockDrawers halfDrawers4A;
|
||||
public static BlockTrim trimA;
|
||||
public static Block fullDrawers1A;
|
||||
public static Block fullDrawers2A;
|
||||
public static Block fullDrawers4A;
|
||||
public static Block halfDrawers2A;
|
||||
public static Block halfDrawers4A;
|
||||
public static Block trimA;
|
||||
|
||||
public static BlockDrawers fullDrawers1B;
|
||||
public static BlockDrawers fullDrawers2B;
|
||||
public static BlockDrawers fullDrawers4B;
|
||||
public static BlockDrawers halfDrawers2B;
|
||||
public static BlockDrawers halfDrawers4B;
|
||||
public static BlockTrim trimB;
|
||||
public static Block fullDrawers1B;
|
||||
public static Block fullDrawers2B;
|
||||
public static Block fullDrawers4B;
|
||||
public static Block halfDrawers2B;
|
||||
public static Block halfDrawers4B;
|
||||
public static Block trimB;
|
||||
|
||||
public void init () {
|
||||
fullDrawers1A = new BlockDrawersPack(makeName("fullDrawers1"), 1, false, 0);
|
||||
fullDrawers2A = new BlockDrawersPack(makeName("fullDrawers2"), 2, false, 0);
|
||||
fullDrawers4A = new BlockDrawersPack(makeName("fullDrawers4"), 4, false, 0);
|
||||
halfDrawers2A = new BlockDrawersPack(makeName("halfDrawers2"), 2, true, 0);
|
||||
halfDrawers4A = new BlockDrawersPack(makeName("halfDrawers4"), 4, true, 0);
|
||||
trimA = new BlockTrimPack(makeName("trim"), 0);
|
||||
IStorageDrawersApi api = StorageDrawersApi.instance();
|
||||
if (api == null)
|
||||
return;
|
||||
|
||||
fullDrawers1B = new BlockDrawersPack(makeName("fullDrawers1"), 1, false, 1);
|
||||
fullDrawers2B = new BlockDrawersPack(makeName("fullDrawers2"), 2, false, 1);
|
||||
fullDrawers4B = new BlockDrawersPack(makeName("fullDrawers4"), 4, false, 1);
|
||||
halfDrawers2B = new BlockDrawersPack(makeName("halfDrawers2"), 2, true, 1);
|
||||
halfDrawers4B = new BlockDrawersPack(makeName("halfDrawers4"), 4, true, 1);
|
||||
trimB = new BlockTrimPack(makeName("trim"), 1);
|
||||
IPackBlockFactory factory = api.packFactory();
|
||||
IPackDataResolver resolver1 = StorageDrawersPack.instance.resolver1;
|
||||
IPackDataResolver resolver2 = StorageDrawersPack.instance.resolver2;
|
||||
|
||||
ConfigManager config = StorageDrawers.config;
|
||||
fullDrawers1A = factory.createBlock(BlockConfiguration.BasicFull1, resolver1);
|
||||
fullDrawers2A = factory.createBlock(BlockConfiguration.BasicFull2, resolver1);
|
||||
fullDrawers4A = factory.createBlock(BlockConfiguration.BasicFull4, resolver1);
|
||||
halfDrawers2A = factory.createBlock(BlockConfiguration.BasicHalf2, resolver1);
|
||||
halfDrawers4A = factory.createBlock(BlockConfiguration.BasicHalf4, resolver1);
|
||||
trimA = factory.createBlock(BlockConfiguration.Trim, resolver1);
|
||||
|
||||
if (config.isBlockEnabled("fulldrawers1")) {
|
||||
GameRegistry.registerBlock(fullDrawers1A, ItemDrawersPack.class, "fullDrawers1A");
|
||||
GameRegistry.registerBlock(fullDrawers1B, ItemDrawersPack.class, "fullDrawers1B");
|
||||
fullDrawers1B = factory.createBlock(BlockConfiguration.BasicFull1, resolver2);
|
||||
fullDrawers2B = factory.createBlock(BlockConfiguration.BasicFull2, resolver2);
|
||||
fullDrawers4B = factory.createBlock(BlockConfiguration.BasicFull4, resolver2);
|
||||
halfDrawers2B = factory.createBlock(BlockConfiguration.BasicHalf2, resolver2);
|
||||
halfDrawers4B = factory.createBlock(BlockConfiguration.BasicHalf4, resolver2);
|
||||
trimB = factory.createBlock(BlockConfiguration.Trim, resolver2);
|
||||
|
||||
IUserConfig config = api.userConfig();
|
||||
IBlockConfig blockConfig = config.blockConfig();
|
||||
|
||||
if (blockConfig.isBlockEnabled(blockConfig.getBlockConfigName(BlockConfiguration.BasicFull1))) {
|
||||
factory.registerBlock(fullDrawers1A, "fullDrawers1A");
|
||||
factory.registerBlock(fullDrawers1B, "fullDrawers1B");
|
||||
}
|
||||
if (config.isBlockEnabled("fulldrawers2")) {
|
||||
GameRegistry.registerBlock(fullDrawers2A, ItemDrawersPack.class, "fullDrawers2A");
|
||||
GameRegistry.registerBlock(fullDrawers2B, ItemDrawersPack.class, "fullDrawers2B");
|
||||
if (blockConfig.isBlockEnabled(blockConfig.getBlockConfigName(BlockConfiguration.BasicFull2))) {
|
||||
factory.registerBlock(fullDrawers2A, "fullDrawers2A");
|
||||
factory.registerBlock(fullDrawers2B, "fullDrawers2B");
|
||||
}
|
||||
if (config.isBlockEnabled("fulldrawers4")) {
|
||||
GameRegistry.registerBlock(fullDrawers4A, ItemDrawersPack.class, "fullDrawers4A");
|
||||
GameRegistry.registerBlock(fullDrawers4B, ItemDrawersPack.class, "fullDrawers4B");
|
||||
if (blockConfig.isBlockEnabled(blockConfig.getBlockConfigName(BlockConfiguration.BasicFull4))) {
|
||||
factory.registerBlock(fullDrawers4A, "fullDrawers4A");
|
||||
factory.registerBlock(fullDrawers4B, "fullDrawers4B");
|
||||
}
|
||||
if (config.isBlockEnabled("halfdrawers2")) {
|
||||
GameRegistry.registerBlock(halfDrawers2A, ItemDrawersPack.class, "halfDrawers2A");
|
||||
GameRegistry.registerBlock(halfDrawers2B, ItemDrawersPack.class, "halfDrawers2B");
|
||||
if (blockConfig.isBlockEnabled(blockConfig.getBlockConfigName(BlockConfiguration.BasicHalf2))) {
|
||||
factory.registerBlock(halfDrawers2A, "halfDrawers2A");
|
||||
factory.registerBlock(halfDrawers2B, "halfDrawers2B");
|
||||
}
|
||||
if (config.isBlockEnabled("halfdrawers4")) {
|
||||
GameRegistry.registerBlock(halfDrawers4A, ItemDrawersPack.class, "halfDrawers4A");
|
||||
GameRegistry.registerBlock(halfDrawers4B, ItemDrawersPack.class, "halfDrawers4B");
|
||||
if (blockConfig.isBlockEnabled(blockConfig.getBlockConfigName(BlockConfiguration.BasicHalf4))) {
|
||||
factory.registerBlock(halfDrawers4A, "halfDrawers4A");
|
||||
factory.registerBlock(halfDrawers4B, "halfDrawers4B");
|
||||
}
|
||||
if (config.isBlockEnabled("trim")) {
|
||||
GameRegistry.registerBlock(trimA, ItemTrimPack.class, "trimA");
|
||||
GameRegistry.registerBlock(trimB, ItemTrimPack.class, "trimB");
|
||||
if (blockConfig.isBlockEnabled(blockConfig.getBlockConfigName(BlockConfiguration.Trim))) {
|
||||
factory.registerBlock(trimA, "trimA");
|
||||
factory.registerBlock(trimB, "trimB");
|
||||
}
|
||||
|
||||
if (!config.cache.addonShowNEI) {
|
||||
NEIStorageDrawersConfig.hideBlock(getQualifiedName(fullDrawers1A));
|
||||
NEIStorageDrawersConfig.hideBlock(getQualifiedName(fullDrawers2A));
|
||||
NEIStorageDrawersConfig.hideBlock(getQualifiedName(fullDrawers4A));
|
||||
NEIStorageDrawersConfig.hideBlock(getQualifiedName(halfDrawers2A));
|
||||
NEIStorageDrawersConfig.hideBlock(getQualifiedName(halfDrawers4A));
|
||||
NEIStorageDrawersConfig.hideBlock(getQualifiedName(trimA));
|
||||
if (!config.addonConfig().showAddonItemsNEI()) {
|
||||
factory.hideBlock(getQualifiedName(fullDrawers1A));
|
||||
factory.hideBlock(getQualifiedName(fullDrawers2A));
|
||||
factory.hideBlock(getQualifiedName(fullDrawers4A));
|
||||
factory.hideBlock(getQualifiedName(halfDrawers2A));
|
||||
factory.hideBlock(getQualifiedName(halfDrawers4A));
|
||||
factory.hideBlock(getQualifiedName(trimA));
|
||||
|
||||
NEIStorageDrawersConfig.hideBlock(getQualifiedName(fullDrawers1B));
|
||||
NEIStorageDrawersConfig.hideBlock(getQualifiedName(fullDrawers2B));
|
||||
NEIStorageDrawersConfig.hideBlock(getQualifiedName(fullDrawers4B));
|
||||
NEIStorageDrawersConfig.hideBlock(getQualifiedName(halfDrawers2B));
|
||||
NEIStorageDrawersConfig.hideBlock(getQualifiedName(halfDrawers4B));
|
||||
NEIStorageDrawersConfig.hideBlock(getQualifiedName(trimB));
|
||||
factory.hideBlock(getQualifiedName(fullDrawers1B));
|
||||
factory.hideBlock(getQualifiedName(fullDrawers2B));
|
||||
factory.hideBlock(getQualifiedName(fullDrawers4B));
|
||||
factory.hideBlock(getQualifiedName(halfDrawers2B));
|
||||
factory.hideBlock(getQualifiedName(halfDrawers4B));
|
||||
factory.hideBlock(getQualifiedName(trimB));
|
||||
}
|
||||
}
|
||||
|
||||
public static String getQualifiedName (Block block) {
|
||||
return GameData.getBlockRegistry().getNameForObject(block);
|
||||
}
|
||||
|
||||
public static String makeName (String name) {
|
||||
return StorageDrawersPack.MOD_ID.toLowerCase() + "." + name;
|
||||
}
|
||||
}
|
||||
+14
-6
@@ -1,6 +1,10 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.packs.forestry.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.config.ConfigManager;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -26,17 +30,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.fullDrawers2A);
|
||||
if (config.isBlockEnabled("fulldrawers4"))
|
||||
if (blockConfig.isBlockEnabled(blockConfig.getBlockConfigName(BlockConfiguration.BasicFull4)))
|
||||
return Item.getItemFromBlock(ModBlocks.fullDrawers4A);
|
||||
if (config.isBlockEnabled("fulldrawers1"))
|
||||
if (blockConfig.isBlockEnabled(blockConfig.getBlockConfigName(BlockConfiguration.BasicFull1)))
|
||||
return Item.getItemFromBlock(ModBlocks.fullDrawers1A);
|
||||
if (config.isBlockEnabled("halfdrawers2"))
|
||||
if (blockConfig.isBlockEnabled(blockConfig.getBlockConfigName(BlockConfiguration.BasicHalf2)))
|
||||
return Item.getItemFromBlock(ModBlocks.halfDrawers2A);
|
||||
if (config.isBlockEnabled("halfdrawers4"))
|
||||
if (blockConfig.isBlockEnabled(blockConfig.getBlockConfigName(BlockConfiguration.BasicHalf4)))
|
||||
return Item.getItemFromBlock(ModBlocks.halfDrawers4A);
|
||||
|
||||
return Item.getItemFromBlock(Blocks.chest);
|
||||
|
||||
+41
-64
@@ -1,25 +1,31 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.packs.forestry.core;
|
||||
|
||||
import com.jaquadro.minecraft.storagedrawers.StorageDrawers;
|
||||
import com.jaquadro.minecraft.storagedrawers.config.ConfigManager;
|
||||
import com.jaquadro.minecraft.storagedrawers.core.ModItems;
|
||||
import com.jaquadro.minecraft.storagedrawers.packs.forestry.block.BlockDrawersPack;
|
||||
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.packs.forestry.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;
|
||||
|
||||
String[][] textureNames = new String[][] {
|
||||
BlockDrawersPack.textureNames1,
|
||||
BlockDrawersPack.textureNames2
|
||||
};
|
||||
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[] planksSet = new Block[] {
|
||||
GameRegistry.findBlock("Forestry", "planks"),
|
||||
@@ -44,70 +50,41 @@ public class ModRecipes
|
||||
Block[] halfDrawers4 = new Block[] { ModBlocks.halfDrawers4A, ModBlocks.halfDrawers4B };
|
||||
Block[] trim = new Block[] { ModBlocks.trimA, ModBlocks.trimB };
|
||||
|
||||
for (int p = 0; p < planksSet.length; p++) {
|
||||
IPackDataResolver[] resolver = new IPackDataResolver[] { StorageDrawersPack.instance.resolver1, StorageDrawersPack.instance.resolver2 };
|
||||
|
||||
for (int p = 0; p < resolver.length; p++) {
|
||||
Block planks = planksSet[p];
|
||||
|
||||
for (int i = 0; i < textureNames[p].length; i++) {
|
||||
if (textureNames[p][i] == null)
|
||||
for (int i = 0; i < 16; i++) {
|
||||
if (resolver[p].isValidMetaValue(i))
|
||||
continue;
|
||||
|
||||
if (planks != null) {
|
||||
if (config.isBlockEnabled("fulldrawers1"))
|
||||
GameRegistry.addRecipe(new ItemStack(fullDrawers1[p], config.getBlockRecipeOutput("fulldrawers1"), i), "xxx", " y ", "xxx",
|
||||
'x', new ItemStack(planks, 1, i), 'y', Blocks.chest);
|
||||
if (config.isBlockEnabled("fulldrawers2"))
|
||||
GameRegistry.addRecipe(new ItemStack(fullDrawers2[p], config.getBlockRecipeOutput("fulldrawers2"), i), "xyx", "xxx", "xyx",
|
||||
'x', new ItemStack(planks, 1, i), 'y', Blocks.chest);
|
||||
if (config.isBlockEnabled("fulldrawers4"))
|
||||
GameRegistry.addRecipe(new ItemStack(fullDrawers4[p], config.getBlockRecipeOutput("fulldrawers4"), i), "yxy", "xxx", "yxy",
|
||||
'x', new ItemStack(planks, 1, i), 'y', Blocks.chest);
|
||||
if (config.isBlockEnabled("trim")) {
|
||||
GameRegistry.addRecipe(new ItemStack(trim[p], config.getBlockRecipeOutput("trim"), i), "xyx", "yyy", "xyx",
|
||||
'x', Items.stick, 'y', new ItemStack(planks, 1, i));
|
||||
if (blockConfig.isBlockEnabled(nameFull1))
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(fullDrawers1[p], blockConfig.getBlockRecipeOutput(nameFull1), i), "xxx", " y ", "xxx",
|
||||
'x', new ItemStack(planks, 1, i), 'y', "chestWood"));
|
||||
if (blockConfig.isBlockEnabled(nameFull2))
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(fullDrawers2[p], blockConfig.getBlockRecipeOutput(nameFull2), i), "xyx", "xxx", "xyx",
|
||||
'x', new ItemStack(planks, 1, i), 'y', "chestWood"));
|
||||
if (blockConfig.isBlockEnabled(nameFull4))
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(fullDrawers4[p], blockConfig.getBlockRecipeOutput(nameFull4), i), "yxy", "xxx", "yxy",
|
||||
'x', new ItemStack(planks, 1, i), 'y', "chestWood"));
|
||||
if (blockConfig.isBlockEnabled(nameTrim)) {
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(trim[p], blockConfig.getBlockRecipeOutput(nameTrim), i), "xyx", "yyy", "xyx",
|
||||
'x', "stickWood", 'y', new ItemStack(planks, 1, i)));
|
||||
}
|
||||
}
|
||||
|
||||
Block recipeSlab = (i < 8) ? slabsSet[p][0] : slabsSet[p][1];
|
||||
if (recipeSlab != null) {
|
||||
if (config.isBlockEnabled("halfdrawers2"))
|
||||
GameRegistry.addRecipe(new ItemStack(halfDrawers2[p], config.getBlockRecipeOutput("halfdrawers2"), i), "xyx", "xxx", "xyx",
|
||||
'x', new ItemStack(recipeSlab, 1, i), 'y', Blocks.chest);
|
||||
if (config.isBlockEnabled("halfdrawers4"))
|
||||
GameRegistry.addRecipe(new ItemStack(halfDrawers4[p], config.getBlockRecipeOutput("halfdrawers4"), i), "yxy", "xxx", "yxy",
|
||||
'x', new ItemStack(recipeSlab, 1, i), 'y', Blocks.chest);
|
||||
if (blockConfig.isBlockEnabled(nameHalf2))
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(halfDrawers2[p], blockConfig.getBlockRecipeOutput(nameHalf2), i), "xyx", "xxx", "xyx",
|
||||
'x', new ItemStack(recipeSlab, 1, i), 'y', "chestWood"));
|
||||
if (blockConfig.isBlockEnabled(nameHalf4))
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(halfDrawers4[p], blockConfig.getBlockRecipeOutput(nameHalf4), i), "yxy", "xxx", "yxy",
|
||||
'x', new ItemStack(recipeSlab, 1, i), 'y', "chestWood"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (config.isBlockEnabled("fulldrawers1")) {
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.upgradeTemplate, 2), "xxx", "xyx", "xxx",
|
||||
'x', Items.stick, 'y', new ItemStack(ModBlocks.fullDrawers1A, 1, OreDictionary.WILDCARD_VALUE));
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.upgradeTemplate, 2), "xxx", "xyx", "xxx",
|
||||
'x', Items.stick, 'y', new ItemStack(ModBlocks.fullDrawers1B, 1, OreDictionary.WILDCARD_VALUE));
|
||||
}
|
||||
if (config.isBlockEnabled("fulldrawers2")) {
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.upgradeTemplate, 2), "xxx", "xyx", "xxx",
|
||||
'x', Items.stick, 'y', new ItemStack(ModBlocks.fullDrawers2A, 1, OreDictionary.WILDCARD_VALUE));
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.upgradeTemplate, 2), "xxx", "xyx", "xxx",
|
||||
'x', Items.stick, 'y', new ItemStack(ModBlocks.fullDrawers2B, 1, OreDictionary.WILDCARD_VALUE));
|
||||
}
|
||||
if (config.isBlockEnabled("halfdrawers2")) {
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.upgradeTemplate, 2), "xxx", "xyx", "xxx",
|
||||
'x', Items.stick, 'y', new ItemStack(ModBlocks.halfDrawers2A, 1, OreDictionary.WILDCARD_VALUE));
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.upgradeTemplate, 2), "xxx", "xyx", "xxx",
|
||||
'x', Items.stick, 'y', new ItemStack(ModBlocks.halfDrawers2B, 1, OreDictionary.WILDCARD_VALUE));
|
||||
}
|
||||
if (config.isBlockEnabled("fulldrawers4")) {
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.upgradeTemplate, 2), "xxx", "xyx", "xxx",
|
||||
'x', Items.stick, 'y', new ItemStack(ModBlocks.fullDrawers4A, 1, OreDictionary.WILDCARD_VALUE));
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.upgradeTemplate, 2), "xxx", "xyx", "xxx",
|
||||
'x', Items.stick, 'y', new ItemStack(ModBlocks.fullDrawers4B, 1, OreDictionary.WILDCARD_VALUE));
|
||||
}
|
||||
if (config.isBlockEnabled("halfdrawers4")) {
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.upgradeTemplate, 2), "xxx", "xyx", "xxx",
|
||||
'x', Items.stick, 'y', new ItemStack(ModBlocks.halfDrawers4A, 1, OreDictionary.WILDCARD_VALUE));
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.upgradeTemplate, 2), "xxx", "xyx", "xxx",
|
||||
'x', Items.stick, 'y', new ItemStack(ModBlocks.halfDrawers4B, 1, OreDictionary.WILDCARD_VALUE));
|
||||
}
|
||||
}
|
||||
}
|
||||
+118
-97
@@ -1,131 +1,152 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.packs.forestry.core;
|
||||
|
||||
import com.jaquadro.minecraft.storagedrawers.StorageDrawers;
|
||||
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.forestry.block.BlockDrawersPack;
|
||||
import com.jaquadro.minecraft.storagedrawers.packs.forestry.block.BlockSortingDrawersPack;
|
||||
import com.jaquadro.minecraft.storagedrawers.packs.forestry.item.ItemSortingDrawersPack;
|
||||
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.packs.forestry.StorageDrawersPack;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class RefinedRelocation
|
||||
{
|
||||
public static BlockSortingDrawersPack fullDrawers1A;
|
||||
public static BlockSortingDrawersPack fullDrawers2A;
|
||||
public static BlockSortingDrawersPack fullDrawers4A;
|
||||
public static BlockSortingDrawersPack halfDrawers2A;
|
||||
public static BlockSortingDrawersPack halfDrawers4A;
|
||||
public static Block fullDrawers1A;
|
||||
public static Block fullDrawers2A;
|
||||
public static Block fullDrawers4A;
|
||||
public static Block halfDrawers2A;
|
||||
public static Block halfDrawers4A;
|
||||
|
||||
public static BlockSortingDrawersPack fullDrawers1B;
|
||||
public static BlockSortingDrawersPack fullDrawers2B;
|
||||
public static BlockSortingDrawersPack fullDrawers4B;
|
||||
public static BlockSortingDrawersPack halfDrawers2B;
|
||||
public static BlockSortingDrawersPack halfDrawers4B;
|
||||
public static Block fullDrawers1B;
|
||||
public static Block fullDrawers2B;
|
||||
public static Block fullDrawers4B;
|
||||
public static Block halfDrawers2B;
|
||||
public static Block halfDrawers4B;
|
||||
|
||||
public static void init () {
|
||||
ConfigManager config = StorageDrawers.config;
|
||||
if (!Loader.isModLoaded("RefinedRelocation") || !config.cache.enableRefinedRelocationIntegration)
|
||||
IStorageDrawersApi api = StorageDrawersApi.instance();
|
||||
if (api == null)
|
||||
return;
|
||||
|
||||
fullDrawers1A = new BlockSortingDrawersPack(ModBlocks.makeName("fullDrawers1"), 1, false, 0);
|
||||
fullDrawers2A = new BlockSortingDrawersPack(ModBlocks.makeName("fullDrawers2"), 2, false, 0);
|
||||
fullDrawers4A = new BlockSortingDrawersPack(ModBlocks.makeName("fullDrawers4"), 4, false, 0);
|
||||
halfDrawers2A = new BlockSortingDrawersPack(ModBlocks.makeName("halfDrawers2"), 2, true, 0);
|
||||
halfDrawers4A = new BlockSortingDrawersPack(ModBlocks.makeName("halfDrawers4"), 4, true, 0);
|
||||
if (!Loader.isModLoaded("RefinedRelocation") || !api.userConfig().integrationConfig().isRefinedRelocationEnabled())
|
||||
return;
|
||||
|
||||
fullDrawers1B = new BlockSortingDrawersPack(ModBlocks.makeName("fullDrawers1"), 1, false, 1);
|
||||
fullDrawers2B = new BlockSortingDrawersPack(ModBlocks.makeName("fullDrawers2"), 2, false, 1);
|
||||
fullDrawers4B = new BlockSortingDrawersPack(ModBlocks.makeName("fullDrawers4"), 4, false, 1);
|
||||
halfDrawers2B = new BlockSortingDrawersPack(ModBlocks.makeName("halfDrawers2"), 2, true, 1);
|
||||
halfDrawers4B = new BlockSortingDrawersPack(ModBlocks.makeName("halfDrawers4"), 4, true, 1);
|
||||
IPackBlockFactory factory = api.packFactory();
|
||||
IPackDataResolver resolver1 = StorageDrawersPack.instance.resolver1;
|
||||
IPackDataResolver resolver2 = StorageDrawersPack.instance.resolver2;
|
||||
|
||||
SortingBlockRegistry.register(ModBlocks.fullDrawers1A, fullDrawers1A);
|
||||
SortingBlockRegistry.register(ModBlocks.fullDrawers2A, fullDrawers2A);
|
||||
SortingBlockRegistry.register(ModBlocks.fullDrawers4A, fullDrawers4A);
|
||||
SortingBlockRegistry.register(ModBlocks.halfDrawers2A, halfDrawers2A);
|
||||
SortingBlockRegistry.register(ModBlocks.halfDrawers4A, halfDrawers4A);
|
||||
fullDrawers1A = factory.createBlock(BlockConfiguration.SortingFull1, resolver1);
|
||||
fullDrawers2A = factory.createBlock(BlockConfiguration.SortingFull2, resolver1);
|
||||
fullDrawers4A = factory.createBlock(BlockConfiguration.SortingFull4, resolver1);
|
||||
halfDrawers2A = factory.createBlock(BlockConfiguration.SortingHalf2, resolver1);
|
||||
halfDrawers4A = factory.createBlock(BlockConfiguration.SortingHalf4, resolver1);
|
||||
|
||||
SortingBlockRegistry.register(ModBlocks.fullDrawers1B, fullDrawers1B);
|
||||
SortingBlockRegistry.register(ModBlocks.fullDrawers2B, fullDrawers2B);
|
||||
SortingBlockRegistry.register(ModBlocks.fullDrawers4B, fullDrawers4B);
|
||||
SortingBlockRegistry.register(ModBlocks.halfDrawers2B, halfDrawers2B);
|
||||
SortingBlockRegistry.register(ModBlocks.halfDrawers4B, halfDrawers4B);
|
||||
fullDrawers1B = factory.createBlock(BlockConfiguration.SortingFull1, resolver2);
|
||||
fullDrawers2B = factory.createBlock(BlockConfiguration.SortingFull2, resolver2);
|
||||
fullDrawers4B = factory.createBlock(BlockConfiguration.SortingFull4, resolver2);
|
||||
halfDrawers2B = factory.createBlock(BlockConfiguration.SortingHalf2, resolver2);
|
||||
halfDrawers4B = factory.createBlock(BlockConfiguration.SortingHalf4, resolver2);
|
||||
|
||||
if (config.isBlockEnabled("fulldrawers1")) {
|
||||
GameRegistry.registerBlock(fullDrawers1A, ItemSortingDrawersPack.class, "fullDrawersSort1A");
|
||||
GameRegistry.registerBlock(fullDrawers1B, ItemSortingDrawersPack.class, "fullDrawersSort1B");
|
||||
factory.bindSortingBlock(ModBlocks.fullDrawers1A, fullDrawers1A);
|
||||
factory.bindSortingBlock(ModBlocks.fullDrawers2A, fullDrawers2A);
|
||||
factory.bindSortingBlock(ModBlocks.fullDrawers4A, fullDrawers4A);
|
||||
factory.bindSortingBlock(ModBlocks.halfDrawers2A, halfDrawers2A);
|
||||
factory.bindSortingBlock(ModBlocks.halfDrawers4A, halfDrawers4A);
|
||||
|
||||
factory.bindSortingBlock(ModBlocks.fullDrawers1B, fullDrawers1B);
|
||||
factory.bindSortingBlock(ModBlocks.fullDrawers2B, fullDrawers2B);
|
||||
factory.bindSortingBlock(ModBlocks.fullDrawers4B, fullDrawers4B);
|
||||
factory.bindSortingBlock(ModBlocks.halfDrawers2B, halfDrawers2B);
|
||||
factory.bindSortingBlock(ModBlocks.halfDrawers4B, halfDrawers4B);
|
||||
|
||||
IUserConfig config = api.userConfig();
|
||||
IBlockConfig blockConfig = config.blockConfig();
|
||||
|
||||
if (blockConfig.isBlockEnabled(blockConfig.getBlockConfigName(BlockConfiguration.SortingFull1))) {
|
||||
factory.registerBlock(fullDrawers1A, "fullDrawersSort1A");
|
||||
factory.registerBlock(fullDrawers1B, "fullDrawersSort1B");
|
||||
}
|
||||
if (config.isBlockEnabled("fulldrawers2")) {
|
||||
GameRegistry.registerBlock(fullDrawers2A, ItemSortingDrawersPack.class, "fullDrawersSort2A");
|
||||
GameRegistry.registerBlock(fullDrawers2B, ItemSortingDrawersPack.class, "fullDrawersSort2B");
|
||||
if (blockConfig.isBlockEnabled(blockConfig.getBlockConfigName(BlockConfiguration.SortingFull2))) {
|
||||
factory.registerBlock(fullDrawers2A, "fullDrawersSort2A");
|
||||
factory.registerBlock(fullDrawers2B, "fullDrawersSort2B");
|
||||
}
|
||||
if (config.isBlockEnabled("fulldrawers4")) {
|
||||
GameRegistry.registerBlock(fullDrawers4A, ItemSortingDrawersPack.class, "fullDrawersSort4A");
|
||||
GameRegistry.registerBlock(fullDrawers4B, ItemSortingDrawersPack.class, "fullDrawersSort4B");
|
||||
if (blockConfig.isBlockEnabled(blockConfig.getBlockConfigName(BlockConfiguration.SortingFull4))) {
|
||||
factory.registerBlock(fullDrawers4A, "fullDrawersSort4A");
|
||||
factory.registerBlock(fullDrawers4B, "fullDrawersSort4B");
|
||||
}
|
||||
if (config.isBlockEnabled("halfdrawers2")) {
|
||||
GameRegistry.registerBlock(halfDrawers2A, ItemSortingDrawersPack.class, "halfDrawersSort2A");
|
||||
GameRegistry.registerBlock(halfDrawers2B, ItemSortingDrawersPack.class, "halfDrawersSort2B");
|
||||
if (blockConfig.isBlockEnabled(blockConfig.getBlockConfigName(BlockConfiguration.SortingHalf2))) {
|
||||
factory.registerBlock(halfDrawers2A, "halfDrawersSort2A");
|
||||
factory.registerBlock(halfDrawers2B, "halfDrawersSort2B");
|
||||
}
|
||||
if (config.isBlockEnabled("halfdrawers4")) {
|
||||
GameRegistry.registerBlock(halfDrawers4A, ItemSortingDrawersPack.class, "halfDrawersSort4A");
|
||||
GameRegistry.registerBlock(halfDrawers4B, ItemSortingDrawersPack.class, "halfDrawersSort4B");
|
||||
if (blockConfig.isBlockEnabled(blockConfig.getBlockConfigName(BlockConfiguration.SortingHalf4))) {
|
||||
factory.registerBlock(halfDrawers4A, "halfDrawersSort4A");
|
||||
factory.registerBlock(halfDrawers4B, "halfDrawersSort4B");
|
||||
}
|
||||
|
||||
if (!config.cache.addonShowNEI) {
|
||||
NEIStorageDrawersConfig.hideBlock(ModBlocks.getQualifiedName(fullDrawers1A));
|
||||
NEIStorageDrawersConfig.hideBlock(ModBlocks.getQualifiedName(fullDrawers2A));
|
||||
NEIStorageDrawersConfig.hideBlock(ModBlocks.getQualifiedName(fullDrawers4A));
|
||||
NEIStorageDrawersConfig.hideBlock(ModBlocks.getQualifiedName(halfDrawers2A));
|
||||
NEIStorageDrawersConfig.hideBlock(ModBlocks.getQualifiedName(halfDrawers4A));
|
||||
if (!config.addonConfig().showAddonItemsNEI()) {
|
||||
factory.hideBlock(ModBlocks.getQualifiedName(fullDrawers1A));
|
||||
factory.hideBlock(ModBlocks.getQualifiedName(fullDrawers2A));
|
||||
factory.hideBlock(ModBlocks.getQualifiedName(fullDrawers4A));
|
||||
factory.hideBlock(ModBlocks.getQualifiedName(halfDrawers2A));
|
||||
factory.hideBlock(ModBlocks.getQualifiedName(halfDrawers4A));
|
||||
|
||||
NEIStorageDrawersConfig.hideBlock(ModBlocks.getQualifiedName(fullDrawers1B));
|
||||
NEIStorageDrawersConfig.hideBlock(ModBlocks.getQualifiedName(fullDrawers2B));
|
||||
NEIStorageDrawersConfig.hideBlock(ModBlocks.getQualifiedName(fullDrawers4B));
|
||||
NEIStorageDrawersConfig.hideBlock(ModBlocks.getQualifiedName(halfDrawers2B));
|
||||
NEIStorageDrawersConfig.hideBlock(ModBlocks.getQualifiedName(halfDrawers4B));
|
||||
factory.hideBlock(ModBlocks.getQualifiedName(fullDrawers1B));
|
||||
factory.hideBlock(ModBlocks.getQualifiedName(fullDrawers2B));
|
||||
factory.hideBlock(ModBlocks.getQualifiedName(fullDrawers4B));
|
||||
factory.hideBlock(ModBlocks.getQualifiedName(halfDrawers2B));
|
||||
factory.hideBlock(ModBlocks.getQualifiedName(halfDrawers4B));
|
||||
}
|
||||
}
|
||||
|
||||
public static void postInit () {
|
||||
ConfigManager config = StorageDrawers.config;
|
||||
if (!Loader.isModLoaded("RefinedRelocation") || !config.cache.enableRefinedRelocationIntegration)
|
||||
IStorageDrawersApi api = StorageDrawersApi.instance();
|
||||
if (api == null)
|
||||
return;
|
||||
|
||||
for (int i = 0; i < BlockDrawersPack.textureNames1.length; i++) {
|
||||
if (config.isBlockEnabled("fulldrawers1")) {
|
||||
GameRegistry.addRecipe(new ItemStack(fullDrawers1A, 1, i), "x x", " y ", "x x",
|
||||
'x', Items.gold_nugget, 'y', new ItemStack(ModBlocks.fullDrawers1A, 1, i));
|
||||
GameRegistry.addRecipe(new ItemStack(fullDrawers1B, 1, i), "x x", " y ", "x x",
|
||||
'x', Items.gold_nugget, 'y', new ItemStack(ModBlocks.fullDrawers1B, 1, i));
|
||||
}
|
||||
if (config.isBlockEnabled("fulldrawers2")) {
|
||||
GameRegistry.addRecipe(new ItemStack(fullDrawers2A, 1, i), "x x", " y ", "x x",
|
||||
'x', Items.gold_nugget, 'y', new ItemStack(ModBlocks.fullDrawers2A, 1, i));
|
||||
GameRegistry.addRecipe(new ItemStack(fullDrawers2B, 1, i), "x x", " y ", "x x",
|
||||
'x', Items.gold_nugget, 'y', new ItemStack(ModBlocks.fullDrawers2B, 1, i));
|
||||
}
|
||||
if (config.isBlockEnabled("halfdrawers2")) {
|
||||
GameRegistry.addRecipe(new ItemStack(halfDrawers2A, 1, i), "x x", " y ", "x x",
|
||||
'x', Items.gold_nugget, 'y', new ItemStack(ModBlocks.halfDrawers2A, 1, i));
|
||||
GameRegistry.addRecipe(new ItemStack(halfDrawers2B, 1, i), "x x", " y ", "x x",
|
||||
'x', Items.gold_nugget, 'y', new ItemStack(ModBlocks.halfDrawers2B, 1, i));
|
||||
}
|
||||
if (config.isBlockEnabled("fulldrawers4")) {
|
||||
GameRegistry.addRecipe(new ItemStack(fullDrawers4A, 1, i), "x x", " y ", "x x",
|
||||
'x', Items.gold_nugget, 'y', new ItemStack(ModBlocks.fullDrawers4A, 1, i));
|
||||
GameRegistry.addRecipe(new ItemStack(fullDrawers4B, 1, i), "x x", " y ", "x x",
|
||||
'x', Items.gold_nugget, 'y', new ItemStack(ModBlocks.fullDrawers4B, 1, i));
|
||||
}
|
||||
if (config.isBlockEnabled("halfdrawers4")) {
|
||||
GameRegistry.addRecipe(new ItemStack(halfDrawers4A, 1, i), "x x", " y ", "x x",
|
||||
'x', Items.gold_nugget, 'y', new ItemStack(ModBlocks.halfDrawers4A, 1, i));
|
||||
GameRegistry.addRecipe(new ItemStack(halfDrawers4B, 1, i), "x x", " y ", "x x",
|
||||
'x', Items.gold_nugget, 'y', new ItemStack(ModBlocks.halfDrawers4B, 1, i));
|
||||
if (!Loader.isModLoaded("RefinedRelocation") || !api.userConfig().integrationConfig().isRefinedRelocationEnabled())
|
||||
return;
|
||||
|
||||
Block[] fullDrawers1 = new Block[] { fullDrawers1A, fullDrawers1B };
|
||||
Block[] fullDrawers2 = new Block[] { fullDrawers2A, fullDrawers2B };
|
||||
Block[] fullDrawers4 = new Block[] { fullDrawers4A, fullDrawers4B };
|
||||
Block[] halfDrawers2 = new Block[] { halfDrawers2A, halfDrawers2B };
|
||||
Block[] halfDrawers4 = new Block[] { halfDrawers4A, halfDrawers4B };
|
||||
|
||||
Block[] mfullDrawers1 = new Block[] { ModBlocks.fullDrawers1A, ModBlocks.fullDrawers1B };
|
||||
Block[] mfullDrawers2 = new Block[] { ModBlocks.fullDrawers2A, ModBlocks.fullDrawers2B };
|
||||
Block[] mfullDrawers4 = new Block[] { ModBlocks.fullDrawers4A, ModBlocks.fullDrawers4B };
|
||||
Block[] mhalfDrawers2 = new Block[] { ModBlocks.halfDrawers2A, ModBlocks.halfDrawers2B };
|
||||
Block[] mhalfDrawers4 = new Block[] { ModBlocks.halfDrawers4A, ModBlocks.halfDrawers4B };
|
||||
|
||||
IPackDataResolver[] resolver = new IPackDataResolver[] { StorageDrawersPack.instance.resolver1, StorageDrawersPack.instance.resolver2 };
|
||||
|
||||
IBlockConfig blockConfig = api.userConfig().blockConfig();
|
||||
|
||||
for (int p = 0; p < resolver.length; p++) {
|
||||
for (int i = 0; i < 16; i++) {
|
||||
if (!resolver[p].isValidMetaValue(i))
|
||||
continue;
|
||||
|
||||
if (blockConfig.isBlockEnabled(blockConfig.getBlockConfigName(BlockConfiguration.SortingFull1)))
|
||||
GameRegistry.addRecipe(new ItemStack(fullDrawers1[p], 1, i), "x x", " y ", "x x",
|
||||
'x', Items.gold_nugget, 'y', new ItemStack(mfullDrawers1[p], 1, i));
|
||||
if (blockConfig.isBlockEnabled(blockConfig.getBlockConfigName(BlockConfiguration.SortingFull2)))
|
||||
GameRegistry.addRecipe(new ItemStack(fullDrawers2[p], 1, i), "x x", " y ", "x x",
|
||||
'x', Items.gold_nugget, 'y', new ItemStack(mfullDrawers2[p], 1, i));
|
||||
if (blockConfig.isBlockEnabled(blockConfig.getBlockConfigName(BlockConfiguration.SortingFull4)))
|
||||
GameRegistry.addRecipe(new ItemStack(halfDrawers2[p], 1, i), "x x", " y ", "x x",
|
||||
'x', Items.gold_nugget, 'y', new ItemStack(mhalfDrawers2[p], 1, i));
|
||||
if (blockConfig.isBlockEnabled(blockConfig.getBlockConfigName(BlockConfiguration.SortingHalf2)))
|
||||
GameRegistry.addRecipe(new ItemStack(fullDrawers4[p], 1, i), "x x", " y ", "x x",
|
||||
'x', Items.gold_nugget, 'y', new ItemStack(mfullDrawers4[p], 1, i));
|
||||
if (blockConfig.isBlockEnabled(blockConfig.getBlockConfigName(BlockConfiguration.SortingHalf4)))
|
||||
GameRegistry.addRecipe(new ItemStack(halfDrawers4[p], 1, i), "x x", " y ", "x x",
|
||||
'x', Items.gold_nugget, 'y', new ItemStack(mhalfDrawers4[p], 1, i));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-48
@@ -1,48 +0,0 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.packs.forestry.item;
|
||||
|
||||
import com.jaquadro.minecraft.storagedrawers.StorageDrawers;
|
||||
import com.jaquadro.minecraft.storagedrawers.config.ConfigManager;
|
||||
import com.jaquadro.minecraft.storagedrawers.item.ItemDrawers;
|
||||
import com.jaquadro.minecraft.storagedrawers.packs.forestry.block.BlockDrawersPack;
|
||||
import com.jaquadro.minecraft.storagedrawers.packs.forestry.core.ModBlocks;
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
public class ItemDrawersPack extends ItemDrawers
|
||||
{
|
||||
public ItemDrawersPack (Block block) {
|
||||
super(block, getTextureGroupForBlock(block));
|
||||
}
|
||||
|
||||
protected ItemDrawersPack (Block block, String[] names) {
|
||||
super(block, names);
|
||||
}
|
||||
|
||||
private static String[] getTextureGroupForBlock (Block block) {
|
||||
if (block == ModBlocks.fullDrawers1A ||
|
||||
block == ModBlocks.fullDrawers2A ||
|
||||
block == ModBlocks.fullDrawers4A ||
|
||||
block == ModBlocks.halfDrawers2A ||
|
||||
block == ModBlocks.halfDrawers4A)
|
||||
return BlockDrawersPack.textureNames1;
|
||||
else
|
||||
return BlockDrawersPack.textureNames2;
|
||||
}
|
||||
|
||||
protected int getCapacityForBlock (Block block) {
|
||||
ConfigManager config = StorageDrawers.config;
|
||||
int count = 0;
|
||||
|
||||
if (block == ModBlocks.fullDrawers1A || block == ModBlocks.fullDrawers1B)
|
||||
count = config.getBlockBaseStorage("fulldrawers1");
|
||||
else if (block == ModBlocks.fullDrawers2A || block == ModBlocks.fullDrawers2B)
|
||||
count = config.getBlockBaseStorage("fulldrawers2");
|
||||
else if (block == ModBlocks.fullDrawers4A || block == ModBlocks.fullDrawers4B)
|
||||
count = config.getBlockBaseStorage("fulldrawers4");
|
||||
else if (block == ModBlocks.halfDrawers2A || block == ModBlocks.halfDrawers2B)
|
||||
count = config.getBlockBaseStorage("halfdrawers2");
|
||||
else if (block == ModBlocks.halfDrawers4A || block == ModBlocks.halfDrawers4B)
|
||||
count = config.getBlockBaseStorage("halfdrawers4");
|
||||
|
||||
return count;
|
||||
}
|
||||
}
|
||||
-62
@@ -1,62 +0,0 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.packs.forestry.item;
|
||||
|
||||
import com.jaquadro.minecraft.storagedrawers.StorageDrawers;
|
||||
import com.jaquadro.minecraft.storagedrawers.config.ConfigManager;
|
||||
import com.jaquadro.minecraft.storagedrawers.packs.forestry.block.BlockDrawersPack;
|
||||
import com.jaquadro.minecraft.storagedrawers.packs.forestry.core.ModBlocks;
|
||||
import com.jaquadro.minecraft.storagedrawers.packs.forestry.core.RefinedRelocation;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemSortingDrawersPack extends ItemDrawersPack
|
||||
{
|
||||
public ItemSortingDrawersPack (Block block) {
|
||||
super(block, getTextureGroupForBlock(block));
|
||||
}
|
||||
|
||||
private static String[] getTextureGroupForBlock (Block block) {
|
||||
if (block == RefinedRelocation.fullDrawers1A ||
|
||||
block == RefinedRelocation.fullDrawers2A ||
|
||||
block == RefinedRelocation.fullDrawers4A ||
|
||||
block == RefinedRelocation.halfDrawers2A ||
|
||||
block == RefinedRelocation.halfDrawers4A)
|
||||
return BlockDrawersPack.textureNames1;
|
||||
else
|
||||
return BlockDrawersPack.textureNames2;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation (ItemStack itemStack, EntityPlayer player, List list, boolean par4) {
|
||||
super.addInformation(itemStack, player, list, par4);
|
||||
|
||||
Block block = Block.getBlockFromItem(itemStack.getItem());
|
||||
list.add(EnumChatFormatting.YELLOW + StatCollector.translateToLocalFormatted("storageDrawers.waila.sorting"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCapacityForBlock (Block block) {
|
||||
ConfigManager config = StorageDrawers.config;
|
||||
int count = 0;
|
||||
|
||||
if (block == RefinedRelocation.fullDrawers1A || block == RefinedRelocation.fullDrawers1B)
|
||||
count = config.getBlockBaseStorage("fulldrawers1");
|
||||
else if (block == RefinedRelocation.fullDrawers2A || block == RefinedRelocation.fullDrawers2B)
|
||||
count = config.getBlockBaseStorage("fulldrawers2");
|
||||
else if (block == RefinedRelocation.fullDrawers4A || block == RefinedRelocation.fullDrawers4B)
|
||||
count = config.getBlockBaseStorage("fulldrawers4");
|
||||
else if (block == RefinedRelocation.halfDrawers2A || block == RefinedRelocation.halfDrawers2B)
|
||||
count = config.getBlockBaseStorage("halfdrawers2");
|
||||
else if (block == RefinedRelocation.halfDrawers4A || block == RefinedRelocation.halfDrawers4B)
|
||||
count = config.getBlockBaseStorage("halfdrawers4");
|
||||
|
||||
return count;
|
||||
}
|
||||
}
|
||||
-20
@@ -1,20 +0,0 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.packs.forestry.item;
|
||||
|
||||
import com.jaquadro.minecraft.storagedrawers.item.ItemTrim;
|
||||
import com.jaquadro.minecraft.storagedrawers.packs.forestry.block.BlockDrawersPack;
|
||||
import com.jaquadro.minecraft.storagedrawers.packs.forestry.core.ModBlocks;
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
public class ItemTrimPack extends ItemTrim
|
||||
{
|
||||
public ItemTrimPack (Block block) {
|
||||
super(block, getTextureGroupForBlock(block));
|
||||
}
|
||||
|
||||
private static String[] getTextureGroupForBlock (Block block) {
|
||||
if (block == ModBlocks.trimA)
|
||||
return BlockDrawersPack.textureNames1;
|
||||
else
|
||||
return BlockDrawersPack.textureNames2;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user