-
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.
- Loading branch information
1 parent
54666c9
commit c1e437a
Showing
17 changed files
with
219 additions
and
55 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
src/generated/resources/data/tconstruct/tinkering/modifiers/armor_power.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,7 @@ | ||
{ | ||
"redirects": [ | ||
{ | ||
"id": "tconstruct:strength" | ||
} | ||
] | ||
} |
7 changes: 7 additions & 0 deletions
7
src/generated/resources/data/tconstruct/tinkering/modifiers/blue_extra_upgrade.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,7 @@ | ||
{ | ||
"redirects": [ | ||
{ | ||
"id": "tconstruct:harmonious" | ||
} | ||
] | ||
} |
7 changes: 7 additions & 0 deletions
7
src/generated/resources/data/tconstruct/tinkering/modifiers/extra_ability.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,7 @@ | ||
{ | ||
"redirects": [ | ||
{ | ||
"id": "tconstruct:draconic" | ||
} | ||
] | ||
} |
7 changes: 7 additions & 0 deletions
7
src/generated/resources/data/tconstruct/tinkering/modifiers/fractured.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,7 @@ | ||
{ | ||
"redirects": [ | ||
{ | ||
"id": "tconstruct:sharpness" | ||
} | ||
] | ||
} |
7 changes: 7 additions & 0 deletions
7
src/generated/resources/data/tconstruct/tinkering/modifiers/green_extra_upgrade.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,7 @@ | ||
{ | ||
"redirects": [ | ||
{ | ||
"id": "tconstruct:recapitated" | ||
} | ||
] | ||
} |
7 changes: 7 additions & 0 deletions
7
src/generated/resources/data/tconstruct/tinkering/modifiers/maintained_2.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,7 @@ | ||
{ | ||
"redirects": [ | ||
{ | ||
"id": "tconstruct:maintained" | ||
} | ||
] | ||
} |
7 changes: 7 additions & 0 deletions
7
src/generated/resources/data/tconstruct/tinkering/modifiers/red_extra_upgrade.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,7 @@ | ||
{ | ||
"redirects": [ | ||
{ | ||
"id": "tconstruct:writable" | ||
} | ||
] | ||
} |
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
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
39 changes: 39 additions & 0 deletions
39
src/main/java/slimeknights/tconstruct/library/json/JsonRedirect.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,39 @@ | ||
package slimeknights.tconstruct.library.json; | ||
|
||
import com.google.gson.JsonObject; | ||
import lombok.Data; | ||
import net.minecraft.resources.ResourceLocation; | ||
import net.minecraftforge.common.crafting.CraftingHelper; | ||
import net.minecraftforge.common.crafting.conditions.ICondition; | ||
import slimeknights.mantle.util.JsonHelper; | ||
|
||
import javax.annotation.Nullable; | ||
|
||
/** Represents a redirect in a material or modifier JSON */ | ||
@SuppressWarnings("ClassCanBeRecord") // GSON does not support records | ||
@Data | ||
public class JsonRedirect { | ||
private final ResourceLocation id; | ||
@Nullable | ||
private final ICondition condition; | ||
|
||
/** Serializes this to JSON */ | ||
public JsonObject toJson() { | ||
JsonObject json = new JsonObject(); | ||
json.addProperty("id", id.toString()); | ||
if (condition != null) { | ||
json.add("condition", CraftingHelper.serialize(condition)); | ||
} | ||
return json; | ||
} | ||
|
||
/** Deserializes this to JSON */ | ||
public static JsonRedirect fromJson(JsonObject json) { | ||
ResourceLocation id = JsonHelper.getResourceLocation(json, "id"); | ||
ICondition condition = null; | ||
if (json.has("condition")) { | ||
condition = CraftingHelper.getCondition(json); | ||
} | ||
return new JsonRedirect(id, condition); | ||
} | ||
} |
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
Oops, something went wrong.