mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-15 01:25:04 +00:00
fix fluid bus legacy config
This commit is contained in:
1 parent
a900afc9fe
commit
c1ccceb123
2 files changed
+38
No files matched your search
@@ -1,17 +1,23 @@
|
||||
package com.glodblock.github.common.parts;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import com.glodblock.github.client.textures.FCPartsTexture;
|
||||
import com.glodblock.github.util.Util;
|
||||
|
||||
import appeng.api.config.FuzzyMode;
|
||||
import appeng.api.config.Upgrades;
|
||||
import appeng.api.networking.energy.IEnergyGrid;
|
||||
import appeng.api.storage.IMEMonitor;
|
||||
import appeng.api.storage.StorageName;
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.storage.data.IAEStack;
|
||||
import appeng.me.GridAccessException;
|
||||
import appeng.parts.automation.PartBaseExportBus;
|
||||
import appeng.tile.inventory.IAEStackInventory;
|
||||
import appeng.util.InventoryAdaptor;
|
||||
|
||||
public class PartFluidExportBus extends PartBaseExportBus<IAEFluidStack> {
|
||||
@@ -66,4 +72,18 @@ public class PartFluidExportBus extends PartBaseExportBus<IAEFluidStack> {
|
||||
|
||||
@Override
|
||||
protected void doOreDict(InventoryAdaptor destination, IEnergyGrid energy, IMEMonitor<IAEFluidStack> gridInv) {}
|
||||
|
||||
// legacy
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound extra) {
|
||||
super.readFromNBT(extra);
|
||||
|
||||
final IAEStackInventory config = this.getAEInventoryByName(StorageName.NONE);
|
||||
for (int i = 0; i < config.getSizeInventory(); i++) {
|
||||
final IAEStack<?> stack = config.getAEStackInSlot(i);
|
||||
if (stack instanceof IAEItemStack ais) {
|
||||
config.putAEStackInSlot(i, Util.getAEFluidFromItem(ais.getItemStack()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.glodblock.github.common.parts;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
@@ -10,6 +11,7 @@ import net.minecraftforge.fluids.IFluidHandler;
|
||||
|
||||
import com.glodblock.github.client.textures.FCPartsTexture;
|
||||
import com.glodblock.github.util.BlockPos;
|
||||
import com.glodblock.github.util.Util;
|
||||
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.FuzzyMode;
|
||||
@@ -19,6 +21,8 @@ import appeng.api.networking.energy.IEnergySource;
|
||||
import appeng.api.storage.IMEMonitor;
|
||||
import appeng.api.storage.StorageName;
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.storage.data.IAEStack;
|
||||
import appeng.me.GridAccessException;
|
||||
import appeng.parts.automation.PartBaseImportBus;
|
||||
import appeng.tile.inventory.IAEStackInventory;
|
||||
@@ -155,4 +159,18 @@ public class PartFluidImportBus extends PartBaseImportBus<IAEFluidStack> {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// legacy
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound extra) {
|
||||
super.readFromNBT(extra);
|
||||
|
||||
final IAEStackInventory config = this.getAEInventoryByName(StorageName.NONE);
|
||||
for (int i = 0; i < config.getSizeInventory(); i++) {
|
||||
final IAEStack<?> stack = config.getAEStackInSlot(i);
|
||||
if (stack instanceof IAEItemStack ais) {
|
||||
config.putAEStackInSlot(i, Util.getAEFluidFromItem(ais.getItemStack()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user