diff --git a/client/render/BaseBlockRender.java b/client/render/BaseBlockRender.java index 575d6ad5..24f001cd 100644 --- a/client/render/BaseBlockRender.java +++ b/client/render/BaseBlockRender.java @@ -709,14 +709,14 @@ public class BaseBlockRender double maxY = (forward.offsetY > 0 ? 1 : 0) + mapFaceUV( west.offsetY, u2 ) + mapFaceUV( up.offsetY, v2 ); double maxZ = (forward.offsetZ > 0 ? 1 : 0) + mapFaceUV( west.offsetZ, u2 ) + mapFaceUV( up.offsetZ, v2 ); - renderer.renderMinX = Math.max( 0.0, Math.min( minX, maxX ) - 0.001 ); - renderer.renderMaxX = Math.min( 1.0, Math.max( minX, maxX ) + 0.001 ); + renderer.renderMinX = Math.max( 0.0, Math.min( minX, maxX ) - (forward.offsetX != 0 ? 0 : 0.001) ); + renderer.renderMaxX = Math.min( 1.0, Math.max( minX, maxX ) + (forward.offsetX != 0 ? 0 : 0.001) ); - renderer.renderMinY = Math.max( 0.0, Math.min( minY, maxY ) - 0.001 ); - renderer.renderMaxY = Math.min( 1.0, Math.max( minY, maxY ) + 0.001 ); + renderer.renderMinY = Math.max( 0.0, Math.min( minY, maxY ) - (forward.offsetY != 0 ? 0 : 0.001) ); + renderer.renderMaxY = Math.min( 1.0, Math.max( minY, maxY ) + (forward.offsetY != 0 ? 0 : 0.001) ); - renderer.renderMinZ = Math.max( 0.0, Math.min( minZ, maxZ ) - 0.001 ); - renderer.renderMaxZ = Math.min( 1.0, Math.max( minZ, maxZ ) + 0.001 ); + renderer.renderMinZ = Math.max( 0.0, Math.min( minZ, maxZ ) - (forward.offsetZ != 0 ? 0 : 0.001) ); + renderer.renderMaxZ = Math.min( 1.0, Math.max( minZ, maxZ ) + (forward.offsetZ != 0 ? 0 : 0.001) ); } private double mapFaceUV(int offset, int uv) diff --git a/core/Registration.java b/core/Registration.java index a72e1c86..54800a69 100644 --- a/core/Registration.java +++ b/core/Registration.java @@ -566,9 +566,6 @@ public class Registration AEApi.instance().registries().matterCannon().registerAmmo( AEApi.instance().materials().materialMatterBall.stack( 1 ), 32.0 ); - // default settings.. - ((P2PTunnelRegistry) AEApi.instance().registries().p2pTunnel()).configure(); - recipeHandler.injectRecipes(); if ( AEConfig.instance.isFeatureEnabled( AEFeature.enableDisassemblyCrafting ) ) @@ -582,6 +579,9 @@ public class Registration { registerSpatial( true ); + // default settings.. + ((P2PTunnelRegistry) AEApi.instance().registries().p2pTunnel()).configure(); + // add to localizaiton.. PlayerMessages.values(); GuiText.values(); diff --git a/core/features/registries/P2PTunnelRegistry.java b/core/features/registries/P2PTunnelRegistry.java index 2635150e..8b66b283 100644 --- a/core/features/registries/P2PTunnelRegistry.java +++ b/core/features/registries/P2PTunnelRegistry.java @@ -53,6 +53,7 @@ public class P2PTunnelRegistry implements IP2PTunnelRegistry addNewAttunement( new ItemStack( Blocks.redstone_wire ), TunnelType.REDSTONE ); addNewAttunement( new ItemStack( Blocks.redstone_block ), TunnelType.REDSTONE ); addNewAttunement( new ItemStack( Blocks.lever ), TunnelType.REDSTONE ); + addNewAttunement( getModItem( "EnderIO", "itemRedstoneConduit", OreDictionary.WILDCARD_VALUE ), TunnelType.REDSTONE ); /** * attune based on lots of random item related stuff @@ -69,6 +70,8 @@ public class P2PTunnelRegistry implements IP2PTunnelRegistry addNewAttunement( new ItemStack( Blocks.chest ), TunnelType.ITEM ); addNewAttunement( new ItemStack( Blocks.trapped_chest ), TunnelType.ITEM ); addNewAttunement( getModItem( "ExtraUtilities", "extractor_base", 0 ), TunnelType.ITEM ); + addNewAttunement( getModItem( "Mekanism", "PartTransmitter", 9 ), TunnelType.ITEM ); + addNewAttunement( getModItem( "EnderIO", "itemItemConduit", OreDictionary.WILDCARD_VALUE ), TunnelType.ITEM ); /** * attune based on lots of random item related stuff @@ -77,7 +80,11 @@ public class P2PTunnelRegistry implements IP2PTunnelRegistry addNewAttunement( new ItemStack( Items.lava_bucket ), TunnelType.FLUID ); addNewAttunement( new ItemStack( Items.milk_bucket ), TunnelType.FLUID ); addNewAttunement( new ItemStack( Items.water_bucket ), TunnelType.FLUID ); + addNewAttunement( getModItem( "Mekanism", "MachineBlock2", 11 ), TunnelType.FLUID ); + addNewAttunement( getModItem( "Mekanism", "PartTransmitter", 4 ), TunnelType.FLUID ); addNewAttunement( getModItem( "ExtraUtilities", "extractor_base", 6 ), TunnelType.FLUID ); + addNewAttunement( getModItem( "ExtraUtilities", "drum", OreDictionary.WILDCARD_VALUE ), TunnelType.FLUID ); + addNewAttunement( getModItem( "EnderIO", "itemLiquidConduit", OreDictionary.WILDCARD_VALUE ), TunnelType.FLUID ); for (AEColor c : AEColor.values()) { diff --git a/facade/FacadePart.java b/facade/FacadePart.java index b18083cf..8ba03375 100644 --- a/facade/FacadePart.java +++ b/facade/FacadePart.java @@ -1,538 +1,563 @@ -package appeng.facade; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.item.Item; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import net.minecraftforge.common.util.ForgeDirection; - -import org.lwjgl.opengl.GL11; - -import appeng.api.AEApi; -import appeng.api.parts.IBoxProvider; -import appeng.api.parts.IFacadeContainer; -import appeng.api.parts.IFacadePart; -import appeng.api.parts.IPartCollsionHelper; -import appeng.api.parts.IPartHost; -import appeng.api.parts.IPartRenderHelper; -import appeng.api.parts.ISimplifiedBundle; -import appeng.client.render.BusRenderHelper; -import appeng.client.render.RenderBlocksWorkaround; -import appeng.core.AELog; -import appeng.core.AppEng; -import appeng.integration.IntegrationType; -import appeng.integration.abstraction.IBC; -import appeng.util.Platform; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class FacadePart implements IFacadePart, IBoxProvider -{ - - public final ItemStack facade; - public final ForgeDirection side; - public int thickness = 2; - - @SideOnly(Side.CLIENT) - ISimplifiedBundle prevLight; - - public FacadePart(ItemStack facade, ForgeDirection side) { - if ( facade == null ) - throw new RuntimeException( "Facade Part constructed on null item." ); - this.facade = facade.copy(); - this.facade.stackSize = 1; - this.side = side; - } - - @Override - public ItemStack getItemStack() - { - return facade; - } - - @Override - public void getBoxes(IPartCollsionHelper ch, Entity e) - { - if ( e instanceof EntityLivingBase ) - { - // prevent weird snagg behavior - ch.addBox( 0.0, 0.0, 14, 16.0, 16.0, 16.0 ); - } - else - { - // the box is 15.9 for transition planes to pick up collision events. - ch.addBox( 0.0, 0.0, 14, 16.0, 16.0, 15.9 ); - } - } - - @Override - public void getBoxes(IPartCollsionHelper bch) - { - getBoxes( bch, null ); - - } - - public static boolean isFacade(ItemStack is) - { - if ( is.getItem() instanceof IFacadeItem ) - return true; - return false; - } - - ItemStack getTexture() - { - if ( facade.getItem() instanceof IFacadeItem ) - { - IFacadeItem fi = (IFacadeItem) facade.getItem(); - return fi.getTextureItem( facade ); - } - else if ( AppEng.instance.isIntegrationEnabled( IntegrationType.BC ) ) - { - IBC bc = (IBC) AppEng.instance.getIntegration( IntegrationType.BC ); - return bc.getTextureForFacade( facade ); - } - return null; - } - - @Override - @SideOnly(Side.CLIENT) - public void renderStatic(int x, int y, int z, IPartRenderHelper instance2, RenderBlocks renderer, IFacadeContainer fc, AxisAlignedBB busBounds, - boolean renderStilt) - { - if ( facade != null ) - { - BusRenderHelper instance = (BusRenderHelper) instance2; - - try - { - ItemStack randomItem = getTexture(); - - RenderBlocksWorkaround rbw = null; - if ( renderer instanceof RenderBlocksWorkaround ) - { - rbw = (RenderBlocksWorkaround) renderer; - } - - if ( renderStilt && busBounds == null ) - { - if ( rbw != null ) - { - rbw.isFacade = false; - rbw.calculations = true; - } - - IIcon myIcon = null; - if ( isBC() ) - { - IBC bc = (IBC) AppEng.instance.getIntegration( IntegrationType.BC ); - myIcon = bc.getFacadeTexture(); - } - - if ( myIcon == null ) - myIcon = facade.getIconIndex(); - - instance.setTexture( myIcon ); - - if ( isBC() ) - instance.setBounds( 6, 6, 10, 10, 10, 15 ); - else - instance.setBounds( 7, 7, 10, 9, 9, 15 ); - - instance.renderBlock( x, y, z, renderer ); - instance.setTexture( null ); - - } - - if ( randomItem != null ) - { - if ( randomItem.getItem() instanceof ItemBlock ) - { - ItemBlock ib = (ItemBlock) randomItem.getItem(); - Block blk = Block.getBlockFromItem( ib ); - - if ( AEApi.instance().partHelper().getCableRenderMode().transparentFacades ) - { - if ( rbw != null ) - rbw.opacity = 0.3f; - instance.renderForPass( 1 ); - } - else - { - if ( blk.canRenderInPass( 1 ) ) - { - instance.renderForPass( 1 ); - } - } - - int color = 0xffffff; - - try - { - color = ib.getColorFromItemStack( randomItem, 0 ); - } - catch (Throwable error) - { - } - - renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; - instance.setBounds( 0, 0, 16 - getFacadeThickness(), 16, 16, 16 ); - instance.prepareBounds( renderer ); - - if ( rbw != null ) - { - rbw.isFacade = true; - - rbw.calculations = true; - rbw.faces = EnumSet.noneOf( ForgeDirection.class ); - - if ( prevLight != null && rbw.similarLighting( blk, rbw.blockAccess, x, y, z, prevLight ) ) - rbw.populate( prevLight ); - else - { - instance.setRenderColor( color ); - rbw.renderStandardBlock( instance.getBlock(), x, y, z ); - instance.setRenderColor( 0xffffff ); - prevLight = rbw.getLightingCache(); - } - - rbw.calculations = false; - rbw.faces = calculateFaceOpenFaces( rbw.blockAccess, fc, x, y, z, side ); - - ((RenderBlocksWorkaround) renderer).setTexture( - blk.getIcon( ForgeDirection.DOWN.ordinal(), ib.getMetadata( randomItem.getItemDamage() ) ), - blk.getIcon( ForgeDirection.UP.ordinal(), ib.getMetadata( randomItem.getItemDamage() ) ), - blk.getIcon( ForgeDirection.NORTH.ordinal(), ib.getMetadata( randomItem.getItemDamage() ) ), - blk.getIcon( ForgeDirection.SOUTH.ordinal(), ib.getMetadata( randomItem.getItemDamage() ) ), - blk.getIcon( ForgeDirection.WEST.ordinal(), ib.getMetadata( randomItem.getItemDamage() ) ), - blk.getIcon( ForgeDirection.EAST.ordinal(), ib.getMetadata( randomItem.getItemDamage() ) ) ); - } - else - { - instance.setTexture( blk.getIcon( ForgeDirection.DOWN.ordinal(), ib.getMetadata( randomItem.getItemDamage() ) ), - blk.getIcon( ForgeDirection.UP.ordinal(), ib.getMetadata( randomItem.getItemDamage() ) ), - blk.getIcon( ForgeDirection.NORTH.ordinal(), ib.getMetadata( randomItem.getItemDamage() ) ), - blk.getIcon( ForgeDirection.SOUTH.ordinal(), ib.getMetadata( randomItem.getItemDamage() ) ), - blk.getIcon( ForgeDirection.WEST.ordinal(), ib.getMetadata( randomItem.getItemDamage() ) ), - blk.getIcon( ForgeDirection.EAST.ordinal(), ib.getMetadata( randomItem.getItemDamage() ) ) ); - } - - if ( busBounds == null ) - { - if ( side == ForgeDirection.UP || side == ForgeDirection.DOWN ) - { - instance.renderBlockCurrentBounds( x, y, z, renderer ); - } - else if ( side == ForgeDirection.NORTH || side == ForgeDirection.SOUTH ) - { - if ( fc.getFacade( ForgeDirection.UP ) != null ) - renderer.renderMaxY -= getFacadeThickness() / 16.0; - - if ( fc.getFacade( ForgeDirection.DOWN ) != null ) - renderer.renderMinY += getFacadeThickness() / 16.0; - - instance.renderBlockCurrentBounds( x, y, z, renderer ); - } - else - { - if ( fc.getFacade( ForgeDirection.UP ) != null ) - renderer.renderMaxY -= getFacadeThickness() / 16.0; - - if ( fc.getFacade( ForgeDirection.DOWN ) != null ) - renderer.renderMinY += getFacadeThickness() / 16.0; - - if ( fc.getFacade( ForgeDirection.SOUTH ) != null ) - renderer.renderMaxZ -= getFacadeThickness() / 16.0; - - if ( fc.getFacade( ForgeDirection.NORTH ) != null ) - renderer.renderMinZ += getFacadeThickness() / 16.0; - - instance.renderBlockCurrentBounds( x, y, z, renderer ); - } - } - else - { - if ( side == ForgeDirection.UP || side == ForgeDirection.DOWN ) - { - renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, 0.0, 0.0, busBounds.maxZ, 1.0, 1.0, 1.0 ); - renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, 0.0, 0.0, 0.0, 1.0, 1.0, busBounds.minZ ); - renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, 0.0, 0.0, busBounds.minZ, busBounds.minX, 1.0, busBounds.maxZ ); - renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, busBounds.maxX, 0.0, busBounds.minZ, 1.0, 1.0, busBounds.maxZ ); - } - else if ( side == ForgeDirection.NORTH || side == ForgeDirection.SOUTH ) - { - if ( fc.getFacade( ForgeDirection.UP ) != null ) - renderer.renderMaxY -= getFacadeThickness() / 16.0; - - if ( fc.getFacade( ForgeDirection.DOWN ) != null ) - renderer.renderMinY += getFacadeThickness() / 16.0; - - renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, busBounds.maxX, 0.0, 0.0, 1.0, 1.0, 1.0 ); - renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, 0.0, 0.0, 0.0, busBounds.minX, 1.0, 1.0 ); - renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, busBounds.minX, 0.0, 0.0, busBounds.maxX, busBounds.minY, 1.0 ); - renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, busBounds.minX, busBounds.maxY, 0.0, busBounds.maxX, 1.0, 1.0 ); - } - else - { - if ( fc.getFacade( ForgeDirection.UP ) != null ) - renderer.renderMaxY -= getFacadeThickness() / 16.0; - - if ( fc.getFacade( ForgeDirection.DOWN ) != null ) - renderer.renderMinY += getFacadeThickness() / 16.0; - - if ( fc.getFacade( ForgeDirection.SOUTH ) != null ) - renderer.renderMaxZ -= getFacadeThickness() / 16.0; - - if ( fc.getFacade( ForgeDirection.NORTH ) != null ) - renderer.renderMinZ += getFacadeThickness() / 16.0; - - renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, 0.0, 0.0, busBounds.maxZ, 1.0, 1.0, 1.0 ); - renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, 0.0, 0.0, 0.0, 1.0, 1.0, busBounds.minZ ); - renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, 0.0, 0.0, busBounds.minZ, 1.0, busBounds.minY, busBounds.maxZ ); - renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, 0.0, busBounds.maxY, busBounds.minZ, 1.0, 1.0, busBounds.maxZ ); - } - } - - if ( rbw != null ) - { - rbw.opacity = 1.0f; - rbw.faces = EnumSet.allOf( ForgeDirection.class ); - } - - instance.renderForPass( 0 ); - instance.setTexture( null ); - Tessellator.instance.setColorOpaque_F( 1, 1, 1 ); - - return; - } - } - } - catch (Throwable t) - { - AELog.error( t ); - - } - - return; - } - } - - private EnumSet calculateFaceOpenFaces(IBlockAccess blockAccess, IFacadeContainer fc, int x, int y, int z, ForgeDirection side) - { - EnumSet out = EnumSet.of( side, side.getOpposite() ); - IFacadePart facade = fc.getFacade( side ); - - for (ForgeDirection it : ForgeDirection.VALID_DIRECTIONS) - { - if ( !out.contains( it ) && alphaDiff( blockAccess.getTileEntity( x + it.offsetX, y + it.offsetY, z + it.offsetZ ), side, facade ) ) - { - out.add( it ); - } - } - - if ( out.contains( ForgeDirection.UP ) && (side.offsetX != 0 || side.offsetZ != 0) ) - { - IFacadePart fp = fc.getFacade( ForgeDirection.UP ); - if ( fp != null && (fp.isTransparent() == facade.isTransparent()) ) - out.remove( ForgeDirection.UP ); - } - - if ( out.contains( ForgeDirection.DOWN ) && (side.offsetX != 0 || side.offsetZ != 0) ) - { - IFacadePart fp = fc.getFacade( ForgeDirection.DOWN ); - if ( fp != null && (fp.isTransparent() == facade.isTransparent()) ) - out.remove( ForgeDirection.DOWN ); - } - - if ( out.contains( ForgeDirection.SOUTH ) && (side.offsetX != 0) ) - { - IFacadePart fp = fc.getFacade( ForgeDirection.SOUTH ); - if ( fp != null && (fp.isTransparent() == facade.isTransparent()) ) - out.remove( ForgeDirection.SOUTH ); - } - - if ( out.contains( ForgeDirection.NORTH ) && (side.offsetX != 0) ) - { - IFacadePart fp = fc.getFacade( ForgeDirection.NORTH ); - if ( fp != null && (fp.isTransparent() == facade.isTransparent()) ) - out.remove( ForgeDirection.NORTH ); - } - - return out; - } - - private boolean alphaDiff(TileEntity tileEntity, ForgeDirection side, IFacadePart facade) - { - if ( tileEntity instanceof IPartHost ) - { - IPartHost ph = (IPartHost) tileEntity; - IFacadePart fp = ph.getFacadeContainer().getFacade( side ); - - return fp == null || (fp.isTransparent() != facade.isTransparent()); - } - - return true; - } - - @SideOnly(Side.CLIENT) - private void renderSegmentBlockCurrentBounds(BusRenderHelper instance, int x, int y, int z, RenderBlocks renderer, double minX, double minY, double minZ, - double maxX, double maxY, double maxZ) - { - double oldMinX = renderer.renderMinX; - double oldMinY = renderer.renderMinY; - double oldMinZ = renderer.renderMinZ; - double oldMaxX = renderer.renderMaxX; - double oldMaxY = renderer.renderMaxY; - double oldMaxZ = renderer.renderMaxZ; - - renderer.renderMinX = Math.max( renderer.renderMinX, minX ); - renderer.renderMinY = Math.max( renderer.renderMinY, minY ); - renderer.renderMinZ = Math.max( renderer.renderMinZ, minZ ); - renderer.renderMaxX = Math.min( renderer.renderMaxX, maxX ); - renderer.renderMaxY = Math.min( renderer.renderMaxY, maxY ); - renderer.renderMaxZ = Math.min( renderer.renderMaxZ, maxZ ); - - // don't draw it if its not at least a pixel wide... - if ( renderer.renderMaxX - renderer.renderMinX >= 1.0 / 16.0 && renderer.renderMaxY - renderer.renderMinY >= 1.0 / 16.0 - && renderer.renderMaxZ - renderer.renderMinZ >= 1.0 / 16.0 ) - { - instance.renderBlockCurrentBounds( x, y, z, renderer ); - } - - renderer.renderMinX = oldMinX; - renderer.renderMinY = oldMinY; - renderer.renderMinZ = oldMinZ; - renderer.renderMaxX = oldMaxX; - renderer.renderMaxY = oldMaxY; - renderer.renderMaxZ = oldMaxZ; - } - - @Override - @SideOnly(Side.CLIENT) - public void renderInventory(IPartRenderHelper instance, RenderBlocks renderer) - { - if ( facade != null ) - { - IFacadeItem fi = (IFacadeItem) facade.getItem(); - - try - { - ItemStack randomItem = fi.getTextureItem( facade ); - - instance.setTexture( 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( side.ordinal(), ib.getMetadata( randomItem.getItemDamage() ) ) ); - - instance.setBounds( 0, 0, 14, 16, 16, 16 ); - instance.renderInventoryBox( renderer ); - - instance.setTexture( null ); - - return; - } - } - } - catch (Throwable t) - { - - } - - return; - } - } - - @Override - public ForgeDirection getSide() - { - return side; - } - - public int getFacadeThickness() - { - return thickness; - } - - @Override - public AxisAlignedBB getPrimaryBox() - { - return Platform.getPrimaryBox( side, getFacadeThickness() ); - } - - @Override - public Item getItem() - { - ItemStack is = getTexture(); - if ( is == null ) - return null; - return is.getItem(); - } - - @Override - public int getItemDamage() - { - ItemStack is = getTexture(); - if ( is == null ) - return 0; - return is.getItemDamage(); - } - - @Override - public boolean isBC() - { - return !(facade.getItem() instanceof IFacadeItem); - } - - @Override - public void setThinFacades(boolean useThinFacades) - { - thickness = useThinFacades ? 1 : 2; - } - - @Override - public boolean isTransparent() - { - if ( AEApi.instance().partHelper().getCableRenderMode().transparentFacades ) - return true; - - ItemStack is = getTexture(); - Block blk = Block.getBlockFromItem( is.getItem() ); - if ( !blk.isOpaqueCube() ) - return true; - - return false; - } - -} +package appeng.facade; + +import java.util.EnumSet; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraftforge.common.util.ForgeDirection; + +import org.lwjgl.opengl.GL11; + +import appeng.api.AEApi; +import appeng.api.parts.IBoxProvider; +import appeng.api.parts.IFacadeContainer; +import appeng.api.parts.IFacadePart; +import appeng.api.parts.IPartCollsionHelper; +import appeng.api.parts.IPartHost; +import appeng.api.parts.IPartRenderHelper; +import appeng.api.parts.ISimplifiedBundle; +import appeng.client.render.BusRenderHelper; +import appeng.client.render.RenderBlocksWorkaround; +import appeng.core.AELog; +import appeng.core.AppEng; +import appeng.integration.IntegrationType; +import appeng.integration.abstraction.IBC; +import appeng.util.Platform; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class FacadePart implements IFacadePart, IBoxProvider +{ + + public final ItemStack facade; + public final ForgeDirection side; + public int thickness = 2; + + @SideOnly(Side.CLIENT) + ISimplifiedBundle prevLight; + + public FacadePart(ItemStack facade, ForgeDirection side) { + if ( facade == null ) + throw new RuntimeException( "Facade Part constructed on null item." ); + this.facade = facade.copy(); + this.facade.stackSize = 1; + this.side = side; + } + + @Override + public ItemStack getItemStack() + { + return facade; + } + + @Override + public void getBoxes(IPartCollsionHelper ch, Entity e) + { + if ( e instanceof EntityLivingBase ) + { + // prevent weird snagg behavior + ch.addBox( 0.0, 0.0, 14, 16.0, 16.0, 16.0 ); + } + else + { + // the box is 15.9 for transition planes to pick up collision events. + ch.addBox( 0.0, 0.0, 14, 16.0, 16.0, 15.9 ); + } + } + + @Override + public void getBoxes(IPartCollsionHelper bch) + { + getBoxes( bch, null ); + + } + + public static boolean isFacade(ItemStack is) + { + if ( is.getItem() instanceof IFacadeItem ) + return true; + return false; + } + + ItemStack getTexture() + { + if ( facade.getItem() instanceof IFacadeItem ) + { + IFacadeItem fi = (IFacadeItem) facade.getItem(); + return fi.getTextureItem( facade ); + } + else if ( AppEng.instance.isIntegrationEnabled( IntegrationType.BC ) ) + { + IBC bc = (IBC) AppEng.instance.getIntegration( IntegrationType.BC ); + return bc.getTextureForFacade( facade ); + } + return null; + } + + @Override + @SideOnly(Side.CLIENT) + public void renderStatic(int x, int y, int z, IPartRenderHelper instance2, RenderBlocks renderer, IFacadeContainer fc, AxisAlignedBB busBounds, + boolean renderStilt) + { + if ( facade != null ) + { + BusRenderHelper instance = (BusRenderHelper) instance2; + + try + { + ItemStack randomItem = getTexture(); + + RenderBlocksWorkaround rbw = null; + if ( renderer instanceof RenderBlocksWorkaround ) + { + rbw = (RenderBlocksWorkaround) renderer; + } + + if ( renderStilt && busBounds == null ) + { + if ( rbw != null ) + { + rbw.isFacade = false; + rbw.calculations = true; + } + + IIcon myIcon = null; + if ( isBC() ) + { + IBC bc = (IBC) AppEng.instance.getIntegration( IntegrationType.BC ); + myIcon = bc.getFacadeTexture(); + } + + if ( myIcon == null ) + myIcon = facade.getIconIndex(); + + instance.setTexture( myIcon ); + + if ( isBC() ) + instance.setBounds( 6, 6, 10, 10, 10, 15 ); + else + instance.setBounds( 7, 7, 10, 9, 9, 15 ); + + instance.renderBlock( x, y, z, renderer ); + instance.setTexture( null ); + + } + + if ( randomItem != null ) + { + if ( randomItem.getItem() instanceof ItemBlock ) + { + ItemBlock ib = (ItemBlock) randomItem.getItem(); + Block blk = Block.getBlockFromItem( ib ); + + if ( AEApi.instance().partHelper().getCableRenderMode().transparentFacades ) + { + if ( rbw != null ) + rbw.opacity = 0.3f; + instance.renderForPass( 1 ); + } + else + { + if ( blk.canRenderInPass( 1 ) ) + { + instance.renderForPass( 1 ); + } + } + + int color = 0xffffff; + + try + { + color = ib.getColorFromItemStack( randomItem, 0 ); + } + catch (Throwable error) + { + } + + renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; + instance.setBounds( 0, 0, 16 - getFacadeThickness(), 16, 16, 16 ); + instance.prepareBounds( renderer ); + + if ( rbw != null ) + { + rbw.isFacade = true; + + rbw.calculations = true; + rbw.faces = EnumSet.noneOf( ForgeDirection.class ); + + if ( prevLight != null && rbw.similarLighting( blk, rbw.blockAccess, x, y, z, prevLight ) ) + rbw.populate( prevLight ); + else + { + instance.setRenderColor( color ); + rbw.renderStandardBlock( instance.getBlock(), x, y, z ); + instance.setRenderColor( 0xffffff ); + prevLight = rbw.getLightingCache(); + } + + rbw.calculations = false; + rbw.faces = calculateFaceOpenFaces( rbw.blockAccess, fc, x, y, z, side ); + + ((RenderBlocksWorkaround) renderer).setTexture( + blk.getIcon( ForgeDirection.DOWN.ordinal(), ib.getMetadata( randomItem.getItemDamage() ) ), + blk.getIcon( ForgeDirection.UP.ordinal(), ib.getMetadata( randomItem.getItemDamage() ) ), + blk.getIcon( ForgeDirection.NORTH.ordinal(), ib.getMetadata( randomItem.getItemDamage() ) ), + blk.getIcon( ForgeDirection.SOUTH.ordinal(), ib.getMetadata( randomItem.getItemDamage() ) ), + blk.getIcon( ForgeDirection.WEST.ordinal(), ib.getMetadata( randomItem.getItemDamage() ) ), + blk.getIcon( ForgeDirection.EAST.ordinal(), ib.getMetadata( randomItem.getItemDamage() ) ) ); + } + else + { + instance.setTexture( blk.getIcon( ForgeDirection.DOWN.ordinal(), ib.getMetadata( randomItem.getItemDamage() ) ), + blk.getIcon( ForgeDirection.UP.ordinal(), ib.getMetadata( randomItem.getItemDamage() ) ), + blk.getIcon( ForgeDirection.NORTH.ordinal(), ib.getMetadata( randomItem.getItemDamage() ) ), + blk.getIcon( ForgeDirection.SOUTH.ordinal(), ib.getMetadata( randomItem.getItemDamage() ) ), + blk.getIcon( ForgeDirection.WEST.ordinal(), ib.getMetadata( randomItem.getItemDamage() ) ), + blk.getIcon( ForgeDirection.EAST.ordinal(), ib.getMetadata( randomItem.getItemDamage() ) ) ); + } + + if ( busBounds == null ) + { + if ( side == ForgeDirection.UP || side == ForgeDirection.DOWN ) + { + instance.renderBlockCurrentBounds( x, y, z, renderer ); + } + else if ( side == ForgeDirection.NORTH || side == ForgeDirection.SOUTH ) + { + if ( fc.getFacade( ForgeDirection.UP ) != null ) + renderer.renderMaxY -= getFacadeThickness() / 16.0; + + if ( fc.getFacade( ForgeDirection.DOWN ) != null ) + renderer.renderMinY += getFacadeThickness() / 16.0; + + instance.renderBlockCurrentBounds( x, y, z, renderer ); + } + else + { + if ( fc.getFacade( ForgeDirection.UP ) != null ) + renderer.renderMaxY -= getFacadeThickness() / 16.0; + + if ( fc.getFacade( ForgeDirection.DOWN ) != null ) + renderer.renderMinY += getFacadeThickness() / 16.0; + + if ( fc.getFacade( ForgeDirection.SOUTH ) != null ) + renderer.renderMaxZ -= getFacadeThickness() / 16.0; + + if ( fc.getFacade( ForgeDirection.NORTH ) != null ) + renderer.renderMinZ += getFacadeThickness() / 16.0; + + instance.renderBlockCurrentBounds( x, y, z, renderer ); + } + } + else + { + if ( side == ForgeDirection.UP || side == ForgeDirection.DOWN ) + { + renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, 0.0, 0.0, busBounds.maxZ, 1.0, 1.0, 1.0 ); + renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, 0.0, 0.0, 0.0, 1.0, 1.0, busBounds.minZ ); + renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, 0.0, 0.0, busBounds.minZ, busBounds.minX, 1.0, busBounds.maxZ ); + renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, busBounds.maxX, 0.0, busBounds.minZ, 1.0, 1.0, busBounds.maxZ ); + } + else if ( side == ForgeDirection.NORTH || side == ForgeDirection.SOUTH ) + { + if ( fc.getFacade( ForgeDirection.UP ) != null ) + renderer.renderMaxY -= getFacadeThickness() / 16.0; + + if ( fc.getFacade( ForgeDirection.DOWN ) != null ) + renderer.renderMinY += getFacadeThickness() / 16.0; + + renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, busBounds.maxX, 0.0, 0.0, 1.0, 1.0, 1.0 ); + renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, 0.0, 0.0, 0.0, busBounds.minX, 1.0, 1.0 ); + renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, busBounds.minX, 0.0, 0.0, busBounds.maxX, busBounds.minY, 1.0 ); + renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, busBounds.minX, busBounds.maxY, 0.0, busBounds.maxX, 1.0, 1.0 ); + } + else + { + if ( fc.getFacade( ForgeDirection.UP ) != null ) + renderer.renderMaxY -= getFacadeThickness() / 16.0; + + if ( fc.getFacade( ForgeDirection.DOWN ) != null ) + renderer.renderMinY += getFacadeThickness() / 16.0; + + if ( fc.getFacade( ForgeDirection.SOUTH ) != null ) + renderer.renderMaxZ -= getFacadeThickness() / 16.0; + + if ( fc.getFacade( ForgeDirection.NORTH ) != null ) + renderer.renderMinZ += getFacadeThickness() / 16.0; + + renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, 0.0, 0.0, busBounds.maxZ, 1.0, 1.0, 1.0 ); + renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, 0.0, 0.0, 0.0, 1.0, 1.0, busBounds.minZ ); + renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, 0.0, 0.0, busBounds.minZ, 1.0, busBounds.minY, busBounds.maxZ ); + renderSegmentBlockCurrentBounds( instance, x, y, z, renderer, 0.0, busBounds.maxY, busBounds.minZ, 1.0, 1.0, busBounds.maxZ ); + } + } + + if ( rbw != null ) + { + rbw.opacity = 1.0f; + rbw.faces = EnumSet.allOf( ForgeDirection.class ); + } + + instance.renderForPass( 0 ); + instance.setTexture( null ); + Tessellator.instance.setColorOpaque_F( 1, 1, 1 ); + + return; + } + } + } + catch (Throwable t) + { + AELog.error( t ); + + } + + return; + } + } + + private EnumSet calculateFaceOpenFaces(IBlockAccess blockAccess, IFacadeContainer fc, int x, int y, int z, ForgeDirection side) + { + EnumSet out = EnumSet.of( side, side.getOpposite() ); + IFacadePart facade = fc.getFacade( side ); + + for (ForgeDirection it : ForgeDirection.VALID_DIRECTIONS) + { + if ( !out.contains( it ) && alphaDiff( blockAccess.getTileEntity( x + it.offsetX, y + it.offsetY, z + it.offsetZ ), side, facade ) ) + { + out.add( it ); + } + } + + if ( out.contains( ForgeDirection.UP ) && (side.offsetX != 0 || side.offsetZ != 0) ) + { + IFacadePart fp = fc.getFacade( ForgeDirection.UP ); + if ( fp != null && (fp.isTransparent() == facade.isTransparent()) ) + out.remove( ForgeDirection.UP ); + } + + if ( out.contains( ForgeDirection.DOWN ) && (side.offsetX != 0 || side.offsetZ != 0) ) + { + IFacadePart fp = fc.getFacade( ForgeDirection.DOWN ); + if ( fp != null && (fp.isTransparent() == facade.isTransparent()) ) + out.remove( ForgeDirection.DOWN ); + } + + if ( out.contains( ForgeDirection.SOUTH ) && (side.offsetX != 0) ) + { + IFacadePart fp = fc.getFacade( ForgeDirection.SOUTH ); + if ( fp != null && (fp.isTransparent() == facade.isTransparent()) ) + out.remove( ForgeDirection.SOUTH ); + } + + if ( out.contains( ForgeDirection.NORTH ) && (side.offsetX != 0) ) + { + IFacadePart fp = fc.getFacade( ForgeDirection.NORTH ); + if ( fp != null && (fp.isTransparent() == facade.isTransparent()) ) + out.remove( ForgeDirection.NORTH ); + } + + /* + * if ( out.contains( ForgeDirection.EAST ) && (side.offsetZ != 0) ) { IFacadePart fp = fc.getFacade( + * ForgeDirection.EAST ); if ( fp != null && (fp.isTransparent() == facade.isTransparent()) ) out.remove( + * ForgeDirection.EAST ); } + * + * if ( out.contains( ForgeDirection.WEST ) && (side.offsetZ != 0) ) { IFacadePart fp = fc.getFacade( + * ForgeDirection.WEST ); if ( fp != null && (fp.isTransparent() == facade.isTransparent()) ) out.remove( + * ForgeDirection.WEST ); } + * + * if ( out.contains( ForgeDirection.NORTH ) && (side.offsetY != 0) ) { IFacadePart fp = fc.getFacade( + * ForgeDirection.NORTH ); if ( fp != null && (fp.isTransparent() == facade.isTransparent()) ) out.remove( + * ForgeDirection.NORTH ); } + * + * if ( out.contains( ForgeDirection.SOUTH ) && (side.offsetY != 0) ) { IFacadePart fp = fc.getFacade( + * ForgeDirection.SOUTH ); if ( fp != null && (fp.isTransparent() == facade.isTransparent()) ) out.remove( + * ForgeDirection.SOUTH ); } + * + * if ( out.contains( ForgeDirection.EAST ) && (side.offsetY != 0) ) { IFacadePart fp = fc.getFacade( + * ForgeDirection.EAST ); if ( fp != null && (fp.isTransparent() == facade.isTransparent()) ) out.remove( + * ForgeDirection.EAST ); } + * + * if ( out.contains( ForgeDirection.WEST ) && (side.offsetY != 0) ) { IFacadePart fp = fc.getFacade( + * ForgeDirection.WEST ); if ( fp != null && (fp.isTransparent() == facade.isTransparent()) ) out.remove( + * ForgeDirection.WEST ); } + */ + return out; + } + + private boolean alphaDiff(TileEntity tileEntity, ForgeDirection side, IFacadePart facade) + { + if ( tileEntity instanceof IPartHost ) + { + IPartHost ph = (IPartHost) tileEntity; + IFacadePart fp = ph.getFacadeContainer().getFacade( side ); + + return fp == null || (fp.isTransparent() != facade.isTransparent()); + } + + return true; + } + + @SideOnly(Side.CLIENT) + private void renderSegmentBlockCurrentBounds(BusRenderHelper instance, int x, int y, int z, RenderBlocks renderer, double minX, double minY, double minZ, + double maxX, double maxY, double maxZ) + { + double oldMinX = renderer.renderMinX; + double oldMinY = renderer.renderMinY; + double oldMinZ = renderer.renderMinZ; + double oldMaxX = renderer.renderMaxX; + double oldMaxY = renderer.renderMaxY; + double oldMaxZ = renderer.renderMaxZ; + + renderer.renderMinX = Math.max( renderer.renderMinX, minX ); + renderer.renderMinY = Math.max( renderer.renderMinY, minY ); + renderer.renderMinZ = Math.max( renderer.renderMinZ, minZ ); + renderer.renderMaxX = Math.min( renderer.renderMaxX, maxX ); + renderer.renderMaxY = Math.min( renderer.renderMaxY, maxY ); + renderer.renderMaxZ = Math.min( renderer.renderMaxZ, maxZ ); + + // don't draw it if its not at least a pixel wide... + if ( renderer.renderMaxX - renderer.renderMinX >= 1.0 / 16.0 && renderer.renderMaxY - renderer.renderMinY >= 1.0 / 16.0 + && renderer.renderMaxZ - renderer.renderMinZ >= 1.0 / 16.0 ) + { + instance.renderBlockCurrentBounds( x, y, z, renderer ); + } + + renderer.renderMinX = oldMinX; + renderer.renderMinY = oldMinY; + renderer.renderMinZ = oldMinZ; + renderer.renderMaxX = oldMaxX; + renderer.renderMaxY = oldMaxY; + renderer.renderMaxZ = oldMaxZ; + } + + @Override + @SideOnly(Side.CLIENT) + public void renderInventory(IPartRenderHelper instance, RenderBlocks renderer) + { + if ( facade != null ) + { + IFacadeItem fi = (IFacadeItem) facade.getItem(); + + try + { + ItemStack randomItem = fi.getTextureItem( facade ); + + instance.setTexture( 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( side.ordinal(), ib.getMetadata( randomItem.getItemDamage() ) ) ); + + instance.setBounds( 0, 0, 14, 16, 16, 16 ); + instance.renderInventoryBox( renderer ); + + instance.setTexture( null ); + + return; + } + } + } + catch (Throwable t) + { + + } + + return; + } + } + + @Override + public ForgeDirection getSide() + { + return side; + } + + public int getFacadeThickness() + { + return thickness; + } + + @Override + public AxisAlignedBB getPrimaryBox() + { + return Platform.getPrimaryBox( side, getFacadeThickness() ); + } + + @Override + public Item getItem() + { + ItemStack is = getTexture(); + if ( is == null ) + return null; + return is.getItem(); + } + + @Override + public int getItemDamage() + { + ItemStack is = getTexture(); + if ( is == null ) + return 0; + return is.getItemDamage(); + } + + @Override + public boolean isBC() + { + return !(facade.getItem() instanceof IFacadeItem); + } + + @Override + public void setThinFacades(boolean useThinFacades) + { + thickness = useThinFacades ? 1 : 2; + } + + @Override + public boolean isTransparent() + { + if ( AEApi.instance().partHelper().getCableRenderMode().transparentFacades ) + return true; + + ItemStack is = getTexture(); + Block blk = Block.getBlockFromItem( is.getItem() ); + if ( !blk.isOpaqueCube() ) + return true; + + return false; + } + +} diff --git a/fmp/FMPEvent.java b/fmp/FMPEvent.java index 07ac5743..40750b1c 100644 --- a/fmp/FMPEvent.java +++ b/fmp/FMPEvent.java @@ -72,7 +72,7 @@ public class FMPEvent if ( held.getItem() instanceof AEBaseItemBlock ) { AEBaseItemBlock ib = (AEBaseItemBlock) held.getItem(); - blk = Block.getBlockFromItem(ib); + blk = Block.getBlockFromItem( ib ); part = PartRegistry.getPartByBlock( blk, hit.sideHit ); } @@ -88,9 +88,9 @@ public class FMPEvent && block.onBlockActivated( world, hit.blockX, hit.blockY, hit.blockZ, player, hit.sideHit, (float) f.x, (float) f.y, (float) f.z ) ) { player.swingItem(); - PacketCustom.sendToServer(new C08PacketPlayerBlockPlacement( hit.blockX, hit.blockY, hit.blockZ, hit.sideHit, player.inventory.getCurrentItem(), (float) f.x, - (float) f.y, (float) f.z ) ); - return false; + PacketCustom.sendToServer( new C08PacketPlayerBlockPlacement( hit.blockX, hit.blockY, hit.blockZ, hit.sideHit, player.inventory + .getCurrentItem(), (float) f.x, (float) f.y, (float) f.z ) ); + return true; } } diff --git a/integration/modules/RF.java b/integration/modules/RF.java index ed080f28..d0b7536d 100644 --- a/integration/modules/RF.java +++ b/integration/modules/RF.java @@ -4,7 +4,6 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; import appeng.api.AEApi; import appeng.api.config.TunnelType; -import appeng.api.features.IP2PTunnelRegistry; import appeng.integration.BaseModule; import appeng.integration.IIntegrationModule; import cpw.mods.fml.common.registry.GameRegistry; @@ -22,30 +21,32 @@ public class RF extends BaseModule implements IIntegrationModule @Override public void Init() { - IP2PTunnelRegistry reg = AEApi.instance().registries().p2pTunnel(); + } - ItemStack energyPipe = GameRegistry.findItemStack( "ExtraUtilities", "extractor_base", 1 ); - if ( energyPipe != null ) + void RFStack(String mod, String name, int dmg) + { + ItemStack modItem = GameRegistry.findItemStack( mod, name, 1 ); + if ( modItem != null ) { - energyPipe.setItemDamage( 12 ); - reg.addNewAttunement( energyPipe, TunnelType.RF_POWER ); + modItem.setItemDamage( dmg ); + AEApi.instance().registries().p2pTunnel().addNewAttunement( modItem, TunnelType.RF_POWER ); } - - ItemStack energyConduit = GameRegistry.findItemStack( "EnderIO", "itemPowerConduit", 1 ); - if ( energyConduit != null ) - { - energyConduit.setItemDamage( OreDictionary.WILDCARD_VALUE ); - reg.addNewAttunement( energyConduit, TunnelType.RF_POWER ); - } - - reg.addNewAttunement( GameRegistry.findItemStack( "EnderIO", "blockCapacitorBank", 1 ), TunnelType.RF_POWER ); - reg.addNewAttunement( GameRegistry.findItemStack( "EnderIO", "blockPowerMonitor", 1 ), TunnelType.RF_POWER ); } @Override public void PostInit() { + RFStack( "ExtraUtilities", "extractor_base", 12 ); + RFStack( "ExtraUtilities", "pipes", 11 ); + RFStack( "ExtraUtilities", "pipes", 14 ); + RFStack( "ExtraUtilities", "generator", OreDictionary.WILDCARD_VALUE ); + RFStack( "ThermalExpansion", "Cell", OreDictionary.WILDCARD_VALUE ); + RFStack( "ThermalExpansion", "Dynamo", OreDictionary.WILDCARD_VALUE ); + + RFStack( "EnderIO", "itemPowerConduit", OreDictionary.WILDCARD_VALUE ); + RFStack( "EnderIO", "blockCapacitorBank", 0 ); + RFStack( "EnderIO", "blockPowerMonitor", 0 ); } } diff --git a/parts/p2p/PartP2PTunnel.java b/parts/p2p/PartP2PTunnel.java index b207a04d..b77f9ade 100644 --- a/parts/p2p/PartP2PTunnel.java +++ b/parts/p2p/PartP2PTunnel.java @@ -70,6 +70,9 @@ public class PartP2PTunnel extends PartBasicState { ItemStack is = player.inventory.getCurrentItem(); + // UniqueIdentifier id = GameRegistry.findUniqueIdentifierFor( is.getItem() ); + // AELog.info( "ID:" + id.toString() + " : " + is.getItemDamage() ); + TunnelType tt = AEApi.instance().registries().p2pTunnel().getTunnelTypeByItem( is ); if ( is != null && is.getItem() instanceof IMemoryCard ) { diff --git a/tile/misc/TileCharger.java b/tile/misc/TileCharger.java index 638ea831..e93b27e1 100644 --- a/tile/misc/TileCharger.java +++ b/tile/misc/TileCharger.java @@ -17,7 +17,6 @@ import appeng.api.config.PowerMultiplier; import appeng.api.config.PowerUnits; import appeng.api.implementations.items.IAEItemPowerStorage; import appeng.api.implementations.tiles.ICrankable; -import appeng.api.networking.GridFlags; import appeng.api.storage.data.IAEItemStack; import appeng.api.util.AECableType; import appeng.me.GridAccessException; @@ -141,7 +140,7 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable public TileCharger() { gridProxy.setValidSides( EnumSet.noneOf( ForgeDirection.class ) ); - gridProxy.setFlags( GridFlags.CANNOT_CARRY ); + gridProxy.setFlags(); internalMaxPower = 1500; gridProxy.setIdlePowerUsage( 0 ); addNewHandler( new TileChargerHandler() ); diff --git a/tile/misc/TileQuartzGrowthAccelerator.java b/tile/misc/TileQuartzGrowthAccelerator.java index 3d1c0971..c20aa1d5 100644 --- a/tile/misc/TileQuartzGrowthAccelerator.java +++ b/tile/misc/TileQuartzGrowthAccelerator.java @@ -7,7 +7,6 @@ import java.util.EnumSet; import net.minecraftforge.common.util.ForgeDirection; import appeng.api.implementations.IPowerChannelState; -import appeng.api.networking.GridFlags; import appeng.api.networking.events.MENetworkEventSubscribe; import appeng.api.networking.events.MENetworkPowerStatusChange; import appeng.api.util.AECableType; @@ -66,7 +65,7 @@ public class TileQuartzGrowthAccelerator extends AENetworkTile implements IPower public TileQuartzGrowthAccelerator() { gridProxy.setValidSides( EnumSet.noneOf( ForgeDirection.class ) ); - gridProxy.setFlags( GridFlags.CANNOT_CARRY ); + gridProxy.setFlags(); gridProxy.setIdlePowerUsage( 8 ); addNewHandler( new TileChargerHandler() ); } diff --git a/tile/misc/TileVibrationChamber.java b/tile/misc/TileVibrationChamber.java index 76131c29..b34b6af9 100644 --- a/tile/misc/TileVibrationChamber.java +++ b/tile/misc/TileVibrationChamber.java @@ -10,7 +10,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntityFurnace; import net.minecraftforge.common.util.ForgeDirection; import appeng.api.config.Actionable; -import appeng.api.networking.GridFlags; import appeng.api.networking.IGridNode; import appeng.api.networking.energy.IEnergyGrid; import appeng.api.networking.ticking.IGridTickable; @@ -88,7 +87,7 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka public TileVibrationChamber() { gridProxy.setIdlePowerUsage( 0 ); - gridProxy.setFlags( GridFlags.CANNOT_CARRY ); + gridProxy.setFlags(); addNewHandler( new TileVibrationChamberHandler() ); }