diff options
| author | 2024-02-04 15:13:48 +0200 | |
|---|---|---|
| committer | 2024-02-04 15:14:06 +0200 | |
| commit | 8b2f462adbf8861f6404b2da96818adef2e16676 (patch) | |
| tree | 806d47729f63a5ec77868514138f579aa92af854 /src | |
| parent | Release 0.2.2 (diff) | |
| download | mc-eris-alchemy-8b2f462adbf8861f6404b2da96818adef2e16676.tar.gz mc-eris-alchemy-8b2f462adbf8861f6404b2da96818adef2e16676.tar.xz mc-eris-alchemy-8b2f462adbf8861f6404b2da96818adef2e16676.zip | |
Small bugfixes
Diffstat (limited to 'src')
3 files changed, 7 insertions, 5 deletions
diff --git a/src/main/java/lv/enes/mc/eris_alchemy/block/entity/EnergyCondenserEntity.java b/src/main/java/lv/enes/mc/eris_alchemy/block/entity/EnergyCondenserEntity.java index 105e9e3..0aa14fe 100644 --- a/src/main/java/lv/enes/mc/eris_alchemy/block/entity/EnergyCondenserEntity.java +++ b/src/main/java/lv/enes/mc/eris_alchemy/block/entity/EnergyCondenserEntity.java | |||
| @@ -95,6 +95,10 @@ public class EnergyCondenserEntity extends ChestLikeEntity implements EmcStorage | |||
| 95 | @Override | 95 | @Override |
| 96 | public void tick(Level world, BlockPos pos, BlockState state) { | 96 | public void tick(Level world, BlockPos pos, BlockState state) { |
| 97 | super.tick(world, pos, state); | 97 | super.tick(world, pos, state); |
| 98 | if (world.isClientSide) { | ||
| 99 | return; | ||
| 100 | } | ||
| 101 | |||
| 98 | var cost = getMaxEmc(); | 102 | var cost = getMaxEmc(); |
| 99 | tryConsumeEmc(cost); | 103 | tryConsumeEmc(cost); |
| 100 | tryCloneTemplate(cost); | 104 | tryCloneTemplate(cost); |
diff --git a/src/main/java/lv/enes/mc/eris_alchemy/recipe/SimplifiedRecipe.java b/src/main/java/lv/enes/mc/eris_alchemy/recipe/SimplifiedRecipe.java index 6bb1274..0a6a5a0 100644 --- a/src/main/java/lv/enes/mc/eris_alchemy/recipe/SimplifiedRecipe.java +++ b/src/main/java/lv/enes/mc/eris_alchemy/recipe/SimplifiedRecipe.java | |||
| @@ -24,14 +24,14 @@ import java.lang.reflect.Type; | |||
| 24 | import java.util.Arrays; | 24 | import java.util.Arrays; |
| 25 | import java.util.Collection; | 25 | import java.util.Collection; |
| 26 | import java.util.List; | 26 | import java.util.List; |
| 27 | import java.util.Objects; | ||
| 28 | import java.util.function.Predicate; | 27 | import java.util.function.Predicate; |
| 29 | import java.util.function.Supplier; | 28 | import java.util.function.Supplier; |
| 30 | import java.util.stream.Stream; | 29 | import java.util.stream.Stream; |
| 31 | 30 | ||
| 32 | public record SimplifiedRecipe(ItemStack output, List<ItemStack> remainder, List<Supplier<Ingredient>> input) { | 31 | public record SimplifiedRecipe(ItemStack output, List<ItemStack> remainder, List<Supplier<Ingredient>> input) { |
| 33 | public static List<SimplifiedRecipe> of(Recipe<?> recipe, RegistryAccess registryAccess) { | 32 | public static List<SimplifiedRecipe> of(Recipe<?> recipe, RegistryAccess registryAccess) { |
| 34 | if (ForeignUtils.IS_CHIPPED_AVAILABLE && recipe instanceof ChippedRecipe chippedRecipe) { | 33 | if (ForeignUtils.isClassAvailable("earth.terrarium.chipped.common.recipe.ChippedRecipe") |
| 34 | && recipe instanceof ChippedRecipe chippedRecipe) { | ||
| 35 | var remainder = List.<ItemStack>of(); | 35 | var remainder = List.<ItemStack>of(); |
| 36 | return chippedRecipe.tags() | 36 | return chippedRecipe.tags() |
| 37 | .stream() | 37 | .stream() |
diff --git a/src/main/java/lv/enes/mc/eris_alchemy/utils/ForeignUtils.java b/src/main/java/lv/enes/mc/eris_alchemy/utils/ForeignUtils.java index b686a9e..d31d484 100644 --- a/src/main/java/lv/enes/mc/eris_alchemy/utils/ForeignUtils.java +++ b/src/main/java/lv/enes/mc/eris_alchemy/utils/ForeignUtils.java | |||
| @@ -1,9 +1,7 @@ | |||
| 1 | package lv.enes.mc.eris_alchemy.utils; | 1 | package lv.enes.mc.eris_alchemy.utils; |
| 2 | 2 | ||
| 3 | public class ForeignUtils { | 3 | public class ForeignUtils { |
| 4 | public static boolean IS_CHIPPED_AVAILABLE = check("earth.terrarium.chipped.Chipped"); | 4 | public static boolean isClassAvailable(String className) { |
| 5 | |||
| 6 | private static boolean check(String className) { | ||
| 7 | try { | 5 | try { |
| 8 | Class.forName(className); | 6 | Class.forName(className); |
| 9 | return true; | 7 | return true; |