Remove Stick Requirement for Hand Framing Tool

This commit is contained in:
IntegerLimit 2023-06-18 10:23:49 +10:00
parent 1182ffca79
commit 4e4628f772
2 changed files with 0 additions and 34 deletions

View File

@ -140,37 +140,6 @@ function getNested(inTag as IData, keys as string[], alt as IData) as IData {
return isNull(tag) ? alt : tag; return isNull(tag) ? alt : tag;
} }
val sticksIngredient = <ore:stickWood>.transformConsume(64);
val sticksRecipeFunction = function(out, ins, cinfo) {
var sticks as int = getNested(ins.hft.tag, ["sticks"], 0) as int;
for k, v in ins {
if k != "hft" {
sticks += v.amount;
}
}
return ins.hft.updateTag({ "sticks": sticks });
} as IRecipeFunction;
val hftIngredient = <contenttweaker:hand_framing_tool>.marked("hft");
for stickStacks in 1 .. 9 {
var ingredients = [hftIngredient] as IIngredient[];
for i in 0 .. stickStacks {
ingredients += sticksIngredient.marked("stick" + i);
}
recipes.addShapeless(
"hand_framing_tool_sticks_" + stickStacks,
<contenttweaker:hand_framing_tool>.withTag({sticks: stickStacks}),
ingredients,
sticksRecipeFunction
);
}
<contenttweaker:hand_framing_tool>.addAdvancedTooltip(
function(stack as IItemStack) {
return "Sticks: " + (isNull(stack) ? "0" : getNested(stack.tag, ["sticks"], 0));
} as ITooltipFunction
);
function makeTagFunc(name as string) as ITooltipFunction { function makeTagFunc(name as string) as ITooltipFunction {
val matTag = "Mat" + name[0]; val matTag = "Mat" + name[0];
return function(stack as IItemStack) as string { return function(stack as IItemStack) as string {

View File

@ -105,9 +105,6 @@ hft.onItemUse = function(player as Player,
if (isNull(tag) || isNull(tag.MatS)) return ActionResult.fail(); if (isNull(tag) || isNull(tag.MatS)) return ActionResult.fail();
if !isReframing(definition) { if !isReframing(definition) {
val stickCount = orElse(tag.sticks, 0) as int;
if (stickCount < 8) return ActionResult.fail();
tag += { "sticks": stickCount - 8 } as IData;
state = makeFramedState(state); state = makeFramedState(state);
} }