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.

SuperHB

Forge Modder
  • Joined

  • Last visited

Everything posted by SuperHB

  1. Call openGui when world.isRemote is true
  2. This is my first time working with partialTicks. I'm guessing I have to use this formula? partialTick + partialTick * (currentTick - previousTick) I have the previousTick and currentTick updated in updateScreen like so: @Override public void updateScreen () { previousTick = currentTick; currentTick++; } But I'm not really sure what to do in drawScreen to make sure it runs the animation consistently
  3. I have a tick counter variable and when that reaches a certain number, the code inside the if statement will run. The problem with this is that the speed of the animation now changes depending on FPS. Lets say that every 20 ticks I have the code run. In game, if I get 20 FPS the animation will be slow, but if I have 200 FPS the animation will speed up. I'm wondering how I can stop it from doing this, to keep a consistent speed when the game is running at different FPS.
  4. I'm currently working on a mod that adds arcade machines into minecraft. I currently have the gui to render based on ticks. This isn't the best as depending on the FPS the game could run too fast or too slow. I was wondering if it is possible to render parts in GuiScreen#drawScreen consistently at different FPS?
  5. Thank you! I got everything working now.
  6. How do I get the packet data from my Gui class?
  7. I was able to move all the checks to server-side. But how do I send data back to the client? I've been looking around and haven't been able to find how to receive the return from the onMessage
  8. Thank you. That helped. But what would be the best way to do the checks server-side?
  9. What I'm trying to accomplish is when the button is pressed it will consume an item in the players inventory. This is what I have currently @Override protected void actionPerformed (GuiButton button) throws IOException { if (button == insertCoin) { if (menu == -1){ EntityPlayer player = Minecraft.getMinecraft().player; if (player.inventory.hasItemStack(new ItemStack(ArcadeItems.coin))) { ItemStack coin = player.inventory.getStackInSlot(player.inventory.getSlotFor(new ItemStack(ArcadeItems.coin))); if (coin.getCount() > cost) { int slot = player.inventory.getSlotFor(new ItemStack(ArcadeItems.coin)); ItemStack newStack = player.inventory.decrStackSize(slot, coin.getCount() - cost); player.inventory.setInventorySlotContents(slot, newStack); menu = 0; } else if (coin.getCount() == cost) { player.inventory.setInventorySlotContents(player.inventory.getSlotFor(new ItemStack(ArcadeItems.coin)), ItemStack.EMPTY); menu = 0; } else enoughCoins = false; } else enoughCoins = false; } } } It does remove a coin, but it only updates client side so relogging into the world I would have the original numbered stack. How do I properly update the player's inventory?
  10. https://github.com/MinecraftForge/MinecraftForge/blob/1.10.x/src/test/java/net/minecraftforge/debug/ModelAnimationDebug.java Some example code for 1.10 by MinecraftForge you can work off of.
  11. First of all, metadata can only hold 16 values. Secondly, the HALF variant isn't set to change anywhere in your code.
  12. The Forge documentation gives an example of using submodels here
  13. your file isn't a .json file
  14. try changing your item/BlockSchwarzpulver json to just { "parent": "cyc:block/schwarzpulver" }
  15. Do you mean BloomeryGUIHandler and GuiHandlerRegistry? GuiHandlerRegistry is just to register all of my Gui's and BloomeryGUIHandler is specificly for the Bloomery. Well I meant why are you going to have more than one. Why don't you just use a switch statement or an if else statement to handle your GUIs and Containers? item.getMetadata(1) // Doesn't work the way you think it does. "// TODO: Figure out difference between simulate = true and simulate = false" If simulate is true then the process doesn't happen, if false it does happen. In this case if true it doesn't mess with your ItemStacks, if false the ItemStacks change. Also quick question did you follow a tutorial? I originally followed TheGreyGhost's code here but I'm trying to switch it to Forge's capability system. Also, checked getMetadata, thought it just returned the int I put in, but I switched it to getMetadata(ItemStack) now. For that todo I originally had insertItem, but I switched it to setStackInSlot. I'm guessing it would be better to use insertItem? Thank you for explaining it though.
  16. Do you mean BloomeryGUIHandler and GuiHandlerRegistry? GuiHandlerRegistry is just to register all of my Gui's and BloomeryGUIHandler is specificly for the Bloomery.
  17. I'm currently working on a custom furnace with 2 inputs and 3 outputs and 1 fuel slot. I've got the furnace to smelt but it creates a lot of weird bugs. Which are: 1. When I try to put say 40 coal into the fuel slot, it puts a full stack of 64 coal. That same effect is on every slot that I place items in. It doesn't take the items either, It creates a whole new stack of 64. Sometime it takes the stack, puts it in, but when I try and take it back out, gone. (This seems to only happen when there isn't any inputs and only for the fuel, but if there is an input bug 1 still happens to the fuel) 2. When I try to take the items out of the furnace like the fuel or input or output, it just disappears when I click on it. 3. When both inputs are full, it takes two out of the first input instead of one from both Here is my code: Block TileEntity Container Gui I've been looking at the code inside the container, do I need to override detectAndSendChanges and other functions inside Container to possibly get this to work?
  18. Block class TileEntity class BlockState file Model folder
  19. Figured it out. It can't switch textures. only models. Is that a possible bug?
  20. I followed the Custom Furnace code by TheGreyGhost and the furnace doesn't use metadata to store its states either but it works. I've been looking through the code for it and changing my block but it's not making a difference. Here is the code if you want to take a look through it: https://github.com/TheGreyGhost/MinecraftByExample/tree/b1f1192efe029a8e8c1dff47c82da76fb80509b7/src/main/java/minecraftbyexample/mbe31_inventory_furnace
  21. What if you just don't mention the banner_top & bottom textures in the model file? Purple and black texture aswell
  22. Well that's why you see blocks/debug. I'm going to be using more than 14 (I have 19 right now). I had more than 16 but I commented them out as I was going to use metadata before I found out that you can have more than 16 state. Also Im going to be using the metadata for probably facing. If i set the textures to nothing in the model file it would give me the purple/black texture.

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.