添加强制删除激光的方法
This commit is contained in:
parent
c2b3f29e7b
commit
dd1f63cf05
1 changed files with 10 additions and 0 deletions
|
@ -1,6 +1,8 @@
|
|||
package com.atsuishio.superbwarfare.event;
|
||||
|
||||
import com.atsuishio.superbwarfare.ModUtils;
|
||||
import com.atsuishio.superbwarfare.capability.LaserCapability;
|
||||
import com.atsuishio.superbwarfare.capability.ModCapabilities;
|
||||
import com.atsuishio.superbwarfare.config.common.GameplayConfig;
|
||||
import com.atsuishio.superbwarfare.entity.ICannonEntity;
|
||||
import com.atsuishio.superbwarfare.entity.TargetEntity;
|
||||
|
@ -80,6 +82,10 @@ public class LivingEventHandler {
|
|||
handlePlayerKillEntity(event);
|
||||
handlePlayerDeathDropAmmo(event.getEntity());
|
||||
giveKillExpToWeapon(event);
|
||||
|
||||
if (event.getEntity() instanceof Player player) {
|
||||
handlePlayerBeamReset(player);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -725,4 +731,8 @@ public class LivingEventHandler {
|
|||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
|
||||
public static void handlePlayerBeamReset(Player player) {
|
||||
player.getCapability(ModCapabilities.LASER_CAPABILITY).ifPresent(LaserCapability.ILaserCapability::end);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue