Skip to content

Commit 42918ec

Browse files
committed
Implement potion recipes
1 parent dbc1cb4 commit 42918ec

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

Common/src/main/java/at/petrak/hexcasting/common/lib/HexPotions.java

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,22 @@
33
import net.minecraft.resources.ResourceLocation;
44
import net.minecraft.world.effect.MobEffectInstance;
55
import net.minecraft.world.item.alchemy.Potion;
6+
import net.minecraft.world.item.alchemy.Potions;
7+
import net.minecraft.world.item.Items;
68

79
import java.util.LinkedHashMap;
810
import java.util.Map;
911
import java.util.function.BiConsumer;
1012

1113
import static at.petrak.hexcasting.api.HexAPI.modLoc;
14+
import at.petrak.hexcasting.mixin.accessor.AccessorPotionBrewing;
1215

1316
public class HexPotions {
1417
public static void register(BiConsumer<Potion, ResourceLocation> r) {
1518
for (var e : POTIONS.entrySet()) {
1619
r.accept(e.getValue(), e.getKey());
1720
}
21+
HexPotions.addRecipes();
1822
}
1923

2024
private static final Map<ResourceLocation, Potion> POTIONS = new LinkedHashMap<>();
@@ -26,12 +30,24 @@ public static void register(BiConsumer<Potion, ResourceLocation> r) {
2630
public static final Potion ENLARGE_GRID_STRONG = make("enlarge_grid_strong",
2731
new Potion("enlarge_grid_strong", new MobEffectInstance(HexMobEffects.ENLARGE_GRID, 1800, 1)));
2832

33+
public static final Potion SHRINK_GRID = make("shrink_grid",
34+
new Potion("shrink_grid", new MobEffectInstance(HexMobEffects.SHRINK_GRID, 3600)));
35+
public static final Potion SHRINK_GRID_LONG = make("shrink_grid_long",
36+
new Potion("shrink_grid_long", new MobEffectInstance(HexMobEffects.SHRINK_GRID, 9600)));
37+
public static final Potion SHRINK_GRID_STRONG = make("shrink_grid_strong",
38+
new Potion("shrink_grid_strong", new MobEffectInstance(HexMobEffects.SHRINK_GRID, 1800, 1)));
39+
2940
public static void addRecipes() {
30-
/*
3141
AccessorPotionBrewing.addMix(Potions.AWKWARD, HexItems.AMETHYST_DUST, ENLARGE_GRID);
3242
AccessorPotionBrewing.addMix(ENLARGE_GRID, Items.REDSTONE, ENLARGE_GRID_LONG);
3343
AccessorPotionBrewing.addMix(ENLARGE_GRID, Items.GLOWSTONE_DUST, ENLARGE_GRID_STRONG);
34-
*/
44+
45+
AccessorPotionBrewing.addMix(ENLARGE_GRID, Items.FERMENTED_SPIDER_EYE, SHRINK_GRID);
46+
AccessorPotionBrewing.addMix(ENLARGE_GRID_LONG, Items.FERMENTED_SPIDER_EYE, SHRINK_GRID_LONG);
47+
AccessorPotionBrewing.addMix(ENLARGE_GRID_STRONG, Items.FERMENTED_SPIDER_EYE, SHRINK_GRID_STRONG);
48+
49+
AccessorPotionBrewing.addMix(SHRINK_GRID, Items.REDSTONE, SHRINK_GRID_LONG);
50+
AccessorPotionBrewing.addMix(SHRINK_GRID, Items.GLOWSTONE_DUST, SHRINK_GRID_STRONG);
3551
}
3652

3753
private static <T extends Potion> T make(String id, T potion) {

Fabric/src/main/java/at/petrak/hexcasting/fabric/FabricHexInitializer.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ object FabricHexInitializer : ModInitializer {
132132
HexAttributes.register(bind(BuiltInRegistries.ATTRIBUTE))
133133
HexMobEffects.register(bind(BuiltInRegistries.MOB_EFFECT))
134134
HexPotions.register(bind(BuiltInRegistries.POTION))
135-
HexPotions.addRecipes()
136135

137136
HexRecipeStuffRegistry.registerSerializers(bind(BuiltInRegistries.RECIPE_SERIALIZER))
138137
HexRecipeStuffRegistry.registerTypes(bind(BuiltInRegistries.RECIPE_TYPE))

Forge/src/main/java/at/petrak/hexcasting/forge/ForgeHexInitializer.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ private static void initRegistry() {
131131
bind(Registries.ATTRIBUTE, HexAttributes::register);
132132
bind(Registries.MOB_EFFECT, HexMobEffects::register);
133133
bind(Registries.POTION, HexPotions::register);
134-
HexPotions.addRecipes();
135134

136135
bind(Registries.PARTICLE_TYPE, HexParticles::registerParticles);
137136

0 commit comments

Comments
 (0)