Merge branch 'master' of https://bitbucket.org/AlgorithmX2/appliedenergistics2 into rv1
This commit is contained in:
commit
87bd8f3c22
8 changed files with 55 additions and 18 deletions
|
@ -187,8 +187,9 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
|
||||||
this( c, mat, null );
|
this( c, mat, null );
|
||||||
setLightOpacity( 15 );
|
setLightOpacity( 15 );
|
||||||
setLightLevel( 0 );
|
setLightLevel( 0 );
|
||||||
setHardness( 1.2F );
|
setHardness( 2.2F );
|
||||||
setTileProvider( false );
|
setTileProvider( false );
|
||||||
|
setHarvestLevel( "pickaxe", 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
// update Block value.
|
// update Block value.
|
||||||
|
|
|
@ -19,6 +19,7 @@ public class BlockGrinder extends AEBaseBlock
|
||||||
super( BlockGrinder.class, Material.rock );
|
super( BlockGrinder.class, Material.rock );
|
||||||
setfeature( EnumSet.of( AEFeature.GrindStone ) );
|
setfeature( EnumSet.of( AEFeature.GrindStone ) );
|
||||||
setTileEntiy( TileGrinder.class );
|
setTileEntiy( TileGrinder.class );
|
||||||
|
setHardness( 3.2F );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -27,7 +28,7 @@ public class BlockGrinder extends AEBaseBlock
|
||||||
TileGrinder tg = getTileEntity( w, x, y, z );
|
TileGrinder tg = getTileEntity( w, x, y, z );
|
||||||
if ( tg != null && !p.isSneaking() )
|
if ( tg != null && !p.isSneaking() )
|
||||||
{
|
{
|
||||||
Platform.openGUI( p, tg, ForgeDirection.getOrientation(side),GuiBridge.GUI_GRINDER );
|
Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_GRINDER );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -25,6 +25,7 @@ public class BlockVibrationChamber extends AEBaseBlock
|
||||||
super( BlockVibrationChamber.class, Material.iron );
|
super( BlockVibrationChamber.class, Material.iron );
|
||||||
setfeature( EnumSet.of( AEFeature.PowerGen ) );
|
setfeature( EnumSet.of( AEFeature.PowerGen ) );
|
||||||
setTileEntiy( TileVibrationChamber.class );
|
setTileEntiy( TileVibrationChamber.class );
|
||||||
|
setHardness( 4.2F );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -46,8 +46,17 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void breakFaster(PlayerEvent.BreakSpeed Ev)
|
public void breakFaster(PlayerEvent.BreakSpeed Ev)
|
||||||
{
|
{
|
||||||
if ( Ev.block == this && (Ev.originalSpeed > 7 || Ev.metadata > 0) )
|
if ( Ev.block == this && Ev.entityPlayer != null )
|
||||||
Ev.newSpeed /= 0.1;
|
{
|
||||||
|
ItemStack is = Ev.entityPlayer.inventory.getCurrentItem();
|
||||||
|
int level = -1;
|
||||||
|
|
||||||
|
if ( is != null )
|
||||||
|
level = is.getItem().getHarvestLevel( is, "pickaxe" );
|
||||||
|
|
||||||
|
if ( Ev.metadata > 0 || level >= 3 || Ev.originalSpeed > 7.0 )
|
||||||
|
Ev.newSpeed /= 0.1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public BlockSkyStone() {
|
public BlockSkyStone() {
|
||||||
|
|
|
@ -274,9 +274,18 @@ public class MeteoritePlacer
|
||||||
{
|
{
|
||||||
boolean lava = Math.random() > 0.9;
|
boolean lava = Math.random() > 0.9;
|
||||||
|
|
||||||
for (int i = x - 30; i < x + 30; i++)
|
int maxY = Math.min( y + 20, 255 );
|
||||||
for (int j = y - 5; j < y + 40; j++)
|
int minX = x - 40;
|
||||||
for (int k = z - 30; k < z + 30; k++)
|
int maxX = x + 40;
|
||||||
|
int minZ = z - 40;
|
||||||
|
int maxZ = z + 40;
|
||||||
|
|
||||||
|
for (int j = y - 5; j < maxY; j++)
|
||||||
|
{
|
||||||
|
boolean changed = false;
|
||||||
|
|
||||||
|
for (int i = minX; i < maxX; i++)
|
||||||
|
for (int k = minZ; k < maxZ; k++)
|
||||||
{
|
{
|
||||||
double dx = i - x;
|
double dx = i - x;
|
||||||
double dz = k - z;
|
double dz = k - z;
|
||||||
|
@ -292,10 +301,22 @@ public class MeteoritePlacer
|
||||||
put( w, i, j, k, Blocks.lava );
|
put( w, i, j, k, Blocks.lava );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
put( w, i, j, k, Platform.air );
|
changed = put( w, i, j, k, Platform.air ) || changed;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( changed && j > maxY - 5 )
|
||||||
|
{
|
||||||
|
maxY = Math.min( maxY + 5, 255 );
|
||||||
|
|
||||||
|
minX -= 7;
|
||||||
|
maxX += 7;
|
||||||
|
|
||||||
|
minZ -= 7;
|
||||||
|
maxZ += 7;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (Object o : w.getEntitiesWithinAABB( EntityItem.class, AxisAlignedBB.getBoundingBox( x - 30, y - 5, z - 30, x + 30, y + 30, z + 30 ) ))
|
for (Object o : w.getEntitiesWithinAABB( EntityItem.class, AxisAlignedBB.getBoundingBox( x - 30, y - 5, z - 30, x + 30, y + 30, z + 30 ) ))
|
||||||
{
|
{
|
||||||
Entity e = (Entity) o;
|
Entity e = (Entity) o;
|
||||||
|
@ -476,12 +497,15 @@ public class MeteoritePlacer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void put(World w, int i, int j, int k, Block blk)
|
private boolean put(World w, int i, int j, int k, Block blk)
|
||||||
{
|
{
|
||||||
if ( w.getBlock( i, j, k ) == Blocks.bedrock )
|
Block original = w.getBlock( i, j, k );
|
||||||
return;
|
|
||||||
|
if ( original == Blocks.bedrock || original == blk )
|
||||||
|
return false;
|
||||||
|
|
||||||
w.setBlock( i, j, k, blk );
|
w.setBlock( i, j, k, blk );
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void put(World w, int i, int j, int k, Block blk, int meta)
|
private void put(World w, int i, int j, int k, Block blk, int meta)
|
||||||
|
|
|
@ -77,12 +77,10 @@ public class TileEnergyAcceptor extends AENetworkPowerTile
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
IEnergyGrid grid = gridProxy.getEnergy();
|
IEnergyGrid grid = gridProxy.getEnergy();
|
||||||
double overFlow = grid.injectPower( newPower, Actionable.SIMULATE );
|
double leftOver = grid.injectPower( newPower, mode );
|
||||||
|
if ( mode == Actionable.SIMULATE )
|
||||||
if ( mode == Actionable.MODULATE )
|
return leftOver;
|
||||||
grid.injectPower( Math.max( 0.0, newPower - overFlow ), Actionable.MODULATE );
|
return 0.0;
|
||||||
|
|
||||||
return super.funnelPowerIntoStorage( overFlow, mode );
|
|
||||||
}
|
}
|
||||||
catch (GridAccessException e)
|
catch (GridAccessException e)
|
||||||
{
|
{
|
||||||
|
|
|
@ -73,7 +73,6 @@ public abstract class IC2 extends MinecraftJoules6 implements IEnergySink
|
||||||
super.setPowerSides( sides );
|
super.setPowerSides( sides );
|
||||||
removeFromENet();
|
removeFromENet();
|
||||||
addToENet();
|
addToENet();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
final private void addToENet()
|
final private void addToENet()
|
||||||
|
|
|
@ -30,6 +30,10 @@ public abstract class MinecraftJoules6 extends MinecraftJoules5 implements IBatt
|
||||||
@Method(iname = "MJ6")
|
@Method(iname = "MJ6")
|
||||||
public double addEnergy(double amount)
|
public double addEnergy(double amount)
|
||||||
{
|
{
|
||||||
|
double demand = getExternalPowerDemand( PowerUnits.MJ, Double.MAX_VALUE );
|
||||||
|
if ( amount > demand )
|
||||||
|
amount = demand;
|
||||||
|
|
||||||
double overflow = injectExternalPower( PowerUnits.MJ, amount );
|
double overflow = injectExternalPower( PowerUnits.MJ, amount );
|
||||||
return amount - overflow;
|
return amount - overflow;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue