forked from upstream/AxSmithing
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5d1161bb15 | ||
|
|
bfbe454b71 | ||
|
|
97ed8ad6e2 | ||
|
|
cbcd7f5855 | ||
|
|
cf4416d562 | ||
|
|
f214bf44b3 | ||
|
|
e9d941e872 | ||
|
|
532fda45f3 | ||
|
|
2a4dd534a5 | ||
|
|
39d0e36e72 | ||
|
|
f5bdb77c0e | ||
|
|
b06b4e7156 | ||
|
|
05c131cbff | ||
|
|
e3b71c2141 | ||
|
|
7c52af372f | ||
|
|
2b51eef478 | ||
|
|
abd52fb9ed | ||
|
|
366e7cd32a | ||
|
|
8d2dfe0695 | ||
|
|
b9b440c97b | ||
|
|
d2ff1107de |
No files matched your search
Generated
+1
-1
@@ -5,7 +5,7 @@
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="gradleHome" value="C:/Gradle/gradle-7.5.1" />
|
||||
<option name="gradleJvm" value="17" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
|
||||
Generated
+1
-1
@@ -5,7 +5,7 @@
|
||||
<option name="description" value="" />
|
||||
</component>
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_16" default="true" project-jdk-name="temurin-16" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" project-jdk-name="17" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -19,7 +19,7 @@ Commands:
|
||||
Permissions:
|
||||
axsmithing.reload
|
||||
|
||||
To download: [Click here, and download the latest .jar!](https://github.com/ViaVersionAddons/AxSmithing/releases/tag/release)
|
||||
To download: [Click here, and download the latest .jar!](https://github.com/ViaVersionAddons/AxSmithing/releases/)
|
||||
|
||||
Need help? Join our Discord!
|
||||
|
||||
|
||||
+10
-11
@@ -1,10 +1,10 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'com.github.johnrengelman.shadow' version '8.1.1'
|
||||
id 'io.github.goooler.shadow' version '8.1.7'
|
||||
}
|
||||
|
||||
group = 'com.artillexstudios.axsmithing'
|
||||
version = '1.2'
|
||||
version = '1.10'
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
@@ -20,19 +20,19 @@ repositories {
|
||||
maven {
|
||||
url = uri('https://repo.viaversion.com')
|
||||
}
|
||||
|
||||
maven {
|
||||
url = uri('https://repo.artillex-studios.com/releases')
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'net.byteflux:libby-bukkit:1.2.0'
|
||||
implementation 'dev.dejvokep:boosted-yaml:1.3'
|
||||
implementation 'net.kyori:adventure-text-minimessage:4.14.0'
|
||||
implementation 'net.kyori:adventure-text-serializer-legacy:4.14.0'
|
||||
implementation 'net.kyori:adventure-platform-bukkit:4.3.0'
|
||||
implementation 'net.kyori:adventure-api:4.14.0'
|
||||
implementation 'com.artillexstudios.axapi:axapi:1.4.190:all'
|
||||
implementation 'org.bstats:bstats-bukkit:3.0.2'
|
||||
compileOnly 'com.google.code.gson:gson:2.10.1'
|
||||
compileOnly 'org.spigotmc:spigot-api:1.20.1-R0.1-SNAPSHOT'
|
||||
compileOnly 'com.viaversion:viaversion-api:4.7.0'
|
||||
compileOnly 'com.viaversion:viaversion-api:4.10.0'
|
||||
}
|
||||
|
||||
compileJava {
|
||||
@@ -48,11 +48,10 @@ processResources {
|
||||
|
||||
shadowJar {
|
||||
relocate("net.byteflux.libby", "com.artillexstudios.axsmithing.libs.libby")
|
||||
relocate("net.kyori", "com.artillexstudios.axsmithing.libs.kyori")
|
||||
relocate("org.bstats", "com.artillexstudios.axsmithing.libs.bstats")
|
||||
minimize()
|
||||
relocate("com.artillexstudios.axapi", "com.artillexstudios.axsmithing.libs.axapi")
|
||||
}
|
||||
|
||||
build {
|
||||
dependsOn(shadowJar)
|
||||
}
|
||||
}
|
||||
Vendored
BIN
Binary file not shown.
+3
-2
@@ -1,6 +1,7 @@
|
||||
#Sat Aug 19 14:47:24 CEST 2023
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
@@ -55,7 +55,7 @@
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
@@ -80,13 +80,10 @@ do
|
||||
esac
|
||||
done
|
||||
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||
|
||||
APP_NAME="Gradle"
|
||||
# This is normally unused
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
@@ -133,22 +130,29 @@ location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD=java
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
if ! command -v java >/dev/null 2>&1
|
||||
then
|
||||
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC3045
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
case $MAX_FD in #(
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC3045
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
@@ -193,6 +197,10 @@ if "$cygwin" || "$msys" ; then
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Collect all arguments for the java command;
|
||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
||||
# shell script including quotes and variable substitutions, so put them in
|
||||
@@ -205,6 +213,12 @@ set -- \
|
||||
org.gradle.wrapper.GradleWrapperMain \
|
||||
"$@"
|
||||
|
||||
# Stop when "xargs" is not available.
|
||||
if ! command -v xargs >/dev/null 2>&1
|
||||
then
|
||||
die "xargs is not available"
|
||||
fi
|
||||
|
||||
# Use "xargs" to parse quoted args.
|
||||
#
|
||||
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||
|
||||
Vendored
+9
-6
@@ -14,7 +14,7 @@
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@@ -25,7 +25,8 @@
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
if "%DIRNAME%"=="" set DIRNAME=.
|
||||
@rem This is normally unused
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@@ -40,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto execute
|
||||
if %ERRORLEVEL% equ 0 goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
@@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
set EXIT_CODE=%ERRORLEVEL%
|
||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||
exit /b %EXIT_CODE%
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
package com.artillexstudios.axsmithing;
|
||||
|
||||
import com.artillexstudios.axapi.AxPlugin;
|
||||
import com.artillexstudios.axapi.libs.boostedyaml.boostedyaml.YamlDocument;
|
||||
import com.artillexstudios.axapi.libs.boostedyaml.boostedyaml.dvs.versioning.BasicVersioning;
|
||||
import com.artillexstudios.axapi.libs.boostedyaml.boostedyaml.settings.dumper.DumperSettings;
|
||||
import com.artillexstudios.axapi.libs.boostedyaml.boostedyaml.settings.general.GeneralSettings;
|
||||
import com.artillexstudios.axapi.libs.boostedyaml.boostedyaml.settings.loader.LoaderSettings;
|
||||
import com.artillexstudios.axapi.libs.boostedyaml.boostedyaml.settings.updater.UpdaterSettings;
|
||||
import com.artillexstudios.axapi.scheduler.Scheduler;
|
||||
import com.artillexstudios.axsmithing.command.AxSmithingCommand;
|
||||
import com.artillexstudios.axsmithing.command.AxSmithingTabComplete;
|
||||
import com.artillexstudios.axsmithing.gui.SmithingTable;
|
||||
@@ -7,21 +15,14 @@ import com.artillexstudios.axsmithing.gui.impl.SmithingTable_V1_16;
|
||||
import com.artillexstudios.axsmithing.gui.impl.SmithingTable_V1_20;
|
||||
import com.artillexstudios.axsmithing.listener.InteractListener;
|
||||
import com.artillexstudios.axsmithing.listener.InventoryListener;
|
||||
import dev.dejvokep.boostedyaml.YamlDocument;
|
||||
import dev.dejvokep.boostedyaml.dvs.versioning.BasicVersioning;
|
||||
import dev.dejvokep.boostedyaml.settings.dumper.DumperSettings;
|
||||
import dev.dejvokep.boostedyaml.settings.general.GeneralSettings;
|
||||
import dev.dejvokep.boostedyaml.settings.loader.LoaderSettings;
|
||||
import dev.dejvokep.boostedyaml.settings.updater.UpdaterSettings;
|
||||
import org.bstats.bukkit.Metrics;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
public class AxSmithingPlugin extends JavaPlugin {
|
||||
public class AxSmithingPlugin extends AxPlugin {
|
||||
private static YamlDocument config;
|
||||
private static SmithingTable smithingTableImpl;
|
||||
private static AxSmithingPlugin instance;
|
||||
@@ -52,7 +53,7 @@ public class AxSmithingPlugin extends JavaPlugin {
|
||||
// }
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
public void enable() {
|
||||
instance = this;
|
||||
new Metrics(this, 19575);
|
||||
try {
|
||||
@@ -68,8 +69,12 @@ public class AxSmithingPlugin extends JavaPlugin {
|
||||
Bukkit.getPluginCommand("axsmithing").setTabCompleter(new AxSmithingTabComplete());
|
||||
}
|
||||
|
||||
public String reload() {
|
||||
long now = System.currentTimeMillis();
|
||||
@Override
|
||||
public void onDisable() {
|
||||
Scheduler.get().cancelAll();
|
||||
}
|
||||
|
||||
public void reload() {
|
||||
try {
|
||||
config.reload();
|
||||
} catch (IOException e) {
|
||||
@@ -77,14 +82,10 @@ public class AxSmithingPlugin extends JavaPlugin {
|
||||
}
|
||||
|
||||
initializeSmithingTableImpl();
|
||||
long took = System.currentTimeMillis() - now;
|
||||
return String.valueOf(took);
|
||||
}
|
||||
|
||||
private void initializeSmithingTableImpl() {
|
||||
String version = Bukkit.getVersion();
|
||||
|
||||
if (version.contains("20")) {
|
||||
if (!Bukkit.getBukkitVersion().startsWith("1.1")) {
|
||||
v1_20 = true;
|
||||
smithingTableImpl = new SmithingTable_V1_20();
|
||||
} else {
|
||||
|
||||
@@ -16,7 +16,7 @@ public class AxSmithingCommand implements CommandExecutor {
|
||||
return true;
|
||||
}
|
||||
|
||||
String took = AxSmithingPlugin.getInstance().reload();
|
||||
String took = String.valueOf(AxSmithingPlugin.getInstance().reloadWithTime());
|
||||
sender.sendMessage(StringUtils.format(AxSmithingPlugin.getConfiguration().getString("messages.prefix") + AxSmithingPlugin.getConfiguration().getString("messages.reload").replace("%time%", took)));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
package com.artillexstudios.axsmithing.gui.impl;
|
||||
|
||||
import com.artillexstudios.axapi.libs.boostedyaml.boostedyaml.YamlDocument;
|
||||
import com.artillexstudios.axapi.libs.boostedyaml.boostedyaml.block.implementation.Section;
|
||||
import com.artillexstudios.axapi.scheduler.Scheduler;
|
||||
import com.artillexstudios.axsmithing.AxSmithingPlugin;
|
||||
import com.artillexstudios.axsmithing.gui.SmithingTable;
|
||||
import com.artillexstudios.axsmithing.utils.ItemBuilder;
|
||||
import com.artillexstudios.axsmithing.utils.StringUtils;
|
||||
import dev.dejvokep.boostedyaml.YamlDocument;
|
||||
import dev.dejvokep.boostedyaml.block.implementation.Section;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.InventoryAction;
|
||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.event.inventory.InventoryCloseEvent;
|
||||
import org.bukkit.event.inventory.InventoryDragEvent;
|
||||
@@ -16,10 +18,12 @@ import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.InventoryHolder;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.Recipe;
|
||||
import org.bukkit.inventory.RecipeChoice;
|
||||
import org.bukkit.inventory.SmithingRecipe;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
@@ -31,6 +35,9 @@ public class SmithingTable_V1_16 implements SmithingTable, InventoryHolder {
|
||||
private final int upgradeSlot;
|
||||
private final int itemSlot;
|
||||
private final boolean dontConvertWithModelData;
|
||||
private final Field baseField;
|
||||
private final Field additionField;
|
||||
private final Field resultField;
|
||||
|
||||
public SmithingTable_V1_16() {
|
||||
YamlDocument config = AxSmithingPlugin.getConfiguration();
|
||||
@@ -38,6 +45,27 @@ public class SmithingTable_V1_16 implements SmithingTable, InventoryHolder {
|
||||
upgradeSlot = config.getInt("menu.1_16.upgrade-slot");
|
||||
itemSlot = config.getInt("menu.1_16.item-slot");
|
||||
dontConvertWithModelData = config.getBoolean("menu.1_16.dont-convert-with-modeldata");
|
||||
|
||||
try {
|
||||
baseField = SmithingRecipe.class.getDeclaredField("base");
|
||||
baseField.setAccessible(true);
|
||||
} catch (NoSuchFieldException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
try {
|
||||
additionField = SmithingRecipe.class.getDeclaredField("addition");
|
||||
additionField.setAccessible(true);
|
||||
} catch (NoSuchFieldException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
try {
|
||||
resultField = SmithingRecipe.class.getDeclaredField("result");
|
||||
resultField.setAccessible(true);
|
||||
} catch (NoSuchFieldException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -63,7 +91,9 @@ public class SmithingTable_V1_16 implements SmithingTable, InventoryHolder {
|
||||
if (!(event.getInventory().getHolder() instanceof SmithingTable_V1_16)) return;
|
||||
|
||||
if ((event.getSlot() == upgradeSlot || event.getSlot() == itemSlot) && event.getInventory().getItem(outputSlot) != null) {
|
||||
event.getInventory().setItem(outputSlot, null);
|
||||
if (checkRecipes(event.getInventory(), event.getInventory().getItem(itemSlot), event.getInventory().getItem(upgradeSlot))) {
|
||||
event.getInventory().setItem(outputSlot, null);
|
||||
}
|
||||
}
|
||||
|
||||
if (event.getClickedInventory() == event.getView().getTopInventory()) {
|
||||
@@ -159,26 +189,32 @@ public class SmithingTable_V1_16 implements SmithingTable, InventoryHolder {
|
||||
}
|
||||
|
||||
private void updateGui(Inventory inv) {
|
||||
Bukkit.getScheduler().runTaskLater(AxSmithingPlugin.getInstance(), t -> {
|
||||
Scheduler.get().runLater(t -> {
|
||||
ItemStack base = inv.getItem(itemSlot);
|
||||
ItemStack addition = inv.getItem(upgradeSlot);
|
||||
if (addition == null || addition.getType().isAir()) {
|
||||
addition = new ItemStack(Material.AIR);
|
||||
}
|
||||
|
||||
if (base == null || addition.getType().isAir()) {
|
||||
if (base == null || base.getType().isAir()) {
|
||||
base = new ItemStack(Material.AIR);
|
||||
}
|
||||
|
||||
ItemStack finalAddition = addition;
|
||||
ItemStack finalBase = base;
|
||||
|
||||
boolean successful = checkRecipe(inv, finalBase, finalAddition);
|
||||
checkRecipes(inv, finalBase, finalAddition);
|
||||
}, 1L);
|
||||
}
|
||||
|
||||
if (!successful) {
|
||||
checkRecipe(inv, finalAddition, finalBase);
|
||||
}
|
||||
}, 0L);
|
||||
private boolean checkRecipes(Inventory inv, ItemStack finalBase, ItemStack finalAddition) {
|
||||
boolean successful = checkRecipe(inv, finalBase, finalAddition);
|
||||
|
||||
if (!successful) {
|
||||
successful = checkRecipe(inv, finalAddition, finalBase);
|
||||
}
|
||||
|
||||
return successful;
|
||||
}
|
||||
|
||||
private boolean checkRecipe(Inventory inventory, ItemStack finalBase, ItemStack finalAddition) {
|
||||
@@ -188,17 +224,33 @@ public class SmithingTable_V1_16 implements SmithingTable, InventoryHolder {
|
||||
Recipe recipe = recipeIterator.next();
|
||||
|
||||
if (recipe instanceof SmithingRecipe smithingRecipe) {
|
||||
boolean test1 = smithingRecipe.getBase().test(finalBase);
|
||||
RecipeChoice base = getBase(smithingRecipe);
|
||||
RecipeChoice addition = getAddition(smithingRecipe);
|
||||
if (base == null || addition == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean test1 = base.test(finalBase);
|
||||
ItemMeta baseItemMeta = finalBase.getItemMeta();
|
||||
if (baseItemMeta == null) return false;
|
||||
boolean test2 = smithingRecipe.getAddition().test(finalAddition);
|
||||
boolean test2 = addition.test(finalAddition);
|
||||
|
||||
if (dontConvertWithModelData && baseItemMeta.hasCustomModelData()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (test1 && test2) {
|
||||
ItemStack item = smithingRecipe.getResult();
|
||||
ItemStack item = getResult(smithingRecipe);
|
||||
if (item == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
ItemStack it;
|
||||
if ((it = inventory.getItem(outputSlot)) != null && it.getType() == item.getType()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
item.setItemMeta(baseItemMeta);
|
||||
inventory.setItem(outputSlot, item);
|
||||
return true;
|
||||
@@ -210,4 +262,46 @@ public class SmithingTable_V1_16 implements SmithingTable, InventoryHolder {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public RecipeChoice getBase(SmithingRecipe recipe) {
|
||||
RecipeChoice recipeChoice;
|
||||
try {
|
||||
recipeChoice = (RecipeChoice) baseField.get(recipe);
|
||||
if (recipeChoice == null) {
|
||||
return null;
|
||||
}
|
||||
} catch (IllegalAccessException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
return recipeChoice.clone();
|
||||
}
|
||||
|
||||
public RecipeChoice getAddition(SmithingRecipe recipe) {
|
||||
RecipeChoice recipeChoice;
|
||||
try {
|
||||
recipeChoice = (RecipeChoice) additionField.get(recipe);
|
||||
if (recipeChoice == null) {
|
||||
return null;
|
||||
}
|
||||
} catch (IllegalAccessException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
return recipeChoice.clone();
|
||||
}
|
||||
|
||||
public ItemStack getResult(SmithingRecipe recipe) {
|
||||
ItemStack result;
|
||||
try {
|
||||
result = (ItemStack) resultField.get(recipe);
|
||||
if (result == null) {
|
||||
return null;
|
||||
}
|
||||
} catch (IllegalAccessException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
return result.clone();
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,16 @@
|
||||
package com.artillexstudios.axsmithing.gui.impl;
|
||||
|
||||
import com.artillexstudios.axapi.libs.boostedyaml.boostedyaml.YamlDocument;
|
||||
import com.artillexstudios.axapi.libs.boostedyaml.boostedyaml.block.implementation.Section;
|
||||
import com.artillexstudios.axapi.scheduler.Scheduler;
|
||||
import com.artillexstudios.axsmithing.AxSmithingPlugin;
|
||||
import com.artillexstudios.axsmithing.gui.SmithingTable;
|
||||
import com.artillexstudios.axsmithing.utils.ItemBuilder;
|
||||
import com.artillexstudios.axsmithing.utils.StringUtils;
|
||||
import dev.dejvokep.boostedyaml.YamlDocument;
|
||||
import dev.dejvokep.boostedyaml.block.implementation.Section;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.bukkit.Registry;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.event.inventory.InventoryCloseEvent;
|
||||
@@ -16,6 +19,8 @@ import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.InventoryHolder;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.Recipe;
|
||||
import org.bukkit.inventory.RecipeChoice;
|
||||
import org.bukkit.inventory.SmithingRecipe;
|
||||
import org.bukkit.inventory.SmithingTransformRecipe;
|
||||
import org.bukkit.inventory.SmithingTrimRecipe;
|
||||
import org.bukkit.inventory.meta.ArmorMeta;
|
||||
@@ -26,9 +31,11 @@ import org.bukkit.inventory.meta.trim.TrimPattern;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -39,6 +46,10 @@ public class SmithingTable_V1_20 implements SmithingTable, InventoryHolder {
|
||||
private final int templateSlot;
|
||||
private final boolean needNetheriteTemplate;
|
||||
private final boolean dontConvertWithModelData;
|
||||
private final Field templateField;
|
||||
private final Field baseField;
|
||||
private final Field additionField;
|
||||
private final Field resultField;
|
||||
|
||||
public SmithingTable_V1_20() {
|
||||
YamlDocument config = AxSmithingPlugin.getConfiguration();
|
||||
@@ -48,6 +59,33 @@ public class SmithingTable_V1_20 implements SmithingTable, InventoryHolder {
|
||||
itemSlot = config.getInt("menu.1_20.item-slot");
|
||||
needNetheriteTemplate = config.getBoolean("menu.1_20.need-netherite-template");
|
||||
dontConvertWithModelData = config.getBoolean("menu.1_20.dont-convert-with-modeldata");
|
||||
try {
|
||||
templateField = SmithingTransformRecipe.class.getDeclaredField("template");
|
||||
templateField.setAccessible(true);
|
||||
} catch (NoSuchFieldException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
try {
|
||||
baseField = SmithingRecipe.class.getDeclaredField("base");
|
||||
baseField.setAccessible(true);
|
||||
} catch (NoSuchFieldException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
try {
|
||||
additionField = SmithingRecipe.class.getDeclaredField("addition");
|
||||
additionField.setAccessible(true);
|
||||
} catch (NoSuchFieldException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
try {
|
||||
resultField = SmithingRecipe.class.getDeclaredField("result");
|
||||
resultField.setAccessible(true);
|
||||
} catch (NoSuchFieldException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -73,7 +111,9 @@ public class SmithingTable_V1_20 implements SmithingTable, InventoryHolder {
|
||||
if (!(event.getInventory().getHolder() instanceof SmithingTable_V1_20)) return;
|
||||
|
||||
if ((event.getSlot() == upgradeSlot || event.getSlot() == itemSlot || event.getSlot() == templateSlot) && event.getInventory().getItem(outputSlot) != null) {
|
||||
event.getInventory().setItem(outputSlot, null);
|
||||
if (checkRecipes(event.getInventory(), event.getInventory().getItem(templateSlot), event.getInventory().getItem(itemSlot), event.getInventory().getItem(upgradeSlot))) {
|
||||
event.getInventory().setItem(outputSlot, null);
|
||||
}
|
||||
}
|
||||
|
||||
if (event.getClickedInventory() == event.getView().getTopInventory()) {
|
||||
@@ -188,7 +228,7 @@ public class SmithingTable_V1_20 implements SmithingTable, InventoryHolder {
|
||||
}
|
||||
|
||||
private void updateGui(Inventory inv) {
|
||||
Bukkit.getScheduler().runTaskLater(AxSmithingPlugin.getInstance(), t -> {
|
||||
Scheduler.get().runLater(t -> {
|
||||
ItemStack template = inv.getItem(templateSlot);
|
||||
ItemStack base = inv.getItem(itemSlot);
|
||||
ItemStack addition = inv.getItem(upgradeSlot);
|
||||
@@ -196,15 +236,21 @@ public class SmithingTable_V1_20 implements SmithingTable, InventoryHolder {
|
||||
addition = new ItemStack(Material.AIR);
|
||||
}
|
||||
|
||||
if (base == null || addition.getType().isAir()) {
|
||||
if (base == null || base.getType().isAir()) {
|
||||
base = new ItemStack(Material.AIR);
|
||||
}
|
||||
|
||||
if (template == null || addition.getType().isAir()) {
|
||||
if (!needNetheriteTemplate) {
|
||||
if (template == null || template.getType().isAir()) {
|
||||
template = new ItemStack(Material.AIR);
|
||||
}
|
||||
|
||||
if (!needNetheriteTemplate && !hasTemplate(addition, base, template)) {
|
||||
if (template.getType().isAir()) {
|
||||
template = new ItemStack(Material.NETHERITE_UPGRADE_SMITHING_TEMPLATE);
|
||||
} else {
|
||||
template = new ItemStack(Material.AIR);
|
||||
} else if (base.getType().isAir()) {
|
||||
base = new ItemStack(Material.NETHERITE_UPGRADE_SMITHING_TEMPLATE);
|
||||
} else if (addition.getType().isAir()) {
|
||||
addition = new ItemStack(Material.NETHERITE_UPGRADE_SMITHING_TEMPLATE);;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -213,33 +259,52 @@ public class SmithingTable_V1_20 implements SmithingTable, InventoryHolder {
|
||||
ItemStack finalBase = base;
|
||||
|
||||
// Very very very ugly solution, but I guess, it works!
|
||||
boolean successful = checkRecipe(inv, finalBase, finalAddition, finalTemplate);
|
||||
if (!successful) {
|
||||
successful = checkRecipe(inv, finalBase, finalTemplate, finalAddition);
|
||||
}
|
||||
if (!successful) {
|
||||
successful = checkRecipe(inv, finalTemplate, finalBase, finalAddition);
|
||||
}
|
||||
if (!successful) {
|
||||
successful = checkRecipe(inv, finalTemplate, finalAddition, finalBase);
|
||||
}
|
||||
if (!successful) {
|
||||
successful = checkRecipe(inv, finalAddition, finalBase, finalTemplate);
|
||||
}
|
||||
if (!successful) {
|
||||
checkRecipe(inv, finalAddition, finalTemplate, finalBase);
|
||||
}
|
||||
checkRecipes(inv, finalTemplate, finalBase, finalAddition);
|
||||
}, 1L);
|
||||
}
|
||||
|
||||
}, 0L);
|
||||
private boolean checkRecipes(Inventory inv, ItemStack finalTemplate, ItemStack finalBase, ItemStack finalAddition) {
|
||||
boolean successful = checkRecipe(inv, finalBase, finalAddition, finalTemplate);
|
||||
if (!successful) {
|
||||
successful = checkRecipe(inv, finalBase, finalTemplate, finalAddition);
|
||||
}
|
||||
if (!successful) {
|
||||
successful = checkRecipe(inv, finalTemplate, finalBase, finalAddition);
|
||||
}
|
||||
if (!successful) {
|
||||
successful = checkRecipe(inv, finalTemplate, finalAddition, finalBase);
|
||||
}
|
||||
if (!successful) {
|
||||
successful = checkRecipe(inv, finalAddition, finalBase, finalTemplate);
|
||||
}
|
||||
if (!successful) {
|
||||
successful = checkRecipe(inv, finalAddition, finalTemplate, finalBase);
|
||||
}
|
||||
|
||||
return successful;
|
||||
}
|
||||
|
||||
private boolean hasTemplate(ItemStack item1, ItemStack item2, ItemStack item3) {
|
||||
if (isTemplate(item1)) {
|
||||
return true;
|
||||
} else if (isTemplate(item2)) {
|
||||
return true;
|
||||
} else {
|
||||
return isTemplate(item3);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isTemplate(ItemStack item) {
|
||||
return item.getType().name().contains("SMITHING_TEMPLATE");
|
||||
}
|
||||
|
||||
private boolean checkRecipe(Inventory inventory, ItemStack finalTemplate, ItemStack finalBase, ItemStack finalAddition) {
|
||||
Iterator<Recipe> recipeIterator = Bukkit.getServer().recipeIterator();
|
||||
while (recipeIterator.hasNext()) {
|
||||
inventory.setItem(outputSlot, new ItemStack(Material.AIR));
|
||||
Recipe recipe = recipeIterator.next();
|
||||
|
||||
if (recipe instanceof SmithingTrimRecipe trimRecipe) {
|
||||
if (finalBase == null || finalAddition == null || finalTemplate == null) return false;
|
||||
boolean test1 = trimRecipe.getTemplate().test(finalTemplate);
|
||||
boolean test2 = trimRecipe.getBase().test(finalBase);
|
||||
boolean test3 = trimRecipe.getAddition().test(finalAddition);
|
||||
@@ -254,6 +319,11 @@ public class SmithingTable_V1_20 implements SmithingTable, InventoryHolder {
|
||||
clone.setItemMeta(armorMeta);
|
||||
}
|
||||
|
||||
ItemStack it;
|
||||
if ((it = inventory.getItem(outputSlot)) != null && it.getType() == clone.getType()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
inventory.setItem(outputSlot, clone);
|
||||
return true;
|
||||
} else {
|
||||
@@ -262,18 +332,34 @@ public class SmithingTable_V1_20 implements SmithingTable, InventoryHolder {
|
||||
}
|
||||
|
||||
if (recipe instanceof SmithingTransformRecipe transformRecipe) {
|
||||
boolean test1 = transformRecipe.getTemplate().test(finalTemplate);
|
||||
boolean test2 = transformRecipe.getBase().test(finalBase);
|
||||
RecipeChoice template = getTemplate(transformRecipe);
|
||||
RecipeChoice base = getBase(transformRecipe);
|
||||
RecipeChoice addition = getAddition(transformRecipe);
|
||||
if (template == null || base == null || addition == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean test1 = template.test(finalTemplate);
|
||||
boolean test2 = base.test(finalBase);
|
||||
ItemMeta baseItemMeta = finalBase.getItemMeta();
|
||||
if (baseItemMeta == null) return false;
|
||||
boolean test3 = transformRecipe.getAddition().test(finalAddition);
|
||||
boolean test3 = addition.test(finalAddition);
|
||||
|
||||
if (dontConvertWithModelData && baseItemMeta.hasCustomModelData()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (test1 && test2 && test3) {
|
||||
ItemStack item = transformRecipe.getResult();
|
||||
ItemStack item = getResult(transformRecipe);
|
||||
if (item == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
ItemStack it;
|
||||
if ((it = inventory.getItem(outputSlot)) != null && it.getType() == item.getType()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
item.setItemMeta(baseItemMeta);
|
||||
inventory.setItem(outputSlot, item);
|
||||
return true;
|
||||
@@ -286,6 +372,62 @@ public class SmithingTable_V1_20 implements SmithingTable, InventoryHolder {
|
||||
return false;
|
||||
}
|
||||
|
||||
public RecipeChoice getTemplate(SmithingTransformRecipe recipe) {
|
||||
RecipeChoice recipeChoice;
|
||||
try {
|
||||
recipeChoice = (RecipeChoice) templateField.get(recipe);
|
||||
if (recipeChoice == null) {
|
||||
return null;
|
||||
}
|
||||
} catch (IllegalAccessException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
return recipeChoice.clone();
|
||||
}
|
||||
|
||||
public RecipeChoice getBase(SmithingTransformRecipe recipe) {
|
||||
RecipeChoice recipeChoice;
|
||||
try {
|
||||
recipeChoice = (RecipeChoice) baseField.get(recipe);
|
||||
if (recipeChoice == null) {
|
||||
return null;
|
||||
}
|
||||
} catch (IllegalAccessException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
return recipeChoice.clone();
|
||||
}
|
||||
|
||||
public RecipeChoice getAddition(SmithingTransformRecipe recipe) {
|
||||
RecipeChoice recipeChoice;
|
||||
try {
|
||||
recipeChoice = (RecipeChoice) additionField.get(recipe);
|
||||
if (recipeChoice == null) {
|
||||
return null;
|
||||
}
|
||||
} catch (IllegalAccessException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
return recipeChoice.clone();
|
||||
}
|
||||
|
||||
public ItemStack getResult(SmithingTransformRecipe recipe) {
|
||||
ItemStack result;
|
||||
try {
|
||||
result = (ItemStack) resultField.get(recipe);
|
||||
if (result == null) {
|
||||
return null;
|
||||
}
|
||||
} catch (IllegalAccessException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
return result.clone();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private ArmorTrim armorTrim(@NotNull ItemStack finalAddition, @NotNull ItemStack finalTemplate) {
|
||||
TrimMaterial material;
|
||||
@@ -305,24 +447,7 @@ public class SmithingTable_V1_20 implements SmithingTable, InventoryHolder {
|
||||
default -> material = null;
|
||||
}
|
||||
|
||||
switch (finalTemplate.getType()) {
|
||||
case COAST_ARMOR_TRIM_SMITHING_TEMPLATE -> pattern = TrimPattern.COAST;
|
||||
case DUNE_ARMOR_TRIM_SMITHING_TEMPLATE -> pattern = TrimPattern.DUNE;
|
||||
case EYE_ARMOR_TRIM_SMITHING_TEMPLATE -> pattern = TrimPattern.EYE;
|
||||
case SENTRY_ARMOR_TRIM_SMITHING_TEMPLATE -> pattern = TrimPattern.SENTRY;
|
||||
case HOST_ARMOR_TRIM_SMITHING_TEMPLATE -> pattern = TrimPattern.HOST;
|
||||
case SHAPER_ARMOR_TRIM_SMITHING_TEMPLATE -> pattern = TrimPattern.SHAPER;
|
||||
case SILENCE_ARMOR_TRIM_SMITHING_TEMPLATE -> pattern = TrimPattern.SILENCE;
|
||||
case RAISER_ARMOR_TRIM_SMITHING_TEMPLATE -> pattern = TrimPattern.RAISER;
|
||||
case RIB_ARMOR_TRIM_SMITHING_TEMPLATE -> pattern = TrimPattern.RIB;
|
||||
case SNOUT_ARMOR_TRIM_SMITHING_TEMPLATE -> pattern = TrimPattern.SNOUT;
|
||||
case SPIRE_ARMOR_TRIM_SMITHING_TEMPLATE -> pattern = TrimPattern.SPIRE;
|
||||
case TIDE_ARMOR_TRIM_SMITHING_TEMPLATE -> pattern = TrimPattern.TIDE;
|
||||
case VEX_ARMOR_TRIM_SMITHING_TEMPLATE -> pattern = TrimPattern.VEX;
|
||||
case WARD_ARMOR_TRIM_SMITHING_TEMPLATE -> pattern = TrimPattern.WARD;
|
||||
case WAYFINDER_ARMOR_TRIM_SMITHING_TEMPLATE -> pattern = TrimPattern.WAYFINDER;
|
||||
default -> pattern = null;
|
||||
}
|
||||
pattern = Registry.TRIM_PATTERN.get(NamespacedKey.minecraft(finalTemplate.getType().name().replace("_ARMOR_TRIM_SMITHING_TEMPLATE", "").toLowerCase(Locale.ENGLISH)));
|
||||
|
||||
if (pattern == null || material == null) {
|
||||
return null;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.artillexstudios.axsmithing.listener;
|
||||
|
||||
import com.artillexstudios.axapi.scheduler.Scheduler;
|
||||
import com.artillexstudios.axapi.utils.Version;
|
||||
import com.artillexstudios.axsmithing.AxSmithingPlugin;
|
||||
import com.viaversion.viaversion.api.Via;
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Event;
|
||||
@@ -22,13 +22,14 @@ public class InteractListener implements Listener {
|
||||
if (event.getClickedBlock() == null) return;
|
||||
if (event.getClickedBlock().getType() != Material.SMITHING_TABLE) return;
|
||||
if (event.getAction().equals(Action.LEFT_CLICK_BLOCK)) return;
|
||||
if (!AxSmithingPlugin.getConfiguration().getBoolean("listen-to-interact-event")) return;
|
||||
|
||||
if (AxSmithingPlugin.is1_20()) {
|
||||
if (Via.getAPI().getPlayerVersion(event.getPlayer()) >= ProtocolVersion.v1_20.getVersion() && !AxSmithingPlugin.getConfiguration().getBoolean("menu.1_20.force-for-1_20-clients")) {
|
||||
if (Via.getAPI().getPlayerVersion(event.getPlayer()) >= 762 && !AxSmithingPlugin.getConfiguration().getBoolean("menu.1_20.force-for-1_20-clients")) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (Via.getAPI().getPlayerVersion(event.getPlayer()) != ProtocolVersion.v1_20.getVersion()) {
|
||||
if (!AxSmithingPlugin.getConfiguration().getBoolean("menu.1_16.force")) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -45,16 +46,18 @@ public class InteractListener implements Listener {
|
||||
if (event.getInventory().getType() != InventoryType.SMITHING) return;
|
||||
|
||||
if (AxSmithingPlugin.is1_20()) {
|
||||
if (Via.getAPI().getPlayerVersion(event.getPlayer()) >= ProtocolVersion.v1_20.getVersion() && !AxSmithingPlugin.getConfiguration().getBoolean("menu.1_20.force-for-1_20-clients")) {
|
||||
if (Via.getAPI().getPlayerVersion(event.getPlayer()) >= 762 && !AxSmithingPlugin.getConfiguration().getBoolean("menu.1_20.force-for-1_20-clients")) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (Via.getAPI().getPlayerVersion(event.getPlayer()) != ProtocolVersion.v1_20.getVersion()) {
|
||||
if (!AxSmithingPlugin.getConfiguration().getBoolean("menu.1_16.force")) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
event.getPlayer().closeInventory();
|
||||
Bukkit.getScheduler().runTaskLater(AxSmithingPlugin.getInstance(), () -> AxSmithingPlugin.getSmithingTableImpl().open((Player) event.getPlayer()),1L);
|
||||
Scheduler.get().runLater(t -> {
|
||||
AxSmithingPlugin.getSmithingTableImpl().open((Player) event.getPlayer());
|
||||
}, 1);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.artillexstudios.axsmithing.utils;
|
||||
|
||||
import dev.dejvokep.boostedyaml.block.implementation.Section;
|
||||
import com.artillexstudios.axapi.libs.boostedyaml.boostedyaml.block.implementation.Section;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Color;
|
||||
import org.bukkit.Material;
|
||||
|
||||
@@ -9,7 +9,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class StringUtils {
|
||||
private static final LegacyComponentSerializer LEGACY_COMPONENT_SERIALIZER = LegacyComponentSerializer.builder().character('\u00a7').useUnusualXRepeatedCharacterHexFormat().hexColors().build();
|
||||
private static final LegacyComponentSerializer LEGACY_FORMATTER = LegacyComponentSerializer.legacyAmpersand().toBuilder().useUnusualXRepeatedCharacterHexFormat().hexColors().build();
|
||||
private static final LegacyComponentSerializer LEGACY_FORMATTER = LegacyComponentSerializer.builder().character('&').useUnusualXRepeatedCharacterHexFormat().hexColors().build();
|
||||
private static final MiniMessage MINI_MESSAGE = MiniMessage.miniMessage();
|
||||
|
||||
@NotNull
|
||||
|
||||
@@ -32,6 +32,7 @@ menu:
|
||||
upgrade-slot: 12
|
||||
output-slot: 14
|
||||
dont-convert-with-modeldata: false
|
||||
force: false
|
||||
items:
|
||||
'1':
|
||||
slots:
|
||||
@@ -43,9 +44,11 @@ menu:
|
||||
- 14
|
||||
material: air
|
||||
|
||||
listen-to-interact-event: true
|
||||
|
||||
messages:
|
||||
prefix: "&#AA3428&lAxSmithing &7» "
|
||||
no-permission: "&cYou do not have permission to do this!"
|
||||
reload: "&aPlugin reloaded in %time%ms!"
|
||||
|
||||
config-version: 1
|
||||
config-version: 3
|
||||
@@ -1,39 +1,12 @@
|
||||
{
|
||||
"dependencies": [
|
||||
{
|
||||
"group": "net.kyori",
|
||||
"artifact": "adventure-text-minimessage",
|
||||
"version": "4.14.0",
|
||||
"group": "org.bstats",
|
||||
"artifact": "bstats-bukkit",
|
||||
"version": "3.0.2",
|
||||
"relocate": {
|
||||
"from": "net.kyori",
|
||||
"to": "com.artillexstudios.axsmithing.libs.adventure"
|
||||
}
|
||||
},
|
||||
{
|
||||
"group": "net.kyori",
|
||||
"artifact": "adventure-text-serializer-legacy",
|
||||
"version": "4.14.0",
|
||||
"relocate": {
|
||||
"from": "net.kyori",
|
||||
"to": "com.artillexstudios.axsmithing.libs.adventure"
|
||||
}
|
||||
},
|
||||
{
|
||||
"group": "net.kyori",
|
||||
"artifact": "adventure-platform-bukkit",
|
||||
"version": "4.3.0",
|
||||
"relocate": {
|
||||
"from": "net.kyori",
|
||||
"to": "com.artillexstudios.axsmithing.libs.adventure"
|
||||
}
|
||||
},
|
||||
{
|
||||
"group": "net.kyori",
|
||||
"artifact": "adventure-api",
|
||||
"version": "4.14.0",
|
||||
"relocate": {
|
||||
"from": "net.kyori",
|
||||
"to": "com.artillexstudios.axsmithing.libs.adventure"
|
||||
"from": "org.bstats",
|
||||
"to": "com.artillexstudios.axsmithing.libs.bstats"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@@ -2,6 +2,7 @@ name: "AxSmithing"
|
||||
main: "com.artillexstudios.axsmithing.AxSmithingPlugin"
|
||||
version: "$version"
|
||||
api-version: "1.16"
|
||||
folia-supported: true
|
||||
depend:
|
||||
- ViaVersion
|
||||
|
||||
|
||||
Reference in new issue
Block a user