Update for recent Forge/FML. Fix up a graphical bug. Require shiny new FML and Forge.
This commit is contained in:
parent
73422fcd5e
commit
0011616b6f
|
@ -5,4 +5,5 @@ bin/
|
||||||
/build.properties
|
/build.properties
|
||||||
/build
|
/build
|
||||||
/ironchestversion.properties
|
/ironchestversion.properties
|
||||||
|
/version.properties
|
||||||
/tmpbukkit
|
/tmpbukkit
|
||||||
|
|
|
@ -15,15 +15,15 @@
|
||||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||||
</natures>
|
</natures>
|
||||||
<linkedResources>
|
<linkedResources>
|
||||||
<link>
|
|
||||||
<name>common/ironchestversion.properties</name>
|
|
||||||
<type>1</type>
|
|
||||||
<locationURI>PROJECT_LOC/ironchestversion.properties</locationURI>
|
|
||||||
</link>
|
|
||||||
<link>
|
<link>
|
||||||
<name>common/mcmod.info</name>
|
<name>common/mcmod.info</name>
|
||||||
<type>1</type>
|
<type>1</type>
|
||||||
<locationURI>PROJECT_LOC/mcmod.info</locationURI>
|
<location>/home/cpw/projects/gitstores/ironchests/IronChests2/mcmod.info</location>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>common/version.properties</name>
|
||||||
|
<type>1</type>
|
||||||
|
<location>/home/cpw/projects/gitstores/ironchests/IronChests2/version.properties</location>
|
||||||
</link>
|
</link>
|
||||||
</linkedResources>
|
</linkedResources>
|
||||||
</projectDescription>
|
</projectDescription>
|
||||||
|
|
|
@ -21,9 +21,6 @@
|
||||||
<condition property="is.server">
|
<condition property="is.server">
|
||||||
<equals arg1="@{side}" arg2="server" />
|
<equals arg1="@{side}" arg2="server" />
|
||||||
</condition>
|
</condition>
|
||||||
<condition property="is.bukkit">
|
|
||||||
<equals arg1="@{side}" arg2="bukkit" />
|
|
||||||
</condition>
|
|
||||||
</sequential>
|
</sequential>
|
||||||
</macrodef>
|
</macrodef>
|
||||||
<target name="writeversion" depends="buildenvsetup">
|
<target name="writeversion" depends="buildenvsetup">
|
||||||
|
@ -31,8 +28,9 @@
|
||||||
<arg value="${basedir}/getversion.py" />
|
<arg value="${basedir}/getversion.py" />
|
||||||
<arg value="${mcp.home}" />
|
<arg value="${mcp.home}" />
|
||||||
</exec>
|
</exec>
|
||||||
<propertyfile file="ironchestversion.properties">
|
<propertyfile file="version.properties">
|
||||||
<entry key="ironchest.build.build.number" type="int" value="${version.build}"/>
|
<entry key="IronChest.build.number" type="int" value="${version.build}"/>
|
||||||
|
<entry key="IronChest.version" type="string" value="${version}"/>
|
||||||
</propertyfile>
|
</propertyfile>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
@ -52,11 +50,6 @@
|
||||||
<condition property="python.exe" value="${mcp.home}/runtime/bin/python/python_mcp" else="python">
|
<condition property="python.exe" value="${mcp.home}/runtime/bin/python/python_mcp" else="python">
|
||||||
<os family="Windows" />
|
<os family="Windows" />
|
||||||
</condition>
|
</condition>
|
||||||
<condition property="bukkitporting.dir" value="${env.WORKSPACE}/bukkitportingtools" else="${dev.home}/bukkitportingtools">
|
|
||||||
<isset property="env.WORKSPACE" />
|
|
||||||
</condition>
|
|
||||||
<property name="bukkit.tmpdir" location="${basedir}/tmpbukkit" />
|
|
||||||
<property name="bukkit.mcp.srcdir" location="${bukkit.tmpdir}/src" />
|
|
||||||
<property name="mcp.obfoutput" location="${mcp.home}/reobf" />
|
<property name="mcp.obfoutput" location="${mcp.home}/reobf" />
|
||||||
<property name="client.mcp.obfoutput" location="${mcp.obfoutput}/minecraft" />
|
<property name="client.mcp.obfoutput" location="${mcp.obfoutput}/minecraft" />
|
||||||
<property name="server.mcp.obfoutput" location="${mcp.obfoutput}/minecraft_server" />
|
<property name="server.mcp.obfoutput" location="${mcp.obfoutput}/minecraft_server" />
|
||||||
|
@ -66,7 +59,6 @@
|
||||||
<property name="common.src.dir" location="${basedir}/common" />
|
<property name="common.src.dir" location="${basedir}/common" />
|
||||||
<property name="client.src.dir" location="${basedir}/client" />
|
<property name="client.src.dir" location="${basedir}/client" />
|
||||||
<property name="server.src.dir" location="${basedir}/server" />
|
<property name="server.src.dir" location="${basedir}/server" />
|
||||||
<property name="bukkit.src.dir" location="${server.src.dir}" />
|
|
||||||
<property name="deploy.dir" location="${user.home}/.minecraft/mods" />
|
<property name="deploy.dir" location="${user.home}/.minecraft/mods" />
|
||||||
<property name="resource.dir" location="${basedir}/resources" />
|
<property name="resource.dir" location="${basedir}/resources" />
|
||||||
<condition property="version.build" value="${env.BUILD_NUMBER}" else="1">
|
<condition property="version.build" value="${env.BUILD_NUMBER}" else="1">
|
||||||
|
@ -76,17 +68,17 @@
|
||||||
|
|
||||||
<target name="init" depends="buildenvsetup">
|
<target name="init" depends="buildenvsetup">
|
||||||
<antcall target="writeversion" />
|
<antcall target="writeversion" />
|
||||||
<property file="ironchestversion.properties" />
|
<property file="version.properties" />
|
||||||
<property name="build.number" value="${ironchest.build.major.number}.${ironchest.build.minor.number}.${ironchest.build.revision.number}" />
|
<property name="build.number" value="${IronChest.build.major.number}.${IronChest.build.minor.number}.${IronChest.build.revision.number}" />
|
||||||
<property name="version.minecraft" value="${ironchest.build.mcversion}" />
|
<property name="version.minecraft" value="${IronChest.build.mcversion}" />
|
||||||
<property name="version.major" value="${ironchest.build.major.number}" />
|
<property name="version.major" value="${IronChest.build.major.number}" />
|
||||||
<property name="version.minor" value="${ironchest.build.minor.number}" />
|
<property name="version.minor" value="${IronChest.build.minor.number}" />
|
||||||
<property name="version.rev" value="${ironchest.build.revision.number}" />
|
<property name="version.rev" value="${IronChest.build.revision.number}" />
|
||||||
<property name="version" value="${version.major}.${version.minor}.${version.rev}.${version.build}" />
|
<property name="version" value="${version.major}.${version.minor}.${version.rev}.${version.build}" />
|
||||||
|
<antcall target="writeversion" />
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="clean">
|
<target name="clean">
|
||||||
<delete dir="${bukkit.tmpdir}"/>
|
|
||||||
<antcall target="clean-source">
|
<antcall target="clean-source">
|
||||||
<param name="side" value="client" />
|
<param name="side" value="client" />
|
||||||
</antcall>
|
</antcall>
|
||||||
|
@ -125,6 +117,7 @@
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="build-client" depends="init,clean,merge-client,buildandreobfmcp">
|
<target name="build-client" depends="init,clean,merge-client,buildandreobfmcp">
|
||||||
|
<antcall target="writeversion" />
|
||||||
<antcall target="extract-built-jar">
|
<antcall target="extract-built-jar">
|
||||||
<param name="side" value="client" />
|
<param name="side" value="client" />
|
||||||
</antcall>
|
</antcall>
|
||||||
|
@ -136,7 +129,7 @@
|
||||||
<mkdir dir="${basedir}/target" />
|
<mkdir dir="${basedir}/target" />
|
||||||
<jar destfile="${basedir}/target/${jarname}.zip">
|
<jar destfile="${basedir}/target/${jarname}.zip">
|
||||||
<fileset dir="${output}" includes="**/*.class" />
|
<fileset dir="${output}" includes="**/*.class" />
|
||||||
<zipfileset dir="${basedir}" includes="ironchestversion.properties"/>
|
<zipfileset dir="${basedir}" includes="version.properties"/>
|
||||||
<mappedresources>
|
<mappedresources>
|
||||||
<concat>
|
<concat>
|
||||||
<fileset dir="${basedir}" includes="mcmod.info" />
|
<fileset dir="${basedir}" includes="mcmod.info" />
|
||||||
|
@ -176,27 +169,6 @@
|
||||||
</delete>
|
</delete>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="merge-bukkit" depends="init">
|
|
||||||
<mkdir dir="${bukkit.tmpdir}"/>
|
|
||||||
<mkdir dir="${bukkit.mcp.srcdir}"/>
|
|
||||||
<antcall target="merge-source">
|
|
||||||
<param name="side" value="bukkit" />
|
|
||||||
</antcall>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<target name="build-bukkit" depends="init,merge-bukkit">
|
|
||||||
<property name="jarname" value="${basedir}/target/${modname}-bukkit-${version}.jar" />
|
|
||||||
<path id="bukkit.compile.ref"/>
|
|
||||||
<mkdir dir="${basedir}/target" />
|
|
||||||
<ant dir="${bukkitporting.dir}" target="convert-mcp-to-bukkit">
|
|
||||||
<reference refid="bukkit.compile.ref" />
|
|
||||||
<property name="modname" value="ironchest"/>
|
|
||||||
<property name="bukkit.output.jar" value="${jarname}"/>
|
|
||||||
<property name="bukkit.mcp.srcdir" value="${bukkit.mcp.srcdir}"/>
|
|
||||||
</ant>
|
|
||||||
<delete dir="${bukkit.tmpdir}"/>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<target name="deploy" depends="init,build-client">
|
<target name="deploy" depends="init,build-client">
|
||||||
<property name="jarname" value="${modname}-client-${version}" />
|
<property name="jarname" value="${modname}-client-${version}" />
|
||||||
<move file="${deploy.dir}/${jarname}.zip" tofile="${deploy.dir}/${jarname}.zip.${timestamp}" failonerror="false" verbose="true" />
|
<move file="${deploy.dir}/${jarname}.zip" tofile="${deploy.dir}/${jarname}.zip.${timestamp}" failonerror="false" verbose="true" />
|
||||||
|
|
|
@ -55,17 +55,8 @@ public class TileEntityIronChestRenderer extends TileEntitySpecialRenderer {
|
||||||
|
|
||||||
private RenderBlocks renderBlocks;
|
private RenderBlocks renderBlocks;
|
||||||
|
|
||||||
private static float[][] shifts = {
|
private static float[][] shifts = { { 0.3F, 0.45F, 0.3F }, { 0.7F, 0.45F, 0.3F }, { 0.3F, 0.45F, 0.7F }, { 0.7F, 0.45F, 0.7F }, { 0.3F, 0.1F, 0.3F },
|
||||||
{ 0.3F, 0.45F, 0.3F },
|
{ 0.7F, 0.1F, 0.3F }, { 0.3F, 0.1F, 0.7F }, { 0.7F, 0.1F, 0.7F }, { 0.5F, 0.32F, 0.5F }, };
|
||||||
{ 0.7F, 0.45F, 0.3F },
|
|
||||||
{ 0.3F, 0.45F, 0.7F },
|
|
||||||
{ 0.7F, 0.45F, 0.7F },
|
|
||||||
{ 0.3F, 0.1F, 0.3F },
|
|
||||||
{ 0.7F, 0.1F, 0.3F },
|
|
||||||
{ 0.3F, 0.1F, 0.7F },
|
|
||||||
{ 0.7F, 0.1F, 0.7F },
|
|
||||||
{ 0.5F, 0.32F, 0.5F },
|
|
||||||
};
|
|
||||||
|
|
||||||
public TileEntityIronChestRenderer() {
|
public TileEntityIronChestRenderer() {
|
||||||
model = new ModelChest();
|
model = new ModelChest();
|
||||||
|
@ -73,15 +64,11 @@ public class TileEntityIronChestRenderer extends TileEntitySpecialRenderer {
|
||||||
renderBlocks = new RenderBlocks();
|
renderBlocks = new RenderBlocks();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void overrideTexture(Object obj)
|
private void overrideTexture(Object obj) {
|
||||||
{
|
if (obj instanceof Item) {
|
||||||
if (obj instanceof Item)
|
GL11.glBindTexture(GL11.GL_TEXTURE_2D, FMLClientHandler.instance().getClient().renderEngine.getTexture(((Item) obj).getTextureFile()));
|
||||||
{
|
} else if (obj instanceof Block) {
|
||||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, FMLClientHandler.instance().getClient().renderEngine.getTexture(((Item)obj).getTextureFile()));
|
GL11.glBindTexture(GL11.GL_TEXTURE_2D, FMLClientHandler.instance().getClient().renderEngine.getTexture(((Block) obj).getTextureFile()));
|
||||||
}
|
|
||||||
else if (obj instanceof Block)
|
|
||||||
{
|
|
||||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, FMLClientHandler.instance().getClient().renderEngine.getTexture(((Block)obj).getTextureFile()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -91,10 +78,10 @@ public class TileEntityIronChestRenderer extends TileEntitySpecialRenderer {
|
||||||
}
|
}
|
||||||
int facing = 3;
|
int facing = 3;
|
||||||
IronChestType type = tile.getType();
|
IronChestType type = tile.getType();
|
||||||
if (tile != null && tile.func_70314_l() != null) {
|
if (tile != null && tile.getWorldObj() != null) {
|
||||||
facing = tile.getFacing();
|
facing = tile.getFacing();
|
||||||
type = tile.getType();
|
type = tile.getType();
|
||||||
int typ = tile.func_70314_l().getBlockMetadata(tile.xCoord, tile.yCoord, tile.zCoord);
|
int typ = tile.getWorldObj().getBlockMetadata(tile.xCoord, tile.yCoord, tile.zCoord);
|
||||||
type = IronChestType.values()[typ];
|
type = IronChestType.values()[typ];
|
||||||
}
|
}
|
||||||
bindTextureByName(type.getModelTexture());
|
bindTextureByName(type.getModelTexture());
|
||||||
|
@ -160,7 +147,7 @@ public class TileEntityIronChestRenderer extends TileEntitySpecialRenderer {
|
||||||
shiftZ = shifts[shift][2];
|
shiftZ = shifts[shift][2];
|
||||||
shift++;
|
shift++;
|
||||||
float localScale = blockScale;
|
float localScale = blockScale;
|
||||||
if (item.itemID < Block.blocksList.length && Block.blocksList[item.itemID] != null) {
|
if (item.itemID < Block.blocksList.length && Block.blocksList[item.itemID] != null && Block.blocksList[item.itemID].blockID != 0) {
|
||||||
int j = Block.blocksList[item.itemID].getRenderType();
|
int j = Block.blocksList[item.itemID].getRenderType();
|
||||||
if (j == 1 || j == 19 || j == 12 || j == 2) {
|
if (j == 1 || j == 19 || j == 12 || j == 2) {
|
||||||
localScale = 2 * blockScale;
|
localScale = 2 * blockScale;
|
||||||
|
@ -180,24 +167,28 @@ public class TileEntityIronChestRenderer extends TileEntitySpecialRenderer {
|
||||||
}
|
}
|
||||||
MappableItemStackWrapper mis = new MappableItemStackWrapper(item);
|
MappableItemStackWrapper mis = new MappableItemStackWrapper(item);
|
||||||
if (!IronChest.CACHE_RENDER || !renderList.containsKey(mis)) { // Added support for using only old system.
|
if (!IronChest.CACHE_RENDER || !renderList.containsKey(mis)) { // Added support for using only old system.
|
||||||
if (IronChest.CACHE_RENDER) {
|
|
||||||
int render = glGenLists(1);
|
|
||||||
renderList.put(mis, render);
|
|
||||||
glNewList(render, GL_COMPILE_AND_EXECUTE);
|
|
||||||
}
|
|
||||||
IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(item, IItemRenderer.ItemRenderType.ENTITY);
|
IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(item, IItemRenderer.ItemRenderType.ENTITY);
|
||||||
if (customRenderer != null) {
|
if (customRenderer != null) {
|
||||||
customitem.item = item;
|
customitem.item = item;
|
||||||
bindTextureByName("/terrain.png");
|
bindTextureByName("/terrain.png");
|
||||||
overrideTexture(item.getItem());
|
overrideTexture(item.getItem());
|
||||||
customRenderer.renderItem(IItemRenderer.ItemRenderType.ENTITY, item, renderBlocks, customitem);
|
customRenderer.renderItem(IItemRenderer.ItemRenderType.ENTITY, item, renderBlocks, customitem);
|
||||||
} else if (item.itemID < Block.blocksList.length && Block.blocksList[item.itemID] != null && RenderBlocks.renderItemIn3d(Block.blocksList[item.itemID].getRenderType())) {
|
} else if (item.itemID < Block.blocksList.length && Block.blocksList[item.itemID] != null && Block.blocksList[item.itemID].blockID != 0 && RenderBlocks.renderItemIn3d(Block.blocksList[item.itemID].getRenderType())) {
|
||||||
bindTextureByName("/terrain.png");
|
bindTextureByName("/terrain.png");
|
||||||
overrideTexture(Block.blocksList[item.itemID]);
|
overrideTexture(Block.blocksList[item.itemID]);
|
||||||
renderBlocks.renderBlockAsItem(Block.blocksList[item.itemID], item.getItemDamage(), 1.0F);
|
renderBlocks.renderBlockAsItem(Block.blocksList[item.itemID], item.getItemDamage(), 1.0F);
|
||||||
} else {
|
} else {
|
||||||
|
int render = 0;
|
||||||
|
if (IronChest.CACHE_RENDER) {
|
||||||
|
render = glGenLists(1);
|
||||||
|
if (render != 0)
|
||||||
|
{
|
||||||
|
renderList.put(mis, render);
|
||||||
|
glNewList(render, GL_COMPILE_AND_EXECUTE);
|
||||||
|
}
|
||||||
|
}
|
||||||
int i = item.getIconIndex();
|
int i = item.getIconIndex();
|
||||||
if (item.itemID >= Block.blocksList.length || Block.blocksList[item.itemID] == null) {
|
if (item.itemID >= Block.blocksList.length || Block.blocksList[item.itemID] == null || Block.blocksList[item.itemID].blockID == 0) {
|
||||||
bindTextureByName("/gui/items.png");
|
bindTextureByName("/gui/items.png");
|
||||||
overrideTexture(Item.itemsList[item.itemID]);
|
overrideTexture(Item.itemsList[item.itemID]);
|
||||||
} else {
|
} else {
|
||||||
|
@ -227,10 +218,10 @@ public class TileEntityIronChestRenderer extends TileEntitySpecialRenderer {
|
||||||
tessellator.addVertexWithUV(f13 - f14, 1.0F - f15, 0.0D, f8, f10);
|
tessellator.addVertexWithUV(f13 - f14, 1.0F - f15, 0.0D, f8, f10);
|
||||||
tessellator.addVertexWithUV(0.0F - f14, 1.0F - f15, 0.0D, f5, f10);
|
tessellator.addVertexWithUV(0.0F - f14, 1.0F - f15, 0.0D, f5, f10);
|
||||||
tessellator.draw();
|
tessellator.draw();
|
||||||
}
|
if (IronChest.CACHE_RENDER && render != 0) {
|
||||||
if (IronChest.CACHE_RENDER) {
|
|
||||||
glEndList();
|
glEndList();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Integer integer = renderList.get(mis);
|
Integer integer = renderList.get(mis);
|
||||||
if (integer != null) { // Added null check for auto-unboxing JUST in case.
|
if (integer != null) { // Added null check for auto-unboxing JUST in case.
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
package cpw.mods.ironchest;
|
package cpw.mods.ironchest;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
@ -41,12 +40,9 @@ public class BlockIronChest extends BlockContainer {
|
||||||
setBlockName("IronChest");
|
setBlockName("IronChest");
|
||||||
setHardness(3.0F);
|
setHardness(3.0F);
|
||||||
setRequiresSelfNotify();
|
setRequiresSelfNotify();
|
||||||
if (id >= 256) {
|
|
||||||
disableStats();
|
|
||||||
}
|
|
||||||
setBlockBounds(0.0625F, 0F, 0.0625F, 0.9375F, 0.875F, 0.9375F);
|
setBlockBounds(0.0625F, 0F, 0.0625F, 0.9375F, 0.875F, 0.9375F);
|
||||||
random = new Random();
|
random = new Random();
|
||||||
setCreativeTab(CreativeTabs.tabDeco);
|
setCreativeTab(CreativeTabs.tabDecorations);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
package cpw.mods.ironchest;
|
package cpw.mods.ironchest;
|
||||||
|
|
||||||
import java.lang.reflect.Method;
|
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
import net.minecraftforge.common.Configuration;
|
import net.minecraftforge.common.Configuration;
|
||||||
|
@ -30,14 +29,14 @@ import cpw.mods.fml.common.network.NetworkRegistry;
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
import cpw.mods.fml.common.registry.LanguageRegistry;
|
import cpw.mods.fml.common.registry.LanguageRegistry;
|
||||||
|
|
||||||
@Mod(modid = "IronChest", name = "Iron Chests", version = "4.0")
|
@Mod(modid = "IronChest", name = "Iron Chests", dependencies="required-after:FML@[3.1.15,)")
|
||||||
@NetworkMod(channels = { "IronChest" }, clientSideRequired = true, serverSideRequired = false, packetHandler = PacketHandler.class)
|
@NetworkMod(channels = { "IronChest" }, versionBounds = "[4.0,)", clientSideRequired = true, serverSideRequired = false, packetHandler = PacketHandler.class)
|
||||||
public class IronChest {
|
public class IronChest {
|
||||||
|
|
||||||
public static BlockIronChest ironChestBlock;
|
public static BlockIronChest ironChestBlock;
|
||||||
@SidedProxy(clientSide = "cpw.mods.ironchest.client.ClientProxy", serverSide = "cpw.mods.ironchest.CommonProxy")
|
@SidedProxy(clientSide = "cpw.mods.ironchest.client.ClientProxy", serverSide = "cpw.mods.ironchest.CommonProxy")
|
||||||
public static CommonProxy proxy;
|
public static CommonProxy proxy;
|
||||||
@Instance
|
@Instance("IronChest")
|
||||||
public static IronChest instance;
|
public static IronChest instance;
|
||||||
public static boolean CACHE_RENDER = true;
|
public static boolean CACHE_RENDER = true;
|
||||||
public static boolean OCELOTS_SITONCHESTS = true;
|
public static boolean OCELOTS_SITONCHESTS = true;
|
||||||
|
@ -45,6 +44,7 @@ public class IronChest {
|
||||||
|
|
||||||
@PreInit
|
@PreInit
|
||||||
public void preInit(FMLPreInitializationEvent event) {
|
public void preInit(FMLPreInitializationEvent event) {
|
||||||
|
Version.init(event.getVersionProperties());
|
||||||
event.getModMetadata().version = Version.fullVersionString();
|
event.getModMetadata().version = Version.fullVersionString();
|
||||||
Configuration cfg = new Configuration(event.getSuggestedConfigurationFile());
|
Configuration cfg = new Configuration(event.getSuggestedConfigurationFile());
|
||||||
try {
|
try {
|
||||||
|
@ -84,26 +84,5 @@ public class IronChest {
|
||||||
|
|
||||||
@PostInit
|
@PostInit
|
||||||
public void modsLoaded(FMLPostInitializationEvent evt) {
|
public void modsLoaded(FMLPostInitializationEvent evt) {
|
||||||
try {
|
|
||||||
Class<?> equivexmaps = Class.forName("ee.EEMaps");
|
|
||||||
Method addEMC = equivexmaps.getMethod("addEMC", int.class, int.class, int.class);
|
|
||||||
Method addMeta = equivexmaps.getMethod("addMeta", int.class, int.class);
|
|
||||||
int[] chestEMCValues = new int[] { 8 * 8 + 256 * 8, /* iron chest */
|
|
||||||
8 * 8 + 256 * 8 + 2048 * 8, /* gold chest */
|
|
||||||
2 * 8192 + 8 * 8 + 256 * 8 + 2048 * 8 + 6, /* diamond chest */
|
|
||||||
85 * 8 + 8 * 8, /* copper chest */
|
|
||||||
85 * 8 + 8 * 8 + 512 * 8, /* silver chest */
|
|
||||||
2 * 8192 + 8 * 8 + 256 * 8 + 2048 * 8 + 6 + 8 /* crystal chest */
|
|
||||||
};
|
|
||||||
for (IronChestType icType : IronChestType.values()) {
|
|
||||||
if (icType.ordinal() >= chestEMCValues.length)
|
|
||||||
break;
|
|
||||||
addEMC.invoke(null, ironChestBlock.blockID, icType.ordinal(), chestEMCValues[icType.ordinal()]);
|
|
||||||
}
|
|
||||||
addMeta.invoke(null, ironChestBlock.blockID, IronChestType.values().length - 1);
|
|
||||||
FMLLog.fine("mod_IronChest registered chests with Equivalent Exchange");
|
|
||||||
} catch (Exception ex) {
|
|
||||||
FMLLog.fine("mod_IronChest unable to load Equivalent Exchange integration");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@ public class ItemChestChanger extends Item {
|
||||||
this.type=type;
|
this.type=type;
|
||||||
setIconIndex(type.ordinal());
|
setIconIndex(type.ordinal());
|
||||||
setItemName(type.itemName);
|
setItemName(type.itemName);
|
||||||
setTabToDisplayOn(CreativeTabs.tabMisc);
|
setCreativeTab(CreativeTabs.tabMisc);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -15,7 +15,7 @@ public class OcelotsSitOnChestsHandler {
|
||||||
{
|
{
|
||||||
EntityOcelot ocelot = (EntityOcelot) evt.entityLiving;
|
EntityOcelot ocelot = (EntityOcelot) evt.entityLiving;
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
List<EntityAITaskEntry> tasks = ocelot.tasks.field_75782_a;
|
List<EntityAITaskEntry> tasks = ocelot.tasks.taskEntries;
|
||||||
|
|
||||||
for (int i=0; i<tasks.size(); i++)
|
for (int i=0; i<tasks.size(); i++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -334,7 +334,7 @@ public class TileEntityIronChest extends TileEntity implements IInventory {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Packet getAuxillaryInfoPacket() {
|
public Packet getDescriptionPacket() {
|
||||||
return PacketHandler.getPacket(this);
|
return PacketHandler.getPacket(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,12 +6,7 @@
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
package cpw.mods.ironchest;
|
package cpw.mods.ironchest;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
import java.util.logging.Level;
|
|
||||||
|
|
||||||
import cpw.mods.fml.common.FMLCommonHandler;
|
|
||||||
|
|
||||||
public class Version {
|
public class Version {
|
||||||
private static String major;
|
private static String major;
|
||||||
|
@ -19,37 +14,18 @@ public class Version {
|
||||||
private static String rev;
|
private static String rev;
|
||||||
private static String build;
|
private static String build;
|
||||||
private static String mcversion;
|
private static String mcversion;
|
||||||
private static boolean loaded;
|
|
||||||
|
|
||||||
private static void init() {
|
static void init(Properties properties) {
|
||||||
InputStream stream = Version.class.getClassLoader().getResourceAsStream("ironchestversion.properties");
|
if (properties != null) {
|
||||||
Properties properties = new Properties();
|
major = properties.getProperty("IronChest.build.major.number");
|
||||||
|
minor = properties.getProperty("IronChest.build.minor.number");
|
||||||
|
rev = properties.getProperty("IronChest.build.revision.number");
|
||||||
|
build = properties.getProperty("IronChest.build.number");
|
||||||
|
mcversion = properties.getProperty("IronChest.build.mcversion");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (stream != null) {
|
|
||||||
try {
|
|
||||||
properties.load(stream);
|
|
||||||
major = properties.getProperty("ironchest.build.major.number");
|
|
||||||
minor = properties.getProperty("ironchest.build.minor.number");
|
|
||||||
rev = properties.getProperty("ironchest.build.revision.number");
|
|
||||||
build = properties.getProperty("ironchest.build.build.number");
|
|
||||||
mcversion = properties.getProperty("ironchest.build.mcversion");
|
|
||||||
} catch (IOException ex) {
|
|
||||||
FMLCommonHandler.instance().getFMLLogger().log(Level.SEVERE, "Could not get IronChest version information - corrupted installation detected!", ex);
|
|
||||||
throw new RuntimeException(ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
loaded = true;
|
|
||||||
}
|
|
||||||
public static final String version() {
|
|
||||||
if (!loaded) {
|
|
||||||
init();
|
|
||||||
}
|
|
||||||
return major+"."+minor;
|
|
||||||
}
|
|
||||||
public static String fullVersionString() {
|
public static String fullVersionString() {
|
||||||
if (!loaded) {
|
return String.format("%s.%s.%s build %s", major,minor,rev, build);
|
||||||
init();
|
|
||||||
}
|
|
||||||
return String.format("%s.%s.%s build %s for %s", major,minor,rev, build, mcversion);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,18 +45,17 @@ def main():
|
||||||
vers="v1.0-0-deadbeef"
|
vers="v1.0-0-deadbeef"
|
||||||
(major,minor,rev,githash)=re.match("v(\d+).(\d+)-(\d+)-(.*)",vers).groups()
|
(major,minor,rev,githash)=re.match("v(\d+).(\d+)-(\d+)-(.*)",vers).groups()
|
||||||
|
|
||||||
(mcpversion,mcclientversion,mcserverversion) = re.match("[.\w]+ \(data: ([.\w]+), client: ([.\w.]+), server: ([.\w.]+)\)",Commands.fullversion()).groups()
|
(mcpversion,mcversion,mcserverversion) = re.match("[.\w]+ \(data: ([.\w]+), client: ([.\w.]+), server: ([.\w.]+)\)",Commands.fullversion()).groups()
|
||||||
|
|
||||||
with open("ironchestversion.properties","w") as f:
|
with open("version.properties","w") as f:
|
||||||
f.write("%s=%s\n" %("ironchest.build.major.number",major))
|
f.write("%s=%s\n" %("IronChest.build.major.number",major))
|
||||||
f.write("%s=%s\n" %("ironchest.build.minor.number",minor))
|
f.write("%s=%s\n" %("IronChest.build.minor.number",minor))
|
||||||
f.write("%s=%s\n" %("ironchest.build.revision.number",rev))
|
f.write("%s=%s\n" %("IronChest.build.revision.number",rev))
|
||||||
f.write("%s=%s\n" %("ironchest.build.githash",githash))
|
f.write("%s=%s\n" %("IronChest.build.githash",githash))
|
||||||
f.write("%s=%s\n" %("ironchest.build.mcpversion",mcpversion))
|
f.write("%s=%s\n" %("IronChest.build.mcpversion",mcpversion))
|
||||||
f.write("%s=%s\n" %("ironchest.build.mcclientversion",mcclientversion))
|
f.write("%s=%s\n" %("IronChest.build.mcversion",mcversion))
|
||||||
f.write("%s=%s\n" %("ironchest.build.mcserverversion",mcserverversion))
|
|
||||||
|
|
||||||
print("Version information: IronChest %s.%s.%s using MCP %s for c:%s, s:%s" % (major, minor, rev, mcpversion, mcclientversion, mcserverversion))
|
print("Version information: IronChest %s.%s.%s using MCP %s for %s" % (major, minor, rev, mcpversion, mcversion))
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
"description": "New chests with larger sizes, with in-place upgrade items.
|
"description": "New chests with larger sizes, with in-place upgrade items.
|
||||||
The feature chest is the crystal chest, which is transparent - some inventory contents are visible without opening the chest",
|
The feature chest is the crystal chest, which is transparent - some inventory contents are visible without opening the chest",
|
||||||
"version": "@VERSION@",
|
"version": "@VERSION@",
|
||||||
"mcversion": "1.2.5",
|
"mcversion": "1.3.2",
|
||||||
"url": "http://www.minecraftforum.net/topic/981855-",
|
"url": "http://www.minecraftforum.net/topic/981855-",
|
||||||
"updateUrl": "",
|
"updateUrl": "",
|
||||||
"authors": [
|
"authors": [
|
||||||
|
|
Loading…
Reference in New Issue