mirror of
https://github.com/ColdeZhang/Dominion.git
synced 2025-03-15 12:10:23 +08:00
修复了在1.21中风弹的击退效果无法被拦截的漏洞 #17
This commit is contained in:
parent
99405c3828
commit
72a5a84a65
@ -7,7 +7,7 @@ plugins {
|
||||
}
|
||||
|
||||
group = "cn.lunadeer"
|
||||
version = "2.8.1-beta"
|
||||
version = "2.8.2-beta"
|
||||
|
||||
java {
|
||||
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
|
||||
|
@ -7,6 +7,7 @@ import cn.lunadeer.dominion.dtos.PlayerDTO;
|
||||
import cn.lunadeer.minecraftpluginutils.Common;
|
||||
import cn.lunadeer.minecraftpluginutils.Notification;
|
||||
import cn.lunadeer.minecraftpluginutils.Teleport;
|
||||
import com.destroystokyo.paper.event.entity.EntityKnockbackByEntityEvent;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Tag;
|
||||
@ -790,6 +791,19 @@ public class PlayerEvents implements Listener {
|
||||
checkFlag(dom, Flag.SHOOT, player, event);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST) // shoot - wind_charge knock back
|
||||
public void onWindChargeKnockBack(EntityKnockbackByEntityEvent event) {
|
||||
Entity entity = event.getHitBy();
|
||||
if (!(entity instanceof WindCharge windCharge)) {
|
||||
return;
|
||||
}
|
||||
if (!(windCharge.getShooter() instanceof Player player)) {
|
||||
return;
|
||||
}
|
||||
DominionDTO dom = Cache.instance.getDominionByLoc(windCharge.getLocation());
|
||||
checkFlag(dom, Flag.SHOOT, player, event);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST) // trade
|
||||
public void onTrade(InventoryOpenEvent event) {
|
||||
if (event.getInventory().getType() != InventoryType.MERCHANT) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user