Add gradle project

This commit is contained in:
Jesse Boyd 2016-04-02 15:06:24 +11:00
parent 51c7b29f51
commit e71fd64e9c
129 changed files with 4634 additions and 111 deletions

2
.gitignore vendored
View File

@ -8,3 +8,5 @@
*.project *.project
*.classpath *.classpath
/target/ /target/
/.gradle
/.idea

46
build.gradle Normal file
View File

@ -0,0 +1,46 @@
buildscript {
repositories {
mavenCentral()
maven { url = "https://oss.sonatype.org/content/repositories/snapshots/" }
jcenter()
}
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.3'
}
}
group = 'com.boydti.fawe'
version = '3.3.4'
description = """FastAsyncWorldEdit"""
subprojects {
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'eclipse'
apply plugin: 'idea'
dependencies {
compile(group: 'com.sk89q', name: 'worldedit', version:'6.0.0-SNAPSHOT') {
exclude(module: 'bukkit-classloader-check')
}
compile 'com.sk89q:worldguard:6.0.0-SNAPSHOT'
compile 'com.intellectualcrafters.plot:plotsquared:3.3.1'
}
repositories {
mavenCentral()
maven {url "http://empcraft.com/maven2"}
maven {url "http://repo.mcstats.org/content/repositories/public"}
maven {url "https://hub.spigotmc.org/nexus/content/groups/public/"}
maven {url "http://maven.sk89q.com/repo/"}
maven {url "http://nexus.theyeticave.net/content/repositories/pub_releases"}
maven {url "http://repo.maven.apache.org/maven2"}
maven {url "http://repo.techcable.net/content/groups/public/"}
maven {url "http://hub.spigotmc.org/nexus/content/groups/public/"}
maven {url "http://ci.frostcast.net/plugin/repository/everything"}
maven {url "http://maven.sk89q.com/artifactory/repo/"}
maven {url "http://nexus.theyeticave.net/content/repositories/pub_releases"}
maven {url "http://repo.spongepowered.org/maven"}
}
}

53
bukkit/build.gradle Normal file
View File

@ -0,0 +1,53 @@
dependencies {
compile project(':core')
compile 'org.bukkit:bukkit:1.9-R0.1-SNAPSHOT'
compile 'org.mcstats.bukkit:metrics:R7'
compile 'net.milkbowl.vault:VaultAPI:1.5'
compile 'javax.websocket:javax.websocket-api:1.1'
compile 'org.spongepowered:spongeapi:2.1-SNAPSHOT'
compile 'org.bukkit:bukkit:1.9-R0.1-SNAPSHOT'
compile 'org.PrimeSoft:blockshub:1.2'
compile 'com.massivecraft:factions:2.8.0'
compile 'com.drtshock:factions:1.6.9.5'
compile 'me.ryanhamshire:GriefPrevention:11.5.2'
compile 'com.massivecraft:mcore:7.0.1'
compile 'net.sacredlabyrinth.Phaed:PreciousStones:9.6.6'
compile 'net.jzx7:regios:5.9.9'
compile 'com.bekvon.bukkit:residence:2.6.6.6'
compile 'com.palmergames.bukkit:towny:0.84.0.9'
compile 'com.worldcretornica:plotme_core:0.16.3'
compile 'junit:junit:4.11'
}
sourceCompatibility = 1.7
targetCompatibility = 1.7
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(':core'))
include(dependency('org.mcstats.bukkit:metrics:R7'))
}
relocate 'org.mcstats', 'com.plotsquared.stats'
archiveName = "${parent.name}-${project.name}-${parent.version}.jar"
destinationDir = file '../target'
}
shadowJar.doLast {
task ->
ant.checksum file: task.archivePath
}
build.dependsOn(shadowJar);

View File

View File

@ -0,0 +1,32 @@
name: FastAsyncWorldEdit
main: com.boydti.fawe.bukkit.FaweBukkit
version: 3.3.4
description: Fast Async WorldEdit plugin
authors: [Empire92]
loadbefore: [WorldEdit]
load: STARTUP
database: false
#softdepend: [WorldGuard, PlotSquared, MCore, Factions, GriefPrevention, Residence, Towny, PlotMe, PreciousStones]
commands:
wea:
description: (FAWE) Bypass WorldEdit processing and area restrictions
aliases: [weanywhere,worldeditanywhere,/wea,/weanywhere,/worldeditanywhere]
usage: "Vault is required for the toggle. Optionally, you can set the permission fawe.bypass"
fixlighting:
description: (FAWE) Fix the lighting in your current chunk
aliases: [/fixlighting]
stream:
description: (FAWE) Stream a schematic into the world
aliases: [/stream]
wrg:
description: (FAWE) Select your current WorldEdit Region.
aliases: [/wrg,wer,/wer,worldeditregion,/worldeditregion,/region]
permissions:
fawe.bypass:
default: false
fawe.admin:
default: false
fawe.stream:
default: false
fawe.fixlighting:
default: false

11
core/build.gradle Normal file
View File

@ -0,0 +1,11 @@
dependencies {
testCompile 'junit:junit:4.12'
compile 'org.yaml:snakeyaml:1.16'
compile 'com.google.code.gson:gson:2.2.4'
}
sourceCompatibility = 1.7
targetCompatibility = 1.7
jar.archiveName="FastAsyncWorldEdit-API-${parent.version}.jar"
jar.destinationDir = file '../target'

View File

@ -217,10 +217,15 @@ public class Fawe {
NonRisingVisitor.inject(); NonRisingVisitor.inject();
RecursiveVisitor.inject(); RecursiveVisitor.inject();
RegionVisitor.inject(); RegionVisitor.inject();
CommandManager.inject();
EntityCreate.inject(); EntityCreate.inject();
EntityRemove.inject(); EntityRemove.inject();
LocalSession.inject(); LocalSession.inject();
try {
CommandManager.inject();
} catch (Throwable e) {
e.printStackTrace();
IMP.debug("Incompatible version of WorldEdit, please update the plugin or contact the Author!");
}
} }
private void setupMemoryListener() { private void setupMemoryListener() {

View File

@ -50,7 +50,7 @@ public abstract class FawePlayer<T> {
} }
public LocalSession getSession() { public LocalSession getSession() {
return this.session != null ? this.session : Fawe.get().getWorldEdit().getSession(this.getPlayer()); return (this.session != null || this.getPlayer() == null) ? this.session : Fawe.get().getWorldEdit().getSession(this.getPlayer());
} }
public HashSet<RegionWrapper> getCurrentRegions() { public HashSet<RegionWrapper> getCurrentRegions() {

View File

@ -248,7 +248,7 @@ public class EditSession implements Extent {
final String name = actor.getName(); final String name = actor.getName();
final FawePlayer<Object> fp = FawePlayer.wrap(name); final FawePlayer<Object> fp = FawePlayer.wrap(name);
final LocalSession session = fp.getSession(); final LocalSession session = fp.getSession();
if (this.fastmode = session.hasFastMode()) { if (this.fastmode = (session == null ? false : session.hasFastMode())) {
session.clearHistory(); session.clearHistory();
} }
if (fp.hasWorldEditBypass()) { if (fp.hasWorldEditBypass()) {

View File

@ -29,6 +29,7 @@ import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import com.boydti.fawe.util.SetQueue;
import com.boydti.fawe.util.TaskManager; import com.boydti.fawe.util.TaskManager;
import com.google.common.base.Joiner; import com.google.common.base.Joiner;
import com.sk89q.minecraft.util.commands.CommandException; import com.sk89q.minecraft.util.commands.CommandException;
@ -218,7 +219,7 @@ public final class CommandManager {
TaskManager.IMP.async(new Runnable() { TaskManager.IMP.async(new Runnable() {
@Override @Override
public void run() { public void run() {
Actor actor = platformManager.createProxyActor(event.getActor()); final Actor actor = platformManager.createProxyActor(event.getActor());
String[] split = commandDetection(event.getArguments().split(" ")); String[] split = commandDetection(event.getArguments().split(" "));
// No command found! // No command found!
@ -270,9 +271,16 @@ public final class CommandManager {
if (editSession != null) { if (editSession != null) {
session.remember(editSession); session.remember(editSession);
editSession.flushQueue(); editSession.flushQueue();
if (config.profile) {
long time = System.currentTimeMillis() - start; long time = System.currentTimeMillis() - start;
if (time > 5 && editSession.size() != 0) {
SetQueue.IMP.addTask(new Runnable() {
@Override
public void run() {
actor.print("[FAWE] Action complete");
}
});
}
if (config.profile) {
int changed = editSession.getBlockChangeCount(); int changed = editSession.getBlockChangeCount();
if (time > 0) { if (time > 0) {
double throughput = changed / (time / 1000.0); double throughput = changed / (time / 1000.0);

0
forge/.gradle/gradle.log Normal file
View File

81
forge/build.gradle Normal file
View File

@ -0,0 +1,81 @@
buildscript {
repositories {
jcenter()
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
maven {url = "http://repo.minecrell.net/snapshots"}
}
dependencies {
classpath 'net.minecrell:VanillaGradle:2.0.3-SNAPSHOT'
classpath 'net.minecraftforge.gradle:ForgeGradle:2.1-SNAPSHOT'
}
}
apply plugin: 'net.minecrell.vanilla.server.library'
apply plugin: 'com.github.johnrengelman.shadow'
dependencies {
compile project(':core')
compile 'org.spongepowered:spongeapi:4.+'
compile 'org.mcstats.sponge:metrics:R8-SNAPSHOT'
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
maven {
name = 'forge'
url = 'http://files.minecraftforge.net/maven'
}
maven {
name = "Sponge"
url = "https://repo.spongepowered.org/maven"
}
maven {
name = "Sponge Metrics"
url = "http://repo.mcstats.org/content/repositories/releases/"
}
}
minecraft {
version = "1.8.9"
mappings = "stable_22"
runDir = 'run'
}
project.archivesBaseName = "${project.archivesBaseName}-mc${minecraft.version}"
processResources {
from(sourceSets.main.resources.srcDirs) {
expand 'version': project.version,
'mcVersion': project.minecraft.version
}
}
shadowJar {
dependencies {
include(dependency(':core'))
include(dependency('org.mcstats.sponge:metrics:R8-SNAPSHOT'))
}
relocate 'org.mcstats', 'com.boydti.fawe.stats'
archiveName = "${parent.name}-${project.name}-${parent.version}.jar"
destinationDir = file '../target'
}
shadowJar.doLast {
task ->
ant.checksum file: task.archivePath
}
reobf {
shadowJar {
mappingType = 'SEARGE'
}
}
task deobfJar(type: Jar) {
from sourceSets.main.output
classifier = 'dev'
}
build.dependsOn(shadowJar)

View File

@ -0,0 +1,31 @@
package com.boydti.fawe.bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import com.boydti.fawe.Fawe;
import com.boydti.fawe.config.BBC;
import com.boydti.fawe.object.FaweCommand;
import com.boydti.fawe.object.FawePlayer;
public class BukkitCommand implements CommandExecutor {
private final FaweCommand cmd;
public BukkitCommand(final FaweCommand cmd) {
this.cmd = cmd;
}
@Override
public boolean onCommand(final CommandSender sender, final Command cmd, final String label, final String[] args) {
final FawePlayer plr = Fawe.imp().wrap(sender);
if (!sender.hasPermission(this.cmd.getPerm())) {
BBC.NO_PERM.send(plr, this.cmd.getPerm());
return true;
}
this.cmd.execute(plr, args);
return true;
}
}

Some files were not shown because too many files have changed in this diff Show More