-
Posts
403 -
Joined
-
Last visited
Converted
-
Gender
Male
-
Location
Canada
-
Personal Text
Yes those are numbers
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
61352151511's Achievements

Diamond Finder (5/8)
85
Reputation
-
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(); }
-
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
61352151511 replied to killakayes's topic in Support & Bug Reports
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
61352151511 replied to 61352151511's topic in Modder Support
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
61352151511 replied to 61352151511's topic in Modder Support
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
61352151511 replied to 61352151511's topic in Modder Support
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
61352151511 replied to 61352151511's topic in Modder Support
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. -
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
-
Post your new code
-
1.11 onItemUse -> need access to stack and position.
61352151511 replied to Raycoms's topic in Modder Support
ItemStack argument was removed. All you need to do is getHeldItem(hand) -
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.
-
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.9.4] Custom leaf block texture issue.
61352151511 replied to 61352151511's topic in Modder Support
*facedesk* thank you.