Updated API to changed 1.15 classes

This commit is contained in:
yueh
2020-05-07 17:03:24 +02:00
parent 3dff3a5d54
commit 2cbff91ab0
42 changed files with 208 additions and 207 deletions
@@ -22,9 +22,9 @@ package appeng.api.definitions;
import java.util.Optional;
import net.minecraft.block.Block;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.BlockItem;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.IBlockReader;
public interface IBlockDefinition extends IItemDefinition
@@ -37,7 +37,7 @@ public interface IBlockDefinition extends IItemDefinition
/**
* @return the {@link ItemBlock} implementation if applicable
*/
Optional<ItemBlock> maybeItemBlock();
Optional<BlockItem> maybeItemBlock();
/**
* Compare Block with world.
@@ -47,5 +47,5 @@ public interface IBlockDefinition extends IItemDefinition
*
* @return if the block is placed in the world at the specific location.
*/
boolean isSameAs( IBlockAccess world, BlockPos pos );
boolean isSameAs( IBlockReader world, BlockPos pos );
}
@@ -24,7 +24,7 @@
package appeng.api.events;
import net.minecraftforge.fml.common.eventhandler.Event;
import net.minecraftforge.eventbus.api.Event;
import appeng.api.features.ILocatable;
@@ -28,7 +28,7 @@ import javax.annotation.Nullable;
import com.mojang.authlib.GameProfile;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
/**
@@ -50,7 +50,7 @@ public interface IPlayerRegistry
*
* @return user id of a player entity.
*/
int getID( EntityPlayer player );
int getID( PlayerEntity player );
/**
* @param playerID to be found player id
@@ -58,5 +58,5 @@ public interface IPlayerRegistry
* @return PlayerEntity, or null if the player could not be found.
*/
@Nullable
EntityPlayer findPlayer( int playerID );
PlayerEntity findPlayer( int playerID );
}
@@ -24,7 +24,7 @@
package appeng.api.features;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import appeng.api.util.IConfigManager;
@@ -52,7 +52,7 @@ public interface IWirelessTermHandler extends INetworkEncodable
*
* @return true if wireless terminal uses power
*/
boolean usePower( EntityPlayer player, double amount, ItemStack is );
boolean usePower( PlayerEntity player, double amount, ItemStack is );
/**
* gets the power status of the item.
@@ -61,7 +61,7 @@ public interface IWirelessTermHandler extends INetworkEncodable
*
* @return returns true if there is any power left.
*/
boolean hasPower( EntityPlayer player, double amount, ItemStack is );
boolean hasPower( PlayerEntity player, double amount, ItemStack is );
/**
* Return the config manager for the wireless terminal.
@@ -24,9 +24,9 @@
package appeng.api.features;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraft.world.IBlockReader;
/**
@@ -51,7 +51,7 @@ public interface IWirelessTermRegistry
/**
* @param is item with handler
*
* PlayerEntity
* @return a register handler for the item in question, or null if there
* isn't one
*/
@@ -61,5 +61,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, World w, EntityPlayer player );
void openWirelessTerminalGui( ItemStack item, IBlockReader world, PlayerEntity player );
}
@@ -25,13 +25,13 @@ package appeng.api.features;
import net.minecraft.world.World;
import net.minecraft.world.WorldProvider;
import net.minecraft.world.dimension.Dimension;
public interface IWorldGen
{
void disableWorldGenForProviderID( WorldGenType type, Class<? extends WorldProvider> provider );
void disableWorldGenForProviderID( WorldGenType type, Class<? extends Dimension> provider );
void enableWorldGenForDimension( WorldGenType type, int dimID );
@@ -24,7 +24,7 @@
package appeng.api.implementations.items;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.math.BlockPos;
@@ -44,5 +44,5 @@ public interface IAEWrench
*
* @return true if wrench can be used
*/
boolean canWrench( ItemStack wrench, EntityPlayer player, BlockPos pos );
boolean canWrench( ItemStack wrench, PlayerEntity player, BlockPos pos );
}
@@ -24,9 +24,9 @@
package appeng.api.implementations.items;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.CompoundNBT;
import appeng.api.util.AEColor;
@@ -54,7 +54,7 @@ public interface IMemoryCard
* @param settingsName unlocalized string that represents the tile entity.
* @param data the NBT tag, refer to the normal comment for special keys.
*/
void setMemoryCardContents( ItemStack is, String settingsName, NBTTagCompound data );
void setMemoryCardContents( ItemStack is, String settingsName, CompoundNBT data );
/**
* returns the settings name provided by a previous call to
@@ -73,7 +73,7 @@ public interface IMemoryCard
* @return the NBT Data previously saved by setMemoryCardContents, or an
* empty NBTCompound
*/
NBTTagCompound getData( ItemStack is );
CompoundNBT getData( ItemStack is );
/**
* This represent as 4x2 grid of {@link AEColor} without transparent/fluix color.
@@ -92,5 +92,5 @@ public interface IMemoryCard
* @param player that used the card.
* @param msg which message to send.
*/
void notifyUser( EntityPlayer player, MemoryCardMessages msg );
void notifyUser( PlayerEntity player, MemoryCardMessages msg );
}
@@ -26,8 +26,8 @@ package appeng.api.implementations.parts;
import java.util.EnumSet;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.EnumFacing;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.Direction;
import appeng.api.networking.IGridHost;
import appeng.api.parts.BusSupport;
@@ -67,7 +67,7 @@ public interface IPartCable extends IPart, IGridHost
*
* @return if the color change was successful.
*/
boolean changeColor( AEColor newColor, EntityPlayer who );
boolean changeColor( AEColor newColor, PlayerEntity who );
/**
* Change sides on the cables node.
@@ -76,7 +76,7 @@ public interface IPartCable extends IPart, IGridHost
*
* @param sides sides of cable
*/
void setValidSides( EnumSet<EnumFacing> sides );
void setValidSides( EnumSet<Direction> sides );
/**
* used to tests if a cable connects to neighbors visually.
@@ -85,6 +85,6 @@ public interface IPartCable extends IPart, IGridHost
*
* @return true if this side is currently connects to an external block.
*/
boolean isConnected( EnumFacing side );
boolean isConnected( Direction side );
}
@@ -24,8 +24,8 @@
package appeng.api.implementations.tiles;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.EnumFacing;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.Direction;
import appeng.api.util.AEColor;
@@ -35,5 +35,5 @@ public interface IColorableTile
AEColor getColor();
boolean recolourBlock( EnumFacing side, AEColor colour, EntityPlayer who );
boolean recolourBlock( Direction side, AEColor colour, PlayerEntity who );
}
@@ -24,8 +24,8 @@
package appeng.api.implementations.tiles;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.util.EnumFacing;
import net.minecraft.inventory.CraftingInventory;
import net.minecraft.util.Direction;
import appeng.api.networking.crafting.ICraftingPatternDetails;
@@ -42,7 +42,7 @@ public interface ICraftingMachine
*
* @return if it was accepted, all or nothing.
*/
boolean pushPattern( ICraftingPatternDetails patternDetails, InventoryCrafting table, EnumFacing ejectionDirection );
boolean pushPattern( ICraftingPatternDetails patternDetails, CraftingInventory table, Direction ejectionDirection );
/**
* check if the crafting machine is accepting pushes via pushPattern, if this is false, all calls to push will fail,
@@ -24,7 +24,7 @@
package appeng.api.implementations.tiles;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.Direction;
/**
@@ -55,5 +55,5 @@ public interface ICrankable
/**
* @return true if the crank can attach on the given side.
*/
boolean canCrankAttach( EnumFacing directionToCrank );
boolean canCrankAttach( Direction directionToCrank );
}
@@ -30,7 +30,7 @@ import javax.annotation.Nonnegative;
import javax.annotation.Nonnull;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.Direction;
import appeng.api.parts.IPart;
import appeng.api.util.AEColor;
@@ -107,7 +107,7 @@ public interface IGridBlock
* for {@link IPart} implementations.
*/
@Nonnull
EnumSet<EnumFacing> getConnectableSides();
EnumSet<Direction> getConnectableSides();
/**
* @return the IGridHost for the node, this will be an IGridPart or a TileEntity generally speaking.
@@ -28,7 +28,7 @@ import java.util.EnumSet;
import javax.annotation.Nonnull;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.world.World;
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 NBTTagCompound nodeData );
void loadFromNBT( @Nonnull String name, @Nonnull CompoundNBT nodeData );
/**
* this should be called for each node you maintain, you can save all your nodes to the same tag with different
@@ -139,7 +139,7 @@ public interface IGridNode
* @param name nbt name
* @param nodeData to be saved data
*/
void saveToNBT( @Nonnull String name, @Nonnull NBTTagCompound nodeData );
void saveToNBT( @Nonnull String name, @Nonnull CompoundNBT nodeData );
/**
* @return if the node's channel requirements are currently met, use this for display purposes, use isActive for
@@ -26,7 +26,7 @@ package appeng.api.networking;
import javax.annotation.Nonnull;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.CompoundNBT;
public interface IGridStorage
@@ -36,7 +36,7 @@ public interface IGridStorage
* @return an NBTTagCompound that can be read, and written too.
*/
@Nonnull
NBTTagCompound dataObject();
CompoundNBT dataObject();
/**
* @return the id for this grid storage object, used internally
@@ -24,7 +24,7 @@
package appeng.api.networking.crafting;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.CompoundNBT;
public interface ICraftingLink
@@ -55,7 +55,7 @@ public interface ICraftingLink
*
* @param tag to be written data
*/
void writeToNBT( NBTTagCompound tag );
void writeToNBT( CompoundNBT tag );
/**
* @return the crafting ID for this link.
@@ -24,7 +24,7 @@
package appeng.api.networking.crafting;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.inventory.CraftingInventory;
/**
@@ -42,7 +42,7 @@ public interface ICraftingMedium
*
* @return if the pattern was successfully pushed.
*/
boolean pushPattern( ICraftingPatternDetails patternDetails, InventoryCrafting table );
boolean pushPattern( ICraftingPatternDetails patternDetails, CraftingInventory table );
/**
* @return if this is false, the crafting engine will refuse to send new jobs to this medium.
@@ -24,7 +24,7 @@
package appeng.api.networking.crafting;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.inventory.CraftingInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
@@ -92,7 +92,7 @@ public interface ICraftingPatternDetails
*
* @return the crafted ( work bench ) item.
*/
ItemStack getOutput( InventoryCrafting craftingInv, World world );
ItemStack getOutput( CraftingInventory craftingInv, World world );
/**
* Get the priority of this pattern
@@ -28,14 +28,14 @@ import java.util.Optional;
import javax.annotation.Nonnull;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
/**
* The source of any action.
*
*
* This can either be a {@link EntityPlayer} or an {@link IActionHost}.
*
*
* In most cases this is used for security checks, but can be used to validate the source itself.
*
*/
@@ -44,21 +44,21 @@ public interface IActionSource
/**
* If present, AE will consider the player being the source for the action.
*
*
* This will take precedence over {@link IActionSource#machine()} in any case.
*
*
* @return An optional player issuing the action.
*/
@Nonnull
Optional<EntityPlayer> player();
Optional<PlayerEntity> player();
/**
* If present, it indicates the {@link IActionHost} of the source.
*
*
* Should {@link IActionSource#player()} be absent, it will consider a machine as source.
*
* It is recommended to include the machine even when a player is present.
*
*
* @return An optional machine issuing the action or acting as proxy for a player.
*/
@Nonnull
@@ -66,9 +66,9 @@ public interface IActionSource
/**
* An {@link IActionSource} can have multiple optional contexts.
*
*
* It is strongly recommended to limit the uses for absolutely necessary cases.
*
*
* Currently there are no public contexts made available by AE.
* An example would be the context interfaces use internally to avoid looping items between each other.
*/
@@ -27,7 +27,7 @@ package appeng.api.networking.security;
import javax.annotation.Nonnegative;
import javax.annotation.Nonnull;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import appeng.api.config.SecurityPermissions;
import appeng.api.networking.IGridCache;
@@ -49,7 +49,7 @@ public interface ISecurityGrid extends IGridCache
*
* @return true if the player has permissions.
*/
boolean hasPermission( @Nonnull EntityPlayer player, @Nonnull SecurityPermissions perm );
boolean hasPermission( @Nonnull PlayerEntity player, @Nonnull SecurityPermissions perm );
/**
* Check if a player has permissions.
@@ -22,8 +22,4 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
@API( apiVersion = "@aeversion@", owner = "appliedenergistics2", provides = "appliedenergistics2|API" )
package appeng.api;
import net.minecraftforge.fml.common.API;
@@ -28,7 +28,7 @@ import java.io.IOException;
import io.netty.buffer.ByteBuf;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.CompoundNBT;
import appeng.api.util.AEPartLocation;
@@ -68,7 +68,7 @@ public interface IFacadeContainer
*
* @param data to be written data
*/
void writeToNBT( NBTTagCompound data );
void writeToNBT( CompoundNBT data );
/**
* read from stream
@@ -86,7 +86,7 @@ public interface IFacadeContainer
*
* @param data to be read data
*/
void readFromNBT( NBTTagCompound data );
void readFromNBT( CompoundNBT data );
/**
* write to stream
@@ -24,7 +24,7 @@
package appeng.api.parts;
import net.minecraft.block.state.IBlockState;
import net.minecraft.block.BlockState;
import net.minecraft.entity.Entity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@@ -74,6 +74,6 @@ public interface IFacadePart
/**
* @return The block state used for rendering.
*/
IBlockState getBlockState();
BlockState getBlockState();
}
+20 -21
View File
@@ -33,20 +33,19 @@ import javax.annotation.Nonnull;
import io.netty.buffer.ByteBuf;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import appeng.api.networking.IGridNode;
import appeng.api.util.AECableType;
@@ -76,7 +75,7 @@ public interface IPart extends IBoxProvider, ICustomCableConnection
* {@link #requireDynamicRender()} in order for
* this method to be called.
*/
@SideOnly( Side.CLIENT )
@OnlyIn( Dist.CLIENT )
default void renderDynamic( double x, double y, double z, float partialTicks, int destroyStage )
{
}
@@ -104,14 +103,14 @@ public interface IPart extends IBoxProvider, ICustomCableConnection
*
* @param data to be written nbt data
*/
void writeToNBT( NBTTagCompound data );
void writeToNBT( CompoundNBT data );
/**
* Read the previously written NBT Data. this is the mirror for writeToNBT
*
* @param data to be read nbt data
*/
void readFromNBT( NBTTagCompound data );
void readFromNBT( CompoundNBT data );
/**
* @return get the amount of light produced by the bus
@@ -125,12 +124,12 @@ public interface IPart extends IBoxProvider, ICustomCableConnection
*
* @return true if entity can climb
*/
boolean isLadder( EntityLivingBase entity );
boolean isLadder( LivingEntity entity );
/**
* a block around the bus's host has been changed.
*/
void onNeighborChanged( IBlockAccess w, BlockPos pos, BlockPos neighbor );
void onNeighborChanged( IBlockReader w, BlockPos pos, BlockPos neighbor );
/**
* @return output redstone on facing side
@@ -214,7 +213,7 @@ public interface IPart extends IBoxProvider, ICustomCableConnection
*
* @return if your activate method performed something.
*/
boolean onActivate( EntityPlayer player, EnumHand hand, Vec3d pos );
boolean onActivate( PlayerEntity player, Hand hand, Vec3d pos );
/**
* Called when you right click the part, very similar to Block.onActivateBlock
@@ -225,7 +224,7 @@ public interface IPart extends IBoxProvider, ICustomCableConnection
*
* @return if your activate method performed something, you should use false unless you really need it.
*/
boolean onShiftActivate( EntityPlayer player, EnumHand hand, Vec3d pos );
boolean onShiftActivate( PlayerEntity player, Hand hand, Vec3d pos );
/**
* Called when you left click the part, very similar to Block.onBlockClicked
@@ -236,7 +235,7 @@ public interface IPart extends IBoxProvider, ICustomCableConnection
*
* @return if your activate method performed something, you should use false unless you really need it.
*/
default boolean onClicked( EntityPlayer player, EnumHand hand, Vec3d pos )
default boolean onClicked( PlayerEntity player, Hand hand, Vec3d pos )
{
return false;
}
@@ -247,10 +246,10 @@ public interface IPart extends IBoxProvider, ICustomCableConnection
* @param player shift-left clicking player
* @param hand hand used
* @param pos position of block
*
*
* @return if your activate method performed something, you should use false unless you really need it.
*/
default boolean onShiftClicked( EntityPlayer player, EnumHand hand, Vec3d pos )
default boolean onShiftClicked( PlayerEntity player, Hand hand, Vec3d pos )
{
return false;
}
@@ -287,11 +286,11 @@ public interface IPart extends IBoxProvider, ICustomCableConnection
* @param held held item
* @param side placing side
*/
void onPlacement( EntityPlayer player, EnumHand hand, ItemStack held, AEPartLocation side );
void onPlacement( PlayerEntity player, Hand hand, ItemStack held, AEPartLocation side );
/**
* Used to determine which parts can be placed on what cables.
*
*
* Dense cables are not allowed for functional (getGridNode returns a node) parts.
* Doing so will result in crashes.
*
@@ -360,7 +359,7 @@ public interface IPart extends IBoxProvider, ICustomCableConnection
/**
* Flag to be passed to the renderer.
*
*
* @return flag or null
*/
default Long getRenderFlag()
@@ -6,7 +6,7 @@ import java.util.List;
import javax.annotation.Nullable;
import net.minecraft.client.renderer.block.model.BakedQuad;
import net.minecraft.client.renderer.model.BakedQuad;
public interface IPartBakedModel
@@ -24,7 +24,7 @@
package appeng.api.parts;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.Direction;
public interface IPartCollisionHelper
@@ -47,17 +47,17 @@ public interface IPartCollisionHelper
/**
* @return east in world space.
*/
EnumFacing getWorldX();
Direction getWorldX();
/**
* @return up in world space.
*/
EnumFacing getWorldY();
Direction getWorldY();
/**
* @return forward in world space.
*/
EnumFacing getWorldZ();
Direction getWorldZ();
/**
* @return true if this test is to get the BB Collision information.
@@ -24,11 +24,11 @@
package appeng.api.parts;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Direction;
import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
@@ -73,7 +73,7 @@ public interface IPartHelper
*
* @return true if placing was successful
*/
EnumActionResult placeBus( ItemStack is, BlockPos pos, EnumFacing side, EntityPlayer player, EnumHand hand, World world );
ActionResult<?> placeBus( ItemStack is, BlockPos pos, Direction side, PlayerEntity player, Hand hand, World world );
/**
* @return the render mode
+6 -6
View File
@@ -26,11 +26,11 @@ package appeng.api.parts;
import java.util.Set;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.Direction;
import net.minecraft.util.Hand;
import net.minecraft.util.math.Vec3d;
import appeng.api.util.AEColor;
@@ -72,7 +72,7 @@ public interface IPartHost extends ICustomCableConnection
* @return null if the item failed to add, the side it was placed on other wise ( may different for cables,
* {@link AEPartLocation}.UNKNOWN )
*/
AEPartLocation addPart( ItemStack is, AEPartLocation side, EntityPlayer owner, EnumHand hand );
AEPartLocation addPart( ItemStack is, AEPartLocation side, PlayerEntity owner, Hand hand );
/**
* Get part by side ( center is {@link AEPartLocation}.UNKNOWN )
@@ -90,7 +90,7 @@ public interface IPartHost extends ICustomCableConnection
*
* @return the part located on the specified side, or null if there is no part.
*/
IPart getPart( EnumFacing side );
IPart getPart( Direction side );
/**
* removes the part on the side, this doesn't drop it or anything, if you don't do something with it, its just
@@ -134,7 +134,7 @@ public interface IPartHost extends ICustomCableConnection
*
* @return returns if microblocks are blocking this cable path.
*/
boolean isBlocked( EnumFacing side );
boolean isBlocked( Direction side );
/**
* finds the part located at the position ( pos must be relative, not global )
+9 -2
View File
@@ -27,7 +27,8 @@ package appeng.api.parts;
import java.util.Set;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.tileentity.TileEntityType;
import net.minecraft.util.Direction;
import appeng.api.util.AEPartLocation;
@@ -41,6 +42,12 @@ import appeng.api.util.AEPartLocation;
public abstract class LayerBase extends TileEntity // implements IPartHost
{
public LayerBase( TileEntityType<?> tileEntityTypeIn )
{
super( tileEntityTypeIn );
// TODO Auto-generated constructor stub
}
/**
* Grants access for the layer to the parts of the host.
*
@@ -64,7 +71,7 @@ public abstract class LayerBase extends TileEntity // implements IPartHost
*
* @return the part for the requested side.
*/
public IPart getPart( final EnumFacing side )
public IPart getPart( final Direction side )
{
return null; // place holder.
}
@@ -24,7 +24,7 @@
package appeng.api.recipes;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.CompoundNBT;
public class ResolverResult
@@ -32,7 +32,7 @@ public class ResolverResult
public final String itemName;
public final int damageValue;
public final NBTTagCompound compound;
public final CompoundNBT compound;
public ResolverResult( final String name, final int damage )
{
@@ -41,7 +41,7 @@ public class ResolverResult
this.compound = null;
}
public ResolverResult( final String name, final int damage, final NBTTagCompound data )
public ResolverResult( final String name, final int damage, final CompoundNBT data )
{
this.itemName = name;
this.damageValue = damage;
@@ -2,7 +2,7 @@
package appeng.api.storage;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import appeng.api.implementations.tiles.IChestOrDrive;
@@ -13,7 +13,7 @@ public interface ICellGuiHandler
{
/**
* Return true if this handler can show GUI for this channel.
*
*
* @param channel Storage channel
* @return True if handled, else false.
*/
@@ -21,7 +21,7 @@ public interface ICellGuiHandler
/**
* Return true to prioritize this handler for the provided {@link ItemStack}.
*
*
* @param is Cell ItemStack
* @return True, if specialized else false.
*/
@@ -42,6 +42,6 @@ public interface ICellGuiHandler
* @param is item
* @param chan storage channel
*/
<T extends IAEStack<T>> void openChestGui( EntityPlayer player, IChestOrDrive chest, ICellHandler cellHandler, IMEInventoryHandler<T> inv, ItemStack is, IStorageChannel<T> chan );
<T extends IAEStack<T>> void openChestGui( PlayerEntity player, IChestOrDrive chest, ICellHandler cellHandler, IMEInventoryHandler<T> inv, ItemStack is, IStorageChannel<T> chan );
}
@@ -28,7 +28,6 @@ import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import appeng.api.IAppEngApi;
import appeng.api.storage.data.IAEStack;
@@ -55,7 +54,7 @@ public interface ICellRegistry
/**
* Register a new handler
*
*
* @param handler cell gui handler
*/
void addCellGuiHandler( @Nonnull ICellGuiHandler handler );
@@ -32,7 +32,7 @@ import javax.annotation.Nullable;
import io.netty.buffer.ByteBuf;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.CompoundNBT;
import net.minecraftforge.fluids.FluidStack;
import appeng.api.storage.data.IAEStack;
@@ -44,10 +44,10 @@ public interface IStorageChannel<T extends IAEStack<T>>
/**
* Can be used as factor for transferring stacks of a channel.
*
*
* E.g. used by IO Ports to transfer 1000 mB, not 1 mB to match the
* item channel transferring a full bucket per operation.
*
*
* @return
*/
default int transferFactor()
@@ -68,7 +68,7 @@ public interface IStorageChannel<T extends IAEStack<T>>
/**
* Create a new {@link IItemList} of the specific type.
*
*
* @return
*/
@Nonnull
@@ -76,7 +76,7 @@ public interface IStorageChannel<T extends IAEStack<T>>
/**
* Create a new {@link IAEStack} subtype of the specific object.
*
*
* The parameter is unbound to allow a slightly more flexible approach.
* But the general intention is about converting an {@link ItemStack} or {@link FluidStack} into the corresponding
* {@link IAEStack}.
@@ -84,7 +84,7 @@ public interface IStorageChannel<T extends IAEStack<T>>
* types.
* IAEStacks that use custom items for {@link IAEStack#asItemStackRepresentation()} must also be able to convert
* these.
*
*
* @param input The object to turn into an {@link IAEStack}
* @return The converted stack or null
*/
@@ -92,7 +92,7 @@ public interface IStorageChannel<T extends IAEStack<T>>
T createStack( @Nonnull Object input );
/**
*
*
* @param input
* @return
* @throws IOException
@@ -102,10 +102,10 @@ public interface IStorageChannel<T extends IAEStack<T>>
/**
* create from nbt data
*
*
* @param nbt
* @return
*/
@Nullable
T createFromNBT( @Nonnull NBTTagCompound nbt );
T createFromNBT( @Nonnull CompoundNBT nbt );
}
@@ -29,7 +29,7 @@ import java.util.Collection;
import javax.annotation.Nonnull;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.CompoundNBT;
import appeng.api.config.Actionable;
import appeng.api.networking.crafting.ICraftingLink;
@@ -47,19 +47,19 @@ public interface IStorageHelper
/**
* Register a new storage channel.
*
*
* AE2 already provides native channels for {@link IAEItemStack} and {@link IAEFluidStack}.
*
*
* Each {@link IAEStack} subtype can only have a single factory instance. Overwriting is not intended.
* Each subtype should be a direct one, this might be enforced at any time.
*
*
* Channel class and factory instance can be used interchangeable as identifier. In most cases the factory instance
* is used as key as having direct access the methods is more beneficial compared to being forced to query the
* registry each time.
*
*
* Caching the factory instance in a field or local variable is perfectly for performance reasons. But do not use
* any AE2 internal field as they can change randomly between releases.
*
*
* @param channel The channel type, must be a subtype of {@link IStorageChannel}
* @param factory An instance implementing the channel, must be be an instance of channel
*/
@@ -68,9 +68,9 @@ public interface IStorageHelper
/**
* Fetch the factory instance for a specific storage channel.
*
*
* Channel must be a direct subtype of {@link IStorageChannel}.
*
*
* @throws NullPointerException when fetching an unregistered channel.
* @param channel The channel type
* @return the factory instance
@@ -80,7 +80,7 @@ public interface IStorageHelper
/**
* An unmodifiable collection of all registered factory instance.
*
*
* This is mainly used as helper to let storage grids construct their internal storage for each type.
*/
@Nonnull
@@ -93,11 +93,11 @@ public interface IStorageHelper
*
* @return crafting link
*/
ICraftingLink loadCraftingLink( NBTTagCompound data, ICraftingRequester req );
ICraftingLink loadCraftingLink( CompoundNBT data, ICraftingRequester req );
/**
* Extracts items from a {@link IMEInventory} respecting power requirements.
*
*
* @param energy Energy source.
* @param inv Inventory to extract from.
* @param request Requested item and count.
@@ -109,7 +109,7 @@ public interface IStorageHelper
/**
* Inserts items into a {@link IMEInventory} respecting power requirements.
*
*
* @param energy Energy source.
* @param inv Inventory to insert into.
* @param request Items to insert.
@@ -122,7 +122,7 @@ public interface IStorageHelper
/**
* Posts alteration of stored items to the provided {@link IStorageGrid}.
* This can be used by cell containers to notify the grid of storage cell changes.
*
*
* @param gs the storage grid.
* @param removedCell the removed cell itemstack
* @param addedCell the added cell itemstack
@@ -24,7 +24,7 @@
package appeng.api.storage.data;
import net.minecraftforge.fluids.Fluid;
import net.minecraft.fluid.Fluid;
import net.minecraftforge.fluids.FluidStack;
@@ -29,7 +29,7 @@ import java.io.IOException;
import io.netty.buffer.ByteBuf;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.CompoundNBT;
import appeng.api.config.FuzzyMode;
import appeng.api.storage.IStorageChannel;
@@ -130,7 +130,7 @@ public interface IAEStack<T extends IAEStack<T>>
*
* @param i to be written data
*/
void writeToNBT( NBTTagCompound i );
void writeToNBT( CompoundNBT i );
/**
* Compare stacks using precise logic.
+21 -22
View File
@@ -27,9 +27,8 @@ package appeng.api.util;
import java.util.Arrays;
import java.util.List;
import net.minecraft.client.renderer.block.model.BakedQuad;
import net.minecraft.item.EnumDyeColor;
import net.minecraft.util.text.translation.I18n;
import net.minecraft.client.renderer.model.BakedQuad;
import net.minecraft.item.DyeColor;
/**
@@ -40,37 +39,37 @@ import net.minecraft.util.text.translation.I18n;
public enum AEColor
{
WHITE( "gui.appliedenergistics2.White", EnumDyeColor.WHITE, 0xBEBEBE, 0xDBDBDB, 0xFAFAFA ),
WHITE( "gui.appliedenergistics2.White", DyeColor.WHITE, 0xBEBEBE, 0xDBDBDB, 0xFAFAFA ),
ORANGE( "gui.appliedenergistics2.Orange", EnumDyeColor.ORANGE, 0xF99739, 0xFAAE44, 0xF4DEC3 ),
ORANGE( "gui.appliedenergistics2.Orange", DyeColor.ORANGE, 0xF99739, 0xFAAE44, 0xF4DEC3 ),
MAGENTA( "gui.appliedenergistics2.Magenta", EnumDyeColor.MAGENTA, 0x821E82, 0xB82AB8, 0xC598C8 ),
MAGENTA( "gui.appliedenergistics2.Magenta", DyeColor.MAGENTA, 0x821E82, 0xB82AB8, 0xC598C8 ),
LIGHT_BLUE( "gui.appliedenergistics2.LightBlue", EnumDyeColor.LIGHT_BLUE, 0x628DCB, 0x82ACE7, 0xD8F6FF ),
LIGHT_BLUE( "gui.appliedenergistics2.LightBlue", DyeColor.LIGHT_BLUE, 0x628DCB, 0x82ACE7, 0xD8F6FF ),
YELLOW( "gui.appliedenergistics2.Yellow", EnumDyeColor.YELLOW, 0xFFF7AA, 0xF8FF4A, 0xFFFFE8 ),
YELLOW( "gui.appliedenergistics2.Yellow", DyeColor.YELLOW, 0xFFF7AA, 0xF8FF4A, 0xFFFFE8 ),
LIME( "gui.appliedenergistics2.Lime", EnumDyeColor.LIME, 0x7CFF4A, 0xBBFF51, 0xE7F7D7 ),
LIME( "gui.appliedenergistics2.Lime", DyeColor.LIME, 0x7CFF4A, 0xBBFF51, 0xE7F7D7 ),
PINK( "gui.appliedenergistics2.Pink", EnumDyeColor.PINK, 0xDC8DB5, 0xF8B5D7, 0xF7DEEB ),
PINK( "gui.appliedenergistics2.Pink", DyeColor.PINK, 0xDC8DB5, 0xF8B5D7, 0xF7DEEB ),
GRAY( "gui.appliedenergistics2.Gray", EnumDyeColor.GRAY, 0x7C7C7C, 0xA0A0A0, 0xC9C9C9 ),
GRAY( "gui.appliedenergistics2.Gray", DyeColor.GRAY, 0x7C7C7C, 0xA0A0A0, 0xC9C9C9 ),
LIGHT_GRAY( "gui.appliedenergistics2.LightGray", EnumDyeColor.SILVER, 0x9D9D9D, 0xCDCDCD, 0xEFEFEF ),
LIGHT_GRAY( "gui.appliedenergistics2.LightGray", DyeColor.LIGHT_GRAY, 0x9D9D9D, 0xCDCDCD, 0xEFEFEF ),
CYAN( "gui.appliedenergistics2.Cyan", EnumDyeColor.CYAN, 0x2F9BA5, 0x51AAC6, 0xAEDDF4 ),
CYAN( "gui.appliedenergistics2.Cyan", DyeColor.CYAN, 0x2F9BA5, 0x51AAC6, 0xAEDDF4 ),
PURPLE( "gui.appliedenergistics2.Purple", EnumDyeColor.PURPLE, 0x8230B2, 0xA453CE, 0xC7A3CC ),
PURPLE( "gui.appliedenergistics2.Purple", DyeColor.PURPLE, 0x8230B2, 0xA453CE, 0xC7A3CC ),
BLUE( "gui.appliedenergistics2.Blue", EnumDyeColor.BLUE, 0x2D29A0, 0x514AFF, 0xDDE6FF ),
BLUE( "gui.appliedenergistics2.Blue", DyeColor.BLUE, 0x2D29A0, 0x514AFF, 0xDDE6FF ),
BROWN( "gui.appliedenergistics2.Brown", EnumDyeColor.BROWN, 0x724E35, 0xB7967F, 0xE0D2C8 ),
BROWN( "gui.appliedenergistics2.Brown", DyeColor.BROWN, 0x724E35, 0xB7967F, 0xE0D2C8 ),
GREEN( "gui.appliedenergistics2.Green", EnumDyeColor.GREEN, 0x45A021, 0x60E32E, 0xE3F2E3 ),
GREEN( "gui.appliedenergistics2.Green", DyeColor.GREEN, 0x45A021, 0x60E32E, 0xE3F2E3 ),
RED( "gui.appliedenergistics2.Red", EnumDyeColor.RED, 0xA50029, 0xFF003C, 0xFFE6ED ),
RED( "gui.appliedenergistics2.Red", DyeColor.RED, 0xA50029, 0xFF003C, 0xFFE6ED ),
BLACK( "gui.appliedenergistics2.Black", EnumDyeColor.BLACK, 0x2B2B2B, 0x565656, 0x848484 ),
BLACK( "gui.appliedenergistics2.Black", DyeColor.BLACK, 0x2B2B2B, 0x565656, 0x848484 ),
TRANSPARENT( "gui.appliedenergistics2.Fluix", null, 0x1B2344, 0x895CA8, 0xD7BBEC );
@@ -125,9 +124,9 @@ public enum AEColor
/**
* Vanilla Dye Equivilient
*/
public final EnumDyeColor dye;
public final DyeColor dye;
AEColor( final String unlocalizedName, final EnumDyeColor dye, final int blackHex, final int medHex, final int whiteHex )
AEColor( final String unlocalizedName, final DyeColor dye, final int blackHex, final int medHex, final int whiteHex )
{
this.unlocalizedName = unlocalizedName;
this.blackVariant = blackHex;
@@ -177,7 +176,7 @@ public enum AEColor
@Override
public String toString()
{
return I18n.translateToLocal( this.unlocalizedName );
return this.unlocalizedName;
}
}
@@ -19,7 +19,7 @@
package appeng.api.util;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.Direction;
/**
@@ -67,7 +67,7 @@ public enum AEPartLocation
public final int yOffset;
public final int zOffset;
private static final EnumFacing[] facings = { EnumFacing.DOWN, EnumFacing.UP, EnumFacing.NORTH, EnumFacing.SOUTH, EnumFacing.WEST, EnumFacing.EAST, null };
private static final Direction[] facings = { Direction.DOWN, Direction.UP, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST, null };
private static final int[] OPPOSITES = { 1, 0, 3, 2, 5, 4, 6 };
public static final AEPartLocation[] SIDE_LOCATIONS = { DOWN, UP, NORTH, SOUTH, WEST, EAST };
@@ -98,7 +98,7 @@ public enum AEPartLocation
* @param side
* @return proper Part Location for a facing enum.
*/
public static AEPartLocation fromFacing( final EnumFacing side )
public static AEPartLocation fromFacing( final Direction side )
{
if( side == null )
{
@@ -118,7 +118,7 @@ public enum AEPartLocation
/**
* @return EnumFacing Equivalence, if Center returns null.
*/
public EnumFacing getFacing()
public Direction getFacing()
{
return facings[this.ordinal()];
}
@@ -26,7 +26,8 @@ package appeng.api.util;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraft.world.IWorld;
import net.minecraft.world.dimension.Dimension;
/**
@@ -35,35 +36,35 @@ import net.minecraft.world.World;
public class DimensionalCoord extends WorldCoord
{
private final World w;
private final int dimId;
private final IWorld world;
private final Dimension dimension;
public DimensionalCoord( final DimensionalCoord s )
public DimensionalCoord( final DimensionalCoord coordinate )
{
super( s.x, s.y, s.z );
this.w = s.w;
this.dimId = s.dimId;
super( coordinate.x, coordinate.y, coordinate.z );
this.world = coordinate.world;
this.dimension = coordinate.dimension;
}
public DimensionalCoord( final TileEntity s )
public DimensionalCoord( final TileEntity tileEntity )
{
super( s );
this.w = s.getWorld();
this.dimId = this.w.provider.getDimension();
super( tileEntity );
this.world = tileEntity.getWorld();
this.dimension = this.world.getDimension();
}
public DimensionalCoord( final World _w, final int x, final int y, final int z )
public DimensionalCoord( final IWorld world, final int x, final int y, final int z )
{
super( x, y, z );
this.w = _w;
this.dimId = _w.provider.getDimension();
this.world = world;
this.dimension = world.getDimension();
}
public DimensionalCoord( final World _w, final BlockPos pos )
public DimensionalCoord( final IWorld world, final BlockPos pos )
{
super( pos );
this.w = _w;
this.dimId = _w.provider.getDimension();
this.world = world;
this.dimension = world.getDimension();
}
@Override
@@ -75,7 +76,7 @@ public class DimensionalCoord extends WorldCoord
@Override
public int hashCode()
{
return super.hashCode() ^ this.dimId;
return super.hashCode() ^ this.dimension.hashCode();
}
@Override
@@ -84,25 +85,25 @@ public class DimensionalCoord extends WorldCoord
return obj instanceof DimensionalCoord && this.isEqual( (DimensionalCoord) obj );
}
public boolean isEqual( final DimensionalCoord c )
{
return this.x == c.x && this.y == c.y && this.z == c.z && c.w == this.w;
}
@Override
public String toString()
{
return "dimension=" + this.dimId + ", " + super.toString();
return "dimension=" + this.dimension + ", " + super.toString();
}
public boolean isInWorld( final World world )
public boolean isInWorld( final IWorld world )
{
return this.w == world;
return this.world == world;
}
public World getWorld()
public IWorld getWorld()
{
return this.w;
return this.world;
}
private boolean isEqual( final DimensionalCoord c )
{
return this.x == c.x && this.y == c.y && this.z == c.z && c.world == this.world;
}
}
@@ -26,7 +26,7 @@ package appeng.api.util;
import java.util.Set;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.CompoundNBT;
import appeng.api.config.Settings;
@@ -78,12 +78,12 @@ public interface IConfigManager
*
* @param destination to be written nbt tag
*/
void writeToNBT( NBTTagCompound destination );
void writeToNBT( CompoundNBT destination );
/**
* Only works after settings have been registered
*
* @param src to be read nbt tag
*/
void readFromNBT( NBTTagCompound src );
void readFromNBT( CompoundNBT src );
}
@@ -24,7 +24,7 @@
package appeng.api.util;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.Direction;
/**
@@ -45,12 +45,12 @@ public interface IOrientable
/**
* @return the direction the tile is facing
*/
EnumFacing getForward();
Direction getForward();
/**
* @return the direction top of the tile
*/
EnumFacing getUp();
Direction getUp();
/**
* Update the orientation
@@ -58,5 +58,5 @@ public interface IOrientable
* @param Forward new forward direction
* @param Up new upwards direction
*/
void setOrientation( EnumFacing Forward, EnumFacing Up );
void setOrientation( Direction Forward, Direction Up );
}
@@ -25,7 +25,7 @@ package appeng.api.util;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.IBlockReader;
/**
@@ -47,5 +47,5 @@ public interface IOrientableBlock
*
* @return a IOrientable if applicable
*/
IOrientable getOrientable( IBlockAccess world, BlockPos z );
IOrientable getOrientable( IBlockReader world, BlockPos z );
}