Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grid modifier potions 2: the real one: definitive edition #788

Merged
merged 4 commits into from
Nov 12, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public static void register(BiConsumer<MobEffect, ResourceLocation> r) {
.addAttributeModifier(HexAttributes.GRID_ZOOM, "d4afaf0f-df37-4253-9fa7-029e8e4415d9",
0.25, AttributeModifier.Operation.MULTIPLY_TOTAL);
public static final MobEffect SHRINK_GRID = make("shrink_grid",
new HexMobEffect(MobEffectCategory.HARMFUL, 0xebad1c))
new HexMobEffect(MobEffectCategory.HARMFUL, 0xc0e660))
.addAttributeModifier(HexAttributes.GRID_ZOOM, "1ce492a9-8bf5-4091-a482-c6d9399e448a",
-0.2, AttributeModifier.Operation.MULTIPLY_TOTAL);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,22 @@
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.effect.MobEffectInstance;
import net.minecraft.world.item.alchemy.Potion;
import net.minecraft.world.item.alchemy.Potions;
import net.minecraft.world.item.Items;

import java.util.LinkedHashMap;
import java.util.Map;
import java.util.function.BiConsumer;

import static at.petrak.hexcasting.api.HexAPI.modLoc;
import at.petrak.hexcasting.mixin.accessor.AccessorPotionBrewing;

public class HexPotions {
public static void register(BiConsumer<Potion, ResourceLocation> r) {
for (var e : POTIONS.entrySet()) {
r.accept(e.getValue(), e.getKey());
}
HexPotions.addRecipes();
}

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

public static final Potion SHRINK_GRID = make("shrink_grid",
new Potion("shrink_grid", new MobEffectInstance(HexMobEffects.SHRINK_GRID, 3600)));
public static final Potion SHRINK_GRID_LONG = make("shrink_grid_long",
new Potion("shrink_grid_long", new MobEffectInstance(HexMobEffects.SHRINK_GRID, 9600)));
public static final Potion SHRINK_GRID_STRONG = make("shrink_grid_strong",
new Potion("shrink_grid_strong", new MobEffectInstance(HexMobEffects.SHRINK_GRID, 1800, 1)));

public static void addRecipes() {
/*
AccessorPotionBrewing.addMix(Potions.AWKWARD, HexItems.AMETHYST_DUST, ENLARGE_GRID);
AccessorPotionBrewing.addMix(ENLARGE_GRID, Items.REDSTONE, ENLARGE_GRID_LONG);
AccessorPotionBrewing.addMix(ENLARGE_GRID, Items.GLOWSTONE_DUST, ENLARGE_GRID_STRONG);
*/

AccessorPotionBrewing.addMix(ENLARGE_GRID, Items.FERMENTED_SPIDER_EYE, SHRINK_GRID);
AccessorPotionBrewing.addMix(ENLARGE_GRID_LONG, Items.FERMENTED_SPIDER_EYE, SHRINK_GRID_LONG);
AccessorPotionBrewing.addMix(ENLARGE_GRID_STRONG, Items.FERMENTED_SPIDER_EYE, SHRINK_GRID_STRONG);

AccessorPotionBrewing.addMix(SHRINK_GRID, Items.REDSTONE, SHRINK_GRID_LONG);
AccessorPotionBrewing.addMix(SHRINK_GRID, Items.GLOWSTONE_DUST, SHRINK_GRID_STRONG);
}

private static <T extends Potion> T make(String id, T potion) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,47 @@
bricks_small: "Small Quenched Allay Bricks",
},
},

"effect.hexcasting": {
enlarge_grid: "Clarity",
shrink_grid: "Clouding",
},

"item.minecraft.potion.effect": {
enlarge_grid: "Potion of Clarity",
enlarge_grid_long: "Potion of Clarity",
enlarge_grid_strong: "Potion of Clarity",
shrink_grid: "Potion of Clouding",
shrink_grid_long: "Potion of Clouding",
shrink_grid_strong: "Potion of Clouding",
},

"item.minecraft.splash_potion.effect": {
enlarge_grid: "Splash Potion of Clarity",
enlarge_grid_long: "Splash Potion of Clarity",
enlarge_grid_strong: "Splash Potion of Clarity",
shrink_grid: "Splash Potion of Clouding",
shrink_grid_long: "Splash Potion of Clouding",
shrink_grid_strong: "Splash Potion of Clouding",
},

"item.minecraft.lingering_potion.effect": {
enlarge_grid: "Lingering Potion of Clarity",
enlarge_grid_long: "Lingering Potion of Clarity",
enlarge_grid_strong: "Lingering Potion of Clarity",
shrink_grid: "Lingering Potion of Clouding",
shrink_grid_long: "Lingering Potion of Clouding",
shrink_grid_strong: "Lingering Potion of Clouding",
},

"item.minecraft.tipped_arrow.effect": {
enlarge_grid: "Arrow of Clarity",
enlarge_grid_long: "Arrow of Clarity",
enlarge_grid_strong: "Arrow of Clarity",
shrink_grid: "Arrow of Clouding",
shrink_grid_long: "Arrow of Clouding",
shrink_grid_strong: "Arrow of Clouding",
},

"itemGroup.hexcasting": {
"": "Hexcasting",
Expand Down Expand Up @@ -1117,6 +1158,7 @@
// why is this called "hexcasting"?
hexcasting: "Casting Items",
phials: "Phials of Media",
potions: "Hex Potions",
pigments: "Pigments",

edified: "Edified Trees",
Expand Down Expand Up @@ -1461,6 +1503,12 @@
"3": "Unfortunately, the art of actually $(italic)making/$ the things seems to have been lost to time. I've found a $(l:patterns/great_spells/make_battery#hexcasting:craft/battery)$(thing)hint at the pattern used to craft it/$, but the technique is irritatingly elusive, and I can't seem to do it successfully. I suspect I will figure it out with study and practice, though. For now, I will simply deal with the wasted _media...$(br2)But I won't settle for it forever.",
desc: "$(italic)Drink the milk./$",
},

potions: {
"1": "Peering through a $(l:items/lens)$(item)Scrying Lens/$ allows me to fit more patterns onto my casting grid. But what if I want to improve my casting even further? Alchemy has an answer.$(br2)By adding a pinch of Amethyst Dust to an $(item)Awkward Potion/$, I can create a brew that increases the size of my grid in much the same way as the Lens. I can even use both at once for the ultimate grid!",
"2": "The Potion of Clarity can be extended, strengthened, and modified like any other potion.$(br2)It can also be corrupted with a $(item)Fermented Spider Eye/$ to produce a variant with the opposite effect. This may be useful for dealing with enemy casters.",
"effects.header": "Clarity and Clouding",
},

pigments: {
"1": "The old practitioners of my art sometimes identified themselves by a color, emblematic of them and their _Hexes. Although their names have faded, their colors remain. It seems a special kind of pigment, offered to Nature in the right way, would \"[...] paint one's thoughts in a manner pleasing to Nature, inducing a miraculous change in personal colour.\"",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "hexcasting.entry.phials",
"category": "hexcasting:items",
"icon": "hexcasting:battery{media:10000,max_media:10000}",
"icon": "hexcasting:battery",
"sortnum": 7,
"advancement": "hexcasting:root",
"read_by_default": true,
Expand All @@ -21,7 +21,7 @@
{
"type": "patchouli:spotlight",
"text": "hexcasting.page.phials.desc",
"item": "hexcasting:battery{media:10000,max_media:10000}",
"item": "hexcasting:battery{\"hexcasting:media\":640000,\"hexcasting:start_media\":640000}",
"link_recipe": true
}
]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "hexcasting.entry.potions",
"category": "hexcasting:items",
"icon": "minecraft:potion{Potion:\"hexcasting:enlarge_grid\"}",
"sortnum": 8,
"advancement": "hexcasting:root",
"read_by_default": true,
"pages": [
{
"type": "patchouli:text",
"text": "hexcasting.page.potions.1"
},
{
"type": "patchouli:spotlight",
"title": "hexcasting.page.potions.effects.header",
"text": "hexcasting.page.potions.2",
"item": "minecraft:potion{Potion:\"hexcasting:enlarge_grid\"},minecraft:potion{Potion:\"hexcasting:enlarge_grid_long\"},minecraft:potion{Potion:\"hexcasting:enlarge_grid_strong\"},minecraft:potion{Potion:\"hexcasting:shrink_grid\"},minecraft:potion{Potion:\"hexcasting:shrink_grid_long\"},minecraft:potion{Potion:\"hexcasting:shrink_grid_strong\"}"
}
]
}

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ object FabricHexInitializer : ModInitializer {
HexAttributes.register(bind(BuiltInRegistries.ATTRIBUTE))
HexMobEffects.register(bind(BuiltInRegistries.MOB_EFFECT))
HexPotions.register(bind(BuiltInRegistries.POTION))
HexPotions.addRecipes()

HexRecipeStuffRegistry.registerSerializers(bind(BuiltInRegistries.RECIPE_SERIALIZER))
HexRecipeStuffRegistry.registerTypes(bind(BuiltInRegistries.RECIPE_TYPE))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ private static void initRegistry() {
bind(Registries.ATTRIBUTE, HexAttributes::register);
bind(Registries.MOB_EFFECT, HexMobEffects::register);
bind(Registries.POTION, HexPotions::register);
HexPotions.addRecipes();

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

Expand Down
Loading