apace100 / apoli

MIT License
40 stars 46 forks source link

ItemStackMixin#addUnusableTooltip breaks Polymer's server side tooltips #68

Closed Patbox closed 1 year ago

Patbox commented 2 years ago

https://github.com/apace100/apoli/blob/1.19/src/main/java/io/github/apace100/apoli/mixin/ItemStackMixin.java#L55

This mixin breaks (otherwise fully working on server) getTooltip method.

Ideally that mixin should be either limited to client-only or be made server compatible.

[09:53:54] [Netty Epoll Server IO #38/ERROR]: Failed to get tooltip of 1 drink_bottle
java.lang.ClassCastException: class io.github.apace100.apoli.util.ApoliConfigServer cannot be cast to class io.github.apace100.apoli.util.ApoliConfigClient (io.github.apace100.apoli.util.ApoliConfigServer and io.github.apace100.apoli.util.ApoliConfigClient are in unnamed module of loader org.quiltmc.loader.impl.launch.knot.KnotClassLoader @366e2eef)
    at Not Enough Crashes deobfuscated stack trace.(1.19.2+build.28) ~[?:?]
    at net.minecraft.item.ItemStack.handler$zjd000$addUnusableTooltip(ItemStack:2682) ~[?:?]
    at net.minecraft.item.ItemStack.getTooltip(ItemStack:687) ~[?:?]
    at eu.pb4.polymer.api.item.PolymerItemUtils.createItemStack(PolymerItemUtils.java:364) ~[polymer-0.2.19-dev+1.19.2.jar-f8de1d56-2ae6-466b-bcdb-5cfd873ad221-nested.jar:?]
    at eu.pb4.polymer.api.item.PolymerItem.getPolymerItemStack(PolymerItem.java:36) ~[polymer-0.2.19-dev+1.19.2.jar-f8de1d56-2ae6-466b-bcdb-5cfd873ad221-nested.jar:?]
    at eu.pb4.brewery.item.DrinkItem.getPolymerItemStack(DrinkItem.java:178) ~[brewery-0.2.2+1.19.2.jar:?]
    at eu.pb4.polymer.api.item.PolymerItemUtils.getPolymerItemStack(PolymerItemUtils.java:70) ~[polymer-0.2.19-dev+1.19.2.jar-f8de1d56-2ae6-466b-bcdb-5cfd873ad221-nested.jar:?]
    at net.minecraft.network.PacketByteBuf.localvar$cii000$polymer_replaceWithVanillaItem(PacketByteBuf:1760) ~[?:?]
    at net.minecraft.network.PacketByteBuf.writeItemStack(PacketByteBuf) ~[?:?]
    at net.minecraft.network.packet.s2c.play.ScreenHandlerSlotUpdateS2CPacket.write(ScreenHandlerSlotUpdateS2CPacket:36) ~[?:?]
    at net.minecraft.network.PacketEncoder.encode(PacketEncoder:45) ~[?:?]
    at net.minecraft.network.PacketEncoder.encode(PacketEncoder:14) ~[?:?]
    at io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:107) [netty-codec-4.1.77.Final.jar:?]
    at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:717) [netty-transport-4.1.77.Final.jar:?]
    at io.netty.channel.AbstractChannelHandlerContext.invokeWriteAndFlush(AbstractChannelHandlerContext.java:764) [netty-transport-4.1.77.Final.jar:?]
    at io.netty.channel.AbstractChannelHandlerContext$WriteTask.run(AbstractChannelHandlerContext.java:1071) [netty-transport-4.1.77.Final.jar:?]
    at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174) [netty-common-4.1.77.Final.jar:?]
    at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167) [netty-common-4.1.77.Final.jar:?]
    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470) [netty-common-4.1.77.Final.jar:?]
    at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:391) [netty-transport-classes-epoll-4.1.77.Final.jar:?]
    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:995) [netty-common-4.1.77.Final.jar:?]
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [netty-common-4.1.77.Final.jar:?]
    at java.lang.Thread.run(Thread.java:833) [?:?]
Patbox commented 1 year ago

Still an issue