From 36a8ea458ccf5a751837b5bac3c846c8ca91d5ea Mon Sep 17 00:00:00 2001 From: screret <68943070+screret@users.noreply.github.com> Date: Fri, 24 May 2024 18:48:22 +0300 Subject: [PATCH] Why do they call it oven when you of in the cold food of out hot eat the food (#1316) --- .../gtceu/api/capability/recipe/EURecipeCapability.java | 6 +++++- .../com/gregtechceu/gtceu/data/loader/BedrockOreLoader.java | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gregtechceu/gtceu/api/capability/recipe/EURecipeCapability.java b/src/main/java/com/gregtechceu/gtceu/api/capability/recipe/EURecipeCapability.java index 187dd9d272..30de885dcb 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/capability/recipe/EURecipeCapability.java +++ b/src/main/java/com/gregtechceu/gtceu/api/capability/recipe/EURecipeCapability.java @@ -71,6 +71,10 @@ public int getMaxParallelRatio(IRecipeCapabilityHolder holder, GTRecipe recipe, if (recipeEUt == 0) { return Integer.MAX_VALUE; } - return Math.abs((int) (maxVoltage / recipeEUt)); + return Math.abs(safeCastLongToInt(maxVoltage / recipeEUt)); + } + + public static int safeCastLongToInt(long v) { + return v > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int) v; } } diff --git a/src/main/java/com/gregtechceu/gtceu/data/loader/BedrockOreLoader.java b/src/main/java/com/gregtechceu/gtceu/data/loader/BedrockOreLoader.java index c75ee3ceda..5fd4614e08 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/loader/BedrockOreLoader.java +++ b/src/main/java/com/gregtechceu/gtceu/data/loader/BedrockOreLoader.java @@ -49,7 +49,7 @@ protected void apply(Map resourceList, ResourceMa GTRegistries.BEDROCK_ORE_DEFINITIONS.registry().clear(); GTOres.toReRegisterBedrock.forEach(GTRegistries.BEDROCK_ORE_DEFINITIONS::registerOrOverride); - AddonFinder.getAddons().forEach(IGTAddon::registerFluidVeins); + AddonFinder.getAddons().forEach(IGTAddon::registerBedrockOreVeins); ModLoader.get().postEvent(new GTCEuAPI.RegisterEvent<>(GTRegistries.BEDROCK_ORE_DEFINITIONS, BedrockOreDefinition.class)); if (GTCEu.isKubeJSLoaded()) { RunKJSEventInSeparateClassBecauseForgeIsDumb.fireKJSEvent();