Jump to content

Recommended Posts

Posted

 

good days,

i have little issue becoze the class i make long ago to send packages only send strings and now im maken tile entityes and this dont works for that

and i have to fix it whiout fucking upo everiting else i made that requires send packages, as mi guns or villagers

 

soo i think in make this package class whith a variable modo thath means

0 = im sending a plain string

1 = im sending a blockPos and id and type values

2 = im sending x y z cordinathe plus id and type

3 = im sendind data to an especific entity plus id and type

 

 

sooo long lets say i wana set something in modo 2 thats  and byte mode, a int x, a int y, a int z, a int id, and a int type. all in only a ByteBuf to send it in a package to the server side like a big binary number

but the class ByteBuf only has an  method  ByteBufUtils.readVarInt(buf, 4);  like is an int it only would retribe 32bit of whatever is stored in the 

ByteBuf  but everything i wanna send sum like 164bits

 

####

how i arrange this 6 values in the  ByteBuf  and later how i retrive the 6 values in the ByteBuf in the server side ???

 

 

soo long i have this

https://gist.github.com/anonymous/74a468c1afd2aafc4b4b

 

 

thanks for reading

 

Posted

1. Why is this not in Modder Support?

 

2. Don't use static to hold data that is not supposed to be static. Read what static means.

3. Don't try to make one packet do everything - if data differs that much, don't force it, it will be bad design and waste of resources.

4. Implement few different packets - each handling different thing.

5. Don't use ByteBufUtild if you don't need to. ByteBuf class is perfectly capable of writing and reading generic types (not  only).

1.7.10 is no longer supported by forge, you are on your own.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.