Jump 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.

tarun1998

Members
  • Joined

  • Last visited

Everything posted by tarun1998

  1. Okay done and all finished. Thanks so much! Heres the code for anyone: Nulling it out means that this method will also work with Blocks without the game crashing. Sweet!
  2. Okay thanks, BTW that was quick.
  3. I would I do that. (I'm not too good with arrays) but I will have a good look at it.
  4. Why didn't I think of that earlier. Java Reflection works perfectly except for the conflict that pops up when the game is loading. The code for anyone else who may need it. You've got your thanks OverMind. Thanks a lot.
  5. Alright i'll have a look at. Thanks for the suggestion.
  6. I made a Thirst Mod with another friend. I just want that when you drink from a either a potion, milk bucket or soup to add stats to the thirst bar. I was previously able to do it by editing their respective classes but I figured out that with the following code I was able to add stats from ItemStack.class/onFoodEaten: if(getItem()) == Item.potion) { Utilities.getStats.addStats(10, 2f); } I don't want to edit any classes so thats why I was asking for an interface. Otherwise the only way is to edit ItemStack.class or the drink classes. Thanks
  7. In the next Forge release will it be possible to create an Interface for the following method in ItemStack.class: onFoodEaten. Want to do stuff when a item is eaten but don't want to edit those classes or ItemStack.class.
  8. Shouldn't the ticks be on par with ModLoader's ticking system. Well it definitely not. Same source but I only installed ModLoader into the jar and decompiled and guess what: Testing printed every tick. Also how I can read from the NBT using ISaveEventHandler when ModLoader.getMinecraftInstance.thePlayer.getEntityData is null? Sorry for all this trouble.
  9. Alright I'll use ISaveEventHandler but I still want this fixed. Here is the code: Testing only prints once. Thanks
  10. Okay so I reinstalled the latest forge source (3.3.8.164) but unfortunately 'println' in onTickInGUI only printed once which is all I need but i'm not sure if it will run the code if I quit a world. Here is the log: As you can see 'Testing....1, 2, 3' only printed once. What I am currently doing is trying to change a value everytime a person returns from a world so that I can read from the NBT storage file if the person decides to open another world. If that value does not change some values will remain the same from the previous world. Here is the code where i am trying to accomplish this: And in onTickInGUI i am trying to reset 'attempts' value back to 0 so that the game will read from the NBT storage when the person opens a world again. I hope you can understand me and get this issue fixed soon. BTW I have called setInGUIHook(this, true, true).
  11. Thanks i'll try and report back any problems. I was using the latest recommended version.
  12. Came across a bug. if(gui instanceof GuiMainMenu) { System.out.println("Hi 1"); } if(gui instanceof GuiIngameMenu) { System.out.println("Hi 2"); } System.out.println("Hi 3"); When the game is in the main menu (where there are the Mods, Texture packs buttons) 'Hi 1' never prints to the console but when the game is paused 'Hi 2' is printing. 'Hi 3' only prints when you are playing a world or the game is paused. Any reasons why? I have not modified the jars that get decompiled except add textures to em.
  13. Wait can you send ItemStack packets currently i'm sending integers and then changing the jmItemStacks when the packet is received on the server side. It is kinda working.
  14. No everything is working on MLMP version. You probably (or CPW) did not add a functionality that MLMP does for you already relating to Tile Entities. I'll have a good look at MLMP files to fix this problem BTW is everything in the code on the first post for the GUI alright? Some methods in ModLoaderMp.class Server: getTileEntityPacket sendTileEntityPacket I'll have a look at it myself. Or maybe i'll just send some itemstack packets with things inside the container... Hm...
  15. How would you send back the so called "clicks" to the server. I'm not sure why or how because it was all working on MLMP and so far not impressed with the difficulty to port to or use FML. Anyways how would I send the "clicks" back. Packets possibly.
  16. Thanks mate, all working now. Turns out worldObj was null for some reason. But I do believe this may be a bug, when you put something into the TileEntity (similar to Furnace) it does not send the information back so that in this case the drink is never made. This is the exact same code as the MLMP version except with the Forge GUI, packets etc. So I have no clue why this is not working. Do you have to register TileEntities with some sort of Forge register method or use the MinecraftForge.registerEntity method.
  17. If you mean a method, then I have not used any nulls and have determined the variable 'mod'. Otherwise I have clue what you mean.
  18. Okay having some problems with the gui for a block. If you need more code PM me. This is also happening with the Water Collector

Important Information

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

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.