Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

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

 

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.