Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
93bcf6ce44 | ||
|
|
afcbcfa527 |
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
version = 6.73.6
|
||||
version = 6.73.7
|
||||
kotlin.incremental.useClasspathSnapshot=false
|
||||
Reference in New Issue
Block a user