Uncommented the code for chest tile entities... Apparently everything works...
This commit is contained in:
parent
a015481d3d
commit
9bdaeb6ed5
|
@ -172,6 +172,9 @@ func_177580_d - getModelLocation
|
|||
func_177584_b - getBlockStateLocation
|
||||
func_177586_a - getModelBlockDefinition
|
||||
|
||||
—Minecraft—
|
||||
field_175617_aL - modelManager
|
||||
|
||||
——————————
|
||||
FIXES
|
||||
——————————
|
||||
|
|
|
@ -10,23 +10,21 @@
|
|||
******************************************************************************/
|
||||
package cpw.mods.ironchest;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
import net.minecraft.block.state.BlockState;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockIronChest extends /*BlockContainer*/Block
|
||||
public class BlockIronChest extends BlockContainer
|
||||
{
|
||||
public static final PropertyEnum VARIANT_PROP = PropertyEnum.func_177709_a("variant", IronChestType.class);
|
||||
|
||||
|
@ -54,6 +52,36 @@ public class BlockIronChest extends /*BlockContainer*/Block
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState blockState, EntityPlayer player, EnumFacing direction, float p_180639_6_, float p_180639_7_, float p_180639_8_)
|
||||
{
|
||||
TileEntity te = world.getTileEntity(pos);
|
||||
|
||||
if (te == null || !(te instanceof TileEntityIronChest))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/*if (world.isSideSolid(i, j + 1, k, ForgeDirection.DOWN))
|
||||
{
|
||||
return true;
|
||||
}*/
|
||||
|
||||
if (world.isRemote)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
player.openGui(IronChest.instance, ((TileEntityIronChest) te).getType().ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int metadata)
|
||||
{
|
||||
return IronChestType.makeEntity(metadata);
|
||||
}
|
||||
|
||||
/*@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item itemIn, CreativeTabs tab, List list)
|
||||
|
@ -91,12 +119,6 @@ public class BlockIronChest extends /*BlockContainer*/Block
|
|||
return 22;
|
||||
}*/
|
||||
|
||||
/*@Override
|
||||
public TileEntity createNewTileEntity(World world, int metadata)
|
||||
{
|
||||
return IronChestType.makeEntity(metadata);
|
||||
}*/
|
||||
|
||||
/*@Override
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune)
|
||||
{
|
||||
|
@ -106,30 +128,6 @@ public class BlockIronChest extends /*BlockContainer*/Block
|
|||
items.add(stack);
|
||||
return items;
|
||||
}*/
|
||||
|
||||
/*@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState blockState, EntityPlayer player, EnumFacing direction, float p_180639_6_, float p_180639_7_, float p_180639_8_)
|
||||
{
|
||||
TileEntity te = world.getTileEntity(pos);
|
||||
|
||||
if (te == null || !(te instanceof TileEntityIronChest))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/*if (world.isSideSolid(i, j + 1, k, ForgeDirection.DOWN))
|
||||
{
|
||||
return true;
|
||||
}*/
|
||||
|
||||
/*if (world.isRemote)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
player.openGui(IronChest.instance, ((TileEntityIronChest) te).getType().ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
|
||||
return true;
|
||||
}*/
|
||||
|
||||
/*@Override
|
||||
public void onBlockAdded(World world, BlockPos pos, IBlockState blockState)
|
||||
|
|
|
@ -29,52 +29,35 @@ public class IronChest {
|
|||
public static CommonProxy proxy;
|
||||
@Instance("IronChest")
|
||||
public static IronChest instance;
|
||||
public static boolean CACHE_RENDER = true;
|
||||
public static boolean OCELOTS_SITONCHESTS = true;
|
||||
|
||||
@EventHandler
|
||||
public void preInit(FMLPreInitializationEvent event)
|
||||
{
|
||||
Version.init(event.getVersionProperties());
|
||||
event.getModMetadata().version = Version.fullVersionString();
|
||||
/*TODO Configuration cfg = new Configuration(event.getSuggestedConfigurationFile());
|
||||
try
|
||||
{
|
||||
cfg.load();
|
||||
ChestChangerType.buildItems(cfg);
|
||||
CACHE_RENDER = cfg.get(Configuration.CATEGORY_GENERAL, "cacheRenderingInformation", true).getBoolean(true);
|
||||
OCELOTS_SITONCHESTS = cfg.get(Configuration.CATEGORY_GENERAL, "ocelotsSitOnChests", true).getBoolean(true);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
FMLLog.log(Level.ERROR, e, "IronChest has a problem loading its configuration");
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (cfg.hasChanged())
|
||||
cfg.save();
|
||||
}*/
|
||||
|
||||
//ChestChangerType.buildItems(cfg);
|
||||
ironChestBlock = new BlockIronChest();
|
||||
GameRegistry.registerBlock(ironChestBlock, ItemIronChest.class, "BlockIronChest");
|
||||
//PacketHandler.INSTANCE.ordinal();
|
||||
PacketHandler.INSTANCE.ordinal();
|
||||
}
|
||||
|
||||
/*@EventHandler
|
||||
@EventHandler
|
||||
public void load(FMLInitializationEvent evt)
|
||||
{
|
||||
for (IronChestType typ : IronChestType.values())
|
||||
{
|
||||
GameRegistry.registerTileEntityWithAlternatives(typ.clazz, "IronChest."+typ.name(), typ.name());
|
||||
GameRegistry.registerTileEntityWithAlternatives(typ.clazz, "IronChest." + typ.name(), typ.name());
|
||||
proxy.registerTileEntitySpecialRenderer(typ);
|
||||
}
|
||||
//OreDictionary.registerOre("chestWood", Blocks.chest);
|
||||
IronChestType.registerBlocksAndRecipes(ironChestBlock);
|
||||
ChestChangerType.generateRecipes();
|
||||
//IronChestType.registerBlocksAndRecipes(ironChestBlock);
|
||||
//ChestChangerType.generateRecipes();
|
||||
NetworkRegistry.INSTANCE.registerGuiHandler(instance, proxy);
|
||||
proxy.registerRenderInformation();
|
||||
// if (OCELOTS_SITONCHESTS)
|
||||
// {
|
||||
// MinecraftForge.EVENT_BUS.register(new OcelotsSitOnChestsHandler());
|
||||
// }
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,7 +10,9 @@
|
|||
******************************************************************************/
|
||||
package cpw.mods.ironchest.client;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererChestHelper;
|
||||
import net.minecraft.client.resources.IReloadableResourceManager;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
|
@ -21,10 +23,11 @@ import cpw.mods.ironchest.CommonProxy;
|
|||
import cpw.mods.ironchest.IronChestType;
|
||||
import cpw.mods.ironchest.TileEntityIronChest;
|
||||
|
||||
public class ClientProxy extends CommonProxy {
|
||||
public class ClientProxy extends CommonProxy
|
||||
{
|
||||
@Override
|
||||
public void registerRenderInformation()
|
||||
{
|
||||
{
|
||||
//TileEntityRendererChestHelper.instance = new IronChestRenderHelper();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue