mirror of
https://github.com/darksaid98/nightcore-spigot.git
synced 2026-12-01 14:38:47 +00:00
v2.7.3.4
FIXED: - Errors when using Spigot.
This commit is contained in:
1 parent
c5409e25cb
commit
68a5b068e2
6 files changed
+20
-7
No files matched your search
@@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>su.nightexpress.nightcore</groupId>
|
||||
<artifactId>nightcore</artifactId>
|
||||
<version>2.7.3.3</version>
|
||||
<version>2.7.3.4</version>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>21</maven.compiler.source>
|
||||
|
||||
@@ -107,9 +107,7 @@ public class ItemUtil {
|
||||
if (Version.isAtLeast(Version.MC_1_20_6) && material.isItem()) {
|
||||
EquipmentSlot slot = material.getEquipmentSlot();
|
||||
material.getDefaultAttributeModifiers(slot).forEach((attribute, modifier) -> {
|
||||
if (meta.hasAttributeModifiers()) return;
|
||||
|
||||
var modifiers = meta.getAttributeModifiers(attribute);
|
||||
var modifiers = meta.getAttributeModifiers() == null ? null : meta.getAttributeModifiers(attribute);
|
||||
if (modifiers == null || modifiers.isEmpty()) {
|
||||
meta.addAttributeModifier(attribute, modifier);
|
||||
}
|
||||
|
||||
@@ -64,12 +64,11 @@ public enum Version {
|
||||
String bukkitVersion = core.getServer().getBukkitVersion();
|
||||
String bukkitName = core.getServer().getName();
|
||||
String exact = bukkitVersion.split("-")[0];
|
||||
boolean isSpigot = bukkitName.equalsIgnoreCase("Spigot");
|
||||
boolean isSpigot = bukkitName.equalsIgnoreCase("Spigot") || bukkitName.equalsIgnoreCase("CraftBukkit");
|
||||
|
||||
current = Stream.of(values()).sorted(Comparator.reverseOrder()).filter(version -> exact.equalsIgnoreCase(version.getLocalized())).findFirst().orElse(UNKNOWN);
|
||||
software = isSpigot ? new SpigotBridge() : new PaperBridge();
|
||||
//spigot = bukkitName.equalsIgnoreCase("Spigot");
|
||||
core.info("Server version detected as " + bukkitName + " " + current.getLocalized() + ".");
|
||||
core.info("Server version detected as " + bukkitName + " " + current.getLocalized() + ". Using " + software().getName() + ".");
|
||||
|
||||
loadComponents(core);
|
||||
}
|
||||
|
||||
@@ -11,6 +11,12 @@ import su.nightexpress.nightcore.util.text.NightMessage;
|
||||
@SuppressWarnings("UnstableApiUsage")
|
||||
public class PaperBridge implements Software {
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getName() {
|
||||
return "paper-bridge";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSpigot() {
|
||||
return false;
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
package su.nightexpress.nightcore.util.bridge;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public interface Software {
|
||||
|
||||
@NotNull String getName();
|
||||
|
||||
boolean isSpigot();
|
||||
|
||||
boolean isPaper();
|
||||
|
||||
@@ -10,6 +10,12 @@ import su.nightexpress.nightcore.util.text.NightMessage;
|
||||
@SuppressWarnings("UnstableApiUsage")
|
||||
public class SpigotBridge implements Software {
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getName() {
|
||||
return "spigot-bridge";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSpigot() {
|
||||
return true;
|
||||
|
||||
Reference in new issue
Block a user