Everything posted by GodOfYeti
-
XP help
I have a block that lets you add exp levels but when you reopen the block it resets your level package com.mcpixelplex.Gui; import org.lwjgl.opengl.GL11; import com.mcpixelplex.lib.RefStrings; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiScreen; import net.minecraft.entity.item.EntityXPOrb; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; public class TestGui extends GuiScreen { Minecraft mc = Minecraft.getMinecraft(); GuiButton testButton; public String[] levelDisplay = new String[]{"1","2","3","4","5","6","7","8","9","10"}; public int level = 0; public int currentPower = 0; public int maxPower = 1000; public final int xSizeOfTexture = 256; public final int ySizeOfTexture = 156; public TestGui(EntityPlayer player){ } @Override public void drawScreen(int x, int y, float f){ int xPos = (this.width - xSizeOfTexture) / 2; int yPos = (this.height - ySizeOfTexture) / 2; int levelPosX = (xSizeOfTexture) / 2; int levelPosY = (ySizeOfTexture) / 2; GL11.glColor4f(1F, 1F, 1F, 1F); mc.renderEngine.bindTexture(new ResourceLocation(RefStrings.MODID, "/textures/gui/background.png")); drawDefaultBackground(); drawTexturedModalRect(xPos, yPos, 0, 0, xSizeOfTexture, ySizeOfTexture); fontRendererObj.drawString("XP Block", xPos + 20, yPos + 5, 0x000000); fontRendererObj.drawString(String.valueOf(level), levelPosX + 85 , levelPosY + 45, 0x000000); super.drawScreen(xPos, y, f); } public void initGui(){ int xSize = 100; int ySize = 20; int xPos = (xSizeOfTexture) / 2; int yPos = (ySizeOfTexture) / 2; int bottomButton = (ySizeOfTexture - ySize - 2); buttonList.clear(); buttonList.add(new GuiButton(0, xPos + 40, bottomButton + 40, 100, 20, "Give XP")); buttonList.add(new GuiButton(1, xPos + 40, yPos + 40, 20, 20, "+")); buttonList.add(new GuiButton(2, xPos + 120, yPos + 40, 20, 20, "-")); super.initGui(); } public void playerEffects(){ EntityPlayer player = mc.thePlayer; player.addExperienceLevel(level); player.setHealth(1000); } public void actionPerformed(GuiButton button){ switch(button.id){ case 0: playerEffects(); break; case 1: level++; break; case 2: if(level == 0){ }else{ level--; } break; } } @Override public boolean doesGuiPauseGame(){ return false; } }
-
Help with Gui
Ok how can I get the params for world and player
-
Help with Gui
could someone tell me why the buttons are not working package com.mcpixelplex.Gui; import org.lwjgl.opengl.GL11; import com.mcpixelplex.lib.RefStrings; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiScreen; import net.minecraft.entity.item.EntityXPOrb; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; public class TestGui extends GuiScreen { Minecraft mc = Minecraft.getMinecraft(); GuiButton testButton; public String[] levelDisplay = new String[]{"1","2","3","4","5","6","7","8","9","10"}; public int level = 0; public int currentPower = 0; public int maxPower = 1000; public final int xSizeOfTexture = 256; public final int ySizeOfTexture = 156; public TestGui(EntityPlayer player){ } @Override public void drawScreen(int x, int y, float f){ int xPos = (this.width - xSizeOfTexture) / 2; int yPos = (this.height - ySizeOfTexture) / 2; int levelPosX = (xSizeOfTexture) / 2; int levelPosY = (ySizeOfTexture) / 2; GL11.glColor4f(1F, 1F, 1F, 1F); mc.renderEngine.bindTexture(new ResourceLocation(RefStrings.MODID, "/textures/gui/background.png")); drawDefaultBackground(); drawTexturedModalRect(xPos, yPos, 0, 0, xSizeOfTexture, ySizeOfTexture); fontRendererObj.drawString("XP Block", xPos + 20, yPos + 5, 0x000000); fontRendererObj.drawString(String.valueOf(level), levelPosX + 85 , levelPosY + 45, 0x000000); super.drawScreen(xPos, y, f); } public void initGui(){ int xSize = 100; int ySize = 20; int xPos = (xSizeOfTexture) / 2; int yPos = (ySizeOfTexture) / 2; int bottomButton = (ySizeOfTexture - ySize - 2); buttonList.clear(); buttonList.add(new GuiButton(0, xPos + 40, bottomButton + 40, 100, 20, "Give XP")); buttonList.add(new GuiButton(1, xPos + 40, yPos + 40, 20, 20, "+")); buttonList.add(new GuiButton(2, xPos + 120, yPos + 40, 20, 20, "-")); super.initGui(); } public void spawnXP(World world, EntityPlayer player){ double pX = player.posX; double pY = player.posY; double pZ = player.posZ; int xp = 1000; world.spawnEntityInWorld(new EntityXPOrb(world, pX, pY, pZ, xp)); } public void actionPerformed(GuiButton button, World world, EntityPlayer player){ switch(button.id){ case 0: //this.spawnXP(world, player); break; case 1: level++; break; case 2: if(level == 0){ }else{ level--; } break; } } @Override public boolean doesGuiPauseGame(){ return false; } }
-
help with xp
Im sorry Im still a tab bit new, how would I go about doing that.
-
help with xp
whats the code to give a player exp level
- Update text on gui
-
Update text on gui
I want to update the text on my gui when the "+" button is pressed heres the gui code package com.mcpixelplex.Gui; import org.lwjgl.opengl.GL11; import com.mcpixelplex.lib.RefStrings; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiScreen; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.ResourceLocation; public class TestGui extends GuiScreen { Minecraft mc = Minecraft.getMinecraft(); GuiButton testButton; public String[] levelDisplay = new String[]{"1","2","3","4","5","6","7","8","9","10"}; public int level = 0; public final int xSizeOfTexture = 256; public final int ySizeOfTexture = 156; public TestGui(EntityPlayer player){ } @Override public void drawScreen(int x, int y, float f){ int posX = (this.width - xSizeOfTexture) / 2; int posY = (this.height - ySizeOfTexture) / 2; GL11.glColor4f(1F, 1F, 1F, 1F); mc.renderEngine.bindTexture(new ResourceLocation(RefStrings.MODID, "/textures/gui/background.png")); drawDefaultBackground(); drawTexturedModalRect(posX, posY, 0, 0, xSizeOfTexture, ySizeOfTexture); fontRendererObj.drawString("XP Block", posX + 20, posY + 5, 0x000000); fontRendererObj.drawString(levelDisplay[level], xSizeOfTexture / 2, ySizeOfTexture / 2, 0x000000); super.drawScreen(x, y, f); } public void initGui(){ int xSize = 100; int ySize = 20; int posX = (xSizeOfTexture) / 2; int posY = (ySizeOfTexture) / 2; int bottomButton = (ySizeOfTexture - ySize - 2); buttonList.clear(); buttonList.add(new GuiButton(0, posX + 40, bottomButton + 40, 100, 20, "no use")); buttonList.add(new GuiButton(1, posX + 40, posY + 40, 20, 20, "+")); super.initGui(); } public void actionPreformed(GuiButton button){ switch(button.id){ case 0: break; case 1: if(level == 10){ }else{ level++; } } } @Override public boolean doesGuiPauseGame(){ return false; } }
-
Could someone explain this error to me
Ok the games start but when I join or create a world it crashes and says this Error If more information is needed please tell me Ill add all my classes
-
Code error
Updated Post, hope there is better information.
-
Code error
Could someone look this over and tell me what I can do to fix this code its giving me errors but not a way to fix them (Updated) Main Code BlockMacerator Tile Entity Macerator GuiMacerator Container OreRecipes Error report
-
Game crashes when joining world
http://authenticgaming.net/Video/videofiles/minecrafterrorvideo.mp4 This is what happens when when its not crashing
-
Game crashes when joining world
There are no red x
-
Game crashes when joining world
For this most of us use eclipse. I do use eclipse but im not very familiar with it.
-
Game crashes when joining world
Is there a way to figure out what method needs to be fixed and where its located
-
Game crashes when joining world
- Game crashes when joining world
I tried that and I still crash when i said that i was on my phone so was unable to reference my code, now that im home im looking at my code and see that it should be setRotationAngles(f, f1, f2, f3, f4, f5, entity); nope- Game crashes when joining world
I tried that and I still crash- Game crashes when joining world
Ok I added some code up there that is all i've really done since it worked Could you tell me a bit of what its saying is broke help narrow it down for me, I'd rather not redo it and find out it was 1 peice I redid the entire model and used the new code it got me about 5 more seconds in the game till the neither loaded then it crashed plus when its not crashing the camera is spazing out- Game crashes when joining world
Ok I added some code up there that is all i've really done since it worked Could you tell me a bit of what its saying is broke help narrow it down for me, I'd rather not redo it and find out it was 1 peice- Game crashes when joining world
Ok I added some code up there that is all i've really done since it worked- Game crashes when joining world
Ok so the game loads fine then when I go to the world it shows for 1 second then goes blue and crashes heres the crash report Code If this is still not enough then ill add every class- Game crashes after starting to add tile entity
That has been getting me all week... Thank you for the help i'm very greatful- Game crashes after starting to add tile entity
Post logs or Thread will be locked. I think I've added everything you ask for.- Game crashes after starting to add tile entity
Please anyone.- Game crashes after starting to add tile entity
Posted 02 January 2014 - 08:25 PM I've started a mod and its gone fine till I started to add a tile entity. Now every time I start Minecraft it crashes, here's the code of the item crashing me. Main class where everything is defined item crashing me Entire Console Log Crash Report If someone could look this over and help me through whats going on I would greatly appreciate it. - Game crashes when joining world
IPS spam blocked by CleanTalk.
Important Information
By using this site, you agree to our Terms of Use.