updated apis

This commit is contained in:
Robert 2013-11-12 15:55:24 -05:00
parent 4acb350cfd
commit 74c033b57f
26 changed files with 708 additions and 1465 deletions

View file

@ -26,8 +26,6 @@ public interface IMetaDelegate extends IEnergyTile {
/** /**
* Get the sub-TileEntities belonging to this Meta TileEntity. * Get the sub-TileEntities belonging to this Meta TileEntity.
* *
* @note the list has to be consistent between the EnergyNet Load and Unload events.
*
* @return sub-TileEntity array * @return sub-TileEntity array
*/ */
List<TileEntity> getSubTiles(); List<TileEntity> getSubTiles();

View file

@ -42,538 +42,346 @@ public final class Items {
/* Possible values: /* Possible values:
// ores ----- blocks -----
copperOre; // Copper Ore block, currently not meta sensitive, meta in ItemStack set to 0, ore dictionary: oreCopper, null with enableWorldGenOreCopper=false
tinOre; // Tin Ore block, currently not meta sensitive, meta in ItemStack set to 0, ore dictionary: oreTin, null with enableWorldGenOreTin=false ores
uraniumOre; // Tin Ore block, currently not meta sensitive, meta in ItemStack set to 0, ore dictionary: oreUranium, null with enableWorldGenOreUranium=false copperOre Copper Ore block, currently not meta sensitive, meta in ItemStack set to 0, ore dictionary: oreCopper, null with enableWorldGenOreCopper=false
leadOre; // Lead Ore Block, currently not meta sensitive, meta in ItemStack set to 0, ore dictionary: oreLead, null with enableWorldGenOreLead=false tinOre Tin Ore block, currently not meta sensitive, meta in ItemStack set to 0, ore dictionary: oreTin, null with enableWorldGenOreTin=false
uraniumOre Tin Ore block, currently not meta sensitive, meta in ItemStack set to 0, ore dictionary: oreUranium, null with enableWorldGenOreUranium=false
// rubber related
rubber related
Rubber wood block, meta reflects the state, meta in ItemStack set to 0, ore dictionary: woodRubber (with meta 0), null with enableWorldGenTreeRubber=false Rubber wood block, meta reflects the state, meta in ItemStack set to 0, ore dictionary: woodRubber (with meta 0), null with enableWorldGenTreeRubber=false
dropped (as an item) -> metadata 0 dropped (as an item) -> metadata 0
block, no resin spot -> metadata 0 or 1 block, no resin spot -> metadata 0 or 1
block, wet resin spot -> metadata 2-5 (according to the side) block, wet resin spot -> metadata 2-5 (according to the side)
block, dry resin spot -> metadata 8-11 (wet state + 6) block, dry resin spot -> metadata 8-11 (wet state + 6)
rubberWood; rubberWood
rubberLeaves; // Rubber Leaves block, currently not meta sensitive, meta in ItemStack set to 0, null with enableWorldGenTreeRubber=false rubberLeaves Rubber Leaves block, currently not meta sensitive, meta in ItemStack set to 0, null with enableWorldGenTreeRubber=false
rubberSapling; // Rubber Sapling block, currently not meta sensitive, meta in ItemStack set to 0, null with enableWorldGenTreeRubber=false rubberSapling Rubber Sapling block, currently not meta sensitive, meta in ItemStack set to 0, null with enableWorldGenTreeRubber=false
resinSheet; // Resin Sheet block, currently not meta sensitive resinSheet Resin Sheet block, currently not meta sensitive
rubberTrampoline; // Rubber Trampoline block, meta reflects internal state, meta in ItemStack set to 0 rubberTrampoline Rubber Trampoline block, meta reflects internal state, meta in ItemStack set to 0
// building/storage building/storage
ironFence; // Iron Fence block, currently not meta sensitive ironFence Iron Fence block, currently not meta sensitive
reinforcedStone; // Reinforced Stone block, currently not meta sensitive reinforcedStone Reinforced Stone block, currently not meta sensitive
reinforcedGlass; // Reinforced Glass block, currently not meta sensitive reinforcedGlass Reinforced Glass block, currently not meta sensitive
reinforcedDoorBlock; // Reinforced Door block, meta reflects the state (see vanilla doors), meta in ItemStack set to 0 reinforcedDoorBlock Reinforced Door block, meta reflects the state (see vanilla doors), meta in ItemStack set to 0
constructionreinforcedFoam; // Construction Reinforced Foam block, currently not meta sensitive constructionFoam Construction Foam block, currently not meta sensitive
constructionFoam; // Construction Foam block, currently not meta sensitive constructionFoamWall Construction Foam Wall block, meta = color, implements IPaintableBlock
constructionFoamWall; // Construction Foam Wall block, meta = color, implements IPaintableBlock scaffold Scaffold block, meta reflects internal physical model data
scaffold; // Scaffold block, meta reflects internal physical model data
ironScaffold; // Scaffold block, meta reflects internal physical model data bronzeBlock Bronze block, meta sensitive
copperBlock Copper block, meta sensitive
bronzeBlock; // Bronze block, meta sensitive tinBlock Tin block, meta sensitive
copperBlock; // Copper block, meta sensitive uraniumBlock Uranium block, meta sensitive
tinBlock; // Tin block, meta sensitive
uraniumBlock; // Uranium block, meta sensitive cables (when placed as a block, inventory items are different TE implements IEnergyConductor)
leadBlock; // Uranium block, meta sensitive copperCableBlock Copper Cable block, meta sensitive
insulatedCopperCableBlock Insulated Copper Cable block, meta sensitive
// cables (when placed as a block, inventory items are different; TE implements IEnergyConductor)
goldCableBlock Gold Cable block, meta sensitive
copperCableBlock; // Copper Cable block, meta sensitive insulatedGoldCableBlock Insulated Gold Cable block, meta sensitive
insulatedCopperCableBlock; // Insulated Copper Cable block, meta sensitive doubleInsulatedGoldCableBlock Double Insulated Gold Cable block, meta sensitive
goldCableBlock; // Gold Cable block, meta sensitive ironCableBlock Iron Cable block, meta sensitive
insulatedGoldCableBlock; // Insulated Gold Cable block, meta sensitive insulatedIronCableBlock Insulated Iron Cable block, meta sensitive
doubleInsulatedGoldCableBlock; // Double Insulated Gold Cable block, meta sensitive doubleInsulatedIronCableBlock Double Insulated Iron Cable block, meta sensitive
trippleInsulatedIronCableBlock Tripple Insulated Iron Cable block, meta sensitive
ironCableBlock; // Iron Cable block, meta sensitive
insulatedIronCableBlock; // Insulated Iron Cable block, meta sensitive glassFiberCableBlock Glass Fiber Cable block, meta sensitive
doubleInsulatedIronCableBlock; // Double Insulated Iron Cable block, meta sensitive
trippleInsulatedIronCableBlock; // Tripple Insulated Iron Cable block, meta sensitive tinCableBlock Tin Cable block, meta sensitive
glassFiberCableBlock; // Glass Fiber Cable block, meta sensitive detectorCableBlock Detector Cable block, meta sensitive
splitterCableBlock Splitter Cable block, meta sensitive
tinCableBlock; // Tin Cable block, meta sensitive
insulatedtinCableBlock; // Insulated Tin Cable item, meta sensitive generators + related (TE implements IEnergySource ex. reactorChamber)
detectorCableBlock; // Detector Cable block, meta sensitive generator Generator block, meta sensitive
splitterCableBlock; // Splitter Cable block, meta sensitive geothermalGenerator Geothermal Generator block, meta sensitive
waterMill Water Mill block, meta sensitive
// generators + related (TE implements IEnergySource ex. reactorChamber) solarPanel Solar Panel block, meta sensitive
windMill Wind Mill block, meta sensitive
generator; // Generator block, meta sensitive nuclearReactor Nuclear Reactor block, meta sensitive
geothermalGenerator; // Geothermal Generator block, meta sensitive reactorChamber Reactor Chamber block, currently not meta sensitive
waterMill; // Water Mill block, meta sensitive
solarPanel; // Solar Panel block, meta sensitive energy storages (TE implements IEnergySource and IEnergyConductor)
windMill; // Wind Mill block, meta sensitive batBox BatBox block, meta sensitive
nuclearReactor; // Nuclear Reactor block, meta sensitive mfeUnit MFE Unit block, meta sensitive
reactorChamber; // Reactor Chamber block, currently not meta sensitive mfsUnit MFS Unit block, meta sensitive
RTGenerator; // Radioisotope Thermoelectric Generator block, meta sensitive
semifluidGenerator; // Semifluid Generator block, meta sensitive transformers (TE implements IEnergySource and IEnergyConductor)
lvTransformer LV Transformer block, meta sensitive
mvTransformer MV Transformer block, meta sensitive
// energy storages (TE implements IEnergySource and IEnergyConductor) hvTransformer HV Transformer block, meta sensitive
batBox; // BatBox block, meta sensitive machines + related (TE implements IEnergySink ex. machine, miningPipe, miningPipeTip)
cesuUnit; // CESU Unit block, meta sensitive machine Machine block, meta sensitive
mfeUnit; // MFE Unit block, meta sensitive advancedMachine Advanced Machine block, meta sensitive
mfsUnit; // MFS Unit block, meta sensitive
ironFurnace Iron Furnace block, meta sensitive
// transformers (TE implements IEnergySource and IEnergyConductor) electroFurnace Electro Furnace block, meta sensitive
macerator Macerator block, meta sensitive
lvTransformer; // LV Transformer block, meta sensitive extractor Extractor block, meta sensitive
mvTransformer; // MV Transformer block, meta sensitive compressor Compressor block, meta sensitive
hvTransformer; // HV Transformer block, meta sensitive canner Canner block, meta sensitive
evTransformer; // EV Transformer block, meta sensitive miner Miner block, meta sensitive
pump Pump block, meta sensitive
// machines + related (TE implements IEnergySink ex. machine, miningPipe, miningPipeTip) magnetizer Magnetizer block, meta sensitive
electrolyzer Electrolyzer block, meta sensitive
machine; // Machine block, meta sensitive recycler Recycler block, meta sensitive
advancedMachine; // Advanced Machine block, meta sensitive inductionFurnace Induction Furnace block, meta sensitive
massFabricator Mass Fabricator block, meta sensitive
ironFurnace; // Iron Furnace block, meta sensitive terraformer Terraformer block, meta sensitive
electroFurnace; // Electro Furnace block, meta sensitive teleporter Teleporter block, meta sensitive
macerator; // Macerator block, meta sensitive teslaCoil Tesla Coil block, meta sensitive
extractor; // Extractor block, meta sensitive luminator Passive (dark) Luminator block, meta = facing
compressor; // Compressor block, meta sensitive activeLuminator Active (bright) Luminator block, meta = facing
canner; // Canner block, meta sensitive
miner; // Miner block, meta sensitive miningPipe Mining Pipe block, currently not meta sensitive, meta in ItemStack set to 0
pump; // Pump block, meta sensitive miningPipeTip Mining Pipe Tip block, currently not meta sensitive, meta in ItemStack set to 0
magnetizer; // Magnetizer block, meta sensitive
electrolyzer; // Electrolyzer block, meta sensitive personal blocks
recycler; // Recycler block, meta sensitive personalSafe Personal Safe block, meta sensitive
inductionFurnace; // Induction Furnace block, meta sensitive tradeOMat Trade-O-Mat block, meta sensitive
massFabricator; // Mass Fabricator block, meta sensitive energyOMat Energy-O-Mat block, meta sensitive
terraformer; // Terraformer block, meta sensitive
teleporter; // Teleporter block, meta sensitive explosives
teslaCoil; // Tesla Coil block, meta sensitive industrialTnt Industrial TNT block, currently not meta sensitive
luminator; // Passive (dark) Luminator block, meta = facing nuke Nuke block, currently not meta sensitive
activeLuminator; // Active (bright) Luminator block, meta = facing dynamiteStick Dynamite Stick block, meta = placement, meta in ItemStack set to 0
centrifuge; // Centrifuge block, meta sensitive dynamiteStickWithRemote Dynamite Stick with Remote block, meta = placement, meta in ItemStack set to 0
metalformer; // MetalFormer block ,meta sensitive
orewashingplant; // Ore Wasching Plant,Meta sensitive Agriculture Stuff
patternstorage; // Pattern Storage,Meta sensitive crop Crop Block, empty, not meta sensitive
scanner; // Scanner,Meta sensitive
replicator; // Replicator,Meta sensitive
----- items -----
miningPipe; // Mining Pipe block, currently not meta sensitive, meta in ItemStack set to 0
miningPipeTip; // Mining Pipe Tip block, currently not meta sensitive, meta in ItemStack set to 0 rubber + related
resin Resin item, currently not meta sensitive
rubber Rubber item, currently not meta sensitive, ore dictionary: itemRubber
// personal blocks
ore drops
personalSafe; // Personal Safe block, meta sensitive uraniumDrop Uranium Drop item, currently not meta sensitive, ore dictionary: itemDropUranium
tradeOMat; // Trade-O-Mat block, meta sensitive
energyOMat; // Energy-O-Mat block, meta sensitive dusts
bronzeDust Bronze Dust item, currently not meta sensitive
// explosives clayDust Clay Dust item, currently not meta sensitive
coalDust Coal Dust item, currently not meta sensitive
industrialTnt; // Industrial TNT block, currently not meta sensitive copperDust Copper Dust item, currently not meta sensitive
nuke; // Nuke block, currently not meta sensitive goldDust Gold Dust item, currently not meta sensitive
dynamiteStick; // Dynamite Stick block, meta = placement, meta in ItemStack set to 0 ironDust Iron Dust item, currently not meta sensitive
dynamiteStickWithRemote; // Dynamite Stick with Remote block, meta = placement, meta in ItemStack set to 0 silverDust Silver Dust item, currently not meta sensitive
smallIronDust Small Iron Dust item, currently not meta sensitive
// Agriculture Stuff tinDust Tin Dust item, currently not meta sensitive
hydratedCoalDust Hydrated Coal Dust item, currently not meta sensitive
crop; // Crop Block, empty, not meta sensitive
cropmatron; // Cropmatron machien block, meta sensititve ingots
refinedIronIngot Refined Iron Ingot item, currently not meta sensitive, ore dictionary: ingotRefinedIron
// ----- items ----- copperIngot Copper Ingot item, currently not meta sensitive, ore dictionary: ingotCopper
tinIngot Tin Ingot item, currently not meta sensitive, ore dictionary: ingotTin
// rubber + related bronzeIngot Bronze Ingot item, currently not meta sensitive, ore dictionary: ingotBronze
resin; // Resin item, currently not meta sensitive mixedMetalIngot Mixed Metal Ingot item, currently not meta sensitive
rubber; // Rubber item, currently not meta sensitive, ore dictionary: itemRubber uraniumIngot Uranium Ingot item, currently not meta sensitive, ore dictionary: ingotUranium
FluidCell; tools/weapons (without electric tools)
treetap Treetap item, meta = damage value
// Lithium -> Tritium wrench Wrench item, meta = damage value
cutter Insulation Cutter item, meta = damage value
reactorLithiumCell; // LithiumCell use in Reaktor, , meta = damage value constructionFoamSprayer Construction Foam Sprayer item, meta = charges (as of v1.45)
TritiumCell; // Tritium, currently not meta sensitive
bronzePickaxe Bronze Pickaxe item, meta = damage value
// Nuclear Fuel bronzeAxe Bronze Axe item, meta = damage value
bronzeSword Bronze Sword item, meta = damage value
UranFuel; // , currently not meta sensitive bronzeShovel Bronze Shovel item, meta = damage value
MOXFuel; // , currently not meta sensitive bronzeHoe Bronze Hoe item, meta = damage value
Plutonium; // , currently not meta sensitive
smallPlutonium; // , currently not meta sensitive el. tools/devices/weapons
Uran235; // , currently not meta sensitive miningDrill Mining Drill item, meta = visual charge indicator, implements IElectricItem
smallUran235; // , currently not meta sensitive diamondDrill Diamond Tipped Mining Drill item, meta = visual charge indicator, implements IElectricItem
Uran238; // , currently not meta sensitive chainsaw Chainsaw item, meta = visual charge indicator, implements IElectricItem
electricWrench Electric Wrench item, meta = visual charge indicator, implements IElectricItem
reactorDepletedUraniumSimple; // Depleted Uranium Cell items, currently not meta sensitive electricTreetap Electric Treetap item, meta = visual charge indicator, implements IElectricItem
reactorDepletedUraniumDual; miningLaser Mining Laser item, meta = visual charge indicator, implements IElectricItem
reactorDepletedUraniumQuad;
reactorDepletedMOXSimple; // Depleted MOX Cell items, currently not meta sensitive ecMeter EC-Mater item, currently not meta sensitive
reactorDepletedMOXDual; odScanner Ore Density Scanner item, meta = damage value for charge level, implements IElectricItem
reactorDepletedMOXQuad; ovScanner Ore Value Scanner item, meta = visual charge indicator, implements IElectricItem
reactorMOXSimple; // Depleted MOX Cell items, currently not meta sensitive
reactorMOXDual; frequencyTransmitter Frequency Transmitter item, currently not meta sensitive
reactorMOXQuad;
RTGPellets; nanoSaber Idle Nano Saber item, meta = visual charge indicator, implements IElectricItem
enabledNanoSaber Enabled Nano Saber item, meta = visual charge indicator, implements IElectricItem
// Recipe Parts armor/wearable
rubberBoots Rubber Boots item, meta = damage value
coil; // Coil, meta sensitive
elemotor; // electric motor, meta sensitive bronzeHelmet Bronze Helmet Armor item, meta = damage value
powerunit; // Item Power Unit, meta sensitive bronzeChestplate Bronze Chestplate Armor item, meta = damage value
powerunitsmall; // Item Power Unit, meta sensitive bronzeLeggings Bronze Leggings Armor item, meta = damage value
bronzeBoots Bronze Boots Armor item, meta = damage value
// ItemCasing compositeArmor Composite Armor item, meta = damage value for charge level
casingcopper; // Copper ItemCasing, meta sensitive nanoHelmet Nano Helmet Armor item, meta = visual charge indicator, implements IElectricItem
casingtin; // Tin ItemCasing, meta sensitive nanoBodyarmor Nano Bodyarmor item, meta = visual charge indicator, implements IElectricItem
casingbronze; // Bronze ItemCasing, meta sensitive nanoLeggings Nano Leggings Armor item, meta = visual charge indicator, implements IElectricItem
casinggold; // Gold ItemCasing, meta sensitive nanoBoots Nano Boots Armor item, meta = visual charge indicator, implements IElectricItem
casingiron; // Iron ItemCasing, meta sensitive
@Deprecated quantumHelmet Quantum Helmet Armor item, meta = visual charge indicator, implements IElectricItem
casingadviron; // Refined Iron ItemCasing, meta sensitive quantumBodyarmor Quantum Bodyarmor item, meta = visual charge indicator, implements IElectricItem
casinglead; // Lead ItemCasing, meta sensitive quantumLeggings Quantum Leggings Armor item, meta = visual charge indicator, implements IElectricItem
quantumBoots Quantum Boots Armor item, meta = visual charge indicator, implements IElectricItem
// Crushed Ore
crushedIronOre; // Crushed Iron Ore, meta sensitive jetpack Jetpack item, meta = damage value for fuel level
crushedCopperOre; // Crushed Copper Ore, meta sensitive electricJetpack Electric Jetpack item, meta = visual charge indicator, implements IElectricItem
crushedGoldOre; // Crushed Gold Ore, meta sensitive
crushedTinOre; // Crushed Tin Ore, meta sensitive batPack BatPack item, meta = visual charge indicator, implements IElectricItem, can provide energy
crushedUraniumOre; // Crushed Uranium Ore, meta sensitive lapPack LapPack item, meta = visual charge indicator, implements IElectricItem, can provide energy
crushedSilverOre; // Crushed Silver Ore, meta sensitive
crushedLeadOre; // Crushed Lead Ore, meta sensitive cfPack CF Pack item, meta = charges (as of v1.45)
solarHelmet Solar Helmet item, currently not meta sensitive
//Purify Crushed Ore staticBoots Static Boots item, currently not meta sensitive
purifiedCrushedIronOre; // Purify Crushed Iron Ore, meta sensitive
purifiedCrushedCopperOre; // Purify Crushed Copper Ore, meta sensitive batteries
purifiedCrushedGoldOre; // Purify Crushed Gold Ore, meta sensitive reBattery Empty RE Battery item, currently not meta sensitive, implements IElectricItem
purifiedCrushedTinOre; // Purify Crushed Tin Ore, meta sensitive chargedReBattery RE Battery item, meta = visual charge indicator, implements IElectricItem, can provide energy
purifiedCrushedUraniumOre; // Purify Crushed Uranium Ore, meta sensitive energyCrystal Energy Crystal item, meta = visual charge indicator, implements IElectricItem, can provide energy
purifiedCrushedSilverOre; // Purify Crushed Silver Ore, meta sensitive lapotronCrystal Lapotron Crystal item, meta = visual charge indicator, implements IElectricItem, can provide energy
purifiedCrushedLeadOre; // Purify Crushed Lead Ore, meta sensitive suBattery SU Battery item, currently not meta sensitive
// dusts cables
stoneDust; copperCableItem Copper Cable item, meta sensitive
bronzeDust; // Bronze Dust item, meta sensitive, ore dictionary: dustBronze insulatedCopperCableItem Insulated Copper Cable item, meta sensitive
clayDust; // Clay Dust item, meta sensitive, ore dictionary: dustClay
coalDust; // Coal Dust item, meta sensitive, ore dictionary: dustCoal goldCableItem Gold Cable item, meta sensitive
copperDust; // Copper Dust item, meta sensitive, ore dictionary: dustCopper insulatedGoldCableItem Insulated Gold Cable item, meta sensitive
goldDust; // Gold Dust item, meta sensitive, ore dictionary: dustGold doubleInsulatedGoldCableItem Double Insulated Gold Cable item, meta sensitive
ironDust; // Iron Dust item, meta sensitive, ore dictionary: dustIron
silverDust; // Silver Dust item, meta sensitive, ore dictionary: dustSilver ironCableItem Iron Cable item, meta sensitive
tinDust; // Tin Dust item, meta sensitive, ore dictionary: dustTin insulatedIronCableItem Insulated Iron Cable item, meta sensitive
hydratedCoalDust; // Hydrated Coal Dust item, meta sensitive doubleInsulatedIronCableItem Double Insulated Iron Cable item, meta sensitive
leadDust; // Lead Dust item, meta sensitive, ore dictionary: dustLead trippleInsulatedIronCableItem Tripple Insulated Iron Cable item, meta sensitive
obsidianDust; // Obsidian Dust item, meta sensitive, ore dictionary: dustObsidian
lapiDust; // Lapi Dust item, meta sensitive, ore dictionary: dustLapi glassFiberCableItem Glass Fiber Cable item, meta sensitive
sulfurDust; // Sulfur Dust item, meta sensitive, ore dictionary: dustSulfur
lithiumDust; // Lithium dust, meta sensitive, ore dictionary: dustLithium tinCableItem Tin Cable item, meta sensitive
// small dusts detectorCableItem Detector Cable item, meta sensitive
splitterCableItem Splitter Cable item, meta sensitive
smallIronDust; // Small Iron Dust item, meta sensitive
smallCopperDust; // Small Copper Dust item, meta sensitive cells/containers (without reactor components)
smallGoldDust; // Small Gold Dust item, meta sensitive cell Empty Cell item, currently not meta sensitive
smallTinDust; // Small Tin Dust item, meta sensitive lavaCell Lava Cell item, currently not meta sensitive
smallSilverDust; // Small Silver Dust item, meta sensitive hydratedCoalCell Hydrated Coal Cell item, currently not meta sensitive
smallLeadDust; // Small Lead Dust item, meta sensitive bioCell Bio Cell item, currently not meta sensitive
smallSulfurDust; // Small Sulfur Dust item, meta sensitive coalfuelCell Coalfuel Cell item, currently not meta sensitive
smallLithiumDust; // Small Lithium Dust item, meta sensitive biofuelCell Biofuel Cell item, currently not meta sensitive
waterCell Water Cell item, currently not meta sensitive
electrolyzedWaterCell Electrolyzed Water Cell item, currently not meta sensitive
// ingots
@Deprecated fuelCan Empty Fuel Can item, currently not meta sensitive
refinedIronIngot; // Refined Iron Ingot item, currently not meta sensitive, ore dictionary: ingotRefinedIron filledFuelCan Fuel Can item, meta = fuel value (as of v1.45)
copperIngot; // Copper Ingot item, currently not meta sensitive, ore dictionary: ingotCopper
tinIngot; // Tin Ingot item, currently not meta sensitive, ore dictionary: ingotTin tinCan Empty Tin Can item, currently not meta sensitive
bronzeIngot; // Bronze Ingot item, currently not meta sensitive, ore dictionary: ingotBronze filledTinCan Filled Tin Can item, currently not meta sensitive
mixedMetalIngot; // Mixed Metal Ingot item, currently not meta sensitive
leadIngot; // Lead Ingot item, currently not meta sensitive reactor components
uraniumCell Uranium Cell item, meta = damage value
coolingCell Cooling Cell item, meta = damage value
// tools/weapons (without electric tools)
treetap; // Treetap item, meta = damage value depletedIsotopeCell Depleted Isotope Cell item, meta = damage value
wrench; // Wrench item, meta = damage value reEnrichedUraniumCell Re-Enriched Uranium Cell item, currently not meta sensitive
cutter; // Insulation Cutter item, meta = damage value nearDepletedUraniumCell Near-Depleted Uranium Cell item, currently not meta sensitive
constructionFoamSprayer; // Construction Foam Sprayer item, meta = charges (as of v1.45)
integratedReactorPlating Integrated Reactor Plating item, meta = damage value
bronzePickaxe; // Bronze Pickaxe item, meta = damage value integratedHeatDisperser Integrated Heat Disperser item, meta = damage value
bronzeAxe; // Bronze Axe item, meta = damage value
bronzeSword; // Bronze Sword item, meta = damage value terraformer blueprints
bronzeShovel; // Bronze Shovel item, meta = damage value terraformerBlueprint Empty Terraformer Blueprint item, currently not meta sensitive
bronzeHoe; // Bronze Hoe item, meta = damage value cultivationTerraformerBlueprint Cultivation Terraformer Blueprint item, currently not meta sensitive
irrigationTerraformerBlueprint Irrigation Terraformer Blueprint item, currently not meta sensitive
ForgeHammer; // Refine Iron Hammer item, meta = damage value chillingTerraformerBlueprint Chilling Terraformer Blueprint item, currently not meta sensitive
desertificationTerraformerBlueprint Desertification Terraformer Blueprint item, currently not meta sensitive
// el. tools/devices/weapons flatificatorTerraformerBlueprint Flatificator Terraformer Blueprint item, currently not meta sensitive
miningDrill; // Mining Drill item, meta = damage value for charge level mushroomTerraformerBlueprint Mushroom Terraformer Blueprint item, currently not meta sensitive
diamondDrill; // Diamond Tipped Mining Drill item, meta = damage value for charge level
chainsaw; // Chainsaw item, meta = damage value for charge level diamond chain
electricWrench; // Electric Wrench item, meta = damage value for charge level coalBall Coal Ball item, currently not meta sensitive
electricTreetap; // Electric Treetap item, meta = damage value for charge level compressedCoalBall Compressed Coal Ball item, currently not meta sensitive
miningLaser; // Mining Laser item, meta = damage value for charge level coalChunk Coal Chunk item, currently not meta sensitive
industrialDiamond Industrial Diamond item, currently not meta sensitive, DEPRECATED
ecMeter; // EC-Mater item, meta = itemdata db index (as of v1.45)
odScanner; // Ore Density Scanner item, meta = damage value for charge level recycler chain
ovScanner; // Ore Value Scanner item, meta = damage value for charge level scrap Scrap item, currently not meta sensitive
obscurator; // Obscurator item, meta = damage value for charge level scrapBox Scrap Box item, currently not meta sensitive
frequencyTransmitter; // Frequency Transmitter item, meta = itemdata db index (as of v1.45) fuel production chain
hydratedCoalClump Hydrated Coal Clump item, currently not meta sensitive
nanoSaber; // Idle Nano Saber item, meta = damage value for charge level plantBall Plant Ball item, currently not meta sensitive
enabledNanoSaber; // Enabled Nano Saber item, meta = damage value for charge level compressedPlantBall Compressed Plant Ball item, currently not meta sensitive
toolbox; // Open/Empty toolbox, meta = Open (0) / Closed (1) painting
painter Painter item, currently not meta sensitive
// armor/wearable
hazmatHelmet; // Hazmat Helmet item, meta = damage value blackPainter Black Painter item, meta = damage value
hazmatChestplate; // Hazmat Chestplate item, meta = damage value redPainter Red Painter item, meta = damage value
hazmatLeggings; // Hazmat Leggings item, meta = damage value greenPainter Green Painter item, meta = damage value
hazmatBoots; // Hazmat Boots item, meta = damage value brownPainter Brown Painter item, meta = damage value
bluePainter Blue Painter item, meta = damage value
bronzeHelmet; // Bronze Helmet Armor item, meta = damage value purplePainter Purple Painter item, meta = damage value
bronzeChestplate; // Bronze Chestplate Armor item, meta = damage value cyanPainter Cyan Painter item, meta = damage value
bronzeLeggings; // Bronze Leggings Armor item, meta = damage value lightGreyPainter Light Grey Painter item, meta = damage value
bronzeBoots; // Bronze Boots Armor item, meta = damage value darkGreyPainter Dark Grey Painter item, meta = damage value
pinkPainter Pink Painter item, meta = damage value
compositeArmor; // Composite Armor item, meta = damage value for charge level limePainter Lime Painter item, meta = damage value
yellowPainter Yellow Painter item, meta = damage value
nanoHelmet; // Nano Helmet Armor item, meta = damage value for charge level cloudPainter Cloud Painter item, meta = damage value
nanoBodyarmor; // Nano Bodyarmor item, meta = damage value for charge level magentaPainter Magenta Painter item, meta = damage value
nanoLeggings; // Nano Leggings Armor item, meta = damage value for charge level orangePainter Orange Painter item, meta = damage value
nanoBoots; // Nano Boots Armor item, meta = damage value for charge level whitePainter White Painter item, meta = damage value
quantumHelmet; // Quantum Helmet Armor item, meta = damage value for charge level explosives + related
quantumBodyarmor; // Quantum Bodyarmor item, meta = damage value for charge level dynamite Throwable Dynamite item, currently not meta sensitive
quantumLeggings; // Quantum Leggings Armor item, meta = damage value for charge level stickyDynamite Throwable Sticky Dynamite item, currently not meta sensitive
quantumBoots; // Quantum Boots Armor item, meta = damage value for charge level
remote Dynamite Remote item, currently not meta sensitive
jetpack; // Jetpack item, meta = damage value for fuel level
electricJetpack; // Electric Jetpack item, meta = damage value for charge level misc intermediate recipe ingredients
electronicCircuit Electronic Circuit item, currently not meta sensitive
batPack; // BatPack item, meta = damage value for charge level advancedCircuit Advanced Circuit item, currently not meta sensitive
advbatPack; // Adv.BatPack item, meta = damage value for charge level
lapPack; // LapPack item, meta = damage value for charge level advancedAlloy Advanced Alloy item, currently not meta sensitive
energyPack; // EnergyPack item, meta = damage value for charge level
carbonFiber Raw Carbon Fiber item, currently not meta sensitive
cfPack; // CF Pack item, meta = charges (as of v1.45) carbonMesh Raw Carbon Mesh item, currently not meta sensitive
solarHelmet; // Solar Helmet, currently not meta sensitive carbonPlate Carbon Plate item, currently not meta sensitive
staticBoots; // Static Boots, currently not meta sensitive
nightvisionGoggles; // Nightvision Goggles, meta = damage value for charge level matter UU-Matter item, currently not meta sensitive
iridiumOre Iridium Ore item, currently not meta sensitive
// batteries iridiumPlate Iridium Plate item, currently not meta sensitive
reBattery; // Empty RE Battery item, currently not meta sensitive
chargedReBattery; // RE Battery item, meta = damage value for charge level upgrade modules
advBattery; // Adv Batteryitem, meta = damage value for charge level overclockerUpgrade overclocker upgrade item, meta sensitive
energyCrystal; // Energy Crystal item, meta = damage value for charge level transformerUpgrade transformer upgrade item, meta sensitive
lapotronCrystal; // Lapotron Crystal item, meta = damage value for charge level energyStorageUpgrade energy storage upgrade item, meta sensitive
suBattery; // SU Battery item, meta = damage value for charge level
misc
// cables coin Coin item, currently not meta sensitive
copperCableItem; // Copper Cable item, meta sensitive reinforcedDoor Reinforced Door item, currently not meta sensitive
insulatedCopperCableItem; // Insulated Copper Cable item, meta sensitive constructionFoamPellet Construction Foam Pellet item, currently not meta sensitive
cropSeed Crop seeds, stuff stored in NBT, don't use for crafting recipes!
goldCableItem; // Gold Cable item, meta sensitive cropnalyzer Cropnalyzer handheld device
insulatedGoldCableItem; // Insulated Gold Cable item, meta sensitive fertilizer Basic IC2Item, used to provide nutrients toCropBlocks
hydratingCell Cell used to hydrate Crops, meta = Content, 0 = Full, 9999 = Near empty
@Deprecated electricHoe Electric Hoe, meta = charge level
doubleInsulatedGoldCableItem; // Double Insulated Gold Cable item, meta sensitive solarHelmet Solar Helmet item, currently not meta sensitive
terraWart Terra Wart item, cures potion effects
ironCableItem; // Iron Cable item, meta sensitive weedEx Weed-EX can, meta = uses left
insulatedIronCableItem; // Insulated Iron Cable item, meta sensitive
@Deprecated
doubleInsulatedIronCableItem; // Double Insulated Iron Cable item, meta sensitive
@Deprecated
trippleInsulatedIronCableItem; // Tripple Insulated Iron Cable item, meta sensitive
insulatedTinCableItem;
glassFiberCableItem; // Glass Fiber Cable item, meta sensitive
tinCableItem; // Tin Cable item, meta sensitive
detectorCableItem; // Detector Cable item, meta sensitive
splitterCableItem; // Splitter Cable item, meta sensitive
// cells/containers (without reactor components)
cell; // Empty Cell item, meta sensitive
lavaCell; // Lava Cell item, meta sensitive
waterCell; // Water Cell item, meta sensitive
UuMatterCell; // UUMatter Cell item, meta sensitive
CFCell; // constructionFoam Cell item, meta sensitive
fuelRod; // Empy Fuel Rod item, currently not meta sensitive
hydratedCoalCell; // Hydrated Coal Cell item, currently not meta sensitive
bioCell; // Bio Cell item, currently not meta sensitive
coalfuelCell; // Coalfuel Cell item, currently not meta sensitive
biofuelCell; // Biofuel Cell item, currently not meta sensitive
electrolyzedWaterCell; // Electrolyzed Water Cell item, currently not meta sensitive
airCell; // Compressed Air item, currently not meta sensitive
fuelCan; // Empty Fuel Can item, currently not meta sensitive
filledFuelCan; // Fuel Can item, meta = fuel value (as of v1.45)
tinCan; // Empty Tin Can item, currently not meta sensitive
filledTinCan; // Filled Tin Can item, currently not meta sensitive
// reactor components
reactorUraniumSimple; // Uranium Cell items, meta = consumed uranium ticks
reactorUraniumDual;
reactorUraniumQuad;
reactorCoolantSimple;
reactorCoolantTriple ; // Coolant Cell item, NBT for heat-storage, meta is 0-10000 for display
reactorCoolantSix;
reactorPlating; // Integrated Reactor Plating item, currently not meta sensitive
reactorPlatingHeat;
reactorPlatingExplosive;
reactorHeatSwitch; // Integrated Heat Disperser item, NBT for heat-storage, meta is 0-10000 for display
reactorHeatSwitchCore;
reactorHeatSwitchSpread;
reactorHeatSwitchDiamond;
reactorVent; // Heat Venting component, NBT for heat-storage, meta is 0-10000 for display
reactorVentCore;
reactorVentGold;
reactorVentSpread;// Special: Does not store heat
reactorVentDiamond;
reactorReflector; // Increase efficiency without additional ticks, NBT for heat-storage, meta is 0-10000 for display
reactorReflectorThick; // Increase efficiency without additional ticks, NBT for heat-storage, meta is 0-10000 for display
reactorCondensator; // Consumes redstone to absorb heat, NBT for storage, meta is 0-10000 for display
reactorCondensatorLap; // Consumes redstone/lapis to absorb heat, mNBT for storage, meta is 0-10000 for display
// terraformer blueprints
terraformerBlueprint; // Empty Terraformer Blueprint item, currently not meta sensitive
cultivationTerraformerBlueprint; // Cultivation Terraformer Blueprint item, currently not meta sensitive
irrigationTerraformerBlueprint; // Irrigation Terraformer Blueprint item, currently not meta sensitive
chillingTerraformerBlueprint; // Chilling Terraformer Blueprint item, currently not meta sensitive
desertificationTerraformerBlueprint; // Desertification Terraformer Blueprint item, currently not meta sensitive
flatificatorTerraformerBlueprint; // Flatificator Terraformer Blueprint item, currently not meta sensitive
mushroomTerraformerBlueprint; // Mushroom Terraformer Blueprint item, currently not meta sensitive
// diamond chain
coalBall; // Coal Ball item, currently not meta sensitive
compressedCoalBall; // Compressed Coal Ball item, currently not meta sensitive
coalChunk; // Coal Chunk item, currently not meta sensitive
industrialDiamond; // Industrial Diamond item, currently not meta sensitive, DEPRECATED
// recycler chain
scrap; // Scrap item, currently not meta sensitive
scrapBox; // Scrap Box item, currently not meta sensitive
// fuel production chain
hydratedCoalClump; // Hydrated Coal Clump item, currently not meta sensitive
plantBall; // Plant Ball item, currently not meta sensitive
compressedPlantBall; // Compressed Plant Ball item, currently not meta sensitive
// painting
painter; // Painter item, currently not meta sensitive
blackPainter; // Black Painter item, meta = damage value
redPainter; // Red Painter item, meta = damage value
greenPainter; // Green Painter item, meta = damage value
brownPainter; // Brown Painter item, meta = damage value
bluePainter; // Blue Painter item, meta = damage value
purplePainter; // Purple Painter item, meta = damage value
cyanPainter; // Cyan Painter item, meta = damage value
lightGreyPainter; // Light Grey Painter item, meta = damage value
darkGreyPainter; // Dark Grey Painter item, meta = damage value
pinkPainter; // Pink Painter item, meta = damage value
limePainter; // Lime Painter item, meta = damage value
yellowPainter; // Yellow Painter item, meta = damage value
cloudPainter; // Cloud Painter item, meta = damage value
magentaPainter; // Magenta Painter item, meta = damage value
orangePainter; // Orange Painter item, meta = damage value
whitePainter; // White Painter item, meta = damage value
// explosives + related
dynamite; // Throwable Dynamite item, currently not meta sensitive
stickyDynamite; // Throwable Sticky Dynamite item, currently not meta sensitive
remote; // Dynamite Remote item, currently not meta sensitive
// misc intermediate recipe ingredients
electronicCircuit; // Electronic Circuit item, currently not meta sensitive
advancedCircuit; // Advanced Circuit item, currently not meta sensitive
advancedAlloy; // Advanced Alloy item, currently not meta sensitive
carbonFiber; // Raw Carbon Fiber item, currently not meta sensitive
carbonMesh; // Raw Carbon Mesh item, currently not meta sensitive
carbonPlate; // Carbon Plate item, currently not meta sensitive
matter; // UUA item, currently not meta sensitive
iridiumOre; // Iridium Ore item, currently not meta sensitive
iridiumPlate; // Iridium Plate item, currently not meta sensitive
// Metal Plates
platecopper; // Metal plate item, meta sensitive
platetin; // Metal plate item, meta sensitive
platebronze; // Metal plate item, meta sensitive
plategold; // Metal plate item, meta sensitive
plateiron; // Metal plate item, meta sensitive
platelead; // Metal plate item, meta sensitive
platelapi; // Metal plate item, meta sensitive
plateobsidian; // Metal plate item, meta sensitive
plateadviron; // Metal plate item, meta sensitive
// Metal Dense Plates
denseplatecopper; // Metal dense plate item, meta sensitive
denseplatetin; // Metal dense plate item, meta sensitive
denseplatebronze; // Metal dense plate item, meta sensitive
denseplategold; // Metal dense plate item, meta sensitive
denseplateiron; // Metal dense plate item, meta sensitive
@Deprecated
denseplateadviron; // Metal dense plate item, meta sensitive
denseplatelead; // Metal dense plate item, meta sensitive
denseplatelapi; // Metal dense plate item, meta sensitive
denseplateobsidian; // Metal dense plate item, meta sensitive
// upgrade modules
overclockerUpgrade; // overclocker upgrade item, meta sensitive
transformerUpgrade; // transformer upgrade item, meta sensitive
energyStorageUpgrade; // energy storage upgrade item, meta sensitive
ejectorUpgrade; // ejector upgrade item, meta sensitive
// misc
coin; // Coin item, currently not meta sensitive
reinforcedDoor; // Reinforced Door item, currently not meta sensitive
constructionFoamPowder; // Construction Foam Powder item, currently not meta sensitive
grinPowder; // Poisonous ingrident, currently not meta sensitive
debug; // Debug item, currently not meta sensitive
boatCarbon; // Carbon Fiber Canoe item, meta sensitive
boatRubber; // Rubber Dinghy item, meta sensitive
boatRubberBroken; // Damaged Rubber Dinghy item, meta sensitive
boatElectric; // Electric Boat item, meta sensitive
//Agriculture
cropSeed; // Crop seeds, stuff stored in NBT, don't use for crafting recipes!
cropnalyzer; // Cropnalyzer handheld device
fertilizer; // Basic IC2Item, used to provide nutrients toCropBlocks
hydratingCell; // Cell used to hydrate Crops, meta = Content, 0= Full, 9999 = Near empty
electricHoe; // Electric Hoe, Metadata indicates charge level
terraWart; // Mystic opposite of NEtherWart, cures StatusEffects, simply consumeable
weedEx; // Spraying can of WEED-EX, meta indicates usages left
//Boozeception
mugEmpty; // Simple stone mug
coffeeBeans; // Harvested CoffeeBeans
coffeePowder; // Processed Coffee Beans, used to craft drinkable Coffee
mugCoffee; // Mug of Coffee, Meta indicates status 0 = cold, 1 = Normal, 2 = Sugar'd
hops; // Hops, harvested freshly from crop
barrel; // Carried Barrel, metadata encrypts the information about the liquid inside
blockBarrel; // Unobtainable "placed barrel", TileEntity controlling the Fermentation process
mugBooze; // Mug filled with booze, metadata encrypts the information about the liquid inside
*/ */

View file

@ -1,51 +0,0 @@
package ic2.api.recipe;
import java.util.Map;
import net.minecraft.item.ItemStack;
public interface ICannerBottleRecipeManager {
/**
* Adds a recipe to the machine.
*
* @param container Container to be filled
* @param fill Item to fill into the container
* @param output Filled container
*/
public void addRecipe(IRecipeInput container, IRecipeInput fill, ItemStack output);
/**
* Gets the recipe output for the given input.
*
* @param container Container to be filled
* @param fill Item to fill into the container
* @param adjustInput modify the input according to the recipe's requirements
* @param acceptTest allow either container or fill to be null to see if either of them is part of a recipe
* @return Recipe output, or null if none
*/
public RecipeOutput getOutputFor(ItemStack container, ItemStack fill, boolean adjustInput, boolean acceptTest);
/**
* Gets a list of recipes.
*
* You're a mad evil scientist if you ever modify this.
*
* @return List of recipes
*/
public Map<Input, RecipeOutput> getRecipes();
public static class Input {
public Input(IRecipeInput container, IRecipeInput fill) {
this.container = container;
this.fill = fill;
}
public boolean matches(ItemStack container, ItemStack fill) {
return this.container.matches(container) && this.fill.matches(fill);
}
public final IRecipeInput container;
public final IRecipeInput fill;
}
}

View file

@ -1,54 +0,0 @@
package ic2.api.recipe;
import java.util.Map;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
public interface ICannerEnrichRecipeManager {
/**
* Adds a recipe to the machine.
*
* @param input Fluid input
* @param additive Item to enrich the fluid with
* @param output Output fluid
*/
public void addRecipe(FluidStack input, IRecipeInput additive, FluidStack output);
/**
* Gets the recipe output for the given input.
*
* @param input Fluid input
* @param additive Item to enrich the fluid with
* @param adjustInput modify the input according to the recipe's requirements
* @param acceptTest allow input or additive to be null to see if either of them is part of a recipe
* @return Recipe output, or null if none, output fluid in nbt
*/
public RecipeOutput getOutputFor(FluidStack input, ItemStack additive, boolean adjustInput, boolean acceptTest);
/**
* Gets a list of recipes.
*
* You're a mad evil scientist if you ever modify this.
*
* @return List of recipes
*/
public Map<Input, FluidStack> getRecipes();
public static class Input {
public Input(FluidStack fluid, IRecipeInput additive) {
this.fluid = fluid;
this.additive = additive;
}
public boolean matches(FluidStack fluid, ItemStack additive) {
return (this.fluid == null || this.fluid.isFluidEqual(fluid)) &&
this.additive.matches(additive);
}
public final FluidStack fluid;
public final IRecipeInput additive;
}
}

View file

@ -1,26 +0,0 @@
package ic2.api.recipe;
import net.minecraft.item.ItemStack;
/**
* Recipe manager interface for crafting recipes.
*
* @author Richard
*/
public interface ICraftingRecipeManager {
/**
* Adds a shaped crafting recipe.
*
* @param output Recipe output
* @param input Recipe input format
*/
public void addRecipe(ItemStack output, Object... input);
/**
* Adds a shapeless crafting recipe.
*
* @param output Recipe output
* @param input Recipe input
*/
public void addShapelessRecipe(ItemStack output, Object... input);
}

View file

@ -1,10 +0,0 @@
package ic2.api.recipe;
import java.util.Set;
import net.minecraftforge.fluids.Fluid;
public interface ILiquidAcceptManager {
boolean acceptsFluid(Fluid fluid);
Set<Fluid> getAcceptedFluids();
}

View file

@ -1,36 +0,0 @@
package ic2.api.recipe;
import java.util.List;
import net.minecraft.item.ItemStack;
/**
* Recipe manager interface for basic lists.
*
* @author Richard
*/
public interface IListRecipeManager extends Iterable<ItemStack> {
/**
* Adds a stack to the list.
*
* @param stack Stack to add
*/
public void add(ItemStack stack);
/**
* Checks whether the specified stack is in the list.
*
* @param stack Stack to check
* @return Whether the stack is in the list
*/
public boolean contains(ItemStack stack);
/**
* Gets the list of stacks.
*
* You're a mad evil scientist if you ever modify this.
*
* @return List of stacks
*/
public List<ItemStack> getStacks();
}

View file

@ -1,40 +0,0 @@
package ic2.api.recipe;
import java.util.Map;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
/**
* Recipe manager interface for basic machines.
*
* @author RichardG, Player
*/
public interface IMachineRecipeManager {
/**
* Adds a recipe to the machine.
*
* @param input Recipe input
* @param metadata meta data for additional recipe properties, may be null
* @param outputs Recipe outputs, zero or more depending on the machine
*/
public void addRecipe(IRecipeInput input, NBTTagCompound metadata, ItemStack... outputs);
/**
* Gets the recipe output for the given input.
*
* @param input Recipe input
* @param adjustInput modify the input according to the recipe's requirements
* @return Recipe output, or null if none
*/
public RecipeOutput getOutputFor(ItemStack input, boolean adjustInput);
/**
* Gets a list of recipes.
*
* You're a mad evil scientist if you ever modify this.
*
* @return List of recipes
*/
public Map<IRecipeInput, RecipeOutput> getRecipes();
}

View file

@ -1,15 +0,0 @@
package ic2.api.recipe;
import net.minecraft.item.ItemStack;
public interface IPatternStorage {
boolean transferPattern(ItemStack itemstack, int amountUU , int amountEU);
int[] getPatternvalus(ItemStack itemstack);
short getPatternCount();
ItemStack getPatternItemstack(int index);
}

View file

@ -1,31 +0,0 @@
package ic2.api.recipe;
import java.util.List;
import net.minecraft.item.ItemStack;
public interface IRecipeInput {
/**
* Check if subject matches this recipe input, ignoring the amount.
*
* @param subject ItemStack to check
* @return true if it matches the requirement
*/
boolean matches(ItemStack subject);
/**
* Determine the minimum input stack size.
*
* @return input amount required
*/
int getAmount();
/**
* List all possible inputs (best effort).
*
* The stack size is undefined, use getAmount to get the correct one.
*
* @return list of inputs, may be incomplete
*/
List<ItemStack> getInputs();
}

View file

@ -1,13 +0,0 @@
package ic2.api.recipe;
import java.util.Map;
import net.minecraft.item.ItemStack;
public interface IScrapboxManager {
void addDrop(ItemStack drop, float rawChance);
ItemStack getDrop(ItemStack input, boolean adjustInput);
Map<ItemStack, Float> getDrops();
}

View file

@ -1,32 +0,0 @@
package ic2.api.recipe;
import java.util.Map;
import net.minecraftforge.fluids.Fluid;
public interface ISemiFluidFuelManager extends ILiquidAcceptManager {
/**
* Add a new fluid to the semi fluid generator.
*
* @param fluidName the fluid to burn
* @param amount amount of fluid to consume per tick
* @param power amount of energy generated per tick
*/
void addFluid(String fluidName, int amount, double power);
BurnProperty getBurnProperty(Fluid fluid);
Map<String, BurnProperty> getBurnProperties();
public static class BurnProperty {
public BurnProperty(int amount, double power) {
this.amount = amount;
this.power = power;
}
public final int amount;
public final double power;
}
}

View file

@ -1,38 +0,0 @@
package ic2.api.recipe;
import java.util.Arrays;
import java.util.List;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
public class RecipeInputItemStack implements IRecipeInput {
public RecipeInputItemStack(ItemStack input) {
this(input, input.stackSize);
}
public RecipeInputItemStack(ItemStack input, int amount) {
this.input = input;
this.amount = amount;
}
@Override
public boolean matches(ItemStack subject) {
return subject.itemID == input.itemID &&
(subject.getItemDamage() == input.getItemDamage() || input.getItemDamage() == OreDictionary.WILDCARD_VALUE);
}
@Override
public int getAmount() {
return amount;
}
@Override
public List<ItemStack> getInputs() {
return Arrays.asList(input);
}
public final ItemStack input;
public final int amount;
}

View file

@ -1,45 +0,0 @@
package ic2.api.recipe;
import java.util.List;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
public class RecipeInputOreDict implements IRecipeInput {
public RecipeInputOreDict(String input) {
this(input, 1);
}
public RecipeInputOreDict(String input, int amount) {
this.input = input;
this.amount = amount;
}
@Override
public boolean matches(ItemStack subject) {
List<ItemStack> inputs = OreDictionary.getOres(input);
for (ItemStack input : inputs) {
if (subject.itemID == input.itemID &&
(subject.getItemDamage() == input.getItemDamage() || input.getItemDamage() == OreDictionary.WILDCARD_VALUE)) {
return true;
}
}
return false;
}
@Override
public int getAmount() {
return amount;
}
@Override
public List<ItemStack> getInputs() {
return OreDictionary.getOres(input);
}
public final String input;
public final int amount;
}

View file

@ -1,21 +0,0 @@
package ic2.api.recipe;
import java.util.Arrays;
import java.util.List;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
public final class RecipeOutput {
public RecipeOutput(NBTTagCompound metadata, List<ItemStack> items) {
this.metadata = metadata;
this.items = items;
}
public RecipeOutput(NBTTagCompound metadata, ItemStack... items) {
this(metadata, Arrays.asList(items));
}
public final List<ItemStack> items;
public final NBTTagCompound metadata;
}

View file

@ -1,55 +0,0 @@
package ic2.api.recipe;
/**
* General recipe registry.
*
* @author Richard
*/
public class Recipes {
public static IMachineRecipeManager macerator;
public static IMachineRecipeManager extractor;
public static IMachineRecipeManager compressor;
public static IMachineRecipeManager centrifuge;
public static IMachineRecipeManager recycler;
public static IMachineRecipeManager metalformerExtruding;
public static IMachineRecipeManager metalformerCutting;
public static IMachineRecipeManager metalformerRolling;
public static IMachineRecipeManager oreWashing;
public static IMachineRecipeManager Scanner;
public static ICannerBottleRecipeManager cannerBottle;
public static ICannerEnrichRecipeManager cannerEnrich;
/**
* Reference amplifier values:
*
* 5000: Scrap
* 45000: Scrapbox
*
* As Parameter for the Amplification Value you have to use the NBTTagCompound
*
* NBTTagCompound nbt = new NBTTagCompound();
* nbt.setInteger("amplification", aValue);
* matterAmplifier.addRecipe(yourStack, nbt);
*/
public static IMachineRecipeManager matterAmplifier;
/**
* Reference scrap box chance values:
*
* 0.1: Diamond
* 0.5: Cake, Gold Helmet, Iron Ore, Gold Ore
* 1.0: Wooden tools, Soul Sand, Sign, Leather, Feather, Bone
* 1.5: Apple, Bread
* 2.0: Netherrack, Rotten Flesh
* 3.0: Grass, Gravel
* 4.0: Stick
* 5.0: Dirt, Wooden Hoe
*/
public static IScrapboxManager scrapboxDrops;
public static IListRecipeManager recyclerBlacklist;
public static ICraftingRecipeManager advRecipes;
public static ISemiFluidFuelManager semiFluidGenerator;
}

View file

@ -1,46 +0,0 @@
package ic2.api.tile;
import java.util.*;
import net.minecraft.block.Block;
/**
* Blocks on this whitelist will not resist an explosion but won't be destroyed.
*
* The explosion code by default ignores blocks which absorb more than 1000 explosion power to
* prevent abusing personal safes, Trade-O-Mats and other blocks to serve as a cheap and
* invulnerable reactor chambers. Said blocks will not shield the explosion and won't get
* destroyed.
*/
public final class ExplosionWhitelist {
/**
* Add a block to the whitelist.
*
* @param block block to add
*/
public static void addWhitelistedBlock(Block block) {
whitelist.add(block);
}
/**
* Remove a block from the whitelist.
*
* @param block block to remove
*/
public static void removeWhitelistedBlock(Block block) {
whitelist.remove(block);
}
/**
* Check if a block is on the whitelist.
*
* @param block block to check if whitelisted
* @return Whether the block is whitelisted
*/
public static boolean isBlockWhitelisted(Block block) {
return whitelist.contains(block);
}
private static Set<Block> whitelist = new HashSet<Block>();
}

View file

@ -1,61 +0,0 @@
package ic2.api.tile;
import net.minecraftforge.common.ForgeDirection;
/**
* Interface implemented by the tile entity of energy storage blocks.
*/
public interface IEnergyStorage {
/**
* Get the amount of energy currently stored in the block.
*
* @return Energy stored in the block
*/
public int getStored();
/**
* Set the amount of energy currently stored in the block.
*
* @param energy stored energy
*/
public void setStored(int energy);
/**
* Add the specified amount of energy.
*
* Use negative values to decrease.
*
* @param amount of energy to add
* @return Energy stored in the block after adding the specified amount
*/
public int addEnergy(int amount);
/**
* Get the maximum amount of energy the block can store.
*
* @return Maximum energy stored
*/
public int getCapacity();
/**
* Get the block's energy output.
*
* @return Energy output in EU/t
*/
public int getOutput();
/**
* Get the block's energy output.
*
* @return Energy output in EU/t
*/
public double getOutputEnergyUnitsPerTick();
/**
* Get whether this block can have its energy used by an adjacent teleporter.
*
* @param side side the teleporter is draining energy from
* @return Whether the block is teleporter compatible
*/
public boolean isTeleporterCompatible(ForgeDirection side);
}

View file

@ -1,59 +0,0 @@
package ic2.api.tile;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
/**
* Allows a tile entity to make use of the wrench's removal and rotation functions.
*/
public interface IWrenchable {
/**
* Determine if the wrench can be used to set the block's facing.
* Called before wrenchCanRemove().
*
* @param entityPlayer player using the wrench, may be null
* @param side block's side the wrench was clicked on
* @return Whether the wrenching was done and the wrench should be damaged
*/
boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side);
/**
* Get the block's facing.
*
* @return Block facing
*/
short getFacing();
/**
* Set the block's facing
*
* @param facing facing to set the block to
*/
void setFacing(short facing);
/**
* Determine if the wrench can be used to remove the block.
* Called if wrenchSetFacing fails.
*
* @param entityPlayer player using the wrench, may be null
* @return Whether the wrenching was done and the wrench should be damaged
*/
boolean wrenchCanRemove(EntityPlayer entityPlayer);
/**
* Determine the probability to drop the block as it is.
* The first entry in getBlockDropped will be replaced by blockid:meta if the drop is successful.
*
* @return Probability from 0 to 1
*/
float getWrenchDropRate();
/**
* Determine the item the block will drop when the wrenching is successful.
*
* @param entityPlayer player using the wrench, may be null
* @return Item to drop, may be null
*/
ItemStack getWrenchDrop(EntityPlayer entityPlayer);
}

View file

@ -174,9 +174,12 @@ public abstract class TileEntityUniversalElectrical extends TileEntityElectrical
if (receiver != null) if (receiver != null)
{ {
float bc3Provide = provide * Compatibility.TO_BC_RATIO; if (receiver.powerRequest() > 0)
float energyUsed = Math.min(receiver.receiveEnergy(this.bcBlockType, bc3Provide, outputDirection.getOpposite()), bc3Provide); {
this.provideElectricity((bc3Provide - (energyUsed * Compatibility.TO_BC_RATIO)), true); float bc3Provide = provide * Compatibility.TO_BC_RATIO;
float energyUsed = Math.min(receiver.receiveEnergy(this.bcBlockType, bc3Provide, outputDirection.getOpposite()), bc3Provide);
this.provideElectricity(energyUsed * Compatibility.TO_BC_RATIO, true);
}
} }
return true; return true;

View file

@ -62,6 +62,8 @@ public class UniversalNetwork extends ElectricityNetwork
if (totalEnergyRequest > 0) if (totalEnergyRequest > 0)
{ {
boolean markRefresh = false;
for (TileEntity tileEntity : avaliableEnergyTiles) for (TileEntity tileEntity : avaliableEnergyTiles)
{ {
if (tileEntity != null && !tileEntity.isInvalid()) if (tileEntity != null && !tileEntity.isInvalid())
@ -114,13 +116,16 @@ public class UniversalNetwork extends ElectricityNetwork
TileEntity conductor = VectorHelper.getConnectorFromSide(tileEntity.worldObj, new Vector3(tileEntity), direction); TileEntity conductor = VectorHelper.getConnectorFromSide(tileEntity.worldObj, new Vector3(tileEntity), direction);
PowerReceiver receiver = electricalTile.getPowerReceiver(direction); PowerReceiver receiver = electricalTile.getPowerReceiver(direction);
if (this.getConductors().contains(conductor)) if (receiver != null)
{ {
float energyToSend = totalUsableEnergy * ((receiver.powerRequest() * Compatibility.TO_BC_RATIO) / totalEnergyRequest); if (this.getConductors().contains(conductor))
if (energyToSend > 0)
{ {
remainingUsableEnergy -= receiver.receiveEnergy(Type.PIPE, energyToSend * Compatibility.TO_BC_RATIO, direction); float energyToSend = totalUsableEnergy * ((receiver.powerRequest() * Compatibility.TO_BC_RATIO) / totalEnergyRequest);
if (energyToSend > 0)
{
remainingUsableEnergy -= receiver.receiveEnergy(Type.PIPE, energyToSend * Compatibility.TO_BC_RATIO, direction);
}
} }
} }
} }
@ -129,10 +134,14 @@ public class UniversalNetwork extends ElectricityNetwork
} }
else else
{ {
this.refresh(); markRefresh = true;
break;
} }
} }
if(markRefresh)
{
this.refresh();
}
} }
} }
} }
@ -176,9 +185,14 @@ public class UniversalNetwork extends ElectricityNetwork
{ {
for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS) for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS)
{ {
if (((IEnergySink) tileEntity).acceptsEnergyFrom(VectorHelper.getTileEntityFromSide(tileEntity.worldObj, new Vector3(tileEntity), direction), ForgeDirection.values()[(direction.ordinal() + 2) % 6]) && this.getConductors().contains(VectorHelper.getConnectorFromSide(tileEntity.worldObj, new Vector3(tileEntity), direction))) if (((IEnergySink) tileEntity).acceptsEnergyFrom(VectorHelper.getTileEntityFromSide(tileEntity.worldObj, new Vector3(tileEntity), direction), direction) && this.getConductors().contains(VectorHelper.getConnectorFromSide(tileEntity.worldObj, new Vector3(tileEntity), direction)))
{ {
requests.add(ElectricityPack.getFromWatts((float) (Math.min(((IEnergySink) tileEntity).demandedEnergyUnits(), ((IEnergySink) tileEntity).getMaxSafeInput()) * Compatibility.IC2_RATIO), 120)); ElectricityPack pack = ElectricityPack.getFromWatts((float) (Math.min(((IEnergySink) tileEntity).demandedEnergyUnits(), ((IEnergySink) tileEntity).getMaxSafeInput()) * Compatibility.IC2_RATIO), 1);
if (pack.getWatts() > 0)
{
requests.add(pack);
}
} }
} }
@ -191,7 +205,7 @@ public class UniversalNetwork extends ElectricityNetwork
{ {
if (((IPowerReceptor) tileEntity).getPowerReceiver(direction) != null) if (((IPowerReceptor) tileEntity).getPowerReceiver(direction) != null)
{ {
ElectricityPack pack = ElectricityPack.getFromWatts(((IPowerReceptor) tileEntity).getPowerReceiver(direction).powerRequest() * Compatibility.BC3_RATIO, 120); ElectricityPack pack = ElectricityPack.getFromWatts(((IPowerReceptor) tileEntity).getPowerReceiver(direction).powerRequest() * Compatibility.BC3_RATIO, 1);
if (pack.getWatts() > 0) if (pack.getWatts() > 0)
{ {
@ -281,7 +295,7 @@ public class UniversalNetwork extends ElectricityNetwork
possibleDirections = new ArrayList<ForgeDirection>(); possibleDirections = new ArrayList<ForgeDirection>();
} }
if (((IEnergyAcceptor) acceptor).acceptsEnergyFrom(VectorHelper.getTileEntityFromSide(acceptor.worldObj, new Vector3(acceptor), ForgeDirection.getOrientation(i)), ForgeDirection.values()[(i + 2) % 6]) && this.getConductors().contains(VectorHelper.getConnectorFromSide(acceptor.worldObj, new Vector3(acceptor), ForgeDirection.getOrientation(i)))) if (((IEnergyAcceptor) acceptor).acceptsEnergyFrom(VectorHelper.getTileEntityFromSide(acceptor.worldObj, new Vector3(acceptor), ForgeDirection.getOrientation(i)), ForgeDirection.getOrientation(i)) && this.getConductors().contains(VectorHelper.getConnectorFromSide(acceptor.worldObj, new Vector3(acceptor), ForgeDirection.getOrientation(i))))
{ {
possibleDirections.add(ForgeDirection.getOrientation(i)); possibleDirections.add(ForgeDirection.getOrientation(i));
} }

View file

@ -35,6 +35,9 @@ public class UniversalElectricity
* explode under high voltage and react to different amounts of voltage differently. * explode under high voltage and react to different amounts of voltage differently.
*/ */
public static boolean isVoltageSensitive = false; public static boolean isVoltageSensitive = false;
//TODO: Enable this next major MC version
//public static float DEFAULT_VOLTAGE = 1;
/** /**
* Set this value to true if your mod contains and has the ability to transfer electricity via * Set this value to true if your mod contains and has the ability to transfer electricity via

View file

@ -6,146 +6,144 @@ import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTBase;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagDouble;
import net.minecraft.nbt.NBTTagFloat;
import net.minecraft.world.World; import net.minecraft.world.World;
import universalelectricity.core.electricity.ElectricityDisplay; import universalelectricity.core.electricity.ElectricityDisplay;
import universalelectricity.core.electricity.ElectricityDisplay.ElectricUnit; import universalelectricity.core.electricity.ElectricityDisplay.ElectricUnit;
/** /** Extend from this class if your item requires electricity or to be charged. Optionally, you can
* Extend from this class if your item requires electricity or to be charged. Optionally, you can
* implement IItemElectric instead. * implement IItemElectric instead.
* *
* @author Calclavia * @author Calclavia */
*
*/
public abstract class ItemElectric extends Item implements IItemElectric public abstract class ItemElectric extends Item implements IItemElectric
{ {
public ItemElectric(int id) public ItemElectric(int id)
{ {
super(id); super(id);
this.setMaxStackSize(1); this.setMaxStackSize(1);
this.setMaxDamage(100); this.setMaxDamage(100);
this.setNoRepair(); this.setNoRepair();
} }
@Override @Override
public void addInformation(ItemStack itemStack, EntityPlayer entityPlayer, List list, boolean par4) public void addInformation(ItemStack itemStack, EntityPlayer entityPlayer, List list, boolean par4)
{ {
String color = ""; String color = "";
float joules = this.getElectricityStored(itemStack); float joules = this.getElectricityStored(itemStack);
if (joules <= this.getMaxElectricityStored(itemStack) / 3) if (joules <= this.getMaxElectricityStored(itemStack) / 3)
{ {
color = "\u00a74"; color = "\u00a74";
} }
else if (joules > this.getMaxElectricityStored(itemStack) * 2 / 3) else if (joules > this.getMaxElectricityStored(itemStack) * 2 / 3)
{ {
color = "\u00a72"; color = "\u00a72";
} }
else else
{ {
color = "\u00a76"; color = "\u00a76";
} }
list.add(color + ElectricityDisplay.getDisplayShort(joules, ElectricUnit.JOULES) + "/" + ElectricityDisplay.getDisplayShort(this.getMaxElectricityStored(itemStack), ElectricUnit.JOULES)); list.add(color + ElectricityDisplay.getDisplayShort(joules, ElectricUnit.JOULES) + "/" + ElectricityDisplay.getDisplayShort(this.getMaxElectricityStored(itemStack), ElectricUnit.JOULES));
} }
/** /** Makes sure the item is uncharged when it is crafted and not charged. Change this if you do
* Makes sure the item is uncharged when it is crafted and not charged. Change this if you do * not want this to happen! */
* not want this to happen! @Override
*/ public void onCreated(ItemStack itemStack, World par2World, EntityPlayer par3EntityPlayer)
@Override {
public void onCreated(ItemStack itemStack, World par2World, EntityPlayer par3EntityPlayer) this.setElectricity(itemStack, 0);
{ }
this.setElectricity(itemStack, 0);
}
@Override @Override
public float recharge(ItemStack itemStack, float energy, boolean doReceive) public float recharge(ItemStack itemStack, float energy, boolean doReceive)
{ {
float rejectedElectricity = Math.max((this.getElectricityStored(itemStack) + energy) - this.getMaxElectricityStored(itemStack), 0); float rejectedElectricity = Math.max((this.getElectricityStored(itemStack) + energy) - this.getMaxElectricityStored(itemStack), 0);
float energyToReceive = energy - rejectedElectricity; float energyToReceive = energy - rejectedElectricity;
if (doReceive) if (doReceive)
{ {
this.setElectricity(itemStack, this.getElectricityStored(itemStack) + energyToReceive); this.setElectricity(itemStack, this.getElectricityStored(itemStack) + energyToReceive);
} }
return energyToReceive; return energyToReceive;
} }
@Override @Override
public float discharge(ItemStack itemStack, float energy, boolean doTransfer) public float discharge(ItemStack itemStack, float energy, boolean doTransfer)
{ {
float energyToTransfer = Math.min(this.getElectricityStored(itemStack), energy); float energyToTransfer = Math.min(this.getElectricityStored(itemStack), energy);
if (doTransfer) if (doTransfer)
{ {
this.setElectricity(itemStack, this.getElectricityStored(itemStack) - energyToTransfer); this.setElectricity(itemStack, this.getElectricityStored(itemStack) - energyToTransfer);
} }
return energyToTransfer; return energyToTransfer;
} }
@Override @Override
public float getVoltage(ItemStack itemStack) public float getVoltage(ItemStack itemStack)
{ {
return 120; return 0.120f;
} }
@Override @Override
public void setElectricity(ItemStack itemStack, float joules) public void setElectricity(ItemStack itemStack, float joules)
{ {
// Saves the frequency in the ItemStack // Saves the frequency in the ItemStack
if (itemStack.getTagCompound() == null) if (itemStack.getTagCompound() == null)
{ {
itemStack.setTagCompound(new NBTTagCompound()); itemStack.setTagCompound(new NBTTagCompound());
} }
float electricityStored = Math.max(Math.min(joules, this.getMaxElectricityStored(itemStack)), 0); float electricityStored = Math.max(Math.min(joules, this.getMaxElectricityStored(itemStack)), 0);
itemStack.getTagCompound().setFloat("electricity", electricityStored); itemStack.getTagCompound().setFloat("electricity", electricityStored);
/** /** Sets the damage as a percentage to render the bar properly. */
* Sets the damage as a percentage to render the bar properly. itemStack.setItemDamage((int) (100 - (electricityStored / getMaxElectricityStored(itemStack)) * 100));
*/ }
itemStack.setItemDamage((int) (100 - (electricityStored / getMaxElectricityStored(itemStack)) * 100));
}
@Override @Override
public float getTransfer(ItemStack itemStack) public float getTransfer(ItemStack itemStack)
{ {
return this.getMaxElectricityStored(itemStack) - this.getElectricityStored(itemStack); return this.getMaxElectricityStored(itemStack) - this.getElectricityStored(itemStack);
} }
/** /** Gets the energy stored in the item. Energy is stored using item NBT */
* This function is called to get the electricity stored in this item @Override
* public float getElectricityStored(ItemStack itemStack)
* @return - The amount of electricity stored in watts {
*/ if (itemStack.getTagCompound() == null)
@Override {
public float getElectricityStored(ItemStack itemStack) itemStack.setTagCompound(new NBTTagCompound());
{ }
if (itemStack.getTagCompound() == null) float energyStored = 0f;
{ if (itemStack.getTagCompound().hasKey("electricity"))
itemStack.setTagCompound(new NBTTagCompound()); {
} NBTBase obj = itemStack.getTagCompound().getTag("electricity");
if (obj instanceof NBTTagDouble)
{
energyStored = (float) ((NBTTagDouble) obj).data;
}
else if (obj instanceof NBTTagFloat)
{
energyStored = ((NBTTagFloat) obj).data;
}
}
float electricityStored = itemStack.getTagCompound().getFloat("electricity"); /** Sets the damage as a percentage to render the bar properly. */
itemStack.setItemDamage((int) (100 - (energyStored / getMaxElectricityStored(itemStack)) * 100));
return energyStored;
}
/** @Override
* Sets the damage as a percentage to render the bar properly. public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List)
*/ {
itemStack.setItemDamage((int) (100 - (electricityStored / getMaxElectricityStored(itemStack)) * 100)); par3List.add(ElectricItemHelper.getUncharged(new ItemStack(this)));
return electricityStored; par3List.add(ElectricItemHelper.getWithCharge(new ItemStack(this), this.getMaxElectricityStored(new ItemStack(this))));
} }
@Override
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List)
{
// Add an uncharged version of the electric item
par3List.add(ElectricItemHelper.getUncharged(new ItemStack(this)));
// Add an electric item to the creative list that is fully charged
ItemStack chargedItem = new ItemStack(this);
par3List.add(ElectricItemHelper.getWithCharge(chargedItem, this.getMaxElectricityStored(chargedItem)));
}
} }

View file

@ -1,179 +1,213 @@
package universalelectricity.core.vector; package universalelectricity.core.vector;
import universalelectricity.core.vector.Vector3; /**
* Quaternion class designed to be used for the rotation of objects.
/** Simple quaternion class designed to be used for rotation of objects. *
* * Do not use in MC 1.6.4, subject to change!
* @author DarkGuardsman */ *
public class Quaternion * @author DarkGuardsman, Calclavia
*/
public class Quaternion implements Cloneable
{ {
public static final float TOLERANCE = 0.00001f; public static final float TOLERANCE = 0.00001f;
float x, y, z, w; public double x, y, z, w;
public Quaternion() public Quaternion()
{ {
this(0, 0, 0, 1); this(0, 0, 0, 1);
} }
public Quaternion(float x, float y, float z, float w) public Quaternion(Quaternion copy)
{ {
this.x = x; this(copy.x, copy.y, copy.z, copy.w);
this.y = y; }
this.z = z;
this.w = w;
}
public Quaternion(Vector3 vec, float w) public Quaternion(double x, double y, double z, double w)
{ {
this((float) vec.x, (float) vec.y, (float) vec.z, w); this.x = x;
} this.y = y;
this.z = z;
this.w = w;
}
public void set(Quaternion quaternion) /**
{ * Convert from Euler Angles. Basically we create 3 Quaternions, one for pitch, one for yaw, one
w = quaternion.w; * for roll and multiply those together. the calculation below does the same, just shorter
x = quaternion.x; */
y = quaternion.y; public Quaternion(float pitch, float yaw, float roll)
z = quaternion.z; {
} float p = (float) (pitch * (Math.PI / 180) / 2.0);
float y = (float) (yaw * (Math.PI / 180) / 2.0);
float r = (float) (roll * (Math.PI / 180) / 2.0);
public void set(float x, float y, float z, float w) float sinp = (float) Math.sin(p);
{ float siny = (float) Math.sin(y);
this.x = x; float sinr = (float) Math.sin(r);
this.y = y; float cosp = (float) Math.cos(p);
this.z = z; float cosy = (float) Math.cos(y);
this.w = w; float cosr = (float) Math.cos(r);
}
/** Normalizes the Quaternion only if its outside the min errors range */ this.x = sinr * cosp * cosy - cosr * sinp * siny;
public void normalise() this.y = cosr * sinp * cosy + sinr * cosp * siny;
{ this.z = cosr * cosp * siny - sinr * sinp * cosy;
// Don't normalize if we don't have to this.w = cosr * cosp * cosy + sinr * sinp * siny;
double mag2 = w * w + x * x + y * y + z * z;
if (Math.abs(mag2) > TOLERANCE && Math.abs(mag2 - 1.0f) > TOLERANCE)
{
float mag = (float) Math.sqrt(mag2);
w /= mag;
x /= mag;
y /= mag;
z /= mag;
}
}
/** Gets the inverse of this Quaternion */ this.normalize();
public Quaternion getConj() }
{
return new Quaternion(-x, -y, -z, w);
}
public void conj() public Quaternion(Vector3 vector, double w)
{ {
x = -x; this(vector.x, vector.y, vector.z, w);
y = -y; }
z = -z;
}
/** Multiplying q1 with q2 applies the rotation q2 to q1 */ public static Quaternion IDENTITY()
public Quaternion multi(Quaternion rq) {
{ return new Quaternion();
return new Quaternion(w * rq.x + x * rq.w + y * rq.z - z * rq.y, w * rq.y + y * rq.w + z * rq.x - x * rq.z, w * rq.z + z * rq.w + x * rq.y - y * rq.x, w * rq.w - x * rq.x - y * rq.y - z * rq.z); }
}
public void multLocal(Quaternion q) public Quaternion set(Quaternion quaternion)
{ {
Quaternion temp = this.multi(q); this.w = quaternion.w;
this.set(temp); this.x = quaternion.x;
} this.y = quaternion.y;
this.z = quaternion.z;
return this;
}
/** Multi a vector against this in other words applying rotation */ public Quaternion set(double x, double y, double z, double w)
public Vector3 multi(Vector3 vec) {
{ return this.set(new Quaternion(x, y, z, w));
Vector3 vn = vec.clone(); }
Quaternion vecQuat = new Quaternion(0, 0, 0, 1), resQuat; public Quaternion normalize()
vecQuat.x = (float) vn.x; {
vecQuat.y = (float) vn.y; double magnitude = this.magnitude();
vecQuat.z = (float) vn.z; this.x /= magnitude;
vecQuat.w = 0.0f; this.y /= magnitude;
this.z /= magnitude;
this.w /= magnitude;
return this;
}
resQuat = vecQuat.multi(this.getConj()); public double magnitude()
resQuat = this.multi(resQuat); {
return Math.sqrt(this.magnitudeSquared());
}
return new Vector3(resQuat.x, resQuat.y, resQuat.z); public double magnitudeSquared()
} {
return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w;
}
public void FromAxis(Vector3 v, float angle) public Quaternion inverse()
{ {
angle *= 0.5f; double d = this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w;
Vector3 vn = v.clone(); return new Quaternion(this.x / d, -this.y / d, -this.z / d, -this.w / d);
vn.normalize(); }
float sinAngle = (float) Math.sin(angle); /**
* Gets the conjugate of this Quaternion
*/
public Quaternion getConjugate()
{
return this.clone().conjugate();
}
x = (float) (vn.x * sinAngle); public Quaternion conjugate()
y = (float) (vn.y * sinAngle); {
z = (float) (vn.z * sinAngle); this.y = -this.y;
w = (float) Math.cos(angle); this.z = -this.z;
} this.w = -this.w;
return this;
}
// Convert from Euler Angles /**
public void FromEuler(float pitch, float yaw, float roll) * Let the current quaternion be "a". Multiplying the a with b applies the rotation a to b.
{ */
// Basically we create 3 Quaternions, one for pitch, one for yaw, one for roll public Quaternion getMultiply(Quaternion b)
// and multiply those together. {
// the calculation below does the same, just shorter return this.clone().multiply(b);
}
float p = (float) (pitch * (Math.PI / 180) / 2.0); public Quaternion multiply(Quaternion b)
float y = (float) (yaw * (Math.PI / 180) / 2.0); {
float r = (float) (roll * (Math.PI / 180) / 2.0); Quaternion a = this;
double newX = a.x * b.x - a.y * b.y - a.z * b.z - a.w * b.w;
double newY = a.x * b.y + a.y * b.x + a.z * b.w - a.w * b.z;
double newZ = a.x * b.z - a.y * b.w + a.z * b.x + a.w * b.y;
double newW = a.x * b.w + a.y * b.z - a.z * b.y + a.w * b.x;
this.set(newX, newY, newZ, newW);
return this;
}
float sinp = (float) Math.sin(p); public Quaternion divide(Quaternion b)
float siny = (float) Math.sin(y); {
float sinr = (float) Math.sin(r); Quaternion a = this;
float cosp = (float) Math.cos(p); return a.inverse().multiply(b);
float cosy = (float) Math.cos(y); }
float cosr = (float) Math.cos(r);
x = sinr * cosp * cosy - cosr * sinp * siny; /** Multi a vector against this in other words applying rotation */
y = cosr * sinp * cosy + sinr * cosp * siny; public Vector3 multi(Vector3 vec)
z = cosr * cosp * siny - sinr * sinp * cosy; {
w = cosr * cosp * cosy + sinr * sinp * siny; Vector3 vn = vec.clone();
normalise(); Quaternion vecQuat = new Quaternion(0, 0, 0, 1), resQuat;
} vecQuat.x = (float) vn.x;
vecQuat.y = (float) vn.y;
vecQuat.z = (float) vn.z;
vecQuat.w = 0.0f;
/* Convert to Matrix resQuat = vecQuat.multiply(this.getConjugate());
public Matrix4 getMatrix() resQuat = this.multiply(resQuat);
{
float x2 = (float) (x * x);
float y2 = (float) (y * y);
float z2 = (float) (z * z);
float xy = (float) (x * y);
float xz = (float) (x * z);
float yz = (float) (y * z);
float wx = (float) (w * x);
float wy = (float) (w * y);
float wz = (float) (w * z);
// This calculation would be a lot more complicated for non-unit length quaternions return new Vector3(resQuat.x, resQuat.y, resQuat.z);
// Note: The constructor of Matrix4 expects the Matrix in column-major format like expected }
// by
// OpenGL
return new Matrix4(1.0f - 2.0f * (y2 + z2), 2.0f * (xy - wz), 2.0f * (xz + wy), 0.0f, 2.0f * (xy + wz), 1.0f - 2.0f * (x2 + z2), 2.0f * (yz - wx), 0.0f, 2.0f * (xz - wy), 2.0f * (yz + wx), 1.0f - 2.0f * (x2 + y2), 0.0f, 0.0f, 0.0f, 0.0f, 1.0f);
}*/
// Convert to Axis/Angles public static Quaternion fromAxis(Vector3 vector, double angle)
public void getAxisAngle(Vector3 axis, float angle) {
{ angle *= 0.5f;
float scale = (float) Math.sqrt(x * x + y * y + z * z); Vector3 vn = vector.clone().normalize();
x = x / scale; float sinAngle = (float) Math.sin(angle);
y = y / scale; return new Quaternion(vn.x * sinAngle, vn.y * sinAngle, vn.z * sinAngle, Math.cos(angle));
z = z / scale; }
angle = (float) (Math.acos(w) * 2.0f);
}
@Override /*
public String toString() * Convert to Matrix public Matrix4 getMatrix() { float x2 = (float) (x * x); float y2 = (float)
{ * (y * y); float z2 = (float) (z * z); float xy = (float) (x * y); float xz = (float) (x * z);
return "<" + x + "x " + y + "y " + z + "z @" + w + ">"; * float yz = (float) (y * z); float wx = (float) (w * x); float wy = (float) (w * y); float wz
} * = (float) (w * z);
*
* // This calculation would be a lot more complicated for non-unit length quaternions // Note:
* The constructor of Matrix4 expects the Matrix in column-major format like expected // by //
* OpenGL return new Matrix4(1.0f - 2.0f * (y2 + z2), 2.0f * (xy - wz), 2.0f * (xz + wy), 0.0f,
* 2.0f * (xy + wz), 1.0f - 2.0f * (x2 + z2), 2.0f * (yz - wx), 0.0f, 2.0f * (xz - wy), 2.0f *
* (yz + wx), 1.0f - 2.0f * (x2 + y2), 0.0f, 0.0f, 0.0f, 0.0f, 1.0f); }
*/
/**
* Convert to Axis/Angles
*
* @param axis - The axis of rotation
* @param angle - The angle of rotation
*/
public void getAxisAngle(Vector3 axis, float angle)
{
float scale = (float) axis.getMagnitude();
this.x = this.x / scale;
this.y = this.y / scale;
this.z = this.z / scale;
angle = (float) (Math.acos(this.w) * 2.0f);
}
@Override
public Quaternion clone()
{
return new Quaternion(this);
}
@Override
public String toString()
{
return "Quaternion [" + x + ", " + y + ", " + z + ", " + w + "]";
}
} }

View file

@ -712,7 +712,7 @@ public class Vector3 implements Cloneable
{ {
// Somehow this destroys the playerPosition vector -.- // Somehow this destroys the playerPosition vector -.-
MovingObjectPosition pickedBlock = this.rayTraceBlocks(world, rotationYaw, rotationPitch, collisionFlag, reachDistance); MovingObjectPosition pickedBlock = this.rayTraceBlocks(world, rotationYaw, rotationPitch, collisionFlag, reachDistance);
MovingObjectPosition pickedEntity = this.rayTraceEntities(world, rotationYaw, rotationPitch, collisionFlag, reachDistance); MovingObjectPosition pickedEntity = this.rayTraceEntities(world, rotationYaw, rotationPitch, reachDistance);
if (pickedBlock == null) if (pickedBlock == null)
{ {
@ -740,8 +740,8 @@ public class Vector3 implements Cloneable
public MovingObjectPosition rayTraceBlocks(World world, float rotationYaw, float rotationPitch, boolean collisionFlag, double reachDistance) public MovingObjectPosition rayTraceBlocks(World world, float rotationYaw, float rotationPitch, boolean collisionFlag, double reachDistance)
{ {
Vector3 lookVector = getDeltaPositionFromRotation(rotationYaw, rotationPitch); Vector3 lookVector = this.getDeltaPositionFromRotation(rotationYaw, rotationPitch);
Vector3 reachPoint = translate(this, Vector3.scale(lookVector, reachDistance)); Vector3 reachPoint = this.clone().translate(lookVector.clone().scale(reachDistance));
return world.rayTraceBlocks_do_do(this.toVec3(), reachPoint.toVec3(), collisionFlag, !collisionFlag); return world.rayTraceBlocks_do_do(this.toVec3(), reachPoint.toVec3(), collisionFlag, !collisionFlag);
} }
@ -756,11 +756,19 @@ public class Vector3 implements Cloneable
return this.rayTraceEntities(world, getDeltaPositionFromRotation(rotationYaw, rotationPitch).scale(reachDistance)); return this.rayTraceEntities(world, getDeltaPositionFromRotation(rotationYaw, rotationPitch).scale(reachDistance));
} }
/**
* Does an entity raytrace.
*
* @param world - The world object.
* @param target - The rotation in terms of Vector3. Convert using
* getDeltaPositionFromRotation()
* @return The target hit.
*/
public MovingObjectPosition rayTraceEntities(World world, Vector3 target) public MovingObjectPosition rayTraceEntities(World world, Vector3 target)
{ {
MovingObjectPosition pickedEntity = null; MovingObjectPosition pickedEntity = null;
Vec3 startingPosition = this.toVec3(); Vec3 startingPosition = this.toVec3();
Vec3 look = target.clone().difference(this).normalize().toVec3(); Vec3 look = target.toVec3();
double reachDistance = this.distance(target); double reachDistance = this.distance(target);
Vec3 reachPoint = Vec3.createVectorHelper(startingPosition.xCoord + look.xCoord * reachDistance, startingPosition.yCoord + look.yCoord * reachDistance, startingPosition.zCoord + look.zCoord * reachDistance); Vec3 reachPoint = Vec3.createVectorHelper(startingPosition.xCoord + look.xCoord * reachDistance, startingPosition.yCoord + look.yCoord * reachDistance, startingPosition.zCoord + look.zCoord * reachDistance);

View file

@ -62,22 +62,32 @@ public abstract class TileEntityElectrical extends TileEntityAdvanced implements
if (provide > 0) if (provide > 0)
{ {
TileEntity outputTile = VectorHelper.getConnectorFromSide(this.worldObj, new Vector3(this), outputDirection); TileEntity outputTile = VectorHelper.getConnectorFromSide(this.worldObj, new Vector3(this), outputDirection);
IElectricityNetwork outputNetwork = ElectricityHelper.getNetworkFromTileEntity(outputTile, outputDirection); IElectricityNetwork outputNetwork = ElectricityHelper.getNetworkFromTileEntity(outputTile, outputDirection);
if (outputNetwork != null)
{
ElectricityPack powerRequest = outputNetwork.getRequest(this);
if (outputNetwork != null) if (powerRequest.getWatts() > 0)
{ {
ElectricityPack powerRequest = outputNetwork.getRequest(this); ElectricityPack sendPack = ElectricityPack.min(ElectricityPack.getFromWatts(this.getEnergyStored(), this.getVoltage()), ElectricityPack.getFromWatts(provide, this.getVoltage()));
float rejectedPower = outputNetwork.produce(sendPack, this);
if (powerRequest.getWatts() > 0) this.provideElectricity(sendPack.getWatts() - rejectedPower, true);
{ return true;
ElectricityPack sendPack = ElectricityPack.min(ElectricityPack.getFromWatts(this.getEnergyStored(), this.getVoltage()), ElectricityPack.getFromWatts(provide, this.getVoltage())); }
float rejectedPower = outputNetwork.produce(sendPack, this); }
this.provideElectricity(sendPack.getWatts() - rejectedPower, true); else if (outputTile instanceof IElectrical)
} {
float requestedEnergy = ((IElectrical) outputTile).getRequest(outputDirection.getOpposite());
return true;
} if (requestedEnergy > 0)
{
ElectricityPack sendPack = ElectricityPack.min(ElectricityPack.getFromWatts(this.getEnergyStored(), this.getVoltage()), ElectricityPack.getFromWatts(provide, this.getVoltage()));
float acceptedEnergy = ((IElectrical) outputTile).receiveElectricity(outputDirection.getOpposite(), sendPack, true);
this.setEnergyStored(this.getEnergyStored() - acceptedEnergy);
return true;
}
}
} }
} }