I'm using the ClientDisconnectionFromServerEvent event to listen for any disconnection. I am only interested in getting disconnections that happened due to errors (time out, etc.).
This listens for every disconnection including the ones triggered by the player.
How can I either only catch the errors that are thrown, or check for the reason?
Thank you.
I'm not asking for you to maintain old versions though, just asking if you are aware of a way to do what I'm trying to achieve with what's currently available in 1.8.9. I don't want you to add anything new.
I'm trying to check if an item can be placed. I started out by checking if the ItemStack is a block but it misses some items such as sugar cane, nether wart, etc. I haven't been able to find a function isPlaceable or any Interface that could be used with instanceof.
My code right now:
BlockPos blockPos = mc.objectMouseOver.getBlockPos();
ItemStack itemInUse = mc.thePlayer.getHeldItem();
if (itemInUse != null) {
Block resultBlock = Block.getBlockFromItem(itemInUse.getItem());
if (mc.theWorld.getBlockState(blockPos).getBlock().getMaterial() == Material.air || resultBlock == null) {
return;
}
}
Is there any function that can do what I'm trying to achieve?