Luohuayu / CatServer

高性能和高兼容性的1.12.2/1.16.5/1.18.2版本Forge+Bukkit+Spigot服务端 (A high performance and high compatibility 1.12.2/1.16.5/1.18.2 version Forge+Bukkit+Spigot server)
https://catmc.org
GNU Lesser General Public License v3.0
1.98k stars 211 forks source link

Handle Quark MatrixEnchantingTable correctly. #401

Closed Fox2Code closed 2 years ago

Fox2Code commented 2 years ago

Quard oddities module replace vanilla Enchanting Table causing errors:

[13:53:44] [Server thread/WARN]: java.lang.ClassCastException: Cannot cast vazkii.quark.oddities.tile.TileMatrixEnchanter to net.minecraft.tileentity.TileEntityEnchantmentTable
[13:53:44] [Server thread/WARN]:        at java.lang.Class.cast(Class.java:2904)
[13:53:44] [Server thread/WARN]:        at org.bukkit.craftbukkit.v1_12_R1.block.CraftBlockEntityState.<init>(CraftBlockEntityState.java:36)
[13:53:44] [Server thread/WARN]:        at org.bukkit.craftbukkit.v1_12_R1.block.CraftEnchantingTable.<init>(CraftEnchantingTable.java:11)
[13:53:44] [Server thread/WARN]:        at org.bukkit.craftbukkit.v1_12_R1.block.CraftBlock.getState(CraftBlock.java:360)
[13:53:44] [Server thread/WARN]:        at org.bukkit.craftbukkit.v1_12_R1.CraftChunk.getTileEntities(CraftChunk.java:115)

This PR fix the issue by adding full support to Quark MatrixEnchantingTable I implemented EnchantingTable APIs support too, so no feature lost.

Note: Quark EnchantingTable TileEnity have an inventory while vanilla doesn't have one.

References: https://github.com/VazkiiMods/AutoRegLib/blob/1.12/src/main/java/vazkii/arl/block/tile/TileSimpleInventory.java https://github.com/VazkiiMods/Quark/blob/1.12/src/main/java/vazkii/quark/oddities/tile/TileMatrixEnchanterBase.java

Luohuayu commented 2 years ago

@Fox2Code Merged into 1.12.2 branch, to be tested