Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/main/java/com/gregtechceu/gtceu/api/GTValues.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ public class GTValues {
public static final int L = 144;
public static final RandomSource RNG = RandomSource.createThreadSafe();

// shortcut for various lengths of time in ticks
public static final long SECONDS = 20;
public static final long MINUTES = 60 * SECONDS;
public static final long HOURS = 60 * MINUTES;
public static final long DAYS = 24 * HOURS;
public static final long WEEKS = 7 * DAYS;
public static final long MONTHS = 30 * DAYS;
public static final long YEARS = 365 * DAYS;

/**
* The Item WildCard Tag. Even shorter than the "-1" of the past
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,12 @@ private static void handleGTRecipe(Map<ResourceLocation, Recipe<?>> recipesByNam
// get the recipe ID without the leading type path
GTRecipeBuilder builder = gtRecipeType.recipeBuilder(gtRecipe.idWithoutType());
if (gtRecipe.getValue(GTRecipeSchema.DURATION) != null) {
builder.duration = gtRecipe.getValue(GTRecipeSchema.DURATION).intValue();
int duration = gtRecipe.getValue(GTRecipeSchema.DURATION).intValue();
if (duration <= 0) {
GTCEu.LOGGER.error("Duration must be a positive value, skipping recipe id: {}", gtRecipe.getId());
return;
}
builder.duration = duration;
}
if (gtRecipe.getValue(GTRecipeSchema.DATA) != null) {
builder.data = gtRecipe.getValue(GTRecipeSchema.DATA);
Expand Down