mirror of
https://github.com/Sollace/Unicopia.git
synced 2025-02-20 03:44:23 +01:00
Fix crash when opening the creative inventory
This commit is contained in:
parent
e3a8d0cd13
commit
2620ac5de1
1 changed files with 5 additions and 3 deletions
|
@ -1,5 +1,7 @@
|
||||||
package com.minelittlepony.unicopia.ability.magic.spell.effect;
|
package com.minelittlepony.unicopia.ability.magic.spell.effect;
|
||||||
|
|
||||||
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
import com.google.common.base.Suppliers;
|
import com.google.common.base.Suppliers;
|
||||||
|
@ -103,7 +105,7 @@ public final class SpellType<T extends Spell> implements Affine, SpellPredicate<
|
||||||
private final CustomisedSpellType<T> traited;
|
private final CustomisedSpellType<T> traited;
|
||||||
private final SpellTraits traits;
|
private final SpellTraits traits;
|
||||||
|
|
||||||
private final ItemStack defaultStack;
|
private final Supplier<ItemStack> defaultStack;
|
||||||
|
|
||||||
private final TooltipFactory tooltipFunction;
|
private final TooltipFactory tooltipFunction;
|
||||||
|
|
||||||
|
@ -118,7 +120,7 @@ public final class SpellType<T extends Spell> implements Affine, SpellPredicate<
|
||||||
this.traits = traits;
|
this.traits = traits;
|
||||||
this.stackable = stackable;
|
this.stackable = stackable;
|
||||||
traited = new CustomisedSpellType<>(this, traits, SpellTraits::empty);
|
traited = new CustomisedSpellType<>(this, traits, SpellTraits::empty);
|
||||||
defaultStack = EnchantableItem.enchant(UItems.GEMSTONE.getDefaultStack(), this);
|
defaultStack = Suppliers.memoize(() -> EnchantableItem.enchant(UItems.GEMSTONE.getDefaultStack(), this));
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isObtainable() {
|
public boolean isObtainable() {
|
||||||
|
@ -134,7 +136,7 @@ public final class SpellType<T extends Spell> implements Affine, SpellPredicate<
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemStack getDefualtStack() {
|
public ItemStack getDefualtStack() {
|
||||||
return defaultStack;
|
return defaultStack.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue