Update for 1.6
|
@ -15,6 +15,11 @@
|
|||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
<linkedResources>
|
||||
<link>
|
||||
<name>common/assets</name>
|
||||
<type>2</type>
|
||||
<locationURI>PROJECT_LOC/resources/assets</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>common/mcmod.info</name>
|
||||
<type>1</type>
|
||||
|
|
|
@ -23,6 +23,7 @@ import net.minecraft.client.renderer.texture.IconRegister;
|
|||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
|
@ -152,7 +153,7 @@ public class BlockIronChest extends BlockContainer {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int i, int j, int k, EntityLiving entityliving, ItemStack itemStack)
|
||||
public void onBlockPlacedBy(World world, int i, int j, int k, EntityLivingBase entityliving, ItemStack itemStack)
|
||||
{
|
||||
byte chestFacing = 0;
|
||||
int facing = MathHelper.floor_double((double) ((entityliving.rotationYaw * 4F) / 360F) + 0.5D) & 3;
|
||||
|
|
|
@ -18,6 +18,7 @@ import net.minecraftforge.common.MinecraftForge;
|
|||
import net.minecraftforge.event.ForgeSubscribe;
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.Mod.EventHandler;
|
||||
import cpw.mods.fml.common.Mod.Init;
|
||||
import cpw.mods.fml.common.Mod.Instance;
|
||||
import cpw.mods.fml.common.Mod.PostInit;
|
||||
|
@ -43,7 +44,7 @@ public class IronChest {
|
|||
public static boolean OCELOTS_SITONCHESTS = true;
|
||||
private int blockId;
|
||||
|
||||
@PreInit
|
||||
@EventHandler
|
||||
public void preInit(FMLPreInitializationEvent event)
|
||||
{
|
||||
Version.init(event.getVersionProperties());
|
||||
|
@ -63,15 +64,16 @@ public class IronChest {
|
|||
}
|
||||
finally
|
||||
{
|
||||
if (cfg.hasChanged())
|
||||
cfg.save();
|
||||
}
|
||||
}
|
||||
|
||||
@Init
|
||||
public void load(FMLInitializationEvent evt)
|
||||
{
|
||||
ironChestBlock = new BlockIronChest(blockId);
|
||||
GameRegistry.registerBlock(ironChestBlock, ItemIronChest.class, "BlockIronChest");
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void load(FMLInitializationEvent evt)
|
||||
{
|
||||
for (IronChestType typ : IronChestType.values())
|
||||
{
|
||||
GameRegistry.registerTileEntityWithAlternatives(typ.clazz, "IronChest."+typ.name(), typ.name());
|
||||
|
@ -93,7 +95,7 @@ public class IronChest {
|
|||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
@PostInit
|
||||
@EventHandler
|
||||
public void modsLoaded(FMLPostInitializationEvent evt)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ public enum IronChestType {
|
|||
this.rowLength = rowLength;
|
||||
this.tieredChest = tieredChest;
|
||||
this.friendlyName = friendlyName;
|
||||
this.modelTexture = "/mods/ironchest/textures/model/" + modelTexture;
|
||||
this.modelTexture = modelTexture;
|
||||
this.textureRow = textureRow;
|
||||
this.clazz = clazz;
|
||||
this.recipes = recipes;
|
||||
|
|
|
@ -10,7 +10,10 @@
|
|||
******************************************************************************/
|
||||
package cpw.mods.ironchest.client;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.client.renderer.ChestItemRenderHelper;
|
||||
import net.minecraft.client.resources.ResourceLocation;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
package cpw.mods.ironchest.client;
|
||||
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.resources.ResourceLocation;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
|
||||
|
@ -21,26 +22,38 @@ import cpw.mods.ironchest.IronChestType;
|
|||
import cpw.mods.ironchest.TileEntityIronChest;
|
||||
|
||||
public class GUIChest extends GuiContainer {
|
||||
public enum ResourceList {
|
||||
IRON(new ResourceLocation("ironchest", "textures/gui/ironcontainer.png")),
|
||||
COPPER(new ResourceLocation("ironchest", "textures/gui/coppercontainer.png")),
|
||||
SILVER(new ResourceLocation("ironchest", "textures/gui/silvercontainer.png")),
|
||||
GOLD(new ResourceLocation("ironchest", "textures/gui/goldcontainer.png")),
|
||||
DIAMOND(new ResourceLocation("ironchest", "textures/gui/diamondcontainer.png"));
|
||||
public final ResourceLocation location;
|
||||
private ResourceList(ResourceLocation loc) {
|
||||
this.location = loc;
|
||||
}
|
||||
}
|
||||
public enum GUI {
|
||||
IRON(184, 202, "/mods/ironchest/textures/gui/ironcontainer.png", IronChestType.IRON),
|
||||
GOLD(184, 256, "/mods/ironchest/textures/gui/goldcontainer.png", IronChestType.GOLD),
|
||||
DIAMOND(238, 256, "/mods/ironchest/textures/gui/diamondcontainer.png", IronChestType.DIAMOND),
|
||||
COPPER(184, 184, "/mods/ironchest/textures/gui/coppercontainer.png", IronChestType.COPPER),
|
||||
SILVER(184, 238, "/mods/ironchest/textures/gui/silvercontainer.png", IronChestType.SILVER),
|
||||
CRYSTAL(238, 256, "/mods/ironchest/textures/gui/diamondcontainer.png", IronChestType.CRYSTAL),
|
||||
OBSIDIAN(238, 256, "/mods/ironchest/textures/gui/diamondcontainer.png", IronChestType.OBSIDIAN);
|
||||
IRON(184, 202, ResourceList.IRON, IronChestType.IRON),
|
||||
GOLD(184, 256, ResourceList.GOLD, IronChestType.GOLD),
|
||||
DIAMOND(238, 256, ResourceList.DIAMOND, IronChestType.DIAMOND),
|
||||
COPPER(184, 184, ResourceList.COPPER, IronChestType.COPPER),
|
||||
SILVER(184, 238, ResourceList.SILVER, IronChestType.SILVER),
|
||||
CRYSTAL(238, 256, ResourceList.DIAMOND, IronChestType.CRYSTAL),
|
||||
OBSIDIAN(238, 256, ResourceList.DIAMOND, IronChestType.OBSIDIAN);
|
||||
|
||||
private int xSize;
|
||||
private int ySize;
|
||||
private String guiTexture;
|
||||
private ResourceList guiResourceList;
|
||||
private IronChestType mainType;
|
||||
|
||||
private GUI(int xSize, int ySize, String guiTexture, IronChestType mainType)
|
||||
private GUI(int xSize, int ySize, ResourceList guiResourceList, IronChestType mainType)
|
||||
{
|
||||
this.xSize = xSize;
|
||||
this.ySize = ySize;
|
||||
this.guiTexture = guiTexture;
|
||||
this.guiResourceList = guiResourceList;
|
||||
this.mainType = mainType;
|
||||
|
||||
}
|
||||
|
||||
protected Container makeContainer(IInventory player, IInventory chest)
|
||||
|
@ -75,7 +88,7 @@ public class GUIChest extends GuiContainer {
|
|||
{
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
// new "bind tex"
|
||||
mc.renderEngine.bindTexture(type.guiTexture);
|
||||
this.mc.func_110434_K().func_110577_a(type.guiResourceList.location);
|
||||
int x = (width - xSize) / 2;
|
||||
int y = (height - ySize) / 2;
|
||||
drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
|
||||
|
|
|
@ -36,6 +36,7 @@ import net.minecraft.client.renderer.Tessellator;
|
|||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.client.resources.ResourceLocation;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -46,6 +47,8 @@ import net.minecraftforge.client.MinecraftForgeClient;
|
|||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.ImmutableMap.Builder;
|
||||
import com.google.common.primitives.SignedBytes;
|
||||
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
|
@ -57,6 +60,14 @@ import cpw.mods.ironchest.TileEntityIronChest;
|
|||
public class TileEntityIronChestRenderer extends TileEntitySpecialRenderer {
|
||||
private static Map<MappableItemStackWrapper, Integer> renderList = new HashMap<MappableItemStackWrapper, Integer>();
|
||||
|
||||
private static Map<IronChestType, ResourceLocation> locations;
|
||||
static {
|
||||
Builder<IronChestType, ResourceLocation> builder = ImmutableMap.<IronChestType,ResourceLocation>builder();
|
||||
for (IronChestType typ : IronChestType.values()) {
|
||||
builder.put(typ, new ResourceLocation("ironchest","textures/model/"+typ.getModelTexture()));
|
||||
}
|
||||
locations = builder.build();
|
||||
}
|
||||
private Random random;
|
||||
|
||||
private RenderBlocks renderBlocks;
|
||||
|
@ -104,7 +115,7 @@ public class TileEntityIronChestRenderer extends TileEntitySpecialRenderer {
|
|||
int typ = tile.getWorldObj().getBlockMetadata(tile.xCoord, tile.yCoord, tile.zCoord);
|
||||
type = IronChestType.values()[typ];
|
||||
}
|
||||
bindTextureByName(type.getModelTexture());
|
||||
func_110628_a(locations.get(type));
|
||||
glPushMatrix();
|
||||
glEnable(32826 /* GL_RESCALE_NORMAL_EXT */);
|
||||
glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
|
Before Width: | Height: | Size: 679 B After Width: | Height: | Size: 679 B |
Before Width: | Height: | Size: 661 B After Width: | Height: | Size: 661 B |
Before Width: | Height: | Size: 546 B After Width: | Height: | Size: 546 B |
Before Width: | Height: | Size: 396 B After Width: | Height: | Size: 396 B |
Before Width: | Height: | Size: 396 B After Width: | Height: | Size: 396 B |
Before Width: | Height: | Size: 382 B After Width: | Height: | Size: 382 B |
Before Width: | Height: | Size: 762 B After Width: | Height: | Size: 762 B |
Before Width: | Height: | Size: 719 B After Width: | Height: | Size: 719 B |
Before Width: | Height: | Size: 572 B After Width: | Height: | Size: 572 B |
Before Width: | Height: | Size: 784 B After Width: | Height: | Size: 784 B |
Before Width: | Height: | Size: 726 B After Width: | Height: | Size: 726 B |
Before Width: | Height: | Size: 572 B After Width: | Height: | Size: 572 B |
Before Width: | Height: | Size: 787 B After Width: | Height: | Size: 787 B |
Before Width: | Height: | Size: 726 B After Width: | Height: | Size: 726 B |
Before Width: | Height: | Size: 572 B After Width: | Height: | Size: 572 B |
Before Width: | Height: | Size: 586 B After Width: | Height: | Size: 586 B |
Before Width: | Height: | Size: 593 B After Width: | Height: | Size: 593 B |
Before Width: | Height: | Size: 604 B After Width: | Height: | Size: 604 B |
Before Width: | Height: | Size: 625 B After Width: | Height: | Size: 625 B |
Before Width: | Height: | Size: 608 B After Width: | Height: | Size: 608 B |
Before Width: | Height: | Size: 527 B After Width: | Height: | Size: 527 B |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 480 B After Width: | Height: | Size: 480 B |
Before Width: | Height: | Size: 480 B After Width: | Height: | Size: 480 B |
Before Width: | Height: | Size: 418 B After Width: | Height: | Size: 418 B |
Before Width: | Height: | Size: 466 B After Width: | Height: | Size: 466 B |
Before Width: | Height: | Size: 480 B After Width: | Height: | Size: 480 B |
Before Width: | Height: | Size: 526 B After Width: | Height: | Size: 526 B |
Before Width: | Height: | Size: 526 B After Width: | Height: | Size: 526 B |
Before Width: | Height: | Size: 480 B After Width: | Height: | Size: 480 B |
Before Width: | Height: | Size: 480 B After Width: | Height: | Size: 480 B |
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |