Fix players being affected by velocity inside on the spawn island
This commit is contained in:
parent
09300b499f
commit
02ffec8618
@ -1,6 +1,7 @@
|
||||
package nautilus.game.arcade.game.modules.training;
|
||||
|
||||
import mineplex.core.command.CommandCenter;
|
||||
import mineplex.core.common.events.EntityVelocityChangeEvent;
|
||||
import mineplex.core.common.util.*;
|
||||
import mineplex.core.itemstack.ItemBuilder;
|
||||
import mineplex.core.recharge.Recharge;
|
||||
@ -302,6 +303,24 @@ public class TrainingGameModule extends Module
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void entityVelocity(EntityVelocityChangeEvent event)
|
||||
{
|
||||
Entity entity = event.getEntity();
|
||||
|
||||
if (!(entity instanceof Player))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Player player = (Player) entity;
|
||||
|
||||
if (!_damageFunction.apply(player))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void giveReturnToSpawn(UpdateEvent event)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user