Skip to content

Commit

Permalink
remove unused import and create directory command
Browse files Browse the repository at this point in the history
  • Loading branch information
meyason committed Oct 18, 2024
1 parent 2fcf6f6 commit 532719d
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 18 deletions.
4 changes: 0 additions & 4 deletions src/main/java/space/yurisi/universecorev2/item/gun/F2.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
package space.yurisi.universecorev2.item.gun;

import org.bukkit.Sound;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import space.yurisi.universecorev2.subplugins.universeguns.constants.GunType;

import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.inventory.ItemStack;
import space.yurisi.universecorev2.subplugins.universeguns.constants.GunType;

public final class F2 extends Gun {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import space.yurisi.universecorev2.UniverseCoreV2API;
import space.yurisi.universecorev2.database.DatabaseManager;
import space.yurisi.universecorev2.subplugins.SubPlugin;
import space.yurisi.universecorev2.subplugins.universeguns.core.GunCommand;
import space.yurisi.universecorev2.subplugins.universeguns.command.GunCommand;
import space.yurisi.universecorev2.subplugins.universeguns.event.GunEvent;
import space.yurisi.universecorev2.subplugins.universeguns.connector.UniverseCoreAPIConnector;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package space.yurisi.universecorev2.subplugins.universeguns.core;
package space.yurisi.universecorev2.subplugins.universeguns.command;

import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
Expand Down Expand Up @@ -26,7 +26,7 @@ public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command
AmmoManagerInventoryMenu ammoManagerInventoryMenu = new AmmoManagerInventoryMenu(connector);
ammoManagerInventoryMenu.sendMenu(player);

Message.sendSuccessMessage(player, "[武器AI]", "弾薬管理メニューを開きました");
// Message.sendSuccessMessage(player, "[武器AI]", "弾薬管理メニューを開きました");
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import org.bukkit.persistence.PersistentDataType;
import org.bukkit.plugin.Plugin;
import org.bukkit.scheduler.BukkitRunnable;
import org.bukkit.scoreboard.Team;
import org.bukkit.util.Vector;
import space.yurisi.universecorev2.UniverseCoreV2;
import space.yurisi.universecorev2.constants.UniverseItemKeyString;
Expand Down Expand Up @@ -299,7 +298,6 @@ public void onPlayerHit(EntityDamageByEntityEvent event) {
// livingEntity.setHealth(newHealth);
event.setDamage(damage);
projectileData.remove(snowball);
// TODO: ヒットエフェクト
} else {
livingEntity.setMaximumNoDamageTicks(10);
livingEntity.setNoDamageTicks(10);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,11 @@ public void run() {

private Vector SpreadProjectile(Vector direction, Gun gun) {
double spread = gun.getSpread();
spread /= 5.0;
Random random = new Random();
double spreadX = (random.nextDouble() - 0.5) * spread;
double spreadY = (random.nextDouble() - 0.5) * spread;
double spreadZ = (random.nextDouble() - 0.5) * spread;
double spreadX = random.nextGaussian() * spread;
double spreadY = random.nextGaussian() * spread;
double spreadZ = random.nextGaussian() * spread;
return direction.add(new Vector(spreadX, spreadY, spreadZ)).normalize();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
package space.yurisi.universecorev2.subplugins.universeguns.event;

import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.Location;
import org.bukkit.entity.Snowball;
import org.bukkit.scheduler.BukkitRunnable;
import org.bukkit.util.Vector;
import space.yurisi.universecorev2.UniverseCoreV2;
import space.yurisi.universecorev2.item.gun.Gun;
import space.yurisi.universecorev2.subplugins.universeguns.constants.GunType;
import space.yurisi.universecorev2.subplugins.universeguns.core.GunStatus;

import java.util.ArrayList;
Expand Down Expand Up @@ -41,7 +38,7 @@ public ShotgunShot(Player player, Gun gun, GunStatus gunStatus, ArrayList<Player


for (int i = 0; i < bulletNumber; i++) {
Vector spreadDirection = SpreadProjectile(direction.clone(), gun, spread);
Vector spreadDirection = SpreadProjectile(direction.clone(), spread);
Vector velocity = spreadDirection.multiply(gun.getBulletSpeed());
Snowball projectile = player.launchProjectile(Snowball.class, velocity);
// projectile.setGravity(false);
Expand All @@ -59,7 +56,7 @@ public void run() {

}

private Vector SpreadProjectile(Vector direction, Gun gun, double spread) {
private Vector SpreadProjectile(Vector direction, double spread) {
Random random = new Random();
double spreadX = random.nextGaussian() * spread;
double spreadY = random.nextGaussian() * spread;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.inventory.PlayerInventory;
import org.bukkit.util.RayTraceResult;
import org.bukkit.util.Vector;
import space.yurisi.universecorev2.item.gun.Gun;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package space.yurisi.universecorev2.subplugins.universeguns.menu;

import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import space.yurisi.universecorev2.exception.AmmoNotFoundException;
Expand Down Expand Up @@ -30,6 +31,8 @@ public void sendMenu(Player player) {
this.connector.AmmoDataInit(player);
}

player.playSound(player.getLocation(), Sound.BLOCK_BARREL_OPEN, 1, 1);

Item border = new SimpleItem(new ItemBuilder(Material.BLACK_STAINED_GLASS_PANE));
Item iron1 = new SimpleItem(new ItemBuilder(Material.IRON_INGOT).setAmount(1));
Item iron2 = new SimpleItem(new ItemBuilder(Material.IRON_INGOT).setAmount(2));
Expand Down

0 comments on commit 532719d

Please sign in to comment.