Fixed GUIs, IC2 log spam, and bad Manipulator

shift-right-wrench-doohigie-really-long-commit-message-click issue.
This commit is contained in:
Brian Ricketts 2013-03-25 04:08:29 -05:00
parent 87d22898a8
commit f531771e12
8 changed files with 70 additions and 13 deletions

View file

@ -309,7 +309,7 @@ public class GuiEncoder extends GuiContainer implements IInventoryWatcher
@Override
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
{
int var4 = this.mc.renderEngine.getTexture(AssemblyLine.GUI_TEXTURES_PATH + "gui_encoder.png");
this.mc.renderEngine.bindTexture(AssemblyLine.GUI_TEXTURES_PATH + "gui_encoder.png");
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.drawTexturedModalRect(containerWidth, containerHeight + ContainerEncoder.Y_OFFSET, 0, 0, this.xSize, this.ySize);

View file

@ -40,7 +40,7 @@ public class GuiImprinter extends GuiContainer
@Override
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
{
int var4 = this.mc.renderEngine.getTexture(AssemblyLine.GUI_TEXTURES_PATH + "gui_imprinter.png");
this.mc.renderEngine.bindTexture(AssemblyLine.GUI_TEXTURES_PATH + "gui_imprinter.png");
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.containerWidth = (this.width - this.xSize) / 2;
this.containerHeight = (this.height - this.ySize) / 2;

View file

@ -67,9 +67,9 @@ public class AssemblyLine
public static final String MODEL_TEXTURES_PATH = TEXTURE_PATHS + "models/";
public static final String BLOCK_TEXTURES_PATH = TEXTURE_PATHS + "blocks/";
public static final String ITEM_TEXTURES_PATH = TEXTURE_PATHS + "items/";
public static final String GUI_TEXTURES_PATH = TEXTURE_PATHS + "guis/";
public static final String GUI_TEXTURES_PATH = TEXTURE_PATHS + "gui/";
public static final String LANGUAGE_PATH = DIRECTORY + "languages/";
public static final String TEXTURE_NAME_PREFIX = "assemblyline:";
private static final String[] LANGUAGES_SUPPORTED = new String[] { "en_US" };
@ -95,6 +95,7 @@ public class AssemblyLine
public static final int ITEM_ID_PREFIX = 13030;
public static Item itemImprint;
public static Item itemDisk;
public static ItemStack ic2Wrench = null;
public static Logger FMLog = Logger.getLogger(AssemblyLine.NAME);
@ -106,7 +107,7 @@ public class AssemblyLine
public void preInit(FMLPreInitializationEvent event)
{
FMLog.setParent(FMLLog.getLogger());
//UniversalElectricity.register(this, 1, 2, 6, false);
// UniversalElectricity.register(this, 1, 2, 6, false);
instance = this;
CONFIGURATION.load();
@ -175,6 +176,7 @@ public class AssemblyLine
if (ic2)
{
createIC2Recipes();
ic2Wrench = Items.getItem("wrench");
}
if (ue)
{

View file

@ -59,7 +59,8 @@ public class BlockALMachine extends BlockAdvanced
if (this.onSneakUseWrench(world, x, y, z, player, side, hitX, hitY, hitZ))
return true;
}
return this.onUseWrench(world, x, y, z, player, side, hitX, hitY, hitZ);
if (this.onUseWrench(world, x, y, z, player, side, hitX, hitY, hitZ))
return true;
}
}
return super.onBlockActivated(world, x, y, z, player, side, hitX, hitY, hitZ);
@ -72,7 +73,7 @@ public class BlockALMachine extends BlockAdvanced
{
if (player.getCurrentEquippedItem() != null)
{
return ((Items.getItem("wrench") != null && player.getCurrentEquippedItem().isItemEqual(Items.getItem("wrench"))) || player.getCurrentEquippedItem().getItem() instanceof IToolWrench);
return (AssemblyLine.ic2Wrench != null && player.getCurrentEquippedItem().isItemEqual(AssemblyLine.ic2Wrench) || player.getCurrentEquippedItem().getItem() instanceof IToolWrench);
}
return false;

View file

@ -2,33 +2,68 @@ package assemblyline.common.block;
import java.util.Random;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Icon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import universalelectricity.core.vector.Vector3;
import universalelectricity.prefab.implement.IRotatable;
import assemblyline.common.AssemblyLine;
import assemblyline.common.TabAssemblyLine;
public class BlockTurntable extends BlockALMachine
{
private Icon top;
public BlockTurntable(int par1)
{
super(par1, Material.piston);
this.setUnlocalizedName("turntable");
this.setCreativeTab(TabAssemblyLine.INSTANCE);
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister iconReg)
{
super.registerIcons(iconReg);
this.top = iconReg.registerIcon(AssemblyLine.TEXTURE_NAME_PREFIX + "turntable");
}
@Override
public void updateTick(World world, int x, int y, int z, Random par5Random)
{
this.updateTurntableState(world, x, y, z);
}
@Override
@SideOnly(Side.CLIENT)
public Icon getBlockTexture(IBlockAccess world, int x, int y, int z, int side)
{
if (side == ForgeDirection.UP.ordinal())
return this.top;
return this.machine_icon;
}
@Override
@SideOnly(Side.CLIENT)
public Icon getBlockTextureFromSideAndMetadata(int side, int meta)
{
if (side == ForgeDirection.UP.ordinal())
return this.top;
return this.machine_icon;
}
public static int determineOrientation(World world, int x, int y, int z, EntityPlayer entityPlayer)
{

View file

@ -74,7 +74,7 @@ public class BlockManipulator extends BlockImprintable
}
}
return false;
return true;
}
@Override

View file

@ -1,17 +1,18 @@
package assemblyline.common.machine.encoder;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Icon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import assemblyline.common.AssemblyLine;
import assemblyline.common.CommonProxy;
import assemblyline.common.TabAssemblyLine;
import assemblyline.common.block.BlockALMachine;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockEncoder extends BlockALMachine
{
@ -33,6 +34,16 @@ public class BlockEncoder extends BlockALMachine
this.encoder_top = iconReg.registerIcon(AssemblyLine.TEXTURE_NAME_PREFIX+"encoder_top");
this.encoder_bottom = iconReg.registerIcon(AssemblyLine.TEXTURE_NAME_PREFIX+"encoder_bottom");
}
/**
* Returns the block texture based on the side being looked at. Args: side
*/
@Override
public Icon getBlockTexture(IBlockAccess world, int x, int y, int z, int side)
{
return getBlockTextureFromSideAndMetadata(side, 0);
}
/**
* Returns the block texture based on the side being looked at. Args: side
*/

View file

@ -10,6 +10,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Icon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import assemblyline.common.AssemblyLine;
import assemblyline.common.CommonProxy;
@ -35,9 +36,16 @@ public class BlockImprinter extends BlockALMachine
@Override
public void registerIcons(IconRegister iconReg)
{
this.imprinter_side = iconReg.registerIcon(AssemblyLine.TEXTURE_NAME_PREFIX+"imprinter_side");
this.imprinter_top = iconReg.registerIcon(AssemblyLine.TEXTURE_NAME_PREFIX+"imprinter_top");
this.imprinter_bottom = iconReg.registerIcon(AssemblyLine.TEXTURE_NAME_PREFIX+"imprinter_bottom");
this.imprinter_side = iconReg.registerIcon(AssemblyLine.TEXTURE_NAME_PREFIX + "imprinter_side");
this.imprinter_top = iconReg.registerIcon(AssemblyLine.TEXTURE_NAME_PREFIX + "imprinter_top");
this.imprinter_bottom = iconReg.registerIcon(AssemblyLine.TEXTURE_NAME_PREFIX + "imprinter_bottom");
}
@Override
@SideOnly(Side.CLIENT)
public Icon getBlockTexture(IBlockAccess world, int x, int y, int z, int side)
{
return getBlockTextureFromSideAndMetadata(side, 0);
}
/**