From 1f65b1fbf3e092afd454ea42636c0a30a5bd8ac1 Mon Sep 17 00:00:00 2001 From: ImproperIssues Date: Tue, 25 Jul 2023 20:43:25 -0700 Subject: [PATCH] added rail gun --- .../fun/ogre/ogredupealias/OgreDupeAlias.java | 2 + .../commands/commands/ConfigCommand.java | 2 +- .../commands/commands/CustomItemCommand.java | 53 ++++++++++++ .../commands/commands/ForceFieldCommand.java | 2 - .../commands/commands/RanksCommand.java | 1 - .../commands/ShowDonationCommand.java | 6 -- .../events/InteractionListener.java | 1 - .../events/SPBEventListener.java | 4 - .../events/SnowBallListener.java | 8 +- .../events/TurfWarsEventListener.java | 7 +- .../ogredupealias/plugin/ItemPresets.java | 7 ++ .../plugin/custom/forging/CraftingKeys.java | 1 - .../plugin/custom/forging/CustomTable.java | 2 +- .../custom/gui/CustomGUIs/StoreGUI.java | 3 - .../plugin/custom/items/CustomItems.java | 6 ++ .../custom/items/customitems/RailgunItem.java | 81 +++++++++++++++++++ .../ogredupealias/plugin/funitems/AK47.java | 2 - .../plugin/funitems/Defender.java | 8 +- .../plugin/funitems/Pickler.java | 3 - .../plugin/funitems/PotatoCannon.java | 8 +- .../plugin/funitems/SPBItems.java | 9 +-- .../plugin/funitems/SnowChinegun.java | 25 +++--- .../ogre/ogredupealias/utils/ArrayUtils.java | 1 - .../ogredupealias/utils/DisplayUtils.java | 3 - .../ogre/ogredupealias/utils/MathUtils.java | 4 +- .../ogre/ogredupealias/utils/PlayerUtils.java | 1 - src/main/resources/plugin.yml | 4 + 27 files changed, 183 insertions(+), 71 deletions(-) create mode 100644 src/main/java/fun/ogre/ogredupealias/commands/commands/CustomItemCommand.java create mode 100644 src/main/java/fun/ogre/ogredupealias/plugin/custom/items/customitems/RailgunItem.java diff --git a/src/main/java/fun/ogre/ogredupealias/OgreDupeAlias.java b/src/main/java/fun/ogre/ogredupealias/OgreDupeAlias.java index 53426a8..c4767f9 100644 --- a/src/main/java/fun/ogre/ogredupealias/OgreDupeAlias.java +++ b/src/main/java/fun/ogre/ogredupealias/OgreDupeAlias.java @@ -74,6 +74,8 @@ public final class OgreDupeAlias extends JavaPlugin { getCommand("attackcooldown").setTabCompleter(new AttackCooldownCommand()); getCommand("givecustom").setExecutor(new GiveCustomCommand()); getCommand("givecustom").setTabCompleter(new GiveCustomCommand()); + getCommand("customitem").setExecutor(new CustomItemCommand()); + getCommand("customitem").setTabCompleter(new CustomItemCommand()); getCommand("changerank").setExecutor(new ChangeRankCommand()); getCommand("changerank").setTabCompleter(new ChangeRankCommand()); getCommand("showdonation").setExecutor(new ShowDonationCommand()); diff --git a/src/main/java/fun/ogre/ogredupealias/commands/commands/ConfigCommand.java b/src/main/java/fun/ogre/ogredupealias/commands/commands/ConfigCommand.java index d3b1b29..489295b 100644 --- a/src/main/java/fun/ogre/ogredupealias/commands/commands/ConfigCommand.java +++ b/src/main/java/fun/ogre/ogredupealias/commands/commands/ConfigCommand.java @@ -1,7 +1,7 @@ package fun.ogre.ogredupealias.commands.commands; -import fun.ogre.ogredupealias.data.Config; import fun.ogre.ogredupealias.commands.CmdExHandler; +import fun.ogre.ogredupealias.data.Config; import fun.ogre.ogredupealias.data.ConfigDataType; import fun.ogre.ogredupealias.utils.ArrayUtils; import fun.ogre.ogredupealias.utils.Text; diff --git a/src/main/java/fun/ogre/ogredupealias/commands/commands/CustomItemCommand.java b/src/main/java/fun/ogre/ogredupealias/commands/commands/CustomItemCommand.java new file mode 100644 index 0000000..d6e1cfe --- /dev/null +++ b/src/main/java/fun/ogre/ogredupealias/commands/commands/CustomItemCommand.java @@ -0,0 +1,53 @@ +package fun.ogre.ogredupealias.commands.commands; + +import fun.ogre.ogredupealias.commands.CmdExHandler; +import fun.ogre.ogredupealias.commands.TabComplBuilder; +import fun.ogre.ogredupealias.plugin.custom.items.CustomItem; +import fun.ogre.ogredupealias.plugin.custom.items.CustomItems; +import fun.ogre.ogredupealias.utils.StringUtils; +import fun.ogre.ogredupealias.utils.Text; +import org.bukkit.command.Command; +import org.bukkit.command.CommandSender; +import org.bukkit.command.TabExecutor; +import org.bukkit.entity.Player; + +import java.util.List; + +public class CustomItemCommand implements TabExecutor { + + @Override + public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { + try { + String name = args[0]; + CustomItem result = null; + + for (Class item : CustomItems.getRegistries().keySet()) { + if (item.getSimpleName().equalsIgnoreCase(name)) { + result = item.newInstance(); + break; + } + } + + if (result == null) { + sender.sendMessage(Text.ofAll("&cItem not found!")); + } + else { + Player player = (Player)sender; + player.getInventory().addItem(result.getItem()); + sender.sendMessage(Text.ofAll("&dGave one &7" + StringUtils.capitalizeWords(result.getName()))); + } + } + catch (Exception ex) { + CmdExHandler handler = new CmdExHandler(ex, command); + sender.sendMessage(handler.getHelp()); + } + return true; + } + + @Override + public List onTabComplete(CommandSender sender, Command command, String label, String[] args) { + return new TabComplBuilder(sender, command, label, args) + .add(1, CustomItems.getRegistries().keySet().stream().map(item -> item.getSimpleName().toLowerCase()).toList()) + .build(); + } +} diff --git a/src/main/java/fun/ogre/ogredupealias/commands/commands/ForceFieldCommand.java b/src/main/java/fun/ogre/ogredupealias/commands/commands/ForceFieldCommand.java index aae1d9f..2cfecb1 100644 --- a/src/main/java/fun/ogre/ogredupealias/commands/commands/ForceFieldCommand.java +++ b/src/main/java/fun/ogre/ogredupealias/commands/commands/ForceFieldCommand.java @@ -2,8 +2,6 @@ package fun.ogre.ogredupealias.commands.commands; import fun.ogre.ogredupealias.OgreDupeAlias; import fun.ogre.ogredupealias.commands.CmdExHandler; -import fun.ogre.ogredupealias.events.EntityDamageListener; -import fun.ogre.ogredupealias.events.InteractionListener; import fun.ogre.ogredupealias.plugin.RecipientList; import fun.ogre.ogredupealias.utils.DisplayUtils; import fun.ogre.ogredupealias.utils.SoundPlayer; diff --git a/src/main/java/fun/ogre/ogredupealias/commands/commands/RanksCommand.java b/src/main/java/fun/ogre/ogredupealias/commands/commands/RanksCommand.java index 5a707df..660231f 100644 --- a/src/main/java/fun/ogre/ogredupealias/commands/commands/RanksCommand.java +++ b/src/main/java/fun/ogre/ogredupealias/commands/commands/RanksCommand.java @@ -1,7 +1,6 @@ package fun.ogre.ogredupealias.commands.commands; import fun.ogre.ogredupealias.commands.CmdExHandler; -import fun.ogre.ogredupealias.plugin.custom.gui.CustomGUIs.RankChangeGUI; import fun.ogre.ogredupealias.plugin.custom.gui.CustomGUIs.StoreGUI; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; diff --git a/src/main/java/fun/ogre/ogredupealias/commands/commands/ShowDonationCommand.java b/src/main/java/fun/ogre/ogredupealias/commands/commands/ShowDonationCommand.java index acaa117..b0eb48e 100644 --- a/src/main/java/fun/ogre/ogredupealias/commands/commands/ShowDonationCommand.java +++ b/src/main/java/fun/ogre/ogredupealias/commands/commands/ShowDonationCommand.java @@ -4,18 +4,12 @@ import fun.ogre.ogredupealias.commands.CmdExHandler; import fun.ogre.ogredupealias.utils.ArrayUtils; import fun.ogre.ogredupealias.utils.ImageUtils; import fun.ogre.ogredupealias.utils.Text; -import net.md_5.bungee.api.ChatColor; import org.bukkit.Bukkit; -import org.bukkit.Color; import org.bukkit.OfflinePlayer; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.command.TabExecutor; -import org.bukkit.entity.Player; -import javax.imageio.ImageIO; -import java.awt.image.BufferedImage; -import java.net.URL; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/fun/ogre/ogredupealias/events/InteractionListener.java b/src/main/java/fun/ogre/ogredupealias/events/InteractionListener.java index f520705..2bb3b6d 100644 --- a/src/main/java/fun/ogre/ogredupealias/events/InteractionListener.java +++ b/src/main/java/fun/ogre/ogredupealias/events/InteractionListener.java @@ -14,7 +14,6 @@ public class InteractionListener implements Listener { @EventHandler public void onClick(PlayerInteractEvent e) { try { - this.processTable(e); NetSkyBlade.handleNetskyBlade(e); Defender.handleDefender(e); diff --git a/src/main/java/fun/ogre/ogredupealias/events/SPBEventListener.java b/src/main/java/fun/ogre/ogredupealias/events/SPBEventListener.java index 84ef9ef..4ca6944 100644 --- a/src/main/java/fun/ogre/ogredupealias/events/SPBEventListener.java +++ b/src/main/java/fun/ogre/ogredupealias/events/SPBEventListener.java @@ -3,12 +3,8 @@ package fun.ogre.ogredupealias.events; import fun.ogre.ogredupealias.utils.DisplayUtils; import fun.ogre.ogredupealias.utils.PlayerUtils; import fun.ogre.ogredupealias.utils.SoundPlayer; -import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Sound; -import org.bukkit.World; -import org.bukkit.block.data.type.Snow; -import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.entity.Projectile; import org.bukkit.entity.Snowball; diff --git a/src/main/java/fun/ogre/ogredupealias/events/SnowBallListener.java b/src/main/java/fun/ogre/ogredupealias/events/SnowBallListener.java index 9d1a5de..ba318e1 100644 --- a/src/main/java/fun/ogre/ogredupealias/events/SnowBallListener.java +++ b/src/main/java/fun/ogre/ogredupealias/events/SnowBallListener.java @@ -1,23 +1,19 @@ package fun.ogre.ogredupealias.events; import fun.ogre.ogredupealias.OgreDupeAlias; -import fun.ogre.ogredupealias.data.Config; import fun.ogre.ogredupealias.plugin.ItemPresets; import fun.ogre.ogredupealias.utils.ItemUtils; -import fun.ogre.ogredupealias.utils.Text; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.World; -import org.bukkit.entity.*; +import org.bukkit.entity.Player; +import org.bukkit.entity.Snowball; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.block.BlockBreakEvent; -import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.event.entity.ProjectileHitEvent; -import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.inventory.ItemStack; -import org.bukkit.util.Vector; import java.util.Objects; diff --git a/src/main/java/fun/ogre/ogredupealias/events/TurfWarsEventListener.java b/src/main/java/fun/ogre/ogredupealias/events/TurfWarsEventListener.java index 85e2bff..48509bd 100644 --- a/src/main/java/fun/ogre/ogredupealias/events/TurfWarsEventListener.java +++ b/src/main/java/fun/ogre/ogredupealias/events/TurfWarsEventListener.java @@ -1,7 +1,9 @@ package fun.ogre.ogredupealias.events; -import fun.ogre.ogredupealias.plugin.funitems.*; -import fun.ogre.ogredupealias.utils.*; +import fun.ogre.ogredupealias.utils.PlayerUtils; +import fun.ogre.ogredupealias.utils.RaycastUtils; +import fun.ogre.ogredupealias.utils.SoundPlayer; +import fun.ogre.ogredupealias.utils.Text; import org.bukkit.*; import org.bukkit.block.Block; import org.bukkit.block.data.BlockData; @@ -11,7 +13,6 @@ import org.bukkit.event.Listener; import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.event.entity.EntityShootBowEvent; import org.bukkit.event.entity.ProjectileHitEvent; -import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerMoveEvent; import org.bukkit.event.player.PlayerRespawnEvent; import org.bukkit.inventory.ItemStack; diff --git a/src/main/java/fun/ogre/ogredupealias/plugin/ItemPresets.java b/src/main/java/fun/ogre/ogredupealias/plugin/ItemPresets.java index 96c943f..b85790a 100644 --- a/src/main/java/fun/ogre/ogredupealias/plugin/ItemPresets.java +++ b/src/main/java/fun/ogre/ogredupealias/plugin/ItemPresets.java @@ -168,6 +168,13 @@ public abstract class ItemPresets { .customModelData(1111) .build(); + public static ItemStack RAILGUN = ItemBuilder.create() + .material(Material.DIAMOND_HORSE_ARMOR) + .name("Railgun") + .lore(Text.color("&7- Another funny gadget!")) + .customModelData(1111) + .build(); + public static ItemStack BLANK = ItemBuilder.create() .material(Material.LIGHT_GRAY_STAINED_GLASS_PANE) .name(" ") diff --git a/src/main/java/fun/ogre/ogredupealias/plugin/custom/forging/CraftingKeys.java b/src/main/java/fun/ogre/ogredupealias/plugin/custom/forging/CraftingKeys.java index c75b13e..e819e34 100644 --- a/src/main/java/fun/ogre/ogredupealias/plugin/custom/forging/CraftingKeys.java +++ b/src/main/java/fun/ogre/ogredupealias/plugin/custom/forging/CraftingKeys.java @@ -2,7 +2,6 @@ package fun.ogre.ogredupealias.plugin.custom.forging; import fun.ogre.ogredupealias.plugin.ItemPresets; import org.bukkit.Material; -import org.bukkit.entity.Item; import org.bukkit.inventory.ItemStack; import java.util.HashMap; diff --git a/src/main/java/fun/ogre/ogredupealias/plugin/custom/forging/CustomTable.java b/src/main/java/fun/ogre/ogredupealias/plugin/custom/forging/CustomTable.java index 04329d3..1299291 100644 --- a/src/main/java/fun/ogre/ogredupealias/plugin/custom/forging/CustomTable.java +++ b/src/main/java/fun/ogre/ogredupealias/plugin/custom/forging/CustomTable.java @@ -1,7 +1,7 @@ package fun.ogre.ogredupealias.plugin.custom.forging; -import fun.ogre.ogredupealias.utils.ServerUtils; import fun.ogre.ogredupealias.plugin.RecipientList; +import fun.ogre.ogredupealias.utils.ServerUtils; import fun.ogre.ogredupealias.utils.Text; import org.bukkit.Sound; import org.bukkit.entity.Player; diff --git a/src/main/java/fun/ogre/ogredupealias/plugin/custom/gui/CustomGUIs/StoreGUI.java b/src/main/java/fun/ogre/ogredupealias/plugin/custom/gui/CustomGUIs/StoreGUI.java index f4f4c0b..8ce5bb6 100644 --- a/src/main/java/fun/ogre/ogredupealias/plugin/custom/gui/CustomGUIs/StoreGUI.java +++ b/src/main/java/fun/ogre/ogredupealias/plugin/custom/gui/CustomGUIs/StoreGUI.java @@ -8,12 +8,9 @@ import net.md_5.bungee.api.chat.ClickEvent; import net.md_5.bungee.api.chat.TextComponent; import org.bukkit.Material; import org.bukkit.Sound; -import org.bukkit.entity.Item; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; -import java.awt.*; - public final class StoreGUI { public static final ItemStack knightItem = new ItemStack(ItemBuilder.create() .material(Material.LIGHT_BLUE_WOOL) diff --git a/src/main/java/fun/ogre/ogredupealias/plugin/custom/items/CustomItems.java b/src/main/java/fun/ogre/ogredupealias/plugin/custom/items/CustomItems.java index 0133bc2..2745663 100644 --- a/src/main/java/fun/ogre/ogredupealias/plugin/custom/items/CustomItems.java +++ b/src/main/java/fun/ogre/ogredupealias/plugin/custom/items/CustomItems.java @@ -1,6 +1,7 @@ package fun.ogre.ogredupealias.plugin.custom.items; import fun.ogre.ogredupealias.plugin.custom.items.customitems.LazerItem; +import fun.ogre.ogredupealias.plugin.custom.items.customitems.RailgunItem; import fun.ogre.ogredupealias.plugin.custom.items.customitems.TazerItem; import fun.ogre.ogredupealias.utils.ItemUtils; import org.bukkit.event.EventHandler; @@ -19,6 +20,7 @@ public final class CustomItems implements Listener { public static void init() { register(new TazerItem()); register(new LazerItem()); + register(new RailgunItem()); } public static ItemStack register(ItemStack item, CustomItemInteractionCallback interactionCallback) { @@ -32,6 +34,10 @@ public final class CustomItems implements Listener { return item.getItem(); } + public static Map, String> getRegistries() { + return new HashMap<>(namesList); + } + public static void onInteract(ItemStack item, PlayerInteractEvent event) { String nbt = ItemUtils.nbtOf(item); if (callbackList.containsKey(nbt)) { diff --git a/src/main/java/fun/ogre/ogredupealias/plugin/custom/items/customitems/RailgunItem.java b/src/main/java/fun/ogre/ogredupealias/plugin/custom/items/customitems/RailgunItem.java new file mode 100644 index 0000000..c32bad3 --- /dev/null +++ b/src/main/java/fun/ogre/ogredupealias/plugin/custom/items/customitems/RailgunItem.java @@ -0,0 +1,81 @@ +package fun.ogre.ogredupealias.plugin.custom.items.customitems; + +import fun.ogre.ogredupealias.plugin.ItemPresets; +import fun.ogre.ogredupealias.plugin.custom.items.CustomItem; +import fun.ogre.ogredupealias.plugin.custom.items.CustomItemInteractionCallback; +import fun.ogre.ogredupealias.utils.RaycastUtils; +import fun.ogre.ogredupealias.utils.SoundPlayer; +import org.bukkit.*; +import org.bukkit.entity.BlockDisplay; +import org.bukkit.entity.Display; +import org.bukkit.entity.LivingEntity; +import org.bukkit.util.Transformation; +import org.joml.AxisAngle4f; +import org.joml.Vector3f; + +import static fun.ogre.ogredupealias.OgreDupeAlias.instance; + +public class RailgunItem extends CustomItem { + + public RailgunItem() { + super("railgun", ItemPresets.RAILGUN); + } + + @Override + public CustomItemInteractionCallback getCallback() { + return (player, item, event) -> { + Location loc = player.getLocation(); + Location eye = player.getEyeLocation(); + World world = player.getWorld(); + + Location end = RaycastUtils.raycast(eye, loc.getDirection(), 100, 0.5, point -> { + boolean hitBlock = !point.getBlock().isPassable(); + boolean hitEntity = !world.getNearbyEntities(point, 3, 3, 3, entity -> { + return entity instanceof LivingEntity le && !le.isDead() && le != player && le.getBoundingBox().contains(point.toVector()); + }).isEmpty(); + return hitBlock || hitEntity; + }); + Particle.DustOptions dust = new Particle.DustOptions(Color.AQUA, 10F); + world.spawnParticle(Particle.REDSTONE, end, 30, 0, 0, 0, 1, dust); + + float dist = (float)loc.distance(end); + float rad = 0.02F; + AxisAngle4f angle = new AxisAngle4f(0F, 0F, 0F, 1F); + Vector3f translation = new Vector3f(-0.05F, -0.2F, 0F); + + BlockDisplay beam = world.spawn(eye, BlockDisplay.class, entity -> { + SoundPlayer sound = new SoundPlayer(loc, Sound.BLOCK_BEACON_POWER_SELECT, 5.0F, 10.0F); + Vector3f scale = new Vector3f(rad, rad, 0F); + Transformation transformation = new Transformation(translation, angle, scale, angle); + + entity.setBrightness(new Display.Brightness(15, 15)); + entity.setViewRange(dist); + entity.setRotation(eye.getYaw(), eye.getPitch()); + entity.setBlock(Material.DIAMOND_BLOCK.createBlockData()); + entity.setTransformation(transformation); + sound.playWithin(500); + + Bukkit.getScheduler().runTaskLater(instance, entity::remove, 60); + }); + + Bukkit.getScheduler().runTaskLater(instance, () -> { + Vector3f scale = new Vector3f(rad, rad, dist); + Transformation transformation = new Transformation(translation, angle, scale, angle); + + beam.setInterpolationDelay(0); + beam.setInterpolationDuration((int)(dist / 2)); + beam.setTransformation(transformation); + }, 5); + + Bukkit.getScheduler().runTaskLater(instance, () -> { + Vector3f scale = new Vector3f(rad, rad, 0.0F); + Transformation transformation = new Transformation(translation, angle, scale, angle); + + world.createExplosion(end, 3, false, false, player); + beam.setInterpolationDelay(0); + beam.setInterpolationDuration(20); + beam.setTransformation(transformation); + }, 40); + }; + } +} diff --git a/src/main/java/fun/ogre/ogredupealias/plugin/funitems/AK47.java b/src/main/java/fun/ogre/ogredupealias/plugin/funitems/AK47.java index 97aaf7e..4f0b6b9 100644 --- a/src/main/java/fun/ogre/ogredupealias/plugin/funitems/AK47.java +++ b/src/main/java/fun/ogre/ogredupealias/plugin/funitems/AK47.java @@ -7,11 +7,9 @@ import fun.ogre.ogredupealias.utils.RaycastUtils; import fun.ogre.ogredupealias.utils.SoundPlayer; import org.bukkit.*; import org.bukkit.block.data.BlockData; -import org.bukkit.block.data.type.Bed; import org.bukkit.entity.Entity; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; -import org.bukkit.entity.Snowball; import org.bukkit.event.block.Action; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.inventory.ItemStack; diff --git a/src/main/java/fun/ogre/ogredupealias/plugin/funitems/Defender.java b/src/main/java/fun/ogre/ogredupealias/plugin/funitems/Defender.java index a42cb17..4e8be8a 100644 --- a/src/main/java/fun/ogre/ogredupealias/plugin/funitems/Defender.java +++ b/src/main/java/fun/ogre/ogredupealias/plugin/funitems/Defender.java @@ -1,16 +1,16 @@ package fun.ogre.ogredupealias.plugin.funitems; + import fun.ogre.ogredupealias.OgreDupeAlias; -import fun.ogre.ogredupealias.events.EntityDamageListener; import fun.ogre.ogredupealias.plugin.ItemPresets; -import fun.ogre.ogredupealias.utils.*; +import fun.ogre.ogredupealias.utils.ItemUtils; +import fun.ogre.ogredupealias.utils.RaycastUtils; +import fun.ogre.ogredupealias.utils.SoundPlayer; import org.bukkit.*; import org.bukkit.entity.Entity; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; import org.bukkit.event.block.Action; import org.bukkit.event.player.PlayerInteractEvent; -import org.bukkit.event.player.PlayerMoveEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.potion.PotionEffectType; import org.bukkit.util.Vector; diff --git a/src/main/java/fun/ogre/ogredupealias/plugin/funitems/Pickler.java b/src/main/java/fun/ogre/ogredupealias/plugin/funitems/Pickler.java index 92169dd..9371865 100644 --- a/src/main/java/fun/ogre/ogredupealias/plugin/funitems/Pickler.java +++ b/src/main/java/fun/ogre/ogredupealias/plugin/funitems/Pickler.java @@ -8,12 +8,10 @@ import org.bukkit.block.Block; import org.bukkit.block.BlockState; import org.bukkit.block.data.Waterlogged; import org.bukkit.entity.Entity; -import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.block.Action; -import org.bukkit.event.player.PlayerInteractAtEntityEvent; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerMoveEvent; import org.bukkit.inventory.ItemStack; @@ -21,7 +19,6 @@ import org.bukkit.util.Vector; import java.util.ArrayList; import java.util.List; -import java.util.concurrent.atomic.AtomicReference; public class Pickler implements Listener { public static void handlePickler(PlayerInteractEvent e) { diff --git a/src/main/java/fun/ogre/ogredupealias/plugin/funitems/PotatoCannon.java b/src/main/java/fun/ogre/ogredupealias/plugin/funitems/PotatoCannon.java index 3c336ea..c4120df 100644 --- a/src/main/java/fun/ogre/ogredupealias/plugin/funitems/PotatoCannon.java +++ b/src/main/java/fun/ogre/ogredupealias/plugin/funitems/PotatoCannon.java @@ -5,8 +5,6 @@ import fun.ogre.ogredupealias.utils.ItemUtils; import fun.ogre.ogredupealias.utils.RaycastUtils; import fun.ogre.ogredupealias.utils.SoundPlayer; import fun.ogre.ogredupealias.utils.Text; -import net.md_5.bungee.api.ChatMessageType; -import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.entity.Player; @@ -16,11 +14,11 @@ import org.bukkit.event.block.Action; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; -import org.bukkit.util.Vector; -import java.awt.*; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class PotatoCannon implements Listener { diff --git a/src/main/java/fun/ogre/ogredupealias/plugin/funitems/SPBItems.java b/src/main/java/fun/ogre/ogredupealias/plugin/funitems/SPBItems.java index 6a62afe..1b515d0 100644 --- a/src/main/java/fun/ogre/ogredupealias/plugin/funitems/SPBItems.java +++ b/src/main/java/fun/ogre/ogredupealias/plugin/funitems/SPBItems.java @@ -1,18 +1,15 @@ package fun.ogre.ogredupealias.plugin.funitems; -import fun.ogre.ogredupealias.OgreDupeAlias; import fun.ogre.ogredupealias.plugin.ItemPresets; -import fun.ogre.ogredupealias.utils.*; -import org.bukkit.Bukkit; -import org.bukkit.GameMode; -import org.bukkit.Material; +import fun.ogre.ogredupealias.utils.ItemUtils; import fun.ogre.ogredupealias.utils.PlayerUtils; +import fun.ogre.ogredupealias.utils.SoundPlayer; +import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.entity.Player; import org.bukkit.entity.Snowball; import org.bukkit.event.block.Action; import org.bukkit.event.player.PlayerInteractEvent; -import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; import org.bukkit.util.Vector; diff --git a/src/main/java/fun/ogre/ogredupealias/plugin/funitems/SnowChinegun.java b/src/main/java/fun/ogre/ogredupealias/plugin/funitems/SnowChinegun.java index f809587..a7aed75 100644 --- a/src/main/java/fun/ogre/ogredupealias/plugin/funitems/SnowChinegun.java +++ b/src/main/java/fun/ogre/ogredupealias/plugin/funitems/SnowChinegun.java @@ -1,28 +1,21 @@ package fun.ogre.ogredupealias.plugin.funitems; import fun.ogre.ogredupealias.OgreDupeAlias; -import fun.ogre.ogredupealias.events.EntityDamageListener; import fun.ogre.ogredupealias.plugin.ItemPresets; -import fun.ogre.ogredupealias.utils.*; -import org.bukkit.*; -import org.bukkit.entity.*; -import org.bukkit.event.EventHandler; +import fun.ogre.ogredupealias.utils.ItemUtils; +import fun.ogre.ogredupealias.utils.RaycastUtils; +import fun.ogre.ogredupealias.utils.SoundPlayer; +import org.bukkit.Bukkit; +import org.bukkit.GameMode; +import org.bukkit.Material; +import org.bukkit.Sound; +import org.bukkit.entity.Player; +import org.bukkit.entity.Snowball; import org.bukkit.event.block.Action; -import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.event.player.PlayerInteractEvent; -import org.bukkit.event.player.PlayerMoveEvent; -import org.bukkit.event.player.PlayerSwapHandItemsEvent; import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; import org.bukkit.util.Vector; -import org.bukkit.entity.Player; -import org.bukkit.event.player.PlayerInteractEvent; -import org.bukkit.inventory.ItemStack; -import org.bukkit.util.Vector; - -import java.util.Random; - -import static org.bukkit.event.block.Action.*; public class SnowChinegun { diff --git a/src/main/java/fun/ogre/ogredupealias/utils/ArrayUtils.java b/src/main/java/fun/ogre/ogredupealias/utils/ArrayUtils.java index 9ecf7e0..4fbae3b 100644 --- a/src/main/java/fun/ogre/ogredupealias/utils/ArrayUtils.java +++ b/src/main/java/fun/ogre/ogredupealias/utils/ArrayUtils.java @@ -1,6 +1,5 @@ package fun.ogre.ogredupealias.utils; -import com.google.common.collect.ObjectArrays; import org.bukkit.Material; import org.bukkit.entity.EntityType; diff --git a/src/main/java/fun/ogre/ogredupealias/utils/DisplayUtils.java b/src/main/java/fun/ogre/ogredupealias/utils/DisplayUtils.java index 6951298..bd5a082 100644 --- a/src/main/java/fun/ogre/ogredupealias/utils/DisplayUtils.java +++ b/src/main/java/fun/ogre/ogredupealias/utils/DisplayUtils.java @@ -1,13 +1,10 @@ package fun.ogre.ogredupealias.utils; -import fun.ogre.ogredupealias.OgreDupeAlias; import fun.ogre.ogredupealias.data.BlockStorage; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.Material; -import org.bukkit.Particle; import org.bukkit.block.Block; -import org.bukkit.util.Vector; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/fun/ogre/ogredupealias/utils/MathUtils.java b/src/main/java/fun/ogre/ogredupealias/utils/MathUtils.java index 3a285a5..0075613 100644 --- a/src/main/java/fun/ogre/ogredupealias/utils/MathUtils.java +++ b/src/main/java/fun/ogre/ogredupealias/utils/MathUtils.java @@ -1,6 +1,8 @@ package fun.ogre.ogredupealias.utils; -import java.util.*; +import java.util.Arrays; +import java.util.List; +import java.util.Objects; public final class MathUtils { diff --git a/src/main/java/fun/ogre/ogredupealias/utils/PlayerUtils.java b/src/main/java/fun/ogre/ogredupealias/utils/PlayerUtils.java index 99bc91b..dc34e6e 100644 --- a/src/main/java/fun/ogre/ogredupealias/utils/PlayerUtils.java +++ b/src/main/java/fun/ogre/ogredupealias/utils/PlayerUtils.java @@ -6,7 +6,6 @@ import org.bukkit.Material; import org.bukkit.attribute.Attribute; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; -import org.bukkit.scoreboard.Scoreboard; import java.util.ArrayList; import java.util.List; diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 975ed9a..761cd37 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -78,6 +78,10 @@ commands: permission: oda.command.givecustom aliases: - givec + customitem: + description: Gives custom items + usage: /customitem + permission: oda.command.givecustom config: description: Config management usage: /config [get|set]