diff --git a/README.md b/README.md index b80bd1c..90f7013 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,7 @@ # Glowstone Wire Adds redstone-like dust for glowstone. -- Emit's light level 9 (Perfect for 2-wide path ways) -- Is thinner then redstone +- Emit's light level 8 (Perfect for 2-wide path ways) - Can be customized to look a little more stylized 10/10, great mod. \ No newline at end of file diff --git a/build.gradle b/build.gradle index a4b5de7..7a820ea 100644 --- a/build.gradle +++ b/build.gradle @@ -27,6 +27,9 @@ dependencies { // Fabric API. This is technically optional, but you probably want it anyway. modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" + // Custom API's + implementation "me.zeroeightsix:fiber:${project.fiber_version}" + // PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs. // You may need to force-disable transitiveness on them. } diff --git a/gradle.properties b/gradle.properties index 014849b..8a2b25d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,8 +10,9 @@ org.gradle.jvmargs=-Xmx1G # Mod Properties mod_version = 0.0.1 maven_group = me.parsell - archives_base_name = glowstonedust + archives_base_name = glowstonewire # Dependencies # currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api fabric_version=0.32.5+1.16 + fiber_version =0.23.0-2 diff --git a/src/main/java/me/parsell/glowstonewire/GlowstoneWire.java b/src/main/java/me/parsell/glowstonewire/GlowstoneWire.java index d852e77..1a6d156 100644 --- a/src/main/java/me/parsell/glowstonewire/GlowstoneWire.java +++ b/src/main/java/me/parsell/glowstonewire/GlowstoneWire.java @@ -3,11 +3,6 @@ package me.parsell.glowstonewire; import me.parsell.glowstonewire.core.glowBlocks; import me.parsell.glowstonewire.core.glowItems; import net.fabricmc.api.ModInitializer; -import net.fabricmc.fabric.api.client.itemgroup.FabricItemGroupBuilder; -import net.minecraft.item.ItemGroup; -import net.minecraft.item.ItemStack; -import net.minecraft.item.Items; -import net.minecraft.util.Identifier; public class GlowstoneWire implements ModInitializer { public static final String MODID = "glowstonewire"; diff --git a/src/main/java/me/parsell/glowstonewire/core/glowItems.java b/src/main/java/me/parsell/glowstonewire/core/glowItems.java index b4be0be..84aaab1 100644 --- a/src/main/java/me/parsell/glowstonewire/core/glowItems.java +++ b/src/main/java/me/parsell/glowstonewire/core/glowItems.java @@ -1,6 +1,7 @@ package me.parsell.glowstonewire.core; import me.parsell.glowstonewire.GlowstoneWire; +import me.parsell.glowstonewire.mixin.BrewingRecipeRegistryAccessor; import net.fabricmc.fabric.api.client.itemgroup.FabricItemGroupBuilder; import net.fabricmc.fabric.api.item.v1.FabricItemSettings; import net.minecraft.item.BlockItem; @@ -8,6 +9,7 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; +import net.minecraft.potion.Potions; import net.minecraft.util.Identifier; import net.minecraft.util.registry.Registry; @@ -17,5 +19,26 @@ public class glowItems { public static void init(){ Registry.register(Registry.ITEM, new Identifier(GlowstoneWire.MODID, "glowstone_dust"), GLOWSTONE_DUST); + + // Modded Glowstone Potion Recipes + // TODO: IF "replace" or "both" config is set + if (true) { + BrewingRecipeRegistryAccessor.registerPotionRecipe(Potions.WATER, GLOWSTONE_DUST, Potions.THICK); + BrewingRecipeRegistryAccessor.registerPotionRecipe(Potions.LEAPING, GLOWSTONE_DUST, Potions.STRONG_LEAPING); + BrewingRecipeRegistryAccessor.registerPotionRecipe(Potions.SLOWNESS, GLOWSTONE_DUST, Potions.STRONG_SLOWNESS); + BrewingRecipeRegistryAccessor.registerPotionRecipe(Potions.TURTLE_MASTER, GLOWSTONE_DUST, Potions.STRONG_TURTLE_MASTER); + BrewingRecipeRegistryAccessor.registerPotionRecipe(Potions.SWIFTNESS, GLOWSTONE_DUST, Potions.STRONG_SWIFTNESS); + BrewingRecipeRegistryAccessor.registerPotionRecipe(Potions.HEALING, GLOWSTONE_DUST, Potions.STRONG_HEALING); + BrewingRecipeRegistryAccessor.registerPotionRecipe(Potions.HARMING, GLOWSTONE_DUST, Potions.STRONG_HARMING); + BrewingRecipeRegistryAccessor.registerPotionRecipe(Potions.POISON, GLOWSTONE_DUST, Potions.STRONG_POISON); + BrewingRecipeRegistryAccessor.registerPotionRecipe(Potions.REGENERATION, GLOWSTONE_DUST, Potions.STRONG_REGENERATION); + BrewingRecipeRegistryAccessor.registerPotionRecipe(Potions.STRENGTH, GLOWSTONE_DUST, Potions.STRONG_STRENGTH); + } + + // Vanilla Glowstone -> Modded Glowstone + // TODO: IF "convert" or "both" config is set + if(true) { + + } }; } diff --git a/src/main/java/me/parsell/glowstonewire/mixin/BrewingRecipeRegistryAccessor.java b/src/main/java/me/parsell/glowstonewire/mixin/BrewingRecipeRegistryAccessor.java new file mode 100644 index 0000000..f02a047 --- /dev/null +++ b/src/main/java/me/parsell/glowstonewire/mixin/BrewingRecipeRegistryAccessor.java @@ -0,0 +1,16 @@ +package me.parsell.glowstonewire.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.gen.Invoker; + +import net.minecraft.item.Item; +import net.minecraft.potion.Potion; +import net.minecraft.recipe.BrewingRecipeRegistry; + +@Mixin(BrewingRecipeRegistry.class) +public interface BrewingRecipeRegistryAccessor { + @Invoker("registerPotionRecipe") + public static void registerPotionRecipe(Potion input, Item item, Potion output) { + throw new AssertionError(); + } +}