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,15 @@
|
||||
|
||||
package appeng.items.tools.powered;
|
||||
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.DamageSource;
|
||||
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.core.sync.packets.PacketLightning;
|
||||
@@ -30,28 +34,30 @@ import appeng.items.tools.powered.powersink.AEBasePoweredItem;
|
||||
import appeng.server.ServerHelper;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class ToolChargedStaff extends AEBasePoweredItem
|
||||
{
|
||||
|
||||
public ToolChargedStaff() {
|
||||
super( ToolChargedStaff.class, null );
|
||||
public ToolChargedStaff()
|
||||
{
|
||||
super( ToolChargedStaff.class, Optional.<String> absent() );
|
||||
setFeature( EnumSet.of( AEFeature.ChargedStaff, AEFeature.PoweredTools ) );
|
||||
maxStoredPower = AEConfig.instance.chargedStaffBattery;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack item, EntityLivingBase target, EntityLivingBase hitter)
|
||||
public boolean hitEntity( ItemStack item, EntityLivingBase target, EntityLivingBase hitter )
|
||||
{
|
||||
if ( this.getAECurrentPower( item ) > 300 )
|
||||
{
|
||||
extractAEPower( item, 300 );
|
||||
if ( Platform.isServer() )
|
||||
{
|
||||
for (int x = 0; x < 2; x++)
|
||||
for ( int x = 0; x < 2; x++ )
|
||||
{
|
||||
float dx = (float) (Platform.getRandomFloat() * target.width + target.boundingBox.minX);
|
||||
float dy = (float) (Platform.getRandomFloat() * target.height + target.boundingBox.minY);
|
||||
float dz = (float) (Platform.getRandomFloat() * target.width + target.boundingBox.minZ);
|
||||
float dx = ( float ) ( Platform.getRandomFloat() * target.width + target.boundingBox.minX );
|
||||
float dy = ( float ) ( Platform.getRandomFloat() * target.height + target.boundingBox.minY );
|
||||
float dz = ( float ) ( Platform.getRandomFloat() * target.width + target.boundingBox.minZ );
|
||||
ServerHelper.proxy.sendToAllNearExcept( null, dx, dy, dz, 32.0, target.worldObj, new PacketLightning( dx, dy, dz ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,8 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockDispenser;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -97,7 +99,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
|
||||
|
||||
public ToolColorApplicator()
|
||||
{
|
||||
super( ToolColorApplicator.class, null );
|
||||
super( ToolColorApplicator.class, Optional.<String> absent() );
|
||||
setFeature( EnumSet.of( AEFeature.ColorApplicator, AEFeature.PoweredTools ) );
|
||||
maxStoredPower = AEConfig.instance.colorApplicatorBattery;
|
||||
if ( Platform.isClient() )
|
||||
@@ -111,125 +113,6 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject( this, new DispenserBlockTool() );
|
||||
}
|
||||
|
||||
public ItemStack getColor( ItemStack is )
|
||||
{
|
||||
NBTTagCompound c = is.getTagCompound();
|
||||
if ( c != null && c.hasKey( "color" ) )
|
||||
{
|
||||
NBTTagCompound color = c.getCompoundTag( "color" );
|
||||
ItemStack oldColor = ItemStack.loadItemStackFromNBT( color );
|
||||
if ( oldColor != null )
|
||||
return oldColor;
|
||||
}
|
||||
|
||||
return findNextColor( is, null, 0 );
|
||||
}
|
||||
|
||||
public AEColor getColorFromItem( ItemStack paintBall )
|
||||
{
|
||||
if ( paintBall == null )
|
||||
return null;
|
||||
|
||||
if ( paintBall.getItem() instanceof ItemSnowball )
|
||||
return AEColor.Transparent;
|
||||
|
||||
if ( paintBall.getItem() instanceof ItemPaintBall )
|
||||
{
|
||||
ItemPaintBall ipb = ( ItemPaintBall ) paintBall.getItem();
|
||||
return ipb.getColor( paintBall );
|
||||
}
|
||||
else
|
||||
{
|
||||
int[] id = OreDictionary.getOreIDs( paintBall );
|
||||
|
||||
for ( int oreID : id )
|
||||
{
|
||||
if ( oreToColor.containsKey( oreID ) )
|
||||
return oreToColor.get( oreID );
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public AEColor getActiveColor( ItemStack tol )
|
||||
{
|
||||
return getColorFromItem( getColor( tol ) );
|
||||
}
|
||||
|
||||
private ItemStack findNextColor( ItemStack is, ItemStack anchor, int scrollOffset )
|
||||
{
|
||||
ItemStack newColor = null;
|
||||
|
||||
IMEInventory<IAEItemStack> inv = AEApi.instance().registries().cell().getCellInventory( is, null, StorageChannel.ITEMS );
|
||||
if ( inv != null )
|
||||
{
|
||||
IItemList<IAEItemStack> itemList = inv.getAvailableItems( AEApi.instance().storage().createItemList() );
|
||||
if ( anchor == null )
|
||||
{
|
||||
IAEItemStack firstItem = itemList.getFirstItem();
|
||||
if ( firstItem != null )
|
||||
newColor = firstItem.getItemStack();
|
||||
}
|
||||
else
|
||||
{
|
||||
LinkedList<IAEItemStack> list = new LinkedList<IAEItemStack>();
|
||||
|
||||
for ( IAEItemStack i : itemList )
|
||||
list.add( i );
|
||||
|
||||
Collections.sort( list, new Comparator<IAEItemStack>(){
|
||||
|
||||
@Override
|
||||
public int compare( IAEItemStack a, IAEItemStack b )
|
||||
{
|
||||
return ItemSorters.compareInt( a.getItemDamage(), b.getItemDamage() );
|
||||
}
|
||||
|
||||
} );
|
||||
|
||||
if ( list.size() <= 0 )
|
||||
return null;
|
||||
|
||||
IAEItemStack where = list.getFirst();
|
||||
int cycles = 1 + list.size();
|
||||
|
||||
while ( cycles > 0 && !where.equals( anchor ) )
|
||||
{
|
||||
list.addLast( list.removeFirst() );
|
||||
cycles--;
|
||||
where = list.getFirst();
|
||||
}
|
||||
|
||||
if ( scrollOffset > 0 )
|
||||
list.addLast( list.removeFirst() );
|
||||
|
||||
if ( scrollOffset < 0 )
|
||||
list.addFirst( list.removeLast() );
|
||||
|
||||
return list.get( 0 ).getItemStack();
|
||||
}
|
||||
}
|
||||
|
||||
if ( newColor != null )
|
||||
setColor( is, newColor );
|
||||
|
||||
return newColor;
|
||||
}
|
||||
|
||||
public void setColor( ItemStack is, ItemStack newColor )
|
||||
{
|
||||
NBTTagCompound data = Platform.openNbtData( is );
|
||||
if ( newColor == null )
|
||||
data.removeTag( "color" );
|
||||
else
|
||||
{
|
||||
NBTTagCompound color = new NBTTagCompound();
|
||||
newColor.writeToNBT( color );
|
||||
data.setTag( "color", color );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse( ItemStack is, EntityPlayer p, World w, int x, int y, int z, int side, float hitX, float hitY, float hitZ )
|
||||
{
|
||||
@@ -309,6 +192,138 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName( ItemStack par1ItemStack )
|
||||
{
|
||||
String extra = GuiText.Empty.getLocal();
|
||||
|
||||
AEColor selected = getActiveColor( par1ItemStack );
|
||||
|
||||
if ( selected != null && Platform.isClient() )
|
||||
extra = Platform.gui_localize( selected.unlocalizedName );
|
||||
|
||||
return super.getItemStackDisplayName( par1ItemStack ) + " - " + extra;
|
||||
}
|
||||
|
||||
public AEColor getActiveColor( ItemStack tol )
|
||||
{
|
||||
return getColorFromItem( getColor( tol ) );
|
||||
}
|
||||
|
||||
public AEColor getColorFromItem( ItemStack paintBall )
|
||||
{
|
||||
if ( paintBall == null )
|
||||
return null;
|
||||
|
||||
if ( paintBall.getItem() instanceof ItemSnowball )
|
||||
return AEColor.Transparent;
|
||||
|
||||
if ( paintBall.getItem() instanceof ItemPaintBall )
|
||||
{
|
||||
ItemPaintBall ipb = ( ItemPaintBall ) paintBall.getItem();
|
||||
return ipb.getColor( paintBall );
|
||||
}
|
||||
else
|
||||
{
|
||||
int[] id = OreDictionary.getOreIDs( paintBall );
|
||||
|
||||
for ( int oreID : id )
|
||||
{
|
||||
if ( oreToColor.containsKey( oreID ) )
|
||||
return oreToColor.get( oreID );
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public ItemStack getColor( ItemStack is )
|
||||
{
|
||||
NBTTagCompound c = is.getTagCompound();
|
||||
if ( c != null && c.hasKey( "color" ) )
|
||||
{
|
||||
NBTTagCompound color = c.getCompoundTag( "color" );
|
||||
ItemStack oldColor = ItemStack.loadItemStackFromNBT( color );
|
||||
if ( oldColor != null )
|
||||
return oldColor;
|
||||
}
|
||||
|
||||
return findNextColor( is, null, 0 );
|
||||
}
|
||||
|
||||
private ItemStack findNextColor( ItemStack is, ItemStack anchor, int scrollOffset )
|
||||
{
|
||||
ItemStack newColor = null;
|
||||
|
||||
IMEInventory<IAEItemStack> inv = AEApi.instance().registries().cell().getCellInventory( is, null, StorageChannel.ITEMS );
|
||||
if ( inv != null )
|
||||
{
|
||||
IItemList<IAEItemStack> itemList = inv.getAvailableItems( AEApi.instance().storage().createItemList() );
|
||||
if ( anchor == null )
|
||||
{
|
||||
IAEItemStack firstItem = itemList.getFirstItem();
|
||||
if ( firstItem != null )
|
||||
newColor = firstItem.getItemStack();
|
||||
}
|
||||
else
|
||||
{
|
||||
LinkedList<IAEItemStack> list = new LinkedList<IAEItemStack>();
|
||||
|
||||
for ( IAEItemStack i : itemList )
|
||||
list.add( i );
|
||||
|
||||
Collections.sort( list, new Comparator<IAEItemStack>(){
|
||||
|
||||
@Override
|
||||
public int compare( IAEItemStack a, IAEItemStack b )
|
||||
{
|
||||
return ItemSorters.compareInt( a.getItemDamage(), b.getItemDamage() );
|
||||
}
|
||||
|
||||
} );
|
||||
|
||||
if ( list.size() <= 0 )
|
||||
return null;
|
||||
|
||||
IAEItemStack where = list.getFirst();
|
||||
int cycles = 1 + list.size();
|
||||
|
||||
while ( cycles > 0 && !where.equals( anchor ) )
|
||||
{
|
||||
list.addLast( list.removeFirst() );
|
||||
cycles--;
|
||||
where = list.getFirst();
|
||||
}
|
||||
|
||||
if ( scrollOffset > 0 )
|
||||
list.addLast( list.removeFirst() );
|
||||
|
||||
if ( scrollOffset < 0 )
|
||||
list.addFirst( list.removeLast() );
|
||||
|
||||
return list.get( 0 ).getItemStack();
|
||||
}
|
||||
}
|
||||
|
||||
if ( newColor != null )
|
||||
setColor( is, newColor );
|
||||
|
||||
return newColor;
|
||||
}
|
||||
|
||||
public void setColor( ItemStack is, ItemStack newColor )
|
||||
{
|
||||
NBTTagCompound data = Platform.openNbtData( is );
|
||||
if ( newColor == null )
|
||||
data.removeTag( "color" );
|
||||
else
|
||||
{
|
||||
NBTTagCompound color = new NBTTagCompound();
|
||||
newColor.writeToNBT( color );
|
||||
data.setTag( "color", color );
|
||||
}
|
||||
}
|
||||
|
||||
private boolean recolourBlock( Block blk, ForgeDirection side, World w, int x, int y, int z, ForgeDirection orientation, AEColor newColor, EntityPlayer p )
|
||||
{
|
||||
if ( blk == Blocks.carpet )
|
||||
@@ -376,19 +391,6 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName( ItemStack par1ItemStack )
|
||||
{
|
||||
String extra = GuiText.Empty.getLocal();
|
||||
|
||||
AEColor selected = getActiveColor( par1ItemStack );
|
||||
|
||||
if ( selected != null && Platform.isClient() )
|
||||
extra = Platform.gui_localize( selected.unlocalizedName );
|
||||
|
||||
return super.getItemStackDisplayName( par1ItemStack ) + " - " + extra;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCheckedInformation( ItemStack stack, EntityPlayer player, List<String> lines, boolean displayAdditionalInformation )
|
||||
{
|
||||
@@ -458,6 +460,24 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getIdleDrain()
|
||||
{
|
||||
return 0.5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedGroupName( Set<ItemStack> others, ItemStack is )
|
||||
{
|
||||
return GuiText.StorageCells.getUnlocalized();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEditable( ItemStack is )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getUpgradesInventory( ItemStack is )
|
||||
{
|
||||
@@ -484,30 +504,12 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedGroupName( Set<ItemStack> others, ItemStack is )
|
||||
{
|
||||
return GuiText.StorageCells.getUnlocalized();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFuzzyMode( ItemStack is, FuzzyMode fzMode )
|
||||
{
|
||||
Platform.openNbtData( is ).setString( "FuzzyMode", fzMode.name() );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEditable( ItemStack is )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getIdleDrain()
|
||||
{
|
||||
return 0.5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWheel( ItemStack is, boolean up )
|
||||
{
|
||||
|
||||
@@ -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 );
|
||||
|
||||
|
||||
@@ -18,9 +18,12 @@
|
||||
|
||||
package appeng.items.tools.powered;
|
||||
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockDispenser;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -39,6 +42,7 @@ import net.minecraft.util.MovingObjectPosition.MovingObjectType;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.FuzzyMode;
|
||||
@@ -73,11 +77,13 @@ import appeng.me.storage.CellInventoryHandler;
|
||||
import appeng.tile.misc.TilePaint;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
|
||||
{
|
||||
|
||||
public ToolMassCannon() {
|
||||
super( ToolMassCannon.class, null );
|
||||
public ToolMassCannon()
|
||||
{
|
||||
super( ToolMassCannon.class, Optional.<String> absent() );
|
||||
setFeature( EnumSet.of( AEFeature.MatterCannon, AEFeature.PoweredTools ) );
|
||||
maxStoredPower = AEConfig.instance.matterCannonBattery;
|
||||
}
|
||||
@@ -90,7 +96,7 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCheckedInformation(ItemStack stack, EntityPlayer player, List<String> lines, boolean displayAdditionalInformation )
|
||||
public void addCheckedInformation( ItemStack stack, EntityPlayer player, List<String> lines, boolean displayAdditionalInformation )
|
||||
{
|
||||
super.addCheckedInformation( stack, player, lines, displayAdditionalInformation );
|
||||
|
||||
@@ -98,7 +104,7 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
|
||||
|
||||
if ( cdi instanceof CellInventoryHandler )
|
||||
{
|
||||
ICellInventory cd = ((ICellInventoryHandler) cdi).getCellInv();
|
||||
ICellInventory cd = ( ( ICellInventoryHandler ) cdi ).getCellInv();
|
||||
if ( cd != null )
|
||||
{
|
||||
lines.add( cd.getUsedBytes() + " " + GuiText.Of.getLocal() + " " + cd.getTotalBytes() + " " + GuiText.BytesUsed.getLocal() );
|
||||
@@ -108,13 +114,13 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack item, World w, EntityPlayer p)
|
||||
public ItemStack onItemRightClick( ItemStack item, World w, EntityPlayer p )
|
||||
{
|
||||
if ( this.getAECurrentPower( item ) > 1600 )
|
||||
{
|
||||
int shots = 1;
|
||||
|
||||
CellUpgrades cu = (CellUpgrades) getUpgradesInventory( item );
|
||||
CellUpgrades cu = ( CellUpgrades ) getUpgradesInventory( item );
|
||||
if ( cu != null )
|
||||
shots += cu.getInstalledUpgrades( Upgrades.SPEED );
|
||||
|
||||
@@ -125,8 +131,8 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
|
||||
IAEStack aeAmmo = itemList.getFirstItem();
|
||||
if ( aeAmmo instanceof IAEItemStack )
|
||||
{
|
||||
shots = Math.min( shots, (int) aeAmmo.getStackSize() );
|
||||
for (int sh = 0; sh < shots; sh++)
|
||||
shots = Math.min( shots, ( int ) aeAmmo.getStackSize() );
|
||||
for ( int sh = 0; sh < shots; sh++ )
|
||||
{
|
||||
extractAEPower( item, 1600 );
|
||||
|
||||
@@ -134,7 +140,7 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
|
||||
return item;
|
||||
|
||||
aeAmmo.setStackSize( 1 );
|
||||
ItemStack ammo = ((IAEItemStack) aeAmmo).getItemStack();
|
||||
ItemStack ammo = ( ( IAEItemStack ) aeAmmo ).getItemStack();
|
||||
if ( ammo == null )
|
||||
return item;
|
||||
|
||||
@@ -144,14 +150,14 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
|
||||
return item;
|
||||
|
||||
float f = 1.0F;
|
||||
float f1 = p.prevRotationPitch + (p.rotationPitch - p.prevRotationPitch) * f;
|
||||
float f2 = p.prevRotationYaw + (p.rotationYaw - p.prevRotationYaw) * f;
|
||||
double d0 = p.prevPosX + (p.posX - p.prevPosX) * f;
|
||||
double d1 = p.prevPosY + (p.posY - p.prevPosY) * f + 1.62D - p.yOffset;
|
||||
double d2 = p.prevPosZ + (p.posZ - p.prevPosZ) * f;
|
||||
float f1 = p.prevRotationPitch + ( p.rotationPitch - p.prevRotationPitch ) * f;
|
||||
float f2 = p.prevRotationYaw + ( p.rotationYaw - p.prevRotationYaw ) * f;
|
||||
double d0 = p.prevPosX + ( p.posX - p.prevPosX ) * f;
|
||||
double d1 = p.prevPosY + ( p.posY - p.prevPosY ) * f + 1.62D - p.yOffset;
|
||||
double d2 = p.prevPosZ + ( p.posZ - p.prevPosZ ) * f;
|
||||
Vec3 vec3 = Vec3.createVectorHelper( d0, d1, d2 );
|
||||
float f3 = MathHelper.cos( -f2 * 0.017453292F - (float) Math.PI );
|
||||
float f4 = MathHelper.sin( -f2 * 0.017453292F - (float) Math.PI );
|
||||
float f3 = MathHelper.cos( -f2 * 0.017453292F - ( float ) Math.PI );
|
||||
float f4 = MathHelper.sin( -f2 * 0.017453292F - ( float ) Math.PI );
|
||||
float f5 = -MathHelper.cos( -f1 * 0.017453292F );
|
||||
float f6 = MathHelper.sin( -f1 * 0.017453292F );
|
||||
float f7 = f4 * f5;
|
||||
@@ -165,7 +171,7 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
|
||||
float penetration = AEApi.instance().registries().matterCannon().getPenetration( ammo ); // 196.96655f;
|
||||
if ( penetration <= 0 )
|
||||
{
|
||||
ItemStack type = ((IAEItemStack) aeAmmo).getItemStack();
|
||||
ItemStack type = ( ( IAEItemStack ) aeAmmo ).getItemStack();
|
||||
if ( type.getItem() instanceof ItemPaintBall )
|
||||
{
|
||||
shootPaintBalls( type, w, p, vec3, vec31, direction, d0, d1, d2 );
|
||||
@@ -190,7 +196,7 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
|
||||
return item;
|
||||
}
|
||||
|
||||
private void shootPaintBalls(ItemStack type, World w, EntityPlayer p, Vec3 vec3, Vec3 vec31, Vec3 direction, double d0, double d1, double d2)
|
||||
private void shootPaintBalls( ItemStack type, World w, EntityPlayer p, Vec3 vec3, Vec3 vec31, Vec3 direction, double d0, double d1, double d2 )
|
||||
{
|
||||
AxisAlignedBB bb = AxisAlignedBB.getBoundingBox( Math.min( vec3.xCoord, vec31.xCoord ), Math.min( vec3.yCoord, vec31.yCoord ),
|
||||
Math.min( vec3.zCoord, vec31.zCoord ), Math.max( vec3.xCoord, vec31.xCoord ), Math.max( vec3.yCoord, vec31.yCoord ),
|
||||
@@ -201,11 +207,11 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
|
||||
double closest = 9999999.0D;
|
||||
int l;
|
||||
|
||||
for (l = 0; l < list.size(); ++l)
|
||||
for ( l = 0; l < list.size(); ++l )
|
||||
{
|
||||
Entity entity1 = (Entity) list.get( l );
|
||||
Entity entity1 = ( Entity ) list.get( l );
|
||||
|
||||
if ( !entity1.isDead && entity1 != p && !(entity1 instanceof EntityItem) )
|
||||
if ( !entity1.isDead && entity1 != p && !( entity1 instanceof EntityItem ) )
|
||||
{
|
||||
if ( entity1.isEntityAlive() )
|
||||
{
|
||||
@@ -246,18 +252,18 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
|
||||
|
||||
try
|
||||
{
|
||||
CommonHelper.proxy.sendToAllNearExcept( null, d0, d1, d2, 128, w, new PacketMatterCannon( d0, d1, d2, (float) direction.xCoord,
|
||||
(float) direction.yCoord, (float) direction.zCoord, (byte) (pos == null ? 32 : pos.hitVec.squareDistanceTo( vec ) + 1) ) );
|
||||
CommonHelper.proxy.sendToAllNearExcept( null, d0, d1, d2, 128, w, new PacketMatterCannon( d0, d1, d2, ( float ) direction.xCoord,
|
||||
( float ) direction.yCoord, ( float ) direction.zCoord, ( byte ) ( pos == null ? 32 : pos.hitVec.squareDistanceTo( vec ) + 1 ) ) );
|
||||
|
||||
}
|
||||
catch (Exception err)
|
||||
catch ( Exception err )
|
||||
{
|
||||
AELog.error( err );
|
||||
}
|
||||
|
||||
if ( pos != null && type != null && type.getItem() instanceof ItemPaintBall )
|
||||
{
|
||||
ItemPaintBall ipb = (ItemPaintBall) type.getItem();
|
||||
ItemPaintBall ipb = ( ItemPaintBall ) type.getItem();
|
||||
|
||||
AEColor col = ipb.getColor( type );
|
||||
// boolean lit = ipb.isLumen( type );
|
||||
@@ -270,7 +276,7 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
|
||||
|
||||
if ( pos.entityHit instanceof EntitySheep )
|
||||
{
|
||||
EntitySheep sh = (EntitySheep) pos.entityHit;
|
||||
EntitySheep sh = ( EntitySheep ) pos.entityHit;
|
||||
sh.setFleeceColor( col.ordinal() );
|
||||
}
|
||||
|
||||
@@ -300,17 +306,17 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
|
||||
pos.hitVec.xCoord -= x;
|
||||
pos.hitVec.yCoord -= y;
|
||||
pos.hitVec.zCoord -= z;
|
||||
((TilePaint) te).addBlot( type, side.getOpposite(), pos.hitVec );
|
||||
( ( TilePaint ) te ).addBlot( type, side.getOpposite(), pos.hitVec );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void standardAmmo(float penetration, World w, EntityPlayer p, Vec3 vec3, Vec3 vec31, Vec3 direction, double d0, double d1, double d2)
|
||||
private void standardAmmo( float penetration, World w, EntityPlayer p, Vec3 vec3, Vec3 vec31, Vec3 direction, double d0, double d1, double d2 )
|
||||
{
|
||||
boolean hasDestroyedSomething = true;
|
||||
while (penetration > 0 && hasDestroyedSomething)
|
||||
while ( penetration > 0 && hasDestroyedSomething )
|
||||
{
|
||||
hasDestroyedSomething = false;
|
||||
|
||||
@@ -323,11 +329,11 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
|
||||
double closest = 9999999.0D;
|
||||
int l;
|
||||
|
||||
for (l = 0; l < list.size(); ++l)
|
||||
for ( l = 0; l < list.size(); ++l )
|
||||
{
|
||||
Entity entity1 = (Entity) list.get( l );
|
||||
Entity entity1 = ( Entity ) list.get( l );
|
||||
|
||||
if ( !entity1.isDead && entity1 != p && !(entity1 instanceof EntityItem) )
|
||||
if ( !entity1.isDead && entity1 != p && !( entity1 instanceof EntityItem ) )
|
||||
{
|
||||
if ( entity1.isEntityAlive() )
|
||||
{
|
||||
@@ -367,11 +373,11 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
|
||||
|
||||
try
|
||||
{
|
||||
CommonHelper.proxy.sendToAllNearExcept( null, d0, d1, d2, 128, w, new PacketMatterCannon( d0, d1, d2, (float) direction.xCoord,
|
||||
(float) direction.yCoord, (float) direction.zCoord, (byte) (pos == null ? 32 : pos.hitVec.squareDistanceTo( vec ) + 1) ) );
|
||||
CommonHelper.proxy.sendToAllNearExcept( null, d0, d1, d2, 128, w, new PacketMatterCannon( d0, d1, d2, ( float ) direction.xCoord,
|
||||
( float ) direction.yCoord, ( float ) direction.zCoord, ( byte ) ( pos == null ? 32 : pos.hitVec.squareDistanceTo( vec ) + 1 ) ) );
|
||||
|
||||
}
|
||||
catch (Exception err)
|
||||
catch ( Exception err )
|
||||
{
|
||||
AELog.error( err );
|
||||
}
|
||||
@@ -383,10 +389,10 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
|
||||
|
||||
if ( pos.typeOfHit == MovingObjectType.ENTITY )
|
||||
{
|
||||
int dmg = (int) Math.ceil( penetration / 20.0f );
|
||||
int dmg = ( int ) Math.ceil( penetration / 20.0f );
|
||||
if ( pos.entityHit instanceof EntityLivingBase )
|
||||
{
|
||||
EntityLivingBase el = (EntityLivingBase) pos.entityHit;
|
||||
EntityLivingBase el = ( EntityLivingBase ) pos.entityHit;
|
||||
penetration -= dmg;
|
||||
el.knockBack( p, 0, -direction.xCoord, -direction.zCoord );
|
||||
// el.knockBack( p, 0, vec3.xCoord,
|
||||
@@ -434,81 +440,63 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean storableInStorageCell()
|
||||
public boolean isEditable( ItemStack is )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isStorageCell(ItemStack i)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getIdleDrain()
|
||||
{
|
||||
return 0.5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getUpgradesInventory(ItemStack is)
|
||||
public IInventory getUpgradesInventory( ItemStack is )
|
||||
{
|
||||
return new CellUpgrades( is, 4 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getConfigInventory(ItemStack is)
|
||||
public IInventory getConfigInventory( ItemStack is )
|
||||
{
|
||||
return new CellConfig( is );
|
||||
}
|
||||
|
||||
@Override
|
||||
public FuzzyMode getFuzzyMode(ItemStack is)
|
||||
public FuzzyMode getFuzzyMode( ItemStack is )
|
||||
{
|
||||
String fz = Platform.openNbtData( is ).getString( "FuzzyMode" );
|
||||
try
|
||||
{
|
||||
return FuzzyMode.valueOf( fz );
|
||||
}
|
||||
catch (Throwable t)
|
||||
catch ( Throwable t )
|
||||
{
|
||||
return FuzzyMode.IGNORE_ALL;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFuzzyMode(ItemStack is, FuzzyMode fzMode)
|
||||
public void setFuzzyMode( ItemStack is, FuzzyMode fzMode )
|
||||
{
|
||||
Platform.openNbtData( is ).setString( "FuzzyMode", fzMode.name() );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEditable(ItemStack is)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBytes(ItemStack cellItem)
|
||||
public int getBytes( ItemStack cellItem )
|
||||
{
|
||||
return 512;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int BytePerType(ItemStack cell)
|
||||
public int BytePerType( ItemStack cell )
|
||||
{
|
||||
return 8;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTotalTypes(ItemStack cellItem)
|
||||
public int getTotalTypes( ItemStack cellItem )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBlackListed(ItemStack cellItem, IAEItemStack requestedAddition)
|
||||
public boolean isBlackListed( ItemStack cellItem, IAEItemStack requestedAddition )
|
||||
{
|
||||
float pen = AEApi.instance().registries().matterCannon().getPenetration( requestedAddition.getItemStack() );
|
||||
if ( pen > 0 )
|
||||
@@ -519,4 +507,22 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean storableInStorageCell()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isStorageCell( ItemStack i )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getIdleDrain()
|
||||
{
|
||||
return 0.5;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,8 @@ import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -56,7 +58,7 @@ public class ToolPortableCell extends AEBasePoweredItem implements IStorageCell,
|
||||
{
|
||||
public ToolPortableCell()
|
||||
{
|
||||
super( ToolPortableCell.class, null );
|
||||
super( ToolPortableCell.class, Optional.<String> absent() );
|
||||
setFeature( EnumSet.of( AEFeature.PortableCell, AEFeature.StorageCells, AEFeature.PoweredTools ) );
|
||||
maxStoredPower = AEConfig.instance.portableCellBattery;
|
||||
}
|
||||
@@ -128,6 +130,18 @@ public class ToolPortableCell extends AEBasePoweredItem implements IStorageCell,
|
||||
return 0.5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedGroupName( Set<ItemStack> others, ItemStack is )
|
||||
{
|
||||
return GuiText.StorageCells.getUnlocalized();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEditable( ItemStack is )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getUpgradesInventory( ItemStack is )
|
||||
{
|
||||
@@ -154,24 +168,12 @@ public class ToolPortableCell extends AEBasePoweredItem implements IStorageCell,
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedGroupName( Set<ItemStack> others, ItemStack is )
|
||||
{
|
||||
return GuiText.StorageCells.getUnlocalized();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFuzzyMode( ItemStack is, FuzzyMode fzMode )
|
||||
{
|
||||
Platform.openNbtData( is ).setString( "FuzzyMode", fzMode.name() );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEditable( ItemStack is )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IGuiItemObject getGuiObject( ItemStack is, World w, int x, int y, int z )
|
||||
{
|
||||
|
||||
@@ -18,14 +18,18 @@
|
||||
|
||||
package appeng.items.tools.powered;
|
||||
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.config.SortDir;
|
||||
@@ -41,24 +45,26 @@ import appeng.util.ConfigManager;
|
||||
import appeng.util.IConfigManagerHost;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class ToolWirelessTerminal extends AEBasePoweredItem implements IWirelessTermHandler
|
||||
{
|
||||
|
||||
public ToolWirelessTerminal() {
|
||||
super( ToolWirelessTerminal.class, null );
|
||||
public ToolWirelessTerminal()
|
||||
{
|
||||
super( ToolWirelessTerminal.class, Optional.<String> absent() );
|
||||
setFeature( EnumSet.of( AEFeature.WirelessAccessTerminal, AEFeature.PoweredTools ) );
|
||||
maxStoredPower = AEConfig.instance.wirelessTerminalBattery;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack item, World w, EntityPlayer player)
|
||||
public ItemStack onItemRightClick( ItemStack item, World w, EntityPlayer player )
|
||||
{
|
||||
AEApi.instance().registries().wireless().openWirelessTerminalGui( item, w, player );
|
||||
return item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCheckedInformation(ItemStack stack, EntityPlayer player, List<String> lines, boolean displayAdditionalInformation )
|
||||
public void addCheckedInformation( ItemStack stack, EntityPlayer player, List<String> lines, boolean displayAdditionalInformation )
|
||||
{
|
||||
super.addCheckedInformation( stack, player, lines, displayAdditionalInformation );
|
||||
|
||||
@@ -80,45 +86,30 @@ public class ToolWirelessTerminal extends AEBasePoweredItem implements IWireless
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canHandle(ItemStack is)
|
||||
public boolean canHandle( ItemStack is )
|
||||
{
|
||||
return AEApi.instance().items().itemWirelessTerminal.sameAsStack( is );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean usePower(EntityPlayer player, double amount, ItemStack is)
|
||||
public boolean usePower( EntityPlayer player, double amount, ItemStack is )
|
||||
{
|
||||
return this.extractAEPower( is, amount ) >= amount - 0.5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasPower(EntityPlayer player, double amt, ItemStack is)
|
||||
public boolean hasPower( EntityPlayer player, double amt, ItemStack is )
|
||||
{
|
||||
return getAECurrentPower( is ) >= amt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEncryptionKey(ItemStack item)
|
||||
public IConfigManager getConfigManager( final ItemStack target )
|
||||
{
|
||||
NBTTagCompound tag = Platform.openNbtData( item );
|
||||
return tag.getString( "encryptionKey" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setEncryptionKey(ItemStack item, String encKey, String name)
|
||||
{
|
||||
NBTTagCompound tag = Platform.openNbtData( item );
|
||||
tag.setString( "encryptionKey", encKey );
|
||||
tag.setString( "name", name );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IConfigManager getConfigManager(final ItemStack target)
|
||||
{
|
||||
final ConfigManager out = new ConfigManager( new IConfigManagerHost() {
|
||||
final ConfigManager out = new ConfigManager( new IConfigManagerHost(){
|
||||
|
||||
@Override
|
||||
public void updateSetting(IConfigManager manager, Enum settingName, Enum newValue)
|
||||
public void updateSetting( IConfigManager manager, Enum settingName, Enum newValue )
|
||||
{
|
||||
NBTTagCompound data = Platform.openNbtData( target );
|
||||
manager.writeToNBT( data );
|
||||
@@ -130,8 +121,23 @@ public class ToolWirelessTerminal extends AEBasePoweredItem implements IWireless
|
||||
out.registerSetting( Settings.VIEW_MODE, ViewItems.ALL );
|
||||
out.registerSetting( Settings.SORT_DIRECTION, SortDir.ASCENDING );
|
||||
|
||||
out.readFromNBT( (NBTTagCompound) Platform.openNbtData( target ).copy() );
|
||||
out.readFromNBT( ( NBTTagCompound ) Platform.openNbtData( target ).copy() );
|
||||
return out;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEncryptionKey( ItemStack item )
|
||||
{
|
||||
NBTTagCompound tag = Platform.openNbtData( item );
|
||||
return tag.getString( "encryptionKey" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setEncryptionKey( ItemStack item, String encKey, String name )
|
||||
{
|
||||
NBTTagCompound tag = Platform.openNbtData( item );
|
||||
tag.setString( "encryptionKey", encKey );
|
||||
tag.setString( "name", name );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,11 +18,17 @@
|
||||
|
||||
package appeng.items.tools.powered.powersink;
|
||||
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
|
||||
public class AEBasePoweredItem extends RedstoneFlux
|
||||
{
|
||||
|
||||
public AEBasePoweredItem(Class c, String subName) {
|
||||
public AEBasePoweredItem( Class c, Optional<String> subName )
|
||||
{
|
||||
super( c, subName );
|
||||
setMaxStackSize( 1 );
|
||||
|
||||
this.setMaxStackSize( 1 );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,14 +18,18 @@
|
||||
|
||||
package appeng.items.tools.powered.powersink;
|
||||
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import appeng.api.config.AccessRestriction;
|
||||
import appeng.api.config.PowerUnits;
|
||||
import appeng.api.implementations.items.IAEItemPowerStorage;
|
||||
@@ -33,24 +37,22 @@ import appeng.core.localization.GuiText;
|
||||
import appeng.items.AEBaseItem;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class AERootPoweredItem extends AEBaseItem implements IAEItemPowerStorage
|
||||
{
|
||||
|
||||
private enum batteryOperation
|
||||
{
|
||||
STORAGE, INJECT, EXTRACT
|
||||
}
|
||||
|
||||
final String EnergyVar = "internalCurrentPower";
|
||||
public double maxStoredPower = 200000;
|
||||
|
||||
public AERootPoweredItem(Class c, String subName) {
|
||||
public AERootPoweredItem( Class c, Optional<String> subName )
|
||||
{
|
||||
super( c, subName );
|
||||
setMaxDamage( 32 );
|
||||
hasSubtypes = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCheckedInformation(ItemStack stack, EntityPlayer player, List<String> lines, boolean displayAdditionalInformation )
|
||||
public void addCheckedInformation( ItemStack stack, EntityPlayer player, List<String> lines, boolean displayAdditionalInformation )
|
||||
{
|
||||
NBTTagCompound tag = stack.getTagCompound();
|
||||
double internalCurrentPower = 0;
|
||||
@@ -75,9 +77,15 @@ public class AERootPoweredItem extends AEBaseItem implements IAEItemPowerStorage
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDamaged(ItemStack stack)
|
||||
public void getSubItems( Item id, CreativeTabs tab, List list )
|
||||
{
|
||||
return true;
|
||||
super.getSubItems( id, tab, list );
|
||||
|
||||
ItemStack charged = new ItemStack( this, 1 );
|
||||
NBTTagCompound tag = Platform.openNbtData( charged );
|
||||
tag.setDouble( "internalCurrentPower", getAEMaxPower( charged ) );
|
||||
tag.setDouble( "internalMaxPower", getAEMaxPower( charged ) );
|
||||
list.add( charged );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -87,56 +95,31 @@ public class AERootPoweredItem extends AEBaseItem implements IAEItemPowerStorage
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDamage(ItemStack stack, int damage)
|
||||
public double getDurabilityForDisplay( ItemStack is )
|
||||
{
|
||||
|
||||
return 1 - getAECurrentPower( is ) / getAEMaxPower( is );
|
||||
}
|
||||
|
||||
final String EnergyVar = "internalCurrentPower";
|
||||
|
||||
private double getInternalBattery(ItemStack is, batteryOperation op, double adjustment)
|
||||
@Override
|
||||
public boolean isDamaged( ItemStack stack )
|
||||
{
|
||||
NBTTagCompound data = Platform.openNbtData( is );
|
||||
return true;
|
||||
}
|
||||
|
||||
double currentStorage = data.getDouble( EnergyVar );
|
||||
double maxStorage = getAEMaxPower( is );
|
||||
@Override
|
||||
public void setDamage( ItemStack stack, int damage )
|
||||
{
|
||||
|
||||
switch (op)
|
||||
{
|
||||
case INJECT:
|
||||
currentStorage += adjustment;
|
||||
if ( currentStorage > maxStorage )
|
||||
{
|
||||
double diff = currentStorage - maxStorage;
|
||||
data.setDouble( EnergyVar, maxStorage );
|
||||
return diff;
|
||||
}
|
||||
data.setDouble( EnergyVar, currentStorage );
|
||||
return 0;
|
||||
case EXTRACT:
|
||||
if ( currentStorage > adjustment )
|
||||
{
|
||||
currentStorage -= adjustment;
|
||||
data.setDouble( EnergyVar, currentStorage );
|
||||
return adjustment;
|
||||
}
|
||||
data.setDouble( EnergyVar, 0 );
|
||||
return currentStorage;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return currentStorage;
|
||||
}
|
||||
|
||||
/**
|
||||
* inject external
|
||||
*/
|
||||
double injectExternalPower(PowerUnits input, ItemStack is, double amount, boolean simulate)
|
||||
double injectExternalPower( PowerUnits input, ItemStack is, double amount, boolean simulate )
|
||||
{
|
||||
if ( simulate )
|
||||
{
|
||||
int requiredEU = (int) PowerUnits.AE.convertTo( PowerUnits.EU, getAEMaxPower( is ) - getAECurrentPower( is ) );
|
||||
int requiredEU = ( int ) PowerUnits.AE.convertTo( PowerUnits.EU, getAEMaxPower( is ) - getAECurrentPower( is ) );
|
||||
if ( amount < requiredEU )
|
||||
return 0;
|
||||
return amount - requiredEU;
|
||||
@@ -149,51 +132,73 @@ public class AERootPoweredItem extends AEBaseItem implements IAEItemPowerStorage
|
||||
}
|
||||
|
||||
@Override
|
||||
public double injectAEPower(ItemStack is, double amt)
|
||||
public double injectAEPower( ItemStack is, double amt )
|
||||
{
|
||||
return getInternalBattery( is, batteryOperation.INJECT, amt );
|
||||
}
|
||||
|
||||
@Override
|
||||
public double extractAEPower(ItemStack is, double amt)
|
||||
public double extractAEPower( ItemStack is, double amt )
|
||||
{
|
||||
return getInternalBattery( is, batteryOperation.EXTRACT, amt );
|
||||
}
|
||||
|
||||
private double getInternalBattery( ItemStack is, batteryOperation op, double adjustment )
|
||||
{
|
||||
NBTTagCompound data = Platform.openNbtData( is );
|
||||
|
||||
double currentStorage = data.getDouble( EnergyVar );
|
||||
double maxStorage = getAEMaxPower( is );
|
||||
|
||||
switch ( op )
|
||||
{
|
||||
case INJECT:
|
||||
currentStorage += adjustment;
|
||||
if ( currentStorage > maxStorage )
|
||||
{
|
||||
double diff = currentStorage - maxStorage;
|
||||
data.setDouble( EnergyVar, maxStorage );
|
||||
return diff;
|
||||
}
|
||||
data.setDouble( EnergyVar, currentStorage );
|
||||
return 0;
|
||||
case EXTRACT:
|
||||
if ( currentStorage > adjustment )
|
||||
{
|
||||
currentStorage -= adjustment;
|
||||
data.setDouble( EnergyVar, currentStorage );
|
||||
return adjustment;
|
||||
}
|
||||
data.setDouble( EnergyVar, 0 );
|
||||
return currentStorage;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return currentStorage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getAEMaxPower(ItemStack is)
|
||||
public double getAEMaxPower( ItemStack is )
|
||||
{
|
||||
return maxStoredPower;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getAECurrentPower(ItemStack is)
|
||||
public double getAECurrentPower( ItemStack is )
|
||||
{
|
||||
return getInternalBattery( is, batteryOperation.STORAGE, 0 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public AccessRestriction getPowerFlow(ItemStack is)
|
||||
public AccessRestriction getPowerFlow( ItemStack is )
|
||||
{
|
||||
return AccessRestriction.WRITE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getDurabilityForDisplay(ItemStack is)
|
||||
private enum batteryOperation
|
||||
{
|
||||
return 1 - getAECurrentPower( is ) / getAEMaxPower( is );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(Item id, CreativeTabs tab, List list)
|
||||
{
|
||||
super.getSubItems( id, tab, list );
|
||||
|
||||
ItemStack charged = new ItemStack( this, 1 );
|
||||
NBTTagCompound tag = Platform.openNbtData( charged );
|
||||
tag.setDouble( "internalCurrentPower", getAEMaxPower( charged ) );
|
||||
tag.setDouble( "internalMaxPower", getAEMaxPower( charged ) );
|
||||
list.add( charged );
|
||||
STORAGE, INJECT, EXTRACT
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,27 +18,34 @@
|
||||
|
||||
package appeng.items.tools.powered.powersink;
|
||||
|
||||
import ic2.api.item.IElectricItemManager;
|
||||
import ic2.api.item.ISpecialElectricItem;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import ic2.api.item.IElectricItemManager;
|
||||
import ic2.api.item.ISpecialElectricItem;
|
||||
|
||||
import appeng.api.config.PowerUnits;
|
||||
import appeng.transformer.annotations.integration.Interface;
|
||||
import appeng.transformer.annotations.integration.InterfaceList;
|
||||
import appeng.transformer.annotations.integration.Method;
|
||||
|
||||
@InterfaceList(value = { @Interface(iface = "ic2.api.item.ISpecialElectricItem", iname = "IC2"),
|
||||
@Interface(iface = "ic2.api.item.IElectricItemManager", iname = "IC2") })
|
||||
|
||||
@InterfaceList( value = { @Interface( iface = "ic2.api.item.ISpecialElectricItem", iname = "IC2" ),
|
||||
@Interface( iface = "ic2.api.item.IElectricItemManager", iname = "IC2" ) } )
|
||||
public class IC2 extends AERootPoweredItem implements IElectricItemManager, ISpecialElectricItem
|
||||
{
|
||||
|
||||
public IC2(Class c, String subName) {
|
||||
public IC2( Class c, Optional<String> subName )
|
||||
{
|
||||
super( c, subName );
|
||||
}
|
||||
|
||||
@Override
|
||||
public double charge(ItemStack is, double amount, int tier, boolean ignoreTransferLimit, boolean simulate)
|
||||
public double charge( ItemStack is, double amount, int tier, boolean ignoreTransferLimit, boolean simulate )
|
||||
{
|
||||
double addedAmt = amount;
|
||||
double limit = getTransferLimit( is );
|
||||
@@ -46,29 +53,29 @@ public class IC2 extends AERootPoweredItem implements IElectricItemManager, ISpe
|
||||
if ( !ignoreTransferLimit && amount > limit )
|
||||
addedAmt = limit;
|
||||
|
||||
return addedAmt - ((int) injectExternalPower( PowerUnits.EU, is, addedAmt, simulate ));
|
||||
return addedAmt - ( ( int ) injectExternalPower( PowerUnits.EU, is, addedAmt, simulate ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public double discharge(ItemStack itemStack, double amount, int tier, boolean ignoreTransferLimit, boolean externally, boolean simulate)
|
||||
public double discharge( ItemStack itemStack, double amount, int tier, boolean ignoreTransferLimit, boolean externally, boolean simulate )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getCharge(ItemStack is)
|
||||
public double getCharge( ItemStack is )
|
||||
{
|
||||
return (int) PowerUnits.AE.convertTo( PowerUnits.EU, getAECurrentPower( is ) );
|
||||
return ( int ) PowerUnits.AE.convertTo( PowerUnits.EU, getAECurrentPower( is ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUse(ItemStack is, double amount)
|
||||
public boolean canUse( ItemStack is, double amount )
|
||||
{
|
||||
return getCharge( is ) > amount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean use(ItemStack is, double amount, EntityLivingBase entity)
|
||||
public boolean use( ItemStack is, double amount, EntityLivingBase entity )
|
||||
{
|
||||
if ( canUse( is, amount ) )
|
||||
{
|
||||
@@ -80,56 +87,56 @@ public class IC2 extends AERootPoweredItem implements IElectricItemManager, ISpe
|
||||
}
|
||||
|
||||
@Override
|
||||
public void chargeFromArmor(ItemStack itemStack, EntityLivingBase entity)
|
||||
public void chargeFromArmor( ItemStack itemStack, EntityLivingBase entity )
|
||||
{
|
||||
// wtf?
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getToolTip(ItemStack itemStack)
|
||||
public String getToolTip( ItemStack itemStack )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideEnergy(ItemStack itemStack)
|
||||
public boolean canProvideEnergy( ItemStack itemStack )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getChargedItem(ItemStack itemStack)
|
||||
public Item getChargedItem( ItemStack itemStack )
|
||||
{
|
||||
return itemStack.getItem();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getEmptyItem(ItemStack itemStack)
|
||||
public Item getEmptyItem( ItemStack itemStack )
|
||||
{
|
||||
return itemStack.getItem();
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMaxCharge(ItemStack itemStack)
|
||||
public double getMaxCharge( ItemStack itemStack )
|
||||
{
|
||||
return PowerUnits.AE.convertTo( PowerUnits.EU, getAEMaxPower( itemStack ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTier(ItemStack itemStack)
|
||||
public int getTier( ItemStack itemStack )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getTransferLimit(ItemStack itemStack)
|
||||
public double getTransferLimit( ItemStack itemStack )
|
||||
{
|
||||
return Math.max( 32, getMaxCharge( itemStack ) / 200 );
|
||||
}
|
||||
|
||||
@Override
|
||||
@Method(iname = "IC2")
|
||||
public IElectricItemManager getManager(ItemStack itemStack)
|
||||
@Method( iname = "IC2" )
|
||||
public IElectricItemManager getManager( ItemStack itemStack )
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -18,41 +18,48 @@
|
||||
|
||||
package appeng.items.tools.powered.powersink;
|
||||
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import appeng.api.config.PowerUnits;
|
||||
import appeng.transformer.annotations.integration.Interface;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
|
||||
@Interface(iface = "cofh.api.energy.IEnergyContainerItem", iname = "RFItem")
|
||||
import appeng.api.config.PowerUnits;
|
||||
import appeng.transformer.annotations.integration.Interface;
|
||||
|
||||
|
||||
@Interface( iface = "cofh.api.energy.IEnergyContainerItem", iname = "RFItem" )
|
||||
public class RedstoneFlux extends IC2 implements IEnergyContainerItem
|
||||
{
|
||||
|
||||
public RedstoneFlux(Class c, String subName) {
|
||||
public RedstoneFlux( Class c, Optional<String> subName )
|
||||
{
|
||||
super( c, subName );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int receiveEnergy(ItemStack is, int maxReceive, boolean simulate)
|
||||
public int receiveEnergy( ItemStack is, int maxReceive, boolean simulate )
|
||||
{
|
||||
return maxReceive - (int) injectExternalPower( PowerUnits.RF, is, maxReceive, simulate );
|
||||
return maxReceive - ( int ) injectExternalPower( PowerUnits.RF, is, maxReceive, simulate );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int extractEnergy(ItemStack container, int maxExtract, boolean simulate)
|
||||
public int extractEnergy( ItemStack container, int maxExtract, boolean simulate )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEnergyStored(ItemStack is)
|
||||
public int getEnergyStored( ItemStack is )
|
||||
{
|
||||
return (int) PowerUnits.AE.convertTo( PowerUnits.RF, getAECurrentPower( is ) );
|
||||
return ( int ) PowerUnits.AE.convertTo( PowerUnits.RF, getAECurrentPower( is ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxEnergyStored(ItemStack is)
|
||||
public int getMaxEnergyStored( ItemStack is )
|
||||
{
|
||||
return (int) PowerUnits.AE.convertTo( PowerUnits.RF, getAEMaxPower( is ) );
|
||||
return ( int ) PowerUnits.AE.convertTo( PowerUnits.RF, getAEMaxPower( is ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user