Edit: 65535 is the maximum amount used in bytes. So you'll have to change the byte to something else.
This might be usefull: https://docs.oracle.com/javase/tutor...datatypes.html
|
Where would I look to have my HP be more than 65535?
I noticed this is the max for the byte. No idea where I would change the hp max though.
if i try to make my hp to 65536, it'll instead be 0hp.
same goes for if i put it to 65540, it'll instead be 4hp.
Edit: 65535 is the maximum amount used in bytes. So you'll have to change the byte to something else.
This might be usefull: https://docs.oracle.com/javase/tutor...datatypes.html
Last edited by _Patrick_; 09-05-2018 at 03:25 PM.
65535 is the maximum number in bytes, as patrick said.
Oh my god I got autism from all of these comments jesus christ lol.
A byte has a maximum value of 127/255(signed/unsigned). A byte carries 8 bits which is where the previously mentioned values derive from. 2^8-1.
A short has a maximum value of 32767/65535(signed/unsigned). A short carries 16 bits which is where the previously mentioned values derive from. 2^16-1.
My suggestion here is to use a medium rather than an int. There's no real reason to use an int, a medium can already carry values up to 16.777 million, that's more than enough.
Just go through playerupdating and npcupdating masks and edit these:
To read an integer instead. You'll have to make the server send them as integers aswell.Code:int hp = stream.readShort(); int maxHp = stream.readShort();
edit: yeah should use a medium-int instead as Kris suggested
Haha. Thanks guys.
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |