Jump to content

Recommended Posts

Posted (edited)

On to the next problem that's been bugging me for ages.
Trying to add a new non-placeable liquid (just like eg. tannin). Copied the weaktanninportion.json, made my own texture, formatted the json to my adhesiveportion.json, and thought that would be just about it. But oh neeeeooow... the game crashes during server startup. Log files complaining about "can't create itemstack without a collectible!" and " send ServerAssets failed". Dunno what that's all about... yet.

image.png.1bed6e62ae4f62fa2373dbb988bcb138.png

Spoiler
{
	code: "adhesiveportion",
	class: "ItemLiquidPortion",
	matterState: "liquid",
	attributes: {
		handbook: {
			ignoreCreativeInvStacks: true
		},
		waterTightContainerProps: {
			containable: true,
			itemsPerLitre: 100,
			texture: { base: "liquid/adhesive" },
			allowSpill: true,
			whenSpilled: { 
				action: "DropContents",
				stack: { type: "item", code: "adhesiveportion" } 
			}
		}
	},
	shape: { base: "game:item/liquid" },
	texture: { base: "liquid/adhesive" },
	creativeinventoryStacks: [ { tabs: ["general", "liquids"], stacks: [ { type: "block", code: "game:woodbucket", attributes: { ucontents: [       { type:"item", code: "adhesiveportion", makefull: true } ] } } ] } ],
	maxstacksize: 5000,
	materialDensity: 200,
	guiTransform: {
		translation: { x: 0, y: 1, z: 0 },
		rotation: { x: 123, y: -33, z: -13 },
		origin: { x: 0.5, y: 0, z: 0.5 },
		scale: 1.4
	},
	fpHandTransform: {
		translation: { x: 0, y: 0, z: 0 },
		rotation: { x: 25, y: 157, z: -5 }
	},
	tpHandTransform: {
		translation: { x: -1.5, y: -1, z: -1.4 }
	}
}

 

 

client-crash.txt

Edited by Frepo
Posted (edited)

UPDATE ON RECENT EVENTS IN THIS MYSTERY

Changed "game:woodbucket" to just "woodbucket". The game doesn't crash anymore, but gets stuck in an infinte loading screeen at end of server startup. This removed the critical error "send ServerAssets failed", but gave me instead
[Warning] Failed resolving a blocks blockdrop or smeltedstack with code fregtech:woodbucket in Creative inventory stack of Item fregtech:adhesiveportion
and
[Error] System.NullReferenceException: The object reference has not been set to an instance of an object.

makes sense in a way, cuz there is no fregtech woodbucket, just vanilla woodbucket.

Edited by Frepo
Posted (edited)

THE SOLUTION

Turns out you need your own bucket to go with the liquid to explicitly specify your modid in creativeinventoryStacks.

Edited by Frepo
  • Frepo changed the title to [Solved] Adding a custom liquid
Posted (edited)
16 hours ago, Frepo said:

THE SOLUTION

Turns out you need your own bucket to go with the liquid.

Try explicitly specifying your modid in creativeinventoryStacks (fregtech:adhesiveportion instead of adhesiveportion). As last resort, try putting the liquid json in assets/game instead of assets/fregtech.

You definitely do not need to create a second bucket for this o.O

Edited by DArkHekRoMaNT
Posted

Hey! That worked! Thanks man! I didn't know adding your modId was a thing, I always thought it was supposed to be left empty when using own assets, and "game:" for using vanilla assets. Thanks again man.

×
×
  • 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.