This commit is contained in:
@@ -17,10 +17,10 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Set up JDK 21
|
- name: Set up JDK 25
|
||||||
uses: actions/setup-java@v3
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
java-version: '21'
|
java-version: '25'
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
cache: maven
|
cache: maven
|
||||||
|
|
||||||
|
|||||||
@@ -6,13 +6,13 @@
|
|||||||
|
|
||||||
<groupId>pers.xanadu</groupId>
|
<groupId>pers.xanadu</groupId>
|
||||||
<artifactId>EnderDragon</artifactId>
|
<artifactId>EnderDragon</artifactId>
|
||||||
<version>2.5.8</version>
|
<version>2.5.9-tss3</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>EnderDragon</name>
|
<name>EnderDragon</name>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<java.version>1.8</java.version>
|
<java.version>25</java.version>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
@@ -21,16 +21,22 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>3.8.1</version>
|
<version>3.14.1</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<source>8</source>
|
<release>${java.version}</release>
|
||||||
<target>8</target>
|
<annotationProcessorPaths>
|
||||||
|
<path>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
<version>1.18.46</version>
|
||||||
|
</path>
|
||||||
|
</annotationProcessorPaths>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-shade-plugin</artifactId>
|
<artifactId>maven-shade-plugin</artifactId>
|
||||||
<version>3.2.4</version>
|
<version>3.6.2</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<phase>package</phase>
|
<phase>package</phase>
|
||||||
@@ -148,6 +154,10 @@
|
|||||||
</build>
|
</build>
|
||||||
|
|
||||||
<repositories>
|
<repositories>
|
||||||
|
<repository>
|
||||||
|
<id>papermc</id>
|
||||||
|
<url>https://repo.papermc.io/repository/maven-public/</url>
|
||||||
|
</repository>
|
||||||
<repository>
|
<repository>
|
||||||
<id>spigotmc-repo</id>
|
<id>spigotmc-repo</id>
|
||||||
<url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
|
<url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
|
||||||
@@ -179,11 +189,10 @@
|
|||||||
<!-- <scope>provided</scope>-->
|
<!-- <scope>provided</scope>-->
|
||||||
<!-- </dependency>-->
|
<!-- </dependency>-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.spigotmc1.20.6</groupId>
|
<groupId>io.papermc.paper</groupId>
|
||||||
<artifactId>spigot-api</artifactId>
|
<artifactId>paper-api</artifactId>
|
||||||
<version>1.20.6-R0.1</version>
|
<version>26.2.build.112-stable</version>
|
||||||
<scope>system</scope>
|
<scope>provided</scope>
|
||||||
<systemPath>${basedir}/lib/spigot-api-1.20.6-R0.1-20240613.152322-4-shaded.jar</systemPath>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>me.clip</groupId>
|
<groupId>me.clip</groupId>
|
||||||
@@ -222,13 +231,13 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.groovy</groupId>
|
<groupId>org.apache.groovy</groupId>
|
||||||
<artifactId>groovy</artifactId>
|
<artifactId>groovy</artifactId>
|
||||||
<version>4.0.18</version>
|
<version>4.0.32</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.projectlombok</groupId>
|
<groupId>org.projectlombok</groupId>
|
||||||
<artifactId>lombok</artifactId>
|
<artifactId>lombok</artifactId>
|
||||||
<version>1.18.30</version>
|
<version>1.18.46</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
@@ -73,15 +73,15 @@ public class DragonSpawnListener implements Listener {
|
|||||||
Lang.broadcastMSG(str.replaceAll("%times%",String.valueOf(times)));
|
Lang.broadcastMSG(str.replaceAll("%times%",String.valueOf(times)));
|
||||||
}
|
}
|
||||||
dragon.setCustomName(myDragon.display_name);
|
dragon.setCustomName(myDragon.display_name);
|
||||||
setAttribute(dragon, Attribute.GENERIC_MAX_HEALTH, myDragon.max_health);
|
setAttribute(dragon, Attribute.MAX_HEALTH, myDragon.max_health);
|
||||||
dragon.setHealth(myDragon.spawn_health);
|
dragon.setHealth(myDragon.spawn_health);
|
||||||
dragon.setMaximumNoDamageTicks(myDragon.no_damage_tick);
|
dragon.setMaximumNoDamageTicks(myDragon.no_damage_tick);
|
||||||
|
|
||||||
//modifyAttribute(dragon, Attribute.GENERIC_MOVEMENT_SPEED, myDragon.move_speed_modify);//
|
//modifyAttribute(dragon, Attribute.GENERIC_MOVEMENT_SPEED, myDragon.move_speed_modify);//
|
||||||
|
|
||||||
modifyAttribute(dragon, Attribute.GENERIC_ARMOR, myDragon.armor_modify);
|
modifyAttribute(dragon, Attribute.ARMOR, myDragon.armor_modify);
|
||||||
|
|
||||||
modifyAttribute(dragon, Attribute.GENERIC_ARMOR_TOUGHNESS, myDragon.armor_toughness_modify);
|
modifyAttribute(dragon, Attribute.ARMOR_TOUGHNESS, myDragon.armor_toughness_modify);
|
||||||
String color = myDragon.glow_color.toUpperCase();
|
String color = myDragon.glow_color.toUpperCase();
|
||||||
if(color.equals("NONE")) dragon.setGlowing(false);
|
if(color.equals("NONE")) dragon.setGlowing(false);
|
||||||
else setGlowingColor(dragon,getGlowColor(color));
|
else setGlowingColor(dragon,getGlowColor(color));
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import java.net.URLConnection;
|
|||||||
public final class UpdateChecker {
|
public final class UpdateChecker {
|
||||||
public static void checkUpdate(){
|
public static void checkUpdate(){
|
||||||
// https://github.com/iXanadu13/EnderDragon/issues/17
|
// https://github.com/iXanadu13/EnderDragon/issues/17
|
||||||
if (EnderDragon.plugin.getConfig().getBoolean("skip_update_check")) return;
|
if (EnderDragon.plugin.getConfig().getBoolean("skip_update_check", true)) return;
|
||||||
Lang.info(Lang.plugin_checking_update);
|
Lang.info(Lang.plugin_checking_update);
|
||||||
new BukkitRunnable(){
|
new BukkitRunnable(){
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -9,10 +9,6 @@ import pers.xanadu.enderdragon.nms.NMSItem.INMSItemManager;
|
|||||||
import pers.xanadu.enderdragon.nms.RespawnAnchor.IRespawnAnchorManager;
|
import pers.xanadu.enderdragon.nms.RespawnAnchor.IRespawnAnchorManager;
|
||||||
import pers.xanadu.enderdragon.nms.WorldData.IWorldDataManager;
|
import pers.xanadu.enderdragon.nms.WorldData.IWorldDataManager;
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
|
||||||
|
|
||||||
import static org.bukkit.Bukkit.getServer;
|
|
||||||
|
|
||||||
public class Version {
|
public class Version {
|
||||||
public static final String setting_dragon = "2.5.4";
|
public static final String setting_dragon = "2.5.4";
|
||||||
public static final String lang = "2.2.0";
|
public static final String lang = "2.2.0";
|
||||||
@@ -26,29 +22,24 @@ public class Version {
|
|||||||
private static String version = "no version found";
|
private static String version = "no version found";
|
||||||
private static boolean isMohist = false;
|
private static boolean isMohist = false;
|
||||||
public static void init(){
|
public static void init(){
|
||||||
try {
|
String minecraftVersion = Bukkit.getMinecraftVersion();
|
||||||
version = getServer().getClass().getPackage().getName().split("\\.")[3];
|
String[] parts = minecraftVersion.split("\\.");
|
||||||
} catch (Throwable throwable) {
|
int first = Integer.parseInt(parts[0]);
|
||||||
try{
|
|
||||||
//paper 1.20.6+
|
|
||||||
Class<?> clazz = Class.forName("io.papermc.paper.util.MappingEnvironment");
|
|
||||||
Field LEGACY_CB_VERSION = clazz.getField("LEGACY_CB_VERSION");
|
|
||||||
version = (String) LEGACY_CB_VERSION.get(null);
|
|
||||||
}catch (ReflectiveOperationException e){
|
|
||||||
version = Bukkit.getVersion().split("-")[0];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
String[] mc_version = getServer().getBukkitVersion().split("-")[0].split("\\.");
|
|
||||||
|
|
||||||
int first = Integer.parseInt(mc_version[0]);
|
|
||||||
// e.g. 26.1.2.build.53
|
|
||||||
if (first >= 26) {
|
if (first >= 26) {
|
||||||
|
// Paper 26.x no longer version-qualifies CraftBukkit packages.
|
||||||
|
version = minecraftVersion;
|
||||||
mcMainVersion = first;
|
mcMainVersion = first;
|
||||||
mcPatchVersion = Integer.parseInt(mc_version[1]);
|
mcPatchVersion = parts.length > 1 ? Integer.parseInt(parts[1]) : 0;
|
||||||
} else {
|
} else {
|
||||||
mcMainVersion = Integer.parseInt(mc_version[1]);
|
// Retained for the legacy implementation classes still bundled in the project.
|
||||||
if(mc_version.length<=2) mcPatchVersion = 0;
|
try {
|
||||||
else mcPatchVersion = Integer.parseInt(mc_version[2]);
|
version = Bukkit.getServer().getClass().getPackage().getName().split("\\.")[3];
|
||||||
|
} catch (RuntimeException ex) {
|
||||||
|
version = minecraftVersion;
|
||||||
|
}
|
||||||
|
mcMainVersion = parts.length > 1 ? Integer.parseInt(parts[1]) : first;
|
||||||
|
mcPatchVersion = parts.length > 2 ? Integer.parseInt(parts[2]) : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Lang.info("Found version: " + version);
|
Lang.info("Found version: " + version);
|
||||||
@@ -56,7 +47,7 @@ public class Version {
|
|||||||
Class.forName("net.minecraftforge.server.ServerMain");
|
Class.forName("net.minecraftforge.server.ServerMain");
|
||||||
isMohist = true;
|
isMohist = true;
|
||||||
}catch(ReflectiveOperationException ignored){}
|
}catch(ReflectiveOperationException ignored){}
|
||||||
NBT_UPDATE = mcMainVersion > 20 || mcMainVersion == 20 && mcPatchVersion >=5;
|
NBT_UPDATE = mcMainVersion > 20 || mcMainVersion == 20 && mcPatchVersion >= 5;
|
||||||
}
|
}
|
||||||
public static INMSItemManager getNMSItemManager(){
|
public static INMSItemManager getNMSItemManager(){
|
||||||
switch (version){
|
switch (version){
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ name: EnderDragon
|
|||||||
version: ${project.version}
|
version: ${project.version}
|
||||||
main: pers.xanadu.enderdragon.EnderDragon
|
main: pers.xanadu.enderdragon.EnderDragon
|
||||||
author: Xanadu13
|
author: Xanadu13
|
||||||
api-version: 1.13
|
api-version: '26.2'
|
||||||
softdepend:
|
softdepend:
|
||||||
- MMOItems
|
- MMOItems
|
||||||
- MythicLib
|
- MythicLib
|
||||||
|
|||||||
Reference in New Issue
Block a user