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
-1
View File
@@ -1,2 +1 @@
archivesBaseName = artifact_basename + '-api'
@@ -23,7 +23,7 @@ import java.util.Optional;
import net.minecraft.block.Block;
import net.minecraft.item.BlockItem;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.BlockView;
public interface IBlockDefinition extends IItemDefinition {
/**
@@ -52,5 +52,5 @@ public interface IBlockDefinition extends IItemDefinition {
*
* @return if the block is placed in the world at the specific location.
*/
boolean isSameAs(IBlockReader world, BlockPos pos);
boolean isSameAs(BlockView world, BlockPos pos);
}
@@ -26,7 +26,7 @@ package appeng.api.features;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Hand;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.BlockView;
/**
* Registration record for a Custom Cell handler.
@@ -58,5 +58,5 @@ public interface IWirelessTermRegistry {
* opens the wireless terminal gui, the wireless terminal item, must be in the
* active slot on the tool bar.
*/
void openWirelessTerminalGui(ItemStack item, IBlockReader world, PlayerEntity player, Hand hand);
void openWirelessTerminalGui(ItemStack item, BlockView world, PlayerEntity player, Hand hand);
}
@@ -24,7 +24,7 @@
package appeng.api.implementations.items;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.Material;
import net.minecraft.item.ItemStack;
public interface IGrowableCrystal {
@@ -25,7 +25,7 @@ package appeng.api.implementations.items;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.CompoundTag;
import appeng.api.util.AEColor;
@@ -53,7 +53,7 @@ public interface IMemoryCard {
* @param data the NBT tag, refer to the normal comment for special
* keys.
*/
void setMemoryCardContents(ItemStack is, String settingsName, CompoundNBT data);
void setMemoryCardContents(ItemStack is, String settingsName, CompoundTag data);
/**
* returns the settings name provided by a previous call to
@@ -72,7 +72,7 @@ public interface IMemoryCard {
* @return the NBT Data previously saved by setMemoryCardContents, or an empty
* NBTCompound
*/
CompoundNBT getData(ItemStack is);
CompoundTag getData(ItemStack is);
/**
* This represent as 4x2 grid of {@link AEColor} without transparent/fluix
@@ -26,7 +26,7 @@ package appeng.api.implementations.parts;
import java.util.EnumSet;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.Direction;
import net.minecraft.util.math.Direction;
import appeng.api.networking.IGridHost;
import appeng.api.parts.BusSupport;
@@ -24,7 +24,7 @@
package appeng.api.implementations.tiles;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.Direction;
import net.minecraft.util.math.Direction;
import appeng.api.util.AEColor;
@@ -24,7 +24,7 @@
package appeng.api.implementations.tiles;
import net.minecraft.inventory.CraftingInventory;
import net.minecraft.util.Direction;
import net.minecraft.util.math.Direction;
import appeng.api.networking.crafting.ICraftingPatternDetails;
@@ -23,7 +23,7 @@
package appeng.api.implementations.tiles;
import net.minecraft.util.Direction;
import net.minecraft.util.math.Direction;
/**
* Crank/Crankable API,
@@ -29,7 +29,7 @@ import javax.annotation.Nonnegative;
import javax.annotation.Nonnull;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Direction;
import net.minecraft.util.math.Direction;
import appeng.api.parts.IPart;
import appeng.api.util.AEColor;
@@ -27,7 +27,7 @@ import java.util.EnumSet;
import javax.annotation.Nonnull;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.IWorld;
import appeng.api.IAppEngApi;
@@ -130,7 +130,7 @@ public interface IGridNode {
* @param name nbt name
* @param nodeData to be loaded data
*/
void loadFromNBT(@Nonnull String name, @Nonnull CompoundNBT nodeData);
void loadFromNBT(@Nonnull String name, @Nonnull CompoundTag nodeData);
/**
* this should be called for each node you maintain, you can save all your nodes
@@ -140,7 +140,7 @@ public interface IGridNode {
* @param name nbt name
* @param nodeData to be saved data
*/
void saveToNBT(@Nonnull String name, @Nonnull CompoundNBT nodeData);
void saveToNBT(@Nonnull String name, @Nonnull CompoundTag nodeData);
/**
* @return if the node's channel requirements are currently met, use this for
@@ -25,15 +25,15 @@ package appeng.api.networking;
import javax.annotation.Nonnull;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.CompoundTag;
public interface IGridStorage {
/**
* @return an CompoundNBT that can be read, and written too.
* @return an CompoundTag that can be read, and written too.
*/
@Nonnull
CompoundNBT dataObject();
CompoundTag dataObject();
/**
* @return the id for this grid storage object, used internally
@@ -23,7 +23,7 @@
package appeng.api.networking.crafting;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.CompoundTag;
public interface ICraftingLink {
@@ -53,7 +53,7 @@ public interface ICraftingLink {
*
* @param tag to be written data
*/
void writeToNBT(CompoundNBT tag);
void writeToNBT(CompoundTag tag);
/**
* @return the crafting ID for this link.
@@ -25,7 +25,7 @@ package appeng.api.parts;
import java.io.IOException;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.PacketBuffer;
import appeng.api.util.AEPartLocation;
@@ -64,7 +64,7 @@ public interface IFacadeContainer {
*
* @param data to be written data
*/
void writeToNBT(CompoundNBT data);
void writeToNBT(CompoundTag data);
/**
* read from stream
@@ -82,7 +82,7 @@ public interface IFacadeContainer {
*
* @param data to be read data
*/
void readFromNBT(CompoundNBT data);
void readFromNBT(CompoundTag data);
/**
* write to stream
@@ -36,13 +36,13 @@ import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.PacketBuffer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.BlockView;
import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@@ -110,14 +110,14 @@ public interface IPart extends ICustomCableConnection {
*
* @param data to be written nbt data
*/
void writeToNBT(CompoundNBT data);
void writeToNBT(CompoundTag data);
/**
* Read the previously written NBT Data. this is the mirror for writeToNBT
*
* @param data to be read nbt data
*/
void readFromNBT(CompoundNBT data);
void readFromNBT(CompoundTag data);
/**
* @return get the amount of light produced by the bus
@@ -136,7 +136,7 @@ public interface IPart extends ICustomCableConnection {
/**
* a block around the bus's host has been changed.
*/
void onNeighborChanged(IBlockReader w, BlockPos pos, BlockPos neighbor);
void onNeighborChanged(BlockView w, BlockPos pos, BlockPos neighbor);
/**
* @return output redstone on facing side
@@ -345,7 +345,7 @@ public interface IPart extends ICustomCableConnection {
* capabilities on the cable bus will be forwarded to parts on the appropriate
* side.
*
* @see TileEntity#getCapability(Capability, net.minecraft.util.Direction)
* @see TileEntity#getCapability(Capability, net.minecraft.util.math.Direction)
*
* @return The capability or null.
*/
@@ -23,7 +23,7 @@
package appeng.api.parts;
import net.minecraft.util.Direction;
import net.minecraft.util.math.Direction;
public interface IPartCollisionHelper {
@@ -25,8 +25,8 @@ package appeng.api.parts;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResultType;
import net.minecraft.util.Direction;
import net.minecraft.util.ActionResult;
import net.minecraft.util.math.Direction;
import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
@@ -44,7 +44,7 @@ public interface IPartHelper {
* @return true if placing was successful
*/
// TODO, this should probably take ItemStack + ItemUseContext
ActionResultType placeBus(ItemStack is, BlockPos pos, Direction side, PlayerEntity player, Hand hand, World world);
ActionResult placeBus(ItemStack is, BlockPos pos, Direction side, PlayerEntity player, Hand hand, World world);
/**
* @return the render mode
@@ -28,7 +28,7 @@ import java.util.Set;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Direction;
import net.minecraft.util.math.Direction;
import net.minecraft.util.Hand;
import net.minecraft.util.math.Vec3d;
@@ -40,7 +40,7 @@ import net.minecraft.item.ItemStack;
* <code>
*
* {@literal @}Override
* public default ActionResultType onItemUse(ItemStack is, PlayerEntity player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ)
* public default ActionResult onItemUse(ItemStack is, PlayerEntity player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ)
* {
* return Api.INSTANCE.partHelper().placeBus( is, pos, side, player, hand, world );
* }
@@ -27,7 +27,7 @@ import java.util.Set;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityType;
import net.minecraft.util.Direction;
import net.minecraft.util.math.Direction;
import appeng.api.util.AEPartLocation;
@@ -23,13 +23,13 @@
package appeng.api.recipes;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.CompoundTag;
public class ResolverResult {
public final String itemName;
public final int damageValue;
public final CompoundNBT compound;
public final CompoundTag compound;
public ResolverResult(final String name, final int damage) {
this.itemName = name;
@@ -37,7 +37,7 @@ public class ResolverResult {
this.compound = null;
}
public ResolverResult(final String name, final int damage, final CompoundNBT data) {
public ResolverResult(final String name, final int damage, final CompoundTag data) {
this.itemName = name;
this.damageValue = damage;
this.compound = data;
@@ -29,7 +29,7 @@ import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.PacketBuffer;
import net.minecraftforge.fluids.FluidStack;
@@ -101,5 +101,5 @@ public interface IStorageChannel<T extends IAEStack<T>> {
* @return
*/
@Nullable
T createFromNBT(@Nonnull CompoundNBT nbt);
T createFromNBT(@Nonnull CompoundTag nbt);
}
@@ -28,7 +28,7 @@ import java.util.Collection;
import javax.annotation.Nonnull;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.CompoundTag;
import appeng.api.config.Actionable;
import appeng.api.networking.crafting.ICraftingLink;
@@ -97,7 +97,7 @@ public interface IStorageHelper {
*
* @return crafting link
*/
ICraftingLink loadCraftingLink(CompoundNBT data, ICraftingRequester req);
ICraftingLink loadCraftingLink(CompoundTag data, ICraftingRequester req);
/**
* Extracts items from a {@link IMEInventory} respecting power requirements.
@@ -117,7 +117,7 @@ public interface IStorageHelper {
*
* @param energy Energy source.
* @param inv Inventory to insert into.
* @param request Items to insert.
* @param input Items to insert.
* @param src Action source.
* @param mode Simulate or modulate
* @return items not inserted or {@code null} if everything was inserted.
@@ -26,7 +26,7 @@ package appeng.api.storage.data;
import java.io.IOException;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.PacketBuffer;
import appeng.api.config.FuzzyMode;
@@ -122,11 +122,11 @@ public interface IAEStack<T extends IAEStack<T>> {
void decCountRequestable(long i);
/**
* write to a CompoundNBT.
* write to a CompoundTag.
*
* @param i to be written data
*/
void writeToNBT(CompoundNBT i);
void writeToNBT(CompoundTag i);
/**
* Compare stacks using precise logic.
@@ -18,7 +18,7 @@
package appeng.api.util;
import net.minecraft.util.Direction;
import net.minecraft.util.math.Direction;
/**
* Stand in for previous Forge Direction, Several uses of this class are simply
@@ -25,7 +25,7 @@ package appeng.api.util;
import java.util.Set;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.CompoundTag;
import appeng.api.config.Settings;
@@ -76,12 +76,12 @@ public interface IConfigManager {
*
* @param destination to be written nbt tag
*/
void writeToNBT(CompoundNBT destination);
void writeToNBT(CompoundTag destination);
/**
* Only works after settings have been registered
*
* @param src to be read nbt tag
*/
void readFromNBT(CompoundNBT src);
void readFromNBT(CompoundTag src);
}
@@ -23,7 +23,7 @@
package appeng.api.util;
import net.minecraft.util.Direction;
import net.minecraft.util.math.Direction;
/**
* Nearly all of AE's Tile Entities implement IOrientable.
@@ -24,7 +24,7 @@
package appeng.api.util;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.BlockView;
/**
* Implemented on many of AE's non Tile Entity Blocks as a way to get a
@@ -38,5 +38,5 @@ public interface IOrientableBlock {
*
* @return a IOrientable if applicable
*/
IOrientable getOrientable(IBlockReader world, BlockPos pos);
IOrientable getOrientable(BlockView world, BlockPos pos);
}