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.

61352151511

Forge Modder
  • Joined

  • Last visited

  1. I'm trying to add some rendering to the hotbar for when an items ability cools down. All of the rendering code is below. I've attached three files to show the problem, the first is the hotbar without anything additionally drawn. The second is with the pickaxe ability cooled down, and the third it is on cooldown. As you can see the texture is drawn kind of over the durability bar, I want to know what I can do to solve this. I've tried enabling alpha, that didn't seem to change anything. RenderGameOverlayEvent.Pre broke pretty much the rest of the rendering. Any tips are helpful, basically I need the "highlight" to be in-front of the hotbar, but behind the items being drawn. @SubscribeEvent(priority = EventPriority.NORMAL) public void onRender(RenderGameOverlayEvent.Post event) { if (event.isCanceled() || event.getType() != ElementType.EXPERIENCE) return; NonNullList<ItemStack> inventory = minecraft.player.inventory.mainInventory; for (int i = 0; i < 9; i ++) { ItemStack stack = inventory.get(i); if (stack.isEmpty()) continue; if (stack.getItem() instanceof ItemPickaxe) drawHighlight(i, CooldownReference.pickaxe.isCooledDown()); if (stack.getItem() instanceof ItemSword) drawHighlight(i, CooldownReference.sword.isCooledDown()); if (stack.getItem() instanceof ItemAxe) drawHighlight(i, CooldownReference.axe.isCooledDown()); if (stack.getItem() instanceof ItemSpade) drawHighlight(i, CooldownReference.shovel.isCooledDown()); if (stack.getItem() instanceof ItemHoe) drawHighlight(i, CooldownReference.hoe.isCooledDown()); } } private void drawHighlight(int slot, boolean useable) { ScaledResolution scaledResolution = new ScaledResolution(minecraft); GlStateManager.pushMatrix(); GlStateManager.enableBlend(); GlStateManager.depthMask(false); minecraft.renderEngine.bindTexture(useable ? highlightResourceGreen : highlightResourceRed); drawModalRectWithCustomSizedTexture(((scaledResolution.getScaledWidth() / 2) - 91) + (slot * 20) + 2, scaledResolution.getScaledHeight() - 20, 0, 0, 18, 18, 16, 16); GlStateManager.depthMask(true); GlStateManager.disableBlend(); GlStateManager.popMatrix(); }
  2. I tried searching but got empty results and I'm at a loss. I'm trying to access the text of the titles being displayed to the client. There doesn't seem to be an event for it anywhere, the fields in GuiIngame are protected, and I don't believe I can hook into the PacketReceived event either to see when the client is told to display a title. Any tips would be appreciated, thanks.
  3. 1) Not the section for it 2) Make sure the mods are actually for 1.11 and gotten from a reliable source such as minecraftforums or curseforge
  4. Thank you, I knew ItemStack's couldn't be null anymore, and I searched all of my classes for "null" when I did the update. I missed the fact that just doing "ItemStack result;" would be null and also needed the change. I'll change the code to get rid of that and set the unlocalized name that way.
  5. So from what I'm reading you're basically saying to remove the ObjectHolder annotation? Done, and it still has the same crash. I don't know to be honest. I think I started watching Pahimar's "Let's Mod [Reboot?]" series back for 1.7.10 and it worked, so I never questioned it. I think the reason was to do with getting the mods name in the unlocalized name but I have no idea. If it's something I shouldn't be doing (Is the mod name in the unlocalized name automatically now?) then I'll remove it.
  6. Gonna wait for "someone more advanced" because I still have no information of how to fix it. The items get registered before the recipes attempt to get registered, I don't know why it's printed in the log like that. The exact same thing was printed in the log from 1.7.10 -> 1.10.2 that I'm aware of and the game never crashed that I remember.
  7. Yes all of them, however this is not the issue (Well I really don't think it is) because the objects exist in game when the recipe init is commented out, so they do get registered.
  8. escapemc_ingot = new Item().setUnlocalizedName("escapemc_ingot").setRegistryName("escapemc_ingot").setCreativeTab(TeamMadnessMod.TeamMadnessModMaterialsTab); GameRegistry.register(escapemc_ingot);
  9. So, I'm not sure what is happening here. When I create a new world, the game crashes with this error: http://pastebin.com/UucBkVUG However if I comment out the recipe initialization, everything works fine. All of the code is available on github but the recipe class is here: https://github.com/61352151511/Random-Utilities/blob/1.11/src/main/java/com/sixonethree/randomutilities/common/init/Recipes.java
  10. ItemStack argument was removed. All you need to do is getHeldItem(hand)
  11. Ah, I wasn't aware as I didn't have the time to check, I just kind of guessed that this was the problem based on the error. However doing the instanceof check also makes sure it isn't null, so that should fix it either way.
  12. Before doing anything else, check to make sure the harvester is a player. public void addBlockDrop1(HarvestDropsEvent event) { if (!(event.harvester instanceof EntityPlayer)) return; // Your Code }
  13. It would help to have some code to look at. I can however answer the thing about blockstates, even though they're items, if a model file fails to be found, it searches for a blockstate model it could possibly use. Simply making an item model for "breads" will clear up the block state error.

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.