Skip to content

Commit

Permalink
Remove Stick Requirement for Hand Framing Tool
Browse files Browse the repository at this point in the history
  • Loading branch information
IntegerLimit committed Jun 18, 2023
1 parent 1182ffc commit 4e4628f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 34 deletions.
31 changes: 0 additions & 31 deletions overrides/scripts/HandFraming.zs
Original file line number Diff line number Diff line change
Expand Up @@ -140,37 +140,6 @@ function getNested(inTag as IData, keys as string[], alt as IData) as IData {
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 {
val matTag = "Mat" + name[0];
return function(stack as IItemStack) as string {
Expand Down
3 changes: 0 additions & 3 deletions overrides/scripts/HandFramingTool.zs
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,6 @@ hft.onItemUse = function(player as Player,
if (isNull(tag) || isNull(tag.MatS)) return ActionResult.fail();

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);
}

Expand Down

0 comments on commit 4e4628f

Please sign in to comment.