Effect icons and tooltip !
This commit is contained in:
@@ -85,6 +85,9 @@ export class LocalPlayer extends Player {
|
||||
food = 20;
|
||||
saturation = 5;
|
||||
air = 20;
|
||||
// the effects it has that show an icon, see the inventory screen. counted down here, the server only says when
|
||||
// they change
|
||||
effects: { id: string; amplifier: number; duration: number }[] = [];
|
||||
// the attack speed attribute the server sent, and when they last attacked or switched slots, for the indicator
|
||||
attack_speed = 4;
|
||||
last_attack = -Infinity;
|
||||
@@ -119,6 +122,7 @@ export class LocalPlayer extends Player {
|
||||
}
|
||||
|
||||
tick() {
|
||||
for (const effect of this.effects) if (effect.duration > 0) effect.duration -= 1;
|
||||
this.#in_water = this.in_water;
|
||||
const was_swimming = this.swimming;
|
||||
const input = this.client.screen ? NO_INPUT : this.#read_input();
|
||||
|
||||
Reference in New Issue
Block a user