Search in sources :

Example 1 with ResourceScrollSaveWarehouseSnapshotMessage

use of com.minecolonies.coremod.network.messages.server.ResourceScrollSaveWarehouseSnapshotMessage in project minecolonies by Minecolonies.

the class WindowResourceList method saveWarehouseSnapshotData.

/**
 * Save the snapshot data to the compound data.
 */
private void saveWarehouseSnapshotData() {
    if (compound != null) {
        CompoundNBT newData = new CompoundNBT();
        warehouseSnapshot.keySet().forEach(f -> newData.putInt(f, warehouseSnapshot.getOrDefault(f, 0)));
        compound.put(TAG_WAREHOUSE_SNAPSHOT, newData);
        compound.putString(TAG_WAREHOUSE_SNAPSHOT_WO_HASH, workOrderHash);
        Network.getNetwork().sendToServer(new ResourceScrollSaveWarehouseSnapshotMessage(buildingPos, warehouseSnapshot, workOrderHash));
    }
}
Also used : CompoundNBT(net.minecraft.nbt.CompoundNBT) ResourceScrollSaveWarehouseSnapshotMessage(com.minecolonies.coremod.network.messages.server.ResourceScrollSaveWarehouseSnapshotMessage)

Aggregations

ResourceScrollSaveWarehouseSnapshotMessage (com.minecolonies.coremod.network.messages.server.ResourceScrollSaveWarehouseSnapshotMessage)1 CompoundNBT (net.minecraft.nbt.CompoundNBT)1