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

20 minutes ago, plugsmustard said:

could you give me a little more descriptions if possible

what part do you not understand?

  • Author
Just now, loordgek said:

what part do you not understand?

you said get the pos from the packet buffer. how exactly do i do that?

18 minutes ago, plugsmustard said:

you said get the pos from the packet buffer. how exactly do i do that?

Well, you're doing it here. But you should actually be writing a pos there, not reading one.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

  • Author
40 minutes ago, Draco18s said:

Well, you're doing it here. But you should actually be writing a pos there, not reading one.

buf.writeBlockPos(pos);  <- this pos isn't right is it? it looks like other examples i've seen, but it's telling me to access it in a static way, which fucks with the other pos. any advice?

Edited by plugsmustard

25 minutes ago, plugsmustard said:

but it's telling me to access it in a static way, which fucks with the other pos. any advice?

Look at the parameters that are passed to you.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

  • Author
7 minutes ago, Draco18s said:

Look at the parameters that are passed to you.

these ones?

    public static void encode(PacketButtonClicked msg, PacketBuffer buf)

{

buf.writeBlockPos(pos);

 }

Yes. You're trying to write to the buffer, so what's the other one?

Edited by Draco18s

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

  • Author
32 minutes ago, Draco18s said:

Yes. You're trying to write to the buffer, so what's the other one?

for starters, are those the corrects parameters i should have there?

 

edit: never mind, i think i got it.....?

https://github.com/drmdgg/marijuanacraft1.14.4/blob/a246b0229e61058b95672d7f4813b5c3deb28229/src/main/java/drmdgg/marijuanacraft/network/PacketButtonClicked.java#L24

Edited by plugsmustard

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

  • Author
4 minutes ago, loordgek said:

return new PacketButtonClicked(buf.readBlockPos());

thank you. is that all i need to put in those methods because i am still getting errors in the packet handler class

    public static void Register()
    {
        int MId = 0;
        INSTANCE.registerMessage(MId++, PacketButtonClicked.class, PacketButtonClicked::encode, PacketButtonClicked::decode, PacketButtonClicked.Handler::handle);
        
    }

  • Author
2 minutes ago, loordgek said:

what does the error say, mouse over the error and the IDE tells whats wrong

The method registerMessage(int, Class<MSG>, BiConsumer<MSG,PacketBuffer>, Function<PacketBuffer,MSG>, BiConsumer<MSG,Supplier<NetworkEvent.Context>>) in the type SimpleChannel is not applicable for the arguments (int, Class<PacketButtonClicked>, PacketButtonClicked::encode, PacketButtonClicked::decode, PacketButtonClicked.Handler::handle)

 

there's also errors over each portion

"The type PacketButtonClicked does not define encode(MSG, PacketBuffer) that is applicable here"

Edited by plugsmustard

Both encode and decode need to be static.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

  • Author
2 minutes ago, Draco18s said:

Both encode and decode need to be static.

encode was, decode was not. made them static, but nothing changed

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

You linked to a specific commit, so when I looked at it, it was the old commit where it wasn't changed.

As far as I can tell, it should work. Can you post a screenshot of the error?

 

As for what you put here, you put the code that does whatever you want the button to do.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

  • Author
2 minutes ago, Draco18s said:

You linked to a specific commit, so when I looked at it, it was the old commit where it wasn't changed.

As far as I can tell, it should work. Can you post a screenshot of the error?

 

error.png

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.