Format sourcecode
This commit is contained in:
@@ -44,10 +44,10 @@ public abstract class AEBaseItem extends Item
|
||||
public String toString()
|
||||
{
|
||||
String regName = getRegistryName() != null ? getRegistryName().getResourcePath() : "unregistered";
|
||||
return getClass().getSimpleName() + "[" + regName + "]";
|
||||
return getClass().getSimpleName() + "[" + regName + "]";
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SideOnly( Side.CLIENT )
|
||||
@Override
|
||||
@SuppressWarnings( "unchecked" )
|
||||
public final void addInformation( final ItemStack stack, final World world, final List lines, final ITooltipFlag advancedTooltips )
|
||||
@@ -59,7 +59,7 @@ public abstract class AEBaseItem extends Item
|
||||
@SuppressWarnings( "unchecked" )
|
||||
public final void getSubItems( final CreativeTabs creativeTab, final NonNullList<ItemStack> itemStacks )
|
||||
{
|
||||
if(isInCreativeTab(creativeTab))
|
||||
if( isInCreativeTab( creativeTab ) )
|
||||
this.getCheckedSubItems( creativeTab, itemStacks );
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ public abstract class AEBaseItem extends Item
|
||||
return false;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SideOnly( Side.CLIENT )
|
||||
protected void addCheckedInformation( final ItemStack stack, final World world, final List<String> lines, final ITooltipFlag advancedTooltips )
|
||||
{
|
||||
super.addInformation( stack, world, lines, advancedTooltips );
|
||||
|
||||
@@ -124,7 +124,8 @@ public class NetworkToolViewer implements INetworkTool
|
||||
@Override
|
||||
public boolean isItemValidForSlot( final int i, final ItemStack itemstack )
|
||||
{
|
||||
return this.inv.isItemValidForSlot( i, itemstack ) && itemstack.getItem() instanceof IUpgradeModule && ( (IUpgradeModule) itemstack.getItem() ).getType( itemstack ) != null;
|
||||
return this.inv.isItemValidForSlot( i,
|
||||
itemstack ) && itemstack.getItem() instanceof IUpgradeModule && ( (IUpgradeModule) itemstack.getItem() ).getType( itemstack ) != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -97,7 +97,8 @@ public class PortableCellViewer extends MEMonitorHandler<IAEItemStack> implement
|
||||
@Override
|
||||
public IConfigManager getConfigManager()
|
||||
{
|
||||
final ConfigManager out = new ConfigManager( new IConfigManagerHost(){
|
||||
final ConfigManager out = new ConfigManager( new IConfigManagerHost()
|
||||
{
|
||||
|
||||
@Override
|
||||
public void updateSetting( final IConfigManager manager, final Enum settingName, final Enum newValue )
|
||||
|
||||
@@ -304,10 +304,10 @@ public final class ItemMaterial extends AEBaseItem implements IStorageComponent,
|
||||
upgrades = ( (ISegmentedInventory) te ).getInventoryByName( "upgrades" );
|
||||
}
|
||||
|
||||
if( upgrades != null && !player.getHeldItem(hand).isEmpty() && player.getHeldItem(hand).getItem() instanceof IUpgradeModule )
|
||||
if( upgrades != null && !player.getHeldItem( hand ).isEmpty() && player.getHeldItem( hand ).getItem() instanceof IUpgradeModule )
|
||||
{
|
||||
final IUpgradeModule um = (IUpgradeModule) player.getHeldItem(hand).getItem();
|
||||
final Upgrades u = um.getType( player.getHeldItem(hand) );
|
||||
final IUpgradeModule um = (IUpgradeModule) player.getHeldItem( hand ).getItem();
|
||||
final Upgrades u = um.getType( player.getHeldItem( hand ) );
|
||||
|
||||
if( u != null )
|
||||
{
|
||||
@@ -319,7 +319,7 @@ public final class ItemMaterial extends AEBaseItem implements IStorageComponent,
|
||||
return EnumActionResult.PASS;
|
||||
}
|
||||
|
||||
player.inventory.setInventorySlotContents( player.inventory.currentItem, ad.addItems( player.getHeldItem(hand) ) );
|
||||
player.inventory.setInventorySlotContents( player.inventory.currentItem, ad.addItems( player.getHeldItem( hand ) ) );
|
||||
return EnumActionResult.SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,7 +143,8 @@ public enum MaterialType
|
||||
this( metaValue, modelName, features );
|
||||
this.droppedEntity = c;
|
||||
|
||||
EntityRegistry.registerModEntity( new ResourceLocation( "appliedenergistics2", this.droppedEntity.getName() ), this.droppedEntity, this.droppedEntity.getSimpleName(),
|
||||
EntityRegistry.registerModEntity( new ResourceLocation( "appliedenergistics2", this.droppedEntity.getName() ), this.droppedEntity,
|
||||
this.droppedEntity.getSimpleName(),
|
||||
EntityIds.get( this.droppedEntity ), AppEng.instance(), 16, 4,
|
||||
true );
|
||||
}
|
||||
@@ -153,7 +154,8 @@ public enum MaterialType
|
||||
this( metaValue, modelName, features );
|
||||
this.oreName = oreDictionary;
|
||||
this.droppedEntity = c;
|
||||
EntityRegistry.registerModEntity( new ResourceLocation( "appliedenergistics2", this.droppedEntity.getName() ), this.droppedEntity, this.droppedEntity.getSimpleName(),
|
||||
EntityRegistry.registerModEntity( new ResourceLocation( "appliedenergistics2", this.droppedEntity.getName() ), this.droppedEntity,
|
||||
this.droppedEntity.getSimpleName(),
|
||||
EntityIds.get( this.droppedEntity ), AppEng.instance(), 16, 4,
|
||||
true );
|
||||
}
|
||||
|
||||
@@ -66,14 +66,19 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal
|
||||
{
|
||||
this.setHasSubtypes( true );
|
||||
|
||||
EntityRegistry.registerModEntity( new ResourceLocation( "appliedenergistics2", EntityGrowingCrystal.class.getName() ), EntityGrowingCrystal.class, EntityGrowingCrystal.class.getSimpleName(), EntityIds.get( EntityGrowingCrystal.class ), AppEng.instance(), 16, 4, true );
|
||||
EntityRegistry.registerModEntity( new ResourceLocation( "appliedenergistics2", EntityGrowingCrystal.class.getName() ), EntityGrowingCrystal.class,
|
||||
EntityGrowingCrystal.class.getSimpleName(), EntityIds.get( EntityGrowingCrystal.class ), AppEng.instance(), 16, 4, true );
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static ResolverResult getResolver( final int certus2 )
|
||||
{
|
||||
|
||||
return AEApi.instance().definitions().items().crystalSeed().maybeStack( 1 )
|
||||
return AEApi.instance()
|
||||
.definitions()
|
||||
.items()
|
||||
.crystalSeed()
|
||||
.maybeStack( 1 )
|
||||
.map( crystalSeedStack ->
|
||||
{
|
||||
crystalSeedStack.setItemDamage( certus2 );
|
||||
@@ -236,7 +241,7 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal
|
||||
|
||||
// Cannot read the pickup delay of the original item, so we
|
||||
// use the pickup delay used for items dropped by a player instead
|
||||
egc.setPickupDelay(40);
|
||||
egc.setPickupDelay( 40 );
|
||||
|
||||
return egc;
|
||||
}
|
||||
|
||||
@@ -61,15 +61,15 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick( final World w, final EntityPlayer player, final EnumHand hand )
|
||||
{
|
||||
this.clearPattern( player.getHeldItem(hand), player );
|
||||
this.clearPattern( player.getHeldItem( hand ), player );
|
||||
|
||||
return new ActionResult<ItemStack>( EnumActionResult.SUCCESS, player.getHeldItem(hand) );
|
||||
return new ActionResult<ItemStack>( EnumActionResult.SUCCESS, player.getHeldItem( hand ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumActionResult onItemUseFirst( final EntityPlayer player, final World world, final BlockPos pos, final EnumFacing side, final float hitX, final float hitY, final float hitZ, final EnumHand hand )
|
||||
{
|
||||
return this.clearPattern( player.getHeldItem(hand), player ) ? EnumActionResult.SUCCESS : EnumActionResult.PASS;
|
||||
return this.clearPattern( player.getHeldItem( hand ), player ) ? EnumActionResult.SUCCESS : EnumActionResult.PASS;
|
||||
}
|
||||
|
||||
private boolean clearPattern( final ItemStack stack, final EntityPlayer player )
|
||||
|
||||
@@ -72,7 +72,7 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
|
||||
@Override
|
||||
public EnumActionResult onItemUseFirst( final EntityPlayer player, final World world, final BlockPos pos, final EnumFacing side, final float hitX, final float hitY, final float hitZ, final EnumHand hand )
|
||||
{
|
||||
return AEApi.instance().partHelper().placeBus( player.getHeldItem(hand), pos, side, player, hand, world );
|
||||
return AEApi.instance().partHelper().placeBus( player.getHeldItem( hand ), pos, side, player, hand, world );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -183,7 +183,8 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
final boolean defaultValue = ( b.isTopSolid( blockState ) && hasSimpleModel( blockState ) && !b.getTickRandomly() && !hasTile && !disableOre ) || enableGlass;
|
||||
final boolean defaultValue = ( b
|
||||
.isTopSolid( blockState ) && hasSimpleModel( blockState ) && !b.getTickRandomly() && !hasTile && !disableOre ) || enableGlass;
|
||||
if( FacadeConfig.instance().checkEnabled( b, metadata, defaultValue ) )
|
||||
{
|
||||
if( returnItem )
|
||||
@@ -236,13 +237,16 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
|
||||
}
|
||||
|
||||
Item item = Item.REGISTRY.getObjectById( data[0] );
|
||||
if ( item == null ) {
|
||||
if( item == null )
|
||||
{
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
itemId = item.getRegistryName();
|
||||
itemDamage = data[1];
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
// First item is numeric item id, second is damage
|
||||
itemId = new ResourceLocation( nbt.getString( TAG_ITEM_ID ) );
|
||||
itemDamage = nbt.getInteger( TAG_DAMAGE );
|
||||
@@ -309,12 +313,17 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
|
||||
|
||||
public ItemStack createFromIDs( final int[] ids )
|
||||
{
|
||||
ItemStack facadeStack = AEApi.instance().definitions().items().facade().maybeStack( 1 )
|
||||
ItemStack facadeStack = AEApi.instance()
|
||||
.definitions()
|
||||
.items()
|
||||
.facade()
|
||||
.maybeStack( 1 )
|
||||
.orElseThrow( () -> new MissingDefinition( "Tried to create a facade, while facades are being deactivated." ) );
|
||||
|
||||
// Convert back to a registry name...
|
||||
Item item = Item.REGISTRY.getObjectById( ids[0] );
|
||||
if ( item == null ) {
|
||||
if( item == null )
|
||||
{
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
|
||||
@@ -154,12 +154,12 @@ public final class ItemPart extends AEBaseItem implements IPartItem, IItemGroup
|
||||
@Override
|
||||
public EnumActionResult onItemUse( final EntityPlayer player, final World w, final BlockPos pos, final EnumHand hand, final EnumFacing side, final float hitX, final float hitY, final float hitZ )
|
||||
{
|
||||
if( this.getTypeByStack( player.getHeldItem(hand) ) == PartType.INVALID_TYPE )
|
||||
if( this.getTypeByStack( player.getHeldItem( hand ) ) == PartType.INVALID_TYPE )
|
||||
{
|
||||
return EnumActionResult.FAIL;
|
||||
}
|
||||
|
||||
return AEApi.instance().partHelper().placeBus( player.getHeldItem(hand), pos, side, player, hand, w );
|
||||
return AEApi.instance().partHelper().placeBus( player.getHeldItem( hand ), pos, side, player, hand, w );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -242,19 +242,23 @@ public final class ItemPart extends AEBaseItem implements IPartItem, IItemGroup
|
||||
}
|
||||
catch( final InstantiationException e )
|
||||
{
|
||||
throw new IllegalStateException( "Unable to construct IBusPart from IBusItem : " + part.getName() + " ; Possibly didn't have correct constructor( ItemStack )", e );
|
||||
throw new IllegalStateException( "Unable to construct IBusPart from IBusItem : " + part
|
||||
.getName() + " ; Possibly didn't have correct constructor( ItemStack )", e );
|
||||
}
|
||||
catch( final IllegalAccessException e )
|
||||
{
|
||||
throw new IllegalStateException( "Unable to construct IBusPart from IBusItem : " + part.getName() + " ; Possibly didn't have correct constructor( ItemStack )", e );
|
||||
throw new IllegalStateException( "Unable to construct IBusPart from IBusItem : " + part
|
||||
.getName() + " ; Possibly didn't have correct constructor( ItemStack )", e );
|
||||
}
|
||||
catch( final InvocationTargetException e )
|
||||
{
|
||||
throw new IllegalStateException( "Unable to construct IBusPart from IBusItem : " + part.getName() + " ; Possibly didn't have correct constructor( ItemStack )", e );
|
||||
throw new IllegalStateException( "Unable to construct IBusPart from IBusItem : " + part
|
||||
.getName() + " ; Possibly didn't have correct constructor( ItemStack )", e );
|
||||
}
|
||||
catch( final NoSuchMethodException e )
|
||||
{
|
||||
throw new IllegalStateException( "Unable to construct IBusPart from IBusItem : " + part.getName() + " ; Possibly didn't have correct constructor( ItemStack )", e );
|
||||
throw new IllegalStateException( "Unable to construct IBusPart from IBusItem : " + part
|
||||
.getName() + " ; Possibly didn't have correct constructor( ItemStack )", e );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,5 +35,4 @@ import java.lang.annotation.Target;
|
||||
ElementType.METHOD
|
||||
} )
|
||||
public @interface PartModels
|
||||
{
|
||||
}
|
||||
{}
|
||||
|
||||
@@ -131,7 +131,8 @@ public enum PartType
|
||||
}
|
||||
},
|
||||
|
||||
CABLE_DENSE_SMART( 60, "cable_dense_smart", EnumSet.of( AEFeature.CHANNELS, AEFeature.DENSE_CABLES ), EnumSet.noneOf( IntegrationType.class ), PartDenseCable.class )
|
||||
CABLE_DENSE_SMART( 60, "cable_dense_smart", EnumSet.of( AEFeature.CHANNELS, AEFeature.DENSE_CABLES ), EnumSet
|
||||
.noneOf( IntegrationType.class ), PartDenseCable.class )
|
||||
{
|
||||
@Override
|
||||
public boolean isCable()
|
||||
@@ -181,7 +182,8 @@ public enum PartType
|
||||
|
||||
PATTERN_TERMINAL( 340, "pattern_terminal", EnumSet.of( AEFeature.PATTERNS ), EnumSet.noneOf( IntegrationType.class ), PartPatternTerminal.class ),
|
||||
|
||||
CRAFTING_TERMINAL( 360, "crafting_terminal", EnumSet.of( AEFeature.CRAFTING_TERMINAL ), EnumSet.noneOf( IntegrationType.class ), PartCraftingTerminal.class ),
|
||||
CRAFTING_TERMINAL( 360, "crafting_terminal", EnumSet.of( AEFeature.CRAFTING_TERMINAL ), EnumSet
|
||||
.noneOf( IntegrationType.class ), PartCraftingTerminal.class ),
|
||||
|
||||
TERMINAL( 380, "terminal", EnumSet.of( AEFeature.TERMINAL ), EnumSet.noneOf( IntegrationType.class ), PartTerminal.class ),
|
||||
|
||||
@@ -233,7 +235,7 @@ public enum PartType
|
||||
},
|
||||
|
||||
P2P_TUNNEL_IC2( 465, "p2p_tunnel_ic2", EnumSet.of( AEFeature.P2P_TUNNEL, AEFeature.P2P_TUNNEL_EU ), EnumSet
|
||||
.of ( IntegrationType.IC2 ), PartP2PIC2Power.class, GuiText.EUTunnel )
|
||||
.of( IntegrationType.IC2 ), PartP2PIC2Power.class, GuiText.EUTunnel )
|
||||
{
|
||||
@Override
|
||||
String getUnlocalizedName()
|
||||
@@ -243,7 +245,7 @@ public enum PartType
|
||||
},
|
||||
|
||||
P2P_TUNNEL_RF( 466, "p2p_tunnel_rf", EnumSet.of( AEFeature.P2P_TUNNEL, AEFeature.P2P_TUNNEL_RF ), EnumSet
|
||||
.of ( IntegrationType.RF ), PartP2PRFPower.class, GuiText.RFTunnel )
|
||||
.of( IntegrationType.RF ), PartP2PRFPower.class, GuiText.RFTunnel )
|
||||
{
|
||||
@Override
|
||||
String getUnlocalizedName()
|
||||
@@ -263,13 +265,13 @@ public enum PartType
|
||||
},
|
||||
|
||||
P2P_TUNNEL_FE( 469, "p2p_tunnel_fe", EnumSet.of( AEFeature.P2P_TUNNEL, AEFeature.P2P_TUNNEL_FE ), EnumSet
|
||||
.noneOf( IntegrationType.class ), PartP2PFEPower.class, GuiText.FETunnel )
|
||||
.noneOf( IntegrationType.class ), PartP2PFEPower.class, GuiText.FETunnel )
|
||||
{
|
||||
@Override
|
||||
String getUnlocalizedName()
|
||||
{
|
||||
return "p2p_tunnel";
|
||||
}
|
||||
{
|
||||
return "p2p_tunnel";
|
||||
}
|
||||
},
|
||||
|
||||
// P2PTunnelOpenComputers( 468, EnumSet.of( AEFeature.P2PTunnel, AEFeature.P2PTunnelOpenComputers ), EnumSet.of(
|
||||
|
||||
@@ -110,9 +110,11 @@ public final class ItemBasicStorageCell extends AEBaseItem implements IStorageCe
|
||||
|
||||
if( cellInventory != null )
|
||||
{
|
||||
lines.add( cellInventory.getUsedBytes() + " " + GuiText.Of.getLocal() + ' ' + cellInventory.getTotalBytes() + ' ' + GuiText.BytesUsed.getLocal() );
|
||||
lines.add(
|
||||
cellInventory.getUsedBytes() + " " + GuiText.Of.getLocal() + ' ' + cellInventory.getTotalBytes() + ' ' + GuiText.BytesUsed.getLocal() );
|
||||
|
||||
lines.add( cellInventory.getStoredItemTypes() + " " + GuiText.Of.getLocal() + ' ' + cellInventory.getTotalItemTypes() + ' ' + GuiText.Types.getLocal() );
|
||||
lines.add( cellInventory.getStoredItemTypes() + " " + GuiText.Of.getLocal() + ' ' + cellInventory.getTotalItemTypes() + ' ' + GuiText.Types
|
||||
.getLocal() );
|
||||
|
||||
if( handler.isPreformatted() )
|
||||
{
|
||||
@@ -220,8 +222,8 @@ public final class ItemBasicStorageCell extends AEBaseItem implements IStorageCe
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick( final World world, final EntityPlayer player, final EnumHand hand )
|
||||
{
|
||||
this.disassembleDrive( player.getHeldItem(hand), world, player );
|
||||
return new ActionResult<ItemStack>( EnumActionResult.SUCCESS, player.getHeldItem(hand) );
|
||||
this.disassembleDrive( player.getHeldItem( hand ), world, player );
|
||||
return new ActionResult<ItemStack>( EnumActionResult.SUCCESS, player.getHeldItem( hand ) );
|
||||
}
|
||||
|
||||
private boolean disassembleDrive( final ItemStack stack, final World world, final EntityPlayer player )
|
||||
@@ -287,13 +289,17 @@ public final class ItemBasicStorageCell extends AEBaseItem implements IStorageCe
|
||||
@Override
|
||||
public EnumActionResult onItemUseFirst( final EntityPlayer player, final World world, final BlockPos pos, final EnumFacing side, final float hitX, final float hitY, final float hitZ, final EnumHand hand )
|
||||
{
|
||||
return this.disassembleDrive( player.getHeldItem(hand), world, player ) ? EnumActionResult.SUCCESS : EnumActionResult.PASS;
|
||||
return this.disassembleDrive( player.getHeldItem( hand ), world, player ) ? EnumActionResult.SUCCESS : EnumActionResult.PASS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getContainerItem( final ItemStack itemStack )
|
||||
{
|
||||
return AEApi.instance().definitions().materials().emptyStorageCell().maybeStack( 1 )
|
||||
return AEApi.instance()
|
||||
.definitions()
|
||||
.materials()
|
||||
.emptyStorageCell()
|
||||
.maybeStack( 1 )
|
||||
.orElseThrow( () -> new MissingDefinition( "Tried to use empty storage cells while basic storage cells are defined." ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class ItemCreativeStorageCell extends AEBaseItem implements ICellWorkbenchItem
|
||||
{
|
||||
|
||||
@@ -82,7 +83,7 @@ public class ItemCreativeStorageCell extends AEBaseItem implements ICellWorkbenc
|
||||
{
|
||||
final IMEInventoryHandler<?> inventory = AEApi.instance().registries().cell().getCellInventory( stack, null, StorageChannel.ITEMS );
|
||||
|
||||
if( inventory instanceof ICellInventoryHandler)
|
||||
if( inventory instanceof ICellInventoryHandler )
|
||||
{
|
||||
final CellConfig cc = new CellConfig( stack );
|
||||
|
||||
|
||||
@@ -170,7 +170,8 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag
|
||||
}
|
||||
|
||||
final int floorBuffer = 64;
|
||||
StorageHelper.getInstance().swapRegions( w, min.x + 1, min.y + 1, min.z + 1, destination, 0, floorBuffer, 0, targetX - 1, targetY - 1, targetZ - 1 );
|
||||
StorageHelper.getInstance().swapRegions( w, min.x + 1, min.y + 1, min.z + 1, destination, 0, floorBuffer, 0, targetX - 1, targetY - 1,
|
||||
targetZ - 1 );
|
||||
this.setStoredSize( is, targetX, targetY, targetZ );
|
||||
|
||||
return new TransitionResult( true, 0 );
|
||||
|
||||
@@ -58,14 +58,14 @@ public class ToolBiometricCard extends AEBaseItem implements IBiometricCard
|
||||
{
|
||||
if( p.isSneaking() )
|
||||
{
|
||||
this.encode( p.getHeldItem(hand), p );
|
||||
this.encode( p.getHeldItem( hand ), p );
|
||||
p.swingArm( hand );
|
||||
return new ActionResult<ItemStack>( EnumActionResult.SUCCESS, p.getHeldItem(hand) );
|
||||
return new ActionResult<ItemStack>( EnumActionResult.SUCCESS, p.getHeldItem( hand ) );
|
||||
}
|
||||
|
||||
return new ActionResult<ItemStack>( EnumActionResult.PASS, p.getHeldItem(hand) );
|
||||
return new ActionResult<ItemStack>( EnumActionResult.PASS, p.getHeldItem( hand ) );
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean itemInteractionForEntity( ItemStack is, final EntityPlayer player, final EntityLivingBase target, final EnumHand hand )
|
||||
{
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
package appeng.items.tools;
|
||||
|
||||
|
||||
|
||||
@@ -148,9 +148,9 @@ public class ToolMemoryCard extends AEBaseItem implements IMemoryCard
|
||||
{
|
||||
if( player.isSneaking() && !w.isRemote )
|
||||
{
|
||||
final IMemoryCard mem = (IMemoryCard) player.getHeldItem(hand).getItem();
|
||||
final IMemoryCard mem = (IMemoryCard) player.getHeldItem( hand ).getItem();
|
||||
mem.notifyUser( player, MemoryCardMessages.SETTINGS_CLEARED );
|
||||
player.getHeldItem(hand).setTagCompound( null );
|
||||
player.getHeldItem( hand ).setTagCompound( null );
|
||||
return EnumActionResult.SUCCESS;
|
||||
}
|
||||
else
|
||||
@@ -158,7 +158,7 @@ public class ToolMemoryCard extends AEBaseItem implements IMemoryCard
|
||||
return super.onItemUse( player, w, pos, hand, side, hx, hy, hz );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean doesSneakBypassUse( final ItemStack itemstack, final IBlockAccess world, final BlockPos pos, final EntityPlayer player )
|
||||
{
|
||||
|
||||
@@ -90,7 +90,7 @@ public class ToolNetworkTool extends AEBaseItem implements IGuiItem, IAEWrench /
|
||||
}
|
||||
}
|
||||
|
||||
return new ActionResult<ItemStack>( EnumActionResult.SUCCESS, p.getHeldItem(hand) );
|
||||
return new ActionResult<ItemStack>( EnumActionResult.SUCCESS, p.getHeldItem( hand ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -91,13 +91,13 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
|
||||
static
|
||||
{
|
||||
for( final AEColor color : AEColor.VALID_COLORS )
|
||||
{
|
||||
{
|
||||
final String dyeName = color.dye.getUnlocalizedName();
|
||||
final String oreDictName = "dye" + WordUtils.capitalize( dyeName );
|
||||
final int oreDictId = OreDictionary.getOreID( oreDictName );
|
||||
|
||||
ORE_TO_COLOR.put( oreDictId, color );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public ToolColorApplicator()
|
||||
@@ -108,7 +108,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
|
||||
@Override
|
||||
public EnumActionResult onItemUse( EntityPlayer p, World w, BlockPos pos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ )
|
||||
{
|
||||
return this.onItemUse( p.getHeldItem(hand), p, w, pos, hand, side, hitX, hitY, hitZ );
|
||||
return this.onItemUse( p.getHeldItem( hand ), p, w, pos, hand, side, hitX, hitY, hitZ );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -285,7 +285,8 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
|
||||
list.add( i );
|
||||
}
|
||||
|
||||
Collections.sort( list, new Comparator<IAEItemStack>(){
|
||||
Collections.sort( list, new Comparator<IAEItemStack>()
|
||||
{
|
||||
|
||||
@Override
|
||||
public int compare( final IAEItemStack a, final IAEItemStack b )
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
package appeng.items.tools.powered;
|
||||
|
||||
|
||||
@@ -32,7 +33,8 @@ public class ToolColorApplicatorRendering extends ItemRenderingCustomizer
|
||||
|
||||
private ModelResourceLocation getMesh( ItemStack itemStack )
|
||||
{
|
||||
// If the stack has no color, don't use the colored model since the impact of calling getColor for every quad is extremely high,
|
||||
// If the stack has no color, don't use the colored model since the impact of calling getColor for every quad is
|
||||
// extremely high,
|
||||
// if the stack tries to re-search its inventory for a new paintball everytime
|
||||
AEColor col = ( (ToolColorApplicator) itemStack.getItem() ).getActiveColor( itemStack );
|
||||
return ( col != null ) ? MODEL_COLORED : MODEL_UNCOLORED;
|
||||
|
||||
@@ -66,10 +66,13 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
|
||||
this.heatUp = new HashMap<InWorldToolOperationIngredient, InWorldToolOperationResult>();
|
||||
this.coolDown = new HashMap<InWorldToolOperationIngredient, InWorldToolOperationResult>();
|
||||
|
||||
this.coolDown.put( new InWorldToolOperationIngredient( Blocks.STONE.getDefaultState() ), new InWorldToolOperationResult( new ItemStack( Blocks.COBBLESTONE ) ) );
|
||||
this.coolDown.put( new InWorldToolOperationIngredient( Blocks.STONEBRICK.getDefaultState() ), new InWorldToolOperationResult( new ItemStack( Blocks.STONEBRICK, 1, 2 ) ) );
|
||||
this.coolDown.put( new InWorldToolOperationIngredient( Blocks.STONE.getDefaultState() ),
|
||||
new InWorldToolOperationResult( new ItemStack( Blocks.COBBLESTONE ) ) );
|
||||
this.coolDown.put( new InWorldToolOperationIngredient( Blocks.STONEBRICK.getDefaultState() ),
|
||||
new InWorldToolOperationResult( new ItemStack( Blocks.STONEBRICK, 1, 2 ) ) );
|
||||
this.coolDown.put( new InWorldToolOperationIngredient( Blocks.LAVA, true ), new InWorldToolOperationResult( new ItemStack( Blocks.OBSIDIAN ) ) );
|
||||
this.coolDown.put( new InWorldToolOperationIngredient( Blocks.FLOWING_LAVA, true ), new InWorldToolOperationResult( new ItemStack( Blocks.OBSIDIAN ) ) );
|
||||
this.coolDown.put( new InWorldToolOperationIngredient( Blocks.FLOWING_LAVA, true ),
|
||||
new InWorldToolOperationResult( new ItemStack( Blocks.OBSIDIAN ) ) );
|
||||
this.coolDown.put( new InWorldToolOperationIngredient( Blocks.GRASS, true ), new InWorldToolOperationResult( new ItemStack( Blocks.DIRT ) ) );
|
||||
|
||||
final List<ItemStack> snowBalls = new ArrayList<ItemStack>();
|
||||
@@ -215,7 +218,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
|
||||
|
||||
if( target == null )
|
||||
{
|
||||
return new ActionResult<ItemStack>( EnumActionResult.FAIL, p.getHeldItem(hand) );
|
||||
return new ActionResult<ItemStack>( EnumActionResult.FAIL, p.getHeldItem( hand ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -232,13 +235,13 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
|
||||
}
|
||||
}
|
||||
|
||||
return new ActionResult<ItemStack>( EnumActionResult.SUCCESS, p.getHeldItem(hand) );
|
||||
return new ActionResult<ItemStack>( EnumActionResult.SUCCESS, p.getHeldItem( hand ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumActionResult onItemUse( EntityPlayer p, World w, BlockPos pos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ )
|
||||
{
|
||||
return this.onItemUse( p.getHeldItem(hand), p, w, pos, hand, side, hitX, hitY, hitZ );
|
||||
return this.onItemUse( p.getHeldItem( hand ), p, w, pos, hand, side, hitX, hitY, hitZ );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -299,7 +302,8 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
|
||||
{
|
||||
if( result.getItem() instanceof ItemBlock )
|
||||
{
|
||||
if( Block.getBlockFromItem( result.getItem() ) == blockID && result.getItem().getDamage( result ) == blockID.getMetaFromState( state ) )
|
||||
if( Block.getBlockFromItem( result.getItem() ) == blockID && result.getItem().getDamage( result ) == blockID
|
||||
.getMetaFromState( state ) )
|
||||
{
|
||||
canFurnaceable = false;
|
||||
}
|
||||
@@ -318,7 +322,8 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
|
||||
{
|
||||
this.extractAEPower( item, 1600 );
|
||||
final InWorldToolOperationResult or = InWorldToolOperationResult.getBlockOperationResult( out.toArray( new ItemStack[out.size()] ) );
|
||||
w.playSound( p, pos.getX() + 0.5D, pos.getY() + 0.5D, pos.getZ() + 0.5D, SoundEvents.ITEM_FLINTANDSTEEL_USE, SoundCategory.PLAYERS, 1.0F, itemRand.nextFloat() * 0.4F + 0.8F );
|
||||
w.playSound( p, pos.getX() + 0.5D, pos.getY() + 0.5D, pos.getZ() + 0.5D, SoundEvents.ITEM_FLINTANDSTEEL_USE, SoundCategory.PLAYERS, 1.0F,
|
||||
itemRand.nextFloat() * 0.4F + 0.8F );
|
||||
|
||||
if( or.getBlockItem().isEmpty() )
|
||||
{
|
||||
@@ -349,7 +354,8 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
|
||||
if( w.isAirBlock( offsetPos ) )
|
||||
{
|
||||
this.extractAEPower( item, 1600 );
|
||||
w.playSound( p, offsetPos.getX() + 0.5D, offsetPos.getY() + 0.5D, offsetPos.getZ() + 0.5D, SoundEvents.ITEM_FLINTANDSTEEL_USE, SoundCategory.PLAYERS, 1.0F, itemRand.nextFloat() * 0.4F + 0.8F );
|
||||
w.playSound( p, offsetPos.getX() + 0.5D, offsetPos.getY() + 0.5D, offsetPos.getZ() + 0.5D, SoundEvents.ITEM_FLINTANDSTEEL_USE,
|
||||
SoundCategory.PLAYERS, 1.0F, itemRand.nextFloat() * 0.4F + 0.8F );
|
||||
w.setBlockState( offsetPos, Blocks.FIRE.getDefaultState() );
|
||||
}
|
||||
|
||||
|
||||
@@ -112,17 +112,17 @@ public class ToolMatterCannon extends AEBasePoweredItem implements IStorageCell
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick( final World w, final EntityPlayer p, final @Nullable EnumHand hand )
|
||||
{
|
||||
if( this.getAECurrentPower( p.getHeldItem(hand) ) > 1600 )
|
||||
if( this.getAECurrentPower( p.getHeldItem( hand ) ) > 1600 )
|
||||
{
|
||||
int shots = 1;
|
||||
|
||||
final CellUpgrades cu = (CellUpgrades) this.getUpgradesInventory( p.getHeldItem(hand) );
|
||||
final CellUpgrades cu = (CellUpgrades) this.getUpgradesInventory( p.getHeldItem( hand ) );
|
||||
if( cu != null )
|
||||
{
|
||||
shots += cu.getInstalledUpgrades( Upgrades.SPEED );
|
||||
}
|
||||
|
||||
final IMEInventory inv = AEApi.instance().registries().cell().getCellInventory( p.getHeldItem(hand), null, StorageChannel.ITEMS );
|
||||
final IMEInventory inv = AEApi.instance().registries().cell().getCellInventory( p.getHeldItem( hand ), null, StorageChannel.ITEMS );
|
||||
if( inv != null )
|
||||
{
|
||||
final IItemList itemList = inv.getAvailableItems( AEApi.instance().storage().createItemList() );
|
||||
@@ -132,25 +132,25 @@ public class ToolMatterCannon extends AEBasePoweredItem implements IStorageCell
|
||||
shots = Math.min( shots, (int) aeAmmo.getStackSize() );
|
||||
for( int sh = 0; sh < shots; sh++ )
|
||||
{
|
||||
this.extractAEPower( p.getHeldItem(hand), 1600 );
|
||||
this.extractAEPower( p.getHeldItem( hand ), 1600 );
|
||||
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
return new ActionResult<ItemStack>( EnumActionResult.SUCCESS, p.getHeldItem(hand) );
|
||||
return new ActionResult<ItemStack>( EnumActionResult.SUCCESS, p.getHeldItem( hand ) );
|
||||
}
|
||||
|
||||
aeAmmo.setStackSize( 1 );
|
||||
final ItemStack ammo = ( (IAEItemStack) aeAmmo ).getItemStack();
|
||||
if( ammo == null )
|
||||
{
|
||||
return new ActionResult<ItemStack>( EnumActionResult.SUCCESS, p.getHeldItem(hand) );
|
||||
return new ActionResult<ItemStack>( EnumActionResult.SUCCESS, p.getHeldItem( hand ) );
|
||||
}
|
||||
|
||||
ammo.setCount( 1 );
|
||||
aeAmmo = inv.extractItems( aeAmmo, Actionable.MODULATE, new PlayerSource( p, null ) );
|
||||
if( aeAmmo == null )
|
||||
{
|
||||
return new ActionResult<ItemStack>( EnumActionResult.SUCCESS, p.getHeldItem(hand) );
|
||||
return new ActionResult<ItemStack>( EnumActionResult.SUCCESS, p.getHeldItem( hand ) );
|
||||
}
|
||||
|
||||
final LookDirection dir = Platform.getPlayerRay( p, p.getEyeHeight() );
|
||||
@@ -172,7 +172,7 @@ public class ToolMatterCannon extends AEBasePoweredItem implements IStorageCell
|
||||
{
|
||||
this.shootPaintBalls( type, w, p, Vec3d, Vec3d1, direction, d0, d1, d2 );
|
||||
}
|
||||
return new ActionResult<ItemStack>( EnumActionResult.SUCCESS, p.getHeldItem(hand) );
|
||||
return new ActionResult<ItemStack>( EnumActionResult.SUCCESS, p.getHeldItem( hand ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -186,16 +186,17 @@ public class ToolMatterCannon extends AEBasePoweredItem implements IStorageCell
|
||||
{
|
||||
p.sendMessage( PlayerMessages.AmmoDepleted.get() );
|
||||
}
|
||||
return new ActionResult<ItemStack>( EnumActionResult.SUCCESS, p.getHeldItem(hand) );
|
||||
return new ActionResult<ItemStack>( EnumActionResult.SUCCESS, p.getHeldItem( hand ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
return new ActionResult<ItemStack>( EnumActionResult.FAIL, p.getHeldItem(hand) );
|
||||
return new ActionResult<ItemStack>( EnumActionResult.FAIL, p.getHeldItem( hand ) );
|
||||
}
|
||||
|
||||
private void shootPaintBalls( final ItemStack type, final World w, final EntityPlayer p, final Vec3d Vec3d, final Vec3d Vec3d1, final Vec3d direction, final double d0, final double d1, final double d2 )
|
||||
{
|
||||
final AxisAlignedBB bb = new AxisAlignedBB( Math.min( Vec3d.x, Vec3d1.x ), Math.min( Vec3d.y, Vec3d1.y ), Math.min( Vec3d.z, Vec3d1.z ), Math.max( Vec3d.x, Vec3d1.x ), Math.max( Vec3d.y, Vec3d1.y ), Math.max( Vec3d.z, Vec3d1.z ) ).grow( 16, 16, 16 );
|
||||
final AxisAlignedBB bb = new AxisAlignedBB( Math.min( Vec3d.x, Vec3d1.x ), Math.min( Vec3d.y, Vec3d1.y ), Math.min( Vec3d.z, Vec3d1.z ), Math
|
||||
.max( Vec3d.x, Vec3d1.x ), Math.max( Vec3d.y, Vec3d1.y ), Math.max( Vec3d.z, Vec3d1.z ) ).grow( 16, 16, 16 );
|
||||
|
||||
Entity entity = null;
|
||||
final List list = w.getEntitiesWithinAABBExcludingEntity( p, bb );
|
||||
@@ -248,7 +249,9 @@ public class ToolMatterCannon extends AEBasePoweredItem implements IStorageCell
|
||||
|
||||
try
|
||||
{
|
||||
AppEng.proxy.sendToAllNearExcept( null, d0, d1, d2, 128, w, new PacketMatterCannon( d0, d1, d2, (float) direction.x, (float) direction.y, (float) direction.z, (byte) ( pos == null ? 32 : pos.hitVec.squareDistanceTo( vec ) + 1 ) ) );
|
||||
AppEng.proxy.sendToAllNearExcept( null, d0, d1, d2, 128, w,
|
||||
new PacketMatterCannon( d0, d1, d2, (float) direction.x, (float) direction.y, (float) direction.z, (byte) ( pos == null ? 32 : pos.hitVec
|
||||
.squareDistanceTo( vec ) + 1 ) ) );
|
||||
}
|
||||
catch( final Exception err )
|
||||
{
|
||||
@@ -313,7 +316,8 @@ public class ToolMatterCannon extends AEBasePoweredItem implements IStorageCell
|
||||
{
|
||||
hasDestroyed = false;
|
||||
|
||||
final AxisAlignedBB bb = new AxisAlignedBB( Math.min( Vec3d.x, Vec3d1.x ), Math.min( Vec3d.y, Vec3d1.y ), Math.min( Vec3d.z, Vec3d1.z ), Math.max( Vec3d.x, Vec3d1.x ), Math.max( Vec3d.y, Vec3d1.y ), Math.max( Vec3d.z, Vec3d1.z ) ).grow( 16, 16, 16 );
|
||||
final AxisAlignedBB bb = new AxisAlignedBB( Math.min( Vec3d.x, Vec3d1.x ), Math.min( Vec3d.y, Vec3d1.y ), Math.min( Vec3d.z, Vec3d1.z ), Math
|
||||
.max( Vec3d.x, Vec3d1.x ), Math.max( Vec3d.y, Vec3d1.y ), Math.max( Vec3d.z, Vec3d1.z ) ).grow( 16, 16, 16 );
|
||||
|
||||
Entity entity = null;
|
||||
final List list = w.getEntitiesWithinAABBExcludingEntity( p, bb );
|
||||
@@ -365,7 +369,9 @@ public class ToolMatterCannon extends AEBasePoweredItem implements IStorageCell
|
||||
|
||||
try
|
||||
{
|
||||
AppEng.proxy.sendToAllNearExcept( null, d0, d1, d2, 128, w, new PacketMatterCannon( d0, d1, d2, (float) direction.x, (float) direction.y, (float) direction.z, (byte) ( pos == null ? 32 : pos.hitVec.squareDistanceTo( vec ) + 1 ) ) );
|
||||
AppEng.proxy.sendToAllNearExcept( null, d0, d1, d2, 128, w,
|
||||
new PacketMatterCannon( d0, d1, d2, (float) direction.x, (float) direction.y, (float) direction.z, (byte) ( pos == null ? 32 : pos.hitVec
|
||||
.squareDistanceTo( vec ) + 1 ) ) );
|
||||
}
|
||||
catch( final Exception err )
|
||||
{
|
||||
|
||||
@@ -68,7 +68,7 @@ public class ToolPortableCell extends AEBasePoweredItem implements IStorageCell,
|
||||
public ActionResult<ItemStack> onItemRightClick( final World w, final EntityPlayer player, final EnumHand hand )
|
||||
{
|
||||
Platform.openGUI( player, null, AEPartLocation.INTERNAL, GuiBridge.GUI_PORTABLE_CELL );
|
||||
return new ActionResult<ItemStack>( EnumActionResult.SUCCESS, player.getHeldItem(hand) );
|
||||
return new ActionResult<ItemStack>( EnumActionResult.SUCCESS, player.getHeldItem( hand ) );
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
@@ -190,8 +190,8 @@ public class ToolPortableCell extends AEBasePoweredItem implements IStorageCell,
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldCauseReequipAnimation( ItemStack oldStack, ItemStack newStack, boolean slotChanged )
|
||||
public boolean shouldCauseReequipAnimation( ItemStack oldStack, ItemStack newStack, boolean slotChanged )
|
||||
{
|
||||
return slotChanged;
|
||||
return slotChanged;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,8 +59,8 @@ public class ToolWirelessTerminal extends AEBasePoweredItem implements IWireless
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick( final World w, final EntityPlayer player, final EnumHand hand )
|
||||
{
|
||||
AEApi.instance().registries().wireless().openWirelessTerminalGui( player.getHeldItem(hand), w, player );
|
||||
return new ActionResult<ItemStack>( EnumActionResult.SUCCESS, player.getHeldItem(hand) );
|
||||
AEApi.instance().registries().wireless().openWirelessTerminalGui( player.getHeldItem( hand ), w, player );
|
||||
return new ActionResult<ItemStack>( EnumActionResult.SUCCESS, player.getHeldItem( hand ) );
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
@@ -120,7 +120,8 @@ public class ToolWirelessTerminal extends AEBasePoweredItem implements IWireless
|
||||
@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( final IConfigManager manager, final Enum settingName, final Enum newValue )
|
||||
@@ -153,9 +154,9 @@ public class ToolWirelessTerminal extends AEBasePoweredItem implements IWireless
|
||||
tag.setString( "name", name );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldCauseReequipAnimation( ItemStack oldStack, ItemStack newStack, boolean slotChanged )
|
||||
@Override
|
||||
public boolean shouldCauseReequipAnimation( ItemStack oldStack, ItemStack newStack, boolean slotChanged )
|
||||
{
|
||||
return slotChanged;
|
||||
}
|
||||
return slotChanged;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
///*
|
||||
/// *
|
||||
// * This file is part of Applied Energistics 2.
|
||||
// * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
|
||||
// *
|
||||
@@ -9,117 +9,118 @@
|
||||
// *
|
||||
// * Applied Energistics 2 is distributed in the hope that it will be useful,
|
||||
// * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// * GNU Lesser General Public License for more details.
|
||||
// *
|
||||
// * You should have received a copy of the GNU Lesser General Public License
|
||||
// * along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
|
||||
// * along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
|
||||
// */
|
||||
//
|
||||
//package appeng.items.tools.powered.powersink;
|
||||
// package appeng.items.tools.powered.powersink;
|
||||
//
|
||||
//
|
||||
//import net.minecraft.entity.EntityLivingBase;
|
||||
//import net.minecraft.item.ItemStack;
|
||||
// import net.minecraft.entity.EntityLivingBase;
|
||||
// import net.minecraft.item.ItemStack;
|
||||
//
|
||||
//import ic2.api.item.IElectricItemManager;
|
||||
//import ic2.api.item.ISpecialElectricItem;
|
||||
// import ic2.api.item.IElectricItemManager;
|
||||
// import ic2.api.item.ISpecialElectricItem;
|
||||
//
|
||||
//import appeng.api.config.PowerUnits;
|
||||
//import appeng.coremod.annotations.Integration.Interface;
|
||||
//import appeng.coremod.annotations.Integration.InterfaceList;
|
||||
//import appeng.coremod.annotations.Integration.Method;
|
||||
//import appeng.integration.IntegrationType;
|
||||
// import appeng.api.config.PowerUnits;
|
||||
// import appeng.coremod.annotations.Integration.Interface;
|
||||
// import appeng.coremod.annotations.Integration.InterfaceList;
|
||||
// import appeng.coremod.annotations.Integration.Method;
|
||||
// import appeng.integration.IntegrationType;
|
||||
//
|
||||
//
|
||||
//@InterfaceList( value = {
|
||||
// @Interface( iface = "ic2.api.item.ISpecialElectricItem", iname = IntegrationType.IC2 ),
|
||||
// @Interface( iface = "ic2.api.item.IElectricItemManager", iname = IntegrationType.IC2 )
|
||||
//} )
|
||||
//public abstract class IC2 extends AERootPoweredItem implements IElectricItemManager, ISpecialElectricItem
|
||||
//{
|
||||
// public IC2( double powerCapacity )
|
||||
// {
|
||||
// super( powerCapacity );
|
||||
// }
|
||||
// @InterfaceList( value = {
|
||||
// @Interface( iface = "ic2.api.item.ISpecialElectricItem", iname = IntegrationType.IC2 ),
|
||||
// @Interface( iface = "ic2.api.item.IElectricItemManager", iname = IntegrationType.IC2 )
|
||||
// } )
|
||||
// public abstract class IC2 extends AERootPoweredItem implements IElectricItemManager, ISpecialElectricItem
|
||||
// {
|
||||
// public IC2( double powerCapacity )
|
||||
// {
|
||||
// super( powerCapacity );
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public double charge( ItemStack is, double amount, int tier, boolean ignoreTransferLimit, boolean simulate )
|
||||
// {
|
||||
// double addedAmt = amount;
|
||||
// double limit = this.getTransferLimit( is );
|
||||
// @Override
|
||||
// public double charge( ItemStack is, double amount, int tier, boolean ignoreTransferLimit, boolean simulate )
|
||||
// {
|
||||
// double addedAmt = amount;
|
||||
// double limit = this.getTransferLimit( is );
|
||||
//
|
||||
// if( !ignoreTransferLimit && amount > limit )
|
||||
// {
|
||||
// addedAmt = limit;
|
||||
// }
|
||||
// if( !ignoreTransferLimit && amount > limit )
|
||||
// {
|
||||
// addedAmt = limit;
|
||||
// }
|
||||
//
|
||||
// return addedAmt - ( (int) this.injectExternalPower( PowerUnits.EU, is, addedAmt, simulate ) );
|
||||
// }
|
||||
// return addedAmt - ( (int) this.injectExternalPower( PowerUnits.EU, is, addedAmt, simulate ) );
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public double discharge( ItemStack itemStack, double amount, int tier, boolean ignoreTransferLimit, boolean externally, boolean simulate )
|
||||
// {
|
||||
// return 0;
|
||||
// }
|
||||
// @Override
|
||||
// public double discharge( ItemStack itemStack, double amount, int tier, boolean ignoreTransferLimit, boolean
|
||||
/// externally, boolean simulate )
|
||||
// {
|
||||
// return 0;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public double getCharge( ItemStack is )
|
||||
// {
|
||||
// return (int) PowerUnits.AE.convertTo( PowerUnits.EU, this.getAECurrentPower( is ) );
|
||||
// }
|
||||
// @Override
|
||||
// public double getCharge( ItemStack is )
|
||||
// {
|
||||
// return (int) PowerUnits.AE.convertTo( PowerUnits.EU, this.getAECurrentPower( is ) );
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean canUse( ItemStack is, double amount )
|
||||
// {
|
||||
// return this.getCharge( is ) > amount;
|
||||
// }
|
||||
// @Override
|
||||
// public boolean canUse( ItemStack is, double amount )
|
||||
// {
|
||||
// return this.getCharge( is ) > amount;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean use( ItemStack is, double amount, EntityLivingBase entity )
|
||||
// {
|
||||
// if( this.canUse( is, amount ) )
|
||||
// {
|
||||
// // use the power..
|
||||
// this.extractAEPower( is, PowerUnits.EU.convertTo( PowerUnits.AE, amount ) );
|
||||
// return true;
|
||||
// }
|
||||
// return false;
|
||||
// }
|
||||
// @Override
|
||||
// public boolean use( ItemStack is, double amount, EntityLivingBase entity )
|
||||
// {
|
||||
// if( this.canUse( is, amount ) )
|
||||
// {
|
||||
// // use the power..
|
||||
// this.extractAEPower( is, PowerUnits.EU.convertTo( PowerUnits.AE, amount ) );
|
||||
// return true;
|
||||
// }
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void chargeFromArmor( ItemStack itemStack, EntityLivingBase entity )
|
||||
// {
|
||||
// // wtf?
|
||||
// }
|
||||
// @Override
|
||||
// public void chargeFromArmor( ItemStack itemStack, EntityLivingBase entity )
|
||||
// {
|
||||
// // wtf?
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public String getToolTip( ItemStack itemStack )
|
||||
// {
|
||||
// return null;
|
||||
// }
|
||||
// @Override
|
||||
// public String getToolTip( ItemStack itemStack )
|
||||
// {
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public double getMaxCharge( ItemStack itemStack )
|
||||
// {
|
||||
// return PowerUnits.AE.convertTo( PowerUnits.EU, this.getAEMaxPower( itemStack ) );
|
||||
// }
|
||||
// @Override
|
||||
// public double getMaxCharge( ItemStack itemStack )
|
||||
// {
|
||||
// return PowerUnits.AE.convertTo( PowerUnits.EU, this.getAEMaxPower( itemStack ) );
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public int getTier( ItemStack itemStack )
|
||||
// {
|
||||
// return 1;
|
||||
// }
|
||||
// @Override
|
||||
// public int getTier( ItemStack itemStack )
|
||||
// {
|
||||
// return 1;
|
||||
// }
|
||||
//
|
||||
// private double getTransferLimit( ItemStack itemStack )
|
||||
// {
|
||||
// return Math.max( 32, this.getMaxCharge( itemStack ) / 200 );
|
||||
// }
|
||||
// private double getTransferLimit( ItemStack itemStack )
|
||||
// {
|
||||
// return Math.max( 32, this.getMaxCharge( itemStack ) / 200 );
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// @Method( iname = IntegrationType.IC2 )
|
||||
// public IElectricItemManager getManager( ItemStack itemStack )
|
||||
// {
|
||||
// return this;
|
||||
// }
|
||||
//}
|
||||
// @Override
|
||||
// @Method( iname = IntegrationType.IC2 )
|
||||
// public IElectricItemManager getManager( ItemStack itemStack )
|
||||
// {
|
||||
// return this;
|
||||
// }
|
||||
// }
|
||||
|
||||
@@ -67,7 +67,7 @@ public class ToolQuartzCuttingKnife extends AEBaseItem implements IGuiItem
|
||||
Platform.openGUI( p, null, AEPartLocation.INTERNAL, GuiBridge.GUI_QUARTZ_KNIFE );
|
||||
}
|
||||
p.swingArm( hand );
|
||||
return new ActionResult<ItemStack>( EnumActionResult.SUCCESS, p.getHeldItem(hand) );
|
||||
return new ActionResult<ItemStack>( EnumActionResult.SUCCESS, p.getHeldItem( hand ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -54,7 +54,8 @@ public class ToolQuartzWrench extends AEBaseItem implements IAEWrench /* , ITool
|
||||
{
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
//TODO 1.10-R - if we return FAIL on client, action will not be sent to server. Fix that in all Block#onItemUseFirst overrides.
|
||||
// TODO 1.10-R - if we return FAIL on client, action will not be sent to server. Fix that in all
|
||||
// Block#onItemUseFirst overrides.
|
||||
return !world.isRemote ? EnumActionResult.SUCCESS : EnumActionResult.PASS;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user