mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
add player.is_instant_destruction, .set_instant_destruction
This commit is contained in:
parent
005bcfb436
commit
2ba90625ce
5 changed files with 44 additions and 0 deletions
|
|
@ -248,6 +248,14 @@ void Player::setInfiniteItems(bool flag) {
|
|||
infiniteItems = flag;
|
||||
}
|
||||
|
||||
bool Player::isInstantDestruction() const {
|
||||
return instantDestruction;
|
||||
}
|
||||
|
||||
void Player::setInstantDestruction(bool flag) {
|
||||
instantDestruction = flag;
|
||||
}
|
||||
|
||||
entityid_t Player::getEntity() const {
|
||||
return eid;
|
||||
}
|
||||
|
|
@ -282,6 +290,7 @@ dv::value Player::serialize() const {
|
|||
root["flight"] = flight;
|
||||
root["noclip"] = noclip;
|
||||
root["infinite-items"] = infiniteItems;
|
||||
root["instant-destruction"] = instantDestruction;
|
||||
root["chosen-slot"] = chosenSlot;
|
||||
root["entity"] = eid;
|
||||
root["inventory"] = inventory->serialize();
|
||||
|
|
@ -310,6 +319,7 @@ void Player::deserialize(const dv::value& src) {
|
|||
flight = src["flight"].asBoolean();
|
||||
noclip = src["noclip"].asBoolean();
|
||||
src.at("infinite-items").get(infiniteItems);
|
||||
src.at("instant-destruction").get(instantDestruction);
|
||||
|
||||
setChosenSlot(src["chosen-slot"].asInteger());
|
||||
eid = src["entity"].asNumber();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue