Migrations

This commit is contained in:
Sebastian Hartte
2020-06-27 16:18:20 +02:00
parent d638d083c2
commit ba71a82288
303 changed files with 1216 additions and 1210 deletions
@@ -5,7 +5,7 @@ import java.util.Objects;
import javax.annotation.Nonnull;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.CompoundTag;
import net.minecraftforge.fluids.FluidStack;
import appeng.api.storage.data.IAEFluidStack;
@@ -266,16 +266,16 @@ public class AEFluidInventory implements IAEFluidTank {
return stack;
}
public void writeToNBT(final CompoundNBT data, final String name) {
final CompoundNBT c = new CompoundNBT();
public void writeToNBT(final CompoundTag data, final String name) {
final CompoundTag c = new CompoundTag();
this.writeToNBT(c);
data.put(name, c);
}
private void writeToNBT(final CompoundNBT target) {
private void writeToNBT(final CompoundTag target) {
for (int x = 0; x < this.fluids.length; x++) {
try {
final CompoundNBT c = new CompoundNBT();
final CompoundTag c = new CompoundTag();
if (this.fluids[x] != null) {
this.fluids[x].writeToNBT(c);
@@ -287,17 +287,17 @@ public class AEFluidInventory implements IAEFluidTank {
}
}
public void readFromNBT(final CompoundNBT data, final String name) {
final CompoundNBT c = data.getCompound(name);
public void readFromNBT(final CompoundTag data, final String name) {
final CompoundTag c = data.getCompound(name);
if (!c.isEmpty()) {
this.readFromNBT(c);
}
}
private void readFromNBT(final CompoundNBT target) {
private void readFromNBT(final CompoundTag target) {
for (int x = 0; x < this.fluids.length; x++) {
try {
final CompoundNBT c = target.getCompound("#" + x);
final CompoundTag c = target.getCompound("#" + x);
if (!c.isEmpty()) {
this.fluids[x] = AEFluidStack.fromNBT(c);