Skip to content

Commit

Permalink
refactor(stats): small changes to pack rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
DuckySoLucky committed Dec 15, 2024
1 parent 2867860 commit bc98c3d
Show file tree
Hide file tree
Showing 18 changed files with 30 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/hooks.server.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { init } from "$lib/custom_resources";
import { updateCollections } from "$lib/server/constants/update-collections";
import { updateItems } from "$lib/server/constants/update-items";
import { init } from "$lib/server/custom_resources";
import { parseNEURepository } from "$lib/server/helper/NotEnoughUpdates/parseNEURepository";
import { updateNotEnoughUpdatesRepository } from "$lib/server/helper/NotEnoughUpdates/updateNEURepository";
import { getPrices } from "skyhelper-networth";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import path from "path";
import RJSON from "relaxed-json";
import UPNG from "upng-js";
import util from "util";
import { getCacheFilePath, getCacheFolderPath, getFolderPath, getId, getPath, getTextureValue, hasPath } from "./server/helper";
import { getCacheFilePath, getCacheFolderPath, getFolderPath, getId, getPath, getTextureValue, hasPath } from "./helper";
const mcData = minecraftData("1.8.9");

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
Expand Down
2 changes: 1 addition & 1 deletion src/lib/server/helper.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Item, ProcessedItem } from "$types/stats";
import { getPrices } from "skyhelper-networth";
import { getTexture } from "../custom_resources";
import * as constants from "./constants/constants";
import { getTexture } from "./custom_resources";

export * from "$lib/server/helper/cache";
export * from "$lib/server/helper/item";
Expand Down
6 changes: 3 additions & 3 deletions src/lib/renderer.ts → src/lib/server/helper/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ Modified and Improved by @DuckySoLucky
export const CACHE_PATH = helper.getCacheFolderPath();

import { base } from "$app/paths";
import * as customResources from "$lib/custom_resources";
import * as customResources from "$lib/server/custom_resources";
import { createCanvas, loadImage } from "@napi-rs/canvas";
import fs from "fs-extra";
import sanitize from "mongo-sanitize";
import path from "path";

import type { ItemQuery } from "$types/global";
import minecraftData from "minecraft-data";
import * as helper from "./server/helper";
import { getItemData } from "./server/helper/item";
import * as helper from "../helper";
import { getItemData } from "./item";
const mcData = minecraftData("1.8.9");

const skewA = 26 / 45;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/server/stats/items/processing.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getTexture } from "$lib/custom_resources";
import { getTexture } from "$lib/server/custom_resources";
import { getItemNetworth } from "skyhelper-networth";

import * as constants from "$lib/server/constants/constants";
Expand Down
4 changes: 2 additions & 2 deletions src/routes/api/head/[id=itemId]/+server.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { RequestHandler } from "./$types";
import { getHead } from "$lib/renderer";
import { getHead } from "$lib/server/helper/renderer";
import { error } from "@sveltejs/kit";
import type { RequestHandler } from "./$types";

// GET /api/head/[id=itemId]
export const GET: RequestHandler = async ({ params }) => {
Expand Down
2 changes: 1 addition & 1 deletion src/routes/api/item/[id=itemId]/+server.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { renderItem } from "$lib/renderer";
import { renderItem } from "$lib/server/helper/renderer";
import { error } from "@sveltejs/kit";
import type { RequestHandler } from "./$types";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { getArmor } from "$lib/renderer";
import type { RequestHandler } from "./$types";
import { getArmor } from "$lib/server/helper/renderer";
import { error } from "@sveltejs/kit";
import type { RequestHandler } from "./$types";

export const GET: RequestHandler = async ({ params }) => {
const { type, color } = params;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { POTION_COLORS } from "$constants/constants";
import { getPotion } from "$lib/renderer";
import { getPotion } from "$lib/server/helper/renderer";
import { error } from "@sveltejs/kit";
import type { RequestHandler } from "./$types";

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
type=item
texture=leather_boots
vanillaId=301
damage=0
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
type=item
texture=leather_chestplate
vanillaId=299
damage=0
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
type=item
texture=leather_helmet
vanillaId=298
damage=0
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
type=item
texture=leather_leggings
vanillaId=300
damage=0

0 comments on commit bc98c3d

Please sign in to comment.