Move voxelsniper stuff to its own jar

(untested)
This commit is contained in:
Jesse Boyd 2016-07-16 06:26:09 +10:00
parent 0849948f77
commit 2f76cb59e3
9 changed files with 101 additions and 44 deletions

View File

@ -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);

32
favs/build.gradle Normal file
View File

@ -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);

View File

@ -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) {}
}
}

View File

@ -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 {

View File

@ -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]

View File

@ -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'