Added skystone, skystone block, skystone brick, skystone small brick, certus quartz, certus quartz pillar, chiseled certus quartz and fluix stars
To integrate these into the current system, some changes to the background had to be done, especially to the feature handler. It now uses an interface to work against which you can implement to get your own feature handler instead modifying the base one and add several special cases code
This commit is contained in:
@@ -18,11 +18,14 @@
|
||||
|
||||
package appeng.items.tools.powered;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
import java.util.Hashtable;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockDispenser;
|
||||
import net.minecraft.block.BlockTNT;
|
||||
@@ -39,6 +42,7 @@ import net.minecraft.util.MovingObjectPosition.MovingObjectType;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import appeng.api.util.DimensionalCoord;
|
||||
import appeng.block.misc.BlockTinyTNT;
|
||||
import appeng.core.AEConfig;
|
||||
@@ -49,116 +53,16 @@ import appeng.items.tools.powered.powersink.AEBasePoweredItem;
|
||||
import appeng.util.InWorldToolOperationResult;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockTool
|
||||
{
|
||||
|
||||
static class Combo
|
||||
{
|
||||
|
||||
final public Block blk;
|
||||
final public int meta;
|
||||
|
||||
public Combo(Block b, int m) {
|
||||
blk = b;
|
||||
meta = m;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
return blk.hashCode() ^ meta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
if ( obj == null )
|
||||
return false;
|
||||
if ( getClass() != obj.getClass() )
|
||||
return false;
|
||||
Combo other = (Combo) obj;
|
||||
return blk == other.blk && meta == other.meta;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static private Hashtable<Combo, InWorldToolOperationResult> heatUp;
|
||||
static private Hashtable<Combo, InWorldToolOperationResult> coolDown;
|
||||
|
||||
static public void heat(Block BlockID, int Metadata, World w, int x, int y, int z)
|
||||
public ToolEntropyManipulator()
|
||||
{
|
||||
InWorldToolOperationResult r = heatUp.get( new Combo( BlockID, Metadata ) );
|
||||
|
||||
if ( r == null )
|
||||
{
|
||||
r = heatUp.get( new Combo( BlockID, OreDictionary.WILDCARD_VALUE ) );
|
||||
}
|
||||
|
||||
if ( r.BlockItem != null )
|
||||
{
|
||||
w.setBlock( x, y, z, Block.getBlockFromItem( r.BlockItem.getItem() ), r.BlockItem.getItemDamage(), 3 );
|
||||
}
|
||||
else
|
||||
{
|
||||
w.setBlock( x, y, z, Platform.air, 0, 3 );
|
||||
}
|
||||
|
||||
if ( r.Drops != null )
|
||||
{
|
||||
Platform.spawnDrops( w, x, y, z, r.Drops );
|
||||
}
|
||||
}
|
||||
|
||||
static public boolean canHeat(Block BlockID, int Metadata)
|
||||
{
|
||||
InWorldToolOperationResult r = heatUp.get( new Combo( BlockID, Metadata ) );
|
||||
|
||||
if ( r == null )
|
||||
{
|
||||
r = heatUp.get( new Combo( BlockID, OreDictionary.WILDCARD_VALUE ) );
|
||||
}
|
||||
|
||||
return r != null;
|
||||
}
|
||||
|
||||
static public void cool(Block BlockID, int Metadata, World w, int x, int y, int z)
|
||||
{
|
||||
InWorldToolOperationResult r = coolDown.get( new Combo( BlockID, Metadata ) );
|
||||
|
||||
if ( r == null )
|
||||
{
|
||||
r = coolDown.get( new Combo( BlockID, OreDictionary.WILDCARD_VALUE ) );
|
||||
}
|
||||
|
||||
if ( r.BlockItem != null )
|
||||
{
|
||||
w.setBlock( x, y, z, Block.getBlockFromItem( r.BlockItem.getItem() ), r.BlockItem.getItemDamage(), 3 );
|
||||
}
|
||||
else
|
||||
{
|
||||
w.setBlock( x, y, z, Platform.air, 0, 3 );
|
||||
}
|
||||
|
||||
if ( r.Drops != null )
|
||||
{
|
||||
Platform.spawnDrops( w, x, y, z, r.Drops );
|
||||
}
|
||||
}
|
||||
|
||||
static public boolean canCool(Block BlockID, int Metadata)
|
||||
{
|
||||
InWorldToolOperationResult r = coolDown.get( new Combo( BlockID, Metadata ) );
|
||||
|
||||
if ( r == null )
|
||||
{
|
||||
r = coolDown.get( new Combo( BlockID, OreDictionary.WILDCARD_VALUE ) );
|
||||
}
|
||||
|
||||
return r != null;
|
||||
}
|
||||
|
||||
public ToolEntropyManipulator() {
|
||||
super( ToolEntropyManipulator.class, null );
|
||||
super( ToolEntropyManipulator.class, Optional.<String> absent() );
|
||||
setFeature( EnumSet.of( AEFeature.EntropyManipulator, AEFeature.PoweredTools ) );
|
||||
maxStoredPower = AEConfig.instance.entropyManipulatorBattery;
|
||||
|
||||
@@ -188,8 +92,111 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject( this, new DispenserBlockTool() );
|
||||
}
|
||||
|
||||
static public void heat( Block BlockID, int Metadata, World w, int x, int y, int z )
|
||||
{
|
||||
InWorldToolOperationResult r = heatUp.get( new Combo( BlockID, Metadata ) );
|
||||
|
||||
if ( r == null )
|
||||
{
|
||||
r = heatUp.get( new Combo( BlockID, OreDictionary.WILDCARD_VALUE ) );
|
||||
}
|
||||
|
||||
if ( r.BlockItem != null )
|
||||
{
|
||||
w.setBlock( x, y, z, Block.getBlockFromItem( r.BlockItem.getItem() ), r.BlockItem.getItemDamage(), 3 );
|
||||
}
|
||||
else
|
||||
{
|
||||
w.setBlock( x, y, z, Platform.air, 0, 3 );
|
||||
}
|
||||
|
||||
if ( r.Drops != null )
|
||||
{
|
||||
Platform.spawnDrops( w, x, y, z, r.Drops );
|
||||
}
|
||||
}
|
||||
|
||||
static class Combo
|
||||
{
|
||||
|
||||
final public Block blk;
|
||||
final public int meta;
|
||||
|
||||
public Combo( Block b, int m )
|
||||
{
|
||||
blk = b;
|
||||
meta = m;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
return blk.hashCode() ^ meta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals( Object obj )
|
||||
{
|
||||
if ( obj == null )
|
||||
return false;
|
||||
if ( getClass() != obj.getClass() )
|
||||
return false;
|
||||
Combo other = ( Combo ) obj;
|
||||
return blk == other.blk && meta == other.meta;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static public boolean canHeat( Block BlockID, int Metadata )
|
||||
{
|
||||
InWorldToolOperationResult r = heatUp.get( new Combo( BlockID, Metadata ) );
|
||||
|
||||
if ( r == null )
|
||||
{
|
||||
r = heatUp.get( new Combo( BlockID, OreDictionary.WILDCARD_VALUE ) );
|
||||
}
|
||||
|
||||
return r != null;
|
||||
}
|
||||
|
||||
static public void cool( Block BlockID, int Metadata, World w, int x, int y, int z )
|
||||
{
|
||||
InWorldToolOperationResult r = coolDown.get( new Combo( BlockID, Metadata ) );
|
||||
|
||||
if ( r == null )
|
||||
{
|
||||
r = coolDown.get( new Combo( BlockID, OreDictionary.WILDCARD_VALUE ) );
|
||||
}
|
||||
|
||||
if ( r.BlockItem != null )
|
||||
{
|
||||
w.setBlock( x, y, z, Block.getBlockFromItem( r.BlockItem.getItem() ), r.BlockItem.getItemDamage(), 3 );
|
||||
}
|
||||
else
|
||||
{
|
||||
w.setBlock( x, y, z, Platform.air, 0, 3 );
|
||||
}
|
||||
|
||||
if ( r.Drops != null )
|
||||
{
|
||||
Platform.spawnDrops( w, x, y, z, r.Drops );
|
||||
}
|
||||
}
|
||||
|
||||
static public boolean canCool( Block BlockID, int Metadata )
|
||||
{
|
||||
InWorldToolOperationResult r = coolDown.get( new Combo( BlockID, Metadata ) );
|
||||
|
||||
if ( r == null )
|
||||
{
|
||||
r = coolDown.get( new Combo( BlockID, OreDictionary.WILDCARD_VALUE ) );
|
||||
}
|
||||
|
||||
return r != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack item, EntityLivingBase target, EntityLivingBase hitter)
|
||||
public boolean hitEntity( ItemStack item, EntityLivingBase target, EntityLivingBase hitter )
|
||||
{
|
||||
if ( this.getAECurrentPower( item ) > 1600 )
|
||||
{
|
||||
@@ -201,7 +208,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack item, World w, EntityPlayer p)
|
||||
public ItemStack onItemRightClick( ItemStack item, World w, EntityPlayer p )
|
||||
{
|
||||
MovingObjectPosition target = this.getMovingObjectPositionFromPlayer( w, p, true );
|
||||
|
||||
@@ -229,7 +236,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack item, EntityPlayer p, World w, int x, int y, int z, int side, float hitX, float hitY, float hitZ)
|
||||
public boolean onItemUse( ItemStack item, EntityPlayer p, World w, int x, int y, int z, int side, float hitX, float hitY, float hitZ )
|
||||
{
|
||||
if ( this.getAECurrentPower( item ) > 1600 )
|
||||
{
|
||||
@@ -253,14 +260,14 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
|
||||
if ( Blk instanceof BlockTNT )
|
||||
{
|
||||
w.setBlock( x, y, z, Platform.air, 0, 3 );
|
||||
((BlockTNT) Blk).func_150114_a( w, x, y, z, 1, p );
|
||||
( ( BlockTNT ) Blk ).func_150114_a( w, x, y, z, 1, p );
|
||||
return true;
|
||||
}
|
||||
|
||||
if ( Blk instanceof BlockTinyTNT )
|
||||
{
|
||||
w.setBlock( x, y, z, Platform.air, 0, 3 );
|
||||
((BlockTinyTNT) Blk).startFuse( w, x, y, z, p );
|
||||
( ( BlockTinyTNT ) Blk ).startFuse( w, x, y, z, p );
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -276,7 +283,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
|
||||
boolean hasFurnaceable = false;
|
||||
boolean canFurnaceable = true;
|
||||
|
||||
for (ItemStack i : stack)
|
||||
for ( ItemStack i : stack )
|
||||
{
|
||||
ItemStack result = FurnaceRecipes.smelting().getSmeltingResult( i );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user