Err too much.
This commit is contained in:
@@ -27,6 +27,7 @@ import appeng.api.implementations.IMemoryCard;
|
||||
import appeng.api.implementations.MemoryCardMessages;
|
||||
import appeng.api.util.IOrientable;
|
||||
import appeng.api.util.IOrientableBlock;
|
||||
import appeng.block.networking.BlockCableBus;
|
||||
import appeng.client.render.BaseBlockRender;
|
||||
import appeng.client.render.BlockRenderInfo;
|
||||
import appeng.client.render.WorldRender;
|
||||
@@ -631,7 +632,7 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( is.getItem() instanceof IMemoryCard )
|
||||
if ( is.getItem() instanceof IMemoryCard && !(this instanceof BlockCableBus) )
|
||||
{
|
||||
IMemoryCard memc = (IMemoryCard) is.getItem();
|
||||
if ( player.isSneaking() )
|
||||
|
||||
@@ -11,6 +11,7 @@ import appeng.api.AEApi;
|
||||
import appeng.api.config.AccessRestriction;
|
||||
import appeng.api.config.PowerUnits;
|
||||
import appeng.api.implementations.IAEItemPowerStorage;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public class AEBaseItemBlockChargeable extends AEBaseItemBlock implements IAEItemPowerStorage
|
||||
@@ -34,7 +35,7 @@ public class AEBaseItemBlockChargeable extends AEBaseItemBlock implements IAEIte
|
||||
|
||||
double percent = internalCurrentPower / internalMaxPower;
|
||||
|
||||
lines.add( Platform.gui_localize( "Stored Energy" ) + ":" + MessageFormat.format( " {0,number,#} ", internalCurrentPower )
|
||||
lines.add( GuiText.StoredEnergy.getLocal() + ":" + MessageFormat.format( " {0,number,#} ", internalCurrentPower )
|
||||
+ Platform.gui_localize( PowerUnits.AE.unlocalizedName ) + " - "
|
||||
+ MessageFormat.format( " {0,number,#.##%} ", percent ) );
|
||||
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
package appeng.block.misc;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.core.sync.GuiBridge;
|
||||
import appeng.tile.misc.TileCellWorkbench;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public class BlockCellWorkbench extends AEBaseBlock
|
||||
{
|
||||
|
||||
public BlockCellWorkbench() {
|
||||
super( BlockCellWorkbench.class, Material.iron );
|
||||
setfeature( EnumSet.of( AEFeature.StorageCells ) );
|
||||
setTileEntiy( TileCellWorkbench.class );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onActivated(World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if ( p.isSneaking() )
|
||||
return false;
|
||||
|
||||
TileCellWorkbench tg = getTileEntity( w, x, y, z );
|
||||
if ( tg != null )
|
||||
{
|
||||
if ( Platform.isServer() )
|
||||
Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_CELLWORKBENCH );
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -18,6 +18,7 @@ import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import appeng.api.parts.PartItemStack;
|
||||
import appeng.api.parts.SelectedPart;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.client.render.BaseBlockRender;
|
||||
@@ -25,15 +26,19 @@ import appeng.client.render.blocks.RendererCableBus;
|
||||
import appeng.client.texture.CableBusTextures;
|
||||
import appeng.core.Api;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.core.CommonHelper;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.integration.abstraction.IFMP;
|
||||
import appeng.parts.CableBusContainer;
|
||||
import appeng.parts.ICableBusContainer;
|
||||
import appeng.parts.NullCableBusContainer;
|
||||
import appeng.tile.AEBaseTile;
|
||||
import appeng.tile.networking.TileCableBus;
|
||||
|
||||
public class BlockCableBus extends AEBaseBlock
|
||||
{
|
||||
|
||||
static private ICableBusContainer nullCB = new NullCableBusContainer();
|
||||
|
||||
public BlockCableBus() {
|
||||
super( BlockCableBus.class, Material.glass );
|
||||
setfeature( EnumSet.of( AEFeature.Core ) );
|
||||
@@ -44,14 +49,7 @@ public class BlockCableBus extends AEBaseBlock
|
||||
@Override
|
||||
public boolean isLadder(World world, int x, int y, int z, EntityLivingBase entity)
|
||||
{
|
||||
try
|
||||
{
|
||||
return cb( world, x, y, z ).isLadder( entity );
|
||||
}
|
||||
catch (Throwable t)
|
||||
{
|
||||
}
|
||||
return false;
|
||||
return cb( world, x, y, z ).isLadder( entity );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -70,18 +68,13 @@ public class BlockCableBus extends AEBaseBlock
|
||||
@Override
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random r)
|
||||
{
|
||||
CableBusContainer cb = cb( world, x, y, z );
|
||||
if ( cb != null )
|
||||
cb.randomDisplayTick( world, x, y, z, r );
|
||||
cb( world, x, y, z ).randomDisplayTick( world, x, y, z, r );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLightValue(IBlockAccess world, int x, int y, int z)
|
||||
{
|
||||
CableBusContainer cb = cb( world, x, y, z );
|
||||
if ( cb != null )
|
||||
return cb.getLightValue();
|
||||
return 0;
|
||||
return cb( world, x, y, z ).getLightValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -89,13 +82,12 @@ public class BlockCableBus extends AEBaseBlock
|
||||
{
|
||||
Vec3 v3 = target.hitVec.addVector( -x, -y, -z );
|
||||
SelectedPart sp = cb( world, x, y, z ).selectPart( v3 );
|
||||
if ( sp != null )
|
||||
{
|
||||
if ( sp.part != null )
|
||||
return sp.part.getItemStack( false );
|
||||
if ( sp.facade != null )
|
||||
return sp.facade.getItemStack();
|
||||
}
|
||||
|
||||
if ( sp.part != null )
|
||||
return sp.part.getItemStack( PartItemStack.Break );
|
||||
else if ( sp.facade != null )
|
||||
return sp.facade.getItemStack();
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -130,21 +122,10 @@ public class BlockCableBus extends AEBaseBlock
|
||||
Icon i = super.getIcon( direction, metadata );
|
||||
if ( i != null )
|
||||
return i;
|
||||
|
||||
return CableBusTextures.getMissing();
|
||||
}
|
||||
|
||||
private CableBusContainer cb(IBlockAccess w, int x, int y, int z)
|
||||
{
|
||||
TileEntity te = w.getBlockTileEntity( x, y, z );
|
||||
if ( te instanceof TileCableBus )
|
||||
return ((TileCableBus) te).cb;
|
||||
|
||||
if ( AppEng.instance.isIntegrationEnabled( "FMP" ) )
|
||||
return ((IFMP) AppEng.instance.getIntegration( "FMP" )).getCableContainer( te );
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class<? extends BaseBlockRender> getRenderer()
|
||||
{
|
||||
@@ -234,6 +215,19 @@ public class BlockCableBus extends AEBaseBlock
|
||||
public void setupTile()
|
||||
{
|
||||
setTileEntiy( Api.instance.partHelper.getCombinedInstance( TileCableBus.class.getName() ) );
|
||||
CommonHelper.proxy.bindTileEntitySpecialRenderer( getTileEntityClass(), this );
|
||||
}
|
||||
|
||||
private ICableBusContainer cb(IBlockAccess w, int x, int y, int z)
|
||||
{
|
||||
TileEntity te = w.getBlockTileEntity( x, y, z );
|
||||
if ( te instanceof TileCableBus )
|
||||
return ((TileCableBus) te).cb;
|
||||
|
||||
if ( AppEng.instance.isIntegrationEnabled( "FMP" ) )
|
||||
return ((IFMP) AppEng.instance.getIntegration( "FMP" )).getCableContainer( te );
|
||||
|
||||
return nullCB;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,13 +1,23 @@
|
||||
package appeng.block.qnb;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.particle.EntityFX;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.client.render.BaseBlockRender;
|
||||
import appeng.client.render.blocks.RenderQNB;
|
||||
import appeng.client.render.effects.EnergyFx;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.core.sync.GuiBridge;
|
||||
import appeng.tile.qnb.TileQuantumBridge;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public class BlockQuantumLinkChamber extends AEBaseBlock
|
||||
{
|
||||
@@ -22,10 +32,57 @@ public class BlockQuantumLinkChamber extends AEBaseBlock
|
||||
isFullSize = isOpaque = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void randomDisplayTick(World w, int bx, int by, int bz, Random r)
|
||||
{
|
||||
TileQuantumBridge bridge = getTileEntity( w, bx, by, bz );
|
||||
if ( bridge != null )
|
||||
{
|
||||
if ( bridge.hasQES() )
|
||||
{
|
||||
float x = (float) (((Platform.getRandomInt() % 100) * 0.01) - 0.5) * 0.7f;
|
||||
float y = (float) (((Platform.getRandomInt() % 100) * 0.01) - 0.5) * 0.7f;
|
||||
float z = (float) (((Platform.getRandomInt() % 100) * 0.01) - 0.5) * 0.7f;
|
||||
|
||||
EnergyFx fx = new EnergyFx( w, bx + x + 0.5, by + y + 0.5, bz + z + 0.5, Item.diamond );
|
||||
|
||||
fx.motionX = -x * 0.1;
|
||||
fx.motionY = -y * 0.1;
|
||||
fx.motionZ = -z * 0.1;
|
||||
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect( (EntityFX) fx );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World w, int x, int y, int z, int pointlessnumber)
|
||||
{
|
||||
TileQuantumBridge bridge = getTileEntity( w, x, y, z );
|
||||
if ( bridge != null )
|
||||
bridge.neighborUpdate();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class<? extends BaseBlockRender> getRenderer()
|
||||
{
|
||||
return RenderQNB.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onActivated(World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if ( p.isSneaking() )
|
||||
return false;
|
||||
|
||||
TileQuantumBridge tg = getTileEntity( w, x, y, z );
|
||||
if ( tg != null )
|
||||
{
|
||||
if ( Platform.isServer() )
|
||||
Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_QNB );
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package appeng.block.qnb;
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.world.World;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.client.render.BaseBlockRender;
|
||||
import appeng.client.render.blocks.RenderQNB;
|
||||
@@ -22,6 +23,14 @@ public class BlockQuantumRing extends AEBaseBlock
|
||||
isFullSize = isOpaque = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World w, int x, int y, int z, int pointlessnumber)
|
||||
{
|
||||
TileQuantumBridge bridge = getTileEntity( w, x, y, z );
|
||||
if ( bridge != null )
|
||||
bridge.neighborUpdate();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class<? extends BaseBlockRender> getRenderer()
|
||||
{
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package appeng.block.solids;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import appeng.api.util.IOrientable;
|
||||
import appeng.api.util.IOrientableBlock;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.helpers.LocationRotation;
|
||||
|
||||
public class BlockFluix extends AEBaseBlock implements IOrientableBlock
|
||||
{
|
||||
|
||||
public BlockFluix() {
|
||||
super( BlockFluix.class, Material.rock );
|
||||
setfeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IOrientable getOrientable(final IBlockAccess w, final int x, final int y, final int z)
|
||||
{
|
||||
return new LocationRotation( w, x, y, z );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -11,7 +11,6 @@ import appeng.client.render.BaseBlockRender;
|
||||
import appeng.client.render.blocks.RenderDrive;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.core.sync.GuiBridge;
|
||||
import appeng.tile.misc.TileInterface;
|
||||
import appeng.tile.storage.TileDrive;
|
||||
import appeng.util.Platform;
|
||||
|
||||
@@ -36,7 +35,7 @@ public class BlockDrive extends AEBaseBlock
|
||||
if ( p.isSneaking() )
|
||||
return false;
|
||||
|
||||
TileInterface tg = getTileEntity( w, x, y, z );
|
||||
TileDrive tg = getTileEntity( w, x, y, z );
|
||||
if ( tg != null )
|
||||
{
|
||||
if ( Platform.isServer() )
|
||||
|
||||
@@ -3,9 +3,14 @@ package appeng.block.storage;
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.core.sync.GuiBridge;
|
||||
import appeng.tile.storage.TileIOPort;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public class BlockIOPort extends AEBaseBlock
|
||||
{
|
||||
@@ -16,4 +21,27 @@ public class BlockIOPort extends AEBaseBlock
|
||||
setTileEntiy( TileIOPort.class );
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void onNeighborBlockChange(World w, int x, int y, int z, int junk)
|
||||
{
|
||||
TileIOPort te = getTileEntity( w, x, y, z );
|
||||
if ( te != null )
|
||||
te.updateRedstoneState();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onActivated(World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if ( p.isSneaking() )
|
||||
return false;
|
||||
|
||||
TileIOPort tg = getTileEntity( w, x, y, z );
|
||||
if ( tg != null )
|
||||
{
|
||||
if ( Platform.isServer() )
|
||||
Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_IOPORT );
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user