anegostudios / VintageStory-Issues

Vintage Story's public issue tracker for reporting bugs, crashes and the like
46 stars 16 forks source link

Modded anvils not reading the correct anvil tier #2766

Open SunnyOpossum opened 1 year ago

SunnyOpossum commented 1 year ago

Game Version

v1.18.5

Platform

Windows

Modded

Modded

SP/MP

Singleplayer

Description

Patching in a new metal into worldproperties/block/metal.json and patching in a new matching variant into blocktypes/metal/anvil.json does not give the new anvil type the correct tier. It will be tier 0 no matter what number you set your new metal's tier as.

How to reproduce

The patch for metal.json: { "op": "add", "path": "/variants/-", "value": { code: "dawn", meltPoint: 1502, boilPoint: 2900, density: 7820, specificHeatCapacity: 0.49, elemental: true, tier: 5 }, "file": "game:worldproperties/block/metal.json" } The patch for anvil.json: { "op": "add", "path": "/variantgroups/0/states/-", "value": "dawn", "file": "game:blocktypes/metal/anvil.json" }

Screenshots

2023-05-20_19-50-29

Logs

No response

Craluminum2413 commented 1 year ago

You need to assign anvil tier first

Craluminum2413 commented 1 year ago

Add your anvil under mod id, don't patch base game files

Craluminum2413 commented 1 year ago

I assume tierByType has * in the end, this prevents your patch from working

SunnyOpossum commented 1 year ago

Here is the entire vanilla anvil.json, "tierByType" is not a thing in this file { code: "anvil", class: "BlockAnvil", behaviors: [ { name: "UnstableFalling", impactDamageMul: 20 }, ], attributes: { }, entityClass: "Anvil", enabled: true, heldTpIdleAnimation: "holdunderarm", variantgroups: [ { code:"metal", states: ["copper", "tinbronze", "bismuthbronze", "blackbronze", "iron", "meteoriciron", "steel"] }, ], shapeByType: { "@anvil-(iron|meteoriciron|steel)": { "base": "block/metal/anvil/iron" }, "*": { "base": "block/metal/anvil/normal" } }, creativeinventory: { "general": ["*"], "decorative": ["*"] }, blockmaterial: "Metal", replaceable: 100, resistance: 2, lightAbsorption: 0, maxStackSize: 1, textures: { all: { base: "block/metal/anvil/{metal}" }, ironbloom: { base: "item/resource/ironbloom" }, blistersteel: { base: "block/metal/ingot/blistersteel" }, }, sidesolid: { all: false }, sideopaque: { all: false }, "__comment": "defined for both angles", collisionSelectionBoxesByType: { "*": [ { x1: 0, y1: 0, z1: 0.3125, x2: 1, y2: 0.625, z2: 0.6875 }, { x1: 0.3125, y1: 0, z1: 0, x2: 0.6875, y2: 0.625, z2: 1 } ] }, sounds: { "place": "block/anvil", "break": "block/anvil", "hit": "block/anvil" }, tpHandTransform: { translation: { x: -0.9, y: -0.3, z: -0.5 }, rotation: { x: 0, y: 0, z: -110 }, scale: 0.6 }, guiTransform: { rotation: { x: -20, y: -41, z: 0 }, origin: { x: 0.46, y: 0.34, z: 0.5 }, scale: 1.48 }, groundTransform: { origin: { x: 0.5, y: 0, z: 0.5 }, scale: 2 }, fpHandTransform: { rotation: { x: 12, y: -22, z: 0 }, origin: { x: 0.5, y: 0.3, z: 0.5 } } }

SunnyOpossum commented 1 year ago

The class "BlockAnvil", grabs tier values from worldproperties/block/metal.json