Migrations
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
|
||||
package appeng.helpers;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.Material;
|
||||
import net.minecraft.block.material.MaterialColor;
|
||||
import net.minecraft.block.material.PushReaction;
|
||||
|
||||
|
||||
@@ -36,10 +36,10 @@ import net.minecraft.inventory.CraftingInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.ListNBT;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
@@ -200,7 +200,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
|
||||
}
|
||||
}
|
||||
|
||||
public void writeToNBT(final CompoundNBT data) {
|
||||
public void writeToNBT(final CompoundTag data) {
|
||||
this.config.writeToNBT(data, "config");
|
||||
this.patterns.writeToNBT(data, "patterns");
|
||||
this.storage.writeToNBT(data, "storage");
|
||||
@@ -212,7 +212,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
|
||||
final ListNBT waitingToSend = new ListNBT();
|
||||
if (this.waitingToSend != null) {
|
||||
for (final ItemStack is : this.waitingToSend) {
|
||||
final CompoundNBT item = new CompoundNBT();
|
||||
final CompoundTag item = new CompoundTag();
|
||||
is.write(item);
|
||||
waitingToSend.add(item);
|
||||
}
|
||||
@@ -220,12 +220,12 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
|
||||
data.put("waitingToSend", waitingToSend);
|
||||
}
|
||||
|
||||
public void readFromNBT(final CompoundNBT data) {
|
||||
public void readFromNBT(final CompoundTag data) {
|
||||
this.waitingToSend = null;
|
||||
final ListNBT waitingList = data.getList("waitingToSend", 10);
|
||||
if (waitingList != null) {
|
||||
for (int x = 0; x < waitingList.size(); x++) {
|
||||
final CompoundNBT c = waitingList.getCompound(x);
|
||||
final CompoundTag c = waitingList.getCompound(x);
|
||||
if (c != null) {
|
||||
final ItemStack is = ItemStack.read(c);
|
||||
this.addToSendList(is);
|
||||
|
||||
@@ -21,7 +21,7 @@ package appeng.helpers;
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.Direction;
|
||||
|
||||
import appeng.api.implementations.IUpgradeableHost;
|
||||
import appeng.api.networking.crafting.ICraftingProvider;
|
||||
|
||||
@@ -22,7 +22,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.ListNBT;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.StringTextComponent;
|
||||
@@ -38,7 +38,7 @@ public class InvalidPatternHelper {
|
||||
private final boolean canSubstitute;
|
||||
|
||||
public InvalidPatternHelper(final ItemStack is) {
|
||||
final CompoundNBT encodedValue = is.getTag();
|
||||
final CompoundTag encodedValue = is.getTag();
|
||||
|
||||
if (encodedValue == null) {
|
||||
throw new IllegalArgumentException("No pattern here!");
|
||||
@@ -55,7 +55,7 @@ public class InvalidPatternHelper {
|
||||
}
|
||||
|
||||
for (int i = 0; i < inTag.size(); i++) {
|
||||
CompoundNBT in = inTag.getCompound(i);
|
||||
CompoundTag in = inTag.getCompound(i);
|
||||
|
||||
// skip empty slots in the crafting grid
|
||||
if (in.isEmpty()) {
|
||||
@@ -89,7 +89,7 @@ public class InvalidPatternHelper {
|
||||
|
||||
private ItemStack stack;
|
||||
|
||||
public PatternIngredient(CompoundNBT tag) {
|
||||
public PatternIngredient(CompoundTag tag) {
|
||||
this.stack = ItemStack.read(tag);
|
||||
|
||||
if (this.stack.isEmpty()) {
|
||||
|
||||
@@ -18,19 +18,19 @@
|
||||
|
||||
package appeng.helpers;
|
||||
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.world.BlockView;
|
||||
|
||||
import appeng.api.util.IOrientable;
|
||||
|
||||
public class LocationRotation implements IOrientable {
|
||||
|
||||
private final IBlockReader w;
|
||||
private final BlockView w;
|
||||
private final int x;
|
||||
private final int y;
|
||||
private final int z;
|
||||
|
||||
public LocationRotation(final IBlockReader world, final int x, final int y, final int z) {
|
||||
public LocationRotation(final BlockView world, final int x, final int y, final int z) {
|
||||
this.w = world;
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
|
||||
@@ -20,10 +20,10 @@ package appeng.helpers;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.state.Property;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Direction.Axis;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.math.Direction.Axis;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.api.util.IOrientable;
|
||||
@@ -32,10 +32,10 @@ import appeng.decorative.solid.QuartzPillarBlock;
|
||||
public class MetaRotation implements IOrientable {
|
||||
|
||||
private final Property<Direction> facingProp;
|
||||
private final IBlockReader w;
|
||||
private final BlockView w;
|
||||
private final BlockPos pos;
|
||||
|
||||
public MetaRotation(final IBlockReader world, final BlockPos pos, final Property<Direction> facingProp) {
|
||||
public MetaRotation(final BlockView world, final BlockPos pos, final Property<Direction> facingProp) {
|
||||
this.w = world;
|
||||
this.pos = pos;
|
||||
this.facingProp = facingProp;
|
||||
|
||||
@@ -23,7 +23,7 @@ import java.util.concurrent.Future;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
@@ -49,9 +49,9 @@ public class MultiCraftingTracker {
|
||||
this.size = size;
|
||||
}
|
||||
|
||||
public void readFromNBT(final CompoundNBT extra) {
|
||||
public void readFromNBT(final CompoundTag extra) {
|
||||
for (int x = 0; x < this.size; x++) {
|
||||
final CompoundNBT link = extra.getCompound("links-" + x);
|
||||
final CompoundTag link = extra.getCompound("links-" + x);
|
||||
|
||||
if (link != null && !link.isEmpty()) {
|
||||
this.setLink(x, AEApi.instance().storage().loadCraftingLink(link, this.owner));
|
||||
@@ -59,12 +59,12 @@ public class MultiCraftingTracker {
|
||||
}
|
||||
}
|
||||
|
||||
public void writeToNBT(final CompoundNBT extra) {
|
||||
public void writeToNBT(final CompoundTag extra) {
|
||||
for (int x = 0; x < this.size; x++) {
|
||||
final ICraftingLink link = this.getLink(x);
|
||||
|
||||
if (link != null) {
|
||||
final CompoundNBT ln = new CompoundNBT();
|
||||
final CompoundTag ln = new CompoundTag();
|
||||
link.writeToNBT(ln);
|
||||
extra.put("links-" + x, ln);
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
package appeng.helpers;
|
||||
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.Direction;
|
||||
|
||||
import appeng.api.util.IOrientable;
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.ICraftingRecipe;
|
||||
import net.minecraft.item.crafting.IRecipeType;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.ListNBT;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@@ -61,7 +61,7 @@ public class PatternHelper implements ICraftingPatternDetails, Comparable<Patter
|
||||
private int priority = 0;
|
||||
|
||||
public PatternHelper(final ItemStack is, final World w) {
|
||||
final CompoundNBT encodedValue = is.getTag();
|
||||
final CompoundTag encodedValue = is.getTag();
|
||||
|
||||
if (encodedValue == null) {
|
||||
throw new IllegalArgumentException("No pattern here!");
|
||||
@@ -79,7 +79,7 @@ public class PatternHelper implements ICraftingPatternDetails, Comparable<Patter
|
||||
final List<IAEItemStack> out = new ArrayList<>();
|
||||
|
||||
for (int x = 0; x < inTag.size(); x++) {
|
||||
CompoundNBT ingredient = inTag.getCompound(x);
|
||||
CompoundTag ingredient = inTag.getCompound(x);
|
||||
final ItemStack gs = ItemStack.read(ingredient);
|
||||
|
||||
if (!ingredient.isEmpty() && gs.isEmpty()) {
|
||||
@@ -111,7 +111,7 @@ public class PatternHelper implements ICraftingPatternDetails, Comparable<Patter
|
||||
this.correctOutput = ItemStack.EMPTY;
|
||||
|
||||
for (int x = 0; x < outTag.size(); x++) {
|
||||
CompoundNBT resultItemTag = outTag.getCompound(x);
|
||||
CompoundTag resultItemTag = outTag.getCompound(x);
|
||||
final ItemStack gs = ItemStack.read(resultItemTag);
|
||||
|
||||
if (!resultItemTag.isEmpty() && gs.isEmpty()) {
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
package appeng.helpers;
|
||||
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
|
||||
import appeng.api.util.AEColor;
|
||||
|
||||
Reference in New Issue
Block a user