Remove duplicate code
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user