Most of the 1.8 Port.
This commit is contained in:
@@ -19,44 +19,42 @@
|
||||
package appeng.parts.misc;
|
||||
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
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.networking.IGridNode;
|
||||
import appeng.api.parts.BusSupport;
|
||||
import appeng.api.parts.IPart;
|
||||
import appeng.api.parts.IPartCollisionHelper;
|
||||
import appeng.api.parts.IPartHost;
|
||||
import appeng.api.parts.IPartRenderHelper;
|
||||
import appeng.api.parts.ISimplifiedBundle;
|
||||
import appeng.api.parts.PartItemStack;
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.client.render.IRenderHelper;
|
||||
import appeng.client.texture.IAESprite;
|
||||
|
||||
|
||||
public class PartCableAnchor implements IPart
|
||||
{
|
||||
|
||||
protected ISimplifiedBundle renderCache = null;
|
||||
ItemStack is = null;
|
||||
IPartHost host = null;
|
||||
ForgeDirection mySide = ForgeDirection.UP;
|
||||
AEPartLocation mySide = AEPartLocation.UP;
|
||||
|
||||
public PartCableAnchor( ItemStack is )
|
||||
{
|
||||
@@ -84,9 +82,9 @@ public class PartCableAnchor implements IPart
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderInventory( IPartRenderHelper instance, RenderBlocks renderer )
|
||||
public void renderInventory( IPartRenderHelper instance, IRenderHelper renderer )
|
||||
{
|
||||
instance.setTexture( this.is.getIconIndex() );
|
||||
instance.setTexture( renderer.getIcon( is ) );
|
||||
instance.setBounds( 7, 7, 4, 9, 9, 14 );
|
||||
instance.renderInventoryBox( renderer );
|
||||
instance.setTexture( null );
|
||||
@@ -94,10 +92,9 @@ public class PartCableAnchor implements IPart
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderStatic( int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer )
|
||||
public void renderStatic( BlockPos pos, IPartRenderHelper rh, IRenderHelper renderer )
|
||||
{
|
||||
this.renderCache = rh.useSimplifiedRendering( x, y, z, this, this.renderCache );
|
||||
IIcon myIcon = this.is.getIconIndex();
|
||||
IAESprite myIcon = renderer.getIcon( is );
|
||||
rh.setTexture( myIcon );
|
||||
if( this.host != null && this.host.getFacadeContainer().getFacade( this.mySide ) != null )
|
||||
{
|
||||
@@ -107,19 +104,19 @@ public class PartCableAnchor implements IPart
|
||||
{
|
||||
rh.setBounds( 7, 7, 10, 9, 9, 16 );
|
||||
}
|
||||
rh.renderBlock( x, y, z, renderer );
|
||||
rh.renderBlock( pos, renderer );
|
||||
rh.setTexture( null );
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderDynamic( double x, double y, double z, IPartRenderHelper rh, RenderBlocks renderer )
|
||||
public void renderDynamic( double x, double y, double z, IPartRenderHelper rh, IRenderHelper renderer )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getBreakingTexture()
|
||||
public TextureAtlasSprite getBreakingTexture( IRenderHelper renderer)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -163,7 +160,7 @@ public class PartCableAnchor implements IPart
|
||||
@Override
|
||||
public boolean isLadder( EntityLivingBase entity )
|
||||
{
|
||||
return this.mySide.offsetY == 0 && ( entity.isCollidedHorizontally || !entity.onGround );
|
||||
return this.mySide.yOffset == 0 && ( entity.isCollidedHorizontally || !entity.onGround );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -227,7 +224,7 @@ public class PartCableAnchor implements IPart
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPartHostInfo( ForgeDirection side, IPartHost host, TileEntity tile )
|
||||
public void setPartHostInfo( AEPartLocation side, IPartHost host, TileEntity tile )
|
||||
{
|
||||
this.host = host;
|
||||
this.mySide = side;
|
||||
@@ -258,14 +255,16 @@ public class PartCableAnchor implements IPart
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void randomDisplayTick( World world, int x, int y, int z, Random r )
|
||||
public void randomDisplayTick(
|
||||
World world,
|
||||
BlockPos pos,
|
||||
Random r )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlacement( EntityPlayer player, ItemStack held, ForgeDirection side )
|
||||
public void onPlacement( EntityPlayer player, ItemStack held, AEPartLocation side )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -22,9 +22,7 @@ package appeng.parts.misc;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
@@ -32,13 +30,12 @@ import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.IChatComponent;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
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.Actionable;
|
||||
import appeng.api.config.Upgrades;
|
||||
import appeng.api.implementations.tiles.ITileStorageMonitorable;
|
||||
@@ -60,6 +57,7 @@ import appeng.api.storage.IStorageMonitorable;
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.util.IConfigManager;
|
||||
import appeng.client.render.IRenderHelper;
|
||||
import appeng.client.texture.CableBusTextures;
|
||||
import appeng.core.sync.GuiBridge;
|
||||
import appeng.helpers.DualityInterface;
|
||||
@@ -72,6 +70,8 @@ import appeng.tile.inventory.InvOperation;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.inv.IInventoryDestination;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
||||
|
||||
public class PartInterface extends PartBasicState implements IGridTickable, IStorageMonitorable, IInventoryDestination, IInterfaceHost, ISidedInventory, IAEAppEngInventory, ITileStorageMonitorable, IPriorityHost
|
||||
{
|
||||
@@ -111,9 +111,9 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderInventory( IPartRenderHelper rh, RenderBlocks renderer )
|
||||
public void renderInventory( IPartRenderHelper rh, IRenderHelper renderer )
|
||||
{
|
||||
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), this.is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
|
||||
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), renderer.getIcon( is ), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
|
||||
|
||||
rh.setBounds( 2, 2, 14, 14, 14, 16 );
|
||||
rh.renderInventoryBox( renderer );
|
||||
@@ -133,25 +133,24 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderStatic( int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer )
|
||||
public void renderStatic( BlockPos pos, IPartRenderHelper rh, IRenderHelper renderer )
|
||||
{
|
||||
this.renderCache = rh.useSimplifiedRendering( x, y, z, this, this.renderCache );
|
||||
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), this.is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
|
||||
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), renderer.getIcon( is ), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
|
||||
|
||||
rh.setBounds( 2, 2, 14, 14, 14, 16 );
|
||||
rh.renderBlock( x, y, z, renderer );
|
||||
rh.renderBlock( pos, renderer );
|
||||
|
||||
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), this.is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
|
||||
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), renderer.getIcon( is ), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
|
||||
|
||||
rh.setBounds( 5, 5, 12, 11, 11, 13 );
|
||||
rh.renderBlock( x, y, z, renderer );
|
||||
rh.renderBlock( pos, renderer );
|
||||
|
||||
rh.setTexture( CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), this.is.getIconIndex(), CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon() );
|
||||
rh.setTexture( CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), renderer.getIcon( is ), CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon() );
|
||||
|
||||
rh.setBounds( 5, 5, 13, 11, 11, 14 );
|
||||
rh.renderBlock( x, y, z, renderer );
|
||||
rh.renderBlock( pos, renderer );
|
||||
|
||||
this.renderLights( x, y, z, rh, renderer );
|
||||
this.renderLights( pos, rh, renderer );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -216,9 +215,9 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getBreakingTexture()
|
||||
public TextureAtlasSprite getBreakingTexture(IRenderHelper renderer)
|
||||
{
|
||||
return this.is.getIconIndex();
|
||||
return renderer.getIcon( is ).getAtlas();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -282,15 +281,15 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName()
|
||||
public String getName()
|
||||
{
|
||||
return this.duality.getStorage().getInventoryName();
|
||||
return this.duality.getStorage().getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomInventoryName()
|
||||
public boolean hasCustomName()
|
||||
{
|
||||
return this.duality.getStorage().hasCustomInventoryName();
|
||||
return this.duality.getStorage().hasCustomName();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -312,15 +311,15 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory()
|
||||
public void openInventory( EntityPlayer player )
|
||||
{
|
||||
this.duality.getStorage().openInventory();
|
||||
this.duality.getStorage().openInventory(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeInventory()
|
||||
public void closeInventory( EntityPlayer player )
|
||||
{
|
||||
this.duality.getStorage().closeInventory();
|
||||
this.duality.getStorage().closeInventory(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -330,19 +329,19 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide( int s )
|
||||
public int[] getSlotsForFace( EnumFacing side )
|
||||
{
|
||||
return this.duality.getAccessibleSlotsFromSide( s );
|
||||
return this.duality.getSlotsForFace( side );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem( int i, ItemStack itemstack, int j )
|
||||
public boolean canInsertItem( int i, ItemStack itemstack, EnumFacing j )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem( int i, ItemStack itemstack, int j )
|
||||
public boolean canExtractItem( int i, ItemStack itemstack, EnumFacing j )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -360,9 +359,9 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumSet<ForgeDirection> getTargets()
|
||||
public EnumSet<EnumFacing> getTargets()
|
||||
{
|
||||
return EnumSet.of( this.side );
|
||||
return EnumSet.of( this.side.getFacing() );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -372,7 +371,7 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto
|
||||
}
|
||||
|
||||
@Override
|
||||
public IStorageMonitorable getMonitorable( ForgeDirection side, BaseActionSource src )
|
||||
public IStorageMonitorable getMonitorable( EnumFacing side, BaseActionSource src )
|
||||
{
|
||||
return this.duality.getMonitorable( side, src, this );
|
||||
}
|
||||
@@ -424,4 +423,37 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto
|
||||
{
|
||||
this.duality.setPriority( newValue );
|
||||
}
|
||||
|
||||
@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()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public IChatComponent getDisplayName()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,6 @@ package appeng.parts.misc;
|
||||
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.helpers.Reflected;
|
||||
|
||||
|
||||
|
||||
@@ -23,21 +23,15 @@ import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import buildcraft.api.transport.IPipeConnection;
|
||||
import buildcraft.api.transport.IPipeTile.PipeType;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.AccessRestriction;
|
||||
import appeng.api.config.FuzzyMode;
|
||||
@@ -69,7 +63,9 @@ import appeng.api.storage.IMEMonitorHandlerReceiver;
|
||||
import appeng.api.storage.StorageChannel;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.api.util.IConfigManager;
|
||||
import appeng.client.render.IRenderHelper;
|
||||
import appeng.client.texture.CableBusTextures;
|
||||
import appeng.core.settings.TickRates;
|
||||
import appeng.core.stats.Achievements;
|
||||
@@ -83,15 +79,13 @@ import appeng.me.storage.MEMonitorIInventory;
|
||||
import appeng.parts.automation.PartUpgradeable;
|
||||
import appeng.tile.inventory.AppEngInternalAEInventory;
|
||||
import appeng.tile.inventory.InvOperation;
|
||||
import appeng.transformer.annotations.Integration.Interface;
|
||||
import appeng.transformer.annotations.Integration.Method;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.prioitylist.FuzzyPriorityList;
|
||||
import appeng.util.prioitylist.PrecisePriorityList;
|
||||
|
||||
|
||||
@Interface( iname = "BC", iface = "buildcraft.api.transport.IPipeConnection" )
|
||||
public class PartStorageBus extends PartUpgradeable implements IGridTickable, ICellContainer, IMEMonitorHandlerReceiver<IAEItemStack>, IPipeConnection, IPriorityHost
|
||||
// TODO: BC PIPE INTEGRATION
|
||||
//@Interface( iname = "BC", iface = "buildcraft.api.transport.IPipeConnection" ) - IPipeConnection
|
||||
public class PartStorageBus extends PartUpgradeable implements IGridTickable, ICellContainer, IMEMonitorHandlerReceiver<IAEItemStack>, IPriorityHost
|
||||
{
|
||||
final BaseActionSource mySrc;
|
||||
final AppEngInternalAEInventory Config = new AppEngInternalAEInventory( this, 63 );
|
||||
@@ -204,7 +198,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
|
||||
private void resetCache( boolean fullReset )
|
||||
{
|
||||
if( this.host == null || this.host.getTile() == null || this.host.getTile().getWorldObj() == null || this.host.getTile().getWorldObj().isRemote )
|
||||
if( this.host == null || this.host.getTile() == null || this.host.getTile().getWorld() == null || this.host.getTile().getWorld().isRemote )
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -266,9 +260,9 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderInventory( IPartRenderHelper rh, RenderBlocks renderer )
|
||||
public void renderInventory( IPartRenderHelper rh, IRenderHelper renderer )
|
||||
{
|
||||
rh.setTexture( CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageBack.getIcon(), this.is.getIconIndex(), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon() );
|
||||
rh.setTexture( CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageBack.getIcon(), renderer.getIcon( is ), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon() );
|
||||
|
||||
rh.setBounds( 3, 3, 15, 13, 13, 16 );
|
||||
rh.renderInventoryBox( renderer );
|
||||
@@ -282,28 +276,27 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderStatic( int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer )
|
||||
public void renderStatic( BlockPos pos, IPartRenderHelper rh, IRenderHelper renderer )
|
||||
{
|
||||
this.renderCache = rh.useSimplifiedRendering( x, y, z, this, this.renderCache );
|
||||
rh.setTexture( CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageBack.getIcon(), this.is.getIconIndex(), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon() );
|
||||
rh.setTexture( CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageBack.getIcon(), renderer.getIcon( is ), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon() );
|
||||
|
||||
rh.setBounds( 3, 3, 15, 13, 13, 16 );
|
||||
rh.renderBlock( x, y, z, renderer );
|
||||
rh.renderBlock( pos, renderer );
|
||||
|
||||
rh.setBounds( 2, 2, 14, 14, 14, 15 );
|
||||
rh.renderBlock( x, y, z, renderer );
|
||||
rh.renderBlock( pos, renderer );
|
||||
|
||||
rh.setTexture( CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageBack.getIcon(), this.is.getIconIndex(), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon() );
|
||||
rh.setTexture( CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageBack.getIcon(), renderer.getIcon( is ), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon() );
|
||||
|
||||
rh.setBounds( 5, 5, 12, 11, 11, 13 );
|
||||
rh.renderBlock( x, y, z, renderer );
|
||||
rh.renderBlock( pos, renderer );
|
||||
|
||||
rh.setTexture( CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), this.is.getIconIndex(), CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon() );
|
||||
rh.setTexture( CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), renderer.getIcon( is ), CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon() );
|
||||
|
||||
rh.setBounds( 5, 5, 13, 11, 11, 14 );
|
||||
rh.renderBlock( x, y, z, renderer );
|
||||
rh.renderBlock( pos, renderer );
|
||||
|
||||
this.renderLights( x, y, z, rh, renderer );
|
||||
this.renderLights( pos, rh, renderer );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -402,7 +395,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
|
||||
this.cached = true;
|
||||
TileEntity self = this.getHost().getTile();
|
||||
TileEntity target = self.getWorldObj().getTileEntity( self.xCoord + this.side.offsetX, self.yCoord + this.side.offsetY, self.zCoord + this.side.offsetZ );
|
||||
TileEntity target = self.getWorld().getTileEntity( self.getPos().offset( side.getFacing() ) );
|
||||
|
||||
int newHandlerHash = Platform.generateTileHash( target );
|
||||
|
||||
@@ -426,10 +419,10 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
this.monitor = null;
|
||||
if( target != null )
|
||||
{
|
||||
IExternalStorageHandler esh = AEApi.instance().registries().externalStorage().getHandler( target, this.side.getOpposite(), StorageChannel.ITEMS, this.mySrc );
|
||||
IExternalStorageHandler esh = AEApi.instance().registries().externalStorage().getHandler( target, this.side.getFacing().getOpposite(), StorageChannel.ITEMS, this.mySrc );
|
||||
if( esh != null )
|
||||
{
|
||||
IMEInventory inv = esh.getInventory( target, this.side.getOpposite(), StorageChannel.ITEMS, this.mySrc );
|
||||
IMEInventory inv = esh.getInventory( target, this.side.getFacing().getOpposite(), StorageChannel.ITEMS, this.mySrc );
|
||||
|
||||
if( inv instanceof MEMonitorIInventory )
|
||||
{
|
||||
@@ -506,7 +499,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
return this.handler;
|
||||
}
|
||||
|
||||
private void checkInterfaceVsStorageBus( TileEntity target, ForgeDirection side )
|
||||
private void checkInterfaceVsStorageBus( TileEntity target, AEPartLocation side )
|
||||
{
|
||||
IInterfaceHost achievement = null;
|
||||
|
||||
@@ -564,13 +557,15 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
{
|
||||
}
|
||||
|
||||
// TODO: BC PIPE INTEGRATION
|
||||
/*
|
||||
@Override
|
||||
@Method( iname = "BC" )
|
||||
public ConnectOverride overridePipeConnection( PipeType type, ForgeDirection with )
|
||||
public ConnectOverride overridePipeConnection( PipeType type, AEPartLocation with )
|
||||
{
|
||||
return type == PipeType.ITEM && with == this.side ? ConnectOverride.CONNECT : ConnectOverride.DISCONNECT;
|
||||
}
|
||||
|
||||
*/
|
||||
@Override
|
||||
public void saveChanges( IMEInventory cellInventory )
|
||||
{
|
||||
|
||||
@@ -23,18 +23,16 @@ import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.exceptions.FailedConnection;
|
||||
@@ -44,6 +42,8 @@ import appeng.api.parts.IPartCollisionHelper;
|
||||
import appeng.api.parts.IPartHost;
|
||||
import appeng.api.parts.IPartRenderHelper;
|
||||
import appeng.api.util.AECableType;
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.client.render.IRenderHelper;
|
||||
import appeng.client.texture.CableBusTextures;
|
||||
import appeng.helpers.Reflected;
|
||||
import appeng.me.helpers.AENetworkProxy;
|
||||
@@ -70,10 +70,10 @@ public class PartToggleBus extends PartBasicState
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setColors( boolean hasChan, boolean hasPower )
|
||||
public void setColors( IRenderHelper renderer, boolean hasChan, boolean hasPower )
|
||||
{
|
||||
this.hasRedstone = ( this.clientFlags & this.REDSTONE_FLAG ) == this.REDSTONE_FLAG;
|
||||
super.setColors( hasChan && this.hasRedstone, hasPower && this.hasRedstone );
|
||||
super.setColors( renderer, hasChan && this.hasRedstone, hasPower && this.hasRedstone );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -88,13 +88,13 @@ public class PartToggleBus extends PartBasicState
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getBreakingTexture()
|
||||
public TextureAtlasSprite getBreakingTexture( IRenderHelper renderer )
|
||||
{
|
||||
return this.is.getIconIndex();
|
||||
return renderer.getIcon( is ).getAtlas();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AECableType getCableConnectionType( ForgeDirection dir )
|
||||
public AECableType getCableConnectionType( AEPartLocation dir )
|
||||
{
|
||||
return AECableType.GLASS;
|
||||
}
|
||||
@@ -107,7 +107,7 @@ public class PartToggleBus extends PartBasicState
|
||||
List<ItemStack> items = new ArrayList<ItemStack>();
|
||||
items.add( this.is.copy() );
|
||||
this.host.removePart( this.side, false );
|
||||
Platform.spawnDrops( this.tile.getWorldObj(), this.tile.xCoord, this.tile.yCoord, this.tile.zCoord, items );
|
||||
Platform.spawnDrops( this.tile.getWorld(), this.tile.getPos(), items );
|
||||
this.is.stackSize = 0;
|
||||
}
|
||||
}
|
||||
@@ -120,11 +120,11 @@ public class PartToggleBus extends PartBasicState
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderInventory( IPartRenderHelper rh, RenderBlocks renderer )
|
||||
public void renderInventory( IPartRenderHelper rh, IRenderHelper renderer )
|
||||
{
|
||||
GL11.glTranslated( -0.2, -0.3, 0.0 );
|
||||
|
||||
rh.setTexture( this.is.getIconIndex() );
|
||||
rh.setTexture( renderer.getIcon( is ) );
|
||||
rh.setBounds( 6, 6, 14 - 4, 10, 10, 16 - 4 );
|
||||
rh.renderInventoryBox( renderer );
|
||||
|
||||
@@ -145,23 +145,22 @@ public class PartToggleBus extends PartBasicState
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderStatic( int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer )
|
||||
public void renderStatic( BlockPos pos, IPartRenderHelper rh, IRenderHelper renderer )
|
||||
{
|
||||
this.renderCache = rh.useSimplifiedRendering( x, y, z, this, this.renderCache );
|
||||
rh.setTexture( this.is.getIconIndex() );
|
||||
rh.setTexture( renderer.getIcon( is ) );
|
||||
|
||||
rh.setBounds( 6, 6, 14, 10, 10, 16 );
|
||||
rh.renderBlock( x, y, z, renderer );
|
||||
rh.renderBlock( pos, renderer );
|
||||
|
||||
rh.setBounds( 6, 6, 11, 10, 10, 13 );
|
||||
rh.renderBlock( x, y, z, renderer );
|
||||
rh.renderBlock( pos, renderer );
|
||||
|
||||
rh.setTexture( CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), this.is.getIconIndex(), CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon() );
|
||||
rh.setTexture( CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), renderer.getIcon( is ), CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon() );
|
||||
|
||||
rh.setBounds( 6, 6, 13, 10, 10, 14 );
|
||||
rh.renderBlock( x, y, z, renderer );
|
||||
rh.renderBlock( pos, renderer );
|
||||
|
||||
this.renderLights( x, y, z, rh, renderer );
|
||||
this.renderLights( pos, rh, renderer );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -208,10 +207,10 @@ public class PartToggleBus extends PartBasicState
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPartHostInfo( ForgeDirection side, IPartHost host, TileEntity tile )
|
||||
public void setPartHostInfo( AEPartLocation side, IPartHost host, TileEntity tile )
|
||||
{
|
||||
super.setPartHostInfo( side, host, tile );
|
||||
this.outerProxy.setValidSides( EnumSet.of( side ) );
|
||||
this.outerProxy.setValidSides( EnumSet.of( side.getFacing() ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -227,7 +226,7 @@ public class PartToggleBus extends PartBasicState
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlacement( EntityPlayer player, ItemStack held, ForgeDirection side )
|
||||
public void onPlacement( EntityPlayer player, ItemStack held, AEPartLocation side )
|
||||
{
|
||||
super.onPlacement( player, held, side );
|
||||
this.outerProxy.setOwner( player );
|
||||
|
||||
Reference in New Issue
Block a user