Compare commits
74 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4ebc1a18a1 | ||
|
|
db20bed6e0 | ||
|
|
0826da6cfc | ||
|
|
6d8fce3462 | ||
|
|
eedb1404b6 | ||
|
|
299abe4568 | ||
|
|
98e1f19145 | ||
|
|
424e2ff43d | ||
|
|
3a899226a3 | ||
|
|
8336eee892 | ||
|
|
a48f756582 | ||
|
|
2aa463d083 | ||
|
|
ea833de9f7 | ||
|
|
3c0822310d | ||
|
|
d5cbc1d497 | ||
|
|
c912ad1c9c | ||
|
|
752f38ef25 | ||
|
|
a5525ab332 | ||
|
|
1b442f400d | ||
|
|
3c9c0bcef4 | ||
|
|
3a7a938e7f | ||
|
|
32c17aa3ae | ||
|
|
e451732876 | ||
|
|
53f81c0a03 | ||
|
|
f60d91c5f3 | ||
|
|
a9bdca56a5 | ||
|
|
3516d5881e | ||
|
|
95cecc2b2a | ||
|
|
66d0625d2e | ||
|
|
99a60f2b8b | ||
|
|
0bdfbe76fe | ||
|
|
e0240069fc | ||
|
|
11d2f7d711 | ||
|
|
5cf632e58b | ||
|
|
a90fe5d100 | ||
|
|
8dd145ed7d | ||
|
|
e4c65f1db5 | ||
|
|
2208f161c0 | ||
|
|
95833ea8f6 | ||
|
|
ba2da5c238 | ||
|
|
f276026972 | ||
|
|
d2c6cc0d2e | ||
|
|
60829a3e1d | ||
|
|
38c5bf97a0 | ||
|
|
d61f1bd23b | ||
|
|
275f08fcb6 | ||
|
|
68ae25b7db | ||
|
|
89c529fdb3 | ||
|
|
43157b154a | ||
|
|
8721f96a2f | ||
|
|
ad3f7e529d | ||
|
|
ec6ac88fea | ||
|
|
13b10c13b3 | ||
|
|
1e24cbf67b | ||
|
|
d9cfc8b91a | ||
|
|
b40001d79b | ||
|
|
b8128ef87e | ||
|
|
be885e9092 | ||
|
|
5658c92d3d | ||
|
|
e4b0a602f0 | ||
|
|
bf5c36d2c9 | ||
|
|
cc57d10a36 | ||
|
|
dcbdbb5230 | ||
|
|
de19d67275 | ||
|
|
43abfcb3fc | ||
|
|
34f201d62d | ||
|
|
d3c811614f | ||
|
|
44da61daaa | ||
|
|
3ea6d11026 | ||
|
|
9a03a2e47a | ||
|
|
af91c9d659 | ||
|
|
89eaaf3a5e | ||
|
|
ab174e2d41 | ||
|
|
cfa9badc1e |
36
.github/workflows/java-ci.yml
vendored
Normal file
36
.github/workflows/java-ci.yml
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
name: Java CI
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout latest code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set outputs
|
||||
id: vars
|
||||
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
|
||||
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: 17
|
||||
|
||||
- name: Setup build cache
|
||||
uses: actions/cache@v2.1.6
|
||||
with:
|
||||
path: ~/.gradle/caches
|
||||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-gradle-
|
||||
|
||||
- run: ./gradlew build --full-stacktrace
|
||||
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: eco-dev-${{ steps.vars.outputs.sha_short }}
|
||||
path: build/libs
|
||||
6
.github/workflows/publish-release.yml
vendored
6
.github/workflows/publish-release.yml
vendored
@@ -12,11 +12,11 @@ jobs:
|
||||
- name: Checkout latest code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set up JDK 16
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
distribution: 'adopt'
|
||||
java-version: 16
|
||||
distribution: 'temurin'
|
||||
java-version: 17
|
||||
|
||||
- name: Setup build cache
|
||||
uses: actions/cache@v2.1.6
|
||||
|
||||
@@ -21,4 +21,4 @@
|
||||
|
||||
## Other
|
||||
- All drops **must** be sent through a DropQueue - calls to World#dropItem will get your PR rejected.
|
||||
- eco is built with java 16.
|
||||
- eco is built with java 17.
|
||||
14
README.md
14
README.md
@@ -22,12 +22,20 @@ and many more.
|
||||
<a href="https://discord.gg/ZcwpSsE/" alt="Discord">
|
||||
<img src="https://img.shields.io/discord/452518336627081236?label=discord&color=informational"/>
|
||||
</a>
|
||||
<a href="https://github.com/Auxilor/eco/actions/workflows/java-ci.yml" alt="Latest Dev Build">
|
||||
<img src="https://img.shields.io/github/workflow/status/Auxilor/eco/Java%20CI/develop?color=informational"/>
|
||||
</a>
|
||||
</p>
|
||||
|
||||
# For server owners
|
||||
- Requires ProtocolLib to be installed: get the latest version [here](https://www.spigotmc.org/resources/protocollib.1997/)
|
||||
- Supports 1.16.5+
|
||||
|
||||
## Downloads
|
||||
|
||||
- Stable (Recommended): [GitHub](https://github.com/Auxilor/eco/releases), [Polymart](https://polymart.org/resource/eco.773)
|
||||
- Dev (Not Recommended): [GitHub](https://github.com/Auxilor/eco/actions/workflows/java-ci.yml) (Open latest run and download)
|
||||
|
||||
# For developers
|
||||
|
||||
## Javadoc
|
||||
@@ -43,12 +51,6 @@ depend:
|
||||
- eco
|
||||
```
|
||||
|
||||
eco is available from any of these places:
|
||||
|
||||
- [GitHub](https://github.com/Auxilor/eco/releases)
|
||||
- [Polymart](https://polymart.org/resource/eco.773)
|
||||
- [Build it locally](https://github.com/Auxilor/eco#build-locally).
|
||||
|
||||
## Get from JitPack:
|
||||
|
||||
Gradle:
|
||||
|
||||
124
build.gradle
124
build.gradle
@@ -1,124 +0,0 @@
|
||||
plugins {
|
||||
id 'java-library'
|
||||
id 'com.github.johnrengelman.shadow' version '7.0.0'
|
||||
id 'maven-publish'
|
||||
id 'java'
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation project(":eco-api")
|
||||
implementation project(":eco-core:core-plugin")
|
||||
implementation project(":eco-core:core-proxy")
|
||||
implementation project(":eco-core:core-backend")
|
||||
implementation project(":eco-core:core-nms:v1_16_R3")
|
||||
implementation project(path: ":eco-core:core-nms:v1_17_R1", configuration: 'mapped')
|
||||
}
|
||||
|
||||
allprojects {
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'java-library'
|
||||
apply plugin: 'maven-publish'
|
||||
apply plugin: 'com.github.johnrengelman.shadow'
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
mavenLocal()
|
||||
maven { url 'https://jitpack.io' }
|
||||
|
||||
// SuperiorSkyblock2
|
||||
maven { url 'https://repo.bg-software.com/repository/api/' }
|
||||
|
||||
// NMS (for jitpack compilation)
|
||||
maven { url 'https://repo.codemc.org/repository/nms/' }
|
||||
|
||||
// bStats, mcMMO, BentoBox
|
||||
maven { url 'https://repo.codemc.org/repository/maven-public/' }
|
||||
|
||||
// Spigot API, Bungee API
|
||||
maven { url 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' }
|
||||
|
||||
// PlaceholderAPI
|
||||
maven { url 'https://repo.extendedclip.com/content/repositories/placeholderapi/' }
|
||||
|
||||
// ProtocolLib
|
||||
maven { url 'https://repo.dmulloy2.net/nexus/repository/public/' }
|
||||
|
||||
// WorldGuard
|
||||
maven { url 'https://maven.enginehub.org/repo/' }
|
||||
|
||||
// FactionsUUID
|
||||
maven { url 'https://ci.ender.zone/plugin/repository/everything/' }
|
||||
|
||||
// NoCheatPlus
|
||||
maven { url 'https://repo.md-5.net/content/repositories/snapshots/' }
|
||||
|
||||
// CombatLogX
|
||||
maven { url 'https://nexus.sirblobman.xyz/repository/public/' }
|
||||
|
||||
// IridiumSkyblock
|
||||
maven { url 'https://nexus.iridiumdevelopment.net/repository/maven-releases/' }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly 'org.jetbrains:annotations:19.0.0'
|
||||
|
||||
// Test
|
||||
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.3.1'
|
||||
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
|
||||
}
|
||||
|
||||
tasks.withType(JavaCompile) {
|
||||
options.deprecation = true
|
||||
options.encoding = 'UTF-8'
|
||||
}
|
||||
|
||||
configurations.all {
|
||||
exclude group: "org.codehaus.plexus", module: "plexus-utils"
|
||||
exclude group: "com.mojang", module: "brigadier"
|
||||
exclude group: "org.kitteh", module: "paste-gg-api"
|
||||
exclude group: "org.kitteh", module: "pastegg"
|
||||
exclude group: "org.spongepowered", module: "configurate-hocon"
|
||||
exclude group: "com.darkblade12", module: "particleeffect"
|
||||
exclude group: "com.github.cryptomorin", module: "XSeries"
|
||||
}
|
||||
|
||||
shadowJar {
|
||||
relocate('org.bstats', 'com.willfp.eco.shaded.bstats')
|
||||
relocate('net.kyori.adventure.text.minimessage', 'com.willfp.eco.shaded.minimessage')
|
||||
}
|
||||
|
||||
jar {
|
||||
onlyIf { !sourceSets.main.allSource.files.isEmpty() }
|
||||
}
|
||||
|
||||
compileJava {
|
||||
onlyIf { !sourceSets.main.allSource.files.isEmpty() }
|
||||
}
|
||||
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.VERSION_16
|
||||
targetCompatibility = JavaVersion.VERSION_16
|
||||
withSourcesJar()
|
||||
}
|
||||
|
||||
test {
|
||||
useJUnitPlatform()
|
||||
|
||||
// Always run tests, even when nothing changed.
|
||||
dependsOn cleanTest
|
||||
|
||||
// Show test results.
|
||||
testLogging {
|
||||
events "passed", "skipped", "failed"
|
||||
}
|
||||
}
|
||||
|
||||
compileJava.options.encoding = 'UTF-8'
|
||||
compileJava.dependsOn clean
|
||||
|
||||
build.dependsOn shadowJar
|
||||
}
|
||||
|
||||
group = 'com.willfp'
|
||||
archivesBaseName = project.name
|
||||
version = findProperty("version")
|
||||
126
build.gradle.kts
Normal file
126
build.gradle.kts
Normal file
@@ -0,0 +1,126 @@
|
||||
plugins {
|
||||
id("java-library")
|
||||
id("com.github.johnrengelman.shadow") version "7.0.0"
|
||||
id("maven-publish")
|
||||
id("java")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(project(":eco-api"))
|
||||
implementation(project(":eco-core:core-plugin"))
|
||||
implementation(project(":eco-core:core-proxy"))
|
||||
implementation(project(":eco-core:core-backend"))
|
||||
implementation(project(":eco-core:core-nms:v1_16_R3"))
|
||||
implementation(project(path = ":eco-core:core-nms:v1_17_R1", configuration = "reobf"))
|
||||
implementation(project(":eco-core:core-nms:v1_18_R1"))
|
||||
}
|
||||
|
||||
allprojects {
|
||||
apply(plugin = "java")
|
||||
apply(plugin = "java-library")
|
||||
apply(plugin = "maven-publish")
|
||||
apply(plugin = "com.github.johnrengelman.shadow")
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
mavenLocal()
|
||||
maven("https://jitpack.io")
|
||||
|
||||
// CustomCrafting
|
||||
maven("https://maven.wolfyscript.com/repository/public/")
|
||||
|
||||
// SuperiorSkyblock2
|
||||
maven("https://repo.bg-software.com/repository/api/")
|
||||
|
||||
// NMS (for jitpack compilation)
|
||||
maven("https://repo.codemc.org/repository/nms/")
|
||||
|
||||
// bStats, mcMMO, BentoBox
|
||||
maven("https://repo.codemc.org/repository/maven-public/")
|
||||
|
||||
// Spigot API, Bungee API
|
||||
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
|
||||
|
||||
// PlaceholderAPI
|
||||
maven("https://repo.extendedclip.com/content/repositories/placeholderapi/")
|
||||
|
||||
// ProtocolLib
|
||||
maven("https://repo.dmulloy2.net/nexus/repository/public/")
|
||||
|
||||
// WorldGuard
|
||||
maven("https://maven.enginehub.org/repo/")
|
||||
|
||||
// FactionsUUID
|
||||
maven("https://ci.ender.zone/plugin/repository/everything/")
|
||||
|
||||
// NoCheatPlus
|
||||
maven("https://repo.md-5.net/content/repositories/snapshots/")
|
||||
|
||||
// CombatLogX
|
||||
maven("https://nexus.sirblobman.xyz/repository/public/")
|
||||
|
||||
// IridiumSkyblock
|
||||
maven("https://nexus.iridiumdevelopment.net/repository/maven-releases/")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly("org.jetbrains:annotations:23.0.0")
|
||||
|
||||
// Test
|
||||
testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.1")
|
||||
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.1")
|
||||
|
||||
// Adventure
|
||||
compileOnly("net.kyori:adventure-api:4.9.3")
|
||||
compileOnly("net.kyori:adventure-text-serializer-gson:4.9.3")
|
||||
compileOnly("net.kyori:adventure-text-serializer-legacy:4.9.3")
|
||||
}
|
||||
|
||||
tasks.withType<JavaCompile> {
|
||||
options.encoding = "UTF-8"
|
||||
}
|
||||
|
||||
configurations.all {
|
||||
exclude(group = "org.codehaus.plexus", module = "plexus-utils")
|
||||
exclude(group = "com.mojang", module = "brigadier")
|
||||
exclude(group = "org.kitteh", module = "paste-gg-api")
|
||||
exclude(group = "org.kitteh", module = "pastegg")
|
||||
exclude(group = "org.spongepowered", module = "configurate-hocon")
|
||||
exclude(group = "com.darkblade12", module = "particleeffect")
|
||||
exclude(group = "com.github.cryptomorin", module = "XSeries")
|
||||
}
|
||||
|
||||
tasks {
|
||||
shadowJar {
|
||||
relocate("org.bstats", "com.willfp.eco.shaded.bstats")
|
||||
relocate("net.kyori.adventure.text.minimessage", "com.willfp.eco.shaded.minimessage")
|
||||
}
|
||||
|
||||
compileJava {
|
||||
dependsOn(clean)
|
||||
options.encoding = "UTF-8"
|
||||
}
|
||||
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
withSourcesJar()
|
||||
}
|
||||
|
||||
test {
|
||||
useJUnitPlatform()
|
||||
|
||||
// Show test results.
|
||||
testLogging {
|
||||
events("passed", "skipped", "failed")
|
||||
}
|
||||
}
|
||||
|
||||
build {
|
||||
dependsOn(shadowJar)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
group = "com.willfp"
|
||||
version = findProperty("version")!!
|
||||
@@ -9,14 +9,11 @@ dependencies {
|
||||
// Adventure
|
||||
compileOnly 'net.kyori:adventure-platform-bukkit:4.0.0'
|
||||
compileOnly 'net.kyori:adventure-text-minimessage:4.1.0-SNAPSHOT'
|
||||
compileOnly 'net.kyori:adventure-api:4.9.2'
|
||||
compileOnly 'net.kyori:adventure-text-serializer-gson:4.9.2'
|
||||
compileOnly 'net.kyori:adventure-text-serializer-legacy:4.9.2'
|
||||
|
||||
// Other
|
||||
compileOnly 'org.spigotmc:spigot-api:1.17.1-R0.1-SNAPSHOT'
|
||||
compileOnly 'org.apache.maven:maven-artifact:3.8.1'
|
||||
compileOnly 'com.comphenix.protocol:ProtocolLib:4.7.1-SNAPSHOT'
|
||||
compileOnly 'com.comphenix.protocol:ProtocolLib:4.6.1-SNAPSHOT'
|
||||
compileOnly 'com.google.code.gson:gson:2.8.8'
|
||||
}
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ package com.willfp.eco.core;
|
||||
|
||||
import com.willfp.eco.core.config.updating.ConfigHandler;
|
||||
import com.willfp.eco.core.config.wrapper.ConfigFactory;
|
||||
import com.willfp.eco.core.data.keys.KeyRegistry;
|
||||
import com.willfp.eco.core.data.PlayerProfileHandler;
|
||||
import com.willfp.eco.core.data.keys.KeyRegistry;
|
||||
import com.willfp.eco.core.drops.DropQueueFactory;
|
||||
import com.willfp.eco.core.events.EventManager;
|
||||
import com.willfp.eco.core.extensions.ExtensionLoader;
|
||||
|
||||
@@ -41,11 +41,19 @@ public class Prerequisite {
|
||||
"Requires server to have vault"
|
||||
);
|
||||
|
||||
/**
|
||||
* Requires the server to be running 1.18.
|
||||
*/
|
||||
public static final Prerequisite HAS_1_18 = new Prerequisite(
|
||||
() -> ProxyConstants.NMS_VERSION.contains("18"),
|
||||
"Requires server to be running 1.18+"
|
||||
);
|
||||
|
||||
/**
|
||||
* Requires the server to be running 1.17.
|
||||
*/
|
||||
public static final Prerequisite HAS_1_17 = new Prerequisite(
|
||||
() -> ProxyConstants.NMS_VERSION.contains("17"),
|
||||
() -> ProxyConstants.NMS_VERSION.contains("17") || HAS_1_18.isMet(),
|
||||
"Requires server to be running 1.17+"
|
||||
);
|
||||
|
||||
|
||||
@@ -16,4 +16,40 @@ public class ConfigYml extends YamlBaseConfig {
|
||||
public ConfigYml(@NotNull final EcoPlugin plugin) {
|
||||
super("config", true, plugin);
|
||||
}
|
||||
|
||||
/**
|
||||
* Config.yml.
|
||||
*
|
||||
* @param plugin The plugin.
|
||||
* @param removeUnused Remove unused.
|
||||
*/
|
||||
public ConfigYml(@NotNull final EcoPlugin plugin,
|
||||
final boolean removeUnused) {
|
||||
super("config", removeUnused, plugin);
|
||||
}
|
||||
|
||||
/**
|
||||
* Config.yml.
|
||||
*
|
||||
* @param plugin The plugin.
|
||||
* @param name The config name.
|
||||
*/
|
||||
public ConfigYml(@NotNull final EcoPlugin plugin,
|
||||
@NotNull final String name) {
|
||||
super(name, true, plugin);
|
||||
}
|
||||
|
||||
/**
|
||||
* Config.yml.
|
||||
*
|
||||
* @param plugin The plugin.
|
||||
* @param name The config name.
|
||||
* @param removeUnused Remove unused.
|
||||
*/
|
||||
public ConfigYml(@NotNull final EcoPlugin plugin,
|
||||
@NotNull final String name,
|
||||
final boolean removeUnused) {
|
||||
super(name, removeUnused, plugin);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -70,14 +70,14 @@ public interface FastItemStack {
|
||||
*
|
||||
* @param hideFlags The flags.
|
||||
*/
|
||||
void addItemFlags(ItemFlag... hideFlags);
|
||||
void addItemFlags(@NotNull ItemFlag... hideFlags);
|
||||
|
||||
/**
|
||||
* Remove ItemFlags.
|
||||
*
|
||||
* @param hideFlags The flags.
|
||||
*/
|
||||
void removeItemFlags(ItemFlag... hideFlags);
|
||||
void removeItemFlags(@NotNull ItemFlag... hideFlags);
|
||||
|
||||
/**
|
||||
* Get the ItemFlags.
|
||||
@@ -92,7 +92,7 @@ public interface FastItemStack {
|
||||
* @param flag The flag.
|
||||
* @return If the flag is present.
|
||||
*/
|
||||
boolean hasItemFlag(ItemFlag flag);
|
||||
boolean hasItemFlag(@NotNull ItemFlag flag);
|
||||
|
||||
/**
|
||||
* Get the Bukkit ItemStack again.
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.willfp.eco.core.items.args;
|
||||
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.function.Predicate;
|
||||
|
||||
/**
|
||||
* Parse custom model data.
|
||||
*/
|
||||
public class CustomModelDataArgParser implements LookupArgParser {
|
||||
@Override
|
||||
public @Nullable Predicate<ItemStack> parseArguments(@NotNull final String[] args,
|
||||
@NotNull final ItemMeta meta) {
|
||||
Integer modelData = null;
|
||||
|
||||
for (String arg : args) {
|
||||
String[] argSplit = arg.split(":");
|
||||
if (!argSplit[0].equalsIgnoreCase("custom-model-data")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (argSplit.length < 2) {
|
||||
continue;
|
||||
}
|
||||
|
||||
String asString = argSplit[1];
|
||||
|
||||
try {
|
||||
modelData = Integer.parseInt(asString);
|
||||
} catch (NumberFormatException e) {
|
||||
modelData = null;
|
||||
}
|
||||
}
|
||||
|
||||
if (modelData == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
meta.setCustomModelData(modelData);
|
||||
|
||||
int finalModelData = modelData;
|
||||
return test -> {
|
||||
if (!test.hasItemMeta()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
ItemMeta testMeta = test.getItemMeta();
|
||||
|
||||
assert testMeta != null;
|
||||
|
||||
return testMeta.getCustomModelData() == finalModelData;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package com.willfp.eco.core.recipe.recipes;
|
||||
import com.willfp.eco.core.Eco;
|
||||
import com.willfp.eco.core.EcoPlugin;
|
||||
import com.willfp.eco.core.PluginDependent;
|
||||
import com.willfp.eco.core.Prerequisite;
|
||||
import com.willfp.eco.core.items.TestableItem;
|
||||
import com.willfp.eco.core.recipe.Recipes;
|
||||
import com.willfp.eco.core.recipe.parts.EmptyTestableItem;
|
||||
@@ -112,6 +113,12 @@ public final class ShapedCraftingRecipe extends PluginDependent<EcoPlugin> imple
|
||||
displayedRecipe.setIngredient(character, new RecipeChoice.ExactChoice(item));
|
||||
}
|
||||
|
||||
if (Prerequisite.HAS_1_18.isMet()) {
|
||||
if (Bukkit.getServer().getRecipe(this.getKey()) != null) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Bukkit.getServer().addRecipe(shapedRecipe);
|
||||
Bukkit.getServer().addRecipe(displayedRecipe);
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import java.io.InputStreamReader;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.net.URLDecoder;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
@@ -43,10 +44,10 @@ public class Paste {
|
||||
public void getHastebinToken(@NotNull final Consumer<String> callback) {
|
||||
Eco.getHandler().getEcoPlugin().getScheduler().runAsync(() -> {
|
||||
try {
|
||||
byte[] postData = contents.getBytes(StandardCharsets.UTF_8);
|
||||
byte[] postData = URLEncoder.encode(contents, StandardCharsets.UTF_8).getBytes(StandardCharsets.UTF_8);
|
||||
int postDataLength = postData.length;
|
||||
|
||||
String requestURL = "https://hastebin.com/documents";
|
||||
String requestURL = "https://paste.willfp.com/documents";
|
||||
URL url = new URL(requestURL);
|
||||
HttpsURLConnection conn = (HttpsURLConnection) url.openConnection();
|
||||
conn.setDoOutput(true);
|
||||
@@ -86,7 +87,7 @@ public class Paste {
|
||||
public static Paste getFromHastebin(@NotNull final String token) {
|
||||
try {
|
||||
StringBuilder result = new StringBuilder();
|
||||
URL url = new URL("https://hastebin.com/raw/" + token);
|
||||
URL url = new URL("https://paste.willfp.com/raw/" + token);
|
||||
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
|
||||
conn.setRequestMethod("GET");
|
||||
try (var reader = new BufferedReader(
|
||||
|
||||
@@ -82,20 +82,16 @@ public final class PlayerUtils {
|
||||
* @return The player name.
|
||||
*/
|
||||
public static String getSavedDisplayName(@NotNull final OfflinePlayer player) {
|
||||
PlayerProfile profile = PlayerProfile.load(player);
|
||||
|
||||
if (player instanceof Player onlinePlayer) {
|
||||
profile.write(PLAYER_NAME_KEY, onlinePlayer.getDisplayName());
|
||||
updateSavedDisplayName(onlinePlayer);
|
||||
}
|
||||
|
||||
PlayerProfile profile = PlayerProfile.load(player);
|
||||
|
||||
String saved = profile.read(PLAYER_NAME_KEY);
|
||||
|
||||
if (saved.equals(PLAYER_NAME_KEY.getDefaultValue())) {
|
||||
String name = player.getName();
|
||||
if (name != null) {
|
||||
profile.write(PLAYER_NAME_KEY, player.getName());
|
||||
return player.getName();
|
||||
}
|
||||
return player.getName();
|
||||
}
|
||||
|
||||
return saved;
|
||||
|
||||
@@ -7,7 +7,6 @@ import com.willfp.eco.core.integrations.placeholder.PlaceholderManager;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.TextDecoration;
|
||||
import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||
import net.kyori.adventure.text.minimessage.markdown.DiscordFlavor;
|
||||
import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer;
|
||||
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
|
||||
import net.md_5.bungee.api.ChatColor;
|
||||
@@ -15,7 +14,7 @@ import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
@@ -275,7 +274,7 @@ public final class StringUtils {
|
||||
}
|
||||
|
||||
private static String translateMiniMessage(@NotNull final String message) {
|
||||
return LEGACY_COMPONENT_SERIALIZER.serialize(MiniMessage.withMarkdownFlavor(DiscordFlavor.get()).parse(message));
|
||||
return LEGACY_COMPONENT_SERIALIZER.serialize(MiniMessage.get().parse(message));
|
||||
}
|
||||
|
||||
private static String translateHexColorCodes(@NotNull final String message) {
|
||||
|
||||
@@ -4,7 +4,7 @@ buildscript {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31"
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,14 +16,14 @@ subprojects {
|
||||
|
||||
dependencies {
|
||||
compileOnly project(":eco-api")
|
||||
compileOnly 'org.jetbrains.kotlin:kotlin-stdlib:1.5.31'
|
||||
compileOnly 'org.jetbrains.kotlin:kotlin-stdlib:1.6.0'
|
||||
}
|
||||
|
||||
compileKotlin {
|
||||
kotlinOptions {
|
||||
jvmTarget = "16"
|
||||
jvmTarget = "17"
|
||||
}
|
||||
targetCompatibility = JavaVersion.VERSION_16
|
||||
sourceCompatibility = JavaVersion.VERSION_16
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@ package com.willfp.eco.internal.data
|
||||
|
||||
import com.willfp.eco.core.data.PlayerProfile
|
||||
import com.willfp.eco.core.data.keys.PersistentDataKey
|
||||
import java.util.*
|
||||
import java.util.UUID
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
|
||||
class EcoPlayerProfile(
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.willfp.eco.internal.gui.menu
|
||||
|
||||
import com.willfp.eco.core.gui.menu.Menu
|
||||
import org.bukkit.inventory.Inventory
|
||||
import java.util.*
|
||||
import java.util.WeakHashMap
|
||||
|
||||
object MenuHandler {
|
||||
private val menus = WeakHashMap<ExtendedInventory, EcoMenu>()
|
||||
|
||||
@@ -7,7 +7,7 @@ import com.willfp.eco.core.proxy.ProxyFactory
|
||||
import com.willfp.eco.core.proxy.exceptions.ProxyError
|
||||
import com.willfp.eco.core.proxy.exceptions.UnsupportedVersionException
|
||||
import java.net.URLClassLoader
|
||||
import java.util.*
|
||||
import java.util.IdentityHashMap
|
||||
|
||||
class EcoProxyFactory(
|
||||
private val plugin: EcoPlugin
|
||||
@@ -74,7 +74,8 @@ class EcoProxyFactory(
|
||||
companion object {
|
||||
val SUPPORTED_VERSIONS = listOf(
|
||||
"v1_16_R3",
|
||||
"v1_17_R1"
|
||||
"v1_17_R1",
|
||||
"v1_18_R1"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,11 @@ package com.willfp.eco.internal.requirement
|
||||
|
||||
import com.willfp.eco.core.requirement.Requirement
|
||||
import com.willfp.eco.core.requirement.RequirementFactory
|
||||
import com.willfp.eco.internal.requirement.requirements.*
|
||||
import com.willfp.eco.internal.requirement.requirements.RequirementHasPermission
|
||||
import com.willfp.eco.internal.requirement.requirements.RequirementPlaceholderEquals
|
||||
import com.willfp.eco.internal.requirement.requirements.RequirementPlaceholderGreaterThan
|
||||
import com.willfp.eco.internal.requirement.requirements.RequirementPlaceholderLessThan
|
||||
import com.willfp.eco.internal.requirement.requirements.RequirementTrue
|
||||
|
||||
class EcoRequirementFactory: RequirementFactory {
|
||||
override fun create(name: String): Requirement {
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
group 'com.willfp'
|
||||
version rootProject.version
|
||||
|
||||
subprojects {
|
||||
dependencies {
|
||||
compileOnly project(':eco-core:core-proxy')
|
||||
compileOnly project(':eco-core:core-plugin')
|
||||
compileOnly project(':eco-core:core-backend')
|
||||
}
|
||||
}
|
||||
12
eco-core/core-nms/build.gradle.kts
Normal file
12
eco-core/core-nms/build.gradle.kts
Normal file
@@ -0,0 +1,12 @@
|
||||
group = "com.willfp"
|
||||
version = rootProject.version
|
||||
|
||||
subprojects {
|
||||
dependencies {
|
||||
compileOnly(project(":eco-core:core-proxy"))
|
||||
compileOnly(project(":eco-core:core-plugin"))
|
||||
compileOnly(project(":eco-core:core-backend"))
|
||||
// libraries.minecraft.net machine broke
|
||||
compileOnly("com.github.Mojang:brigadier:1.0.18")
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,4 @@ version rootProject.version
|
||||
|
||||
dependencies {
|
||||
compileOnly 'org.spigotmc:spigot:1.16.5-R0.1-SNAPSHOT'
|
||||
compileOnly 'net.kyori:adventure-api:4.9.1'
|
||||
compileOnly 'net.kyori:adventure-text-serializer-gson:4.8.1'
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
package com.willfp.eco.proxy.v1_16_R3
|
||||
import com.willfp.eco.proxy.AutoCraftProxy
|
||||
package com.willfp.eco.internal.spigot.proxy.v1_16_R3
|
||||
import com.willfp.eco.internal.spigot.proxy.AutoCraftProxy
|
||||
import net.minecraft.server.v1_16_R3.MinecraftKey
|
||||
import net.minecraft.server.v1_16_R3.PacketPlayOutAutoRecipe
|
||||
|
||||
class AutoCraft : AutoCraftProxy {
|
||||
@Throws(NoSuchFieldException::class, IllegalAccessException::class)
|
||||
override fun modifyPacket(packet: Any) {
|
||||
val recipePacket = packet as PacketPlayOutAutoRecipe
|
||||
val fKey = recipePacket.javaClass.getDeclaredField("b")
|
||||
@@ -1,5 +1,5 @@
|
||||
package com.willfp.eco.proxy.v1_16_R3
|
||||
import com.willfp.eco.proxy.BlockBreakProxy
|
||||
package com.willfp.eco.internal.spigot.proxy.v1_16_R3
|
||||
import com.willfp.eco.internal.spigot.proxy.BlockBreakProxy
|
||||
import net.minecraft.server.v1_16_R3.BlockPosition
|
||||
import org.bukkit.block.Block
|
||||
import org.bukkit.craftbukkit.v1_16_R3.entity.CraftPlayer
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.willfp.eco.proxy.v1_16_R3
|
||||
package com.willfp.eco.internal.spigot.proxy.v1_16_R3
|
||||
|
||||
import com.willfp.eco.core.display.Display
|
||||
import com.willfp.eco.proxy.ChatComponentProxy
|
||||
import com.willfp.eco.internal.spigot.proxy.ChatComponentProxy
|
||||
import net.kyori.adventure.nbt.api.BinaryTagHolder
|
||||
import net.kyori.adventure.text.BuildableComponent
|
||||
import net.kyori.adventure.text.Component
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.willfp.eco.proxy.v1_16_R3
|
||||
package com.willfp.eco.internal.spigot.proxy.v1_16_R3
|
||||
import com.willfp.eco.core.fast.FastItemStack
|
||||
import com.willfp.eco.proxy.FastItemStackFactoryProxy
|
||||
import com.willfp.eco.proxy.v1_16_R3.fast.NMSFastItemStack
|
||||
import com.willfp.eco.internal.spigot.proxy.FastItemStackFactoryProxy
|
||||
import com.willfp.eco.internal.spigot.proxy.v1_16_R3.fast.NMSFastItemStack
|
||||
import org.bukkit.inventory.ItemStack
|
||||
|
||||
class FastItemStackFactory : FastItemStackFactoryProxy {
|
||||
@@ -1,12 +1,12 @@
|
||||
package com.willfp.eco.proxy.v1_16_R3
|
||||
package com.willfp.eco.internal.spigot.proxy.v1_16_R3
|
||||
|
||||
import com.mojang.authlib.GameProfile
|
||||
import com.mojang.authlib.properties.Property
|
||||
import com.willfp.eco.proxy.SkullProxy
|
||||
import com.willfp.eco.internal.spigot.proxy.SkullProxy
|
||||
import org.bukkit.inventory.meta.SkullMeta
|
||||
import java.lang.reflect.Field
|
||||
import java.lang.reflect.Method
|
||||
import java.util.*
|
||||
import java.util.UUID
|
||||
|
||||
class Skull : SkullProxy {
|
||||
private lateinit var setProfile: Method
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.willfp.eco.proxy.v1_16_R3
|
||||
package com.willfp.eco.internal.spigot.proxy.v1_16_R3
|
||||
|
||||
import com.willfp.eco.proxy.TPSProxy
|
||||
import com.willfp.eco.internal.spigot.proxy.TPSProxy
|
||||
import org.bukkit.Bukkit
|
||||
import org.bukkit.craftbukkit.v1_16_R3.CraftServer
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.willfp.eco.proxy.v1_16_R3
|
||||
package com.willfp.eco.internal.spigot.proxy.v1_16_R3
|
||||
import com.willfp.eco.core.display.Display
|
||||
import com.willfp.eco.proxy.VillagerTradeProxy
|
||||
import com.willfp.eco.internal.spigot.proxy.VillagerTradeProxy
|
||||
import org.bukkit.craftbukkit.v1_16_R3.inventory.CraftMerchantRecipe
|
||||
import org.bukkit.entity.Player
|
||||
import org.bukkit.inventory.MerchantRecipe
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.willfp.eco.proxy.v1_16_R3.fast
|
||||
package com.willfp.eco.internal.spigot.proxy.v1_16_R3.fast
|
||||
|
||||
import org.bukkit.craftbukkit.v1_16_R3.inventory.CraftItemStack
|
||||
import org.bukkit.inventory.ItemStack
|
||||
@@ -1,8 +1,14 @@
|
||||
package com.willfp.eco.proxy.v1_16_R3.fast
|
||||
package com.willfp.eco.internal.spigot.proxy.v1_16_R3.fast
|
||||
|
||||
import com.willfp.eco.internal.fast.EcoFastItemStack
|
||||
import com.willfp.eco.util.StringUtils
|
||||
import net.minecraft.server.v1_16_R3.*
|
||||
import net.minecraft.server.v1_16_R3.Item
|
||||
import net.minecraft.server.v1_16_R3.ItemEnchantedBook
|
||||
import net.minecraft.server.v1_16_R3.ItemStack
|
||||
import net.minecraft.server.v1_16_R3.Items
|
||||
import net.minecraft.server.v1_16_R3.NBTTagCompound
|
||||
import net.minecraft.server.v1_16_R3.NBTTagList
|
||||
import net.minecraft.server.v1_16_R3.NBTTagString
|
||||
import org.bukkit.craftbukkit.v1_16_R3.inventory.CraftItemStack
|
||||
import org.bukkit.craftbukkit.v1_16_R3.util.CraftMagicNumbers
|
||||
import org.bukkit.craftbukkit.v1_16_R3.util.CraftNamespacedKey
|
||||
@@ -82,7 +88,7 @@ class NMSFastItemStack(itemStack: org.bukkit.inventory.ItemStack) : EcoFastItemS
|
||||
}
|
||||
|
||||
private fun getLoreJSON(): List<String> {
|
||||
val displayTag = handle.a("display")
|
||||
val displayTag = handle.b("display") ?: return emptyList()
|
||||
return if (displayTag.hasKey("Lore")) {
|
||||
val loreTag = displayTag.getList("Lore", CraftMagicNumbers.NBT.TAG_STRING)
|
||||
val lore: MutableList<String> = ArrayList(loreTag.size)
|
||||
@@ -91,7 +97,7 @@ class NMSFastItemStack(itemStack: org.bukkit.inventory.ItemStack) : EcoFastItemS
|
||||
}
|
||||
lore
|
||||
} else {
|
||||
ArrayList()
|
||||
emptyList()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,7 +165,7 @@ class NMSFastItemStack(itemStack: org.bukkit.inventory.ItemStack) : EcoFastItemS
|
||||
}
|
||||
|
||||
override fun hashCode(): Int {
|
||||
return handle.tag.hashCode() * 31 + Item.getId(handle.item)
|
||||
return handle.tag?.hashCode() ?: 0b00010101 * 31 + Item.getId(handle.item)
|
||||
}
|
||||
|
||||
private fun apply() {
|
||||
@@ -1,31 +0,0 @@
|
||||
plugins {
|
||||
id 'xyz.jpenilla.special-gradle' version '1.0.0-SNAPSHOT'
|
||||
}
|
||||
|
||||
group 'com.willfp'
|
||||
version rootProject.version
|
||||
|
||||
dependencies {
|
||||
compileOnly 'org.spigotmc:spigot:1.17.1-R0.1-SNAPSHOT:remapped-mojang'
|
||||
compileOnly 'net.kyori:adventure-api:4.9.1'
|
||||
compileOnly 'net.kyori:adventure-text-serializer-gson:4.8.1'
|
||||
}
|
||||
|
||||
specialGradle {
|
||||
minecraftVersion.set("1.17")
|
||||
specialSourceVersion.set("1.10.0")
|
||||
}
|
||||
|
||||
buildTools {
|
||||
quiet.set(true);
|
||||
}
|
||||
|
||||
configurations.create('mapped')
|
||||
|
||||
artifacts {
|
||||
mapped jar.outputs.files.files.toArray()[0]
|
||||
}
|
||||
|
||||
productionMappedJar.mustRunAfter(clean)
|
||||
productionMappedJar.mustRunAfter(compileKotlin)
|
||||
build.dependsOn productionMappedJar
|
||||
16
eco-core/core-nms/v1_17_R1/build.gradle.kts
Normal file
16
eco-core/core-nms/v1_17_R1/build.gradle.kts
Normal file
@@ -0,0 +1,16 @@
|
||||
plugins {
|
||||
id("io.papermc.paperweight.userdev") version "1.2.0"
|
||||
}
|
||||
|
||||
group = "com.willfp"
|
||||
version = rootProject.version
|
||||
|
||||
dependencies {
|
||||
paperDevBundle("1.17.1-R0.1-SNAPSHOT")
|
||||
}
|
||||
|
||||
tasks {
|
||||
build {
|
||||
dependsOn(reobfJar)
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,10 @@
|
||||
package com.willfp.eco.proxy.v1_17_R1
|
||||
package com.willfp.eco.internal.spigot.proxy.v1_17_R1
|
||||
|
||||
import com.willfp.eco.internal.spigot.proxy.AutoCraftProxy
|
||||
import net.minecraft.network.protocol.game.ClientboundPlaceGhostRecipePacket
|
||||
import net.minecraft.resources.ResourceLocation
|
||||
import com.willfp.eco.proxy.AutoCraftProxy
|
||||
|
||||
class AutoCraft : AutoCraftProxy {
|
||||
@Throws(NoSuchFieldException::class, IllegalAccessException::class)
|
||||
override fun modifyPacket(packet: Any) {
|
||||
val recipePacket = packet as ClientboundPlaceGhostRecipePacket
|
||||
val fKey = recipePacket.javaClass.getDeclaredField("b")
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.willfp.eco.proxy.v1_17_R1
|
||||
package com.willfp.eco.internal.spigot.proxy.v1_17_R1
|
||||
|
||||
import com.willfp.eco.internal.spigot.proxy.BlockBreakProxy
|
||||
import org.bukkit.block.Block
|
||||
import org.bukkit.entity.Player
|
||||
import com.willfp.eco.proxy.BlockBreakProxy
|
||||
|
||||
class BlockBreak : BlockBreakProxy {
|
||||
override fun breakBlock(
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.willfp.eco.proxy.v1_17_R1
|
||||
package com.willfp.eco.internal.spigot.proxy.v1_17_R1
|
||||
|
||||
import com.willfp.eco.core.display.Display
|
||||
import com.willfp.eco.proxy.ChatComponentProxy
|
||||
import com.willfp.eco.internal.spigot.proxy.ChatComponentProxy
|
||||
import net.kyori.adventure.nbt.api.BinaryTagHolder
|
||||
import net.kyori.adventure.text.BuildableComponent
|
||||
import net.kyori.adventure.text.Component
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.willfp.eco.proxy.v1_17_R1
|
||||
package com.willfp.eco.internal.spigot.proxy.v1_17_R1
|
||||
|
||||
import com.willfp.eco.core.fast.FastItemStack
|
||||
import com.willfp.eco.proxy.v1_17_R1.fast.NMSFastItemStack
|
||||
import com.willfp.eco.internal.spigot.proxy.v1_17_R1.fast.NMSFastItemStack
|
||||
import com.willfp.eco.internal.spigot.proxy.FastItemStackFactoryProxy
|
||||
import org.bukkit.inventory.ItemStack
|
||||
import com.willfp.eco.proxy.FastItemStackFactoryProxy
|
||||
|
||||
class FastItemStackFactory : FastItemStackFactoryProxy {
|
||||
override fun create(itemStack: ItemStack): FastItemStack {
|
||||
@@ -1,12 +1,12 @@
|
||||
package com.willfp.eco.proxy.v1_17_R1
|
||||
package com.willfp.eco.internal.spigot.proxy.v1_17_R1
|
||||
|
||||
import com.mojang.authlib.GameProfile
|
||||
import com.mojang.authlib.properties.Property
|
||||
import com.willfp.eco.proxy.SkullProxy
|
||||
import com.willfp.eco.internal.spigot.proxy.SkullProxy
|
||||
import org.bukkit.inventory.meta.SkullMeta
|
||||
import java.lang.reflect.Field
|
||||
import java.lang.reflect.Method
|
||||
import java.util.*
|
||||
import java.util.UUID
|
||||
|
||||
class Skull : SkullProxy {
|
||||
private lateinit var setProfile: Method
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.willfp.eco.proxy.v1_17_R1
|
||||
package com.willfp.eco.internal.spigot.proxy.v1_17_R1
|
||||
|
||||
import com.willfp.eco.proxy.TPSProxy
|
||||
import com.willfp.eco.internal.spigot.proxy.TPSProxy
|
||||
import org.bukkit.Bukkit
|
||||
import org.bukkit.craftbukkit.v1_17_R1.CraftServer
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.willfp.eco.proxy.v1_17_R1
|
||||
package com.willfp.eco.internal.spigot.proxy.v1_17_R1
|
||||
|
||||
import com.willfp.eco.core.display.Display
|
||||
import com.willfp.eco.proxy.VillagerTradeProxy
|
||||
import com.willfp.eco.internal.spigot.proxy.VillagerTradeProxy
|
||||
import net.minecraft.world.item.trading.MerchantOffer
|
||||
import org.bukkit.craftbukkit.v1_17_R1.inventory.CraftMerchantRecipe
|
||||
import org.bukkit.entity.Player
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.willfp.eco.proxy.v1_17_R1.fast
|
||||
package com.willfp.eco.internal.spigot.proxy.v1_17_R1.fast
|
||||
|
||||
import org.bukkit.craftbukkit.v1_17_R1.inventory.CraftItemStack
|
||||
import org.bukkit.inventory.ItemStack
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.willfp.eco.proxy.v1_17_R1.fast
|
||||
package com.willfp.eco.internal.spigot.proxy.v1_17_R1.fast
|
||||
|
||||
import com.willfp.eco.internal.fast.EcoFastItemStack
|
||||
import com.willfp.eco.util.StringUtils
|
||||
@@ -101,7 +101,7 @@ class NMSFastItemStack(itemStack: org.bukkit.inventory.ItemStack) : EcoFastItemS
|
||||
}
|
||||
|
||||
private fun getLoreJSON(): List<String> {
|
||||
val displayTag = handle.getOrCreateTagElement("display")
|
||||
val displayTag = handle.getTagElement("display") ?: return emptyList()
|
||||
return if (displayTag.contains("Lore")) {
|
||||
val loreTag = displayTag.getList("Lore", CraftMagicNumbers.NBT.TAG_STRING)
|
||||
val lore: MutableList<String> = ArrayList(loreTag.size)
|
||||
@@ -112,7 +112,7 @@ class NMSFastItemStack(itemStack: org.bukkit.inventory.ItemStack) : EcoFastItemS
|
||||
|
||||
lore
|
||||
} else {
|
||||
ArrayList()
|
||||
emptyList()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ class NMSFastItemStack(itemStack: org.bukkit.inventory.ItemStack) : EcoFastItemS
|
||||
}
|
||||
|
||||
override fun hashCode(): Int {
|
||||
return handle.tag.hashCode() * 31 + Item.getId(handle.item)
|
||||
return handle.tag?.hashCode() ?: 0b00010101 * 31 + Item.getId(handle.item)
|
||||
}
|
||||
|
||||
private fun apply() {
|
||||
6
eco-core/core-nms/v1_18_R1/build.gradle.kts
Normal file
6
eco-core/core-nms/v1_18_R1/build.gradle.kts
Normal file
@@ -0,0 +1,6 @@
|
||||
group = "com.willfp"
|
||||
version = rootProject.version
|
||||
|
||||
dependencies {
|
||||
implementation(files("./impl.jar"))
|
||||
}
|
||||
BIN
eco-core/core-nms/v1_18_R1/impl.jar
Normal file
BIN
eco-core/core-nms/v1_18_R1/impl.jar
Normal file
Binary file not shown.
@@ -7,15 +7,12 @@ dependencies {
|
||||
exclude group: 'net.kyori', module: 'adventure-api'
|
||||
}
|
||||
compileOnly 'net.kyori:adventure-platform-bukkit:4.0.0'
|
||||
compileOnly 'net.kyori:adventure-api:4.9.2'
|
||||
compileOnly 'net.kyori:adventure-text-serializer-gson:4.9.2'
|
||||
compileOnly 'net.kyori:adventure-text-serializer-legacy:4.9.2'
|
||||
compileOnly 'org.apache.maven:maven-artifact:3.8.1'
|
||||
compileOnly 'com.google.code.gson:gson:2.8.8'
|
||||
compileOnly 'org.spigotmc:spigot-api:1.17.1-R0.1-SNAPSHOT'
|
||||
compileOnly project(":eco-core:core-proxy")
|
||||
compileOnly project(":eco-core:core-backend")
|
||||
compileOnly 'com.comphenix.protocol:ProtocolLib:4.7.1-SNAPSHOT'
|
||||
compileOnly 'com.comphenix.protocol:ProtocolLib:4.6.1-SNAPSHOT'
|
||||
compileOnly 'com.sk89q.worldguard:worldguard-bukkit:7.0.7-SNAPSHOT'
|
||||
compileOnly 'com.github.TechFortress:GriefPrevention:16.17.1'
|
||||
compileOnly 'com.massivecraft:Factions:1.6.9.5-U0.5.10'
|
||||
@@ -30,9 +27,9 @@ dependencies {
|
||||
compileOnly 'com.github.brcdev-minecraft:shopgui-api:2.2.0'
|
||||
compileOnly 'com.github.LoneDev6:API-ItemsAdder:2.4.7'
|
||||
compileOnly 'com.arcaniax:HeadDatabase-API:1.3.0'
|
||||
compileOnly 'org.jetbrains.exposed:exposed-core:0.35.1'
|
||||
compileOnly 'org.jetbrains.exposed:exposed-dao:0.35.1'
|
||||
compileOnly 'org.jetbrains.exposed:exposed-jdbc:0.35.1'
|
||||
compileOnly 'org.jetbrains.exposed:exposed-core:0.36.2'
|
||||
compileOnly 'org.jetbrains.exposed:exposed-dao:0.36.2'
|
||||
compileOnly 'org.jetbrains.exposed:exposed-jdbc:0.36.2'
|
||||
compileOnly 'mysql:mysql-connector-java:8.0.25'
|
||||
compileOnly 'com.gmail.filoghost.holographicdisplays:holographicdisplays-api:2.4.0'
|
||||
compileOnly 'net.essentialsx:EssentialsX:2.19.0'
|
||||
@@ -41,6 +38,8 @@ dependencies {
|
||||
compileOnly 'world.bentobox:bentobox:1.17.3-SNAPSHOT'
|
||||
compileOnly 'com.google.guava:guava:31.0.1-jre'
|
||||
compileOnly 'com.iridium:IridiumSkyblock:3.1.2'
|
||||
compileOnly 'com.github.WillFP:CrashClaim:1.0.19'
|
||||
compileOnly 'com.wolfyscript.wolfyutilities:wolfyutilities:1.7.8.1'
|
||||
|
||||
// CombatLogX V10 + NewbieHelper Expansion
|
||||
compileOnly 'com.SirBlobman.combatlogx:CombatLogX-API:10.0.0.0-SNAPSHOT'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.willfp.eco.spigot.recipes;
|
||||
package com.willfp.eco.internal.spigot.recipes;
|
||||
|
||||
import com.willfp.eco.core.EcoPlugin;
|
||||
import com.willfp.eco.core.PluginDependent;
|
||||
@@ -1,24 +1,9 @@
|
||||
package com.willfp.eco.spigot
|
||||
package com.willfp.eco.internal.spigot
|
||||
|
||||
import com.willfp.eco.core.EcoPlugin
|
||||
import com.willfp.eco.core.Handler
|
||||
import com.willfp.eco.core.config.updating.ConfigHandler
|
||||
import com.willfp.eco.core.config.wrapper.ConfigFactory
|
||||
import com.willfp.eco.core.data.PlayerProfileHandler
|
||||
import com.willfp.eco.core.data.keys.KeyRegistry
|
||||
import com.willfp.eco.core.drops.DropQueueFactory
|
||||
import com.willfp.eco.core.events.EventManager
|
||||
import com.willfp.eco.core.extensions.ExtensionLoader
|
||||
import com.willfp.eco.core.factory.MetadataValueFactory
|
||||
import com.willfp.eco.core.factory.NamespacedKeyFactory
|
||||
import com.willfp.eco.core.factory.RunnableFactory
|
||||
import com.willfp.eco.core.fast.FastItemStack
|
||||
import com.willfp.eco.core.gui.GUIFactory
|
||||
import com.willfp.eco.core.integrations.placeholder.PlaceholderIntegration
|
||||
import com.willfp.eco.core.proxy.Cleaner
|
||||
import com.willfp.eco.core.proxy.ProxyFactory
|
||||
import com.willfp.eco.core.requirement.RequirementFactory
|
||||
import com.willfp.eco.core.scheduling.Scheduler
|
||||
import com.willfp.eco.internal.EcoCleaner
|
||||
import com.willfp.eco.internal.Plugins
|
||||
import com.willfp.eco.internal.config.EcoConfigFactory
|
||||
@@ -35,18 +20,18 @@ import com.willfp.eco.internal.logging.EcoLogger
|
||||
import com.willfp.eco.internal.proxy.EcoProxyFactory
|
||||
import com.willfp.eco.internal.requirement.EcoRequirementFactory
|
||||
import com.willfp.eco.internal.scheduling.EcoScheduler
|
||||
import com.willfp.eco.proxy.FastItemStackFactoryProxy
|
||||
import com.willfp.eco.spigot.data.EcoKeyRegistry
|
||||
import com.willfp.eco.spigot.data.EcoPlayerProfileHandler
|
||||
import com.willfp.eco.spigot.data.storage.MySQLDataHandler
|
||||
import com.willfp.eco.spigot.data.storage.YamlDataHandler
|
||||
import com.willfp.eco.spigot.integrations.bstats.MetricHandler
|
||||
import com.willfp.eco.internal.spigot.data.EcoKeyRegistry
|
||||
import com.willfp.eco.internal.spigot.data.EcoPlayerProfileHandler
|
||||
import com.willfp.eco.internal.spigot.data.storage.MySQLDataHandler
|
||||
import com.willfp.eco.internal.spigot.data.storage.YamlDataHandler
|
||||
import com.willfp.eco.internal.spigot.integrations.bstats.MetricHandler
|
||||
import com.willfp.eco.internal.spigot.proxy.FastItemStackFactoryProxy
|
||||
import net.kyori.adventure.platform.bukkit.BukkitAudiences
|
||||
import org.bukkit.inventory.ItemStack
|
||||
import java.util.logging.Logger
|
||||
|
||||
@Suppress("UNUSED")
|
||||
class EcoHandler : EcoSpigotPlugin(), Handler {
|
||||
class EcoHandler : com.willfp.eco.internal.spigot.EcoSpigotPlugin(), Handler {
|
||||
private val cleaner = EcoCleaner()
|
||||
private val requirementFactory = EcoRequirementFactory()
|
||||
private var adventure: BukkitAudiences? = null
|
||||
@@ -56,31 +41,31 @@ class EcoHandler : EcoSpigotPlugin(), Handler {
|
||||
MySQLDataHandler(this) else YamlDataHandler(this)
|
||||
)
|
||||
|
||||
override fun createScheduler(plugin: EcoPlugin): Scheduler {
|
||||
override fun createScheduler(plugin: EcoPlugin): EcoScheduler {
|
||||
return EcoScheduler(plugin)
|
||||
}
|
||||
|
||||
override fun createEventManager(plugin: EcoPlugin): EventManager {
|
||||
override fun createEventManager(plugin: EcoPlugin): EcoEventManager {
|
||||
return EcoEventManager(plugin)
|
||||
}
|
||||
|
||||
override fun createNamespacedKeyFactory(plugin: EcoPlugin): NamespacedKeyFactory {
|
||||
override fun createNamespacedKeyFactory(plugin: EcoPlugin): EcoNamespacedKeyFactory {
|
||||
return EcoNamespacedKeyFactory(plugin)
|
||||
}
|
||||
|
||||
override fun createMetadataValueFactory(plugin: EcoPlugin): MetadataValueFactory {
|
||||
override fun createMetadataValueFactory(plugin: EcoPlugin): EcoMetadataValueFactory {
|
||||
return EcoMetadataValueFactory(plugin)
|
||||
}
|
||||
|
||||
override fun createRunnableFactory(plugin: EcoPlugin): RunnableFactory {
|
||||
override fun createRunnableFactory(plugin: EcoPlugin): EcoRunnableFactory {
|
||||
return EcoRunnableFactory(plugin)
|
||||
}
|
||||
|
||||
override fun createExtensionLoader(plugin: EcoPlugin): ExtensionLoader {
|
||||
override fun createExtensionLoader(plugin: EcoPlugin): EcoExtensionLoader {
|
||||
return EcoExtensionLoader(plugin)
|
||||
}
|
||||
|
||||
override fun createConfigHandler(plugin: EcoPlugin): ConfigHandler {
|
||||
override fun createConfigHandler(plugin: EcoPlugin): EcoConfigHandler {
|
||||
return EcoConfigHandler(plugin)
|
||||
}
|
||||
|
||||
@@ -96,23 +81,23 @@ class EcoHandler : EcoSpigotPlugin(), Handler {
|
||||
return this
|
||||
}
|
||||
|
||||
override fun getConfigFactory(): ConfigFactory {
|
||||
override fun getConfigFactory(): EcoConfigFactory {
|
||||
return EcoConfigFactory()
|
||||
}
|
||||
|
||||
override fun getDropQueueFactory(): DropQueueFactory {
|
||||
override fun getDropQueueFactory(): EcoDropQueueFactory {
|
||||
return EcoDropQueueFactory()
|
||||
}
|
||||
|
||||
override fun getGUIFactory(): GUIFactory {
|
||||
override fun getGUIFactory(): EcoGUIFactory {
|
||||
return EcoGUIFactory()
|
||||
}
|
||||
|
||||
override fun getCleaner(): Cleaner {
|
||||
override fun getCleaner(): EcoCleaner {
|
||||
return cleaner
|
||||
}
|
||||
|
||||
override fun createProxyFactory(plugin: EcoPlugin): ProxyFactory {
|
||||
override fun createProxyFactory(plugin: EcoPlugin): EcoProxyFactory {
|
||||
return EcoProxyFactory(plugin)
|
||||
}
|
||||
|
||||
@@ -136,7 +121,7 @@ class EcoHandler : EcoSpigotPlugin(), Handler {
|
||||
MetricHandler.createMetrics(plugin, this.ecoPlugin)
|
||||
}
|
||||
|
||||
override fun getRequirementFactory(): RequirementFactory {
|
||||
override fun getRequirementFactory(): EcoRequirementFactory {
|
||||
return requirementFactory
|
||||
}
|
||||
|
||||
@@ -144,11 +129,11 @@ class EcoHandler : EcoSpigotPlugin(), Handler {
|
||||
return adventure
|
||||
}
|
||||
|
||||
override fun getKeyRegistry(): KeyRegistry {
|
||||
override fun getKeyRegistry(): EcoKeyRegistry {
|
||||
return keyRegistry
|
||||
}
|
||||
|
||||
override fun getPlayerProfileHandler(): PlayerProfileHandler {
|
||||
override fun getPlayerProfileHandler(): EcoPlayerProfileHandler {
|
||||
return playerProfileHandler
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.willfp.eco.spigot
|
||||
package com.willfp.eco.internal.spigot
|
||||
|
||||
import com.willfp.eco.core.AbstractPacketAdapter
|
||||
import com.willfp.eco.core.Eco
|
||||
@@ -15,42 +15,64 @@ import com.willfp.eco.core.integrations.hologram.HologramManager
|
||||
import com.willfp.eco.core.integrations.mcmmo.McmmoManager
|
||||
import com.willfp.eco.core.integrations.shop.ShopManager
|
||||
import com.willfp.eco.core.items.Items
|
||||
import com.willfp.eco.core.items.args.CustomModelDataArgParser
|
||||
import com.willfp.eco.core.items.args.EnchantmentArgParser
|
||||
import com.willfp.eco.core.items.args.TextureArgParser
|
||||
import com.willfp.eco.internal.display.EcoDisplayHandler
|
||||
import com.willfp.eco.internal.drops.DropManager
|
||||
import com.willfp.eco.proxy.BlockBreakProxy
|
||||
import com.willfp.eco.proxy.FastItemStackFactoryProxy
|
||||
import com.willfp.eco.proxy.SkullProxy
|
||||
import com.willfp.eco.proxy.TPSProxy
|
||||
import com.willfp.eco.spigot.arrows.ArrowDataListener
|
||||
import com.willfp.eco.spigot.data.DataListener
|
||||
import com.willfp.eco.spigot.data.PlayerBlockListener
|
||||
import com.willfp.eco.spigot.data.storage.ProfileSaver
|
||||
import com.willfp.eco.spigot.display.*
|
||||
import com.willfp.eco.spigot.display.frame.clearFrames
|
||||
import com.willfp.eco.spigot.drops.CollatedRunnable
|
||||
import com.willfp.eco.spigot.eventlisteners.EntityDeathByEntityListeners
|
||||
import com.willfp.eco.spigot.eventlisteners.NaturalExpGainListeners
|
||||
import com.willfp.eco.spigot.eventlisteners.PlayerJumpListeners
|
||||
import com.willfp.eco.spigot.eventlisteners.armor.ArmorChangeEventListeners
|
||||
import com.willfp.eco.spigot.eventlisteners.armor.ArmorListener
|
||||
import com.willfp.eco.spigot.gui.GUIListener
|
||||
import com.willfp.eco.spigot.integrations.afk.AFKIntegrationCMI
|
||||
import com.willfp.eco.spigot.integrations.afk.AFKIntegrationEssentials
|
||||
import com.willfp.eco.spigot.integrations.anticheat.*
|
||||
import com.willfp.eco.spigot.integrations.antigrief.*
|
||||
import com.willfp.eco.spigot.integrations.customitems.CustomItemsHeadDatabase
|
||||
import com.willfp.eco.spigot.integrations.customitems.CustomItemsItemsAdder
|
||||
import com.willfp.eco.spigot.integrations.customitems.CustomItemsOraxen
|
||||
import com.willfp.eco.spigot.integrations.economy.EconomyVault
|
||||
import com.willfp.eco.spigot.integrations.hologram.HologramCMI
|
||||
import com.willfp.eco.spigot.integrations.hologram.HologramGHolo
|
||||
import com.willfp.eco.spigot.integrations.hologram.HologramHolographicDisplays
|
||||
import com.willfp.eco.spigot.integrations.mcmmo.McmmoIntegrationImpl
|
||||
import com.willfp.eco.spigot.integrations.multiverseinventories.MultiverseInventoriesIntegration
|
||||
import com.willfp.eco.spigot.integrations.shop.ShopShopGuiPlus
|
||||
import com.willfp.eco.spigot.recipes.ShapedRecipeListener
|
||||
import com.willfp.eco.internal.spigot.arrows.ArrowDataListener
|
||||
import com.willfp.eco.internal.spigot.data.DataListener
|
||||
import com.willfp.eco.internal.spigot.data.PlayerBlockListener
|
||||
import com.willfp.eco.internal.spigot.data.storage.ProfileSaver
|
||||
import com.willfp.eco.internal.spigot.display.PacketAutoRecipe
|
||||
import com.willfp.eco.internal.spigot.display.PacketChat
|
||||
import com.willfp.eco.internal.spigot.display.PacketOpenWindowMerchant
|
||||
import com.willfp.eco.internal.spigot.display.PacketSetCreativeSlot
|
||||
import com.willfp.eco.internal.spigot.display.PacketSetSlot
|
||||
import com.willfp.eco.internal.spigot.display.PacketWindowItems
|
||||
import com.willfp.eco.internal.spigot.display.frame.clearFrames
|
||||
import com.willfp.eco.internal.spigot.drops.CollatedRunnable
|
||||
import com.willfp.eco.internal.spigot.eventlisteners.EntityDeathByEntityListeners
|
||||
import com.willfp.eco.internal.spigot.eventlisteners.NaturalExpGainListeners
|
||||
import com.willfp.eco.internal.spigot.eventlisteners.PlayerJumpListeners
|
||||
import com.willfp.eco.internal.spigot.eventlisteners.armor.ArmorChangeEventListeners
|
||||
import com.willfp.eco.internal.spigot.eventlisteners.armor.ArmorListener
|
||||
import com.willfp.eco.internal.spigot.gui.GUIListener
|
||||
import com.willfp.eco.internal.spigot.integrations.afk.AFKIntegrationCMI
|
||||
import com.willfp.eco.internal.spigot.integrations.afk.AFKIntegrationEssentials
|
||||
import com.willfp.eco.internal.spigot.integrations.anticheat.AnticheatAAC
|
||||
import com.willfp.eco.internal.spigot.integrations.anticheat.AnticheatAlice
|
||||
import com.willfp.eco.internal.spigot.integrations.anticheat.AnticheatMatrix
|
||||
import com.willfp.eco.internal.spigot.integrations.anticheat.AnticheatNCP
|
||||
import com.willfp.eco.internal.spigot.integrations.anticheat.AnticheatSpartan
|
||||
import com.willfp.eco.internal.spigot.integrations.anticheat.AnticheatVulcan
|
||||
import com.willfp.eco.internal.spigot.integrations.antigrief.AntigriefBentoBox
|
||||
import com.willfp.eco.internal.spigot.integrations.antigrief.AntigriefCombatLogXV10
|
||||
import com.willfp.eco.internal.spigot.integrations.antigrief.AntigriefCombatLogXV11
|
||||
import com.willfp.eco.internal.spigot.integrations.antigrief.AntigriefCrashClaim
|
||||
import com.willfp.eco.internal.spigot.integrations.antigrief.AntigriefDeluxeCombat
|
||||
import com.willfp.eco.internal.spigot.integrations.antigrief.AntigriefFactionsUUID
|
||||
import com.willfp.eco.internal.spigot.integrations.antigrief.AntigriefGriefPrevention
|
||||
import com.willfp.eco.internal.spigot.integrations.antigrief.AntigriefIridiumSkyblock
|
||||
import com.willfp.eco.internal.spigot.integrations.antigrief.AntigriefKingdoms
|
||||
import com.willfp.eco.internal.spigot.integrations.antigrief.AntigriefLands
|
||||
import com.willfp.eco.internal.spigot.integrations.antigrief.AntigriefSuperiorSkyblock2
|
||||
import com.willfp.eco.internal.spigot.integrations.antigrief.AntigriefTowny
|
||||
import com.willfp.eco.internal.spigot.integrations.antigrief.AntigriefWorldGuard
|
||||
import com.willfp.eco.internal.spigot.integrations.customitems.CustomItemsHeadDatabase
|
||||
import com.willfp.eco.internal.spigot.integrations.customitems.CustomItemsItemsAdder
|
||||
import com.willfp.eco.internal.spigot.integrations.customitems.CustomItemsOraxen
|
||||
import com.willfp.eco.internal.spigot.integrations.economy.EconomyVault
|
||||
import com.willfp.eco.internal.spigot.integrations.hologram.HologramCMI
|
||||
import com.willfp.eco.internal.spigot.integrations.hologram.HologramHolographicDisplays
|
||||
import com.willfp.eco.internal.spigot.integrations.mcmmo.McmmoIntegrationImpl
|
||||
import com.willfp.eco.internal.spigot.integrations.multiverseinventories.MultiverseInventoriesIntegration
|
||||
import com.willfp.eco.internal.spigot.integrations.shop.ShopShopGuiPlus
|
||||
import com.willfp.eco.internal.spigot.proxy.BlockBreakProxy
|
||||
import com.willfp.eco.internal.spigot.proxy.FastItemStackFactoryProxy
|
||||
import com.willfp.eco.internal.spigot.proxy.SkullProxy
|
||||
import com.willfp.eco.internal.spigot.proxy.TPSProxy
|
||||
import com.willfp.eco.internal.spigot.recipes.ShapedRecipeListener
|
||||
import com.willfp.eco.util.BlockUtils
|
||||
import com.willfp.eco.util.ServerUtils
|
||||
import com.willfp.eco.util.SkullUtils
|
||||
@@ -64,12 +86,13 @@ import org.bukkit.inventory.ItemStack
|
||||
abstract class EcoSpigotPlugin : EcoPlugin(
|
||||
773,
|
||||
10043,
|
||||
"com.willfp.eco.proxy",
|
||||
"com.willfp.eco.internal.spigot.proxy",
|
||||
"&a"
|
||||
) {
|
||||
init {
|
||||
Items.registerArgParser(EnchantmentArgParser())
|
||||
Items.registerArgParser(TextureArgParser())
|
||||
Items.registerArgParser(CustomModelDataArgParser())
|
||||
|
||||
val skullProxy = getProxy(SkullProxy::class.java)
|
||||
SkullUtils.initialize(
|
||||
@@ -154,6 +177,7 @@ abstract class EcoSpigotPlugin : EcoPlugin(
|
||||
IntegrationLoader("Towny") { AntigriefManager.register(AntigriefTowny()) },
|
||||
IntegrationLoader("Lands") { AntigriefManager.register(AntigriefLands(this)) },
|
||||
IntegrationLoader("Kingdoms") { AntigriefManager.register(AntigriefKingdoms()) },
|
||||
IntegrationLoader("CrashClaim") { AntigriefManager.register(AntigriefCrashClaim()) },
|
||||
IntegrationLoader("CombatLogX") {
|
||||
val pluginManager = Bukkit.getPluginManager()
|
||||
val combatLogXPlugin = pluginManager.getPlugin("CombatLogX") ?: return@IntegrationLoader
|
||||
@@ -185,7 +209,7 @@ abstract class EcoSpigotPlugin : EcoPlugin(
|
||||
// Hologram
|
||||
IntegrationLoader("HolographicDisplays") { HologramManager.register(HologramHolographicDisplays(this)) },
|
||||
IntegrationLoader("CMI") { HologramManager.register(HologramCMI()) },
|
||||
IntegrationLoader("GHolo") { HologramManager.register(HologramGHolo()) },
|
||||
//IntegrationLoader("GHolo") { HologramManager.register(HologramGHolo()) },
|
||||
|
||||
// AFK
|
||||
IntegrationLoader("Essentials") { AFKManager.register(AFKIntegrationEssentials()) },
|
||||
@@ -230,7 +254,7 @@ abstract class EcoSpigotPlugin : EcoPlugin(
|
||||
GUIListener(this),
|
||||
ArrowDataListener(this),
|
||||
ArmorChangeEventListeners(this),
|
||||
DataListener(),
|
||||
DataListener(this),
|
||||
PlayerBlockListener(this)
|
||||
)
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.willfp.eco.spigot.arrows
|
||||
package com.willfp.eco.internal.spigot.arrows
|
||||
|
||||
import com.willfp.eco.core.EcoPlugin
|
||||
import org.bukkit.Material
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.willfp.eco.spigot.data
|
||||
package com.willfp.eco.internal.spigot.data
|
||||
|
||||
import com.willfp.eco.core.Eco
|
||||
import com.willfp.eco.core.EcoPlugin
|
||||
import com.willfp.eco.util.PlayerUtils
|
||||
import org.bukkit.event.EventHandler
|
||||
import org.bukkit.event.Listener
|
||||
@@ -8,16 +9,19 @@ import org.bukkit.event.player.PlayerJoinEvent
|
||||
import org.bukkit.event.player.PlayerLoginEvent
|
||||
import org.bukkit.event.player.PlayerQuitEvent
|
||||
|
||||
class DataListener : Listener {
|
||||
class DataListener(
|
||||
private val plugin: EcoPlugin
|
||||
) : Listener {
|
||||
@EventHandler
|
||||
fun onLeave(event: PlayerQuitEvent) {
|
||||
PlayerUtils.updateSavedDisplayName(event.player)
|
||||
Eco.getHandler().playerProfileHandler.unloadPlayer(event.player.uniqueId)
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
fun onJoin(event: PlayerJoinEvent) {
|
||||
PlayerUtils.updateSavedDisplayName(event.player)
|
||||
plugin.scheduler.runLater({
|
||||
PlayerUtils.updateSavedDisplayName(event.player)
|
||||
}, 5)
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.willfp.eco.spigot.data
|
||||
package com.willfp.eco.internal.spigot.data
|
||||
|
||||
import com.willfp.eco.core.Eco
|
||||
import com.willfp.eco.core.data.keys.KeyRegistry
|
||||
import com.willfp.eco.core.data.keys.PersistentDataKey
|
||||
import com.willfp.eco.core.data.keys.PersistentDataKeyType
|
||||
import com.willfp.eco.spigot.EcoSpigotPlugin
|
||||
import com.willfp.eco.internal.spigot.EcoSpigotPlugin
|
||||
import org.bukkit.NamespacedKey
|
||||
|
||||
class EcoKeyRegistry(
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.willfp.eco.spigot.data
|
||||
package com.willfp.eco.internal.spigot.data
|
||||
|
||||
import com.willfp.eco.core.data.PlayerProfile
|
||||
import com.willfp.eco.core.data.PlayerProfileHandler
|
||||
import com.willfp.eco.core.data.keys.PersistentDataKey
|
||||
import com.willfp.eco.internal.data.EcoPlayerProfile
|
||||
import com.willfp.eco.spigot.data.storage.DataHandler
|
||||
import com.willfp.eco.internal.spigot.data.storage.DataHandler
|
||||
import java.util.UUID
|
||||
|
||||
class EcoPlayerProfileHandler(
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.willfp.eco.spigot.data
|
||||
package com.willfp.eco.internal.spigot.data
|
||||
|
||||
import com.willfp.eco.core.EcoPlugin
|
||||
import org.bukkit.block.Block
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.willfp.eco.spigot.data.storage
|
||||
package com.willfp.eco.internal.spigot.data.storage
|
||||
|
||||
import com.willfp.eco.core.data.keys.PersistentDataKey
|
||||
import org.bukkit.NamespacedKey
|
||||
import java.util.*
|
||||
import java.util.UUID
|
||||
|
||||
interface DataHandler {
|
||||
fun save() {
|
||||
@@ -1,17 +1,29 @@
|
||||
package com.willfp.eco.spigot.data.storage
|
||||
package com.willfp.eco.internal.spigot.data.storage
|
||||
|
||||
import com.google.common.util.concurrent.ThreadFactoryBuilder
|
||||
import com.willfp.eco.core.Eco
|
||||
import com.willfp.eco.core.data.PlayerProfile
|
||||
import com.willfp.eco.core.data.keys.PersistentDataKey
|
||||
import com.willfp.eco.core.data.keys.PersistentDataKeyType
|
||||
import com.willfp.eco.spigot.EcoSpigotPlugin
|
||||
import com.willfp.eco.internal.spigot.EcoSpigotPlugin
|
||||
import org.apache.logging.log4j.Level
|
||||
import org.bukkit.NamespacedKey
|
||||
import org.jetbrains.exposed.dao.id.UUIDTable
|
||||
import org.jetbrains.exposed.sql.*
|
||||
import org.jetbrains.exposed.sql.BooleanColumnType
|
||||
import org.jetbrains.exposed.sql.Column
|
||||
import org.jetbrains.exposed.sql.Database
|
||||
import org.jetbrains.exposed.sql.DoubleColumnType
|
||||
import org.jetbrains.exposed.sql.IntegerColumnType
|
||||
import org.jetbrains.exposed.sql.ResultRow
|
||||
import org.jetbrains.exposed.sql.SchemaUtils
|
||||
import org.jetbrains.exposed.sql.VarCharColumnType
|
||||
import org.jetbrains.exposed.sql.exposedLogger
|
||||
import org.jetbrains.exposed.sql.insert
|
||||
import org.jetbrains.exposed.sql.select
|
||||
import org.jetbrains.exposed.sql.transactions.transaction
|
||||
import java.util.*
|
||||
import org.jetbrains.exposed.sql.update
|
||||
import java.util.UUID
|
||||
import java.util.concurrent.Callable
|
||||
import java.util.concurrent.Executors
|
||||
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
@@ -20,7 +32,7 @@ class MySQLDataHandler(
|
||||
) : DataHandler {
|
||||
private val columns = mutableMapOf<String, Column<*>>()
|
||||
private val threadFactory = ThreadFactoryBuilder().setNameFormat("eco-mysql-thread-%d").build()
|
||||
private val executor = Executors.newCachedThreadPool(threadFactory)
|
||||
private val executor = Executors.newFixedThreadPool(plugin.configYml.getInt("mysql.threads"), threadFactory)
|
||||
|
||||
init {
|
||||
Database.connect(
|
||||
@@ -38,13 +50,17 @@ class MySQLDataHandler(
|
||||
}
|
||||
|
||||
// Get Exposed to shut the hell up
|
||||
exposedLogger::class.java.getDeclaredField("logger").apply { isAccessible = true }
|
||||
.apply {
|
||||
get(exposedLogger).apply {
|
||||
this.javaClass.getDeclaredMethod("setLevel", Level::class.java)
|
||||
.invoke(this, Level.OFF)
|
||||
try {
|
||||
exposedLogger::class.java.getDeclaredField("logger").apply { isAccessible = true }
|
||||
.apply {
|
||||
get(exposedLogger).apply {
|
||||
this.javaClass.getDeclaredMethod("setLevel", Level::class.java)
|
||||
.invoke(this, Level.OFF)
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
Eco.getHandler().ecoPlugin.logger.warning("Failed to silence Exposed logger! You might get some console spam")
|
||||
}
|
||||
}
|
||||
|
||||
override fun updateKeys() {
|
||||
@@ -53,7 +69,7 @@ class MySQLDataHandler(
|
||||
registerColumn(key, Players)
|
||||
}
|
||||
|
||||
SchemaUtils.createMissingTablesAndColumns(Players)
|
||||
SchemaUtils.createMissingTablesAndColumns(Players, withLogs = false)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,13 +115,21 @@ class MySQLDataHandler(
|
||||
}
|
||||
|
||||
override fun <T> read(uuid: UUID, key: NamespacedKey): T? {
|
||||
var value: T? = null
|
||||
transaction {
|
||||
val player = getPlayer(uuid)
|
||||
value = player[getColumn(key.toString())] as T?
|
||||
val doRead = Callable<T?> {
|
||||
var value: T? = null
|
||||
transaction {
|
||||
val player = getPlayer(uuid)
|
||||
value = player[getColumn(key.toString())] as T?
|
||||
}
|
||||
|
||||
return@Callable value
|
||||
}
|
||||
|
||||
return value
|
||||
return if (Eco.getHandler().ecoPlugin.configYml.getBool("mysql.async-reads")) {
|
||||
executor.submit(doRead).get()
|
||||
} else {
|
||||
doRead.call()
|
||||
}
|
||||
}
|
||||
|
||||
object Players : UUIDTable("eco_players")
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.willfp.eco.spigot.data.storage
|
||||
package com.willfp.eco.internal.spigot.data.storage
|
||||
|
||||
import com.willfp.eco.core.Eco
|
||||
import com.willfp.eco.core.EcoPlugin
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.willfp.eco.spigot.data.storage
|
||||
package com.willfp.eco.internal.spigot.data.storage
|
||||
|
||||
import com.willfp.eco.core.config.yaml.YamlBaseConfig
|
||||
import com.willfp.eco.core.data.PlayerProfile
|
||||
import com.willfp.eco.core.data.keys.PersistentDataKey
|
||||
import com.willfp.eco.spigot.EcoSpigotPlugin
|
||||
import com.willfp.eco.internal.spigot.EcoSpigotPlugin
|
||||
import org.bukkit.NamespacedKey
|
||||
import java.util.*
|
||||
import java.util.UUID
|
||||
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
class YamlDataHandler(
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.willfp.eco.spigot.display
|
||||
package com.willfp.eco.internal.spigot.display
|
||||
|
||||
import com.comphenix.protocol.PacketType
|
||||
import com.comphenix.protocol.ProtocolLibrary
|
||||
@@ -6,7 +6,7 @@ import com.comphenix.protocol.events.PacketContainer
|
||||
import com.comphenix.protocol.events.PacketEvent
|
||||
import com.willfp.eco.core.AbstractPacketAdapter
|
||||
import com.willfp.eco.core.EcoPlugin
|
||||
import com.willfp.eco.proxy.AutoCraftProxy
|
||||
import com.willfp.eco.internal.spigot.proxy.AutoCraftProxy
|
||||
import org.bukkit.entity.Player
|
||||
import java.lang.reflect.InvocationTargetException
|
||||
|
||||
@@ -24,11 +24,7 @@ class PacketAutoRecipe(plugin: EcoPlugin) : AbstractPacketAdapter(plugin, Packet
|
||||
if (packet.minecraftKeys.values[0].fullKey.split(":".toRegex()).toTypedArray()[1].contains("displayed")) {
|
||||
return
|
||||
}
|
||||
try {
|
||||
getPlugin().getProxy(AutoCraftProxy::class.java).modifyPacket(packet.handle)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
getPlugin().getProxy(AutoCraftProxy::class.java).modifyPacket(packet.handle)
|
||||
val newAutoRecipe = PacketContainer(PacketType.Play.Server.AUTO_RECIPE)
|
||||
newAutoRecipe.minecraftKeys.write(0, packet.minecraftKeys.read(0))
|
||||
try {
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.willfp.eco.spigot.display
|
||||
package com.willfp.eco.internal.spigot.display
|
||||
|
||||
import com.comphenix.protocol.PacketType
|
||||
import com.comphenix.protocol.events.ListenerPriority
|
||||
@@ -7,7 +7,7 @@ import com.comphenix.protocol.events.PacketEvent
|
||||
import com.comphenix.protocol.wrappers.WrappedChatComponent
|
||||
import com.willfp.eco.core.AbstractPacketAdapter
|
||||
import com.willfp.eco.core.EcoPlugin
|
||||
import com.willfp.eco.proxy.ChatComponentProxy
|
||||
import com.willfp.eco.internal.spigot.proxy.ChatComponentProxy
|
||||
import org.bukkit.entity.Player
|
||||
|
||||
class PacketChat(plugin: EcoPlugin) :
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.willfp.eco.spigot.display
|
||||
package com.willfp.eco.internal.spigot.display
|
||||
|
||||
import com.comphenix.protocol.PacketType
|
||||
import com.comphenix.protocol.events.ListenerPriority
|
||||
@@ -6,7 +6,7 @@ import com.comphenix.protocol.events.PacketContainer
|
||||
import com.comphenix.protocol.events.PacketEvent
|
||||
import com.willfp.eco.core.AbstractPacketAdapter
|
||||
import com.willfp.eco.core.EcoPlugin
|
||||
import com.willfp.eco.proxy.VillagerTradeProxy
|
||||
import com.willfp.eco.internal.spigot.proxy.VillagerTradeProxy
|
||||
import com.willfp.eco.util.NamespacedKeyUtils
|
||||
import org.bukkit.entity.Player
|
||||
import org.bukkit.inventory.ItemFlag
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.willfp.eco.spigot.display
|
||||
package com.willfp.eco.internal.spigot.display
|
||||
|
||||
import com.comphenix.protocol.PacketType
|
||||
import com.comphenix.protocol.events.PacketContainer
|
||||
@@ -6,8 +6,8 @@ import com.comphenix.protocol.events.PacketEvent
|
||||
import com.willfp.eco.core.AbstractPacketAdapter
|
||||
import com.willfp.eco.core.EcoPlugin
|
||||
import com.willfp.eco.core.display.Display
|
||||
import com.willfp.eco.spigot.display.frame.DisplayFrame
|
||||
import com.willfp.eco.spigot.display.frame.lastDisplayFrame
|
||||
import com.willfp.eco.internal.spigot.display.frame.DisplayFrame
|
||||
import com.willfp.eco.internal.spigot.display.frame.lastDisplayFrame
|
||||
import org.bukkit.entity.Player
|
||||
import org.bukkit.inventory.ItemStack
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.willfp.eco.spigot.display
|
||||
package com.willfp.eco.internal.spigot.display
|
||||
|
||||
import com.comphenix.protocol.PacketType
|
||||
import com.comphenix.protocol.events.PacketContainer
|
||||
@@ -6,8 +6,8 @@ import com.comphenix.protocol.events.PacketEvent
|
||||
import com.willfp.eco.core.AbstractPacketAdapter
|
||||
import com.willfp.eco.core.EcoPlugin
|
||||
import com.willfp.eco.core.display.Display
|
||||
import com.willfp.eco.spigot.display.frame.DisplayFrame
|
||||
import com.willfp.eco.spigot.display.frame.lastDisplayFrame
|
||||
import com.willfp.eco.internal.spigot.display.frame.DisplayFrame
|
||||
import com.willfp.eco.internal.spigot.display.frame.lastDisplayFrame
|
||||
import org.bukkit.entity.Player
|
||||
import org.bukkit.inventory.ItemStack
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.willfp.eco.spigot.display
|
||||
package com.willfp.eco.internal.spigot.display
|
||||
|
||||
import com.comphenix.protocol.PacketType
|
||||
import com.comphenix.protocol.ProtocolLibrary
|
||||
@@ -9,9 +9,9 @@ import com.willfp.eco.core.AbstractPacketAdapter
|
||||
import com.willfp.eco.core.EcoPlugin
|
||||
import com.willfp.eco.core.display.Display
|
||||
import com.willfp.eco.core.fast.FastItemStack
|
||||
import com.willfp.eco.spigot.display.frame.DisplayFrame
|
||||
import com.willfp.eco.spigot.display.frame.HashedItem
|
||||
import com.willfp.eco.spigot.display.frame.lastDisplayFrame
|
||||
import com.willfp.eco.internal.spigot.display.frame.DisplayFrame
|
||||
import com.willfp.eco.internal.spigot.display.frame.HashedItem
|
||||
import com.willfp.eco.internal.spigot.display.frame.lastDisplayFrame
|
||||
import com.willfp.eco.util.ServerUtils
|
||||
import org.bukkit.entity.Player
|
||||
import org.bukkit.inventory.ItemStack
|
||||
@@ -47,10 +47,11 @@ class PacketWindowItems(plugin: EcoPlugin) : AbstractPacketAdapter(plugin, Packe
|
||||
handleRateLimit(player)
|
||||
|
||||
if (usingAsync(player)) {
|
||||
val newPacket = packet.shallowClone()
|
||||
|
||||
fun modifyAndSend(itemStacks: MutableList<ItemStack>, windowId: Int, player: Player) {
|
||||
modifyWindowItems(itemStacks, windowId, player)
|
||||
|
||||
val newPacket = packet.deepClone()
|
||||
newPacket.itemListModifier.write(0, itemStacks)
|
||||
|
||||
ignorePacketList.add(player.name)
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.willfp.eco.spigot.display.frame
|
||||
package com.willfp.eco.internal.spigot.display.frame
|
||||
|
||||
import org.bukkit.entity.Player
|
||||
import org.bukkit.inventory.ItemStack
|
||||
import java.util.*
|
||||
import java.util.UUID
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
|
||||
data class HashedItem(val hash: Int, val item: ItemStack)
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.willfp.eco.spigot.drops
|
||||
package com.willfp.eco.internal.spigot.drops
|
||||
|
||||
import com.willfp.eco.core.EcoPlugin
|
||||
import com.willfp.eco.internal.drops.impl.EcoDropQueue
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.willfp.eco.spigot.eventlisteners
|
||||
package com.willfp.eco.internal.spigot.eventlisteners
|
||||
|
||||
import com.willfp.eco.core.events.EntityDeathByEntityEvent
|
||||
import org.apache.commons.lang.Validate
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.willfp.eco.spigot.eventlisteners
|
||||
package com.willfp.eco.internal.spigot.eventlisteners
|
||||
|
||||
import com.willfp.eco.core.EcoPlugin
|
||||
import org.bukkit.entity.LivingEntity
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.willfp.eco.spigot.eventlisteners
|
||||
package com.willfp.eco.internal.spigot.eventlisteners
|
||||
|
||||
import com.willfp.eco.core.events.NaturalExpGainEvent
|
||||
import org.apache.commons.lang.Validate
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.willfp.eco.spigot.eventlisteners
|
||||
package com.willfp.eco.internal.spigot.eventlisteners
|
||||
|
||||
import org.bukkit.event.EventHandler
|
||||
import org.bukkit.event.Listener
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.willfp.eco.spigot.eventlisteners
|
||||
package com.willfp.eco.internal.spigot.eventlisteners
|
||||
|
||||
import com.willfp.eco.core.events.PlayerJumpEvent
|
||||
import com.willfp.eco.core.integrations.mcmmo.McmmoManager
|
||||
@@ -9,7 +9,7 @@ import org.bukkit.event.Listener
|
||||
import org.bukkit.event.player.PlayerMoveEvent
|
||||
import org.bukkit.potion.PotionEffectType
|
||||
import java.text.DecimalFormat
|
||||
import java.util.*
|
||||
import java.util.UUID
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
class PlayerJumpListeners : Listener {
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.willfp.eco.spigot.eventlisteners.armor
|
||||
package com.willfp.eco.internal.spigot.eventlisteners.armor
|
||||
|
||||
import com.willfp.eco.core.EcoPlugin
|
||||
import com.willfp.eco.core.events.ArmorChangeEvent
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.willfp.eco.spigot.eventlisteners.armor
|
||||
package com.willfp.eco.internal.spigot.eventlisteners.armor
|
||||
|
||||
import com.willfp.eco.core.events.ArmorEquipEvent
|
||||
import org.bukkit.Bukkit
|
||||
@@ -10,7 +10,11 @@ import org.bukkit.event.EventPriority
|
||||
import org.bukkit.event.Listener
|
||||
import org.bukkit.event.block.Action
|
||||
import org.bukkit.event.entity.PlayerDeathEvent
|
||||
import org.bukkit.event.inventory.*
|
||||
import org.bukkit.event.inventory.ClickType
|
||||
import org.bukkit.event.inventory.InventoryAction
|
||||
import org.bukkit.event.inventory.InventoryClickEvent
|
||||
import org.bukkit.event.inventory.InventoryDragEvent
|
||||
import org.bukkit.event.inventory.InventoryType
|
||||
import org.bukkit.event.player.PlayerInteractEvent
|
||||
import org.bukkit.event.player.PlayerItemBreakEvent
|
||||
import org.bukkit.event.player.PlayerJoinEvent
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.willfp.eco.spigot.eventlisteners.armor
|
||||
package com.willfp.eco.internal.spigot.eventlisteners.armor
|
||||
import org.bukkit.inventory.ItemStack
|
||||
|
||||
enum class ArmorType(val slot: Int) {
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.willfp.eco.spigot.gui
|
||||
package com.willfp.eco.internal.spigot.gui
|
||||
|
||||
import com.willfp.eco.core.EcoPlugin
|
||||
import com.willfp.eco.core.drops.DropQueue
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.willfp.eco.spigot.integrations.afk
|
||||
package com.willfp.eco.internal.spigot.integrations.afk
|
||||
|
||||
import com.Zrips.CMI.CMI
|
||||
import com.willfp.eco.core.integrations.afk.AFKWrapper
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.willfp.eco.spigot.integrations.afk
|
||||
package com.willfp.eco.internal.spigot.integrations.afk
|
||||
|
||||
import com.earth2me.essentials.Essentials
|
||||
import com.willfp.eco.core.integrations.afk.AFKWrapper
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.willfp.eco.spigot.integrations.anticheat
|
||||
package com.willfp.eco.internal.spigot.integrations.anticheat
|
||||
|
||||
import com.willfp.eco.core.integrations.anticheat.AnticheatWrapper
|
||||
import me.konsolas.aac.api.AACAPI
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.willfp.eco.spigot.integrations.anticheat
|
||||
package com.willfp.eco.internal.spigot.integrations.anticheat
|
||||
|
||||
import com.willfp.eco.core.integrations.anticheat.AnticheatWrapper
|
||||
import me.nik.alice.api.events.AliceViolationEvent
|
||||
@@ -6,7 +6,7 @@ import org.bukkit.entity.Player
|
||||
import org.bukkit.event.EventHandler
|
||||
import org.bukkit.event.EventPriority
|
||||
import org.bukkit.event.Listener
|
||||
import java.util.*
|
||||
import java.util.UUID
|
||||
|
||||
class AnticheatAlice : AnticheatWrapper, Listener {
|
||||
private val exempt: MutableSet<UUID> = HashSet()
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.willfp.eco.spigot.integrations.anticheat
|
||||
package com.willfp.eco.internal.spigot.integrations.anticheat
|
||||
|
||||
import com.willfp.eco.core.integrations.anticheat.AnticheatWrapper
|
||||
import me.rerere.matrix.api.events.PlayerViolationEvent
|
||||
@@ -6,7 +6,7 @@ import org.bukkit.entity.Player
|
||||
import org.bukkit.event.EventHandler
|
||||
import org.bukkit.event.EventPriority
|
||||
import org.bukkit.event.Listener
|
||||
import java.util.*
|
||||
import java.util.UUID
|
||||
|
||||
class AnticheatMatrix : AnticheatWrapper, Listener {
|
||||
private val exempt: MutableSet<UUID> = HashSet()
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.willfp.eco.spigot.integrations.anticheat
|
||||
package com.willfp.eco.internal.spigot.integrations.anticheat
|
||||
|
||||
import com.willfp.eco.core.integrations.anticheat.AnticheatWrapper
|
||||
import fr.neatmonster.nocheatplus.checks.CheckType
|
||||
import fr.neatmonster.nocheatplus.hooks.NCPExemptionManager
|
||||
import org.bukkit.entity.Player
|
||||
import java.util.*
|
||||
import java.util.UUID
|
||||
|
||||
class AnticheatNCP : AnticheatWrapper {
|
||||
private val exempt: MutableSet<UUID> = HashSet()
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.willfp.eco.spigot.integrations.anticheat
|
||||
package com.willfp.eco.internal.spigot.integrations.anticheat
|
||||
|
||||
import com.willfp.eco.core.integrations.anticheat.AnticheatWrapper
|
||||
import me.vagdedes.spartan.api.PlayerViolationEvent
|
||||
@@ -6,7 +6,7 @@ import org.bukkit.entity.Player
|
||||
import org.bukkit.event.EventHandler
|
||||
import org.bukkit.event.EventPriority
|
||||
import org.bukkit.event.Listener
|
||||
import java.util.*
|
||||
import java.util.UUID
|
||||
|
||||
class AnticheatSpartan : AnticheatWrapper, Listener {
|
||||
private val exempt: MutableSet<UUID> = HashSet()
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.willfp.eco.spigot.integrations.anticheat
|
||||
package com.willfp.eco.internal.spigot.integrations.anticheat
|
||||
|
||||
import com.willfp.eco.core.integrations.anticheat.AnticheatWrapper
|
||||
import me.frep.vulcan.api.event.VulcanFlagEvent
|
||||
@@ -6,7 +6,7 @@ import org.bukkit.entity.Player
|
||||
import org.bukkit.event.EventHandler
|
||||
import org.bukkit.event.EventPriority
|
||||
import org.bukkit.event.Listener
|
||||
import java.util.*
|
||||
import java.util.UUID
|
||||
|
||||
class AnticheatVulcan : AnticheatWrapper, Listener {
|
||||
private val exempt: MutableSet<UUID> = HashSet()
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.willfp.eco.spigot.integrations.antigrief
|
||||
package com.willfp.eco.internal.spigot.integrations.antigrief
|
||||
|
||||
import com.willfp.eco.core.integrations.antigrief.AntigriefWrapper
|
||||
import org.bukkit.Location
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.willfp.eco.spigot.integrations.antigrief
|
||||
package com.willfp.eco.internal.spigot.integrations.antigrief
|
||||
|
||||
import com.SirBlobman.combatlogx.api.ICombatLogX
|
||||
import com.SirBlobman.combatlogx.api.expansion.Expansion
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.willfp.eco.spigot.integrations.antigrief
|
||||
package com.willfp.eco.internal.spigot.integrations.antigrief
|
||||
|
||||
import com.github.sirblobman.combatlogx.api.ICombatLogX
|
||||
import com.willfp.eco.core.integrations.antigrief.AntigriefWrapper
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.willfp.eco.internal.spigot.integrations.antigrief
|
||||
|
||||
import com.willfp.eco.core.integrations.antigrief.AntigriefWrapper
|
||||
import net.crashcraft.crashclaim.CrashClaim
|
||||
import net.crashcraft.crashclaim.permissions.PermissionRoute
|
||||
import org.bukkit.Location
|
||||
import org.bukkit.block.Block
|
||||
import org.bukkit.entity.LivingEntity
|
||||
import org.bukkit.entity.Player
|
||||
|
||||
class AntigriefCrashClaim : AntigriefWrapper {
|
||||
override fun canBreakBlock(
|
||||
player: Player,
|
||||
block: Block
|
||||
): Boolean {
|
||||
val api = CrashClaim.getPlugin().api ?: return true
|
||||
val claim = api.getClaim(block.location).getNow(null) ?: return true
|
||||
return claim.hasPermission(player.uniqueId, block.location, PermissionRoute.BUILD)
|
||||
}
|
||||
|
||||
override fun canCreateExplosion(
|
||||
player: Player,
|
||||
location: Location
|
||||
): Boolean {
|
||||
val api = CrashClaim.getPlugin().api ?: return true
|
||||
val claim = api.getClaim(location).getNow(null) ?: return true
|
||||
return claim.hasPermission(player.uniqueId, location, PermissionRoute.EXPLOSIONS)
|
||||
}
|
||||
|
||||
override fun canPlaceBlock(
|
||||
player: Player,
|
||||
block: Block
|
||||
): Boolean {
|
||||
val api = CrashClaim.getPlugin().api ?: return true
|
||||
val claim = api.getClaim(block.location).getNow(null) ?: return true
|
||||
return claim.hasPermission(player.uniqueId, block.location, PermissionRoute.BUILD)
|
||||
}
|
||||
|
||||
override fun canInjure(
|
||||
player: Player,
|
||||
victim: LivingEntity
|
||||
): Boolean {
|
||||
val api = CrashClaim.getPlugin().api ?: return true
|
||||
val claim = api.getClaim(victim.location).getNow(null) ?: return true
|
||||
return when (victim) {
|
||||
is Player -> false
|
||||
else -> claim.hasPermission(player.uniqueId, victim.location, PermissionRoute.ENTITIES)
|
||||
}
|
||||
}
|
||||
|
||||
override fun getPluginName(): String {
|
||||
return "CrashClaim"
|
||||
}
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
if (other !is AntigriefWrapper) {
|
||||
return false
|
||||
}
|
||||
|
||||
return other.pluginName == this.pluginName
|
||||
}
|
||||
|
||||
override fun hashCode(): Int {
|
||||
return this.pluginName.hashCode()
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.willfp.eco.spigot.integrations.antigrief
|
||||
package com.willfp.eco.internal.spigot.integrations.antigrief
|
||||
|
||||
import com.willfp.eco.core.integrations.antigrief.AntigriefWrapper
|
||||
import nl.marido.deluxecombat.api.DeluxeCombatAPI
|
||||
@@ -1,6 +1,10 @@
|
||||
package com.willfp.eco.spigot.integrations.antigrief
|
||||
package com.willfp.eco.internal.spigot.integrations.antigrief
|
||||
|
||||
import com.massivecraft.factions.*
|
||||
import com.massivecraft.factions.Board
|
||||
import com.massivecraft.factions.FLocation
|
||||
import com.massivecraft.factions.FPlayer
|
||||
import com.massivecraft.factions.FPlayers
|
||||
import com.massivecraft.factions.Faction
|
||||
import com.massivecraft.factions.perms.PermissibleAction
|
||||
import com.willfp.eco.core.integrations.antigrief.AntigriefWrapper
|
||||
import org.bukkit.Location
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.willfp.eco.spigot.integrations.antigrief
|
||||
package com.willfp.eco.internal.spigot.integrations.antigrief
|
||||
|
||||
import com.willfp.eco.core.integrations.antigrief.AntigriefWrapper
|
||||
import me.ryanhamshire.GriefPrevention.Claim
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.willfp.eco.spigot.integrations.antigrief
|
||||
package com.willfp.eco.internal.spigot.integrations.antigrief
|
||||
|
||||
import com.iridium.iridiumskyblock.PermissionType
|
||||
import com.iridium.iridiumskyblock.api.IridiumSkyblockAPI
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.willfp.eco.spigot.integrations.antigrief
|
||||
package com.willfp.eco.internal.spigot.integrations.antigrief
|
||||
|
||||
import com.willfp.eco.core.integrations.antigrief.AntigriefWrapper
|
||||
import org.bukkit.Location
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.willfp.eco.spigot.integrations.antigrief
|
||||
package com.willfp.eco.internal.spigot.integrations.antigrief
|
||||
|
||||
import com.willfp.eco.core.EcoPlugin
|
||||
import com.willfp.eco.core.integrations.antigrief.AntigriefWrapper
|
||||
@@ -0,0 +1,108 @@
|
||||
package com.willfp.eco.internal.spigot.integrations.antigrief
|
||||
|
||||
import com.bgsoftware.superiorskyblock.api.SuperiorSkyblockAPI
|
||||
import com.bgsoftware.superiorskyblock.api.enums.HitActionResult
|
||||
import com.bgsoftware.superiorskyblock.api.island.Island
|
||||
import com.bgsoftware.superiorskyblock.api.island.IslandPrivilege
|
||||
import com.bgsoftware.superiorskyblock.api.key.Key
|
||||
import com.bgsoftware.superiorskyblock.api.wrappers.SuperiorPlayer
|
||||
import com.willfp.eco.core.integrations.antigrief.AntigriefWrapper
|
||||
import org.bukkit.Location
|
||||
import org.bukkit.Material
|
||||
import org.bukkit.block.Block
|
||||
import org.bukkit.entity.*
|
||||
|
||||
class AntigriefSuperiorSkyblock2 : AntigriefWrapper {
|
||||
override fun getPluginName(): String {
|
||||
return "SuperiorSkyblock2"
|
||||
}
|
||||
|
||||
override fun canBreakBlock(player: Player, block: Block): Boolean {
|
||||
val island: Island? =
|
||||
SuperiorSkyblockAPI.getIslandAt(block.location)
|
||||
|
||||
val superiorPlayer: SuperiorPlayer =
|
||||
SuperiorSkyblockAPI.getPlayer(player)
|
||||
|
||||
if (island == null) {
|
||||
if (!superiorPlayer.hasBypassModeEnabled() && SuperiorSkyblockAPI.getSuperiorSkyblock().grid
|
||||
.isIslandsWorld(player.world)
|
||||
) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
val blockType = block.type
|
||||
|
||||
val islandPermission: IslandPrivilege =
|
||||
if (blockType == Material.SPAWNER) IslandPrivilege.getByName("SPAWNER_BREAK") else IslandPrivilege.getByName("BREAK")
|
||||
|
||||
if (!island.hasPermission(superiorPlayer, islandPermission)) {
|
||||
return false
|
||||
}
|
||||
|
||||
if (SuperiorSkyblockAPI.getSuperiorSkyblock().settings.valuableBlocks
|
||||
.contains(Key.of(block)) &&
|
||||
!island.hasPermission(superiorPlayer, IslandPrivilege.getByName("VALUABLE_BREAK"))
|
||||
) {
|
||||
return false
|
||||
}
|
||||
|
||||
if (!island.isInsideRange(block.location)) {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
override fun canCreateExplosion(player: Player, location: Location): Boolean {
|
||||
if (SuperiorSkyblockAPI.getPlayer(player).hasBypassModeEnabled()) {
|
||||
return true
|
||||
}
|
||||
return SuperiorSkyblockAPI.getIslandAt(location)?.isMember(SuperiorSkyblockAPI.getPlayer(player)) ?: true
|
||||
}
|
||||
|
||||
override fun canPlaceBlock(player: Player, block: Block): Boolean {
|
||||
val island: Island? =
|
||||
SuperiorSkyblockAPI.getIslandAt(block.location)
|
||||
|
||||
val superiorPlayer: SuperiorPlayer =
|
||||
SuperiorSkyblockAPI.getPlayer(player)
|
||||
|
||||
if (island == null) {
|
||||
if (!superiorPlayer.hasBypassModeEnabled() && SuperiorSkyblockAPI.getSuperiorSkyblock().grid.isIslandsWorld(superiorPlayer.world)
|
||||
) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
if (!island.hasPermission(superiorPlayer, IslandPrivilege.getByName("BUILD"))) {
|
||||
return false
|
||||
}
|
||||
|
||||
if (!island.isInsideRange(block.location)) {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
override fun canInjure(player: Player, victim: LivingEntity): Boolean {
|
||||
if (SuperiorSkyblockAPI.getPlayer(player).hasBypassModeEnabled()) {
|
||||
return true
|
||||
}
|
||||
return when (victim) {
|
||||
is Player -> SuperiorSkyblockAPI.getPlayer(player).canHit(SuperiorSkyblockAPI.getPlayer(victim)).equals(HitActionResult.SUCCESS)
|
||||
else -> {
|
||||
val island: Island? = SuperiorSkyblockAPI.getSuperiorSkyblock().grid.getIslandAt(victim.location)
|
||||
val islandPermission = if (victim is Monster) IslandPrivilege.getByName("MONSTER_DAMAGE") else IslandPrivilege.getByName("ANIMAL_DAMAGE")
|
||||
if (island != null ) {
|
||||
return island.hasPermission(player, islandPermission)
|
||||
}
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.willfp.eco.spigot.integrations.antigrief
|
||||
package com.willfp.eco.internal.spigot.integrations.antigrief
|
||||
|
||||
import com.palmergames.bukkit.towny.TownyAPI
|
||||
import com.palmergames.bukkit.towny.TownyUniverse
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.willfp.eco.spigot.integrations.antigrief
|
||||
package com.willfp.eco.internal.spigot.integrations.antigrief
|
||||
|
||||
import com.sk89q.worldedit.bukkit.BukkitAdapter
|
||||
import com.sk89q.worldguard.LocalPlayer
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.willfp.eco.spigot.integrations.bstats
|
||||
package com.willfp.eco.internal.spigot.integrations.bstats
|
||||
|
||||
import com.willfp.eco.core.EcoPlugin
|
||||
import org.bstats.bukkit.Metrics
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.willfp.eco.spigot.integrations.customitems
|
||||
package com.willfp.eco.internal.spigot.integrations.customitems
|
||||
|
||||
import com.willfp.eco.core.EcoPlugin
|
||||
import com.willfp.eco.core.integrations.customitems.CustomItemsWrapper
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.willfp.eco.spigot.integrations.customitems
|
||||
package com.willfp.eco.internal.spigot.integrations.customitems
|
||||
|
||||
import com.willfp.eco.core.integrations.customitems.CustomItemsWrapper
|
||||
import com.willfp.eco.core.items.CustomItem
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user