YoWazzup
-
Posts
66 -
Joined
-
Last visited
Posts posted by YoWazzup
-
-
-
I'll just send my whole Gui class then, since I have no idea where the error is then.
public class GuiSkill extends GuiScreen { private final int imageHeight = 129; private final int imageWidth = 176; private static final int SKILL_WIDTH = 64; private static final int SKILL_HEIGHT = 32; private static final int MINING_X = 4; private static final int MINING_Y = 4; private static final int WOOD_X = 4; private static final int WOOD_Y = 37; private static ResourceLocation guiTexture = new ResourceLocation(Reference.MODID + ":textures/gui/gui.png"); private GuiButton buttonDone; private SkillMining mining; private SkillWoodcutting woodcutting; public GuiSkill() { mining = new SkillMining("mining"); woodcutting = new SkillWoodcutting(); } @Override public void initGui() { buttonList.clear(); Keyboard.enableRepeatEvents(true); buttonDone = new GuiButton(0, width / 2 - (98 / 2), 25 + imageHeight, 98, 20, I18n.format("gui.done", new Object[0])); buttonList.add(buttonDone); } int levelMining; int currentExp; @Override public void updateScreen() { levelMining = mining.getCurrentLevel(); currentExp = mining.getCurrentXp(); buttonDone.visible = true; } @Override public void drawScreen(int mouseX, int mouseY, float partialTicks) { super.drawScreen(mouseX, mouseY, partialTicks); GL11.glColor4f(1, 1, 1, 1); mc.getTextureManager().bindTexture(guiTexture); int offsetFromScreenLeft = (width - imageWidth) / 2; int offsetTopScreen = 20; drawTexturedModalRect(offsetFromScreenLeft, 20, 0, 0, imageWidth, imageHeight); //DRAWS STRINGS FOR MINING this.fontRendererObj.drawString("" + mining.getCurrentLevel(), offsetFromScreenLeft + 40, offsetTopScreen + 10, 0xFEFE00); this.fontRendererObj.drawString("" + mining.getCurrentLevel(), offsetFromScreenLeft + 51, offsetTopScreen + 24, 0xFEFE00); //DRWAS STRINGS FOR WOODCUTTING this.fontRendererObj.drawString("" + woodcutting.getCurrentLevel(), offsetFromScreenLeft + 40, offsetTopScreen + 40, 0xFEFE00); this.fontRendererObj.drawString("" + woodcutting.getCurrentLevel(), offsetFromScreenLeft + 51, offsetTopScreen + 54, 0xFEFE00); List<String> hoverText = new ArrayList<String>(); if(isInRect(offsetFromScreenLeft + MINING_X, offsetTopScreen + MINING_Y, SKILL_WIDTH, SKILL_HEIGHT, mouseX, mouseY)) { hoverText.add("Mining: " + mining.levelToString()); hoverText.add("Exp: " + mining.expToString()); hoverText.add("Left: " + mining.neededToString()); } if(isInRect(offsetFromScreenLeft + WOOD_X, offsetTopScreen + WOOD_Y, SKILL_WIDTH, SKILL_HEIGHT, mouseX, mouseY)) { hoverText.add("Woodcutting: " + mining.levelToString()); hoverText.add("Exp: " + mining.expToString()); hoverText.add("Left: " + mining.neededToString()); } if(!hoverText.isEmpty()) { drawHoveringText(hoverText, mouseX , mouseY , fontRendererObj); } } public static boolean isInRect(int x, int y, int xSize, int ySize, int mouseX, int mouseY) { return ((mouseX >= x && mouseX <= x + xSize) && (mouseY >= y && mouseY <= y + ySize)); } @Override protected void mouseClickMove(int mouseX, int mouseY, int clickedMouseButton, long timeSinceLastClick) { } @Override protected void actionPerformed(GuiButton button) throws IOException { if (button == buttonDone) { mc.displayGuiScreen((GuiScreen) null); } } @Override public void onGuiClosed() { } @Override public boolean doesGuiPauseGame() { return true; } }
-
Hello,
I have a gui in my mod that shows me my current skill levels.
There is one problem however. when I open the gui i have no rendered cursor, it only shows up when i move my mouse outside of the minecraft window and move it back in. Is this a known bug? is there a solution?
thanks.
-
Hello,
I'd like to have multiple mods in my workspace, and let those mods work together, like you need the core mod so that another one will work. Is there a way to make this possible?
-
If I am correct metadata can't go above 15, because it is stored in 4 bits.
-
AloeVera.setContainerItem(AloeVera);
If I remind correctly.
-
You are creating blocks before IDs are generated.
You have to do any block = new BlockYours(id) after the id was correctly assigned.
sorry i dont understand what you mean?
Basically what he's saying is that you set the ID variables after registring the blocks, meaning that you are "creating" the blocks before setting the IDs, thus resulting in their IDs being 0. The fix is kind of complicated, but I will try to explain it.
Basically, remove the "public final static Block" before the variables and do "public static Block compactdirt;" before all the methods, but still in the "public class compactblocks". After that, move the setting of the variables (compactdirt = new compactdirt...) in the method marked with @Init. If you don't understand, write.
Get this error too, can you please create a dummy mod or something? So I can understand? Thanks!
-
You can better use Eclipse's Client starter. Press the green button on the top, it runs the code immediatley
-
Well, good luck. Try asking her. I doubt you get an answer.
-
I would want to have a tutorial on how to put multiple blocks into one block id just like Redpower mini blocks. I know it uses tile entity but I want to know how to use it. Big thanks for you help
-
You can also make it easily accesable by using this:
public static void metaSmelting(int input, int meta, ItemStack output) { FurnaceRecipes.smelting().addSmelting(input, meta, output); }
So that you don't have to type so much.
-
I have fixed it, thanks tho
-
Hello, I don't know what I've done wrong but suddenly I can't run my mod anymore because of this error:
2012-10-04 15:45:37 [sEVERE] [ForgeModLoader] Attempted to load a proxy type cococraft2.client.ClientProxy into cococraft2.common.CocoCraft2.proxy, but the types don't match 2012-10-04 15:45:37 [sEVERE] [ForgeModLoader] An error occured trying to load a proxy into {clientSide=cococraft2.client.ClientProxy, serverSide=cococraft2.common.CommonProxy}.cococraft2.common.CocoCraft2 cpw.mods.fml.common.LoaderException at cpw.mods.fml.common.ProxyInjector.inject(ProxyInjector.java:61) at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:348) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:69) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:317) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:300) at com.google.common.eventbus.EventBus.post(EventBus.java:268) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:124) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:69) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:317) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:300) at com.google.common.eventbus.EventBus.post(EventBus.java:268) at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:81) at cpw.mods.fml.common.Loader.loadMods(Loader.java:458) at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:144) at net.minecraft.client.Minecraft.startGame(Minecraft.java:405) at net.minecraft.client.Minecraft.run(Minecraft.java:737) at java.lang.Thread.run(Unknown Source) 2012-10-04 15:45:37 [sEVERE] [ForgeModLoader] Fatal errors were detected during the transition from CONSTRUCTING to PREINITIALIZATION. Loading cannot continue 2012-10-04 15:45:37 [sEVERE] [ForgeModLoader] FML [Forge Mod Loader] (coremods) Unloaded->Constructed Forge [Minecraft Forge] (coremods) Unloaded->Constructed CocoCraft2 [CocoCraft2] (bin) Unloaded->Errored 2012-10-04 15:45:37 [sEVERE] [ForgeModLoader] The following problems were captured during this phase 2012-10-04 15:45:37 [sEVERE] [ForgeModLoader] Caught exception from CocoCraft2 cpw.mods.fml.common.LoaderException: cpw.mods.fml.common.LoaderException at cpw.mods.fml.common.ProxyInjector.inject(ProxyInjector.java:68) at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:348) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:69) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:317) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:300) at com.google.common.eventbus.EventBus.post(EventBus.java:268) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:124) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:69) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:317) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:300) at com.google.common.eventbus.EventBus.post(EventBus.java:268) at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:81) at cpw.mods.fml.common.Loader.loadMods(Loader.java:458) at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:144) at net.minecraft.client.Minecraft.startGame(Minecraft.java:405) at net.minecraft.client.Minecraft.run(Minecraft.java:737) at java.lang.Thread.run(Unknown Source) Caused by: cpw.mods.fml.common.LoaderException at cpw.mods.fml.common.ProxyInjector.inject(ProxyInjector.java:61)
Does anybody know how to fix this?
-
did you remember to register the GUI handler in you MainMod class, Other than that we need the error or issue you are having to help you more.
Yes, I have it registered inmy Main class. There are no errors, but the gui just doesn't open. *sadface*
-
Seems valid.
Could you tell which issues you have?
When I right click nothing hapens. no errors.
-
Hello!
I'm having some issues using the GuiHandler forge adds. I, sort of, copied all the code, changed names around and changed the onBlockActivated to this:
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player) { if (!world.isRemote) { player.openGui(CocoCraft2.instance, 5, world, x, y, z); return true; } return true; }
And my GuiHandler code looks like this:
@Override public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { TileEntity tileEntity = world.getBlockTileEntity(x, y, z); if (tileEntity != null) { switch(ID) { case 5: return new ContainerCrusher(player.inventory, ((TileEntityCrusher)tileEntity)); } } return null; } @Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { TileEntity tileEntity = world.getBlockTileEntity(x, y, z); if (tileEntity != null) { switch(ID) { case 5: return new GuiCrusher(player.inventory, ((TileEntityCrusher)tileEntity)); } } return null; }
Is there something wrong with this code, or is the problem somewhere else?
-
Thank you! Did not think of this! Will test tonight.
-
Hey, I've read the tutorial on the wiki about Achievements, and I added one, but how can I use it with Metadata Items? This is the onSmelting method:
@Override
public void onCrafting(EntityPlayer player, ItemStack item, IInventory craftMatrix)
{
if (item.itemID == Ingot.shiftedIndex)
{
player.addStat(SmeltedCoco, 1);
}
}
but that is not Metadata sensitive, so is there a way to get the Ingot.shiftedIndex metadata sensitive?
-
-
You actually can use another way than setting that int to 3, it is a ModLoader function. instead of that int use: ModLoader.addArmor(String). Don't know if it is the best way, but it works.
-
Well, Armor seems to have changed, if you do it the '1.2.5 way' it will not render and will constantly throw out errors in the console.
-
It is there. But it won't work.
-
Thanks!
The code in your tutorial is Shellscript right? And when i execute it, it does nothing it disappears within a second. The Folder 'builds' is created though.
-
I thinks that's because it doesn't understand the common folder thing yet. I'm currently working on someones jenkins, when I'm don't (and it works) I'll post the file here.
Are you almost done? I really want that code
[1.8.9]Mouse not showing up in gui
in Modder Support
Posted
Thanks for the reply.
What do you eaxactly mean by moving the gui opening to the guihandler? I can't call player.opgenGui because that requires an x, y and z which I don't have? How do I go about fixing this then?