Skip to content

Commit

Permalink
Fixup build script
Browse files Browse the repository at this point in the history
  • Loading branch information
cpw committed Dec 19, 2012
1 parent 2735d04 commit 8a38525
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 40 deletions.
13 changes: 1 addition & 12 deletions IronChests2/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
<property environment="env" />
<property file="build.properties" />
<property name="modname" value="ironchest" />
<condition property="dev.home" value="${env.WORKSPACE}" else="${default.dev.home}">
<isset property="env.WORKSPACE" />
</condition>
<condition property="mcp.home" value="${env.WORKSPACE}/mcpworkspace" else="${default.mcp.home}">
<isset property="env.WORKSPACE" />
</condition>
Expand All @@ -40,9 +37,7 @@
<property name="mcp.obfoutput.classes" location="${mcp.obfoutput}/minecraft" />
<property name="mcp.srcdir" location="${mcp.home}/src" />
<property name="client.mcp.srcdir" location="${mcp.srcdir}/minecraft" />
<property name="common.mcp.srcdir" location="${mcp.srcdir}/common" />
<property name="common.src.dir" location="${basedir}/common" />
<property name="client.src.dir" location="${basedir}/client" />
<property name="deploy.dir" location="${user.home}/.minecraft/mods" />
<property name="resource.dir" location="${basedir}/resources" />
<condition property="version.build" value="${env.BUILD_NUMBER}" else="1">
Expand Down Expand Up @@ -84,9 +79,6 @@

<target name="merge" depends="init">
<copy todir="${client.mcp.srcdir}" overwrite="true" verbose="true">
<fileset dir="${client.src.dir}" includes="**/*.java" />
</copy>
<copy todir="${common.mcp.srcdir}" overwrite="true" verbose="true">
<fileset dir="${common.src.dir}" includes="**/*.java" />
</copy>
</target>
Expand All @@ -97,7 +89,7 @@
</target>

<target name="extract-built-jar">
<property name="jarname" value="${modname}-universal-${version}" />
<property name="jarname" value="${modname}-universal-${version.minecraft}-${version}" />
<mkdir dir="${basedir}/target" />
<jar destfile="${basedir}/target/${jarname}.zip">
<fileset dir="${mcp.obfoutput.classes}" includes="**/*.class" />
Expand Down Expand Up @@ -129,9 +121,6 @@
<target name="clean-source">
<delete verbose="true">
<fileset dir="${client.mcp.srcdir}">
<present present="both" targetdir="${client.src.dir}" />
</fileset>
<fileset dir="${common.mcp.srcdir}">
<present present="both" targetdir="${common.src.dir}" />
</fileset>
</delete>
Expand Down
17 changes: 11 additions & 6 deletions IronChests2/common/cpw/mods/ironchest/ChestChangerType.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,22 @@
import static cpw.mods.ironchest.IronChestType.SILVER;
import static cpw.mods.ironchest.IronChestType.CRYSTAL;
import static cpw.mods.ironchest.IronChestType.WOOD;
import cpw.mods.fml.common.registry.GameRegistry;

import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.Configuration;

public enum ChestChangerType {
IRONGOLD(IRON, GOLD, "ironGoldUpgrade", "Iron to Gold Chest Upgrade", "mmm", "msm", "mmm"), GOLDDIAMOND(GOLD, DIAMOND, "goldDiamondUpgrade",
"Gold to Diamond Chest Upgrade", "GGG", "msm", "GGG"), COPPERSILVER(COPPER, SILVER, "copperSilverUpgrade", "Copper to Silver Chest Upgrade", "mmm",
"msm", "mmm"), SILVERGOLD(SILVER, GOLD, "silverGoldUpgrade", "Silver to Gold Chest Upgrade", "mGm", "GsG", "mGm"), COPPERIRON(COPPER, IRON,
"copperIronUpgrade", "Copper to Iron Chest Upgrade", "mGm", "GsG", "mGm"), DIAMONDCRYSTAL(DIAMOND, CRYSTAL, "diamondCrystalUpgrade",
"Diamond to Crystal Chest Upgrade", "GGG", "GOG", "GGG"), WOODIRON(WOOD, IRON, "woodIronUpgrade", "Normal chest to Iron Chest Upgrade", "mmm",
"msm", "mmm"), WOODCOPPER(WOOD, COPPER, "woodCopperUpgrade", "Normal chest to Copper Chest Upgrade", "mmm", "msm", "mmm");
IRONGOLD(IRON, GOLD, "ironGoldUpgrade", "Iron to Gold Chest Upgrade", "mmm", "msm", "mmm"),
GOLDDIAMOND(GOLD, DIAMOND, "goldDiamondUpgrade", "Gold to Diamond Chest Upgrade", "GGG", "msm", "GGG"),
COPPERSILVER(COPPER, SILVER, "copperSilverUpgrade", "Copper to Silver Chest Upgrade", "mmm", "msm", "mmm"),
SILVERGOLD(SILVER, GOLD, "silverGoldUpgrade", "Silver to Gold Chest Upgrade", "mGm", "GsG", "mGm"),
COPPERIRON(COPPER, IRON, "copperIronUpgrade", "Copper to Iron Chest Upgrade", "mGm", "GsG", "mGm"),
DIAMONDCRYSTAL(DIAMOND, CRYSTAL, "diamondCrystalUpgrade", "Diamond to Crystal Chest Upgrade", "GGG", "GOG", "GGG"),
WOODIRON(WOOD, IRON, "woodIronUpgrade", "Normal chest to Iron Chest Upgrade", "mmm", "msm", "mmm"),
WOODCOPPER(WOOD, COPPER, "woodCopperUpgrade", "Normal chest to Copper Chest Upgrade", "mmm", "msm", "mmm");

private IronChestType source;
private IronChestType target;
Expand Down Expand Up @@ -56,6 +60,7 @@ public ItemChestChanger buildItem(Configuration cfg, int id)
{
int itemId = cfg.get(Configuration.CATEGORY_ITEM, itemName, id).getInt(id);
item = new ItemChestChanger(itemId, this);
GameRegistry.registerItem(item, itemName);
return item;
}

Expand Down
10 changes: 5 additions & 5 deletions IronChests2/common/cpw/mods/ironchest/IronChest.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;

@Mod(modid = "IronChest", name = "Iron Chests", dependencies = "required-after:Forge@[6.0,)")
@NetworkMod(channels = { "IronChest" }, versionBounds = "[4.2,)", clientSideRequired = true, serverSideRequired = false, packetHandler = PacketHandler.class)
@Mod(modid = "IronChest", name = "Iron Chests", dependencies = "required-after:Forge@[6.5,)")
@NetworkMod(channels = { "IronChest" }, versionBounds = "[4.5,)", clientSideRequired = true, serverSideRequired = false, packetHandler = PacketHandler.class)
public class IronChest {
public static BlockIronChest ironChestBlock;
@SidedProxy(clientSide = "cpw.mods.ironchest.client.ClientProxy", serverSide = "cpw.mods.ironchest.CommonProxy")
Expand All @@ -51,8 +51,8 @@ public void preInit(FMLPreInitializationEvent event)
try
{
cfg.load();
blockId = cfg.get(Configuration.CATEGORY_BLOCK, "ironChests", 181).getInt(181);
ChestChangerType.buildItems(cfg, 29501);
blockId = cfg.getBlock("ironChests", 975).getInt(975);
ChestChangerType.buildItems(cfg, 19501);
CACHE_RENDER = cfg.get(Configuration.CATEGORY_GENERAL, "cacheRenderingInformation", true).getBoolean(true);
OCELOTS_SITONCHESTS = cfg.get(Configuration.CATEGORY_GENERAL, "ocelotsSitOnChests", true).getBoolean(true);
}
Expand All @@ -70,7 +70,7 @@ public void preInit(FMLPreInitializationEvent event)
public void load(FMLInitializationEvent evt)
{
ironChestBlock = new BlockIronChest(blockId);
GameRegistry.registerBlock(ironChestBlock, ItemIronChest.class);
GameRegistry.registerBlock(ironChestBlock, ItemIronChest.class, "BlockIronChest");
for (IronChestType typ : IronChestType.values())
{
GameRegistry.registerTileEntity(typ.clazz, typ.name());
Expand Down
28 changes: 11 additions & 17 deletions IronChests2/common/cpw/mods/ironchest/IronChestType.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
import net.minecraftforge.oredict.ShapedOreRecipe;

public enum IronChestType {
IRON(54, 9, true, "Iron Chest", "ironchest.png", 0, Arrays.asList("ingotIron", "ingotRefinedIron"), TileEntityIronChest.class, "mmmmPmmmm", "mGmG3GmGm"), GOLD(
81, 9, true, "Gold Chest", "goldchest.png", 1, Arrays.asList("ingotGold"), TileEntityGoldChest.class, "mmmmPmmmm", "mGmG4GmGm"), DIAMOND(108, 12,
true, "Diamond Chest", "diamondchest.png", 2, Arrays.asList("gemDiamond"), TileEntityDiamondChest.class, "GGGmPmGGG", "GGGG4Gmmm"), COPPER(45, 9,
false, "Copper Chest", "copperchest.png", 3, Arrays.asList("ingotCopper"), TileEntityCopperChest.class, "mmmmCmmmm"), SILVER(72, 9, false,
"Silver Chest", "silverchest.png", 4, Arrays.asList("ingotSilver"), TileEntitySilverChest.class, "mmmm3mmmm", "mGmG0GmGm"), CRYSTAL(108, 12, true,
"Crystal Chest", "crystalchest.png", 5, Arrays.asList("blockGlass"), TileEntityCrystalChest.class, "GGGGPGGGG"), WOOD(0, 0, false, "", "", -1,
Arrays.asList("blockPlanks"), null);
IRON(54, 9, true, "Iron Chest", "ironchest.png", 0, Arrays.asList("ingotIron", "ingotRefinedIron"), TileEntityIronChest.class, "mmmmPmmmm", "mGmG3GmGm"),
GOLD(81, 9, true, "Gold Chest", "goldchest.png", 1, Arrays.asList("ingotGold"), TileEntityGoldChest.class, "mmmmPmmmm", "mGmG4GmGm"),
DIAMOND(108, 12, true, "Diamond Chest", "diamondchest.png", 2, Arrays.asList("gemDiamond"), TileEntityDiamondChest.class, "GGGmPmGGG", "GGGG4Gmmm"),
COPPER(45, 9, false, "Copper Chest", "copperchest.png", 3, Arrays.asList("ingotCopper"), TileEntityCopperChest.class, "mmmmCmmmm"),
SILVER(72, 9, false, "Silver Chest", "silverchest.png", 4, Arrays.asList("ingotSilver"), TileEntitySilverChest.class, "mmmm3mmmm", "mGmG0GmGm"),
CRYSTAL(108, 12, true, "Crystal Chest", "crystalchest.png", 5, Arrays.asList("blockGlass"), TileEntityCrystalChest.class, "GGGGPGGGG"),
WOOD(0, 0, false, "", "", -1, Arrays.asList("blockPlanks"), null);
int size;
private int rowLength;
public String friendlyName;
Expand Down Expand Up @@ -112,16 +112,10 @@ public static void generateRecipesForType(BlockIronChest blockResult, Object pre
for (String mat : type.matList)
{
mainMaterial = translateOreName(mat);
addRecipe(new ItemStack(blockResult, 1, type.ordinal()), recipeSplit, 'm', mainMaterial, 'P', previousTier, /*
* previous
* tier
* of
* chest
*/
'G', Block.glass, 'C', Block.chest, '0', new ItemStack(blockResult, 1, 0), /*
* Iron
* Chest
*/
addRecipe(new ItemStack(blockResult, 1, type.ordinal()), recipeSplit,
'm', mainMaterial, 'P', previousTier, /* previous tier of chest */
'G', Block.glass, 'C', Block.chest,
'0', new ItemStack(blockResult, 1, 0), /* Iron Chest */
'1', new ItemStack(blockResult, 1, 1), /* Gold Chest */
'2', new ItemStack(blockResult, 1, 1), /* Diamond Chest */
'3', new ItemStack(blockResult, 1, 3), /* Copper Chest */
Expand Down

0 comments on commit 8a38525

Please sign in to comment.