Jump to content

Recommended Posts

Posted

the mod i'm working on allows a bunch different blocks to panned similarly to sand and gravel. i've already got the functionality down, but am having some issues with the texture inside the pan when taking material from the blocks themselves. 

this has only happened with Muddy Gravel, specifically the layered block not the vanilla Muddy Gravel block. 

here's a photo of what i mean:

Spoiler

2026-07-03_22-58-22.thumb.png.f10c5ebf57b9ada60f4be2d423ba8fab.png

and the code used to create the layered block:

(file pathway in mod folder: "assets/game/blocktypes/soil/muddygravel-layered.json")

Spoiler

{
    "code": "muddygravel",
    "attributes": {
        "mapColorCode": "land",
        "pannable": true,
        "handbook": {
            "exclude": true
        }
    },
    "behaviors": [{ "name": "UnstableFalling", "properties": { "fallSound": "effect/rockslide", "dustIntensity": 0 }}],
    "variantgroups": [{ "code": "layer", "states": [ "1", "2", "3", "4", "5", "6", "7" ] }],
    "shapebytype": {
        "*-1": { "base": "block/basic/submersiblelayers/2voxel" },
        "*-2": { "base": "block/basic/submersiblelayers/4voxel" },
        "*-3": { "base": "block/basic/submersiblelayers/6voxel" },
        "*-4": { "base": "block/basic/submersiblelayers/8voxel" },
        "*-5": { "base": "block/basic/submersiblelayers/10voxel" },
        "*-6": { "base": "block/basic/submersiblelayers/12voxel" },
        "*-7": { "base": "block/basic/submersiblelayers/14voxel" }
    },
    "blockmaterial": "Soil",
    "textures": {
        "all": { "base": "block/soil/muddygravel" }
    },
    "sidesolid": { "all": false, "down": true },
    "sideopaque": { "all": false, "down": true },
    "emitSideAoByType": {
        "*-7": { "all": true, "up": false },
        "*": { "all": false, "down": true }
    },
    "fertility": 30,
    "resistance": 2.2,
    "drops": [],
    "sounds": {
        "place": "block/dirt",
        "break": "block/dirt",
        "hit": "block/dirt",
        "walk": "walk/grass"
    },
    "heldTpIdleAnimation": "holdbothhandslarge",
    "heldRightReadyAnimation": "heldblockready",
    "heldTpUseAnimation": "twohandplaceblock",
    "tpHandTransform": {
        "translation": { "x": -1.23, "y": -0.91, "z": -0.8 },
        "rotation": { "x": -2, "y": 25, "z": -78 },
        "scale": 0.4
    },
    "collisionselectionboxbytype": {
        "*-1": { "x1": 0, "y1": 0, "z1": 0, "x2": 1, "y2": 0.125, "z2": 1 },
        "*-2": { "x1": 0, "y1": 0, "z1": 0, "x2": 1, "y2": 0.25, "z2": 1 },
        "*-3": { "x1": 0, "y1": 0, "z1": 0, "x2": 1, "y2": 0.375, "z2": 1 },
        "*-4": { "x1": 0, "y1": 0, "z1": 0, "x2": 1, "y2": 0.5, "z2": 1 },
        "*-5": { "x1": 0, "y1": 0, "z1": 0, "x2": 1, "y2": 0.625, "z2": 1 },
        "*-6": { "x1": 0, "y1": 0, "z1": 0, "x2": 1, "y2": 0.75, "z2": 1 },
        "*-7": { "x1": 0, "y1": 0, "z1": 0, "x2": 1, "y2": 0.875, "z2": 1 }
    }
}

if anyone knows how the game determines which textures the pan uses or is able to point out where i may have gone wrong with this code, please let me know!

Posted (edited)
7 hours ago, jun1per said:
  Hide contents

{
    "code": "muddygravel",
    "attributes": {
        "mapColorCode": "land",
        "pannable": true,
        "handbook": {
            "exclude": true
        }
    },
    "behaviors": [{ "name": "UnstableFalling", "properties": { "fallSound": "effect/rockslide", "dustIntensity": 0 }}],
    "variantgroups": [{ "code": "layer", "states": [ "1", "2", "3", "4", "5", "6", "7" ] }],
    "shapebytype": {
        "*-1": { "base": "block/basic/submersiblelayers/2voxel" },
        "*-2": { "base": "block/basic/submersiblelayers/4voxel" },
        "*-3": { "base": "block/basic/submersiblelayers/6voxel" },
        "*-4": { "base": "block/basic/submersiblelayers/8voxel" },
        "*-5": { "base": "block/basic/submersiblelayers/10voxel" },
        "*-6": { "base": "block/basic/submersiblelayers/12voxel" },
        "*-7": { "base": "block/basic/submersiblelayers/14voxel" }
    },
    "blockmaterial": "Soil",
    "textures": {
        "all": { "base": "block/soil/muddygravel" }
    },
    "sidesolid": { "all": false, "down": true },
    "sideopaque": { "all": false, "down": true },
    "emitSideAoByType": {
        "*-7": { "all": true, "up": false },
        "*": { "all": false, "down": true }
    },
    "fertility": 30,
    "resistance": 2.2,
    "drops": [],
    "sounds": {
        "place": "block/dirt",
        "break": "block/dirt",
        "hit": "block/dirt",
        "walk": "walk/grass"
    },
    "heldTpIdleAnimation": "holdbothhandslarge",
    "heldRightReadyAnimation": "heldblockready",
    "heldTpUseAnimation": "twohandplaceblock",
    "tpHandTransform": {
        "translation": { "x": -1.23, "y": -0.91, "z": -0.8 },
        "rotation": { "x": -2, "y": 25, "z": -78 },
        "scale": 0.4
    },
    "collisionselectionboxbytype": {
        "*-1": { "x1": 0, "y1": 0, "z1": 0, "x2": 1, "y2": 0.125, "z2": 1 },
        "*-2": { "x1": 0, "y1": 0, "z1": 0, "x2": 1, "y2": 0.25, "z2": 1 },
        "*-3": { "x1": 0, "y1": 0, "z1": 0, "x2": 1, "y2": 0.375, "z2": 1 },
        "*-4": { "x1": 0, "y1": 0, "z1": 0, "x2": 1, "y2": 0.5, "z2": 1 },
        "*-5": { "x1": 0, "y1": 0, "z1": 0, "x2": 1, "y2": 0.625, "z2": 1 },
        "*-6": { "x1": 0, "y1": 0, "z1": 0, "x2": 1, "y2": 0.75, "z2": 1 },
        "*-7": { "x1": 0, "y1": 0, "z1": 0, "x2": 1, "y2": 0.875, "z2": 1 }
    }
}

if anyone knows how the game determines which textures the pan uses or is able to point out where i may have gone wrong with this code, please let me know!

Your attributes seems to be missing "pannedBlock" (see for example gravel.json). This could already be the solution to your problem. If that doesn't fix it, "inContainerTexture" might be required as well.

Edited by Brady_The
Posted
4 hours ago, Brady_The said:

Your attributes seems to be missing "pannedBlock" (see for example gravel.json). This could already be the solution to your problem. If that doesn't fix it, "inContainerTexture" might be required as well.

i tried both but got the same result. "pannedBlock" didn't yield any results, it didn't even reset to the layer i defined when panning any of the layered blocks. "inContainerTexture" did work, just not for the pan. (i was able to confirm using a barrel)

i tried a few other things including substituting a different texture that i know works but still provided a missing texture. (the texture of the layered blocks themselves did change) even copying and pasting another custom layers file to use for Muddy Gravel still had no texture in the pan. 

i'll be honest, i'm legitimately starting to believe there's something in the actual panning code that's causing this bug. maybe it's because the panning guide calls out Muddy Gravel by name as "NOT WORKING" or that i've never had this problem with the other 22 blocks i made pannable.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.