diff --git a/src/main/java/space/yurisi/universecorev2/item/gun/RPG.java b/src/main/java/space/yurisi/universecorev2/item/gun/RPG.java index addd691e..48e20e50 100644 --- a/src/main/java/space/yurisi/universecorev2/item/gun/RPG.java +++ b/src/main/java/space/yurisi/universecorev2/item/gun/RPG.java @@ -32,7 +32,7 @@ public RPG() { this.weight = 0.10F; this.fireRate = 60; this.recoil = 1; - this.spread = 5.0D; + this.spread = 0.5D; this.bulletNumber = 1; this.bulletSpeed = 2.0D; this.isJumpEnabled = false; diff --git a/src/main/java/space/yurisi/universecorev2/subplugins/universeguns/event/GunEvent.java b/src/main/java/space/yurisi/universecorev2/subplugins/universeguns/event/GunEvent.java index 49dc2b0b..0cf85d33 100644 --- a/src/main/java/space/yurisi/universecorev2/subplugins/universeguns/event/GunEvent.java +++ b/src/main/java/space/yurisi/universecorev2/subplugins/universeguns/event/GunEvent.java @@ -14,7 +14,9 @@ import org.bukkit.event.entity.ProjectileHitEvent; import org.bukkit.event.inventory.InventoryClickEvent; import org.bukkit.event.player.*; +import org.bukkit.inventory.EquipmentSlot; import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.Damageable; import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.persistence.PersistentDataContainer; import org.bukkit.persistence.PersistentDataType; @@ -57,6 +59,10 @@ public GunEvent(Plugin plugin) { public void onPlayerInteract(PlayerInteractEvent event) { Player player = event.getPlayer(); Action action = event.getAction(); + // オフハンドのイベントの場合は無視 + if (event.getHand() != EquipmentSlot.HAND) { + return; + } ItemStack itemInHand = player.getInventory().getItemInMainHand(); ItemMeta meta = itemInHand.getItemMeta(); if (!itemInHand.hasItemMeta()) { @@ -122,6 +128,7 @@ public void run() { if (gunStatus.getCurrentAmmo() == 0) { break; } + new BukkitRunnable() { @Override public void run() { @@ -161,7 +168,7 @@ public void run() { player.getWorld().playSound(player.getLocation(), Sound.BLOCK_COPPER_DOOR_CLOSE, 1.0F, 0.6F); } } - }.runTaskLater(plugin, gun.getFireRate()); + }.runTaskLater(plugin, gun.getFireRate() - 5); } else { isShooting.put(player, false);