Skip to content

Commit

Permalink
Fix manual on dedicated servers
Browse files Browse the repository at this point in the history
  • Loading branch information
malte0811 committed Sep 21, 2024
1 parent 4662c78 commit e4254cf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

package blusunrize.immersiveengineering.common.crafting;

import blusunrize.immersiveengineering.ImmersiveEngineering;
import blusunrize.immersiveengineering.api.IETags;
import blusunrize.immersiveengineering.api.crafting.FluidTagInput;
import blusunrize.immersiveengineering.api.crafting.IngredientWithSize;
Expand Down Expand Up @@ -47,7 +48,11 @@ public static FluidTagInput getFluidTagForType(Holder<Potion> type, int amount)

public static void applyToAllPotionRecipes(PotionRecipeProcessor out)
{
PotionBrewing brewingData = ServerLifecycleHooks.getCurrentServer().potionBrewing();
final PotionBrewing brewingData;
if(ServerLifecycleHooks.getCurrentServer()!=null)
brewingData = ServerLifecycleHooks.getCurrentServer().potionBrewing();
else
brewingData = ImmersiveEngineering.proxy.getClientWorld().potionBrewing();
// Vanilla
for(var mixPredicate : ((PotionBrewingAccess)brewingData).getConversions())
if(mixPredicate.getTo()!=Potions.MUNDANE&&mixPredicate.getTo()!=Potions.THICK)
Expand All @@ -57,7 +62,7 @@ public static void applyToAllPotionRecipes(PotionRecipeProcessor out)
);

// Modded
for(IBrewingRecipe recipe : ((PotionBrewingAccess)brewingData).getRegistry().recipes())
for(IBrewingRecipe recipe : brewingData.getRecipes())
if(recipe instanceof BrewingRecipe brewingRecipe)
{
IngredientWithSize ingredient = new IngredientWithSize(brewingRecipe.getIngredient());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

import net.minecraft.world.item.alchemy.Potion;
import net.minecraft.world.item.alchemy.PotionBrewing;
import net.neoforged.neoforge.common.brewing.BrewingRecipeRegistry;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;

Expand All @@ -22,7 +21,4 @@ public interface PotionBrewingAccess
{
@Accessor("potionMixes")
List<PotionMixAccess<Potion>> getConversions();

@Accessor("registry")
BrewingRecipeRegistry getRegistry();
}

0 comments on commit e4254cf

Please sign in to comment.