-
Notifications
You must be signed in to change notification settings - Fork 754
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement recipe that allows different slot requirements each level w…
…ith the same inputs Useful right now for crystal recipes, but would also be useful if you wish to change slot requirements without having to come up with a new recipe each level
- Loading branch information
1 parent
7b7849e
commit 885868f
Showing
17 changed files
with
757 additions
and
130 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
src/generated/resources/data/tconstruct/recipes/tools/modifiers/ability/luck_crystal.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"type": "tconstruct:multilevel_modifier", | ||
"allow_crystal": true, | ||
"tools": [ | ||
{ | ||
"tag": "tconstruct:modifiable/melee_or_unarmed" | ||
}, | ||
{ | ||
"tag": "tconstruct:modifiable/harvest" | ||
}, | ||
{ | ||
"tag": "tconstruct:modifiable/ranged" | ||
} | ||
], | ||
"levels": [ | ||
{ | ||
"slots": { | ||
"abilities": 1 | ||
}, | ||
"level": 1 | ||
}, | ||
{ | ||
"min_level": 2, | ||
"max_level": 3 | ||
} | ||
], | ||
"result": "tconstruct:luck" | ||
} |
38 changes: 0 additions & 38 deletions
38
...resources/data/tconstruct/recipes/tools/modifiers/ability/luck_crystal_higher_levels.json
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
...enerated/resources/data/tconstruct/recipes/tools/modifiers/ability/tool_belt_crystal.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"type": "tconstruct:multilevel_modifier", | ||
"allow_crystal": true, | ||
"tools": { | ||
"tag": "tconstruct:modifiable/armor/leggings" | ||
}, | ||
"levels": [ | ||
{ | ||
"slots": { | ||
"abilities": 1 | ||
}, | ||
"level": 1 | ||
}, | ||
{ | ||
"min_level": 2, | ||
"max_level": 6 | ||
} | ||
], | ||
"result": "tconstruct:tool_belt" | ||
} |
9 changes: 0 additions & 9 deletions
9
.../resources/data/tconstruct/recipes/tools/modifiers/salvage/upgrade/offhanded_level_1.json
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
.../resources/data/tconstruct/recipes/tools/modifiers/salvage/upgrade/offhanded_level_2.json
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,5 +19,5 @@ | |
"name": "tconstruct:offhanded", | ||
"level": 1 | ||
}, | ||
"max_level": 1 | ||
"max_level": 2 | ||
} |
28 changes: 0 additions & 28 deletions
28
...enerated/resources/data/tconstruct/recipes/tools/modifiers/upgrade/offhanded_level_2.json
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
...n/java/slimeknights/tconstruct/library/recipe/modifiers/adding/DisplayModifierRecipe.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package slimeknights.tconstruct.library.recipe.modifiers.adding; | ||
|
||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
import net.minecraft.world.item.ItemStack; | ||
import slimeknights.mantle.recipe.ingredient.SizedIngredient; | ||
import slimeknights.tconstruct.library.modifiers.ModifierEntry; | ||
import slimeknights.tconstruct.library.tools.SlotType.SlotCount; | ||
|
||
import javax.annotation.Nullable; | ||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
/** Recipe instance to return in JEI from recipes that contain multiple display recipes */ | ||
@RequiredArgsConstructor | ||
public class DisplayModifierRecipe implements IDisplayModifierRecipe { | ||
private final List<SizedIngredient> inputs; | ||
@Getter | ||
private final List<ItemStack> toolWithoutModifier; | ||
@Getter | ||
private final List<ItemStack> toolWithModifier; | ||
/** Error message to display if the requirements do not match */ | ||
@Getter | ||
protected final String requirementsError; | ||
@Getter | ||
private final ModifierEntry displayResult; | ||
@Getter | ||
private final int maxLevel; | ||
@Nullable | ||
@Getter | ||
private final SlotCount slots; | ||
|
||
@Override | ||
public int getInputCount() { | ||
return inputs.size(); | ||
} | ||
|
||
@Override | ||
public List<ItemStack> getDisplayItems(int slot) { | ||
if (slot >= 0 && slot < inputs.size()) { | ||
return inputs.get(slot).getMatchingStacks(); | ||
} | ||
return Collections.emptyList(); | ||
} | ||
|
||
@Override | ||
public boolean hasRequirements() { | ||
return !requirementsError.isEmpty(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.