Zer0HD2
Members-
Posts
127 -
Joined
-
Last visited
Everything posted by Zer0HD2
-
Updated github with new code. Still using dataWatcher for now, and sending update packets to nearby players broke ALL the things, so I've removed that for now. Right now it just uses a nicer packet handling method than the horrific one I was using before. I'm still not entirely sure, once I've sent the packet to nearby players telling them your level, how it is used in the nametag. Also tried to find where Minecraft renders the nametag above the player, failed miserably.
-
Thanks for that, I've changed most of the things you pointed out, but I'm unsure on one thing. What is an alternative to using the dataWatcher? Or, if that's not what you meant, what should I read the dataWatcher from? I haven't been able to find out much about it, so I only know the basics of how it works. I'll update the code on Github once I've tested the nametag updating.
-
Still stuck on exactly how I would do this - as I said, this is the first time I've attempted anything that uses packet handling. I tried sending the SyncPlayerPropsPacket to all players in the code I posted here (Changed the sendTo() to sentToAll()), but that had no effect.
-
Yep, that's what I figured... would I do that using sendToAll()?
-
I just use refreshDisplayName() to update it. It works for chat, but not for the name tag. Code: https://github.com/Zer0HD/MCHardcore/blob/master/java/com/zer0/hardcore/player/ExtendedPlayerProperties.java
-
So I've created a levelling system where a user's level is displayed in their name. I have it working so that the user's display name is refreshed when they level up, but the name tag (above their head) does not refresh for other players. I'm assuming this has something to do with packets, but since I've not really worked with them much I was wondering if anyone could give me some pointers on how I need to do this?
-
[1.7.2]Doing things when a player kills an entity?
Zer0HD2 replied to dude22072's topic in Modder Support
Events are your friend. -
Interesting bug that only affects me (everyone else on server is fine)
Zer0HD2 replied to Zer0HD2's topic in Modder Support
Gah, fixed it. Removed glPushAttrib(GL11.GL_ENABLE_BIT), and disabled ALPHA_TEST. Possibly something to do with the fact that both of the other people who were running the mod have AMD graphics cards, while I'm running nVidia? -
Interesting bug that only affects me (everyone else on server is fine)
Zer0HD2 replied to Zer0HD2's topic in Modder Support
The full code is here if anyone feels like taking a look - I'm pretty much stumped at this point. https://github.com/Zer0HD/MCHardcore -
Interesting bug that only affects me (everyone else on server is fine)
Zer0HD2 replied to Zer0HD2's topic in Modder Support
Nope, I sent them both the exact same version of Forge that I'm using. 1082 I believe. -
Interesting bug that only affects me (everyone else on server is fine)
Zer0HD2 replied to Zer0HD2's topic in Modder Support
The thing is, I was playing on the same server with the exact same .jar as two other people, and it didn't affect them at all. Also, I haven't used any GL11 scaling anywhere in my mod. However, as you mentioned, it is that pale blue colour that you get when Minecraft runs out of memory. -
So my mod was working fine yesterday when I launched it through Eclipse. Today, I made no changes to the code, I just compiled it. Now, whenever I launch my mod, either through Eclipse or through Minecraft, my GUI looks like this: It affects every GUI that I can open; pause menu, crafting, inventory, etc, and any GUI that any other mod provides, like the minimap. I tried on a fresh version of Forge, and the only difference was that I had nothing but a blue screen. Like the screen you get when you run out of memory, but I could pause (nothing happened but a cursor appeared) and control my character (could hear my footsteps, and other players can I was moving). I tried removing the mod from forge, and it fixed it. Has anyone experienced this error before, or know what causes it? And as I said, it does not affect any players but me.
-
Wait, do you want an actual double jump or just jumping twice as high? If you just want the player to jump twice as high, you could apply the jump boost potion effect to them if they're wearing your armour.
-
[1.7.2]How do I tell what a players name is?
Zer0HD2 replied to squirlemaster's topic in Modder Support
So you claim to know Java, yet to access a variable from another class you extend that class? I'm out. Learn Java before you try making a mod. -
[1.7.2]How do I tell what a players name is?
Zer0HD2 replied to squirlemaster's topic in Modder Support
I... what? Why are you extending ItemRegistry? Also, learn which annotations to use. -
Regarding custom HUD elements (replacing vanilla)
Zer0HD2 replied to Zer0HD2's topic in Modder Support
Nevermind, I just solved it, although it's a pretty messy method that I'll change if I find a better way of doing it. I just set glColor4f(1, 1, 1, 0), so it's transparent. Works for now. -
Regarding custom HUD elements (replacing vanilla)
Zer0HD2 replied to Zer0HD2's topic in Modder Support
Yeah, I removed the .Pre to see if that solved the issue and forgot to put it back. Made no difference. -
Regarding custom HUD elements (replacing vanilla)
Zer0HD2 replied to Zer0HD2's topic in Modder Support
That reset the colour, but the phantom health bar just appears white now. -
Regarding custom HUD elements (replacing vanilla)
Zer0HD2 replied to Zer0HD2's topic in Modder Support
So I decided that rather than trying to get the default hunger bar to render, I would create a new HUD instead (seems weird that this was actually easier than getting the default elements to render). However, I now have a new fun little bug. Where the old health and hunger bars would have been, I now have weird green shapes that look like they would have been the outlines for the default bars. They are coloured green because I set the colour of the string (number in the HUD) to green, as when I change that colour, the colour of the phantom health bar changes too. Therefore, it must be rendering after the event I have cancelled, as the string is the last thing I render to prevent it from turning the armour and air bars green (the grey one is my new armour bar, turns out that got cancelled too). Here is the code for the GUI class: http://pastebin.com/D2jrErz8 Does anyone know why this happens or how to fix it? -
[1.7.2]How do I tell what a players name is?
Zer0HD2 replied to squirlemaster's topic in Modder Support
Erm... if you set playername to event.player.getCommandSenderName(), think about what type of variable that is. Now think about what you're trying to do with that variable. -
Yep, that is weird... Could I just check if findNearestVillage(x, y, z, 10) is not null to see if there is a village within a 10-block radius?
-
Ah, thanks, I was looking for a method like that. One thing - the method takes 4 parameters. I'm guessing 3 are the coordinates, but what is the 4th?
-
I've created a mob that I would like to only spawn inside villages - is there any way to check if the mob's location is in a village? If not, it's not the end of the world, there are other methods I can use, but I'd rather use the simplest way I can.
-
[1.7.2]How do I tell what a players name is?
Zer0HD2 replied to squirlemaster's topic in Modder Support
Call the getCommandSenderName() method on the player variable of the PlayerLoggedInEvent. -
Regarding custom HUD elements (replacing vanilla)
Zer0HD2 replied to Zer0HD2's topic in Modder Support
Yep, I tried adding an else statement - still cancels the rendering of everything after the health bar. Kwibble: I did try changing it to the if statement you provided, but it made no difference, so I changed it back to that purely because it's easier to read.