mirror of
https://github.com/TotalFreedomMC/TF-WorldGuardExtraFlagsPlugin.git
synced 2024-06-16 00:11:20 +00:00
Don't supress potion effect removal if diff amplifier
This commit is contained in:
parent
c2a0b0fd32
commit
be129516c7
|
@ -84,12 +84,8 @@ public class GiveEffectsFlagHandler extends HandlerWrapper
|
||||||
private void check(Player player, ApplicableRegionSet set)
|
private void check(Player player, ApplicableRegionSet set)
|
||||||
{
|
{
|
||||||
Set<PotionEffect> potionEffects = WorldGuardUtils.queryValue(player, player.getWorld(), set.getRegions(), Flags.GIVE_EFFECTS);
|
Set<PotionEffect> potionEffects = WorldGuardUtils.queryValue(player, player.getWorld(), set.getRegions(), Flags.GIVE_EFFECTS);
|
||||||
|
|
||||||
|
|
||||||
if (potionEffects != null && potionEffects.size() > 0)
|
if (potionEffects != null && potionEffects.size() > 0)
|
||||||
{
|
{
|
||||||
this.supressRemovePotionPacket = true;
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
for (PotionEffect effect : potionEffects)
|
for (PotionEffect effect : potionEffects)
|
||||||
|
@ -104,6 +100,8 @@ public class GiveEffectsFlagHandler extends HandlerWrapper
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.supressRemovePotionPacket = effect_ != null && effect_.getAmplifier() == effect.getAmplifier();
|
||||||
|
|
||||||
if (this.givenEffects.add(effect.getType()) && effect_ != null)
|
if (this.givenEffects.add(effect.getType()) && effect_ != null)
|
||||||
{
|
{
|
||||||
this.removedEffects.put(effect_.getType(), new PotionEffectDetails(System.nanoTime() + (long)(effect_.getDuration() / 20D * TimeUnit.SECONDS.toNanos(1L)), effect_.getAmplifier(), effect_.isAmbient(), SupportedFeatures.isPotionEffectParticles() ? effect_.hasParticles() : true));
|
this.removedEffects.put(effect_.getType(), new PotionEffectDetails(System.nanoTime() + (long)(effect_.getDuration() / 20D * TimeUnit.SECONDS.toNanos(1L)), effect_.getAmplifier(), effect_.isAmbient(), SupportedFeatures.isPotionEffectParticles() ? effect_.hasParticles() : true));
|
||||||
|
|
Loading…
Reference in a new issue