Skip to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Animefan8888

Forge Modder
  • Joined

  • Last visited

Everything posted by Animefan8888

  1. There is not a non packet way to do this as you need to communicate with the server from the client and packets are the only way to do this. You could instead of using a command use something else like an Item right click. And I believe the id's for mods are mod specific. Then converted to universal later.
  2. I only see one register call. And that is for your crate.
  3. Read this http://www.minecraftforge.net/forum/index.php?topic=20135.0
  4. Show your Item/Block registration.
  5. Forge uses github and accepts pull requests, when they deem them useful. Ohh, so you mean suggest a change to Forge that would make it easier for me to do this? Not a change an addition, you will suggest the event OnSlotClickEvent or some name similar.
  6. I believe that code is executed on the client side of things so you will want to send a packet with as little information as possible to get this done then do it in the packet.
  7. Pull Request I don't understand what you mean by pull request here, isn't that a github thing? Forge uses github and accepts pull requests, when they deem them useful.
  8. Oops no the setBlockState one.
  9. You could put in a PR for slot click? Then when a slot is clicked handle averaging.
  10. Try changing the number at the end of the line to 1.
  11. Where are you running the code at?
  12. Show an image of what it should look like and one with what it does look like.
  13. I would use the pop and push methods.
  14. The # means you need an instance of that type. So do Color color = new Color(R, G, B).getRGB(); Oooooooh. I thought you guys just did that instead of using a decimal Well, good news is something displayed up top. Bad news is, I have no idea where any of that is coming from O_O https://gyazo.com/57afd183d694cde09cd5c1a2df39ce5a I believe that means that textures are bound weirdly. Instead of TextureManager textureManager = ClientProxy.MINECRAFT.getTextureManager(); textureManager.bindTexture(new ResourceLocation(Test.MODID + ":textures/gui/energybar.png")); Just do this.mc.getTextureManager().bindTexture(// Create ResourceLocation in a variable in the class instead of creating it every time the code is ran.//)
  15. The # means you need an instance of that type. So do Color color = new Color(R, G, B).getRGB();
  16. Only the percentage method has to be a double. I see what you were saying about the doubles. I felt dumb when I realized what you meant. haha. Unfortunately, the rectangle still isn't being drawn. No errors are being thrown. I checked the value for "getRightCoord()" and it's 58, just as it should be. I'm not sure what's going on. Here's the code again: public class GuiEnergyBarTwo extends Gui { private int xSize = 116, ySize = 17; //size of desired window. Max is 256x256 public void draw(){ System.out.println("" + getRightCoord()); TextureManager textureManager = ClientProxy.MINECRAFT.getTextureManager(); textureManager.bindTexture(new ResourceLocation(Test.MODID + ":textures/gui/energybar.png")); GlStateManager.pushMatrix(); //---- inner ---- drawRect(0, 0, getRightCoord(), ySize - 1, 1); //---- outline ---- GlStateManager.enableAlpha(); drawTexturedModalRect(0, 0, 0, 0, xSize, ySize); GlStateManager.popMatrix(); } private int getRightCoord(){ return (int)((ClientProxy.clientInfo.getEnergyPercentage() /100) * xSize); //this returns the retrieved percentage of the length of the rectangle } } Try making the last value in drawRect a RGB value using Color#getRGB()
  17. Only the percentage method has to be a double.
  18. First thing is first you are using integers when you should be using doubles or floats. That may fix your problem.
  19. This is probably why. Why are you doing this? int hook = net.minecraftforge.event.ForgeEventFactory.onHoeUse(stack, playerIn, worldIn, pos); if (hook != 0) return hook > 0 ? EnumActionResult.SUCCESS : EnumActionResult.FAIL;
  20. According to the error you are sending a packet and it is erroring on this line https://github.com/tiffit/TaleCraft/blob/master/src/main/java/talecraft/network/packets/StringNBTCommandPacket.java#L34 With a index out of bounds exception as said in your log at line 1586.
  21. You wouldn't cause blocks are called from both sides. You must call it in your ClientProxy.
  22. Okay, I think this is the last problem. I created this new class, hold an instance of it in the ClientProxy, and just manually call ClientProxy.energyGui.draw() in the event you said above. The outline draws fine now and allows for movement, but the "inner" area (drawRect(...)) doesn't display at all. Would you happen to have any hunches off the top of your head? public class GuiEnergyBarTwo extends Gui { private int xSize = 116, ySize = 17; //size of desired window. Max is 256x256 public void draw(){ TextureManager textureManager = ClientProxy.MINECRAFT.getTextureManager(); textureManager.bindTexture(new ResourceLocation(Test.MODID + ":textures/gui/energybar.png")); GlStateManager.pushMatrix(); //---- inner ---- drawRect(0, 0, getRightCoord(), ySize - 1, 1); //---- outline ---- GlStateManager.enableAlpha(); drawTexturedModalRect(0, 0, 0, 0, xSize, ySize); GlStateManager.popMatrix(); } private int getRightCoord(){ int energyPercent = ClientProxy.clientInfo.getEnergyPercentage(); return xSize * (energyPercent/100); //this returns the needed percentage of the length of the rectangle } } Could you post ClientProxy.clientInfo.getEnergyPercentage();
  23. Also post your block model jsons.
  24. Most likely in the "toolTip.add()" while the "sneak" key is not pressed it could render "Press " localized.key.name or something, would make it more dynamic Also a localization call.

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.