Jump to content

Removing a block on ther server side


Guest

Recommended Posts

Ok, I will use only one variable.

19 minutes ago, Draco18s said:

Do not use this, this uses the vanilla IInventory system. You should use ItemStackHandler for inventory instead.

Ah ok thank you, it because of that it was a lot complicated to use the inventory of the block, thank you I will use ItemStackHandler.

 

20 minutes ago, Draco18s said:

What. Why are you passing a public static field to a private non-static method? What.

It's because the booelan dropBlock is used on other class like the gui.

 

21 minutes ago, Draco18s said:

This is not how you get an ItemStack from a block. This won't work for a whole host of blocks, from piston heads, to cake, to redstone wire, to crops.

Ok I haven't tested with complicated items, I have only tested on the ground with the dirt, grass stone, iron, ect it work. So how should I collect the ItemStack ?

 

24 minutes ago, Draco18s said:
45 minutes ago, Leonardlasardine said:

world.setBlockState(pos, newBlockstate, 1);

3 hours ago, Leonardlasardine said:

Ok thank you, so 3 is good.

  *Suspicion*

Oops...

Link to comment
Share on other sites

4 hours ago, Leonardlasardine said:

It's because the booelan dropBlock is used on other class like the gui.

That's called Reaching Across Sides and won't work. If the client and sever are running on different machines, how do you think the server knows about the gui change?

4 hours ago, Leonardlasardine said:

So how should I collect the ItemStack ?

(a) use the loot system and get the block's drops

(b) pickBlock()

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.

Link to comment
Share on other sites

17 hours ago, Draco18s said:

how do you think the server knows about the gui change?

AH YES OK it's for that ! I need to click an on/off button to start and it don't send the information to the server. Thank you.

I remember in 1.12 we had to use packets for sending information across sides. Is it always that in 1.15 or there is an other way to send data?

17 hours ago, Draco18s said:

(b) pickBlock()

Ok thank you I will use pickBlock because I want my quarry to use skill touch.

Good evening

Link to comment
Share on other sites

2 hours ago, Leonardlasardine said:

Is it always that in 1.15 or there is an other way to send data?

New versions don't make the need for packets to magically go away.

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.

Link to comment
Share on other sites

It's was not evident ! I couldn't guess that. New version have removed GameRegistry, EnumHelper, IWorodGeneraror ect... It was possible that packets were removed.

Link to comment
Share on other sites

14 hours ago, Leonardlasardine said:

It's was not evident ! I couldn't guess that.

...How else would data be transmitted from the client to the server or vice versa?

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.

Link to comment
Share on other sites

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.