More 1.5 port work (and general cleanup). Still doesn't build yet.

This commit is contained in:
pahimar 2013-03-04 16:02:24 -05:00
parent 1a1aa173c3
commit e3f6491c4f
24 changed files with 30 additions and 134 deletions

View file

@ -17,7 +17,6 @@ import com.pahimar.ee3.lib.GuiIds;
import com.pahimar.ee3.lib.RenderIds;
import com.pahimar.ee3.lib.Strings;
import com.pahimar.ee3.tileentity.TileAlchemicalChest;
import com.pahimar.ee3.tileentity.TileAludel;
public class BlockAlchemicalChest extends BlockEE {
@ -57,12 +56,6 @@ public class BlockAlchemicalChest extends BlockEE {
return RenderIds.alchemicalChestRenderId;
}
@Override
public int getBlockTextureFromSide(int par1) {
return 1;
}
@Override
public void breakBlock(World world, int x, int y, int z, int id, int meta) {

View file

@ -57,12 +57,6 @@ public class BlockAludel extends BlockEE {
return RenderIds.aludelRenderId;
}
@Override
public int getBlockTextureFromSide(int par1) {
return 1;
}
@Override
public void breakBlock(World world, int x, int y, int z, int id, int meta) {

View file

@ -2,7 +2,6 @@ package com.pahimar.ee3.block;
import java.util.Random;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
@ -66,12 +65,6 @@ public class BlockCalcinator extends BlockEE {
return RenderIds.calcinatorRenderId;
}
@Override
public int getBlockTextureFromSide(int par1) {
return 1;
}
@Override
public void breakBlock(World world, int x, int y, int z, int id, int meta) {

View file

@ -1,5 +1,9 @@
package com.pahimar.ee3.client.gui.inventory;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.StatCollector;
import org.lwjgl.opengl.GL11;
import com.pahimar.ee3.inventory.ContainerAlchemicalChest;
@ -11,11 +15,6 @@ import cpw.mods.fml.common.registry.LanguageRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.util.StatCollector;
@SideOnly(Side.CLIENT)
public class GuiAlchemicalChest extends GuiContainer {

View file

@ -2,13 +2,13 @@ package com.pahimar.ee3.client.model;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraftforge.client.ForgeHooksClient;
import org.lwjgl.opengl.GL11;
import com.pahimar.ee3.lib.Sprites;
import com.pahimar.ee3.tileentity.TileAludel;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -79,7 +79,7 @@ public class ModelAludel extends ModelBase {
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glTranslated(x, y, z);
ForgeHooksClient.bindTexture(Sprites.MODEL_ALUDEL, 0);
FMLClientHandler.instance().getClient().renderEngine.func_98187_b(Sprites.MODEL_ALUDEL);
this.render(scale);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();

View file

@ -2,13 +2,13 @@ package com.pahimar.ee3.client.model;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraftforge.client.ForgeHooksClient;
import org.lwjgl.opengl.GL11;
import com.pahimar.ee3.lib.Sprites;
import com.pahimar.ee3.tileentity.TileCalcinator;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -147,7 +147,7 @@ public class ModelCalcinator extends ModelBase {
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glTranslated(x, y, z);
ForgeHooksClient.bindTexture(Sprites.MODEL_CALCINATOR, 0);
FMLClientHandler.instance().getClient().renderEngine.func_98187_b(Sprites.MODEL_CALCINATOR);
this.render(scale);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();

View file

@ -3,13 +3,13 @@ package com.pahimar.ee3.client.renderer;
import net.minecraft.client.model.ModelChest;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.ForgeHooksClient;
import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
import com.pahimar.ee3.lib.Sprites;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -59,7 +59,7 @@ public class ItemAlchemicalChestRenderer implements IItemRenderer {
private void renderAlchemicalChest(float x, float y, float z) {
Tessellator tesselator = Tessellator.instance;
ForgeHooksClient.bindTexture(Sprites.MODEL_ALCHEMICAL_CHEST, 0);
FMLClientHandler.instance().getClient().renderEngine.func_98187_b(Sprites.MODEL_ALCHEMICAL_CHEST);
GL11.glPushMatrix(); //start
GL11.glTranslatef(x, y, z); //size
GL11.glRotatef(180, 1, 0, 0);

View file

@ -1,18 +1,17 @@
package com.pahimar.ee3.client.renderer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
import com.pahimar.ee3.client.model.ModelAludel;
import com.pahimar.ee3.lib.Sprites;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.ForgeHooksClient;
import net.minecraftforge.client.IItemRenderer;
@SideOnly(Side.CLIENT)
public class ItemAludelRenderer implements IItemRenderer {
@ -58,8 +57,7 @@ public class ItemAludelRenderer implements IItemRenderer {
private void renderAludel(float x, float y, float z) {
Tessellator tesselator = Tessellator.instance;
ForgeHooksClient.bindTexture(Sprites.MODEL_ALUDEL, 0);
FMLClientHandler.instance().getClient().renderEngine.func_98187_b(Sprites.MODEL_ALUDEL);
GL11.glPushMatrix(); //start
GL11.glTranslatef(x, y, z); //size
aludelModel.render(0.0625F);

View file

@ -1,8 +1,6 @@
package com.pahimar.ee3.client.renderer;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.ForgeHooksClient;
import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
@ -10,6 +8,7 @@ import org.lwjgl.opengl.GL11;
import com.pahimar.ee3.client.model.ModelCalcinator;
import com.pahimar.ee3.lib.Sprites;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -69,8 +68,7 @@ public class ItemCalcinatorRenderer implements IItemRenderer {
private void renderCalcinator(float x, float y, float z) {
Tessellator tesselator = Tessellator.instance;
ForgeHooksClient.bindTexture(Sprites.MODEL_CALCINATOR, 0);
FMLClientHandler.instance().getClient().renderEngine.func_98187_b(Sprites.MODEL_CALCINATOR);
GL11.glPushMatrix(); //start
GL11.glTranslatef(x, y, z); //size
calcinatorModel.render(0.0625F);

View file

@ -1,17 +1,17 @@
package com.pahimar.ee3.client.renderer.tileentity;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import net.minecraft.client.model.ModelChest;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.client.ForgeHooksClient;
import net.minecraftforge.common.ForgeDirection;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import com.pahimar.ee3.lib.Sprites;
import com.pahimar.ee3.tileentity.TileAlchemicalChest;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -29,7 +29,7 @@ public class TileEntityAlchemicalChestRenderer extends TileEntitySpecialRenderer
direction = ForgeDirection.getOrientation(tileAlchemicalChest.getBlockMetadata());
}
ForgeHooksClient.bindTexture(Sprites.MODEL_ALCHEMICAL_CHEST, 0);
FMLClientHandler.instance().getClient().renderEngine.func_98187_b(Sprites.MODEL_ALCHEMICAL_CHEST);
GL11.glPushMatrix();
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);

View file

@ -259,7 +259,7 @@ public class EquivalencyHandler {
public void debug() {
int i = 0;
for (ArrayList list : equivalencyList) {
for (ArrayList<ItemStack> list : equivalencyList) {
System.out.println("equivalencyList[" + i + "]: " + list.toString());
++i;
}

View file

@ -23,7 +23,6 @@ import com.pahimar.ee3.network.packet.PacketItemUpdate;
import com.pahimar.ee3.network.packet.PacketSoundEvent;
import com.pahimar.ee3.network.packet.PacketSpawnParticle;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.network.PacketDispatcher;
import cpw.mods.fml.common.network.Player;

View file

@ -1,7 +1,5 @@
package com.pahimar.ee3.core.helper;
import com.pahimar.ee3.lib.Strings;
import cpw.mods.fml.common.registry.LanguageRegistry;
/**

View file

@ -10,6 +10,10 @@ import net.minecraft.item.ItemStack;
import org.lwjgl.opengl.GL11;
import com.pahimar.ee3.lib.Sprites;
import cpw.mods.fml.client.FMLClientHandler;
public class RenderUtils {
private static int rotationAngle = 0;
@ -19,7 +23,7 @@ public class RenderUtils {
RenderBlocks renderBlocks = new RenderBlocks();
Block block = Block.blocksList[stack.itemID];
renderEngine.bindTexture(renderEngine.getTexture(block.getTextureFile()));
renderEngine.func_98187_b(block.getTextureFile());
GL11.glPushMatrix();
GL11.glTranslatef((float) (x - 2), (float) (y + 3), -3.0F + zLevel);
GL11.glScalef(10.0F, 10.0F, 10.0F);

View file

@ -1,6 +1,5 @@
package com.pahimar.ee3.core.helper;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.Properties;

View file

@ -54,7 +54,6 @@ import com.pahimar.ee3.tileentity.TileAlchemicalChest;
import com.pahimar.ee3.tileentity.TileAludel;
import com.pahimar.ee3.tileentity.TileCalcinator;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.client.registry.KeyBindingRegistry;
import cpw.mods.fml.client.registry.RenderingRegistry;

View file

@ -23,7 +23,6 @@ public class ItemAlchemyBag extends ItemEE {
public ItemAlchemyBag(int id) {
super(id);
this.setIconCoord(7, 0);
this.setUnlocalizedName(Strings.ALCHEMY_BAG_NAME);
this.setCreativeTab(EquivalentExchange3.tabsEE3);
}
@ -52,7 +51,7 @@ public class ItemAlchemyBag extends ItemEE {
}
@Override
public int getIconIndex(ItemStack itemStack, int renderPass) {
public Icon getIconIndex(ItemStack itemStack, int renderPass) {
if (NBTHelper.hasTag(itemStack, Strings.NBT_ITEM_ALCHEMY_BAG_GUI_OPEN)) {
if (renderPass == 0) {
@ -71,64 +70,4 @@ public class ItemAlchemyBag extends ItemEE {
}
}
}
@SideOnly(Side.CLIENT)
public int getColorFromItemStack(ItemStack itemStack, int renderPass) {
int returnValue = Integer.parseInt(Colours.PURE_WHITE, 16);
if (renderPass == 0) {
switch (itemStack.getItemDamage()) {
case 0:
returnValue = Integer.parseInt(Colours.BAG_WHITE, 16);
break;
case 1:
returnValue = Integer.parseInt(Colours.BAG_ORANGE, 16);
break;
case 2:
returnValue = Integer.parseInt(Colours.BAG_MAGENTA, 16);
break;
case 3:
returnValue = Integer.parseInt(Colours.BAG_LIGHT_BLUE, 16);
break;
case 4:
returnValue = Integer.parseInt(Colours.BAG_YELLOW, 16);
break;
case 5:
returnValue = Integer.parseInt(Colours.BAG_LIME, 16);
break;
case 6:
returnValue = Integer.parseInt(Colours.BAG_PINK, 16);
break;
case 7:
returnValue = Integer.parseInt(Colours.BAG_GRAY, 16);
break;
case 8:
returnValue = Integer.parseInt(Colours.BAG_LIGHT_GRAY, 16);
break;
case 9:
returnValue = Integer.parseInt(Colours.BAG_CYAN, 16);
break;
case 10:
returnValue = Integer.parseInt(Colours.BAG_PURPLE, 16);
break;
case 11:
returnValue = Integer.parseInt(Colours.BAG_BLUE, 16);
break;
case 12:
returnValue = Integer.parseInt(Colours.BAG_BROWN, 16);
break;
case 13:
returnValue = Integer.parseInt(Colours.BAG_GREEN, 16);
break;
case 14:
returnValue = Integer.parseInt(Colours.BAG_RED, 16);
break;
case 15:
returnValue = Integer.parseInt(Colours.BAG_BLACK, 16);
break;
}
}
return returnValue;
}
}

View file

@ -31,24 +31,16 @@ public class ItemAlchemyDust extends ItemEE {
super(id);
this.setHasSubtypes(true);
this.setIconCoord(11, 0);
this.setUnlocalizedName(Strings.ALCHEMY_DUST_NAME);
this.setCreativeTab(EquivalentExchange3.tabsEE3);
maxStackSize = 64;
}
@SideOnly(Side.CLIENT)
public int getIconFromDamage(int meta) {
int i = MathHelper.clamp_int(meta, 0, 5);
return (this.iconIndex + i);
}
@SideOnly(Side.CLIENT)
public String getItemNameIS(ItemStack stack) {
int meta = MathHelper.clamp_int(stack.getItemDamage(), 0, 5);
return super.getItemName() + "." + alchemyDustNames[meta];
return super.getUnlocalizedName() + "." + alchemyDustNames[meta];
}
@SideOnly(Side.CLIENT)

View file

@ -17,9 +17,7 @@ public class ItemInertStone extends ItemEE {
public ItemInertStone(int id) {
super(id);
this.setIconCoord(1, 0);
this.setUnlocalizedName(Strings.INERT_STONE_NAME);
this.setCreativeTab(EquivalentExchange3.tabsEE3);
}
}

View file

@ -17,10 +17,8 @@ public class ItemMiniumShard extends ItemEE {
public ItemMiniumShard(int id) {
super(id);
this.setIconCoord(0, 0);
this.setUnlocalizedName(Strings.MINIUM_SHARD_NAME);
this.setCreativeTab(EquivalentExchange3.tabsEE3);
maxStackSize = 64;
}
}

View file

@ -31,7 +31,6 @@ public class ItemMiniumStone extends ItemEE
public ItemMiniumStone(int id) {
super(id);
this.setIconCoord(2, 0);
this.setUnlocalizedName(Strings.MINIUM_STONE_NAME);
this.setCreativeTab(EquivalentExchange3.tabsEE3);
this.setMaxDamage(ConfigurationSettings.MINIUM_STONE_MAX_DURABILITY - 1);

View file

@ -37,7 +37,6 @@ public class ItemPhilosopherStone extends ItemEE
public ItemPhilosopherStone(int id) {
super(id);
this.setIconCoord(3, 0);
this.setUnlocalizedName(Strings.PHILOSOPHER_STONE_NAME);
this.setCreativeTab(EquivalentExchange3.tabsEE3);
this.setMaxDamage(ConfigurationSettings.PHILOSOPHERS_STONE_MAX_DURABILITY - 1);

View file

@ -7,11 +7,9 @@ import java.io.IOException;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.network.INetworkManager;
import com.pahimar.ee3.EquivalentExchange3;
import com.pahimar.ee3.core.handlers.WorldTransmutationHandler;
import com.pahimar.ee3.network.PacketTypeHandler;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.network.Player;
public class PacketRequestEvent extends PacketEE {

View file

@ -5,7 +5,6 @@ import java.io.DataOutputStream;
import java.io.IOException;
import net.minecraft.network.INetworkManager;
import net.minecraftforge.common.ForgeDirection;
import com.pahimar.ee3.network.PacketTypeHandler;