Can still "exchange" one block at a time even when player does not have block in inventory
poeticbulldozer opened this issue ยท 6 comments
I seem to be able to exchange one block at a time even when I don't have any of the correct block in my inventory. This appears to work with any exchanger and any block type.
It does in the sense that it can endlessly turn worthless blocks into valuable ones. For example, I can turn stone into dark ineffable glass and then mine it as much as I want.
Apparently it was the Tool Belt causing the exploit to happen, so I guess I'll have to add a blacklist config option for containers like that as a workaround.
I just noticed today that I got an error message in console when I was testing this. Here it is, in case it'll help:
Error executing task
java.util.concurrent.ExecutionException: java.lang.ClassCastException: gigaherz.toolbelt.belt.ToolBeltInventory cannot be cast to net.minecraftforge.items.wrapper.InvWrapper
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:192)
at net.minecraft.util.Util.func_181617_a(SourceFile:47)
at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:721)
at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:666)
at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:185)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:524)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassCastException: gigaherz.toolbelt.belt.ToolBeltInventory cannot be cast to net.minecraftforge.items.wrapper.InvWrapper
at jackyy.exchangers.handler.ExchangerHandler.findItemHolder(ExchangerHandler.java:414)
at jackyy.exchangers.handler.ExchangerHandler.consumeItemInInventory(ExchangerHandler.java:391)
at jackyy.exchangers.handler.ExchangerHandler.placeBlock(ExchangerHandler.java:223)
at jackyy.exchangers.handler.ExchangerHandler.func_180614_a(ExchangerHandler.java:163)
at net.minecraftforge.common.ForgeHooks.onPlaceItemIntoWorld(ForgeHooks.java:860)
at net.minecraft.item.ItemStack.func_179546_a(ItemStack.java:186)
at net.minecraft.server.management.PlayerInteractionManager.func_187251_a(PlayerInteractionManager.java:489)
at net.minecraft.network.NetHandlerPlayServer.func_184337_a(NetHandlerPlayServer.java:739)
at net.minecraft.network.play.client.CPacketPlayerTryUseItemOnBlock.func_148833_a(SourceFile:55)
at net.minecraft.network.play.client.CPacketPlayerTryUseItemOnBlock.func_148833_a(SourceFile:11)
at net.minecraft.network.PacketThreadUtil$1.run(SourceFile:13)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at net.minecraft.util.Util.func_181617_a(SourceFile:46)
... 5 more
Fixed in 2.7.1, turns out no blacklisting were needed.