Removed Purify Crafting Handler.

Added Crystal Growth ( for Nether, Certus, and Fluix. )
Added Macerator Crafting Handler.
Added Pulverizer Crafting Handler.
Implemented Grid Crafting Handler.
Formation Planes now eject items in a more consistent manner.
Formation Planes can now place, or eject into replaceable blocks ( air/grass/fluids )
This commit is contained in:
AlgorithmX2
2014-02-23 00:55:46 -06:00
parent 8b3071553d
commit 15f300c553
13 changed files with 314 additions and 106 deletions
+37 -2
View File
@@ -5,9 +5,11 @@ import net.minecraft.block.material.Material;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import appeng.api.implementations.items.IGrowableCrystal;
import appeng.tile.misc.TileQuartzGrowthAccelerator;
import appeng.util.Platform;
final public class EntityGrowingCrystal extends EntityItem
@@ -32,6 +34,7 @@ final public class EntityGrowingCrystal extends EntityItem
public void onUpdate()
{
super.onUpdate();
age = 0;
if ( Platform.isClient() )
return;
@@ -52,9 +55,10 @@ final public class EntityGrowingCrystal extends EntityItem
float multiplier = cry.getMultiplier( blk, mat );
if ( Platform.isServer() && mat.isLiquid() )
{
progress_1000 += Math.min( 1, getSpeed( j, i, k ) * multiplier );
progress_1000 += Math.max( 1, getSpeed( j, i, k ) * multiplier );
if ( progress_1000 > 1000 )
{
progress_1000 -= 1000;
setEntityItemStack( cry.triggerGrowth( is ) );
}
}
@@ -65,7 +69,38 @@ final public class EntityGrowingCrystal extends EntityItem
private int getSpeed(int x, int y, int z)
{
return 10;
final int per = 80;
final float mul = 0.3f;
int qty = 0;
if ( isAccel( x + 1, y, z ) )
qty += per + qty * mul;
if ( isAccel( x, y + 1, z ) )
qty += per + qty * mul;
if ( isAccel( x, y, z + 1 ) )
qty += per + qty * mul;
if ( isAccel( x - 1, y, z ) )
qty += per + qty * mul;
if ( isAccel( x, y - 1, z ) )
qty += per + qty * mul;
if ( isAccel( x, y, z - 1 ) )
qty += per + qty * mul;
return qty;
}
private boolean isAccel(int x, int y, int z)
{
TileEntity te = worldObj.getTileEntity( x, y, z );
if ( te instanceof TileQuartzGrowthAccelerator )
return ((TileQuartzGrowthAccelerator) te).isPowered();
return false;
}
}