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
+2 -4
View File
@@ -3,6 +3,8 @@
// animated textures, like minecraft's .png.mcmeta and in the same format: textures/<name>.json next to
// textures/<name>.png says how to cut the png into frames and how long each one shows. see docs/modding/resources/textures.md
import { is_object } from "./mod_data.ts";
export interface TextureJson {
animation?: AnimationJson;
}
@@ -101,7 +103,3 @@ function frame_size(animation: AnimationJson, size: { width: number; height: num
const side = Math.min(size.width, size.height);
return { frame_width: animation.width ?? side, frame_height: animation.height ?? side };
}
function is_object(value: unknown): value is Record<string, unknown> {
return typeof value === "object" && value !== null && !Array.isArray(value);
}