From 2f76cb59e30bd6fef72eca4d08b185ebbba0595c Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Sat, 16 Jul 2016 06:26:09 +1000 Subject: [PATCH] Move voxelsniper stuff to its own jar (untested) --- .../com/boydti/fawe/bukkit/ABukkitMain.java | 41 --------------- favs/build.gradle | 32 ++++++++++++ .../com/boydti/fawe/bukkit/favs/Favs.java | 50 +++++++++++++++++++ .../voxelsniper/RangeBlockHelper.java | 0 .../thevoxelbox/voxelsniper/SnipeData.java | 0 .../com/thevoxelbox/voxelsniper/Sniper.java | 0 .../com/thevoxelbox/voxelsniper/Undo.java | 3 +- favs/src/main/resources/plugin.yml | 17 +++++++ settings.gradle | 2 +- 9 files changed, 101 insertions(+), 44 deletions(-) create mode 100644 favs/build.gradle create mode 100644 favs/src/main/java/com/boydti/fawe/bukkit/favs/Favs.java rename {bukkit0 => favs}/src/main/java/com/thevoxelbox/voxelsniper/RangeBlockHelper.java (100%) rename {bukkit0 => favs}/src/main/java/com/thevoxelbox/voxelsniper/SnipeData.java (100%) rename {bukkit0 => favs}/src/main/java/com/thevoxelbox/voxelsniper/Sniper.java (100%) rename {bukkit0 => favs}/src/main/java/com/thevoxelbox/voxelsniper/Undo.java (87%) create mode 100644 favs/src/main/resources/plugin.yml diff --git a/bukkit0/src/main/java/com/boydti/fawe/bukkit/ABukkitMain.java b/bukkit0/src/main/java/com/boydti/fawe/bukkit/ABukkitMain.java index 393cb163..1997b2ce 100644 --- a/bukkit0/src/main/java/com/boydti/fawe/bukkit/ABukkitMain.java +++ b/bukkit0/src/main/java/com/boydti/fawe/bukkit/ABukkitMain.java @@ -1,15 +1,6 @@ package com.boydti.fawe.bukkit; -import com.boydti.fawe.Fawe; -import com.boydti.fawe.object.FaweCommand; -import com.boydti.fawe.object.FawePlayer; import com.boydti.fawe.object.FaweQueue; -import com.thevoxelbox.voxelsniper.SnipeData; -import com.thevoxelbox.voxelsniper.Sniper; -import org.bukkit.Bukkit; -import org.bukkit.command.Command; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; public abstract class ABukkitMain extends JavaPlugin { @@ -17,38 +8,6 @@ public abstract class ABukkitMain extends JavaPlugin { @Override public void onEnable() { FaweBukkit imp = new FaweBukkit(this); - try { - SnipeData.inject(); - Sniper.inject(); - // Forward the commands so //p and //d will work - imp.setupCommand("/p", new FaweCommand("voxelsniper.sniper") { - @Override - public boolean execute(FawePlayer fp, String... args) { - Player player = (Player) fp.parent; - return (Bukkit.getPluginManager().getPlugin("VoxelSniper")).onCommand(player, new Command("p") { - @Override - public boolean execute(CommandSender sender, String commandLabel, String[] args) { - return false; - } - }, null, args); - - } - }); - imp.setupCommand("/d", new FaweCommand("voxelsniper.sniper") { - @Override - public boolean execute(FawePlayer fp, String... args) { - Player player = (Player) fp.parent; - return (Bukkit.getPluginManager().getPlugin("VoxelSniper")).onCommand(player, new Command("d") { - @Override - public boolean execute(CommandSender sender, String commandLabel, String[] args) { - return false; - } - }, null, args); - - } - }); - Fawe.debug("Injected VoxelSniper classes"); - } catch (Throwable ignore) {} } public abstract FaweQueue getQueue(String world); diff --git a/favs/build.gradle b/favs/build.gradle new file mode 100644 index 00000000..014e0900 --- /dev/null +++ b/favs/build.gradle @@ -0,0 +1,32 @@ +dependencies { + compile project(':bukkit0') + compile 'org.bukkit.craftbukkit:CraftBukkit:1.8.8' +} + +processResources { + from('src/main/resources') { + include 'plugin.yml' + expand( + name: project.parent.name, + version: project.parent.version + ) + } +} + +apply plugin: 'com.github.johnrengelman.shadow' +// We only want the shadow jar produced +jar.enabled = false +shadowJar { + dependencies { + include(dependency(':bukkit0')) + include(dependency(':core')) + } + archiveName = "FastAsyncVoxelSniper-${project.name}-${parent.version}.jar" + destinationDir = file '../target' +} +shadowJar.doLast { + task -> + ant.checksum file: task.archivePath +} + +build.dependsOn(shadowJar); \ No newline at end of file diff --git a/favs/src/main/java/com/boydti/fawe/bukkit/favs/Favs.java b/favs/src/main/java/com/boydti/fawe/bukkit/favs/Favs.java new file mode 100644 index 00000000..219a1c4e --- /dev/null +++ b/favs/src/main/java/com/boydti/fawe/bukkit/favs/Favs.java @@ -0,0 +1,50 @@ +package com.boydti.fawe.bukkit.favs; + +import com.boydti.fawe.Fawe; +import com.boydti.fawe.object.FaweCommand; +import com.boydti.fawe.object.FawePlayer; +import com.thevoxelbox.voxelsniper.SnipeData; +import com.thevoxelbox.voxelsniper.Sniper; +import org.bukkit.Bukkit; +import org.bukkit.command.Command; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; +import org.bukkit.plugin.java.JavaPlugin; + +public class Favs extends JavaPlugin { + @Override + public void onEnable() { + try { + SnipeData.inject(); + Sniper.inject(); + // Forward the commands so //p and //d will work + Fawe.imp().setupCommand("/p", new FaweCommand("voxelsniper.sniper") { + @Override + public boolean execute(FawePlayer fp, String... args) { + Player player = (Player) fp.parent; + return (Bukkit.getPluginManager().getPlugin("VoxelSniper")).onCommand(player, new Command("p") { + @Override + public boolean execute(CommandSender sender, String commandLabel, String[] args) { + return false; + } + }, null, args); + + } + }); + Fawe.imp().setupCommand("/d", new FaweCommand("voxelsniper.sniper") { + @Override + public boolean execute(FawePlayer fp, String... args) { + Player player = (Player) fp.parent; + return (Bukkit.getPluginManager().getPlugin("VoxelSniper")).onCommand(player, new Command("d") { + @Override + public boolean execute(CommandSender sender, String commandLabel, String[] args) { + return false; + } + }, null, args); + + } + }); + Fawe.debug("Injected VoxelSniper classes"); + } catch (Throwable ignore) {} + } +} diff --git a/bukkit0/src/main/java/com/thevoxelbox/voxelsniper/RangeBlockHelper.java b/favs/src/main/java/com/thevoxelbox/voxelsniper/RangeBlockHelper.java similarity index 100% rename from bukkit0/src/main/java/com/thevoxelbox/voxelsniper/RangeBlockHelper.java rename to favs/src/main/java/com/thevoxelbox/voxelsniper/RangeBlockHelper.java diff --git a/bukkit0/src/main/java/com/thevoxelbox/voxelsniper/SnipeData.java b/favs/src/main/java/com/thevoxelbox/voxelsniper/SnipeData.java similarity index 100% rename from bukkit0/src/main/java/com/thevoxelbox/voxelsniper/SnipeData.java rename to favs/src/main/java/com/thevoxelbox/voxelsniper/SnipeData.java diff --git a/bukkit0/src/main/java/com/thevoxelbox/voxelsniper/Sniper.java b/favs/src/main/java/com/thevoxelbox/voxelsniper/Sniper.java similarity index 100% rename from bukkit0/src/main/java/com/thevoxelbox/voxelsniper/Sniper.java rename to favs/src/main/java/com/thevoxelbox/voxelsniper/Sniper.java diff --git a/bukkit0/src/main/java/com/thevoxelbox/voxelsniper/Undo.java b/favs/src/main/java/com/thevoxelbox/voxelsniper/Undo.java similarity index 87% rename from bukkit0/src/main/java/com/thevoxelbox/voxelsniper/Undo.java rename to favs/src/main/java/com/thevoxelbox/voxelsniper/Undo.java index bf63a031..2c9382fa 100644 --- a/bukkit0/src/main/java/com/thevoxelbox/voxelsniper/Undo.java +++ b/favs/src/main/java/com/thevoxelbox/voxelsniper/Undo.java @@ -2,10 +2,9 @@ package com.thevoxelbox.voxelsniper; import org.bukkit.World; import org.bukkit.block.Block; -import org.bukkit.block.BlockState; /** - * Holds {@link BlockState}s that can be later on used to reset those block + * Holds {@link org.bukkit.block.BlockState}s that can be later on used to reset those block * locations back to the recorded states. */ public class Undo { diff --git a/favs/src/main/resources/plugin.yml b/favs/src/main/resources/plugin.yml new file mode 100644 index 00000000..024f3d20 --- /dev/null +++ b/favs/src/main/resources/plugin.yml @@ -0,0 +1,17 @@ +name: FastAsyncVoxelSniper +main: com.boydti.fawe.bukkit.favs.Favs +version: ${version} +description: Fast Async VoxelSniper +authors: [Empire92] +loadbefore: [WorldEdit,VoxelSniper] +load: STARTUP +database: false +softdepend: [FastAsyncWorldEdit] +#softdepend: [WorldGuard, PlotSquared, MCore, Factions, GriefPrevention, Residence, Towny, PlotMe, PreciousStones] +commands: + '/p': + description: VoxelSniper perform command + aliases: [perform,/perform] + '/d': + description: VoxelSniper default command + aliases: [default,/default] \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index 272ff13c..a55a221d 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,3 +1,3 @@ rootProject.name = 'FastAsyncWorldEdit' -include 'core', 'bukkit0', 'bukkit1710', 'bukkit18', 'bukkit19', 'bukkit110', 'forge1710', 'forge189', 'forge194', 'forge110' +include 'core', 'bukkit0', 'bukkit1710', 'bukkit18', 'bukkit19', 'bukkit110', 'forge1710', 'forge189', 'forge194', 'forge110', 'favs'