WeaponMachineGun: Store updated numFiredBullets
This commit is contained in:
parent
756f89b283
commit
b616612b07
|
@ -110,9 +110,13 @@ public final class WeaponMachineGun implements Listener {
|
|||
while (iterator.hasNext()) {
|
||||
final Entry<UUID, Integer> entry = iterator.next();
|
||||
final UUID playerUUID = entry.getKey();
|
||||
final Player player = Bukkit.getPlayer(playerUUID);
|
||||
int numFiredBullets = entry.getValue();
|
||||
|
||||
final Player player = Bukkit.getPlayer(playerUUID);
|
||||
if (player == null) {
|
||||
iterator.remove();
|
||||
}
|
||||
|
||||
final Location eyeLocation = player.getEyeLocation();
|
||||
final World world = player.getWorld();
|
||||
final Vector velocity = eyeLocation.getDirection().multiply(12);
|
||||
|
@ -134,6 +138,7 @@ public final class WeaponMachineGun implements Listener {
|
|||
);
|
||||
|
||||
numFiredBullets++;
|
||||
machineGunActive.put(playerUUID, numFiredBullets);
|
||||
|
||||
if (numFiredBullets >= MAX_BULLET_COUNT) {
|
||||
iterator.remove();
|
||||
|
|
Loading…
Reference in New Issue