Most of the 1.8 Port.
This commit is contained in:
@@ -40,8 +40,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompressedStreamTools;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
@@ -865,7 +864,7 @@ public abstract class AEBaseContainer extends Container
|
||||
|
||||
ais.setStackSize( myItem.getMaxStackSize() );
|
||||
|
||||
InventoryAdaptor adp = InventoryAdaptor.getAdaptor( player, ForgeDirection.UNKNOWN );
|
||||
InventoryAdaptor adp = InventoryAdaptor.getAdaptor( player, EnumFacing.UP );
|
||||
myItem.stackSize = (int) ais.getStackSize();
|
||||
myItem = adp.simulateAdd( myItem );
|
||||
|
||||
@@ -1073,7 +1072,7 @@ public abstract class AEBaseContainer extends Container
|
||||
|
||||
ais.setStackSize( myItem.getMaxStackSize() );
|
||||
|
||||
InventoryAdaptor adp = InventoryAdaptor.getAdaptor( player, ForgeDirection.UNKNOWN );
|
||||
InventoryAdaptor adp = InventoryAdaptor.getAdaptor( player, EnumFacing.UP );
|
||||
myItem.stackSize = (int) ais.getStackSize();
|
||||
myItem = adp.simulateAdd( myItem );
|
||||
|
||||
|
||||
@@ -20,10 +20,10 @@ package appeng.container;
|
||||
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import appeng.api.parts.IPart;
|
||||
import appeng.api.util.AEPartLocation;
|
||||
|
||||
|
||||
public class ContainerOpenContext
|
||||
@@ -34,7 +34,7 @@ public class ContainerOpenContext
|
||||
public int x;
|
||||
public int y;
|
||||
public int z;
|
||||
public ForgeDirection side;
|
||||
public AEPartLocation side;
|
||||
|
||||
public ContainerOpenContext( Object myItem )
|
||||
{
|
||||
@@ -48,6 +48,6 @@ public class ContainerOpenContext
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return this.w.getTileEntity( this.x, this.y, this.z );
|
||||
return this.w.getTileEntity( new BlockPos( x,y,z) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,6 @@ import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.inventory.ICrafting;
|
||||
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.core.AELog;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
|
||||
@@ -27,7 +27,7 @@ import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.ICrafting;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraft.util.IChatComponent;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.CopyMode;
|
||||
import appeng.api.config.FuzzyMode;
|
||||
@@ -147,7 +147,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
|
||||
ItemStack is = this.workBench.getInventoryByName( "cell" ).getStackInSlot( 0 );
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
if( this.workBench.getWorldObj().getTileEntity( this.workBench.xCoord, this.workBench.yCoord, this.workBench.zCoord ) != this.workBench )
|
||||
if( this.workBench.getWorld().getTileEntity( this.workBench.getPos() ) != this.workBench )
|
||||
{
|
||||
this.isContainerValid = false;
|
||||
}
|
||||
@@ -295,13 +295,13 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName()
|
||||
public String getName()
|
||||
{
|
||||
return "Upgrades";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomInventoryName()
|
||||
public boolean hasCustomName()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -325,13 +325,17 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory()
|
||||
public void openInventory(
|
||||
EntityPlayer player )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void closeInventory()
|
||||
public void closeInventory(
|
||||
EntityPlayer player )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -339,5 +343,38 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
|
||||
{
|
||||
return ContainerCellWorkbench.this.getCellUpgradeInventory().isItemValidForSlot( i, itemstack );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IChatComponent getDisplayName()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getField(
|
||||
int id )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setField(
|
||||
int id,
|
||||
int value )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFieldCount()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear()
|
||||
{
|
||||
ContainerCellWorkbench.this.getCellUpgradeInventory().clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,6 @@ package appeng.container.implementations;
|
||||
|
||||
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.container.slot.SlotRestrictedInput;
|
||||
import appeng.tile.storage.TileChest;
|
||||
|
||||
@@ -20,7 +20,6 @@ package appeng.container.implementations;
|
||||
|
||||
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
import appeng.api.config.CondenserOutput;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.container.AEBaseContainer;
|
||||
|
||||
@@ -22,7 +22,6 @@ package appeng.container.implementations;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
import appeng.api.networking.IGrid;
|
||||
import appeng.api.networking.security.BaseActionSource;
|
||||
|
||||
@@ -24,8 +24,6 @@ import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.concurrent.Future;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
@@ -33,7 +31,6 @@ import net.minecraft.inventory.ICrafting;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
@@ -63,6 +60,8 @@ import appeng.parts.reporting.PartPatternTerminal;
|
||||
import appeng.parts.reporting.PartTerminal;
|
||||
import appeng.util.Platform;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
||||
|
||||
public class ContainerCraftConfirm extends AEBaseContainer
|
||||
{
|
||||
|
||||
@@ -25,8 +25,6 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.ICrafting;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.networking.IGrid;
|
||||
import appeng.api.networking.IGridHost;
|
||||
@@ -38,6 +36,7 @@ import appeng.api.networking.storage.IBaseMonitor;
|
||||
import appeng.api.storage.IMEMonitorHandlerReceiver;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.container.guisync.GuiSync;
|
||||
import appeng.core.AELog;
|
||||
@@ -70,8 +69,8 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH
|
||||
|
||||
if( host != null )
|
||||
{
|
||||
this.findNode( host, ForgeDirection.UNKNOWN );
|
||||
for( ForgeDirection d : ForgeDirection.VALID_DIRECTIONS )
|
||||
this.findNode( host, AEPartLocation.INTERNAL );
|
||||
for( AEPartLocation d : AEPartLocation.SIDE_LOCATIONS )
|
||||
{
|
||||
this.findNode( host, d );
|
||||
}
|
||||
@@ -88,7 +87,7 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH
|
||||
}
|
||||
}
|
||||
|
||||
private void findNode( IGridHost host, ForgeDirection d )
|
||||
private void findNode( IGridHost host, AEPartLocation d )
|
||||
{
|
||||
if( this.network == null )
|
||||
{
|
||||
|
||||
@@ -22,15 +22,14 @@ package appeng.container.implementations;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
import appeng.api.networking.crafting.ICraftingCPU;
|
||||
import appeng.api.networking.crafting.ICraftingGrid;
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
import appeng.container.guisync.GuiSync;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
||||
|
||||
public class ContainerCraftingStatus extends ContainerCraftingCPU
|
||||
{
|
||||
|
||||
@@ -24,7 +24,6 @@ import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
import appeng.container.ContainerNull;
|
||||
import appeng.container.slot.SlotCraftingMatrix;
|
||||
|
||||
@@ -20,7 +20,6 @@ package appeng.container.implementations;
|
||||
|
||||
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.container.slot.SlotRestrictedInput;
|
||||
import appeng.tile.storage.TileDrive;
|
||||
|
||||
@@ -21,7 +21,6 @@ package appeng.container.implementations;
|
||||
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
|
||||
import appeng.api.config.FuzzyMode;
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
import appeng.api.config.Settings;
|
||||
|
||||
@@ -20,7 +20,6 @@ package appeng.container.implementations;
|
||||
|
||||
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.container.slot.SlotInaccessible;
|
||||
import appeng.container.slot.SlotOutput;
|
||||
|
||||
@@ -21,7 +21,6 @@ package appeng.container.implementations;
|
||||
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
|
||||
import appeng.api.config.FullnessMode;
|
||||
import appeng.api.config.OperationMode;
|
||||
import appeng.api.config.RedstoneMode;
|
||||
|
||||
@@ -22,7 +22,6 @@ package appeng.container.implementations;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.definitions.IItemDefinition;
|
||||
import appeng.api.features.IInscriberRecipe;
|
||||
|
||||
@@ -20,7 +20,6 @@ package appeng.container.implementations;
|
||||
|
||||
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.config.YesNo;
|
||||
|
||||
@@ -29,8 +29,7 @@ import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.config.YesNo;
|
||||
import appeng.api.networking.IGrid;
|
||||
@@ -283,13 +282,13 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer
|
||||
case SHIFT_CLICK:
|
||||
|
||||
IInventory mySlot = slotInv.getWrapper( slot );
|
||||
InventoryAdaptor playerInv = InventoryAdaptor.getAdaptor( player, ForgeDirection.UNKNOWN );
|
||||
InventoryAdaptor playerInv = InventoryAdaptor.getAdaptor( player, EnumFacing.UP );
|
||||
mySlot.setInventorySlotContents( 0, playerInv.addItems( mySlot.getStackInSlot( 0 ) ) );
|
||||
|
||||
break;
|
||||
case MOVE_REGION:
|
||||
|
||||
InventoryAdaptor playerInvAd = InventoryAdaptor.getAdaptor( player, ForgeDirection.UNKNOWN );
|
||||
InventoryAdaptor playerInvAd = InventoryAdaptor.getAdaptor( player, EnumFacing.UP );
|
||||
for( int x = 0; x < inv.server.getSizeInventory(); x++ )
|
||||
{
|
||||
inv.server.setInventorySlotContents( x, playerInvAd.addItems( inv.server.getStackInSlot( x ) ) );
|
||||
|
||||
@@ -23,10 +23,8 @@ import net.minecraft.client.gui.GuiTextField;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import appeng.api.config.FuzzyMode;
|
||||
import appeng.api.config.LevelType;
|
||||
import appeng.api.config.RedstoneMode;
|
||||
|
||||
@@ -23,7 +23,6 @@ import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.api.config.RedstoneMode;
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
import appeng.api.config.Settings;
|
||||
@@ -64,7 +63,7 @@ public class ContainerMAC extends ContainerUpgradeable implements IProgressProvi
|
||||
|
||||
if( is.getItem() instanceof ItemEncodedPattern )
|
||||
{
|
||||
World w = this.getTileEntity().getWorldObj();
|
||||
World w = this.getTileEntity().getWorld();
|
||||
ItemEncodedPattern iep = (ItemEncodedPattern) is.getItem();
|
||||
ICraftingPatternDetails ph = iep.getPatternForItem( is, w );
|
||||
if( ph.isCraftable() )
|
||||
|
||||
@@ -28,8 +28,6 @@ import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.ICrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.PowerMultiplier;
|
||||
@@ -54,6 +52,7 @@ import appeng.api.storage.IMEMonitorHandlerReceiver;
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.api.util.IConfigManager;
|
||||
import appeng.api.util.IConfigurableObject;
|
||||
import appeng.container.AEBaseContainer;
|
||||
@@ -122,7 +121,7 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa
|
||||
}
|
||||
else if( monitorable instanceof IGridHost )
|
||||
{
|
||||
IGridNode node = ( (IGridHost) monitorable ).getGridNode( ForgeDirection.UNKNOWN );
|
||||
IGridNode node = ( (IGridHost) monitorable ).getGridNode( AEPartLocation.INTERNAL );
|
||||
if( node != null )
|
||||
{
|
||||
this.networkNode = node;
|
||||
|
||||
@@ -21,7 +21,6 @@ package appeng.container.implementations;
|
||||
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.PowerMultiplier;
|
||||
import appeng.api.implementations.guiobjects.IPortableCell;
|
||||
|
||||
@@ -25,8 +25,6 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.implementations.guiobjects.INetworkTool;
|
||||
import appeng.api.networking.IGrid;
|
||||
@@ -36,6 +34,7 @@ import appeng.api.networking.IGridNode;
|
||||
import appeng.api.networking.energy.IEnergyGrid;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.container.guisync.GuiSync;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
@@ -65,8 +64,8 @@ public class ContainerNetworkStatus extends AEBaseContainer
|
||||
|
||||
if( host != null )
|
||||
{
|
||||
this.findNode( host, ForgeDirection.UNKNOWN );
|
||||
for( ForgeDirection d : ForgeDirection.VALID_DIRECTIONS )
|
||||
this.findNode( host, AEPartLocation.INTERNAL );
|
||||
for( AEPartLocation d : AEPartLocation.SIDE_LOCATIONS )
|
||||
{
|
||||
this.findNode( host, d );
|
||||
}
|
||||
@@ -78,7 +77,7 @@ public class ContainerNetworkStatus extends AEBaseContainer
|
||||
}
|
||||
}
|
||||
|
||||
private void findNode( IGridHost host, ForgeDirection d )
|
||||
private void findNode( IGridHost host, AEPartLocation d )
|
||||
{
|
||||
if( this.network == null )
|
||||
{
|
||||
|
||||
@@ -22,7 +22,6 @@ package appeng.container.implementations;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import appeng.api.implementations.guiobjects.INetworkTool;
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.container.guisync.GuiSync;
|
||||
|
||||
@@ -36,8 +36,7 @@ import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.nbt.NBTBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.definitions.IDefinitions;
|
||||
@@ -349,7 +348,7 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
|
||||
IAEItemStack out = packetPatternSlot.slotItem.copy();
|
||||
|
||||
InventoryAdaptor inv = new AdaptorPlayerHand( this.getPlayerInv().player );
|
||||
InventoryAdaptor playerInv = InventoryAdaptor.getAdaptor( this.getPlayerInv().player, ForgeDirection.UNKNOWN );
|
||||
InventoryAdaptor playerInv = InventoryAdaptor.getAdaptor( this.getPlayerInv().player, EnumFacing.UP );
|
||||
if( packetPatternSlot.shift )
|
||||
{
|
||||
inv = playerInv;
|
||||
|
||||
@@ -23,10 +23,8 @@ import net.minecraft.client.gui.GuiTextField;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
import appeng.api.parts.IPart;
|
||||
import appeng.container.AEBaseContainer;
|
||||
|
||||
@@ -20,7 +20,6 @@ package appeng.container.implementations;
|
||||
|
||||
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.container.slot.SlotRestrictedInput;
|
||||
import appeng.tile.qnb.TileQuantumBridge;
|
||||
|
||||
@@ -24,9 +24,9 @@ import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.IChatComponent;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.container.slot.QuartzKnifeOutput;
|
||||
@@ -194,13 +194,13 @@ public class ContainerQuartzKnife extends AEBaseContainer implements IAEAppEngIn
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName()
|
||||
public String getName()
|
||||
{
|
||||
return "Quartz Knife Output";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomInventoryName()
|
||||
public boolean hasCustomName()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -224,20 +224,55 @@ public class ContainerQuartzKnife extends AEBaseContainer implements IAEAppEngIn
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory()
|
||||
public void openInventory(
|
||||
EntityPlayer player )
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void closeInventory()
|
||||
public void closeInventory(
|
||||
EntityPlayer player )
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot( int var1, ItemStack var2 )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IChatComponent getDisplayName()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getField(
|
||||
int id )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setField(
|
||||
int id,
|
||||
int value )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFieldCount()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear()
|
||||
{
|
||||
this.inSlot.setInventorySlotContents( 0, null );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@ import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.ICrafting;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
import appeng.api.features.INetworkEncodable;
|
||||
|
||||
@@ -19,11 +19,9 @@
|
||||
package appeng.container.implementations;
|
||||
|
||||
|
||||
import invtweaks.api.container.ChestContainer;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
import invtweaks.api.container.ChestContainer;
|
||||
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.container.slot.SlotNormal;
|
||||
import appeng.tile.storage.TileSkyChest;
|
||||
@@ -48,7 +46,7 @@ public class ContainerSkyChest extends AEBaseContainer
|
||||
}
|
||||
}
|
||||
|
||||
this.chest.openInventory();
|
||||
this.chest.openInventory(ip.player);
|
||||
|
||||
this.bindPlayerInventory( ip, 0, 195 - /* height of player inventory */82 );
|
||||
}
|
||||
@@ -57,6 +55,6 @@ public class ContainerSkyChest extends AEBaseContainer
|
||||
public void onContainerClosed( EntityPlayer par1EntityPlayer )
|
||||
{
|
||||
super.onContainerClosed( par1EntityPlayer );
|
||||
this.chest.closeInventory();
|
||||
this.chest.closeInventory(par1EntityPlayer);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,12 +20,11 @@ package appeng.container.implementations;
|
||||
|
||||
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
import appeng.api.networking.IGrid;
|
||||
import appeng.api.networking.energy.IEnergyGrid;
|
||||
import appeng.api.networking.spatial.ISpatialCache;
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.container.guisync.GuiSync;
|
||||
import appeng.container.slot.SlotOutput;
|
||||
@@ -56,7 +55,7 @@ public class ContainerSpatialIOPort extends AEBaseContainer
|
||||
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
this.network = spatialIOPort.getGridNode( ForgeDirection.UNKNOWN ).getGrid();
|
||||
this.network = spatialIOPort.getGridNode( AEPartLocation.INTERNAL ).getGrid();
|
||||
}
|
||||
|
||||
this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.SPATIAL_STORAGE_CELLS, spatialIOPort, 0, 52, 48, this.invPlayer ) );
|
||||
|
||||
@@ -24,7 +24,6 @@ import java.util.Iterator;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.AccessRestriction;
|
||||
import appeng.api.config.FuzzyMode;
|
||||
|
||||
@@ -23,8 +23,8 @@ import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.api.config.FuzzyMode;
|
||||
import appeng.api.config.RedstoneMode;
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
@@ -74,19 +74,19 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl
|
||||
if( te instanceof TileEntity )
|
||||
{
|
||||
TileEntity myTile = (TileEntity) te;
|
||||
w = myTile.getWorldObj();
|
||||
xCoord = myTile.xCoord;
|
||||
yCoord = myTile.yCoord;
|
||||
zCoord = myTile.zCoord;
|
||||
w = myTile.getWorld();
|
||||
xCoord = myTile.getPos().getX();
|
||||
yCoord = myTile.getPos().getY();
|
||||
zCoord = myTile.getPos().getZ();
|
||||
}
|
||||
|
||||
if( te instanceof IPart )
|
||||
{
|
||||
TileEntity mk = te.getTile();
|
||||
w = mk.getWorldObj();
|
||||
xCoord = mk.xCoord;
|
||||
yCoord = mk.yCoord;
|
||||
zCoord = mk.zCoord;
|
||||
w = mk.getWorld();
|
||||
xCoord = mk.getPos().getX();
|
||||
yCoord = mk.getPos().getY();
|
||||
zCoord = mk.getPos().getZ();
|
||||
}
|
||||
|
||||
IInventory pi = this.getPlayerInv();
|
||||
@@ -97,7 +97,7 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl
|
||||
{
|
||||
this.lockPlayerInventorySlot( x );
|
||||
this.tbSlot = x;
|
||||
this.tbInventory = (NetworkToolViewer) ( (IGuiItem) pii.getItem() ).getGuiObject( pii, w, xCoord, yCoord, zCoord );
|
||||
this.tbInventory = (NetworkToolViewer) ( (IGuiItem) pii.getItem() ).getGuiObject( pii, w, new BlockPos( xCoord, yCoord, zCoord ) );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,6 @@ package appeng.container.implementations;
|
||||
|
||||
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.container.guisync.GuiSync;
|
||||
import appeng.container.interfaces.IProgressProvider;
|
||||
|
||||
@@ -20,7 +20,6 @@ package appeng.container.implementations;
|
||||
|
||||
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.container.guisync.GuiSync;
|
||||
import appeng.container.slot.SlotRestrictedInput;
|
||||
|
||||
@@ -20,7 +20,6 @@ package appeng.container.implementations;
|
||||
|
||||
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.localization.PlayerMessages;
|
||||
import appeng.helpers.WirelessTerminalGuiObject;
|
||||
|
||||
@@ -23,17 +23,15 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemHoe;
|
||||
import net.minecraft.item.ItemPickaxe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemSword;
|
||||
import net.minecraft.item.ItemTool;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
import net.minecraft.stats.AchievementList;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
|
||||
|
||||
public class AppEngCraftingSlot extends AppEngSlot
|
||||
@@ -120,7 +118,7 @@ public class AppEngCraftingSlot extends AppEngSlot
|
||||
this.thePlayer.addStat( AchievementList.bakeCake, 1 );
|
||||
}
|
||||
|
||||
if( par1ItemStack.getItem() instanceof ItemPickaxe && ( (ItemTool) par1ItemStack.getItem() ).func_150913_i() != Item.ToolMaterial.WOOD )
|
||||
if( par1ItemStack.getItem() instanceof ItemPickaxe && ( (ItemTool) par1ItemStack.getItem() ).getToolMaterial() != Item.ToolMaterial.WOOD )
|
||||
{
|
||||
this.thePlayer.addStat( AchievementList.buildBetterPickaxe, 1 );
|
||||
}
|
||||
@@ -142,43 +140,45 @@ public class AppEngCraftingSlot extends AppEngSlot
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPickupFromSlot( EntityPlayer par1EntityPlayer, ItemStack par2ItemStack )
|
||||
public void onPickupFromSlot( EntityPlayer playerIn, ItemStack stack )
|
||||
{
|
||||
FMLCommonHandler.instance().firePlayerCraftingEvent( par1EntityPlayer, par2ItemStack, this.craftMatrix );
|
||||
this.onCrafting( par2ItemStack );
|
||||
net.minecraftforge.fml.common.FMLCommonHandler.instance().firePlayerCraftingEvent(playerIn, stack, craftMatrix);
|
||||
this.onCrafting(stack);
|
||||
net.minecraftforge.common.ForgeHooks.setCraftingPlayer(playerIn);
|
||||
InventoryCrafting ic = new InventoryCrafting( this.myContainer, 3, 3 );
|
||||
|
||||
for ( int x=0; x < this.craftMatrix.getSizeInventory(); x++ )
|
||||
ic.setInventorySlotContents( x, this.craftMatrix.getStackInSlot( x ) );
|
||||
|
||||
ItemStack[] aitemstack = CraftingManager.getInstance().func_180303_b(ic, playerIn.worldObj);
|
||||
|
||||
for ( int x=0; x < this.craftMatrix.getSizeInventory(); x++ )
|
||||
craftMatrix.setInventorySlotContents( x, ic.getStackInSlot( x ) );
|
||||
|
||||
net.minecraftforge.common.ForgeHooks.setCraftingPlayer(null);
|
||||
|
||||
for( int i = 0; i < this.craftMatrix.getSizeInventory(); ++i )
|
||||
{
|
||||
ItemStack itemstack1 = this.craftMatrix.getStackInSlot( i );
|
||||
for (int i = 0; i < aitemstack.length; ++i)
|
||||
{
|
||||
ItemStack itemstack1 = this.craftMatrix.getStackInSlot(i);
|
||||
ItemStack itemstack2 = aitemstack[i];
|
||||
|
||||
if( itemstack1 != null )
|
||||
{
|
||||
this.craftMatrix.decrStackSize( i, 1 );
|
||||
if (itemstack1 != null)
|
||||
{
|
||||
this.craftMatrix.decrStackSize(i, 1);
|
||||
}
|
||||
|
||||
if( itemstack1.getItem().hasContainerItem( itemstack1 ) )
|
||||
{
|
||||
ItemStack itemstack2 = itemstack1.getItem().getContainerItem( itemstack1 );
|
||||
|
||||
if( itemstack2 != null && itemstack2.isItemStackDamageable() && itemstack2.getItemDamage() > itemstack2.getMaxDamage() )
|
||||
{
|
||||
MinecraftForge.EVENT_BUS.post( new PlayerDestroyItemEvent( this.thePlayer, itemstack2 ) );
|
||||
continue;
|
||||
}
|
||||
|
||||
if( !itemstack1.getItem().doesContainerItemLeaveCraftingGrid( itemstack1 ) || !this.thePlayer.inventory.addItemStackToInventory( itemstack2 ) )
|
||||
{
|
||||
if( this.craftMatrix.getStackInSlot( i ) == null )
|
||||
{
|
||||
this.craftMatrix.setInventorySlotContents( i, itemstack2 );
|
||||
}
|
||||
else
|
||||
{
|
||||
this.thePlayer.dropPlayerItemWithRandomChoice( itemstack2, false );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (itemstack2 != null)
|
||||
{
|
||||
if (this.craftMatrix.getStackInSlot(i) == null)
|
||||
{
|
||||
this.craftMatrix.setInventorySlotContents(i, itemstack2);
|
||||
}
|
||||
else if (!this.thePlayer.inventory.addItemStackToInventory(itemstack2))
|
||||
{
|
||||
this.thePlayer.dropPlayerItemWithRandomChoice(itemstack2, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -23,7 +23,6 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.tile.inventory.AppEngInternalInventory;
|
||||
|
||||
@@ -141,7 +140,7 @@ public class AppEngSlot extends Slot
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean func_111238_b()
|
||||
public boolean canBeHovered()
|
||||
{
|
||||
return this.isEnabled();
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
|
||||
import net.minecraft.util.BlockPos;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.networking.energy.IEnergySource;
|
||||
import appeng.api.networking.security.BaseActionSource;
|
||||
@@ -140,7 +140,7 @@ public class SlotCraftingTerm extends AppEngCraftingSlot
|
||||
{
|
||||
List<ItemStack> drops = new ArrayList<ItemStack>();
|
||||
drops.add( extra );
|
||||
Platform.spawnDrops( who.worldObj, (int) who.posX, (int) who.posY, (int) who.posZ, drops );
|
||||
Platform.spawnDrops( who.worldObj, new BlockPos( (int) who.posX, (int) who.posY, (int) who.posZ ), drops );
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -270,7 +270,7 @@ public class SlotCraftingTerm extends AppEngCraftingSlot
|
||||
|
||||
if( drops.size() > 0 )
|
||||
{
|
||||
Platform.spawnDrops( p.worldObj, (int) p.posX, (int) p.posY, (int) p.posZ, drops );
|
||||
Platform.spawnDrops( p.worldObj, new BlockPos( (int) p.posX, (int) p.posY, (int) p.posZ ), drops );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,6 @@ package appeng.container.slot;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.container.implementations.ContainerMAC;
|
||||
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@ import java.io.IOException;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.networking.energy.IEnergySource;
|
||||
import appeng.api.networking.security.BaseActionSource;
|
||||
|
||||
@@ -28,7 +28,6 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntityFurnace;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.definitions.IDefinitions;
|
||||
import appeng.api.definitions.IItems;
|
||||
|
||||
Reference in New Issue
Block a user