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