GithubHelp home page GithubHelp logo

Comments (7)

engineer-pearl avatar engineer-pearl commented on July 21, 2024

I found something that might be used to fix it, but so far I have not been successful.
The line of code can be found on the bottom of this page: http://dev.minetest.net/minetest.register_craft

Now, I know this could cause problems with the fact that not all supported versions of milk are in buckets, however that could be fixed by having two groups, one for milk alone and one for milk in a bucket.

I will comment again when I have something that will load.

from food.

HybridDog avatar HybridDog commented on July 21, 2024

Using replacements should work. It only works if stack_max is 1.

from food.

engineer-pearl avatar engineer-pearl commented on July 21, 2024

It should, but with the code

food.module("butter", function()
minetest.register_craftitem(":food:butter", {
description = S("Butter"),
inventory_image = "food_butter.png",
groups = {food_butter=1}
})
food.craft({
output = "food:butter",
recipe = {"group:food_milkbucket","group:food_milkbucket"},
replacements = { {"group:food_milkbucket", "default:dirt"} },
})
food.craft({
output = "food:butter",
recipe = {
{"group:food_milk","group:food_milk"},
}
})
end, true)

(I've also modified support so that milk is split into milk and milk bucket)

food.support("milk", {
"animalmaterials:milk",
"my_mobs:milk_glass_cup",
"mtfoods:dandelion_milk"
})
food.support("milkbucket", {
"jkanimals:bucket_milk",
"mobs:bucket_milk",
})

I get an invalid crafting recipe error. Everything works but the replacement, and the problem isn't that it wants doubles. Here's the response saved in debug.txt:

2016-07-30 21:40:34: ERROR[Main]: ModError: Invalid crafting recipe (output="food:butter") 2016-07-30 21:40:34: ERROR[Main]: Check debug.txt for details.

(Please forgive the lack of tabs - github did not want to include them)

from food.

HybridDog avatar HybridDog commented on July 21, 2024

l don't know food's craft function

from food.

engineer-pearl avatar engineer-pearl commented on July 21, 2024

Hey, I've submitted a pull request with a fix to this problem. Turns out I didn't have my syntax right when I tried it the first time. The current code:

food.module("butter", function()
	minetest.register_craftitem(":food:butter", {
		description = S("Butter"),
		inventory_image = "food_butter.png",
		groups = {food_butter=1}
	})
	food.craft({
		output = "food:butter",
		recipe = {{"group:food_milkbucket","group:food_milkbucket"}},
		replacements = { 
		    {"group:food_milkbucket","bucket:bucket_empty"},
		    {"group:food_milkbucket","bucket:bucket_empty"} 
		},
	})
	food.craft({
	output = "food:butter",
	recipe = {{"group:food_milk","group:food_milkbucket"}},
	replacements = { 
	    {"group:food_milkbucket","bucket:bucket_empty"},
	},
	})
	food.craft({
		output = "food:butter",
		recipe = {
			{"group:food_milk","group:food_milk"},
		}
	})
end, true)

It may have been the missing braces that caused the failure.

(Note: this version of the fix is compatible with mixing milk buckets with milk not in buckets.)

from food.

partsfps avatar partsfps commented on July 21, 2024

using some restaurant equipment parts then easy to making butter from milk destroys buckets.

from food.

PartsIPS avatar PartsIPS commented on July 21, 2024

Yes! Really this make some sense.. So better to use some Appliance Parts and Supplies to have this work..

from food.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.