Lemon Potion

This commit is contained in:
Vos
2025-11-11 12:01:26 -06:00
parent b027fb1945
commit a9db6e054c
5 changed files with 45 additions and 10 deletions
@@ -5,6 +5,7 @@ import com.acethewildfire.acesbs.component.ModDataComponentTypes;
import com.acethewildfire.acesbs.effect.ModEffects; import com.acethewildfire.acesbs.effect.ModEffects;
import com.acethewildfire.acesbs.item.ModItemGroups; import com.acethewildfire.acesbs.item.ModItemGroups;
import com.acethewildfire.acesbs.item.ModItems; import com.acethewildfire.acesbs.item.ModItems;
import com.acethewildfire.acesbs.potion.ModPotions;
import com.acethewildfire.acesbs.sounds.ModSounds; import com.acethewildfire.acesbs.sounds.ModSounds;
import com.acethewildfire.acesbs.util.HammerUsageEvent; import com.acethewildfire.acesbs.util.HammerUsageEvent;
import com.acethewildfire.acesbs.util.UpdateRecipies; import com.acethewildfire.acesbs.util.UpdateRecipies;
@@ -13,7 +14,10 @@ import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.event.player.AttackEntityCallback; import net.fabricmc.fabric.api.event.player.AttackEntityCallback;
import net.fabricmc.fabric.api.event.player.PlayerBlockBreakEvents; import net.fabricmc.fabric.api.event.player.PlayerBlockBreakEvents;
import net.fabricmc.fabric.api.registry.FabricBrewingRecipeRegistryBuilder;
import net.fabricmc.fabric.api.renderer.v1.Renderer; import net.fabricmc.fabric.api.renderer.v1.Renderer;
import net.minecraft.item.Items;
import net.minecraft.potion.Potions;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -44,5 +48,10 @@ public class AcesBS implements ModInitializer {
PlayerBlockBreakEvents.BEFORE.register(new HammerUsageEvent()); PlayerBlockBreakEvents.BEFORE.register(new HammerUsageEvent());
AttackEntityCallback.EVENT.register(new YouMonsterEvent()); AttackEntityCallback.EVENT.register(new YouMonsterEvent());
FabricBrewingRecipeRegistryBuilder.BUILD.register(builder -> {
builder.registerPotionRecipe(Potions.AWKWARD, ModItems.LEMON, ModPotions.LEMON);
builder.registerPotionRecipe(Potions.AWKWARD, Items.SAND, ModPotions.BLINDNESS);
});
} }
} }
@@ -1,9 +1,14 @@
package com.acethewildfire.acesbs.effect; package com.acethewildfire.acesbs.effect;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.render.BackgroundRenderer;
import net.minecraft.client.render.RenderTickCounter;
import net.minecraft.entity.LivingEntity; import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.effect.StatusEffect; import net.minecraft.entity.effect.StatusEffect;
import net.minecraft.entity.effect.StatusEffectCategory; import net.minecraft.entity.effect.StatusEffectCategory;
import static net.minecraft.client.render.BackgroundRenderer.applyFog;
public class LemonEffect extends StatusEffect { public class LemonEffect extends StatusEffect {
public LemonEffect(StatusEffectCategory category, int color) { public LemonEffect(StatusEffectCategory category, int color) {
super(category, color); super(category, color);
@@ -5,6 +5,7 @@ import com.acethewildfire.acesbs.item.custom.HammerItem;
import com.acethewildfire.acesbs.item.custom.ModArmorItem; import com.acethewildfire.acesbs.item.custom.ModArmorItem;
import com.acethewildfire.acesbs.item.custom.OracleLemon; import com.acethewildfire.acesbs.item.custom.OracleLemon;
import com.acethewildfire.acesbs.item.custom.Wand; import com.acethewildfire.acesbs.item.custom.Wand;
import com.acethewildfire.acesbs.potion.ModPotions;
import com.acethewildfire.acesbs.sounds.ModSounds; import com.acethewildfire.acesbs.sounds.ModSounds;
import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.gui.screen.Screen;
import net.minecraft.component.DataComponentTypes; import net.minecraft.component.DataComponentTypes;
@@ -24,8 +25,7 @@ import net.minecraft.util.Identifier;
import java.util.List; import java.util.List;
public class ModItems { public class ModItems {
private static final RegistryEntry<Potion> BLINDNESS = registerPotion("blindness", new Potion(new StatusEffectInstance(StatusEffects.BLINDNESS, 200))); public static final Item ORACLE_LEMON = registerItem("oracle_lemon", new OracleLemon(new Item.Settings().component(DataComponentTypes.POTION_CONTENTS, new PotionContentsComponent(ModPotions.LEMON))));
public static final Item ORACLE_LEMON = registerItem("oracle_lemon", new OracleLemon(new Item.Settings().component(DataComponentTypes.POTION_CONTENTS, new PotionContentsComponent(BLINDNESS))));
public static final Item WAND = registerItem("wand", new Wand(new Item.Settings().maxDamage(32))); public static final Item WAND = registerItem("wand", new Wand(new Item.Settings().maxDamage(32)));
public static final Item RAW_ENTROPY = registerItem("raw_entropy", new Item(new Item.Settings())); public static final Item RAW_ENTROPY = registerItem("raw_entropy", new Item(new Item.Settings()));
public static final Item STABLE_ENTROPY = registerItem("stable_entropy", new Item(new Item.Settings())); public static final Item STABLE_ENTROPY = registerItem("stable_entropy", new Item(new Item.Settings()));
@@ -122,10 +122,6 @@ public class ModItems {
return Registry.register(Registries.ITEM, Identifier.of(AcesBS.MOD_ID, name), item); return Registry.register(Registries.ITEM, Identifier.of(AcesBS.MOD_ID, name), item);
} }
private static RegistryEntry<Potion> registerPotion(String name, Potion potion){
return Registry.registerReference(Registries.POTION, Identifier.of(AcesBS.MOD_ID, name), potion);
}
public static void registerModItems() { public static void registerModItems() {
AcesBS.LOGGER.info("Registering Mod Items for " + AcesBS.MOD_ID); AcesBS.LOGGER.info("Registering Mod Items for " + AcesBS.MOD_ID);
@@ -0,0 +1,25 @@
package com.acethewildfire.acesbs.potion;
import com.acethewildfire.acesbs.AcesBS;
import com.acethewildfire.acesbs.effect.ModEffects;
import net.minecraft.entity.effect.StatusEffectInstance;
import net.minecraft.entity.effect.StatusEffects;
import net.minecraft.potion.Potion;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.registry.entry.RegistryEntry;
import net.minecraft.util.Identifier;
public class ModPotions {
public static final RegistryEntry<Potion> BLINDNESS = registerPotion("blindness", new Potion(new StatusEffectInstance(StatusEffects.BLINDNESS, 1200, 0)));
public static final RegistryEntry<Potion> LEMON = registerPotion("lemon", new Potion(new StatusEffectInstance(ModEffects.LEMON, 1200, 0)));
private static RegistryEntry<Potion> registerPotion(String name, Potion potion){
return Registry.registerReference(Registries.POTION, Identifier.of(AcesBS.MOD_ID, name), potion);
}
public static void registerPotions(){
AcesBS.LOGGER.info("Registering Mod Potions for " + AcesBS.MOD_ID);
}
}
@@ -14,10 +14,10 @@
"item.minecraft.tipped_arrow.effect.blindness": "Arrow of Blindness", "item.minecraft.tipped_arrow.effect.blindness": "Arrow of Blindness",
"effect.acesbs.lemon": "Puckered", "effect.acesbs.lemon": "Puckered",
"item.acesbs.potion.effect.lemon": "Potion of Puckered", "item.minecraft.potion.effect.lemon": "Potion of Puckered",
"item.acesbs.splash_potion.effect.lemon": "Splash Potion of Puckered", "item.minecraft.splash_potion.effect.lemon": "Splash Potion of Puckered",
"item.acesbs.lingering_potion.effect.lemon": "Lingering Potion of Puckered", "item.minecraft.lingering_potion.effect.lemon": "Lingering Potion of Puckered",
"item.acesbs.tipped_arrow.effect.lemon": "Arrow of Puckered", "item.minecraft.tipped_arrow.effect.lemon": "Arrow of Puckered",
"item.acesbs.prisma_steel": "Prisma Steel", "item.acesbs.prisma_steel": "Prisma Steel",
"item.acesbs.prisma_steel_sword": "Prisma Steel Sword", "item.acesbs.prisma_steel_sword": "Prisma Steel Sword",