mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-06-17 14:21:33 +00:00
Fixed PotionEffect was adding asynchronously
This commit is contained in:
@@ -8,6 +8,7 @@ import lombok.AllArgsConstructor;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Particle;
|
import org.bukkit.Particle;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
@@ -231,7 +232,13 @@ public class IrisEffect
|
|||||||
|
|
||||||
J.sr(() -> {
|
J.sr(() -> {
|
||||||
p.playSound(part, getSound(), (float) volume, (float) RNG.r.d(minPitch, maxPitch));
|
p.playSound(part, getSound(), (float) volume, (float) RNG.r.d(minPitch, maxPitch));
|
||||||
|
Iris.instance.getLogger().info("§bPlayer Location: " +
|
||||||
|
p.getLocation().getBlockX() + " " + p.getLocation().getBlockY() + " " + p.getLocation().getBlockZ() +
|
||||||
|
" Sound Location: " + part.getBlockX() + " " + part.getBlockY() + " " + part.getBlockZ() +
|
||||||
|
" Sound's Name: " + getSound().name());
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
Bukkit.getConsoleSender().sendMessage("Sound is null :(");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(particleEffect != null)
|
if(particleEffect != null)
|
||||||
@@ -275,10 +282,18 @@ public class IrisEffect
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
p.removePotionEffect(getRealType());
|
J.sr(() -> {
|
||||||
|
p.removePotionEffect(getRealType());
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
p.addPotionEffect(new PotionEffect(getRealType(), RNG.r.i(Math.min(potionTicksMax, potionTicksMin), Math.max(potionTicksMax, potionTicksMin)), getPotionStrength(), true, false, false));
|
J.sr(() -> {
|
||||||
|
p.addPotionEffect(new PotionEffect(getRealType(),
|
||||||
|
RNG.r.i(Math.min(potionTicksMax, potionTicksMin),
|
||||||
|
Math.max(potionTicksMax, potionTicksMin)),
|
||||||
|
getPotionStrength(),
|
||||||
|
true, false, false));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user