-
Notifications
You must be signed in to change notification settings - Fork 187
Adding a setSpawn command #2282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
src/server/command/setSpawn.zig
Outdated
| y = std.math.clamp(y.?, -1e9, 1e9); | ||
| z = std.math.clamp(z.?, -1e9, 1e9); | ||
|
|
||
| main.items.Inventory.Sync.setSpawn(source, .{x.?, y.?, z.?}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You shouldn't send spawn points through the inventory system. A simple call to main.network.Protocols.genericUpdate.sendSpawnPoint should be good enough. The Inventory.Sync system should only be used for things that need to be synchronized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh ok i was copy and pasting a lot of code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well since it changes the players spawn point on the cleint side and user it does need to be synced
clientside so when the player dies its in the correct spot
and serverside so when the client disconnects their spawnpoint is saved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check how the tp command is done, it deosn't go through the Inventory system but instead through network.zig
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it functions more similar to the gamemode command since it has to save data when the player leaves the game
therefore it does need to be run through inventory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok i will check it but i have moved it into a generic update
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will check to make sure it still functions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope it does not either save properly anymore or load properly anymore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think loading is broken now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah whatever i willl just revert it
|
did not have a chance to test it with multiplayer yet either though |
updates the inventory, network, and game
this will now sync and load from the world where its players are
|
it should be finished now |
|
Updated to the main branch rechecked and it still works |
|
eh damnit i ruined it |
|
ill open a new one i saved a copy of the right version |
This request will add a command that allows players to set their spawnpoint when they die.
This spawnpoint is saved in the players folder allong with the other player data.
If hooked up properly it can also later be used to make blocks that allow players to set their spawnpoint.
it updates the server, game, network, world, and Inventory.zig
also the commands folder for the set spawn command.
This is mostly for under the hood improvements to add blocks that can Set Spawn
Go to (link) Instead this is depreciated