Remove duplicate code

This commit is contained in:
2026-10-13 11:57:43 -03:00
parent dfc6a6d77b
commit 5165698fe3
50 changed files with 307 additions and 812 deletions
+1 -7
View File
@@ -4,6 +4,7 @@
import type { EntityData, EntityEvent, EntityInfo } from "$/common/protocol.ts";
import type { EntityJson } from "$/common/mod_data.ts";
import { EverythingRegistry } from "$/common/everything_registry.ts";
import { wrap_angle } from "$/common/utils.ts";
import type { ClientLevel } from "../level/client_level.ts";
import { Entity } from "./entity.ts";
@@ -88,10 +89,3 @@ export class RemoteEntity extends Entity {
return this.swing_ticks === undefined ? 0 : Math.min(1, (this.swing_ticks + partial_tick) / SWING_TICKS);
}
}
function wrap_angle(angle: number) {
angle %= Math.PI * 2;
if (angle >= Math.PI) angle -= Math.PI * 2;
if (angle < -Math.PI) angle += Math.PI * 2;
return angle;
}