use of baritone.api.cache.IRememberedInventory in project Spark-Client by Spark-Client-Development.
the class ChestsCommand method execute.
@Override
public void execute(String label, IArgConsumer args) throws CommandException {
args.requireMax(0);
Set<Map.Entry<BlockPos, IRememberedInventory>> entries = ctx.worldData().getContainerMemory().getRememberedInventories().entrySet();
if (entries.isEmpty()) {
throw new CommandInvalidStateException("No remembered inventories");
}
for (Map.Entry<BlockPos, IRememberedInventory> entry : entries) {
// betterblockpos has censoring
BetterBlockPos pos = new BetterBlockPos(entry.getKey());
IRememberedInventory inv = entry.getValue();
logDirect(pos.toString());
for (ItemStack item : inv.getContents()) {
ITextComponent component = item.getTextComponent();
component.appendText(String.format(" x %d", item.getCount()));
logDirect(component);
}
}
}
Aggregations