mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-17 10:55:17 +00:00
tweak prev
This commit is contained in:
1 parent
ce30444ba7
commit
545abdd923
1 file changed
+2
-18
@@ -24,7 +24,6 @@ import vazkii.botania.common.item.ModItems;
|
||||
public class ItemWaterRing extends ItemBauble implements IManaUsingItem {
|
||||
|
||||
private static final int COST = 3;
|
||||
private static final int MAGIC_AMPLIFIER = 123;
|
||||
|
||||
public ItemWaterRing(Properties props) {
|
||||
super(props);
|
||||
@@ -51,27 +50,12 @@ public class ItemWaterRing extends ItemBauble implements IManaUsingItem {
|
||||
|
||||
private static void addEffect(LivingEntity living, Effect effect) {
|
||||
EffectInstance inst = living.getActivePotionEffect(effect);
|
||||
if (inst == null) {
|
||||
EffectInstance neweffect = new EffectInstance(effect, Short.MAX_VALUE, MAGIC_AMPLIFIER, true, true);
|
||||
if (inst == null || (inst.getAmplifier() == 0 && inst.getDuration() == 1)) {
|
||||
EffectInstance neweffect = new EffectInstance(effect, 100, 0, true, true);
|
||||
living.addPotionEffect(neweffect);
|
||||
}
|
||||
}
|
||||
|
||||
private static void removeEffect(LivingEntity living, Effect effect) {
|
||||
EffectInstance inst = living.getActivePotionEffect(effect);
|
||||
if (inst != null && inst.getAmplifier() == MAGIC_AMPLIFIER) {
|
||||
living.removePotionEffect(effect);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUnequipped(ItemStack stack, LivingEntity living) {
|
||||
if (!living.world.isRemote) {
|
||||
removeEffect(living, Effects.CONDUIT_POWER);
|
||||
removeEffect(living, Effects.DOLPHINS_GRACE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean usesMana(ItemStack stack) {
|
||||
return true;
|
||||
|
||||
Reference in new issue
Block a user