Creative
This commit is contained in:
@@ -38,6 +38,8 @@ export interface SavedPlayer {
|
||||
slim?: boolean;
|
||||
// see /fly
|
||||
flying?: boolean;
|
||||
// see /creative
|
||||
creative?: boolean;
|
||||
}
|
||||
|
||||
// the connection of the player machines use items as, see GameServer.use_item_on. nothing is ever sent to it
|
||||
@@ -68,6 +70,9 @@ export class ServerPlayer extends LivingEntity {
|
||||
using: { slot: number; type_id: string; ticks: number; duration: number } | undefined;
|
||||
// flying, from /fly. their client moves them without gravity, and they don't fall or get hungry from moving
|
||||
flying = false;
|
||||
// from /creative: placing doesn't use up what they hold, and breaking is instant and drops nothing. their client
|
||||
// times breaking, so it only needs to know
|
||||
creative = false;
|
||||
|
||||
inventory = new Container(INVENTORY_SIZE);
|
||||
// hunger and saturation, health is the entity's
|
||||
@@ -240,6 +245,7 @@ export class ServerPlayer extends LivingEntity {
|
||||
skin: this.skin,
|
||||
slim: this.slim || undefined,
|
||||
flying: this.flying || undefined,
|
||||
creative: this.creative || undefined,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -256,5 +262,6 @@ export class ServerPlayer extends LivingEntity {
|
||||
this.skin = saved.skin;
|
||||
this.slim = saved.slim ?? false;
|
||||
this.flying = saved.flying === true;
|
||||
this.creative = saved.creative === true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user