Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
88633f94cb | ||
|
|
903084e574 | ||
|
|
dab0ce2ed2 | ||
|
|
c89edd05f5 | ||
|
|
ce2a53e689 | ||
|
|
6658824f9a | ||
|
|
956d4fa10c | ||
|
|
6a7a825376 |
@@ -639,6 +639,15 @@ public final class Items {
|
|||||||
TAGS.put(tag.getIdentifier(), tag);
|
TAGS.put(tag.getIdentifier(), tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get all tags.
|
||||||
|
*
|
||||||
|
* @return All tags.
|
||||||
|
*/
|
||||||
|
public static Collection<ItemTag> getTags() {
|
||||||
|
return TAGS.values();
|
||||||
|
}
|
||||||
|
|
||||||
private Items() {
|
private Items() {
|
||||||
throw new UnsupportedOperationException("This is a utility class and cannot be instantiated");
|
throw new UnsupportedOperationException("This is a utility class and cannot be instantiated");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,6 +31,15 @@ public final class VanillaItemTag implements ItemTag {
|
|||||||
this.tag = tag;
|
this.tag = tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the tag.
|
||||||
|
*
|
||||||
|
* @return The tag.
|
||||||
|
*/
|
||||||
|
public Tag<Material> getTag() {
|
||||||
|
return tag;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@NotNull
|
@NotNull
|
||||||
public String getIdentifier() {
|
public String getIdentifier() {
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.willfp.eco.core.proxy;
|
|||||||
|
|
||||||
import com.willfp.eco.core.version.Version;
|
import com.willfp.eco.core.version.Version;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -35,6 +36,13 @@ public final class ProxyConstants {
|
|||||||
throw new UnsupportedOperationException("This is a utility class and cannot be instantiated");
|
throw new UnsupportedOperationException("This is a utility class and cannot be instantiated");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static String convertVersion(@NotNull final String version) {
|
||||||
|
return switch (version) {
|
||||||
|
case "v1_21_1" -> "v1_21";
|
||||||
|
default -> version;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
static {
|
static {
|
||||||
String currentMinecraftVersion = Bukkit.getServer().getBukkitVersion().split("-")[0];
|
String currentMinecraftVersion = Bukkit.getServer().getBukkitVersion().split("-")[0];
|
||||||
String nmsVersion;
|
String nmsVersion;
|
||||||
@@ -45,6 +53,6 @@ public final class ProxyConstants {
|
|||||||
nmsVersion = "v" + currentMinecraftVersion.replace(".", "_");
|
nmsVersion = "v" + currentMinecraftVersion.replace(".", "_");
|
||||||
}
|
}
|
||||||
|
|
||||||
NMS_VERSION = nmsVersion;
|
NMS_VERSION = convertVersion(nmsVersion);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ object ArgParserEnchantment : LookupArgParser {
|
|||||||
for (arg in args) {
|
for (arg in args) {
|
||||||
val argSplit = arg.split(":")
|
val argSplit = arg.split(":")
|
||||||
|
|
||||||
val enchant = Enchantment.getByKey(NamespacedKey.minecraft(argSplit[0])) ?: continue
|
val enchant = Enchantment.getByKey(NamespacedKey.minecraft(argSplit[0].lowercase())) ?: continue
|
||||||
val level = argSplit.getOrNull(1)?.toIntOrNull() ?: enchant.maxLevel
|
val level = argSplit.getOrNull(1)?.toIntOrNull() ?: enchant.maxLevel
|
||||||
|
|
||||||
enchants[enchant] = level
|
enchants[enchant] = level
|
||||||
|
|||||||
@@ -9,7 +9,8 @@ import java.util.UUID
|
|||||||
import kotlin.jvm.optionals.getOrNull
|
import kotlin.jvm.optionals.getOrNull
|
||||||
|
|
||||||
class HologramFancyHolograms : HologramIntegration {
|
class HologramFancyHolograms : HologramIntegration {
|
||||||
private val manager = FancyHologramsPlugin.get().hologramManager
|
private val manager
|
||||||
|
get() = FancyHologramsPlugin.get().hologramManager
|
||||||
|
|
||||||
override fun createHologram(location: Location, contents: List<String>): Hologram {
|
override fun createHologram(location: Location, contents: List<String>): Hologram {
|
||||||
val id = UUID.randomUUID().toString()
|
val id = UUID.randomUUID().toString()
|
||||||
@@ -19,7 +20,7 @@ class HologramFancyHolograms : HologramIntegration {
|
|||||||
data.isPersistent = false
|
data.isPersistent = false
|
||||||
|
|
||||||
val holo = manager.create(data)
|
val holo = manager.create(data)
|
||||||
FancyHologramsPlugin.get().hologramManager.addHologram(holo)
|
manager.addHologram(holo)
|
||||||
|
|
||||||
return HologramImplFancyHolograms(id)
|
return HologramImplFancyHolograms(id)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
version = 6.73.0
|
version = 6.73.4
|
||||||
kotlin.incremental.useClasspathSnapshot=false
|
kotlin.incremental.useClasspathSnapshot=false
|
||||||
Reference in New Issue
Block a user