mirror of
https://github.com/GTNewHorizons/StorageDrawers.git
synced 2026-11-27 15:33:13 +00:00
Update natura pack to extended API
This commit is contained in:
1 parent
143fb48123
commit
2812c9ab2b
10 files changed
+72
-125
No files matched your search
@@ -20,3 +20,4 @@ runtime-1.8/
|
||||
tools/TextureBuilder/TextureBuilder/bin/
|
||||
tools/TextureBuilder/TextureBuilder/obj/
|
||||
*.suo
|
||||
logs/
|
||||
+1
-1
@@ -17,7 +17,7 @@ buildscript {
|
||||
|
||||
apply plugin: 'forge'
|
||||
|
||||
version = "1.7.10-1.7.4"
|
||||
version = "1.7.10-1.7.5"
|
||||
group= "com.jaquadro.minecraft.storagedrawers" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||
archivesBaseName = "StorageDrawers"
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ minecraft {
|
||||
assetDir = "../../runtime/assets"
|
||||
|
||||
replace '@VERSION@', project.version
|
||||
replace 'required-after:StorageDrawers', "required-after:StorageDrawers@[1.5.8,)"
|
||||
replace 'required-after:StorageDrawers', "required-after:StorageDrawers@[1.7.5,)"
|
||||
}
|
||||
|
||||
sourceSets.main {
|
||||
|
||||
-4
@@ -24,7 +24,6 @@ public class StorageDrawersPack
|
||||
};
|
||||
|
||||
public ModBlocks blocks = new ModBlocks();
|
||||
//public ModRecipes recipes = new ModRecipes();
|
||||
|
||||
@Mod.Instance(MOD_ID)
|
||||
public static StorageDrawersPack instance;
|
||||
@@ -42,7 +41,6 @@ public class StorageDrawersPack
|
||||
RefinedRelocation.init();
|
||||
for (DataResolver resolver : resolvers)
|
||||
resolver.init();
|
||||
//recipes.init();
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
@@ -52,7 +50,5 @@ public class StorageDrawersPack
|
||||
for (IExtendedDataResolver resolver : resolvers)
|
||||
api.registerStandardPackRecipes(resolver);
|
||||
}
|
||||
|
||||
//RefinedRelocation.postInit();
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,7 @@ buildscript {
|
||||
|
||||
apply plugin: 'forge'
|
||||
|
||||
version = "1.7.10-1.0.5"
|
||||
version = "1.7.10-1.1.0"
|
||||
group= "com.jaquadro.minecraft.storagedrawers" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||
archivesBaseName = "StorageDrawers-Natura"
|
||||
|
||||
@@ -26,7 +26,7 @@ minecraft {
|
||||
assetDir = "../../runtime/assets"
|
||||
|
||||
replace '@VERSION@', project.version
|
||||
replace 'required-after:StorageDrawers', "required-after:StorageDrawers@[1.5.8,)"
|
||||
replace 'required-after:StorageDrawers', "required-after:StorageDrawers@[1.7.5,)"
|
||||
}
|
||||
|
||||
sourceSets.main {
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.packs.natura;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
|
||||
public class CommonProxy
|
||||
{
|
||||
|
||||
|
||||
+7
-7
@@ -1,6 +1,7 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.packs.natura;
|
||||
|
||||
import com.jaquadro.minecraft.storagedrawers.api.pack.IPackDataResolver;
|
||||
import com.jaquadro.minecraft.storagedrawers.api.IStorageDrawersApi;
|
||||
import com.jaquadro.minecraft.storagedrawers.api.StorageDrawersApi;
|
||||
import com.jaquadro.minecraft.storagedrawers.packs.natura.core.*;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.SidedProxy;
|
||||
@@ -16,12 +17,9 @@ public class StorageDrawersPack
|
||||
public static final String MOD_VERSION = "@VERSION@";
|
||||
public static final String SOURCE_PATH = "com.jaquadro.minecraft.storagedrawers.packs.natura.";
|
||||
|
||||
public IPackDataResolver resolver = new DataResolver(MOD_ID, new String[] {
|
||||
"eucalyptus", "sakura", "ghostwood", "redwood", "bloodwood", "hopseed", "maple", "silverbell", "purpleheart", "tigerwood", "willow", "darkwood", "fusewood"
|
||||
});
|
||||
public DataResolver resolver = new DataResolver(MOD_ID);
|
||||
|
||||
public ModBlocks blocks = new ModBlocks();
|
||||
public ModRecipes recipes = new ModRecipes();
|
||||
|
||||
@Mod.Instance(MOD_ID)
|
||||
public static StorageDrawersPack instance;
|
||||
@@ -37,11 +35,13 @@ public class StorageDrawersPack
|
||||
@Mod.EventHandler
|
||||
public void init (FMLInitializationEvent event) {
|
||||
RefinedRelocation.init();
|
||||
recipes.init();
|
||||
resolver.init();
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void postInit (FMLPostInitializationEvent event) {
|
||||
RefinedRelocation.postInit();
|
||||
IStorageDrawersApi api = StorageDrawersApi.instance();
|
||||
if (api != null)
|
||||
api.registerStandardPackRecipes(resolver);
|
||||
}
|
||||
}
|
||||
+54
-4
@@ -1,17 +1,67 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.packs.natura.core;
|
||||
|
||||
import com.jaquadro.minecraft.storagedrawers.api.pack.BlockConfiguration;
|
||||
import com.jaquadro.minecraft.storagedrawers.api.pack.BlockType;
|
||||
import com.jaquadro.minecraft.storagedrawers.api.pack.StandardDataResolver;
|
||||
import com.jaquadro.minecraft.storagedrawers.api.pack.ExtendedDataResolver;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
|
||||
public class DataResolver extends StandardDataResolver
|
||||
public class DataResolver extends ExtendedDataResolver
|
||||
{
|
||||
public DataResolver (String modID, String[] unlocalizedNames) {
|
||||
super(modID, unlocalizedNames);
|
||||
private static String[] textureNames = new String[] {
|
||||
"eucalyptus", "sakura", "ghostwood", "redwood", "bloodwood", "hopseed", "maple", "silverbell", "purpleheart", "tigerwood", "willow", "darkwood", "fusewood"
|
||||
};
|
||||
|
||||
public DataResolver (String modID) {
|
||||
super(modID, textureNames);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CreativeTabs getCreativeTabs (BlockType type) {
|
||||
return ModCreativeTabs.getTabStorageDrawers();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block getBlock (BlockConfiguration blockConfig) {
|
||||
switch (blockConfig.getBlockType()) {
|
||||
case Drawers:
|
||||
if (blockConfig.getDrawerCount() == 1)
|
||||
return ModBlocks.fullDrawers1;
|
||||
if (blockConfig.getDrawerCount() == 2 && !blockConfig.isHalfDepth())
|
||||
return ModBlocks.fullDrawers2;
|
||||
if (blockConfig.getDrawerCount() == 4 && !blockConfig.isHalfDepth())
|
||||
return ModBlocks.fullDrawers4;
|
||||
if (blockConfig.getDrawerCount() == 2 && blockConfig.isHalfDepth())
|
||||
return ModBlocks.halfDrawers2;
|
||||
if (blockConfig.getDrawerCount() == 4 && blockConfig.isHalfDepth())
|
||||
return ModBlocks.halfDrawers4;
|
||||
break;
|
||||
case DrawersSorting:
|
||||
if (blockConfig.getDrawerCount() == 1)
|
||||
return RefinedRelocation.fullDrawers1;
|
||||
if (blockConfig.getDrawerCount() == 2 && !blockConfig.isHalfDepth())
|
||||
return RefinedRelocation.fullDrawers2;
|
||||
if (blockConfig.getDrawerCount() == 4 && !blockConfig.isHalfDepth())
|
||||
return RefinedRelocation.fullDrawers4;
|
||||
if (blockConfig.getDrawerCount() == 2 && blockConfig.isHalfDepth())
|
||||
return RefinedRelocation.halfDrawers2;
|
||||
if (blockConfig.getDrawerCount() == 4 && blockConfig.isHalfDepth())
|
||||
return RefinedRelocation.halfDrawers4;
|
||||
break;
|
||||
case Trim:
|
||||
return ModBlocks.trim;
|
||||
case TrimSorting:
|
||||
return RefinedRelocation.trim;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init () {
|
||||
for (int i = 0, p = 0, m = 0; i < 8; i++, p++, m++)
|
||||
setPlankSlab(i, GameRegistry.findBlock("Natura", "planks"), p, GameRegistry.findBlock("Natura", "plankSlab1"), m);
|
||||
for (int i = 8, p = 8, m = 0; i < textureNames.length; i++, p++, m++)
|
||||
setPlankSlab(i, GameRegistry.findBlock("Natura", "planks"), p, GameRegistry.findBlock("Natura", "plankSlab2"), m);
|
||||
}
|
||||
}
|
||||
-67
@@ -1,67 +0,0 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.packs.natura.core;
|
||||
|
||||
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.natura.StorageDrawersPack;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
|
||||
public class ModRecipes
|
||||
{
|
||||
public void init () {
|
||||
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("Natura", "planks");
|
||||
Block slab1 = GameRegistry.findBlock("Natura", "plankSlab1");
|
||||
Block slab2 = GameRegistry.findBlock("Natura", "plankSlab2");
|
||||
|
||||
IPackDataResolver resolver = StorageDrawersPack.instance.resolver;
|
||||
|
||||
for (int i = 0; i < 16; i++) {
|
||||
if (!resolver.isValidMetaValue(i))
|
||||
continue;
|
||||
|
||||
if (planks != null) {
|
||||
if (blockConfig.isBlockEnabled(nameFull1))
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.fullDrawers1, 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(ModBlocks.fullDrawers2, 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(ModBlocks.fullDrawers4, 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(ModBlocks.trim, blockConfig.getBlockRecipeOutput(nameTrim), i), "xyx", "yyy", "xyx",
|
||||
'x', "stickWood", 'y', new ItemStack(planks, 1, i)));
|
||||
}
|
||||
}
|
||||
|
||||
Block recipeSlab = (i < 8) ? slab1 : slab2;
|
||||
if (recipeSlab != null) {
|
||||
if (blockConfig.isBlockEnabled(nameHalf2))
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.halfDrawers2, blockConfig.getBlockRecipeOutput(nameHalf2), i), "xyx", "xxx", "xyx",
|
||||
'x', new ItemStack(recipeSlab, 1, i % 8), 'y', "chestWood"));
|
||||
if (blockConfig.isBlockEnabled(nameHalf4))
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.halfDrawers4, blockConfig.getBlockRecipeOutput(nameHalf4), i), "yxy", "xxx", "yxy",
|
||||
'x', new ItemStack(recipeSlab, 1, i % 8), 'y', "chestWood"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+6
-36
@@ -10,10 +10,7 @@ import com.jaquadro.minecraft.storagedrawers.api.pack.IPackDataResolver;
|
||||
import com.jaquadro.minecraft.storagedrawers.integration.refinedrelocation.*;
|
||||
import com.jaquadro.minecraft.storagedrawers.packs.natura.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
|
||||
{
|
||||
@@ -22,6 +19,7 @@ public class RefinedRelocation
|
||||
public static Block fullDrawers4;
|
||||
public static Block halfDrawers2;
|
||||
public static Block halfDrawers4;
|
||||
public static Block trim;
|
||||
|
||||
public static void init () {
|
||||
IStorageDrawersApi api = StorageDrawersApi.instance();
|
||||
@@ -39,12 +37,14 @@ public class RefinedRelocation
|
||||
fullDrawers4 = factory.createBlock(BlockConfiguration.SortingFull4, resolver);
|
||||
halfDrawers2 = factory.createBlock(BlockConfiguration.SortingHalf2, resolver);
|
||||
halfDrawers4 = factory.createBlock(BlockConfiguration.SortingHalf4, resolver);
|
||||
trim = factory.createBlock(BlockConfiguration.TrimSorting, resolver);
|
||||
|
||||
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);
|
||||
factory.bindSortingBlock(ModBlocks.trim, trim);
|
||||
|
||||
IUserConfig config = api.userConfig();
|
||||
IBlockConfig blockConfig = config.blockConfig();
|
||||
@@ -59,6 +59,8 @@ public class RefinedRelocation
|
||||
factory.registerBlock(halfDrawers2, "halfDrawersSort2");
|
||||
if (blockConfig.isBlockEnabled(blockConfig.getBlockConfigName(BlockConfiguration.SortingHalf4)))
|
||||
factory.registerBlock(halfDrawers4, "halfDrawersSort4");
|
||||
if (blockConfig.isBlockEnabled(blockConfig.getBlockConfigName(BlockConfiguration.TrimSorting)))
|
||||
factory.registerBlock(trim, "trimSort");
|
||||
|
||||
if (!config.addonConfig().showAddonItemsNEI()) {
|
||||
factory.hideBlock(ModBlocks.getQualifiedName(fullDrawers1));
|
||||
@@ -66,43 +68,11 @@ public class RefinedRelocation
|
||||
factory.hideBlock(ModBlocks.getQualifiedName(fullDrawers4));
|
||||
factory.hideBlock(ModBlocks.getQualifiedName(halfDrawers2));
|
||||
factory.hideBlock(ModBlocks.getQualifiedName(halfDrawers4));
|
||||
factory.hideBlock(ModBlocks.getQualifiedName(trim));
|
||||
}
|
||||
|
||||
ModBlocks.addAlternativeTileEntityMappings(TileSortingDrawersStandard.class, ModBlocks.getQualifiedName(fullDrawers1),
|
||||
ModBlocks.getQualifiedName(fullDrawers2), ModBlocks.getQualifiedName(fullDrawers4),
|
||||
ModBlocks.getQualifiedName(halfDrawers2), ModBlocks.getQualifiedName(halfDrawers4));
|
||||
}
|
||||
|
||||
public static void postInit () {
|
||||
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 (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 (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 (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 (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 (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));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user