-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from vaperion/dev
Merge dev -> master
- Loading branch information
Showing
105 changed files
with
2,141 additions
and
1,834 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# | ||
# https://help.github.com/articles/dealing-with-line-endings/ | ||
# | ||
# These are explicitly windows files and should use crlf | ||
*.bat text eol=crlf | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
.idea/ | ||
target/ | ||
*.iml | ||
### Gradle & IntelliJ ### | ||
.gradle/ | ||
/.idea/ | ||
build/ | ||
out/ | ||
run/ | ||
*.iml | ||
.idea_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
plugins { | ||
id 'java-library' | ||
id 'maven-publish' | ||
id 'com.github.johnrengelman.shadow' version '7.1.2' | ||
id 'io.freefair.lombok' version '6.4.3' | ||
} | ||
|
||
allprojects { | ||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
group = 'me.vaperion.blade' | ||
version = '3.0.0' | ||
|
||
// workaround for gradle issue: https://github.com/gradle/gradle/issues/17236#issuecomment-894385386 | ||
tasks.withType(Copy).all { | ||
duplicatesStrategy DuplicatesStrategy.INCLUDE | ||
outputs.upToDateWhen { false } | ||
} | ||
} | ||
|
||
subprojects { | ||
apply plugin: 'com.github.johnrengelman.shadow' | ||
apply plugin: 'io.freefair.lombok' | ||
apply plugin: 'maven-publish' | ||
|
||
java { | ||
toolchain { | ||
languageVersion = JavaLanguageVersion.of(8) | ||
} | ||
} | ||
|
||
tasks.withType(JavaCompile) { | ||
options.encoding = 'UTF-8' | ||
} | ||
|
||
afterEvaluate { | ||
shadowJar { | ||
archiveClassifier.set('') | ||
archiveFileName = 'blade-' + project.name + ".jar" | ||
} | ||
|
||
publishing { | ||
publications { | ||
maven(MavenPublication) { | ||
artifact shadowJar | ||
} | ||
} | ||
} | ||
|
||
tasks.build.dependsOn(shadowJar) | ||
|
||
if (project.name != 'core') { | ||
tasks.shadowJar.dependsOn ':core:shadowJar' | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
plugins { | ||
id 'java-library' | ||
} | ||
|
||
repositories { | ||
maven { url 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' } | ||
maven { url 'https://repo.dmulloy2.net/repository/public/' } | ||
} | ||
|
||
dependencies { | ||
implementation project(":core") | ||
|
||
compileOnly 'org.jetbrains:annotations:23.0.0' | ||
|
||
compileOnly 'org.spigotmc:spigot-api:1.16.5-R0.1-SNAPSHOT' | ||
compileOnly 'com.comphenix.protocol:ProtocolLib:4.6.0' | ||
} |
49 changes: 49 additions & 0 deletions
49
bukkit/src/main/java/me/vaperion/blade/bukkit/BladeBukkitPlatform.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package me.vaperion.blade.bukkit; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import me.vaperion.blade.Blade; | ||
import me.vaperion.blade.Blade.Builder.Binder; | ||
import me.vaperion.blade.bukkit.argument.OfflinePlayerArgument; | ||
import me.vaperion.blade.bukkit.argument.PlayerArgument; | ||
import me.vaperion.blade.bukkit.container.BukkitContainer; | ||
import me.vaperion.blade.bukkit.platform.BukkitHelpGenerator; | ||
import me.vaperion.blade.bukkit.platform.ProtocolLibTabCompleter; | ||
import me.vaperion.blade.container.ContainerCreator; | ||
import me.vaperion.blade.platform.BladeConfiguration; | ||
import me.vaperion.blade.platform.BladePlatform; | ||
import me.vaperion.blade.platform.TabCompleter; | ||
import org.bukkit.Bukkit; | ||
import org.bukkit.OfflinePlayer; | ||
import org.bukkit.entity.Player; | ||
import org.bukkit.plugin.java.JavaPlugin; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
import java.util.Locale; | ||
|
||
@RequiredArgsConstructor | ||
public final class BladeBukkitPlatform implements BladePlatform { | ||
|
||
private final JavaPlugin plugin; | ||
|
||
@Override | ||
public @NotNull Object getPluginInstance() { | ||
return plugin; | ||
} | ||
|
||
@Override | ||
public @NotNull ContainerCreator<?> getContainerCreator() { | ||
return BukkitContainer.CREATOR; | ||
} | ||
|
||
@Override | ||
public void configureBlade(Blade.@NotNull Builder builder, @NotNull BladeConfiguration configuration) { | ||
configuration.setPluginInstance(plugin); | ||
configuration.setFallbackPrefix(plugin.getName().toLowerCase(Locale.ROOT)); | ||
configuration.setHelpGenerator(new BukkitHelpGenerator()); | ||
configuration.setTabCompleter(Bukkit.getPluginManager().isPluginEnabled("ProtocolLib") ? new ProtocolLibTabCompleter(plugin) : new TabCompleter.Default()); | ||
|
||
Binder binder = new Binder(builder, true); | ||
binder.bind(Player.class, new PlayerArgument()); | ||
binder.bind(OfflinePlayer.class, new OfflinePlayerArgument()); | ||
} | ||
} |
Oops, something went wrong.