Jump to content

Recommended Posts

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

Posted (edited)
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
Posted
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.

Posted (edited)

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.

Posted (edited)
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
Posted

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.

Posted
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);
        
    }

Posted (edited)
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
Posted

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.

Posted

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.

Posted

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.

Posted

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.

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

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