Compare commits

...

15 Commits

Author SHA1 Message Date
Auxilor
93bcf6ce44 Updated to 6.73.7 2024-08-24 14:01:20 +01:00
Auxilor
afcbcfa527 Fixed PacketAutoRecipe 2024-08-24 14:01:02 +01:00
Auxilor
2ed1f2bb2f Updated to 6.73.6 2024-08-23 15:18:30 +01:00
Auxilor
9cb596e746 Fixed FastItemStack#getEnchants(true) giving incorrect results when the enchantment component was removed from an item 2024-08-23 15:18:21 +01:00
Auxilor
763a3e9a87 Merge branch 'refs/heads/develop' 2024-08-21 18:23:59 +01:00
Auxilor
f01691663a Fixed ProtocolLib 2024-08-21 18:23:33 +01:00
Auxilor
6c91b4e41f Updated to 6.73.5 2024-08-21 18:08:50 +01:00
Auxilor
06fdb25925 Patch for ArgParserEnchantment 2024-08-21 18:08:39 +01:00
Will FP
665857a00f Merge pull request #371 from MCCasper/master
Update config.yml
2024-08-16 00:14:13 +02:00
Nikolai Connolly
f18016b2de Update config.yml 2024-08-15 14:53:23 -05:00
Auxilor
88633f94cb Updated to 6.73.4 2024-08-12 21:48:27 +01:00
Auxilor
903084e574 Added 1.21.1 support 2024-08-12 21:48:04 +01:00
Auxilor
dab0ce2ed2 Updated to 6.73.3 2024-07-30 15:58:04 +01:00
Will FP
f01e18950c Merge pull request #365 from Exanthiax/develop 2024-07-24 10:44:03 +01:00
Exanthiax
d4a6bf105b Update ParticleFactoryRGB.kt 2024-07-24 01:55:20 +01:00
9 changed files with 32 additions and 14 deletions

View File

@@ -63,7 +63,7 @@ allprojects {
maven("https://repo.extendedclip.com/content/repositories/placeholderapi/")
// ProtocolLib
//maven("https://repo.dmulloy2.net/nexus/repository/public/")
maven("https://repo.dmulloy2.net/nexus/repository/public/")
// WorldGuard
maven("https://maven.enginehub.org/repo/")

View File

@@ -2,6 +2,7 @@ package com.willfp.eco.core.proxy;
import com.willfp.eco.core.version.Version;
import org.bukkit.Bukkit;
import org.jetbrains.annotations.NotNull;
import java.util.Arrays;
import java.util.List;
@@ -35,6 +36,13 @@ public final class ProxyConstants {
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 {
String currentMinecraftVersion = Bukkit.getServer().getBukkitVersion().split("-")[0];
String nmsVersion;
@@ -45,6 +53,6 @@ public final class ProxyConstants {
nmsVersion = "v" + currentMinecraftVersion.replace(".", "_");
}
NMS_VERSION = nmsVersion;
NMS_VERSION = convertVersion(nmsVersion);
}
}

View File

@@ -14,12 +14,16 @@ object ArgParserEnchantment : LookupArgParser {
val enchants = mutableMapOf<Enchantment, Int>()
for (arg in args) {
val argSplit = arg.split(":")
try {
val argSplit = arg.split(":")
val enchant = Enchantment.getByKey(NamespacedKey.minecraft(argSplit[0].lowercase())) ?: continue
val level = argSplit.getOrNull(1)?.toIntOrNull() ?: enchant.maxLevel
val enchant = Enchantment.getByKey(NamespacedKey.minecraft(argSplit[0].lowercase())) ?: continue
val level = argSplit.getOrNull(1)?.toIntOrNull() ?: enchant.maxLevel
enchants[enchant] = level
enchants[enchant] = level
} catch (e: IllegalArgumentException) {
continue
}
}
if (enchants.isEmpty()) {

View File

@@ -12,7 +12,7 @@ object ParticleFactoryRGB : ParticleFactory {
if (Prerequisite.HAS_1_20_5.isMet) {
Particle.valueOf("DUST")
} else {
Particle.valueOf("REDSTONE_DUST")
Particle.valueOf("REDSTONE")
}
}.getOrNull()

View File

@@ -3,12 +3,19 @@ package com.willfp.eco.internal.spigot.proxy.common.packet.display
import com.willfp.eco.core.EcoPlugin
import com.willfp.eco.core.packet.PacketEvent
import com.willfp.eco.core.packet.PacketListener
import com.willfp.eco.internal.spigot.proxy.common.toResourceLocation
import com.willfp.eco.util.namespacedKeyOf
import net.minecraft.network.protocol.game.ClientboundPlaceGhostRecipePacket
import net.minecraft.resources.ResourceLocation
class PacketAutoRecipe(
private val plugin: EcoPlugin
) : PacketListener {
private val fKey = ClientboundPlaceGhostRecipePacket::class.java
.declaredFields
.first { it.type == ResourceLocation::class.java }
.apply { isAccessible = true }
override fun onSend(event: PacketEvent) {
val packet = event.packet.handle as? ClientboundPlaceGhostRecipePacket ?: return
@@ -24,9 +31,7 @@ class PacketAutoRecipe(
return
}
val fKey = packet.javaClass.getDeclaredField("b")
fKey.isAccessible = true
val key = fKey[packet] as ResourceLocation
fKey[packet] = ResourceLocation(key.namespace, key.path + "_displayed")
fKey[packet] = namespacedKeyOf(key.namespace, key.path + "_displayed").toResourceLocation()
}
}

View File

@@ -25,6 +25,7 @@ import net.minecraft.util.Unit
import net.minecraft.world.item.component.CustomData
import net.minecraft.world.item.component.CustomModelData
import net.minecraft.world.item.component.ItemLore
import net.minecraft.world.item.enchantment.ItemEnchantments
import org.bukkit.Bukkit
import org.bukkit.craftbukkit.CraftRegistry
import org.bukkit.craftbukkit.CraftServer
@@ -53,7 +54,7 @@ class NewEcoFastItemStack(
private val pdc = (handle.get(DataComponents.CUSTOM_DATA)?.copyTag() ?: CompoundTag()).makePdc()
override fun getEnchants(checkStored: Boolean): Map<Enchantment, Int> {
val enchantments = handle.get(DataComponents.ENCHANTMENTS) ?: return emptyMap()
val enchantments = handle.get(DataComponents.ENCHANTMENTS) ?: ItemEnchantments.EMPTY
val map = mutableMapOf<Enchantment, Int>()

View File

@@ -29,7 +29,7 @@ dependencies {
compileOnly("io.papermc.paper:paper-api:1.20.2-R0.1-SNAPSHOT")
// Plugin dependencies
compileOnly("com.comphenix.protocol:ProtocolLib:5.0.0-SNAPSHOT")
compileOnly("com.comphenix.protocol:ProtocolLib:5.1.0")
compileOnly("com.sk89q.worldguard:worldguard-bukkit:7.0.7-SNAPSHOT")
compileOnly("com.github.TechFortress:GriefPrevention:16.17.1")
compileOnly("com.github.TownyAdvanced:Towny:0.99.5.21") {

View File

@@ -101,7 +101,7 @@ math-cache-ttl: 200
# The time (in minutes) for literal patterns to be cached for. Higher values will lead to
# faster evaluation times (less CPU usage) at the expense of slightly more memory usage and
# less reactive values. (Do not change unless you are told to).
literal-cache-ttl: 1
literal-cache-ttl: 10
# If anonymous usage statistics should be tracked. This is very valuable information as it
# helps understand how eco and other plugins are being used by logging player and server

View File

@@ -1,2 +1,2 @@
version = 6.73.2
version = 6.73.7
kotlin.incremental.useClasspathSnapshot=false