Updates BuildCraft to 7.0.9
Split dependency logic on the BuildCraft modules. Config needs to be reset, if BuildCraft was disabled actively, because now there are 3 BC modules to be taken account of Conflicts: gradle.properties src/main/java/appeng/facade/FacadeContainer.java src/main/java/appeng/facade/FacadePart.java src/main/java/appeng/integration/abstraction/IBC.java src/main/java/appeng/integration/modules/BC.java src/main/java/appeng/integration/modules/BCHelpers/BCPipeHandler.java src/main/java/appeng/integration/modules/BCHelpers/BCPipeInventory.java src/main/java/appeng/items/tools/ToolNetworkTool.java src/main/java/appeng/items/tools/quartz/ToolQuartzWrench.java src/main/java/appeng/parts/CableBusStorage.java src/main/java/appeng/parts/layers/LayerIPipeConnection.java src/main/java/appeng/parts/misc/PartStorageBus.java src/main/java/appeng/parts/p2p/PartP2PItems.java src/main/java/appeng/util/inv/AdaptorBCPipe.java src/main/java/appeng/util/inv/WrapperBCPipe.java
This commit is contained in:
@@ -19,13 +19,15 @@
|
||||
package appeng.facade;
|
||||
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.parts.IFacadeContainer;
|
||||
import appeng.api.parts.IFacadePart;
|
||||
@@ -33,7 +35,7 @@ import appeng.api.parts.IPartHost;
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.integration.IntegrationRegistry;
|
||||
import appeng.integration.IntegrationType;
|
||||
import appeng.integration.abstraction.IBC;
|
||||
import appeng.integration.abstraction.IBuildCraftTransport;
|
||||
import appeng.items.parts.ItemFacade;
|
||||
import appeng.parts.CableBusStorage;
|
||||
|
||||
@@ -135,15 +137,16 @@ public class FacadeContainer implements IFacadeContainer
|
||||
boolean isBC = ids[0] < 0;
|
||||
ids[0] = Math.abs( ids[0] );
|
||||
|
||||
// TODO: BC Facade Integration!
|
||||
/*
|
||||
if( isBC && IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.BC ) )
|
||||
if( isBC && IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.BuildCraftTransport ) )
|
||||
{
|
||||
IBC bc = (IBC) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BC );
|
||||
final IBuildCraftTransport bc = (IBuildCraftTransport) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BuildCraftTransport );
|
||||
final IFacadePart created = bc.createFacadePart( Block.getStateById( ids[0] ), ids[1], side );
|
||||
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 );
|
||||
}
|
||||
else */
|
||||
else
|
||||
if( !isBC )
|
||||
{
|
||||
for( Item facadeItem : AEApi.instance().definitions().items().facade().maybeItem().asSet() )
|
||||
@@ -188,9 +191,9 @@ public class FacadeContainer implements IFacadeContainer
|
||||
}
|
||||
else
|
||||
{
|
||||
if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.BC ) )
|
||||
if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.BuildCraftTransport ) )
|
||||
{
|
||||
IBC bc = (IBC) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BC );
|
||||
final IBuildCraftTransport bc = (IBuildCraftTransport) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BuildCraftTransport );
|
||||
if( bc.isFacade( is ) )
|
||||
{
|
||||
this.storage.setFacade( x, bc.createFacadePart( is, AEPartLocation.fromOrdinal( x ) ) );
|
||||
@@ -222,7 +225,7 @@ public class FacadeContainer implements IFacadeContainer
|
||||
{
|
||||
int itemID = Item.getIdFromItem( part.getItem() );
|
||||
int dmgValue = part.getItemDamage();
|
||||
out.writeInt( itemID * ( part.isBC() ? -1 : 1 ) );
|
||||
out.writeInt( itemID * ( part.notAEFacade() ? -1 : 1 ) );
|
||||
out.writeInt( dmgValue );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ package appeng.facade;
|
||||
|
||||
|
||||
import java.util.EnumSet;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -50,7 +51,7 @@ import appeng.client.texture.IAESprite;
|
||||
import appeng.core.AELog;
|
||||
import appeng.integration.IntegrationRegistry;
|
||||
import appeng.integration.IntegrationType;
|
||||
import appeng.integration.abstraction.IBC;
|
||||
import appeng.integration.abstraction.IBuildCraftTransport;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
@@ -125,9 +126,9 @@ public class FacadePart implements IFacadePart, IBoxProvider
|
||||
}
|
||||
|
||||
IAESprite myIcon = null;
|
||||
if( this.isBC() )
|
||||
if( this.notAEFacade() && IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.BuildCraftTransport ) )
|
||||
{
|
||||
IBC bc = (IBC) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BC );
|
||||
IBuildCraftTransport bc = (IBuildCraftTransport) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BuildCraftTransport );
|
||||
myIcon = bc.getFacadeTexture();
|
||||
}
|
||||
|
||||
@@ -138,7 +139,7 @@ public class FacadePart implements IFacadePart, IBoxProvider
|
||||
|
||||
instance.setTexture( myIcon );
|
||||
|
||||
if( this.isBC() )
|
||||
if( this.notAEFacade() )
|
||||
{
|
||||
instance.setBounds( 6, 6, 10, 10, 10, 15 );
|
||||
}
|
||||
@@ -345,6 +346,124 @@ public class FacadePart implements IFacadePart, IBoxProvider
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderInventory( IPartRenderHelper instance, RenderBlocks renderer )
|
||||
{
|
||||
if( this.facade != null )
|
||||
{
|
||||
IFacadeItem fi = (IFacadeItem) this.facade.getItem();
|
||||
|
||||
try
|
||||
{
|
||||
if( fi != null )
|
||||
{
|
||||
ItemStack randomItem = fi.getTextureItem( this.facade );
|
||||
|
||||
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
|
||||
{
|
||||
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( Exception ignored )
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ForgeDirection getSide()
|
||||
{
|
||||
return this.side;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getPrimaryBox()
|
||||
{
|
||||
return Platform.getPrimaryBox( this.side, this.thickness );
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItem()
|
||||
{
|
||||
ItemStack is = this.getTexture();
|
||||
if( is == null )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return is.getItem();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemDamage()
|
||||
{
|
||||
ItemStack is = this.getTexture();
|
||||
if( is == null )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return is.getItemDamage();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean notAEFacade()
|
||||
{
|
||||
return !( this.facade.getItem() instanceof IFacadeItem );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setThinFacades( boolean useThinFacades )
|
||||
{
|
||||
this.thickness = useThinFacades ? 1 : 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTransparent()
|
||||
{
|
||||
if( AEApi.instance().partHelper().getCableRenderMode().transparentFacades )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
ItemStack is = this.getTexture();
|
||||
Block blk = Block.getBlockFromItem( is.getItem() );
|
||||
|
||||
return !blk.isOpaqueCube();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
ItemStack getTexture()
|
||||
{
|
||||
final Item maybeFacade = this.facade.getItem();
|
||||
@@ -356,9 +475,9 @@ public class FacadePart implements IFacadePart, IBoxProvider
|
||||
|
||||
return facade.getTextureItem( this.facade );
|
||||
}
|
||||
else if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.BC ) )
|
||||
else if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.BuildCraftTransport ) )
|
||||
{
|
||||
IBC bc = (IBC) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BC );
|
||||
final IBuildCraftTransport bc = (IBuildCraftTransport) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BuildCraftTransport );
|
||||
|
||||
return bc.getTextureForFacade( this.facade );
|
||||
}
|
||||
@@ -486,118 +605,6 @@ public class FacadePart implements IFacadePart, IBoxProvider
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderInventory( IPartRenderHelper instance, IRenderHelper renderer )
|
||||
{
|
||||
if( this.facade != null )
|
||||
{
|
||||
IFacadeItem fi = (IFacadeItem) this.facade.getItem();
|
||||
|
||||
try
|
||||
{
|
||||
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 )
|
||||
{
|
||||
if( randomItem.getItem() instanceof ItemBlock )
|
||||
{
|
||||
ItemBlock ib = (ItemBlock) randomItem.getItem();
|
||||
Block blk = Block.getBlockFromItem( ib );
|
||||
|
||||
try
|
||||
{
|
||||
int color = ib.getColorFromItemStack( randomItem, 0 );
|
||||
instance.setInvColor( color );
|
||||
}
|
||||
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( Throwable ignored )
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AEPartLocation getSide()
|
||||
{
|
||||
return this.side;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getPrimaryBox()
|
||||
{
|
||||
return Platform.getPrimaryBox( this.side, this.thickness );
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItem()
|
||||
{
|
||||
ItemStack is = this.getTexture();
|
||||
if( is == null )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return is.getItem();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemDamage()
|
||||
{
|
||||
ItemStack is = this.getTexture();
|
||||
if( is == null )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return is.getItemDamage();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBC()
|
||||
{
|
||||
return !( this.facade.getItem() instanceof IFacadeItem );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setThinFacades( boolean useThinFacades )
|
||||
{
|
||||
this.thickness = useThinFacades ? 1 : 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTransparent()
|
||||
{
|
||||
if( AEApi.instance().partHelper().getCableRenderMode().transparentFacades )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
ItemStack is = this.getTexture();
|
||||
Block blk = Block.getBlockFromItem( is.getItem() );
|
||||
|
||||
return !blk.isOpaqueCube();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBoxes( IPartCollisionHelper bch )
|
||||
|
||||
Reference in New Issue
Block a user