Fix small issue with TOP support.

This commit is contained in:
modmuss50 2017-10-13 11:07:18 +01:00
parent 709922b708
commit a26d11ee51

View file

@ -105,13 +105,14 @@ public class ProbeProvider implements IProbeInfoProvider {
probeInfo.text("Inventory"); probeInfo.text("Inventory");
} }
Inventory inventory = legacyMachineBase.getInventoryForTile().get(); Inventory inventory = legacyMachineBase.getInventoryForTile().get();
List<ItemStack> stacks = Arrays.stream(inventory.contents).filter(stack -> !stack.isEmpty()).collect(Collectors.toList()); if(!inventory.isEmpty()){
try { List<ItemStack> stacks = Arrays.stream(inventory.contents).filter(stack -> !stack.isEmpty()).collect(Collectors.toList());
methodHandle_addStacks.invoke(probeInfo, world, null, stacks, player.isSneaking()); try {
} catch (Throwable throwable) { methodHandle_addStacks.invoke(probeInfo, world, null, stacks, player.isSneaking());
throwable.printStackTrace(); } catch (Throwable throwable) {
throwable.printStackTrace();
}
} }
} }
if (!legacyMachineBase.upgradeInventory.isEmpty() && player.isSneaking()) { if (!legacyMachineBase.upgradeInventory.isEmpty() && player.isSneaking()) {
probeInfo.horizontal(); probeInfo.horizontal();