Skip to content

Commit

Permalink
1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Starexify committed Oct 28, 2024
1 parent 9653a85 commit 1f2521c
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/main/java/net/nova/nmt/init/NMTItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
public class NMTItems {
public static final DeferredRegister.Items ITEMS = DeferredRegister.createItems(MODID);

// Obsidian Bottle
public static DeferredItem<Item> OBSIDIAN_GLASS_BOTTLE = ITEMS.register("obsidian_glass_bottle", () -> new ObsidianBottleItem(new Item.Properties().fireResistant()));
/// Obsidian Potions
public static DeferredItem<Item> LAVA_BOTTLE = ITEMS.register("lava_bottle", () -> new ObsidianPotionItem(new Item.Properties().stacksTo(1).component(DataComponents.POTION_CONTENTS, new PotionContents(NMTPotions.LAVA)).fireResistant()));
public static DeferredItem<Item> AWFULLY_POTION = ITEMS.register("awfully_potion", () -> new ObsidianPotionItem(new Item.Properties().stacksTo(1).fireResistant()));
public static DeferredItem<Item> AWFULLY_POTION = ITEMS.register("awfully_potion", () -> new ObsidianPotionItem(new Item.Properties().stacksTo(1).component(DataComponents.POTION_CONTENTS, new PotionContents(NMTPotions.AWFULLY)).fireResistant()));
}
16 changes: 14 additions & 2 deletions src/main/java/net/nova/nmt/init/NMTPotions.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import net.minecraft.core.Holder;
import net.minecraft.core.registries.Registries;
import net.minecraft.world.effect.MobEffectInstance;
import net.minecraft.world.flag.FeatureFlagSet;
import net.minecraft.world.item.alchemy.Potion;
import net.neoforged.neoforge.registries.DeferredRegister;

Expand All @@ -11,6 +12,17 @@
public class NMTPotions {
public static final DeferredRegister<Potion> POTIONS = DeferredRegister.create(Registries.POTION, MODID);

public static final Holder<Potion> AWFULLY = POTIONS.register("awfully", () -> new Potion());
public static final Holder<Potion> LAVA = POTIONS.register("lava", () -> new Potion(new MobEffectInstance(NMTEffects.BURN, 900)));
public static final Holder<Potion> AWFULLY = registerPotion("awfully");

public static final Holder<Potion> LAVA = registerPotion("lava", new MobEffectInstance(NMTEffects.BURN, 900));

// Method
public static Holder<Potion> registerPotion(String name, MobEffectInstance... effects) {
return POTIONS.register(name, () -> new Potion(effects) {
@Override
public boolean isEnabled(FeatureFlagSet enabledFeatures) {
return false;
}
});
}
}
11 changes: 11 additions & 0 deletions src/main/java/net/nova/nmt/util/NMTPotion.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package net.nova.nmt.util;

import net.minecraft.world.flag.FeatureFlagSet;
import net.minecraft.world.item.alchemy.Potion;

public class NMTPotion extends Potion {
@Override
public boolean isEnabled(FeatureFlagSet enabledFeatures) {
return false;
}
}

0 comments on commit 1f2521c

Please sign in to comment.