Delupara Posted August 16, 2017 Posted August 16, 2017 (edited) https://github.com/Thegamerchunk1/x3d/blob/master/src/main/java/x3d/blocks/chromosoneblock.java This block is supposed to get a set of random boolean properties that will dictate how the block will react. 9/10 times this block works as planned however sometimes one of the properties 'the boom property' are defined as false, yet it still goes past my if statement at `chromosoneblock#onBlockPlacedBy` because it still blows up. If you want to try and replicate the issue simply clone the repo and build gradle, then go on a world and place a bunch of them down, youll see every now an then a block that: explodes like a block with boom=true has a boom value at false the block isnt destroyed by the explosion, even if it has a ground material\ all the air blocks in the crater formed are super glitchy I first tried to do a side check for the explosion to occur but the problems seems worst. How 2 fix probwem? Edited August 16, 2017 by Delupara accidentally finished the topic Quote When they say your code doesn't follow convention but ur edgy so u dont care d-d-d-dab on them haterz
Draco18s Posted August 16, 2017 Posted August 16, 2017 The client and server disagree about what blockstate was placed. Also: https://github.com/Thegamerchunk1/x3d/blob/master/src/main/java/x3d/blocks/chromosoneblock.java#L82-L90 Seriously? A for-each loop where you manually track an index? Use a regular for-loop. I mean, hell, having to do this should have clued you in. Quote 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.
Delupara Posted August 16, 2017 Author Posted August 16, 2017 (edited) 19 minutes ago, Draco18s said: The client and server disagree about what blockstate was placed. yeah thats I thought but im not entirely sure how to handle Iproperties in conjunction with sides but I did check if the world was remote, ended up by breaking the block further Quote Also: https://github.com/Thegamerchunk1/x3d/blob/master/src/main/java/x3d/blocks/chromosoneblock.java#L82-L90 Seriously? A for-each loop where you manually track an index? Use a regular for-loop. I mean, hell, having to do this should have clued you in. yeah that's temporary and part of an older bit of code I never changed (the loop itself that is) Ill fix it but honestly this has little to no relation with my problem. If I need a convention critic I'll let you know. Edited August 16, 2017 by Delupara Quote When they say your code doesn't follow convention but ur edgy so u dont care d-d-d-dab on them haterz
Draco18s Posted August 17, 2017 Posted August 17, 2017 41 minutes ago, Delupara said: yeah thats I thought but im not entirely sure how to handle Iproperties in conjunction with sides but I did check if the world was remote, ended up by breaking the block further On the client: make both values false On the server: make them random When the server sends the update packet to the client (which would happen immediately) the client will become aware of the correct state. Quote 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.
Delupara Posted August 17, 2017 Author Posted August 17, 2017 2 minutes ago, Draco18s said: On the client: make both values false On the server: make them random When the server sends the update packet to the client (which would happen immediately) the client will become aware of the correct state. good that should be enough info, If I get anymore issues I'll let you know! Quote When they say your code doesn't follow convention but ur edgy so u dont care d-d-d-dab on them haterz
Delupara Posted August 17, 2017 Author Posted August 17, 2017 update here. The same problem is still there, only now I randomized and set everything in my nethandler class. So what do? I don't think my sides are properly communicating. Quote When they say your code doesn't follow convention but ur edgy so u dont care d-d-d-dab on them haterz
Draco18s Posted August 17, 2017 Posted August 17, 2017 I have no idea what you're trying to do with that code. onBlockActivated is already called by both sides. Quote 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.
Delupara Posted August 17, 2017 Author Posted August 17, 2017 (edited) 11 minutes ago, Draco18s said: I have no idea what you're trying to do with that code. Im trying to set the block with randomized values EVERY time I place it down. I simply followed the doc tutorials about networking Quote onBlockActivated is already called by both sides. Thats one thing that the docs doesn't mention, It talks about sides but not what exactly gets called on them, if someone could add that info that would be hype. Also How do I tell the server to set the properties random WITHOUT block#onBlockPlacedBy? Edited August 17, 2017 by Delupara Quote When they say your code doesn't follow convention but ur edgy so u dont care d-d-d-dab on them haterz
Draco18s Posted August 17, 2017 Posted August 17, 2017 (edited) 37 minutes ago, Delupara said: Im trying to set the block with randomized values EVERY time I place it down. I got that part. But you're sending a message to the server from onBlockActivated. This has nothing to do with that. Quote Thats one thing that the docs doesn't mention, It talks about sides but not what exactly gets called on them, if someone could add that info that would be hype. Generally speaking, any method that isn't marked @SideOnly is called on both sides. I've run into a handful of cases where that's not been 100% true, but it's a good baseline. Quote Also How do I tell the server to set the properties random WITHOUT block#onBlockPlacedBy? OnBlockAddedToWorld GetStateForPlacement Edited August 17, 2017 by Draco18s Quote 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.
Delupara Posted August 17, 2017 Author Posted August 17, 2017 (edited) Quote Generally speaking, any method that isn't marked @SideOnly is called on both sides. I've run into a handful of cases where that's not been 100% true, but it's a good baseline. Good. This and events are two things Ill make sure to focus on. Quote OnBlockAddedToWorld GetStateForPlacement and of course there's an event for blocks being placed/added. smh. Edited August 17, 2017 by Delupara Error 404, grammar not found. Quote When they say your code doesn't follow convention but ur edgy so u dont care d-d-d-dab on them haterz
Delupara Posted August 17, 2017 Author Posted August 17, 2017 Wait, Did you mean Block#OnBlockAdded? There isn't a single OnBlockAddedToWorld member in my project. Quote When they say your code doesn't follow convention but ur edgy so u dont care d-d-d-dab on them haterz
Draco18s Posted August 17, 2017 Posted August 17, 2017 14 minutes ago, Delupara said: Wait, Did you mean Block#OnBlockAdded? There isn't a single OnBlockAddedToWorld member in my project. Probably. The names have changed a bit. Quote 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.
Recommended Posts
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.