Skip to content

Commit

Permalink
fix(utils): fix EffectUtils getEffect function
Browse files Browse the repository at this point in the history
  • Loading branch information
WakelessSloth56 committed May 12, 2022
1 parent 1ec873f commit f670f4d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Expand Up @@ -44,7 +44,7 @@ static Optional<MobEffect> getEffect(String id) {

@Nonnull
static MobEffect getEffectOrElseThrow(ResourceLocation id) {
return Optional.ofNullable(ForgeRegistries.MOB_EFFECTS.getValue(id)).orElseThrow(RegistryEntryException.UNKNOWN_MOB_EFFECT.create(id.toString()));
return getEffect(id).orElseThrow(RegistryEntryException.UNKNOWN_MOB_EFFECT.create(id.toString()));
}

@Nonnull
Expand Down
Expand Up @@ -8,11 +8,11 @@
import net.minecraftforge.registries.ForgeRegistries;

public interface EnchUtils {

static Enchantment getEnchantment(String id) {
return ForgeRegistries.ENCHANTMENTS.getValue(new ResourceLocation(id));
}


static void enchantOne(ListTag enchantments, int index, int level) {
CompoundTag nbt = enchantments.getCompound(index);
nbt.putShort("lvl", (short) (nbt.getShort("lvl") + level));
Expand Down

0 comments on commit f670f4d

Please sign in to comment.