From 6f7a73b07a171a3070e2379718c0358ff1243ed9 Mon Sep 17 00:00:00 2001 From: ShermansWorld <77093412+ShermansWorld@users.noreply.github.com> Date: Sat, 30 Sep 2023 10:52:57 -0400 Subject: [PATCH] refactor/organization --- pom.xml => CrunchSiegeEquipment/pom.xml | 0 .../EquipmentMagazine.java | 2 +- .../GunnerEquipment.java | 9 ++---- .../GunnersCore.java | 29 ++++--------------- .../listeners}/ClickHandler.java | 7 ++++- .../listeners}/RotationHandler.java | 9 +++--- .../projectile}/EntityProjectile.java | 7 +++-- .../projectile}/ExplosiveProjectile.java | 7 +++-- .../projectile}/GunnersProjectile.java | 7 +---- .../projectile}/PotionProjectile.java | 8 ++--- .../src/main/resources/plugin.yml | 2 +- 11 files changed, 33 insertions(+), 54 deletions(-) rename pom.xml => CrunchSiegeEquipment/pom.xml (100%) rename CrunchSiegeEquipment/src/main/java/com/gunners/{GunnersCore => gunnerscore}/EquipmentMagazine.java (87%) rename CrunchSiegeEquipment/src/main/java/com/gunners/{GunnersCore => gunnerscore}/GunnerEquipment.java (97%) rename CrunchSiegeEquipment/src/main/java/com/gunners/{GunnersCore => gunnerscore}/GunnersCore.java (94%) rename CrunchSiegeEquipment/src/main/java/com/gunners/{GunnersCore => gunnerscore/listeners}/ClickHandler.java (99%) rename CrunchSiegeEquipment/src/main/java/com/gunners/{GunnersCore => gunnerscore/listeners}/RotationHandler.java (95%) rename CrunchSiegeEquipment/src/main/java/com/gunners/{GunnersCore => gunnerscore/projectile}/EntityProjectile.java (96%) rename CrunchSiegeEquipment/src/main/java/com/gunners/{GunnersCore => gunnerscore/projectile}/ExplosiveProjectile.java (95%) rename CrunchSiegeEquipment/src/main/java/com/gunners/{GunnersCore => gunnerscore/projectile}/GunnersProjectile.java (54%) rename CrunchSiegeEquipment/src/main/java/com/gunners/{GunnersCore => gunnerscore/projectile}/PotionProjectile.java (94%) diff --git a/pom.xml b/CrunchSiegeEquipment/pom.xml similarity index 100% rename from pom.xml rename to CrunchSiegeEquipment/pom.xml diff --git a/CrunchSiegeEquipment/src/main/java/com/gunners/GunnersCore/EquipmentMagazine.java b/CrunchSiegeEquipment/src/main/java/com/gunners/gunnerscore/EquipmentMagazine.java similarity index 87% rename from CrunchSiegeEquipment/src/main/java/com/gunners/GunnersCore/EquipmentMagazine.java rename to CrunchSiegeEquipment/src/main/java/com/gunners/gunnerscore/EquipmentMagazine.java index 6013062..ef87722 100644 --- a/CrunchSiegeEquipment/src/main/java/com/gunners/GunnersCore/EquipmentMagazine.java +++ b/CrunchSiegeEquipment/src/main/java/com/gunners/gunnerscore/EquipmentMagazine.java @@ -1,4 +1,4 @@ -package com.gunners.GunnersCore; +package com.gunners.gunnerscore; import org.bukkit.Material; import org.bukkit.inventory.ItemStack; diff --git a/CrunchSiegeEquipment/src/main/java/com/gunners/GunnersCore/GunnerEquipment.java b/CrunchSiegeEquipment/src/main/java/com/gunners/gunnerscore/GunnerEquipment.java similarity index 97% rename from CrunchSiegeEquipment/src/main/java/com/gunners/GunnersCore/GunnerEquipment.java rename to CrunchSiegeEquipment/src/main/java/com/gunners/gunnerscore/GunnerEquipment.java index d93e842..abef3d4 100644 --- a/CrunchSiegeEquipment/src/main/java/com/gunners/GunnersCore/GunnerEquipment.java +++ b/CrunchSiegeEquipment/src/main/java/com/gunners/gunnerscore/GunnerEquipment.java @@ -1,25 +1,22 @@ -package com.gunners.GunnersCore; +package com.gunners.gunnerscore; import java.util.ArrayList; import java.util.HashMap; import java.util.List; -import java.util.Random; import java.util.UUID; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Particle; -import org.bukkit.Sound; -import org.bukkit.entity.Arrow; import org.bukkit.entity.Entity; -import org.bukkit.entity.EntityType; -import org.bukkit.entity.Firework; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import org.bukkit.util.Vector; +import com.gunners.gunnerscore.projectile.GunnersProjectile; + //import GunnersProjectiles.GunnersProjectile; //import GunnersProjectiles.ExplosiveProjectile; //import me.libraryaddict.disguise.DisguiseAPI; diff --git a/CrunchSiegeEquipment/src/main/java/com/gunners/GunnersCore/GunnersCore.java b/CrunchSiegeEquipment/src/main/java/com/gunners/gunnerscore/GunnersCore.java similarity index 94% rename from CrunchSiegeEquipment/src/main/java/com/gunners/GunnersCore/GunnersCore.java rename to CrunchSiegeEquipment/src/main/java/com/gunners/gunnerscore/GunnersCore.java index 7052f41..9098644 100644 --- a/CrunchSiegeEquipment/src/main/java/com/gunners/GunnersCore/GunnersCore.java +++ b/CrunchSiegeEquipment/src/main/java/com/gunners/gunnerscore/GunnersCore.java @@ -1,48 +1,28 @@ -package com.gunners.GunnersCore; +package com.gunners.gunnerscore; -import java.io.File; -import java.text.DecimalFormat; import java.util.ArrayList; import java.util.Arrays; -import java.util.Collection; -import java.util.HashSet; import java.util.HashMap; import java.util.List; import java.util.Random; import java.util.UUID; import java.util.concurrent.TimeUnit; -import java.util.logging.Level; -import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.NamespacedKey; import org.bukkit.Particle; import org.bukkit.Sound; -import org.bukkit.World; -import org.bukkit.attribute.Attribute; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; -import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.ArmorStand; import org.bukkit.entity.ArmorStand.LockType; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; -import org.bukkit.entity.Horse; import org.bukkit.entity.LivingEntity; -import org.bukkit.entity.Mule; import org.bukkit.entity.Player; -import org.bukkit.entity.Snowball; -import org.bukkit.entity.TNTPrimed; import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.block.Action; -import org.bukkit.event.entity.ProjectileHitEvent; -import org.bukkit.event.inventory.InventoryType.SlotType; -import org.bukkit.event.player.PlayerInteractEntityEvent; -import org.bukkit.event.player.PlayerInteractEvent; -import org.bukkit.event.player.PlayerMoveEvent; import org.bukkit.inventory.EquipmentSlot; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; @@ -51,10 +31,13 @@ import org.bukkit.plugin.Plugin; import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; -import org.bukkit.util.Vector; -import com.comphenix.protocol.wrappers.EnumWrappers.Direction; //import com.palmergames.bukkit.towny.Towny; +import com.gunners.gunnerscore.listeners.ClickHandler; +import com.gunners.gunnerscore.listeners.RotationHandler; +import com.gunners.gunnerscore.projectile.EntityProjectile; +import com.gunners.gunnerscore.projectile.ExplosiveProjectile; +import com.gunners.gunnerscore.projectile.GunnersProjectile; //import GunnersProjectiles.EntityProjectile; //import GunnersProjectiles.GunnersProjectile; diff --git a/CrunchSiegeEquipment/src/main/java/com/gunners/GunnersCore/ClickHandler.java b/CrunchSiegeEquipment/src/main/java/com/gunners/gunnerscore/listeners/ClickHandler.java similarity index 99% rename from CrunchSiegeEquipment/src/main/java/com/gunners/GunnersCore/ClickHandler.java rename to CrunchSiegeEquipment/src/main/java/com/gunners/gunnerscore/listeners/ClickHandler.java index c155378..473b80e 100644 --- a/CrunchSiegeEquipment/src/main/java/com/gunners/GunnersCore/ClickHandler.java +++ b/CrunchSiegeEquipment/src/main/java/com/gunners/gunnerscore/listeners/ClickHandler.java @@ -1,4 +1,4 @@ -package com.gunners.GunnersCore; +package com.gunners.gunnerscore.listeners; import java.util.ArrayList; import java.util.Arrays; @@ -53,6 +53,11 @@ import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; import org.bukkit.util.EulerAngle; +import com.gunners.gunnerscore.EquipmentMagazine; +import com.gunners.gunnerscore.GunnerEquipment; +import com.gunners.gunnerscore.GunnersCore; +import com.gunners.gunnerscore.projectile.ExplosiveProjectile; + //import com.palmergames.bukkit.towny.TownyAPI; //import com.palmergames.bukkit.towny.event.actions.TownyDestroyEvent; //import com.palmergames.bukkit.towny.object.TownBlock; diff --git a/CrunchSiegeEquipment/src/main/java/com/gunners/GunnersCore/RotationHandler.java b/CrunchSiegeEquipment/src/main/java/com/gunners/gunnerscore/listeners/RotationHandler.java similarity index 95% rename from CrunchSiegeEquipment/src/main/java/com/gunners/GunnersCore/RotationHandler.java rename to CrunchSiegeEquipment/src/main/java/com/gunners/gunnerscore/listeners/RotationHandler.java index a4868f4..50d314f 100644 --- a/CrunchSiegeEquipment/src/main/java/com/gunners/GunnersCore/RotationHandler.java +++ b/CrunchSiegeEquipment/src/main/java/com/gunners/gunnerscore/listeners/RotationHandler.java @@ -1,14 +1,11 @@ -package com.gunners.GunnersCore; +package com.gunners.gunnerscore.listeners; -import java.awt.Color; import java.util.UUID; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.NamespacedKey; -import org.bukkit.Particle; -import org.bukkit.block.Block; import org.bukkit.entity.ArmorStand; import org.bukkit.entity.Entity; import org.bukkit.entity.LivingEntity; @@ -18,10 +15,12 @@ import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerMoveEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.persistence.PersistentDataType; -import org.bukkit.util.BlockIterator; import org.bukkit.util.EulerAngle; import org.bukkit.util.Vector; +import com.gunners.gunnerscore.GunnerEquipment; +import com.gunners.gunnerscore.GunnersCore; + public class RotationHandler implements Listener { @EventHandler diff --git a/CrunchSiegeEquipment/src/main/java/com/gunners/GunnersCore/EntityProjectile.java b/CrunchSiegeEquipment/src/main/java/com/gunners/gunnerscore/projectile/EntityProjectile.java similarity index 96% rename from CrunchSiegeEquipment/src/main/java/com/gunners/GunnersCore/EntityProjectile.java rename to CrunchSiegeEquipment/src/main/java/com/gunners/gunnerscore/projectile/EntityProjectile.java index 2e139e6..9e42626 100644 --- a/CrunchSiegeEquipment/src/main/java/com/gunners/GunnersCore/EntityProjectile.java +++ b/CrunchSiegeEquipment/src/main/java/com/gunners/gunnerscore/projectile/EntityProjectile.java @@ -1,4 +1,4 @@ -package com.gunners.GunnersCore; +package com.gunners.gunnerscore.projectile; import org.bukkit.Bukkit; import org.bukkit.Location; @@ -8,11 +8,12 @@ import org.bukkit.World; import org.bukkit.entity.Arrow; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; -import org.bukkit.entity.Fireball; + import org.bukkit.entity.LivingEntity; -import org.bukkit.entity.Player; import org.bukkit.util.Vector; +import com.gunners.gunnerscore.GunnersCore; + public class EntityProjectile implements GunnersProjectile{ diff --git a/CrunchSiegeEquipment/src/main/java/com/gunners/GunnersCore/ExplosiveProjectile.java b/CrunchSiegeEquipment/src/main/java/com/gunners/gunnerscore/projectile/ExplosiveProjectile.java similarity index 95% rename from CrunchSiegeEquipment/src/main/java/com/gunners/GunnersCore/ExplosiveProjectile.java rename to CrunchSiegeEquipment/src/main/java/com/gunners/gunnerscore/projectile/ExplosiveProjectile.java index 51ea35d..21e31b9 100644 --- a/CrunchSiegeEquipment/src/main/java/com/gunners/GunnersCore/ExplosiveProjectile.java +++ b/CrunchSiegeEquipment/src/main/java/com/gunners/gunnerscore/projectile/ExplosiveProjectile.java @@ -1,4 +1,4 @@ -package com.gunners.GunnersCore; +package com.gunners.gunnerscore.projectile; import org.bukkit.Bukkit; import org.bukkit.Location; @@ -9,11 +9,12 @@ import org.bukkit.World; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; import org.bukkit.entity.LivingEntity; -import org.bukkit.entity.Player; import org.bukkit.entity.Snowball; -import org.bukkit.inventory.ItemStack; import org.bukkit.util.Vector; +import com.gunners.gunnerscore.GunnersCore; +import com.gunners.gunnerscore.listeners.ClickHandler; + //import me.libraryaddict.disguise.disguisetypes.DisguiseType; //import me.libraryaddict.disguise.disguisetypes.MiscDisguise; diff --git a/CrunchSiegeEquipment/src/main/java/com/gunners/GunnersCore/GunnersProjectile.java b/CrunchSiegeEquipment/src/main/java/com/gunners/gunnerscore/projectile/GunnersProjectile.java similarity index 54% rename from CrunchSiegeEquipment/src/main/java/com/gunners/GunnersCore/GunnersProjectile.java rename to CrunchSiegeEquipment/src/main/java/com/gunners/gunnerscore/projectile/GunnersProjectile.java index a3162e9..bd1d654 100644 --- a/CrunchSiegeEquipment/src/main/java/com/gunners/GunnersCore/GunnersProjectile.java +++ b/CrunchSiegeEquipment/src/main/java/com/gunners/gunnerscore/projectile/GunnersProjectile.java @@ -1,12 +1,7 @@ -package com.gunners.GunnersCore; +package com.gunners.gunnerscore.projectile; import org.bukkit.Location; -import org.bukkit.Particle; -import org.bukkit.Sound; import org.bukkit.entity.Entity; -import org.bukkit.entity.LivingEntity; -import org.bukkit.entity.Player; -import org.bukkit.plugin.java.JavaPlugin; public interface GunnersProjectile { public void Shoot(Entity player, Entity entity, Location fireLocation, Float velocity); diff --git a/CrunchSiegeEquipment/src/main/java/com/gunners/GunnersCore/PotionProjectile.java b/CrunchSiegeEquipment/src/main/java/com/gunners/gunnerscore/projectile/PotionProjectile.java similarity index 94% rename from CrunchSiegeEquipment/src/main/java/com/gunners/GunnersCore/PotionProjectile.java rename to CrunchSiegeEquipment/src/main/java/com/gunners/gunnerscore/projectile/PotionProjectile.java index 8856241..b7d3858 100644 --- a/CrunchSiegeEquipment/src/main/java/com/gunners/GunnersCore/PotionProjectile.java +++ b/CrunchSiegeEquipment/src/main/java/com/gunners/gunnerscore/projectile/PotionProjectile.java @@ -1,4 +1,4 @@ -package com.gunners.GunnersCore; +package com.gunners.gunnerscore.projectile; import org.bukkit.Bukkit; import org.bukkit.Location; @@ -6,20 +6,18 @@ import org.bukkit.Material; import org.bukkit.Particle; import org.bukkit.Sound; import org.bukkit.World; -import org.bukkit.entity.Arrow; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; import org.bukkit.entity.LivingEntity; -import org.bukkit.entity.Player; -import org.bukkit.entity.SplashPotion; import org.bukkit.entity.ThrownPotion; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.PotionMeta; -import org.bukkit.potion.Potion; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; import org.bukkit.util.Vector; +import com.gunners.gunnerscore.GunnersCore; + public class PotionProjectile implements GunnersProjectile { public String ProjectileType = "Potion"; diff --git a/CrunchSiegeEquipment/src/main/resources/plugin.yml b/CrunchSiegeEquipment/src/main/resources/plugin.yml index 64ababc..c730a43 100644 --- a/CrunchSiegeEquipment/src/main/resources/plugin.yml +++ b/CrunchSiegeEquipment/src/main/resources/plugin.yml @@ -1,5 +1,5 @@ name: GunnersCore -main: com.gunners.GunnersCore.GunnersCore +main: com.gunners.gunnerscore.GunnersCore version: 0.3.0A api-version: 1.19 commands: