3.0.1 - fix block id > 256 (throw error)
This commit is contained in:
parent
9aa53eec37
commit
085ae170ea
|
@ -13,7 +13,7 @@
|
|||
</description>
|
||||
|
||||
<property name="modname" value="mod_ironchests" />
|
||||
<property name="version" value="3.0" />
|
||||
<property name="version" value="3.0.1" />
|
||||
<property name="mcp.home" location="/home/cpw/projects/mcworkspace/forge1.3.4" />
|
||||
<property name="mcp.obfoutput" location="${mcp.home}/reobf" />
|
||||
<property name="client.mcp.obfoutput" location="${mcp.obfoutput}/minecraft" />
|
||||
|
|
|
@ -25,6 +25,9 @@ public class BlockIronChest extends BlockContainer implements ITextureProvider {
|
|||
setBlockName("IronChest");
|
||||
setHardness(3.0F);
|
||||
setRequiresSelfNotify();
|
||||
if (id>=256) {
|
||||
disableStats();
|
||||
}
|
||||
random=new Random();
|
||||
}
|
||||
|
||||
|
|
|
@ -23,18 +23,22 @@ public class mod_IronChest extends BaseModMp {
|
|||
|
||||
@Override
|
||||
public String getVersion() {
|
||||
return "3.0";
|
||||
return "3.0.1";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void load() {
|
||||
MinecraftForge.versionDetect("IronChest", 1, 3, 4);
|
||||
MinecraftForge.versionDetect("IronChest", 1, 4, 0);
|
||||
proxy = ServerClientProxy.getProxy();
|
||||
File cfgFile = new File(proxy.getMinecraftDir(), "config/IronChest.cfg");
|
||||
Configuration cfg = new Configuration(cfgFile);
|
||||
try {
|
||||
cfg.load();
|
||||
ironChestBlock = new BlockIronChest(Integer.parseInt(cfg.getOrCreateBlockIdProperty("ironChests", 181).value));
|
||||
int bId=Integer.parseInt(cfg.getOrCreateBlockIdProperty("ironChests", 181).value);
|
||||
if (bId>=256) {
|
||||
throw new RuntimeException(String.format("IronChest detected an invalid block id %s\n",bId));
|
||||
}
|
||||
ironChestBlock = new BlockIronChest(bId);
|
||||
ChestChangerType.buildItems(cfg, 19501);
|
||||
IronChestType.initGUIs(cfg);
|
||||
} catch (Exception e) {
|
||||
|
|
Loading…
Reference in New Issue