Jump to content

TripleXGaming

Members
  • Posts

    10
  • Joined

  • Last visited

Converted

  • Gender
    Male
  • URL
    http://quantumcraft.us
  • Location
    Somewhere in Wisconsin
  • Personal Text
    Developer of Quantumcraft

TripleXGaming's Achievements

Tree Puncher

Tree Puncher (2/8)

1

Reputation

  1. Ok it finally works.. Thank you. ive been tring to fix this for a while now .. i had the xSize and ySize in the wrong place lol
  2. if things are different... make sure say your useing that so people know ... people will assume your not
  3. ok so for me i use eclipse and i have the mcp/src/minecraft/assets/ ... and so on. this is where i put my textures and eclipse when it runs mc it will copy the textures over to mcp/eclipse/Minecraft/bin/assets/ ... if the texture does get put in here also it wont load the texture... unless your talking about when your mod is compiled and in a jar?
  4. i have a gui that is larger than a normal gui in minecraft and only the slots outside of the normal area will drop items into the world on click. once i put the item in the gui i cant take it out without it dropping and i dont want that .. package TripleXGaming.Quantumcraft.TileEntities; import org.lwjgl.opengl.GL11; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; public class containerControlUnit extends Container{ protected TileEntityControlUnit tileEntity; public containerControlUnit (InventoryPlayer inventoryPlayer, TileEntityControlUnit te){ tileEntity = te; for(int i = 0; i < 9; i++){ this.addSlotToContainer(new MachineOutput(tileEntity, i, 8 + i * 18, -40)); } for(int i = 14; i < 20; i++){ this.addSlotToContainer(new ParticalAcceleratorQCSlot(tileEntity, i, 263, -27 + i * 18 - 14 * 18)); } this.addSlotToContainer(new Slot(tileEntity, 10, 44, 14)); this.addSlotToContainer(new Slot(tileEntity, 11, 44, 32)); this.addSlotToContainer(new Slot(tileEntity, 12, 116, 14)); this.addSlotToContainer(new Slot(tileEntity, 13, 116, 32)); bindPlayerInventory(inventoryPlayer); } @Override public boolean canInteractWith(EntityPlayer player) { return tileEntity.isUseableByPlayer(player); } protected void bindPlayerInventory(InventoryPlayer inventoryPlayer) { for(int i = 0; i < 9; i++){ this.addSlotToContainer(new Slot(inventoryPlayer, i, 8 + i * 18, 148)); } for(int j = 9; j < 18; j++){ this.addSlotToContainer(new Slot(inventoryPlayer, j, 8 + j * 18 - 9 * 18, 90)); } for(int j = 18; j < 27; j++){ this.addSlotToContainer(new Slot(inventoryPlayer, j, 8 + j * 18 - 18 * 18, 108)); } for(int j = 27; j < 36; j++){ this.addSlotToContainer(new Slot(inventoryPlayer, j, 8 + j * 18 - 27 * 18, 126)); } } @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot) { return null; } }
  5. make sure the texture is copying to your workspace for running it ... not just your src assets folder sometimes it doesnt copy it over automaticly. this happens to me occasionaly. MAKE sure your texure name in the folder is not capital letters minecraft wont recognise it
  6. so for adding slots and moving them back to the correct locations so im shifting the 8 to 18 and that is moving the slots over then when it does it again i change it back this for(int i = 0; i < 9; i++){ this.addSlotToContainer(new MachineOutput(tileEntity, i, 8 + i * 18, -40)); to for(int i = 0; i < 9; i++){ this.addSlotToContainer(new MachineOutput(tileEntity, i, 18 + i * 18, -40)); for the gui texture i was useing something like this but of couse changed @Override protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { ResourceLocation textures = (new ResourceLocation("quantumcraft:textures/gui/guibase.png")); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); this.mc.getTextureManager().bindTexture(textures); int x = (width - xSize) / 2; int y = (height - ySize) / 2; this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); } and that only worked for guis a little bit bigger than the normal gui size before it wouldnt display correctly now im useing @Override protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { //draw your Gui here, only thing you need to change is the path GL11.glPushMatrix(); GL11.glTranslatef(0.0f, 0.0f,0.0f); ResourceLocation textures = (new ResourceLocation("quantumcraft:textures/gui/guibase.png")); // GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); this.mc.getTextureManager().bindTexture(textures); int xSize = 512; int ySize = 256; int x = (width - xSize) / 2; int y = (height - ySize) / 2; drawTexturedQuadFit(x+62, y, xSize, ySize, zLevel); GL11.glPopMatrix(); } when the slots shift sideways all of them shift exactly 10px to the right then when i go and changed the location in the code when they shift again they shift left.. i hope you understand all this .. im not sure if im makeing it as clear as it could be
  7. sorry if i dont see what your trying to say ive only been coding for a month and a half but i am not useing any GL11.glTranslatef , and all the gui things you see don't actually work atm they are just on the texture to show me what goes where. so the only thing this is doing is rendering the gui and slots ... the reason i have the tessellator is because the normal way to render the gui was making the gui too small/large and not scaled correctly i will try what you sugested.. anyways edit so i added a GL11.glTranslatef(0.0f, 0.0f, 0.0f); and so far i think it fixed it .. cant be sure tho it has taken over an hour to shift the positions so time will tell ...
  8. these are the two screenshots of the good one and bad one. http://i.imgur.com/TywGMZ1.png - good http://i.imgur.com/AYMgj8D.png - bad hope someone can help. still haven't found the issue on my own all slots are being shifted not just the inventory
  9. the textures go in your src/minecraft/assets/<modname>/textures/blocks you should also go look up some forge tut on the wiki because stuff has changed since 1.4
  10. i've been working on a gui for a particle accelerator and i've gotten a lot done but the problem is the gui will randomly shift right 10 px so i will go in and change the slots to line up again and it works but then randomly it will shift back 10px. ive tried to re code the gui and it still happens so yes i know the code doesnt look good but it was a quick test to see if it would happen again. this is the container for it package TripleXGaming.Quantumcraft.TileEntities; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; public class containerControlUnit extends Container{ protected TileEntityControlUnit tileEntity; // public static final int INPUT_1 = 1, INPUT_2 = 2, INPUT_3 = 3, QCore = 4, OUTPUT_1 = 5, OUTPUT_2 = 6, OUTPUT_3 = 7; public containerControlUnit (InventoryPlayer inventoryPlayer, TileEntityControlUnit te){ tileEntity = te; for(int i = 0; i < 9; i++){ this.addSlotToContainer(new MachineOutput(tileEntity, i, 8 + i * 18, -40)); } for(int i = 14; i < 20; i++){ this.addSlotToContainer(new ParticalAcceleratorQCSlot(tileEntity, i, 263, -27 + i * 18 - 14 * 18)); } this.addSlotToContainer(new Slot(tileEntity, 10, 44, 14)); this.addSlotToContainer(new Slot(tileEntity, 11, 44, 32)); this.addSlotToContainer(new Slot(tileEntity, 12, 116, 14)); this.addSlotToContainer(new Slot(tileEntity, 13, 116, 32)); bindPlayerInventory(inventoryPlayer) } @Override public boolean canInteractWith(EntityPlayer player) { return tileEntity.isUseableByPlayer(player); } protected void bindPlayerInventory(InventoryPlayer inventoryPlayer) { for(int i = 0; i < 9; i++){ this.addSlotToContainer(new Slot(inventoryPlayer, i, 8 + i * 18, 148)); } for(int j = 9; j < 18; j++){ this.addSlotToContainer(new Slot(inventoryPlayer, j, 8 + j * 18 - 9 * 18, 90)); } for(int j = 18; j < 27; j++){ this.addSlotToContainer(new Slot(inventoryPlayer, j, 8 + j * 18 - 18 * 18, 108)); } for(int j = 27; j < 36; j++){ this.addSlotToContainer(new Slot(inventoryPlayer, j, 8 + j * 18 - 27 * 18, 126)); } } //Todo once gui is done @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot) { return null; } } this is the gui for the machine package TripleXGaming.Quantumcraft.gui; import org.lwjgl.opengl.GL11; import TripleXGaming.Quantumcraft.QCModInfo; import TripleXGaming.Quantumcraft.Quantumcraft; import TripleXGaming.Quantumcraft.TileEntities.TileEntityControlUnit; import TripleXGaming.Quantumcraft.TileEntities.containerControlUnit; import cpw.mods.fml.common.network.PacketDispatcher; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.renderer.Tessellator; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.network.packet.Packet250CustomPayload; import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; public class GuiControlUnit extends GuiContainer { containerControlUnit CU = new containerControlUnit(null, null); public GuiControlUnit (InventoryPlayer inventoryPlayer, TileEntityControlUnit tileEntity) { super(new containerControlUnit(inventoryPlayer, tileEntity)); } public static void drawTexturedQuadFit(double x, double y, double width, double height, double zLevel){ Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); tessellator.addVertexWithUV(x + 0, y + height, zLevel, 0,1); tessellator.addVertexWithUV(x + width, y + height, zLevel, 1, 1); tessellator.addVertexWithUV(x + width, y + 0, zLevel, 1,0); tessellator.addVertexWithUV(x + 0, y + 0, zLevel, 0, 0); tessellator.draw(); } @Override protected void drawGuiContainerForegroundLayer(int param1, int param2) { //draw text and stuff here //the parameters for drawString are: string, x, y, color fontRenderer.drawString(" Particle Accelerator", 8, -20, 4210752); //draws "Inventory" or your regional equivalent // fontRenderer.drawString(StatCollector.translateToLocal("container.inventory"), 8, ySize - 96 + 2, 4210752); } @Override protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { //draw your Gui here, only thing you need to change is the path ResourceLocation textures = (new ResourceLocation("quantumcraft:textures/gui/guibase.png")); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); this.mc.getTextureManager().bindTexture(textures); int xSize = 512; int ySize = 256; int x = (width - xSize) / 2; int y = (height - ySize) / 2; drawTexturedQuadFit(x+62, y, xSize, ySize, zLevel); } @Override public void initGui() { super.initGui(); } protected void actionPerformed(GuiButton guibutton) { //id is the id you give your button switch(guibutton.id) { case 1: break; case 2: break; default: } } } this is my first time posting on here so im not sure if i included all needed information.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.