-
[1.11.2] GUI Drawing messing up durability bar
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(); }
-
[1.11.2] Accessing titles/subtitles displayed
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.
-
having trouble with my modes not showing up
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
-
[1.11] There's something wrong with my recipes
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.
-
[1.11] There's something wrong with my recipes
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.
-
[1.11] There's something wrong with my recipes
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.
-
[1.11] There's something wrong with my recipes
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.
-
[Solved, Sort of, but DO NOT worry about this] Changes with 1.11 from 1.10.2
escapemc_ingot = new Item().setUnlocalizedName("escapemc_ingot").setRegistryName("escapemc_ingot").setCreativeTab(TeamMadnessMod.TeamMadnessModMaterialsTab); GameRegistry.register(escapemc_ingot);
-
[1.11] There's something wrong with my recipes
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
-
[1.11] OpenGui not working on Tile Entity
Post your new code
-
1.11 onItemUse -> need access to stack and position.
ItemStack argument was removed. All you need to do is getHeldItem(hand)
-
[1.8.9] Mob Custom Drops
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.
-
[1.8.9] Mob Custom Drops
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 }
-
[1.8.9] Rebuild of 1.8 mod causes mod blocks to do all kinds of crazy.
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.
-
[1.9.4] Custom leaf block texture issue.
*facedesk* thank you.
IPS spam blocked by CleanTalk.