Fixed Forge's 4096 block filler initalization.

This commit is contained in:
LexManos 2012-08-19 17:59:06 -07:00
parent f341fdfd61
commit 3a726c6e68

View file

@ -166,27 +166,15 @@ public class MinecraftForge
*/
public static void initialize()
{
//Cause the classes to initialize if they already haven't
Block.stone.getTextureFile();
Item.appleGold.getTextureFile();
Block filler = null;
try
{
Constructor ctr = Block.class.getDeclaredConstructor(int.class, Material.class);
ctr.setAccessible(true);
filler = (Block)ctr.newInstance(256, Material.air);
}
catch (Exception e)
{
RuntimeException rte = new RuntimeException("Could not create Forge filler block", e);
rte.printStackTrace();
System.exit(1);
}
Block filler = new Block(0, Material.air);
Block.blocksList[0] = null;
Block.opaqueCubeLookup[0] = false;
Block.lightOpacity[0] = 0;
Block.canBlockGrass[0] = false;
for (int x = 256; x < 4096; x++)
{
if (Item.itemsList[x - 256] != null)
if (Item.itemsList[x] != null)
{
Block.blocksList[x] = filler;
}