rest of BC commit
This commit is contained in:
parent
97f23cf955
commit
51ed55510c
|
@ -31,6 +31,7 @@ import net.minecraft.util.AxisAlignedBB;
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.BlockPos;
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
import appeng.api.util.AEPartLocation;
|
import appeng.api.util.AEPartLocation;
|
||||||
import appeng.client.render.IRenderHelper;
|
import appeng.client.render.IRenderHelper;
|
||||||
|
|
||||||
|
@ -52,20 +53,18 @@ public interface IFacadePart
|
||||||
* used to collide, and pick the part
|
* used to collide, and pick the part
|
||||||
*
|
*
|
||||||
* @param ch collision helper
|
* @param ch collision helper
|
||||||
* @param e colliding entity
|
* @param e colliding entity
|
||||||
*/
|
*/
|
||||||
void getBoxes( IPartCollisionHelper ch, Entity e );
|
void getBoxes( IPartCollisionHelper ch, Entity e );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* render the part.
|
* render the part.
|
||||||
*
|
*
|
||||||
* @param x x pos of part
|
* @param pos pos of part
|
||||||
* @param y y pos of part
|
* @param instance render helper
|
||||||
* @param z z pos of part
|
* @param renderer renderer
|
||||||
* @param instance render helper
|
* @param fc face container
|
||||||
* @param renderer renderer
|
* @param busBounds bounding box
|
||||||
* @param fc face container
|
|
||||||
* @param busBounds bounding box
|
|
||||||
* @param renderStilt if to render stilt
|
* @param renderStilt if to render stilt
|
||||||
*/
|
*/
|
||||||
@SideOnly( Side.CLIENT )
|
@SideOnly( Side.CLIENT )
|
||||||
|
|
|
@ -21,9 +21,10 @@ package appeng.core;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
|
import com.google.common.base.Stopwatch;
|
||||||
|
|
||||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||||
import net.minecraftforge.fml.common.Loader;
|
import net.minecraftforge.fml.common.Loader;
|
||||||
import net.minecraftforge.fml.common.Mod;
|
import net.minecraftforge.fml.common.Mod;
|
||||||
|
@ -36,6 +37,7 @@ import net.minecraftforge.fml.common.event.FMLServerAboutToStartEvent;
|
||||||
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
|
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
|
||||||
import net.minecraftforge.fml.common.event.FMLServerStoppingEvent;
|
import net.minecraftforge.fml.common.event.FMLServerStoppingEvent;
|
||||||
import net.minecraftforge.fml.common.network.NetworkRegistry;
|
import net.minecraftforge.fml.common.network.NetworkRegistry;
|
||||||
|
|
||||||
import appeng.core.crash.CrashInfo;
|
import appeng.core.crash.CrashInfo;
|
||||||
import appeng.core.crash.IntegrationCrashEnhancement;
|
import appeng.core.crash.IntegrationCrashEnhancement;
|
||||||
import appeng.core.crash.ModCrashEnhancement;
|
import appeng.core.crash.ModCrashEnhancement;
|
||||||
|
@ -49,8 +51,6 @@ import appeng.services.VersionChecker;
|
||||||
import appeng.services.version.VersionCheckerConfig;
|
import appeng.services.version.VersionCheckerConfig;
|
||||||
import appeng.util.Platform;
|
import appeng.util.Platform;
|
||||||
|
|
||||||
import com.google.common.base.Stopwatch;
|
|
||||||
|
|
||||||
|
|
||||||
@Mod( modid = AppEng.MOD_ID, acceptedMinecraftVersions = "[1.8]", name = AppEng.MOD_NAME, version = AEConfig.VERSION, dependencies = AppEng.MOD_DEPENDENCIES, guiFactory = "appeng.client.gui.config.AEConfigGuiFactory" )
|
@Mod( modid = AppEng.MOD_ID, acceptedMinecraftVersions = "[1.8]", name = AppEng.MOD_NAME, version = AEConfig.VERSION, dependencies = AppEng.MOD_DEPENDENCIES, guiFactory = "appeng.client.gui.config.AEConfigGuiFactory" )
|
||||||
public final class AppEng
|
public final class AppEng
|
||||||
|
@ -76,7 +76,7 @@ public final class AppEng
|
||||||
|
|
||||||
private File configDirectory;
|
private File configDirectory;
|
||||||
|
|
||||||
AppEng()
|
private AppEng()
|
||||||
{
|
{
|
||||||
this.imcHandler = new IMCHandler();
|
this.imcHandler = new IMCHandler();
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,7 @@ import java.io.IOException;
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
@ -140,9 +141,9 @@ public class FacadeContainer implements IFacadeContainer
|
||||||
if( isBC && IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.BuildCraftTransport ) )
|
if( isBC && IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.BuildCraftTransport ) )
|
||||||
{
|
{
|
||||||
final IBuildCraftTransport bc = (IBuildCraftTransport) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BuildCraftTransport );
|
final IBuildCraftTransport bc = (IBuildCraftTransport) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BuildCraftTransport );
|
||||||
final IFacadePart created = bc.createFacadePart( Block.getStateById( ids[0] ), ids[1], side );
|
final IBlockState state = Block.getStateById( ids[0] );
|
||||||
|
final IFacadePart created = bc.createFacadePart( state, side );
|
||||||
changed = changed || this.storage.getFacade( x ) == null;
|
changed = changed || this.storage.getFacade( x ) == null;
|
||||||
this.storage.setFacade( x, bc.createFacadePart( Block.getStateById( id[0] ), ids[1], side ) );
|
|
||||||
|
|
||||||
this.storage.setFacade( x, created );
|
this.storage.setFacade( x, created );
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,6 +36,7 @@ import net.minecraft.util.EnumWorldBlockLayer;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
import appeng.api.AEApi;
|
import appeng.api.AEApi;
|
||||||
import appeng.api.parts.IBoxProvider;
|
import appeng.api.parts.IBoxProvider;
|
||||||
import appeng.api.parts.IFacadeContainer;
|
import appeng.api.parts.IFacadeContainer;
|
||||||
|
@ -129,7 +130,7 @@ public class FacadePart implements IFacadePart, IBoxProvider
|
||||||
if( this.notAEFacade() && IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.BuildCraftTransport ) )
|
if( this.notAEFacade() && IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.BuildCraftTransport ) )
|
||||||
{
|
{
|
||||||
IBuildCraftTransport bc = (IBuildCraftTransport) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BuildCraftTransport );
|
IBuildCraftTransport bc = (IBuildCraftTransport) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BuildCraftTransport );
|
||||||
myIcon = bc.getFacadeTexture();
|
myIcon = bc.getCobbleStructurePipeTexture();
|
||||||
}
|
}
|
||||||
|
|
||||||
if( myIcon == null )
|
if( myIcon == null )
|
||||||
|
@ -217,14 +218,8 @@ public class FacadePart implements IFacadePart, IBoxProvider
|
||||||
else
|
else
|
||||||
{*/
|
{*/
|
||||||
IAESprite[] icon_down = renderer.getIcon( blk.getDefaultState() );
|
IAESprite[] icon_down = renderer.getIcon( blk.getDefaultState() );
|
||||||
|
|
||||||
instance.setTexture(
|
instance.setTexture( icon_down[EnumFacing.DOWN.ordinal()], icon_down[EnumFacing.UP.ordinal()], icon_down[EnumFacing.NORTH.ordinal()], icon_down[EnumFacing.SOUTH.ordinal()], icon_down[EnumFacing.WEST.ordinal()], icon_down[EnumFacing.EAST.ordinal()] );
|
||||||
icon_down[EnumFacing.DOWN.ordinal()],
|
|
||||||
icon_down[EnumFacing.UP.ordinal()],
|
|
||||||
icon_down[EnumFacing.NORTH.ordinal()],
|
|
||||||
icon_down[EnumFacing.SOUTH.ordinal()],
|
|
||||||
icon_down[EnumFacing.WEST.ordinal()],
|
|
||||||
icon_down[EnumFacing.EAST.ordinal()] );
|
|
||||||
//}
|
//}
|
||||||
|
|
||||||
if( busBounds == null )
|
if( busBounds == null )
|
||||||
|
@ -348,7 +343,7 @@ public class FacadePart implements IFacadePart, IBoxProvider
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly( Side.CLIENT )
|
@SideOnly( Side.CLIENT )
|
||||||
public void renderInventory( IPartRenderHelper instance, RenderBlocks renderer )
|
public void renderInventory( IPartRenderHelper instance, IRenderHelper renderer )
|
||||||
{
|
{
|
||||||
if( this.facade != null )
|
if( this.facade != null )
|
||||||
{
|
{
|
||||||
|
@ -356,47 +351,42 @@ public class FacadePart implements IFacadePart, IBoxProvider
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if( fi != null )
|
ItemStack randomItem = fi.getTextureItem( this.facade );
|
||||||
|
|
||||||
|
instance.setTexture( renderer.getIcon( facade ) );
|
||||||
|
instance.setBounds( 7, 7, 4, 9, 9, 14 );
|
||||||
|
instance.renderInventoryBox( renderer );
|
||||||
|
instance.setTexture( null );
|
||||||
|
|
||||||
|
if( randomItem != null )
|
||||||
{
|
{
|
||||||
ItemStack randomItem = fi.getTextureItem( this.facade );
|
if( randomItem.getItem() instanceof ItemBlock )
|
||||||
|
|
||||||
instance.setTexture( this.facade.getIconIndex() );
|
|
||||||
instance.setBounds( 7, 7, 4, 9, 9, 14 );
|
|
||||||
instance.renderInventoryBox( renderer );
|
|
||||||
instance.setTexture( null );
|
|
||||||
|
|
||||||
if( randomItem != null )
|
|
||||||
{
|
{
|
||||||
if( randomItem.getItem() instanceof ItemBlock )
|
ItemBlock ib = (ItemBlock) randomItem.getItem();
|
||||||
|
Block blk = Block.getBlockFromItem( ib );
|
||||||
|
|
||||||
|
try
|
||||||
{
|
{
|
||||||
ItemBlock ib = (ItemBlock) randomItem.getItem();
|
int color = ib.getColorFromItemStack( randomItem, 0 );
|
||||||
Block blk = Block.getBlockFromItem( ib );
|
instance.setInvColor( color );
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
int color = ib.getColorFromItemStack( randomItem, 0 );
|
|
||||||
GL11.glColor4f( 1.0f, 1.0f, 1.0f, 1.0F );
|
|
||||||
instance.setInvColor( color );
|
|
||||||
}
|
|
||||||
catch( Throwable error )
|
|
||||||
{
|
|
||||||
GL11.glColor4f( 1.0f, 1.0f, 1.0f, 1.0F );
|
|
||||||
instance.setInvColor( 0xffffff );
|
|
||||||
}
|
|
||||||
|
|
||||||
Tessellator.instance.setBrightness( 15 << 20 | 15 << 4 );
|
|
||||||
Tessellator.instance.setColorOpaque_F( 1, 1, 1 );
|
|
||||||
instance.setTexture( blk.getIcon( this.side.ordinal(), ib.getMetadata( randomItem.getItemDamage() ) ) );
|
|
||||||
|
|
||||||
instance.setBounds( 0, 0, 14, 16, 16, 16 );
|
|
||||||
instance.renderInventoryBox( renderer );
|
|
||||||
|
|
||||||
instance.setTexture( null );
|
|
||||||
}
|
}
|
||||||
|
catch( Throwable error )
|
||||||
|
{
|
||||||
|
instance.setInvColor( 0xffffff );
|
||||||
|
}
|
||||||
|
|
||||||
|
renderer.setBrightness( 15 << 20 | 15 << 4 );
|
||||||
|
renderer.setColorOpaque_F( 1, 1, 1 );
|
||||||
|
instance.setTexture( renderer.getIcon( blk.getDefaultState() )[side.ordinal()] );
|
||||||
|
|
||||||
|
instance.setBounds( 0, 0, 14, 16, 16, 16 );
|
||||||
|
instance.renderInventoryBox( renderer );
|
||||||
|
|
||||||
|
instance.setTexture( null );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch( Exception ignored )
|
catch( Throwable ignored )
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -404,7 +394,7 @@ public class FacadePart implements IFacadePart, IBoxProvider
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ForgeDirection getSide()
|
public AEPartLocation getSide()
|
||||||
{
|
{
|
||||||
return this.side;
|
return this.side;
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,15 +24,14 @@ import javax.annotation.Nullable;
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.util.BlockPos;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Contains wrench behaviour
|
* Contains wrench behaviour
|
||||||
*
|
*
|
||||||
* and registers the engines as P2P attunements for RF tunnels
|
* and registers the engines as P2P attunements for RF tunnels (since BC 7, they are part of BC Core) The attunement is currently not public anymore, because it
|
||||||
* (since BC 7, they are part of BC Core)
|
* was only used internally
|
||||||
* The attunement is currently not public anymore,
|
|
||||||
* because it was only used internally
|
|
||||||
*
|
*
|
||||||
* @author AlgorithmX2
|
* @author AlgorithmX2
|
||||||
* @version rv3
|
* @version rv3
|
||||||
|
@ -50,26 +49,22 @@ public interface IBuildCraftCore
|
||||||
/**
|
/**
|
||||||
* @param wrench to be checked item, must be an {@link buildcraft.api.tools.IToolWrench}
|
* @param wrench to be checked item, must be an {@link buildcraft.api.tools.IToolWrench}
|
||||||
* @param wrencher wrenching player, can be probably {@code null}, but not sure
|
* @param wrencher wrenching player, can be probably {@code null}, but not sure
|
||||||
* @param x x pos
|
* @param pos pos
|
||||||
* @param y y pos
|
|
||||||
* @param z z pos
|
|
||||||
*
|
*
|
||||||
* @return {@code true} if player can wrench with that {@code wrench}
|
* @return {@code true} if player can wrench with that {@code wrench}
|
||||||
*
|
*
|
||||||
* @throws NullPointerException if {@code wrench} is {@code null}
|
* @throws NullPointerException if {@code wrench} is {@code null}
|
||||||
* @throws ClassCastException if {@code wrench} is not an {@link buildcraft.api.tools.IToolWrench}
|
* @throws ClassCastException if {@code wrench} is not an {@link buildcraft.api.tools.IToolWrench}
|
||||||
*/
|
*/
|
||||||
boolean canWrench( @Nonnull Item wrench, EntityPlayer wrencher, int x, int y, int z );
|
boolean canWrench( @Nonnull Item wrench, EntityPlayer wrencher, BlockPos pos );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param wrench to be checked item, must be an {@link buildcraft.api.tools.IToolWrench}
|
* @param wrench to be checked item, must be an {@link buildcraft.api.tools.IToolWrench}
|
||||||
* @param wrencher wrenching player, can be probably {@code null}, but not sure
|
* @param wrencher wrenching player, can be probably {@code null}, but not sure
|
||||||
* @param x x pos
|
* @param pos pos
|
||||||
* @param y y pos
|
|
||||||
* @param z z pos
|
|
||||||
*
|
*
|
||||||
* @throws NullPointerException if {@code wrench} is {@code null}
|
* @throws NullPointerException if {@code wrench} is {@code null}
|
||||||
* @throws ClassCastException if {@code wrench} is not an {@link buildcraft.api.tools.IToolWrench}
|
* @throws ClassCastException if {@code wrench} is not an {@link buildcraft.api.tools.IToolWrench}
|
||||||
*/
|
*/
|
||||||
void wrenchUsed( @Nonnull Item wrench, EntityPlayer wrencher, int x, int y, int z );
|
void wrenchUsed( @Nonnull Item wrench, EntityPlayer wrencher, BlockPos pos );
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,13 +22,14 @@ package appeng.integration.abstraction;
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
|
||||||
|
|
||||||
import appeng.api.parts.IFacadePart;
|
import appeng.api.parts.IFacadePart;
|
||||||
|
import appeng.api.util.AEPartLocation;
|
||||||
|
import appeng.client.texture.IAESprite;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -61,7 +62,7 @@ public interface IBuildCraftTransport
|
||||||
* @return ae facade through bc facade system
|
* @return ae facade through bc facade system
|
||||||
*/
|
*/
|
||||||
@Nullable
|
@Nullable
|
||||||
IFacadePart createFacadePart( @Nullable Block blk, int meta, @Nonnull ForgeDirection side );
|
IFacadePart createFacadePart( @Nullable IBlockState blk, @Nonnull AEPartLocation side );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param held create facade for that item
|
* @param held create facade for that item
|
||||||
|
@ -71,7 +72,7 @@ public interface IBuildCraftTransport
|
||||||
*
|
*
|
||||||
* @throws IllegalArgumentException if {@code held} is {@code null}
|
* @throws IllegalArgumentException if {@code held} is {@code null}
|
||||||
*/
|
*/
|
||||||
IFacadePart createFacadePart( @Nonnull ItemStack held, @Nonnull ForgeDirection side );
|
IFacadePart createFacadePart( @Nonnull ItemStack held, @Nonnull AEPartLocation side );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param facade buildcraft facade
|
* @param facade buildcraft facade
|
||||||
|
@ -85,9 +86,9 @@ public interface IBuildCraftTransport
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return texture of buildcraft cobblestone structure pipe or null if something bad happens
|
* @return texture of buildcraft cobblestone structure pipe or null if something bad happens
|
||||||
*/
|
// */
|
||||||
@Nullable
|
@Nullable
|
||||||
IIcon getCobbleStructurePipeTexture();
|
IAESprite getCobbleStructurePipeTexture();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param te the to be checked {@link TileEntity}
|
* @param te the to be checked {@link TileEntity}
|
||||||
|
@ -97,7 +98,7 @@ public interface IBuildCraftTransport
|
||||||
*
|
*
|
||||||
* @throws NullPointerException if {@code dir} is {@code null}
|
* @throws NullPointerException if {@code dir} is {@code null}
|
||||||
*/
|
*/
|
||||||
boolean isPipe( @Nullable TileEntity te, @Nonnull ForgeDirection dir );
|
boolean isPipe( @Nullable TileEntity te, @Nonnull EnumFacing dir );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* checks weather if the {@code te} is injectable and simulates to inject the item
|
* checks weather if the {@code te} is injectable and simulates to inject the item
|
||||||
|
@ -108,7 +109,7 @@ public interface IBuildCraftTransport
|
||||||
*
|
*
|
||||||
* @return {@code true} if items were simulated successfully being added
|
* @return {@code true} if items were simulated successfully being added
|
||||||
*/
|
*/
|
||||||
boolean canAddItemsToPipe( TileEntity te, ItemStack is, ForgeDirection dir );
|
boolean canAddItemsToPipe( TileEntity te, ItemStack is, EnumFacing dir );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* checks weather if the {@code te} is injectable, simulates the inject and tries to inject the item
|
* checks weather if the {@code te} is injectable, simulates the inject and tries to inject the item
|
||||||
|
@ -119,5 +120,5 @@ public interface IBuildCraftTransport
|
||||||
*
|
*
|
||||||
* @return {@code true} if items were added to the buildcraft pipe
|
* @return {@code true} if items were added to the buildcraft pipe
|
||||||
*/
|
*/
|
||||||
boolean addItemsToPipe( @Nullable TileEntity te, @Nullable ItemStack is, @Nonnull ForgeDirection dir );
|
boolean addItemsToPipe( @Nullable TileEntity te, @Nullable ItemStack is, @Nonnull EnumFacing dir );
|
||||||
}
|
}
|
||||||
|
|
|
@ -136,7 +136,7 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements ISidedI
|
||||||
if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.BuildCraftTransport ) )
|
if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.BuildCraftTransport ) )
|
||||||
{
|
{
|
||||||
final IBuildCraftTransport buildcraft = (IBuildCraftTransport) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BuildCraftTransport );
|
final IBuildCraftTransport buildcraft = (IBuildCraftTransport) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BuildCraftTransport );
|
||||||
if( buildcraft.isPipe( te, this.side.getOpposite() ) )
|
if( buildcraft.isPipe( te, this.side.getOpposite().getFacing() ) )
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
|
@ -19,109 +19,94 @@
|
||||||
package appeng.util.inv;
|
package appeng.util.inv;
|
||||||
|
|
||||||
|
|
||||||
import java.util.Iterator;
|
//public class AdaptorBCPipe extends InventoryAdaptor
|
||||||
|
//{
|
||||||
import net.minecraft.item.ItemStack;
|
// private final IBuildCraftTransport bc;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
// private final TileEntity i;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
// private final ForgeDirection d;
|
||||||
|
//
|
||||||
import appeng.api.config.FuzzyMode;
|
// public AdaptorBCPipe( TileEntity s, ForgeDirection dd )
|
||||||
import appeng.integration.IntegrationRegistry;
|
// {
|
||||||
import appeng.integration.IntegrationType;
|
// this.bc = (IBuildCraftTransport) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BC );
|
||||||
import appeng.integration.abstraction.IBC;
|
// if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.BuildCraftTransport ) )
|
||||||
import appeng.integration.abstraction.IBuildCraftTransport;
|
// {
|
||||||
import appeng.util.InventoryAdaptor;
|
// if( this.bc.isPipe( s, dd ) )
|
||||||
import appeng.util.iterators.NullIterator;
|
// {
|
||||||
|
// this.i = s;
|
||||||
|
// this.d = dd;
|
||||||
public class AdaptorBCPipe extends InventoryAdaptor
|
// return;
|
||||||
{
|
// }
|
||||||
private final IBuildCraftTransport bc;
|
// }
|
||||||
private final TileEntity i;
|
// this.i = null;
|
||||||
private final ForgeDirection d;
|
// this.d = null;
|
||||||
|
// }
|
||||||
public AdaptorBCPipe( TileEntity s, ForgeDirection dd )
|
//
|
||||||
{
|
// @Override
|
||||||
this.bc = (IBuildCraftTransport) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BC );
|
// public ItemStack removeItems( int amount, ItemStack filter, IInventoryDestination destination )
|
||||||
if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.BuildCraftTransport ) )
|
// {
|
||||||
{
|
// return null;
|
||||||
if( this.bc.isPipe( s, dd ) )
|
// }
|
||||||
{
|
//
|
||||||
this.i = s;
|
// @Override
|
||||||
this.d = dd;
|
// public ItemStack simulateRemove( int amount, ItemStack filter, IInventoryDestination destination )
|
||||||
return;
|
// {
|
||||||
}
|
// return null;
|
||||||
}
|
// }
|
||||||
this.i = null;
|
//
|
||||||
this.d = null;
|
// @Override
|
||||||
}
|
// public ItemStack removeSimilarItems( int amount, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination )
|
||||||
|
// {
|
||||||
@Override
|
// return null;
|
||||||
public ItemStack removeItems( int amount, ItemStack filter, IInventoryDestination destination )
|
// }
|
||||||
{
|
//
|
||||||
return null;
|
// @Override
|
||||||
}
|
// public ItemStack simulateSimilarRemove( int amount, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination )
|
||||||
|
// {
|
||||||
@Override
|
// return null;
|
||||||
public ItemStack simulateRemove( int amount, ItemStack filter, IInventoryDestination destination )
|
// }
|
||||||
{
|
//
|
||||||
return null;
|
// @Override
|
||||||
}
|
// public ItemStack addItems( ItemStack toBeAdded )
|
||||||
|
// {
|
||||||
@Override
|
// if( this.i == null )
|
||||||
public ItemStack removeSimilarItems( int amount, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination )
|
// {
|
||||||
{
|
// return toBeAdded;
|
||||||
return null;
|
// }
|
||||||
}
|
// if( toBeAdded == null )
|
||||||
|
// {
|
||||||
@Override
|
// return null;
|
||||||
public ItemStack simulateSimilarRemove( int amount, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination )
|
// }
|
||||||
{
|
// if( toBeAdded.stackSize == 0 )
|
||||||
return null;
|
// {
|
||||||
}
|
// return null;
|
||||||
|
// }
|
||||||
@Override
|
//
|
||||||
public ItemStack addItems( ItemStack toBeAdded )
|
// if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.BuildCraftTransport ) && this.bc.addItemsToPipe( this.i, toBeAdded, this.d ) )
|
||||||
{
|
// {
|
||||||
if( this.i == null )
|
// return null;
|
||||||
{
|
// }
|
||||||
return toBeAdded;
|
// return toBeAdded;
|
||||||
}
|
// }
|
||||||
if( toBeAdded == null )
|
//
|
||||||
{
|
// @Override
|
||||||
return null;
|
// public ItemStack simulateAdd( ItemStack toBeSimulated )
|
||||||
}
|
// {
|
||||||
if( toBeAdded.stackSize == 0 )
|
// if( this.i == null )
|
||||||
{
|
// {
|
||||||
return null;
|
// return toBeSimulated;
|
||||||
}
|
// }
|
||||||
|
// return null;
|
||||||
if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.BuildCraftTransport ) && this.bc.addItemsToPipe( this.i, toBeAdded, this.d ) )
|
// }
|
||||||
{
|
//
|
||||||
return null;
|
// @Override
|
||||||
}
|
// public boolean containsItems()
|
||||||
return toBeAdded;
|
// {
|
||||||
}
|
// return false;
|
||||||
|
// }
|
||||||
@Override
|
//
|
||||||
public ItemStack simulateAdd( ItemStack toBeSimulated )
|
// @Override
|
||||||
{
|
// public Iterator<ItemSlot> iterator()
|
||||||
if( this.i == null )
|
// {
|
||||||
{
|
// return new NullIterator<ItemSlot>();
|
||||||
return toBeSimulated;
|
// }
|
||||||
}
|
//}
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean containsItems()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Iterator<ItemSlot> iterator()
|
|
||||||
{
|
|
||||||
return new NullIterator<ItemSlot>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -23,7 +23,8 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.inventory.IInventory;
|
import net.minecraft.inventory.IInventory;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraft.util.EnumFacing;
|
||||||
|
import net.minecraft.util.IChatComponent;
|
||||||
|
|
||||||
import appeng.integration.IntegrationRegistry;
|
import appeng.integration.IntegrationRegistry;
|
||||||
import appeng.integration.IntegrationType;
|
import appeng.integration.IntegrationType;
|
||||||
|
@ -34,9 +35,9 @@ public class WrapperBCPipe implements IInventory
|
||||||
{
|
{
|
||||||
private final IBuildCraftTransport bc;
|
private final IBuildCraftTransport bc;
|
||||||
private final TileEntity ad;
|
private final TileEntity ad;
|
||||||
private final ForgeDirection dir;
|
private final EnumFacing dir;
|
||||||
|
|
||||||
public WrapperBCPipe( TileEntity te, ForgeDirection d )
|
public WrapperBCPipe( TileEntity te, EnumFacing d )
|
||||||
{
|
{
|
||||||
this.bc = (IBuildCraftTransport) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BuildCraftTransport );
|
this.bc = (IBuildCraftTransport) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BuildCraftTransport );
|
||||||
this.ad = te;
|
this.ad = te;
|
||||||
|
@ -76,18 +77,6 @@ public class WrapperBCPipe implements IInventory
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getInventoryName()
|
|
||||||
{
|
|
||||||
return "BC Pipe Wrapper";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean hasCustomInventoryName()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getInventoryStackLimit()
|
public int getInventoryStackLimit()
|
||||||
{
|
{
|
||||||
|
@ -100,27 +89,69 @@ public class WrapperBCPipe implements IInventory
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void openInventory( EntityPlayer player )
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void closeInventory( EntityPlayer player )
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isUseableByPlayer( EntityPlayer entityplayer )
|
public boolean isUseableByPlayer( EntityPlayer entityplayer )
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void openInventory()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void closeInventory()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isItemValidForSlot( int i, ItemStack itemstack )
|
public boolean isItemValidForSlot( int i, ItemStack itemstack )
|
||||||
{
|
{
|
||||||
return this.bc.canAddItemsToPipe( this.ad, itemstack, this.dir );
|
return this.bc.canAddItemsToPipe( this.ad, itemstack, this.dir );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@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 String getName()
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasCustomName()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IChatComponent getDisplayName()
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue