From 2db8e30b1d2151fdde5d08a6c06aef55f0c397d2 Mon Sep 17 00:00:00 2001 From: Foghrye4 Date: Fri, 27 Jan 2017 11:32:28 +0300 Subject: License, readme and stuff --- .gitignore | 5 +- .gitignore~ | 22 + README.md | 5 + assets/AbsorberCooler.tcn | Bin 6279 -> 0 bytes assets/BatterySwitchUnit.tcn | Bin 5637 -> 0 bytes assets/CableHolder.tcn | Bin 3883 -> 0 bytes assets/Charger-ejector.tcn | Bin 7268 -> 0 bytes assets/Coiler.tcn | Bin 7235 -> 0 bytes assets/Collector.tcn | Bin 6548 -> 0 bytes assets/Collector2.tcn | Bin 13705 -> 0 bytes assets/Cutter.tcn | Bin 5576 -> 0 bytes assets/Cutter2.tcn | Bin 5576 -> 0 bytes assets/DrawingDesk.tcn | Bin 6120 -> 0 bytes assets/ElectrolisisBath.tcn | Bin 9335 -> 0 bytes assets/Extruder.tcn | Bin 7251 -> 0 bytes assets/GaedesMercuryRotaryPump.tcn | Bin 3437 -> 0 bytes assets/GasWeldingStation.tcn | Bin 6428 -> 0 bytes assets/GlassMeltingPoint.tcn | Bin 6306 -> 0 bytes assets/Helper.tcn | Bin 5219 -> 0 bytes assets/ImpregnatingMachine.tcn | Bin 6246 -> 0 bytes assets/IronWorkbench.tcn | Bin 6005 -> 0 bytes assets/LatheP1.tcn | Bin 7371 -> 0 bytes assets/PrecipitatorCondenser.tcn | Bin 6493 -> 0 bytes assets/ReactorPart1.tcn | Bin 6057 -> 0 bytes assets/RectifierTransformerUnit.tcn | Bin 6705 -> 0 bytes assets/RefluxCondenser.tcn | Bin 4524 -> 0 bytes assets/RollingMachine.tcn | Bin 7121 -> 0 bytes assets/RollingMachinePart1.tcn | Bin 7219 -> 0 bytes assets/RollingMachinePart2.tcn | Bin 6877 -> 0 bytes assets/ShieldModel.tcn | Bin 33894 -> 0 bytes assets/Skull.tcn | Bin 79886 -> 0 bytes assets/Skull2.tcn | Bin 81414 -> 0 bytes assets/SpotLight.tcn | Bin 4708 -> 0 bytes assets/WoodenRollingMachine.tcn | Bin 7941 -> 0 bytes assets/WoodenRollingMachinePart2.tcn | Bin 7531 -> 0 bytes assets/chimneyKnee.tcn | Bin 6006 -> 0 bytes assets/fractionatorBottom.tcn | Bin 4328 -> 0 bytes assets/fractionatorCover.tcn | Bin 6989 -> 0 bytes assets/fractionatorSection.tcn | Bin 4321 -> 0 bytes assets/glassBox.tcn | Bin 4448 -> 0 bytes assets/ihl/config/ihl-recipe.cfg | 35 +- assets/ihl/lang/en_US.lang | 18 + assets/ihl/sounds.json | 12 + assets/ihl/sounds/explosion.ogg | Bin 0 -> 34262 bytes assets/ihl/sounds/fuse.ogg | Bin 0 -> 25668 bytes .../ihl/textures/blocks/explosiveBlockBottom.png | Bin 0 -> 1013 bytes assets/ihl/textures/blocks/explosiveBlockSide.png | Bin 0 -> 1097 bytes assets/ihl/textures/blocks/explosiveBlockTop.png | Bin 0 -> 1705 bytes .../textures/blocks/fluidAcetaldehydeFlowing.png | Bin 0 -> 2857 bytes .../ihl/textures/blocks/fluidAcetaldehydeStill.png | Bin 0 -> 2790 bytes assets/ihl/textures/blocks/fluidAmmoniaFlowing.png | Bin 0 -> 2914 bytes assets/ihl/textures/blocks/fluidAmmoniaStill.png | Bin 0 -> 2790 bytes .../textures/blocks/fluidFormaldehydeFlowing.png | Bin 0 -> 2906 bytes .../ihl/textures/blocks/fluidFormaldehydeStill.png | Bin 0 -> 2790 bytes .../ihl/textures/blocks/fluidMethanolFlowing.png | Bin 0 -> 2870 bytes .../ihl/textures/blocks/fluidMethanolFlowing.xcf | Bin 0 -> 4649 bytes assets/ihl/textures/blocks/fluidMethanolStill.png | Bin 0 -> 2789 bytes .../ihl/textures/blocks/fluidTarWaterFlowing.png | Bin 0 -> 2876 bytes assets/ihl/textures/blocks/fluidTarWaterStill.png | Bin 0 -> 2789 bytes .../blocks/vacuumInductionMeltingFurnaceBack.png | Bin 3747 -> 1438 bytes .../blocks/vacuumInductionMeltingFurnaceFront.png | Bin 2813 -> 1406 bytes .../blocks/vacuumInductionMeltingFurnaceLeft.png | Bin 5091 -> 1455 bytes .../blocks/vacuumInductionMeltingFurnaceRight.png | Bin 2394 -> 1270 bytes assets/ihl/textures/gui/GUIChemicalReactor.png | Bin 5486 -> 3329 bytes assets/ihl/textures/gui/GUIGlassBox.xcf | Bin 121209 -> 0 bytes assets/ihl/textures/gui/GUILabElectrolyzer.png | Bin 7773 -> 4028 bytes assets/ihl/textures/items/catalystIron.png | Bin 0 -> 1756 bytes assets/ihl/textures/items/catalystIronOxide.png | Bin 0 -> 1740 bytes assets/ihl/textures/items/catalystRawIronOxide.png | Bin 0 -> 1058 bytes assets/ihl/textures/items/detonator.png | Bin 0 -> 1482 bytes assets/ihl/textures/items/dustCalciumAcetate.png | Bin 0 -> 549 bytes .../textures/items/dustIronOxideCatalystMix.png | Bin 0 -> 450 bytes assets/ihl/textures/items/dustMercuryChloride.png | Bin 0 -> 539 bytes assets/ihl/textures/items/dustPentaerythritol.png | Bin 0 -> 387 bytes .../items/dustPentaerythritolTetranitrate.png | Bin 0 -> 387 bytes assets/ihl/textures/items/dustPotassiumOxide.png | Bin 0 -> 332 bytes assets/ihl/textures/items/dustSodiumFormate.png | Bin 0 -> 309 bytes assets/ihl/textures/items/ingotPotassium.png | Bin 0 -> 337 bytes assets/ihl/textures/items/itemCellMethanol.png | Bin 0 -> 320 bytes assets/ihl/textures/particles/explosion.png | Bin 0 -> 357813 bytes assets/lightBulb.tcn | Bin 4913 -> 0 bytes assets/loom.tcn | Bin 6280 -> 0 bytes assets/splitInjectionMold.tcn | Bin 7124 -> 0 bytes assets/vulcanizationExtrudingMold.tcn | Bin 7015 -> 0 bytes ihl/ClientProxy.java | 113 ++++- ihl/IHL3dPathFinder.java | 6 +- ihl/IHLMod.java | 370 +++++++++----- ihl/IHLModConfig.java | 173 +++++-- ihl/IHLModInfo.java | 2 +- ihl/IHLModInfo.java~ | 2 +- ihl/ServerProxy.java | 102 +++- ihl/collector/ChargerEjectorContainer.java | 5 +- ihl/collector/ChargerEjectorGui.java | 4 +- ihl/collector/ChargerEjectorTileEntity.java | 7 +- ihl/collector/CollectorEntity.java | 61 +-- ihl/collector/CollectorItem.java | 6 +- ihl/collector/GlassBoxContainer.java | 2 +- ihl/collector/GlassBoxGui.java | 11 - ihl/collector/GlassBoxRender.java | 2 - ihl/collector/GlassBoxTileEntity.java | 7 +- ihl/crop_harvestors/BlowerBlock.java | 1 - ihl/crop_harvestors/BlowerContainer.java | 2 +- ihl/crop_harvestors/BlowerGui.java | 8 - ihl/crop_harvestors/BlowerTileEntity.java | 17 +- ihl/crop_harvestors/RubberTreeBlock.java | 2 - ihl/crop_harvestors/SackBlock.java | 1 + ihl/crop_harvestors/SackTileEntity.java | 4 +- ihl/datanet/Contact.java | 2 +- ihl/datanet/DataCableItem.java | 22 +- ihl/datanet/DataGrid.java | 11 +- ihl/datanet/DataNet.java | 2 +- ihl/datanet/GuiInvisibleButton.java | 1 + ihl/datanet/RedstoneSignalConverterContainer.java | 3 +- ihl/datanet/RedstoneSignalConverterGui.java | 10 +- ihl/datanet/RedstoneSignalConverterTileEntity.java | 9 +- ihl/enviroment/LightBulbBlock.java | 4 +- ihl/enviroment/LightBulbModel.java | 8 - ihl/enviroment/LightBulbTileEntity.java | 6 +- ihl/enviroment/MirrorBlock.java | 24 +- ihl/enviroment/MirrorRender.java | 10 - ihl/enviroment/MirrorTileEntity.java | 29 +- ihl/enviroment/SpotlightTileEntity.java | 5 +- ihl/explosion/ChunkAndWorldLoadEventHandler.java | 72 +++ ihl/explosion/DetonatorMiniGUI.java | 83 ++++ ihl/explosion/ExplosionEntityFX.java | 177 +++++++ ihl/explosion/ExplosionRenderFX.java | 51 ++ ihl/explosion/ExplosionVectorBlockV2.java | 552 +++++++++++++++++++++ ihl/explosion/ExplosiveBlock.java | 252 ++++++++++ ihl/explosion/ExplosiveTileEntity.java | 85 ++++ ihl/explosion/GroundRemoverItem.java | 106 ++++ ihl/explosion/IHLEntityFallingPile.java | 152 ++++++ ihl/explosion/IHLEntityFallingPileRender.java | 52 ++ ihl/explosion/PileBlock.java | 125 +++++ ihl/explosion/PileBlockRender.java | 342 +++++++++++++ ihl/explosion/PileTileEntity.java | 91 ++++ ihl/explosion/PileTileEntityRender.java | 160 ++++++ ihl/explosion/WorldSavedDataBlastWave.java | 108 ++++ ihl/flexible_cable/AnchorBlock.java | 11 - ihl/flexible_cable/AnchorTileEntity.java | 7 +- .../BatterySwitchUnitTileEntity.java | 7 - .../FlexibleCableHolderBaseTileEntity.java | 20 +- ihl/flexible_cable/IHLENet.java | 4 +- ihl/flexible_cable/IHLGrid.java | 21 +- ihl/flexible_cable/InvSlotOutputInProgress.java | 2 +- .../InvSlotProcessableIronWorkbench.java | 27 +- ihl/flexible_cable/InvSlotTool.java | 76 ++- ihl/flexible_cable/InvSlotWorkspaceElement.java | 16 +- ihl/flexible_cable/IronWorkbenchContainer.java | 8 +- ihl/flexible_cable/IronWorkbenchGui.java | 11 - ihl/flexible_cable/IronWorkbenchInvSlot.java | 2 +- ihl/flexible_cable/IronWorkbenchRender.java | 4 - ihl/flexible_cable/IronWorkbenchRender.java~ | 40 -- ihl/flexible_cable/IronWorkbenchTileEntity.java | 71 ++- ihl/flexible_cable/IronWorkbenchTileEntity.java~ | 367 -------------- ihl/flexible_cable/NodeEntity.java | 27 +- ihl/flexible_cable/NodeRender.java | 9 - ihl/flexible_cable/PowerCableNodeEntity.java | 16 +- .../RectifierTransformerUnitTileEntity.java | 7 +- ihl/flexible_cable/SetOfDiesMiniGUI.java | 4 - ihl/flexible_cable/SubAnchorEnergyNetNode.java | 8 +- ihl/flexible_cable/SubRTUEnergyNetNode.java | 6 +- ihl/guidebook/IHLGuidebookGui.java | 16 +- ihl/handpump/AdvancedHandPump.java | 2 +- ihl/handpump/IHLHandPump.java | 6 +- ihl/i_hate_liquids/BlockDynamicLiquidPlus.java | 1 - ihl/i_hate_liquids/InvisibleMagicanEntity.java | 120 +---- ihl/interfaces/IDataCableHolder.java | 6 - ihl/interfaces/IItemHasMiniGUI.java | 1 - ihl/interfaces/INetworkListener.java | 1 - ihl/interfaces/ItemMiniGUI.java | 3 - ihl/items_blocks/ExplosiveBlock.java | 255 ---------- ihl/items_blocks/FiberItem.java | 4 +- ihl/items_blocks/FlexibleCableItem.java | 22 +- ihl/items_blocks/FlexiblePipeItem.java | 10 +- ihl/items_blocks/GroundRemoverItem.java | 92 ---- ihl/items_blocks/IHLItemBlock.java | 20 +- ihl/items_blocks/IHLTool.java | 16 +- ihl/items_blocks/ItemSubstance.java | 51 +- ihl/items_blocks/MachineBaseBlock.java | 19 +- ihl/metallurgy/constants/Details.java | 12 +- .../CableHolderSelectionBoxSpecialRenderer.java | 9 +- ihl/model/FlexibleCableItemRender.java | 9 - ihl/model/IHLModelRenderer.java | 14 +- ihl/model/IHLToolRenderer.java | 1 - ihl/model/IronWorkbenchBlockRender.java | 7 - ihl/model/ModelTube.java | 4 - ihl/model/MultiMetaBlockRender.java | 1 - ihl/model/RectifierTransformerUnitBlockRender.java | 1 - ...TransformerUnitSelectionBoxSpecialRenderer.java | 16 +- ihl/model/RenderGameOverlayEventHandler.java | 1 - ihl/model/SwitchBoxBlockRender.java | 2 - .../AchesonFurnaceRecipeHandler.java | 2 +- .../ChemicalReactorRecipeHandler.java | 10 - ihl/nei_integration/CrucibleRecipeHandler.java | 2 +- .../CryogenicDistillerRecipeHandler.java | 3 +- .../ElectricEvaporatorRecipeHandler.java | 1 - ihl/nei_integration/IHLBlockHighlightHandler.java | 5 - ihl/nei_integration/IHLRecipeHandler.java | 26 +- .../IronWorkbenchRecipeHandler.java | 30 +- .../LabElectrolyzerRecipeHandler.java | 10 + ihl/nei_integration/MachineRecipeHandler.java | 55 +- ihl/nei_integration/NEIIHLConfig.java | 1 - .../chemistry/ApparatusProcessableInvSlot.java | 2 +- ihl/processing/chemistry/BatteryItem.java | 16 +- .../chemistry/ChemicalReactorContainer.java | 4 +- ihl/processing/chemistry/ChemicalReactorGui.java | 5 - .../chemistry/ChemicalReactorTileEntity.java | 67 +-- .../chemistry/CryogenicDistillerContainer.java | 4 +- .../chemistry/CryogenicDistillerGui.java | 5 - .../chemistry/CryogenicDistillerTileEntity.java | 17 +- .../chemistry/ElectricEvaporatorBlock.java | 1 - .../chemistry/ElectricEvaporatorContainer.java | 2 +- .../chemistry/ElectricEvaporatorTileEntity.java | 21 +- .../chemistry/ElectrolysisBathContainer.java | 2 +- ihl/processing/chemistry/ElectrolysisBathGui.java | 2 +- .../chemistry/ElectrolysisBathTileEntity.java | 13 +- ihl/processing/chemistry/EvaporatorBlock.java | 1 - ihl/processing/chemistry/EvaporatorContainer.java | 2 +- ihl/processing/chemistry/EvaporatorTileEntity.java | 12 +- ihl/processing/chemistry/ExplosiveTileEntity.java | 49 -- .../chemistry/FluidizedBedReactorContainer.java | 4 +- .../chemistry/FluidizedBedReactorGui.java | 53 +- .../chemistry/FluidizedBedReactorTileEntity.java | 83 +--- .../chemistry/FractionatorBottomTileEntity.java | 5 +- .../chemistry/FractionatorCoverTileEntity.java | 3 +- .../chemistry/FractionatorSectionTileEntity.java | 3 +- .../GaedesMercuryRotaryPumpContainer.java | 4 +- .../chemistry/GaedesMercuryRotaryPumpGui.java | 9 - .../GaedesMercuryRotaryPumpTileEntity.java | 2 +- .../chemistry/GoldChimneyKneeTileEntity.java | 6 +- .../chemistry/LabElectrolyzerContainer.java | 4 +- ihl/processing/chemistry/LabElectrolyzerGui.java | 6 - .../chemistry/LabElectrolyzerTileEntity.java | 25 +- ihl/processing/chemistry/LeadOvenContainer.java | 2 +- ihl/processing/chemistry/LeadOvenGui.java | 9 +- ihl/processing/chemistry/LeadOvenTileEntity.java | 22 +- ihl/processing/chemistry/LoomContainer.java | 2 +- ihl/processing/chemistry/LoomGui.java | 1 - ihl/processing/chemistry/LoomTileEntity.java | 8 +- .../chemistry/PaperMachineContainer.java | 4 +- ihl/processing/chemistry/PaperMachineGui.java | 5 - .../chemistry/PaperMachineTileEntity.java | 65 +-- .../chemistry/PrecipitatorCondenserTileEntity.java | 3 +- .../chemistry/RefluxCondenserTileEntity.java | 3 +- ihl/processing/invslots/IHLInvSlotOutput.java | 6 +- .../invslots/InvSlotConsumableLiquidIHL.java | 8 +- .../invslots/InvSlotSignalProcessor.java | 2 - .../invslots/SlotInvSlotIronWorkbench.java | 31 ++ ihl/processing/metallurgy/AchesonFurnaceGui.java | 2 - .../metallurgy/AchesonFurnanceTileEntity.java | 9 +- .../metallurgy/BasicElectricMotorTileEntity.java | 43 +- ihl/processing/metallurgy/CoilerContainer.java | 4 +- ihl/processing/metallurgy/CoilerGui.java | 4 - ihl/processing/metallurgy/CoilerRender.java | 7 +- ihl/processing/metallurgy/CoilerTileEntity.java | 22 +- ihl/processing/metallurgy/Crucible.java | 32 +- ihl/processing/metallurgy/CrucibleContainer.java | 3 +- ihl/processing/metallurgy/CrucibleGui.java | 2 - .../DetonationSprayingMachineContainer.java | 2 +- .../metallurgy/DetonationSprayingMachineGui.java | 11 +- .../metallurgy/DetonationSprayingMachineModel.java | 8 - .../DetonationSprayingMachineRender.java | 2 +- .../DetonationSprayingMachineTileEntity.java | 65 +-- .../metallurgy/DrawingDeskContainer.java | 36 -- ihl/processing/metallurgy/DrawingDeskGui.java | 59 --- ihl/processing/metallurgy/DrawingDeskModel.java | 66 --- .../metallurgy/DrawingDeskTileEntity.java | 173 ------- ihl/processing/metallurgy/ElectricEngineItem.java | 4 +- ihl/processing/metallurgy/ExtruderContainer.java | 4 +- ihl/processing/metallurgy/ExtruderGui.java | 9 - ihl/processing/metallurgy/ExtruderTileEntity.java | 23 +- .../metallurgy/GasWeldingStationContainer.java | 2 +- .../metallurgy/GasWeldingStationGui.java | 1 - .../metallurgy/GasWeldingStationTileEntity.java | 55 +- .../metallurgy/ImpregnatingMachineContainer.java | 2 +- .../metallurgy/ImpregnatingMachineTileEntity.java | 57 +-- ihl/processing/metallurgy/InjectionMoldBlock.java | 40 +- .../metallurgy/InjectionMoldTileEntity.java | 34 +- ihl/processing/metallurgy/LatheContainer.java | 4 +- ihl/processing/metallurgy/LatheGui.java | 9 - .../metallurgy/LathePart1TileEntity.java | 2 +- .../metallurgy/LathePart2TileEntity.java | 1 - .../metallurgy/MachineBaseTileEntity.java | 6 +- .../metallurgy/MuffleFurnanceTileEntity.java | 4 +- .../metallurgy/RollingMachineContainer.java | 4 +- ihl/processing/metallurgy/RollingMachineGui.java | 9 - .../metallurgy/RollingMachinePart1TileEntity.java | 20 +- .../metallurgy/RollingMachinePart2TileEntity.java | 1 - .../metallurgy/RollingMachineRender.java | 7 +- .../VacuumInductionMeltingFurnaceGui.java | 4 +- .../VacuumInductionMeltingFurnaceTileEntity.java | 70 +-- .../VulcanizationExtrudingMoldTileEntity.java | 3 +- ihl/processing/metallurgy/WireMillContainer.java | 4 +- ihl/processing/metallurgy/WireMillGui.java | 4 - ihl/processing/metallurgy/WireMillTileEntity.java | 13 +- .../metallurgy/WoodenRollingMachineContainer.java | 4 +- .../metallurgy/WoodenRollingMachineGui.java | 9 - .../WoodenRollingMachinePart1TileEntity.java | 23 +- .../WoodenRollingMachinePart2TileEntity.java | 1 - .../metallurgy/WoodenRollingMachineRender.java | 11 +- ihl/recipes/IRecipeInputFluid.java | 2 - ihl/recipes/IronWorkbenchRecipe.java | 34 +- ihl/recipes/RecipeInputDetonator.java | 73 +++ ihl/recipes/RecipeInputDie.java | 5 +- ihl/recipes/RecipeInputFluidDictionary.java | 11 +- ihl/recipes/RecipeInputFluidStack.java | 8 +- ihl/recipes/RecipeInputObjectInstance.java | 2 - ihl/recipes/RecipeInputOreDictionaryList.java | 24 +- ihl/recipes/UniversalRecipeInput.java | 37 +- ihl/recipes/UniversalRecipeManager.java | 93 ++-- ihl/recipes/UniversalRecipeOutput.java | 48 +- ihl/servitor/BoneBlock.java | 1 + ihl/servitor/FlameRenderFX.java | 1 - ihl/servitor/LostHeadEntity.java | 8 +- .../TDITContainer.java | 2 +- .../TDITFrequencyTransmitter.java | 2 +- ihl/trans_dimensional_item_teleporter/TDITGui.java | 10 +- .../TDITTileEntity.java | 5 +- ihl/tunneling_shield/DriverContainer.java | 2 +- ihl/tunneling_shield/DriverGui.java | 4 +- ihl/tunneling_shield/DriverRenderEntity.java | 3 - ihl/tunneling_shield/DriverTileEntity.java | 18 +- ihl/tunneling_shield/HorizontalMiningPipe.java | 2 +- .../HydrotransportPulpRegeneratorContainer.java | 5 +- .../HydrotransportPulpRegeneratorGui.java | 4 - .../HydrotransportPulpRegeneratorTileEntity.java | 4 +- ihl/tunneling_shield/MultiBlockSpacerBlock.java | 17 +- ihl/utils/ChunkAndWorldLoadEventHandler.java | 63 --- ihl/utils/EntityIHLExplosion.java | 187 ------- ihl/utils/ExplosionVector.java | 453 ----------------- ihl/utils/FluidDictionary.java | 6 +- ihl/utils/IHLFluidTank.java | 8 +- ihl/utils/IHLItemRenderer.java | 4 +- ihl/utils/IHLMathUtils.java | 108 +++- ihl/utils/IHLRenderUtils.java | 40 +- ihl/utils/IHLUtils.java | 172 ++++++- ihl/utils/IHLXMLParser.java | 51 +- ihl/utils/WorldSavedDataBlastWave.java | 92 ---- ihl/worldgen/IHLWorldGenerator.java | 12 +- ihl/worldgen/WorldGenMinableMeta.java | 6 +- ihl/worldgen/ores/BlockOre.java | 4 +- ihl/worldgen/ores/DebugScannerContainer.java | 2 +- ihl/worldgen/ores/DebugScannerGui.java | 2 - ihl/worldgen/ores/DebugScannerTileEntity.java | 8 +- ihl/worldgen/ores/IHLFluid.java | 28 +- license.txt | 190 +++++++ 346 files changed, 4529 insertions(+), 4126 deletions(-) create mode 100644 README.md delete mode 100644 assets/AbsorberCooler.tcn delete mode 100644 assets/BatterySwitchUnit.tcn delete mode 100644 assets/CableHolder.tcn delete mode 100644 assets/Charger-ejector.tcn delete mode 100644 assets/Coiler.tcn delete mode 100644 assets/Collector.tcn delete mode 100644 assets/Collector2.tcn delete mode 100644 assets/Cutter.tcn delete mode 100644 assets/Cutter2.tcn delete mode 100644 assets/DrawingDesk.tcn delete mode 100644 assets/ElectrolisisBath.tcn delete mode 100644 assets/Extruder.tcn delete mode 100644 assets/GaedesMercuryRotaryPump.tcn delete mode 100644 assets/GasWeldingStation.tcn delete mode 100644 assets/GlassMeltingPoint.tcn delete mode 100644 assets/Helper.tcn delete mode 100644 assets/ImpregnatingMachine.tcn delete mode 100644 assets/IronWorkbench.tcn delete mode 100644 assets/LatheP1.tcn delete mode 100644 assets/PrecipitatorCondenser.tcn delete mode 100644 assets/ReactorPart1.tcn delete mode 100644 assets/RectifierTransformerUnit.tcn delete mode 100644 assets/RefluxCondenser.tcn delete mode 100644 assets/RollingMachine.tcn delete mode 100644 assets/RollingMachinePart1.tcn delete mode 100644 assets/RollingMachinePart2.tcn delete mode 100644 assets/ShieldModel.tcn delete mode 100644 assets/Skull.tcn delete mode 100644 assets/Skull2.tcn delete mode 100644 assets/SpotLight.tcn delete mode 100644 assets/WoodenRollingMachine.tcn delete mode 100644 assets/WoodenRollingMachinePart2.tcn delete mode 100644 assets/chimneyKnee.tcn delete mode 100644 assets/fractionatorBottom.tcn delete mode 100644 assets/fractionatorCover.tcn delete mode 100644 assets/fractionatorSection.tcn delete mode 100644 assets/glassBox.tcn create mode 100644 assets/ihl/sounds/explosion.ogg create mode 100644 assets/ihl/sounds/fuse.ogg create mode 100644 assets/ihl/textures/blocks/explosiveBlockBottom.png create mode 100644 assets/ihl/textures/blocks/explosiveBlockSide.png create mode 100644 assets/ihl/textures/blocks/explosiveBlockTop.png create mode 100644 assets/ihl/textures/blocks/fluidAcetaldehydeFlowing.png create mode 100644 assets/ihl/textures/blocks/fluidAcetaldehydeStill.png create mode 100644 assets/ihl/textures/blocks/fluidAmmoniaFlowing.png create mode 100644 assets/ihl/textures/blocks/fluidAmmoniaStill.png create mode 100644 assets/ihl/textures/blocks/fluidFormaldehydeFlowing.png create mode 100644 assets/ihl/textures/blocks/fluidFormaldehydeStill.png create mode 100644 assets/ihl/textures/blocks/fluidMethanolFlowing.png create mode 100644 assets/ihl/textures/blocks/fluidMethanolFlowing.xcf create mode 100644 assets/ihl/textures/blocks/fluidMethanolStill.png create mode 100644 assets/ihl/textures/blocks/fluidTarWaterFlowing.png create mode 100644 assets/ihl/textures/blocks/fluidTarWaterStill.png delete mode 100644 assets/ihl/textures/gui/GUIGlassBox.xcf create mode 100644 assets/ihl/textures/items/catalystIron.png create mode 100644 assets/ihl/textures/items/catalystIronOxide.png create mode 100644 assets/ihl/textures/items/catalystRawIronOxide.png create mode 100644 assets/ihl/textures/items/detonator.png create mode 100644 assets/ihl/textures/items/dustCalciumAcetate.png create mode 100644 assets/ihl/textures/items/dustIronOxideCatalystMix.png create mode 100644 assets/ihl/textures/items/dustMercuryChloride.png create mode 100644 assets/ihl/textures/items/dustPentaerythritol.png create mode 100644 assets/ihl/textures/items/dustPentaerythritolTetranitrate.png create mode 100644 assets/ihl/textures/items/dustPotassiumOxide.png create mode 100644 assets/ihl/textures/items/dustSodiumFormate.png create mode 100644 assets/ihl/textures/items/ingotPotassium.png create mode 100644 assets/ihl/textures/items/itemCellMethanol.png create mode 100644 assets/ihl/textures/particles/explosion.png delete mode 100644 assets/lightBulb.tcn delete mode 100644 assets/loom.tcn delete mode 100644 assets/splitInjectionMold.tcn delete mode 100644 assets/vulcanizationExtrudingMold.tcn create mode 100644 ihl/explosion/ChunkAndWorldLoadEventHandler.java create mode 100644 ihl/explosion/DetonatorMiniGUI.java create mode 100644 ihl/explosion/ExplosionEntityFX.java create mode 100644 ihl/explosion/ExplosionRenderFX.java create mode 100644 ihl/explosion/ExplosionVectorBlockV2.java create mode 100644 ihl/explosion/ExplosiveBlock.java create mode 100644 ihl/explosion/ExplosiveTileEntity.java create mode 100644 ihl/explosion/GroundRemoverItem.java create mode 100644 ihl/explosion/IHLEntityFallingPile.java create mode 100644 ihl/explosion/IHLEntityFallingPileRender.java create mode 100644 ihl/explosion/PileBlock.java create mode 100644 ihl/explosion/PileBlockRender.java create mode 100644 ihl/explosion/PileTileEntity.java create mode 100644 ihl/explosion/PileTileEntityRender.java create mode 100644 ihl/explosion/WorldSavedDataBlastWave.java delete mode 100644 ihl/flexible_cable/IronWorkbenchRender.java~ delete mode 100644 ihl/flexible_cable/IronWorkbenchTileEntity.java~ delete mode 100644 ihl/items_blocks/ExplosiveBlock.java delete mode 100644 ihl/items_blocks/GroundRemoverItem.java delete mode 100644 ihl/processing/chemistry/ExplosiveTileEntity.java create mode 100644 ihl/processing/invslots/SlotInvSlotIronWorkbench.java delete mode 100644 ihl/processing/metallurgy/DrawingDeskContainer.java delete mode 100644 ihl/processing/metallurgy/DrawingDeskGui.java delete mode 100644 ihl/processing/metallurgy/DrawingDeskModel.java delete mode 100644 ihl/processing/metallurgy/DrawingDeskTileEntity.java create mode 100644 ihl/recipes/RecipeInputDetonator.java delete mode 100644 ihl/utils/ChunkAndWorldLoadEventHandler.java delete mode 100644 ihl/utils/EntityIHLExplosion.java delete mode 100644 ihl/utils/ExplosionVector.java delete mode 100644 ihl/utils/WorldSavedDataBlastWave.java create mode 100644 license.txt diff --git a/.gitignore b/.gitignore index 0b0e24d..f0ed580 100644 --- a/.gitignore +++ b/.gitignore @@ -16,7 +16,4 @@ codechicken/ gregtech/ # Files backup -*.json~ -*.lang~ -*.xml~ -*.cfg~ +*~ diff --git a/.gitignore~ b/.gitignore~ index e69de29..0b0e24d 100644 --- a/.gitignore~ +++ b/.gitignore~ @@ -0,0 +1,22 @@ +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# API folders +codechicken/ +gregtech/ + +# Files backup +*.json~ +*.lang~ +*.xml~ +*.cfg~ diff --git a/README.md b/README.md new file mode 100644 index 0000000..accb0b4 --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +# ihl +IHL: Tools & Machines mod for Minecraft Forge 1.7.10 + +Modpacks are allowed + diff --git a/assets/AbsorberCooler.tcn b/assets/AbsorberCooler.tcn deleted file mode 100644 index d84edf1..0000000 Binary files a/assets/AbsorberCooler.tcn and /dev/null differ diff --git a/assets/BatterySwitchUnit.tcn b/assets/BatterySwitchUnit.tcn deleted file mode 100644 index 2f2e465..0000000 Binary files a/assets/BatterySwitchUnit.tcn and /dev/null differ diff --git a/assets/CableHolder.tcn b/assets/CableHolder.tcn deleted file mode 100644 index 0940de6..0000000 Binary files a/assets/CableHolder.tcn and /dev/null differ diff --git a/assets/Charger-ejector.tcn b/assets/Charger-ejector.tcn deleted file mode 100644 index b57f4f2..0000000 Binary files a/assets/Charger-ejector.tcn and /dev/null differ diff --git a/assets/Coiler.tcn b/assets/Coiler.tcn deleted file mode 100644 index fbfa22f..0000000 Binary files a/assets/Coiler.tcn and /dev/null differ diff --git a/assets/Collector.tcn b/assets/Collector.tcn deleted file mode 100644 index 16adb7c..0000000 Binary files a/assets/Collector.tcn and /dev/null differ diff --git a/assets/Collector2.tcn b/assets/Collector2.tcn deleted file mode 100644 index 009aa4b..0000000 Binary files a/assets/Collector2.tcn and /dev/null differ diff --git a/assets/Cutter.tcn b/assets/Cutter.tcn deleted file mode 100644 index bd884be..0000000 Binary files a/assets/Cutter.tcn and /dev/null differ diff --git a/assets/Cutter2.tcn b/assets/Cutter2.tcn deleted file mode 100644 index 66a58db..0000000 Binary files a/assets/Cutter2.tcn and /dev/null differ diff --git a/assets/DrawingDesk.tcn b/assets/DrawingDesk.tcn deleted file mode 100644 index 7fd573c..0000000 Binary files a/assets/DrawingDesk.tcn and /dev/null differ diff --git a/assets/ElectrolisisBath.tcn b/assets/ElectrolisisBath.tcn deleted file mode 100644 index 8e7c3e2..0000000 Binary files a/assets/ElectrolisisBath.tcn and /dev/null differ diff --git a/assets/Extruder.tcn b/assets/Extruder.tcn deleted file mode 100644 index 34d9777..0000000 Binary files a/assets/Extruder.tcn and /dev/null differ diff --git a/assets/GaedesMercuryRotaryPump.tcn b/assets/GaedesMercuryRotaryPump.tcn deleted file mode 100644 index 38a4dec..0000000 Binary files a/assets/GaedesMercuryRotaryPump.tcn and /dev/null differ diff --git a/assets/GasWeldingStation.tcn b/assets/GasWeldingStation.tcn deleted file mode 100644 index 94f071c..0000000 Binary files a/assets/GasWeldingStation.tcn and /dev/null differ diff --git a/assets/GlassMeltingPoint.tcn b/assets/GlassMeltingPoint.tcn deleted file mode 100644 index acd5b32..0000000 Binary files a/assets/GlassMeltingPoint.tcn and /dev/null differ diff --git a/assets/Helper.tcn b/assets/Helper.tcn deleted file mode 100644 index bd83d08..0000000 Binary files a/assets/Helper.tcn and /dev/null differ diff --git a/assets/ImpregnatingMachine.tcn b/assets/ImpregnatingMachine.tcn deleted file mode 100644 index 2bf242c..0000000 Binary files a/assets/ImpregnatingMachine.tcn and /dev/null differ diff --git a/assets/IronWorkbench.tcn b/assets/IronWorkbench.tcn deleted file mode 100644 index d1b7526..0000000 Binary files a/assets/IronWorkbench.tcn and /dev/null differ diff --git a/assets/LatheP1.tcn b/assets/LatheP1.tcn deleted file mode 100644 index 3958f4d..0000000 Binary files a/assets/LatheP1.tcn and /dev/null differ diff --git a/assets/PrecipitatorCondenser.tcn b/assets/PrecipitatorCondenser.tcn deleted file mode 100644 index d1d4a5a..0000000 Binary files a/assets/PrecipitatorCondenser.tcn and /dev/null differ diff --git a/assets/ReactorPart1.tcn b/assets/ReactorPart1.tcn deleted file mode 100644 index 6dca869..0000000 Binary files a/assets/ReactorPart1.tcn and /dev/null differ diff --git a/assets/RectifierTransformerUnit.tcn b/assets/RectifierTransformerUnit.tcn deleted file mode 100644 index 3580d35..0000000 Binary files a/assets/RectifierTransformerUnit.tcn and /dev/null differ diff --git a/assets/RefluxCondenser.tcn b/assets/RefluxCondenser.tcn deleted file mode 100644 index f0393d5..0000000 Binary files a/assets/RefluxCondenser.tcn and /dev/null differ diff --git a/assets/RollingMachine.tcn b/assets/RollingMachine.tcn deleted file mode 100644 index 9324da7..0000000 Binary files a/assets/RollingMachine.tcn and /dev/null differ diff --git a/assets/RollingMachinePart1.tcn b/assets/RollingMachinePart1.tcn deleted file mode 100644 index 260c3fb..0000000 Binary files a/assets/RollingMachinePart1.tcn and /dev/null differ diff --git a/assets/RollingMachinePart2.tcn b/assets/RollingMachinePart2.tcn deleted file mode 100644 index 07e2dbf..0000000 Binary files a/assets/RollingMachinePart2.tcn and /dev/null differ diff --git a/assets/ShieldModel.tcn b/assets/ShieldModel.tcn deleted file mode 100644 index a2db376..0000000 Binary files a/assets/ShieldModel.tcn and /dev/null differ diff --git a/assets/Skull.tcn b/assets/Skull.tcn deleted file mode 100644 index 1e98760..0000000 Binary files a/assets/Skull.tcn and /dev/null differ diff --git a/assets/Skull2.tcn b/assets/Skull2.tcn deleted file mode 100644 index a66ee69..0000000 Binary files a/assets/Skull2.tcn and /dev/null differ diff --git a/assets/SpotLight.tcn b/assets/SpotLight.tcn deleted file mode 100644 index 80c9514..0000000 Binary files a/assets/SpotLight.tcn and /dev/null differ diff --git a/assets/WoodenRollingMachine.tcn b/assets/WoodenRollingMachine.tcn deleted file mode 100644 index a36eb3a..0000000 Binary files a/assets/WoodenRollingMachine.tcn and /dev/null differ diff --git a/assets/WoodenRollingMachinePart2.tcn b/assets/WoodenRollingMachinePart2.tcn deleted file mode 100644 index 0a2309b..0000000 Binary files a/assets/WoodenRollingMachinePart2.tcn and /dev/null differ diff --git a/assets/chimneyKnee.tcn b/assets/chimneyKnee.tcn deleted file mode 100644 index 5a1feec..0000000 Binary files a/assets/chimneyKnee.tcn and /dev/null differ diff --git a/assets/fractionatorBottom.tcn b/assets/fractionatorBottom.tcn deleted file mode 100644 index bafa585..0000000 Binary files a/assets/fractionatorBottom.tcn and /dev/null differ diff --git a/assets/fractionatorCover.tcn b/assets/fractionatorCover.tcn deleted file mode 100644 index fcbf2af..0000000 Binary files a/assets/fractionatorCover.tcn and /dev/null differ diff --git a/assets/fractionatorSection.tcn b/assets/fractionatorSection.tcn deleted file mode 100644 index 76a39dc..0000000 Binary files a/assets/fractionatorSection.tcn and /dev/null differ diff --git a/assets/glassBox.tcn b/assets/glassBox.tcn deleted file mode 100644 index b5588c6..0000000 Binary files a/assets/glassBox.tcn and /dev/null differ diff --git a/assets/ihl/config/ihl-recipe.cfg b/assets/ihl/config/ihl-recipe.cfg index 44df9e0..45451a3 100644 --- a/assets/ihl/config/ihl-recipe.cfg +++ b/assets/ihl/config/ihl-recipe.cfg @@ -1,8 +1,14 @@ // <- This is a commentary. ; <- This is also a commentary. // Syntax are simple as fist. Every recipe modifier must start from new line and keyword. -// Keywords are "addrecipe" and "removerecipe". -// Right after keyword goes parameters. Parameters are machine name (see in bottom of this file), +// Keywords are "addrecipe", "removerecipe" and "addcasting". +// "addcasting" is a special function to define amount of molten metal nessesary for castind certain parts. +// Syntax is "addcasting(name_of_a_part,amount_of_metal)". "name_of_a_part" is ore dictionary name +// without material suffix. +// Do not include a metal name in "name_of_a_part"! +// It is "toolHeadHammer" not "toolHeadHammerBronze". +// For "addrecipe" and "removerecipe" right after keyword goes parameters. +// Parameters are machine name (see in bottom of this file), // recipeinput (with parameters) and recipeoutput (with parameters). // All parameters are separated with "," symbol. // For adding recipe add both input and output. @@ -10,6 +16,7 @@ // Inside "recipeinput" and "recipeoutput" are parameters, separated with ",". // For "recipeinput" those parameters are: // itemstack(modname:internal_itemname,stacksize,damage) +// fluidcontainer(fluidname,minimal_amount) // toolitemstack(modname:internal_itemname,stacksize,damage) //For iron workbench only // machine(modname:internal_itemname) //For iron workbench only // die(transverseSection) @@ -31,6 +38,30 @@ // fluidstack(fluid,quantity) // Examples: +//addcasting +//( +//nozzle, +//864 +//) + +// To add custom forced casting recipe using any fluid and any itemstack (even those, who are not registered in ore dictionary): +//addrecipe +//( +//injectionmold, +//recipeinput(fluidstack(water,100),itemstack(ihl:injectionMold,1,hash(diamond))), +//recipeoutput(itemstack(minecraft:diamond,1,0)) +//) +// "hash" will convert argument into string hash. +// It is nessesary for casting recipes to contain itemstack damage matching "resultSuffix" string hash. + +// To add casting form craft use "resultSuffix" NBT tag: +//addrecipe +//( +//ironworkbench, +//recipeinput(oredict(sand,1),fluidcontainer(water,1),oredict(dustClay,1)), +//recipeoutput(itemstack(ihl:injectionMold,1,24,tags(string(resultSuffix,diamond)))) +//) + //addrecipe //( //evaporator, diff --git a/assets/ihl/lang/en_US.lang b/assets/ihl/lang/en_US.lang index 4be6075..9b7b25a 100644 --- a/assets/ihl/lang/en_US.lang +++ b/assets/ihl/lang/en_US.lang @@ -2,6 +2,23 @@ language.name=HAYO language.region=US language.code=en_US +ihl.detonator_delay=Detonation delay: +ihl.seconds=s +tile.pileBlock.name=Pile of something +detonator.name=Detonator +dustPentaerythritolTetranitrate.name=Pentaerythritol tetranitrate +dustPentaerythritol.name=Pentaerythritol +dustPotassiumOxide=Potassium oxide +ingotPotassium.name=Potassium ingot +catalystIron.name=Iron catalyst +catalystIronOxide.name=Iron oxide catalyst blank +catalystRawIronOxide.name=Iron oxide catalyst blank (not sintered) +dustIronOxideCatalystMix.name=Mix for preparing an iron catalyst +dustSodiumFormate.name=Sodium formate +dustMercuryChloride.name=Mercury chloride +dustCalciumAcetate.name=Calcium acetate +itemCellMethanol=Methanol cell + item.skull.name=Wailer remains item.guidebook.name=IHL manual item.handpump.name=IHL handpump @@ -30,6 +47,7 @@ tile.boneBlock.name=Bone pillar entity.LostHead.name=Wailer tile.basicHarvestorBlock.name=IHL Auto crop harvestor tile.blowerBlock.name=IHL Industrial fan +tile.ihlExplosive.name=Explosive pack ihl.gui.blower=Air speed: ihl.gui.blowerUnits=m/s tile.glassBox.name=Glass box diff --git a/assets/ihl/sounds.json b/assets/ihl/sounds.json index 9e3e08b..d1369e7 100644 --- a/assets/ihl/sounds.json +++ b/assets/ihl/sounds.json @@ -72,5 +72,17 @@ "sounds": [ "zap" ] + }, + "explosion": { + "category": "master", + "sounds": [ + "explosion" + ] + }, + "fuse": { + "category": "master", + "sounds": [ + "fuse" + ] } } diff --git a/assets/ihl/sounds/explosion.ogg b/assets/ihl/sounds/explosion.ogg new file mode 100644 index 0000000..56d4c4c Binary files /dev/null and b/assets/ihl/sounds/explosion.ogg differ diff --git a/assets/ihl/sounds/fuse.ogg b/assets/ihl/sounds/fuse.ogg new file mode 100644 index 0000000..9693279 Binary files /dev/null and b/assets/ihl/sounds/fuse.ogg differ diff --git a/assets/ihl/textures/blocks/explosiveBlockBottom.png b/assets/ihl/textures/blocks/explosiveBlockBottom.png new file mode 100644 index 0000000..eddc613 Binary files /dev/null and b/assets/ihl/textures/blocks/explosiveBlockBottom.png differ diff --git a/assets/ihl/textures/blocks/explosiveBlockSide.png b/assets/ihl/textures/blocks/explosiveBlockSide.png new file mode 100644 index 0000000..91729a2 Binary files /dev/null and b/assets/ihl/textures/blocks/explosiveBlockSide.png differ diff --git a/assets/ihl/textures/blocks/explosiveBlockTop.png b/assets/ihl/textures/blocks/explosiveBlockTop.png new file mode 100644 index 0000000..b313484 Binary files /dev/null and b/assets/ihl/textures/blocks/explosiveBlockTop.png differ diff --git a/assets/ihl/textures/blocks/fluidAcetaldehydeFlowing.png b/assets/ihl/textures/blocks/fluidAcetaldehydeFlowing.png new file mode 100644 index 0000000..084e79e Binary files /dev/null and b/assets/ihl/textures/blocks/fluidAcetaldehydeFlowing.png differ diff --git a/assets/ihl/textures/blocks/fluidAcetaldehydeStill.png b/assets/ihl/textures/blocks/fluidAcetaldehydeStill.png new file mode 100644 index 0000000..af64436 Binary files /dev/null and b/assets/ihl/textures/blocks/fluidAcetaldehydeStill.png differ diff --git a/assets/ihl/textures/blocks/fluidAmmoniaFlowing.png b/assets/ihl/textures/blocks/fluidAmmoniaFlowing.png new file mode 100644 index 0000000..faa27db Binary files /dev/null and b/assets/ihl/textures/blocks/fluidAmmoniaFlowing.png differ diff --git a/assets/ihl/textures/blocks/fluidAmmoniaStill.png b/assets/ihl/textures/blocks/fluidAmmoniaStill.png new file mode 100644 index 0000000..9619e25 Binary files /dev/null and b/assets/ihl/textures/blocks/fluidAmmoniaStill.png differ diff --git a/assets/ihl/textures/blocks/fluidFormaldehydeFlowing.png b/assets/ihl/textures/blocks/fluidFormaldehydeFlowing.png new file mode 100644 index 0000000..4252b6f Binary files /dev/null and b/assets/ihl/textures/blocks/fluidFormaldehydeFlowing.png differ diff --git a/assets/ihl/textures/blocks/fluidFormaldehydeStill.png b/assets/ihl/textures/blocks/fluidFormaldehydeStill.png new file mode 100644 index 0000000..621a940 Binary files /dev/null and b/assets/ihl/textures/blocks/fluidFormaldehydeStill.png differ diff --git a/assets/ihl/textures/blocks/fluidMethanolFlowing.png b/assets/ihl/textures/blocks/fluidMethanolFlowing.png new file mode 100644 index 0000000..e1e37bb Binary files /dev/null and b/assets/ihl/textures/blocks/fluidMethanolFlowing.png differ diff --git a/assets/ihl/textures/blocks/fluidMethanolFlowing.xcf b/assets/ihl/textures/blocks/fluidMethanolFlowing.xcf new file mode 100644 index 0000000..d3ca048 Binary files /dev/null and b/assets/ihl/textures/blocks/fluidMethanolFlowing.xcf differ diff --git a/assets/ihl/textures/blocks/fluidMethanolStill.png b/assets/ihl/textures/blocks/fluidMethanolStill.png new file mode 100644 index 0000000..948e525 Binary files /dev/null and b/assets/ihl/textures/blocks/fluidMethanolStill.png differ diff --git a/assets/ihl/textures/blocks/fluidTarWaterFlowing.png b/assets/ihl/textures/blocks/fluidTarWaterFlowing.png new file mode 100644 index 0000000..6a58cbe Binary files /dev/null and b/assets/ihl/textures/blocks/fluidTarWaterFlowing.png differ diff --git a/assets/ihl/textures/blocks/fluidTarWaterStill.png b/assets/ihl/textures/blocks/fluidTarWaterStill.png new file mode 100644 index 0000000..dd67de2 Binary files /dev/null and b/assets/ihl/textures/blocks/fluidTarWaterStill.png differ diff --git a/assets/ihl/textures/blocks/vacuumInductionMeltingFurnaceBack.png b/assets/ihl/textures/blocks/vacuumInductionMeltingFurnaceBack.png index 5dc90f7..d519cd7 100644 Binary files a/assets/ihl/textures/blocks/vacuumInductionMeltingFurnaceBack.png and b/assets/ihl/textures/blocks/vacuumInductionMeltingFurnaceBack.png differ diff --git a/assets/ihl/textures/blocks/vacuumInductionMeltingFurnaceFront.png b/assets/ihl/textures/blocks/vacuumInductionMeltingFurnaceFront.png index 9736bd0..10dcd29 100644 Binary files a/assets/ihl/textures/blocks/vacuumInductionMeltingFurnaceFront.png and b/assets/ihl/textures/blocks/vacuumInductionMeltingFurnaceFront.png differ diff --git a/assets/ihl/textures/blocks/vacuumInductionMeltingFurnaceLeft.png b/assets/ihl/textures/blocks/vacuumInductionMeltingFurnaceLeft.png index 9c2a8a2..122e95c 100644 Binary files a/assets/ihl/textures/blocks/vacuumInductionMeltingFurnaceLeft.png and b/assets/ihl/textures/blocks/vacuumInductionMeltingFurnaceLeft.png differ diff --git a/assets/ihl/textures/blocks/vacuumInductionMeltingFurnaceRight.png b/assets/ihl/textures/blocks/vacuumInductionMeltingFurnaceRight.png index 6c00f99..a9347eb 100644 Binary files a/assets/ihl/textures/blocks/vacuumInductionMeltingFurnaceRight.png and b/assets/ihl/textures/blocks/vacuumInductionMeltingFurnaceRight.png differ diff --git a/assets/ihl/textures/gui/GUIChemicalReactor.png b/assets/ihl/textures/gui/GUIChemicalReactor.png index 687c217..2af8f55 100644 Binary files a/assets/ihl/textures/gui/GUIChemicalReactor.png and b/assets/ihl/textures/gui/GUIChemicalReactor.png differ diff --git a/assets/ihl/textures/gui/GUIGlassBox.xcf b/assets/ihl/textures/gui/GUIGlassBox.xcf deleted file mode 100644 index eb872e6..0000000 Binary files a/assets/ihl/textures/gui/GUIGlassBox.xcf and /dev/null differ diff --git a/assets/ihl/textures/gui/GUILabElectrolyzer.png b/assets/ihl/textures/gui/GUILabElectrolyzer.png index 4fab6d0..1830c04 100644 Binary files a/assets/ihl/textures/gui/GUILabElectrolyzer.png and b/assets/ihl/textures/gui/GUILabElectrolyzer.png differ diff --git a/assets/ihl/textures/items/catalystIron.png b/assets/ihl/textures/items/catalystIron.png new file mode 100644 index 0000000..057a4d3 Binary files /dev/null and b/assets/ihl/textures/items/catalystIron.png differ diff --git a/assets/ihl/textures/items/catalystIronOxide.png b/assets/ihl/textures/items/catalystIronOxide.png new file mode 100644 index 0000000..62ac0fd Binary files /dev/null and b/assets/ihl/textures/items/catalystIronOxide.png differ diff --git a/assets/ihl/textures/items/catalystRawIronOxide.png b/assets/ihl/textures/items/catalystRawIronOxide.png new file mode 100644 index 0000000..31e1836 Binary files /dev/null and b/assets/ihl/textures/items/catalystRawIronOxide.png differ diff --git a/assets/ihl/textures/items/detonator.png b/assets/ihl/textures/items/detonator.png new file mode 100644 index 0000000..be569ad Binary files /dev/null and b/assets/ihl/textures/items/detonator.png differ diff --git a/assets/ihl/textures/items/dustCalciumAcetate.png b/assets/ihl/textures/items/dustCalciumAcetate.png new file mode 100644 index 0000000..cca785f Binary files /dev/null and b/assets/ihl/textures/items/dustCalciumAcetate.png differ diff --git a/assets/ihl/textures/items/dustIronOxideCatalystMix.png b/assets/ihl/textures/items/dustIronOxideCatalystMix.png new file mode 100644 index 0000000..b9cf99d Binary files /dev/null and b/assets/ihl/textures/items/dustIronOxideCatalystMix.png differ diff --git a/assets/ihl/textures/items/dustMercuryChloride.png b/assets/ihl/textures/items/dustMercuryChloride.png new file mode 100644 index 0000000..e01f549 Binary files /dev/null and b/assets/ihl/textures/items/dustMercuryChloride.png differ diff --git a/assets/ihl/textures/items/dustPentaerythritol.png b/assets/ihl/textures/items/dustPentaerythritol.png new file mode 100644 index 0000000..c9cdce9 Binary files /dev/null and b/assets/ihl/textures/items/dustPentaerythritol.png differ diff --git a/assets/ihl/textures/items/dustPentaerythritolTetranitrate.png b/assets/ihl/textures/items/dustPentaerythritolTetranitrate.png new file mode 100644 index 0000000..ebffb57 Binary files /dev/null and b/assets/ihl/textures/items/dustPentaerythritolTetranitrate.png differ diff --git a/assets/ihl/textures/items/dustPotassiumOxide.png b/assets/ihl/textures/items/dustPotassiumOxide.png new file mode 100644 index 0000000..2784e55 Binary files /dev/null and b/assets/ihl/textures/items/dustPotassiumOxide.png differ diff --git a/assets/ihl/textures/items/dustSodiumFormate.png b/assets/ihl/textures/items/dustSodiumFormate.png new file mode 100644 index 0000000..55fd979 Binary files /dev/null and b/assets/ihl/textures/items/dustSodiumFormate.png differ diff --git a/assets/ihl/textures/items/ingotPotassium.png b/assets/ihl/textures/items/ingotPotassium.png new file mode 100644 index 0000000..fba83d4 Binary files /dev/null and b/assets/ihl/textures/items/ingotPotassium.png differ diff --git a/assets/ihl/textures/items/itemCellMethanol.png b/assets/ihl/textures/items/itemCellMethanol.png new file mode 100644 index 0000000..c4a65c8 Binary files /dev/null and b/assets/ihl/textures/items/itemCellMethanol.png differ diff --git a/assets/ihl/textures/particles/explosion.png b/assets/ihl/textures/particles/explosion.png new file mode 100644 index 0000000..3e75fab Binary files /dev/null and b/assets/ihl/textures/particles/explosion.png differ diff --git a/assets/lightBulb.tcn b/assets/lightBulb.tcn deleted file mode 100644 index 57caaf3..0000000 Binary files a/assets/lightBulb.tcn and /dev/null differ diff --git a/assets/loom.tcn b/assets/loom.tcn deleted file mode 100644 index a49da87..0000000 Binary files a/assets/loom.tcn and /dev/null differ diff --git a/assets/splitInjectionMold.tcn b/assets/splitInjectionMold.tcn deleted file mode 100644 index c1a9dd6..0000000 Binary files a/assets/splitInjectionMold.tcn and /dev/null differ diff --git a/assets/vulcanizationExtrudingMold.tcn b/assets/vulcanizationExtrudingMold.tcn deleted file mode 100644 index 07a12d0..0000000 Binary files a/assets/vulcanizationExtrudingMold.tcn and /dev/null differ diff --git a/ihl/ClientProxy.java b/ihl/ClientProxy.java index de2758c..1a55e27 100644 --- a/ihl/ClientProxy.java +++ b/ihl/ClientProxy.java @@ -2,15 +2,12 @@ package ihl; import java.io.File; import java.io.IOException; +import java.util.Arrays; import java.util.HashMap; import java.util.Map; import javax.xml.parsers.ParserConfigurationException; -import org.lwjgl.opengl.ARBFramebufferObject; -import org.lwjgl.opengl.EXTFramebufferObject; -import org.lwjgl.opengl.GL30; - import ihl.collector.ChargerEjectorModel; import ihl.collector.ChargerEjectorRender; import ihl.collector.ChargerEjectorTileEntity; @@ -34,11 +31,16 @@ import ihl.enviroment.MirrorTileEntity; import ihl.enviroment.SpotlightModel; import ihl.enviroment.SpotlightRender; import ihl.enviroment.SpotlightTileEntity; +import ihl.explosion.ExplosionEntityFX; +import ihl.explosion.ExplosionRenderFX; +import ihl.explosion.IHLEntityFallingPile; +import ihl.explosion.IHLEntityFallingPileRender; +import ihl.explosion.PileBlockRender; +import ihl.explosion.PileTileEntity; import ihl.flexible_cable.AnchorTileEntity; import ihl.flexible_cable.BatterySwitchUnitModel; import ihl.flexible_cable.BatterySwitchUnitTileEntity; import ihl.flexible_cable.BlastEntityFX; -import ihl.flexible_cable.IronWorkbenchModel; import ihl.flexible_cable.IronWorkbenchTileEntity; import ihl.flexible_cable.IronWorkbenchRender; import ihl.flexible_cable.NodeEntity; @@ -108,7 +110,6 @@ import ihl.tunneling_shield.DriverModel; import ihl.tunneling_shield.DriverRender; import ihl.tunneling_shield.DriverRenderEntity; import ihl.tunneling_shield.DriverTileEntity; -import ihl.utils.EntityDropEventHandler; import ihl.utils.IHLRenderUtils; import ihl.utils.IHLUtils; import ihl.worldgen.ores.IHLFluid; @@ -117,6 +118,8 @@ import io.netty.buffer.ByteBufInputStream; import io.netty.buffer.ByteBufOutputStream; import io.netty.buffer.Unpooled; import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityClientPlayerMP; +import net.minecraft.client.multiplayer.WorldClient; import net.minecraft.client.renderer.GLAllocation; import net.minecraft.client.renderer.entity.Render; import net.minecraft.client.renderer.entity.RenderManager; @@ -124,11 +127,11 @@ import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; import net.minecraftforge.client.MinecraftForgeClient; import net.minecraftforge.client.event.TextureStitchEvent; import net.minecraftforge.common.MinecraftForge; @@ -136,10 +139,8 @@ import cpw.mods.fml.client.registry.ClientRegistry; import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.network.FMLEventChannel; import cpw.mods.fml.common.network.FMLNetworkEvent; import cpw.mods.fml.common.network.NetworkRegistry; -import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; import cpw.mods.fml.common.network.internal.FMLProxyPacket; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -148,18 +149,17 @@ public class ClientProxy extends ServerProxy { public boolean loadMirrorRender=true; public IHLRenderUtils renderUtils; - public Map sharedBlockRenders = new HashMap(); - public Map,ISelectionBoxSpecialRenderer> selectionBoxSpecialRendererRegistry = new HashMap(); - + public Map sharedBlockRenders = new HashMap(); + public Map,ISelectionBoxSpecialRenderer> selectionBoxSpecialRendererRegistry = new HashMap,ISelectionBoxSpecialRenderer>(); public ClientProxy() {} @Override public void load() throws ParserConfigurationException { - if(this.channel==null) + if(channel==null) { - this.channel = NetworkRegistry.INSTANCE.newEventDrivenChannel(IHLModInfo.MODID); - this.channel.register(this); + channel = NetworkRegistry.INSTANCE.newEventDrivenChannel(IHLModInfo.MODID); + channel.register(this); } this.renderUtils=new IHLRenderUtils(); MinecraftForge.EVENT_BUS.register(this.renderUtils); @@ -169,12 +169,16 @@ public class ClientProxy extends ServerProxy { registerBlockHandler(new SwitchBoxBlockRender(), MachineType.RedstoneSignalConverter); registerBlockHandler(new RectifierTransformerUnitBlockRender(), MachineType.RectifierTransformerUnit); registerBlockHandler(new IronWorkbenchBlockRender(), MachineType.IronWorkbench); - + PileBlockRender pileBlockRender = new PileBlockRender(); + RenderingRegistry.registerBlockHandler(pileBlockRender); + ClientRegistry.bindTileEntitySpecialRenderer(PileTileEntity.class, pileBlockRender.pileTileEntityRender); + RenderingRegistry.registerEntityRenderingHandler(CollectorEntity.class, new CollectorRender(false)); MinecraftForgeClient.registerItemRenderer(IHLMod.collectorItem, new CollectorItemRender(false)); RenderingRegistry.registerEntityRenderingHandler(CollectorHeavyEntity.class, new CollectorRender(true)); MinecraftForgeClient.registerItemRenderer(IHLMod.collectorHeavyItem, new CollectorItemRender(true)); RenderingRegistry.registerEntityRenderingHandler(DriverEntity.class, new DriverRenderEntity()); + RenderingRegistry.registerEntityRenderingHandler(IHLEntityFallingPile.class, new IHLEntityFallingPileRender()); ClientRegistry.bindTileEntitySpecialRenderer(ChargerEjectorTileEntity.class, new ChargerEjectorRender()); ClientRegistry.bindTileEntitySpecialRenderer(DriverTileEntity.class, new DriverRender()); ClientRegistry.bindTileEntitySpecialRenderer(SackTileEntity.class, new SackRender()); @@ -243,6 +247,7 @@ public class ClientProxy extends ServerProxy { RenderingRegistry.registerEntityRenderingHandler(FlameEntityFX.class, new FlameRenderFX(IHLModInfo.MODID+":textures/particles/flameTongue.png")); RenderingRegistry.registerEntityRenderingHandler(BlastEntityFX.class, new FlameRenderFX(IHLModInfo.MODID+":textures/particles/blast.png")); RenderingRegistry.registerEntityRenderingHandler(BlobEntityFX.class, new BlobRenderFX()); + RenderingRegistry.registerEntityRenderingHandler(ExplosionEntityFX.class, new ExplosionRenderFX(IHLModInfo.MODID+":textures/particles/explosion.png")); RenderingRegistry.registerEntityRenderingHandler(NodeEntity.class, new NodeRender()); MinecraftForge.EVENT_BUS.register(new RenderGameOverlayEventHandler()); @@ -269,6 +274,9 @@ public class ClientProxy extends ServerProxy { BlastEntityFX blast = new BlastEntityFX(world,x,y,z,mx,my,mz,particleScale); world.spawnEntityInWorld(blast); break; + case 4: + world.spawnParticle("smoke",x,y,z,mx,my,mz); + break; default: FlameEntityFX flamePEFX2 = new FlameEntityFX(world,x,y,z,mx,my,mz,particleScale); world.spawnEntityInWorld(flamePEFX2); @@ -276,6 +284,15 @@ public class ClientProxy extends ServerProxy { } } + @Override + public void createExplosionEffect(World world, int x, int y, int z, float radius) + { + world.playSound(x, y, z, IHLModInfo.MODID+":explosion", 100f, 1f, false); + ExplosionEntityFX explosionFX = new ExplosionEntityFX(world, x, y, z, radius); + world.spawnEntityInWorld(explosionFX); + } + + @Override @SideOnly(Side.CLIENT) @SubscribeEvent @@ -329,6 +346,7 @@ public class ClientProxy extends ServerProxy { @SubscribeEvent public void onPacketFromServerToClient(FMLNetworkEvent.ClientCustomPacketEvent event) throws IOException { + World world = Minecraft.getMinecraft().theWorld; ByteBuf data = event.packet.payload(); ByteBufInputStream byteBufInputStream = new ByteBufInputStream(data); switch(byteBufInputStream.read()) @@ -342,11 +360,11 @@ public class ClientProxy extends ServerProxy { float my=byteBufInputStream.readFloat(); float mz=byteBufInputStream.readFloat(); float particleScale=byteBufInputStream.readFloat(); - this.spawnParticle(particleId, Minecraft.getMinecraft().theWorld, x, y, z, mx, my, mz, particleScale); + this.spawnParticle(particleId, world, x, y, z, mx, my, mz, particleScale); break; case 1: int entityId = byteBufInputStream.readInt(); - INetworkListener listener = (INetworkListener) Minecraft.getMinecraft().theWorld.getEntityByID(entityId); + INetworkListener listener = (INetworkListener) world.getEntityByID(entityId); if(listener!=null) { listener.recieveData(byteBufInputStream); @@ -358,11 +376,44 @@ public class ClientProxy extends ServerProxy { IHLMod.log.debug("Data delayed. Entity ID="+entityId); } break; + case 2: + int posX=byteBufInputStream.readInt(); + int posY=byteBufInputStream.readInt(); + int posZ=byteBufInputStream.readInt(); + float radius=byteBufInputStream.readFloat(); + this.createExplosionEffect(world, posX, posY, posZ, radius); + break; + case 3: + int soundId = byteBufInputStream.read(); + x=byteBufInputStream.readFloat(); + y=byteBufInputStream.readFloat(); + z=byteBufInputStream.readFloat(); + float volume=byteBufInputStream.readFloat(); + float pitch=byteBufInputStream.readFloat(); + this.playSound(Minecraft.getMinecraft().theWorld, soundId, x, y, z, volume, pitch); + break; + case 4: + int chunkNum = byteBufInputStream.read(); + for(int i=0;i>32) & 0xFFFFFFFF); + Chunk chunk = world.getChunkProvider().provideChunk(chunkX, chunkZ); + chunk.generateSkylightMap(); + Arrays.fill(chunk.updateSkylightColumns, true); + chunk.func_150804_b(true); + } + break; } byteBufInputStream.close(); } - @Override + private void playSound(WorldClient world, int soundId, float x, float y, float z, float volume, float pitch) { + world.playSound(x, y, z, IHLModInfo.MODID+":fuse", 1f, 1f, false); + } + + @Override public boolean renderTESpecialSelectionBox(TileEntity te, EntityPlayer player, ItemStack currentItem, MovingObjectPosition target, float partialTicks) { ISelectionBoxSpecialRenderer ssbr = selectionBoxSpecialRendererRegistry.get(te.getClass()); @@ -397,7 +448,29 @@ public class ClientProxy extends ServerProxy { { e.printStackTrace(); } - + } + + @Override + public void requestTileEntityInitdataFromClientToServer(int x, int y, int z) + { + EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer; + ByteBuf bb = Unpooled.buffer(36); + ByteBufOutputStream byteBufOutputStream = new ByteBufOutputStream(bb); + try + { + byteBufOutputStream.write(1); + byteBufOutputStream.writeInt(player.getEntityId()); + byteBufOutputStream.writeInt(player.worldObj.provider.dimensionId); + byteBufOutputStream.writeInt(x); + byteBufOutputStream.writeInt(y); + byteBufOutputStream.writeInt(z); + channel.sendToServer(new FMLProxyPacket(byteBufOutputStream.buffer(),IHLModInfo.MODID)); + byteBufOutputStream.close(); + } + catch (IOException e) + { + e.printStackTrace(); + } } } diff --git a/ihl/IHL3dPathFinder.java b/ihl/IHL3dPathFinder.java index cfb71d1..3f0605b 100644 --- a/ihl/IHL3dPathFinder.java +++ b/ihl/IHL3dPathFinder.java @@ -1,7 +1,7 @@ package ihl; -import java.util.ArrayList; -import java.util.List; +import java.util.HashSet; +import java.util.Set; import net.minecraft.block.Block; import net.minecraft.entity.Entity; @@ -70,7 +70,7 @@ public class IHL3dPathFinder { int y=Math.round((float)toY); int z=Math.round((float)toZ); int xyz[] = {0,0,1,0,0,-1,0,0}; - List list = new ArrayList(); + Set list = new HashSet(); for(int thread=0;thread<=256;thread++) { if(this.isCourseTraversable(x+0.5D, y+0.5D, z+0.5D, this.entity.posX, this.entity.posY, this.entity.posZ)) diff --git a/ihl/IHLMod.java b/ihl/IHLMod.java index c92e0ff..ed66a5f 100644 --- a/ihl/IHLMod.java +++ b/ihl/IHLMod.java @@ -3,8 +3,10 @@ package ihl; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; +import java.util.HashMap; import java.util.Iterator; import java.util.List; +import java.util.Map; import javax.xml.parsers.ParserConfigurationException; @@ -36,6 +38,12 @@ import ihl.datanet.DataNet; import ihl.enviroment.LaserHitMirrorEventHandler; import ihl.enviroment.LightBulbBlock; import ihl.enviroment.MirrorBlock; +import ihl.explosion.ChunkAndWorldLoadEventHandler; +import ihl.explosion.ExplosionVectorBlockV2; +import ihl.explosion.ExplosiveBlock; +import ihl.explosion.GroundRemoverItem; +import ihl.explosion.IHLEntityFallingPile; +import ihl.explosion.PileBlock; import ihl.flexible_cable.AnchorBlock; import ihl.flexible_cable.AnchorTileEntity; import ihl.flexible_cable.IHLENet; @@ -51,7 +59,6 @@ import ihl.i_hate_liquids.IHLEventHandler; import ihl.items_blocks.FiberItem; import ihl.items_blocks.FlexibleCableItem; import ihl.items_blocks.FlexiblePipeItem; -import ihl.items_blocks.GroundRemoverItem; import ihl.items_blocks.IHLItemBlock; import ihl.items_blocks.IHLTool; import ihl.items_blocks.ItemSubstance; @@ -101,6 +108,7 @@ import ihl.crop_harvestors.RubberTreeBlock; import ihl.crop_harvestors.SackBlock; import ihl.crop_harvestors.SackTileEntity; import ihl.recipes.IronWorkbenchRecipe; +import ihl.recipes.RecipeInputDetonator; import ihl.recipes.RecipeInputDie; import ihl.recipes.RecipeInputWire; import ihl.recipes.RecipeOutputItemStack; @@ -115,13 +123,10 @@ import ihl.tunneling_shield.DriverBlock; import ihl.tunneling_shield.DriverTileEntity; import ihl.tunneling_shield.HorizontalMiningPipe; import ihl.tunneling_shield.MultiBlockSpacerBlock; -import ihl.utils.ChunkAndWorldLoadEventHandler; import ihl.utils.EntityDropEventHandler; -import ihl.utils.ExplosionVector; import ihl.utils.FluidDictionary; import ihl.utils.IHLUtils; import ihl.utils.IHLXMLParser; -import ihl.utils.PlayerWakeUpEventHandler; import ihl.worldgen.IHLWorldGenerator; import ihl.worldgen.ores.BlockOre; import ihl.worldgen.ores.DebugScannerBlock; @@ -140,7 +145,6 @@ import net.minecraft.world.biome.BiomeGenBase; import net.minecraftforge.common.BiomeDictionary; import net.minecraftforge.common.BiomeDictionary.Type; import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; @@ -152,8 +156,6 @@ import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent; import cpw.mods.fml.common.registry.EntityRegistry; import cpw.mods.fml.common.registry.GameRegistry; @@ -203,9 +205,10 @@ public class IHLMod implements IFuelHandler{ public static DataNet datanet; private ItemStack pfaalimestone; private ItemStack pfaacobblelimestone; - public static ExplosionVector explosionHandler; public static IHLXMLParser xmlparser; public static FluidDictionary fluidDictionary; + public static Map moltenAmounts = new HashMap(); + public static ExplosionVectorBlockV2 explosionHandler; @EventHandler public void preInit(FMLPreInitializationEvent evt) throws IOException, ParserConfigurationException @@ -237,12 +240,7 @@ public class IHLMod implements IFuelHandler{ { MinecraftForge.EVENT_BUS.register(new IHLEventHandler()); } - MinecraftForge.EVENT_BUS.register(new ChunkAndWorldLoadEventHandler()); MinecraftForge.EVENT_BUS.register(new EntityDropEventHandler()); - if(config.giveIHLManualOnPlayerWakeUpEvent) - { - MinecraftForge.EVENT_BUS.register(new PlayerWakeUpEventHandler()); - } MinecraftForge.EVENT_BUS.register(new LaserHitMirrorEventHandler()); MinecraftForge.EVENT_BUS.register(new IHLBucketHandler()); MinecraftForge.EVENT_BUS.register(proxy); @@ -250,13 +248,14 @@ public class IHLMod implements IFuelHandler{ GameRegistry.registerBlock(ds, "debugScanner"); GameRegistry.registerTileEntity(DebugScannerTileEntity.class,"DebugScanner"); cableAnchorBlock = new AnchorBlock("cableAnchor"); - List info1 = new ArrayList(); + List info1 = new ArrayList(); info1.add("non vulcanized rubber insulated"); DataCableItem.init(); GroundRemoverItem.init(); FlexibleCableItem.init(); IHLGuidebookItem.init(); - //ExplosiveBlock.init(); + ExplosiveBlock.init(); + PileBlock.init(); GameRegistry.registerTileEntity(AnchorTileEntity.class, "anchorTileEntity"); crucible=new Crucible(); @@ -315,18 +314,17 @@ public class IHLMod implements IFuelHandler{ GameRegistry.registerItem(tditft, "tditftItem"); proxy.load(); registerEntities(); - if(!IHLUtils.hasOreDictionaryEntry("ingotBrick")) - { - OreDictionary.registerOre("ingotBrick", Items.brick); - } - if(!IHLUtils.hasOreDictionaryEntry("dustGunpowder")) - { - OreDictionary.registerOre("dustGunpowder", Items.gunpowder); - } - + OreDictionary.registerOre("ingotBrick", Items.brick); + OreDictionary.registerOre("dustGunpowder", Items.gunpowder); + OreDictionary.registerOre("blockDirt", new ItemStack(Blocks.dirt, 1, OreDictionary.WILDCARD_VALUE)); + OreDictionary.registerOre("blockDirt", new ItemStack(Blocks.grass, 1, OreDictionary.WILDCARD_VALUE)); + OreDictionary.registerOre("platePaper", new ItemStack(Items.paper, 1, OreDictionary.WILDCARD_VALUE)); + OreDictionary.registerOre("dustGunpowder", new ItemStack(Items.gunpowder, 1, OreDictionary.WILDCARD_VALUE)); + OreDictionary.registerOre("blockExplosive", IHLUtils.getThisModItemStack("ihlExplosive")); + MinecraftForge.EVENT_BUS.register(new ChunkAndWorldLoadEventHandler()); IHLMod.log.info("IHL precalculating explosion."); - explosionHandler = new ExplosionVector(); - IHLMod.log.info("Explosion calculated. Amount of start vectors is "+explosionHandler.startVectors.size()); + IHLMod.explosionHandler = new ExplosionVectorBlockV2(); + IHLMod.log.info("Explosion calculated."); } @EventHandler @@ -349,8 +347,8 @@ public class IHLMod implements IFuelHandler{ ConfigTag tweaks = codechicken.core.asm.CodeChickenCoreModContainer.config.getTag("tweaks"); cccFiniteWater = tweaks.getTag("finiteWater").setComment("If set to true two adjacent water source blocks will not generate a third.").getBooleanValue(true); } - if(!IHLMod.config.skipRecipeLoad) - { + if(!IHLMod.config.skipRecipeLoad) + { if(IHLMod.config.enableRubberTreeSack) { GameRegistry.addRecipe(new ItemStack(sackBlock, 1), new Object[]{ "STS", "L L", "LLL", 'S', Items.string, 'T', Items.stick, 'L', Items.leather}); @@ -370,8 +368,8 @@ public class IHLMod implements IFuelHandler{ ItemStack nuggetTarPitch = OreDictionary.getOres("nuggetTarPitch").get(0).copy(); GameRegistry.addShapelessRecipe(OreDictionary.getOres("ingotTarPitch").get(0).copy(), new Object[]{nuggetTarPitch,nuggetTarPitch,nuggetTarPitch,nuggetTarPitch,nuggetTarPitch,nuggetTarPitch,nuggetTarPitch,nuggetTarPitch,nuggetTarPitch}); if(IHLUtils.hasOreDictionaryEntry("brickPeat") && GameRegistry.findItem("Forestry", "bituminousPeat")!=null)GameRegistry.addRecipe(new ItemStack(GameRegistry.findItem("Forestry", "bituminousPeat"), 5), new Object[] { "BBB", "BPB", "BBB", 'B', IHLUtils.getOreDictItemStack("brickPeat"), 'P', OreDictionary.getOres("ingotTarPitch").get(0)}); - pfaalimestone = IHLUtils.getOtherModItemStackWithDamage("PFAAGeologica", "mediumStone",0); - pfaacobblelimestone = IHLUtils.getOtherModItemStackWithDamage("PFAAGeologica", "mediumCobble",0); + pfaalimestone = IHLUtils.getOtherModItemStackWithDamage("PFAAGeologica", "mediumStone",0,1); + pfaacobblelimestone = IHLUtils.getOtherModItemStackWithDamage("PFAAGeologica", "mediumCobble",0,1); isGregTechModLoaded=Loader.isModLoaded("gregtech"); if(isGregTechModLoaded) { @@ -402,6 +400,7 @@ public class IHLMod implements IFuelHandler{ IHLUtils.addIC2CentrifugeRecipe("crushedBauxite", IHLUtils.getThisModItemStack("crushedPurifiedBauxite"),IHLUtils.getOreDictItemStack("dustClay")); IHLUtils.addIC2CentrifugeRecipe("crushedStibnite", IHLUtils.getThisModItemStack("crushedPurifiedStibnite"),IHLUtils.getOreDictItemStack("dustTinyGold")); IHLUtils.addIC2MaceratorRecipe("logWood", IHLUtils.getThisModItemStack("dustWood")); + IHLUtils.addIC2MaceratorRecipe("ingotPotassium", IHLUtils.getThisModItemStack("dustPotassiumOxide")); if(IHLUtils.hasOreDictionaryEntry("blockLimestone"))IHLUtils.addIC2MaceratorRecipe("blockLimestone", IHLUtils.getOreDictItemStackWithSize("dustCalcite",4)); if(pfaalimestone!=null)IHLUtils.addIC2MaceratorRecipe(pfaalimestone, IHLUtils.getOreDictItemStackWithSize("dustCalcite",4)); if(pfaacobblelimestone!=null)IHLUtils.addIC2MaceratorRecipe(pfaacobblelimestone, IHLUtils.getOreDictItemStackWithSize("dustCalcite",4)); @@ -423,6 +422,7 @@ public class IHLMod implements IFuelHandler{ IHLUtils.addIC2MaceratorRecipe("oreDatolite", IHLUtils.getThisModItemStackWithSize("dustDatolite",4)); IHLUtils.addIC2MaceratorRecipe("oreBischofite", IHLUtils.getThisModItemStackWithSize("dustBischofite",4)); IHLUtils.addIC2MaceratorRecipe("ingotBrick", IHLUtils.getOreDictItemStackWithSize("dustBrick",1)); + IHLUtils.addIC2ExtrudingRecipe(IHLUtils.getThisModItemStack("dustIronOxideCatalystMix"), IHLUtils.getThisModItemStack("catalystRawIronOxide")); Recipes.advRecipes.addShapelessRecipe(IHLUtils.getThisModItemStackWithSize("dustIrongraphite",2), new Object[] {new RecipeInputOreDict("dustIron"), new RecipeInputOreDict("dustGraphite")}); Recipes.advRecipes.addShapelessRecipe(IHLUtils.getOreDictItemStackWithSize("dustPorcelain",4), new Object[] {new RecipeInputOreDict("dustClay"),new RecipeInputOreDict("dustClay"), new RecipeInputOreDict("dustSiliconDioxide"), new RecipeInputOreDict("dustPotassiumFeldspar")}); Recipes.advRecipes.addShapelessRecipe(IHLUtils.getThisModItemStack("chisel"), new Object[] {IHLUtils.getThisModItemStack("grindstone"),IHLUtils.getThisModItemStack("blankChiselSteel")}); @@ -460,6 +460,15 @@ public class IHLMod implements IFuelHandler{ Character.valueOf('D'), new RecipeInputOreDict("craftingToolHardHammer"), Character.valueOf('R'), new RecipeInputItemStack(IHLUtils.getThisModItemStack("diceM10x1SteelHardened")), Character.valueOf('W'), new RecipeInputOreDict("craftingToolSaw")}); + + Recipes.advRecipes.addRecipe(IHLUtils.getThisModItemStackWithSize("drillSteel",2), new Object[] { + "VFS", "DR ", " ", + Character.valueOf('V'), new RecipeInputOreDict("craftingToolHardHammer"), + Character.valueOf('F'), new RecipeInputItemStack(IHLUtils.getThisModItemStack("viseSteel")), + Character.valueOf('S'), new RecipeInputOreDict("craftingToolFile"), + Character.valueOf('D'), new RecipeInputOreDict("craftingToolChisel"), + Character.valueOf('R'), new RecipeInputItemStack(IHLUtils.getThisModItemStack("barD10SteelHot"))}); + ItemStack crystal = IC2Items.getItem("lapotronCrystal").copy(); ItemStack advBattery = IC2Items.getItem("advBattery").copy(); ItemStack chargedReBattery = IC2Items.getItem("chargedReBattery").copy(); @@ -485,10 +494,10 @@ public class IHLMod implements IFuelHandler{ Recipes.advRecipes.addRecipe(((AdvancedHandPump) ic2_advanced_handpump).getItemStack(0), new Object[] { "TK ", "KCA", " RP", Character.valueOf('T'), IC2Items.getItem("treetap"), Character.valueOf('K'), IC2Items.getItem("advancedAlloy"), Character.valueOf('C'), IC2Items.getItem("cell"), Character.valueOf('A'), IC2Items.getItem("advancedCircuit"), Character.valueOf('R'), IC2Items.getItem("energyCrystal"), Character.valueOf('P'), IC2Items.getItem("powerunitsmall")}); } - ItemStack forestryWaxCapsule = IHLUtils.getOtherModItemStackWithDamage("Forestry", "waxCapsule", 0); - ItemStack forestryWaxCast = IHLUtils.getOtherModItemStackWithDamage("Forestry", "waxCast", 0); - ItemStack forestryCandle = IHLUtils.getOtherModItemStackWithDamage("Forestry", "candle", 0); - ItemStack forestryBeesWax = IHLUtils.getOtherModItemStackWithDamage("Forestry", "beeswax", 0); + ItemStack forestryWaxCapsule = IHLUtils.getOtherModItemStackWithDamage("Forestry", "waxCapsule", 0,1); + ItemStack forestryWaxCast = IHLUtils.getOtherModItemStackWithDamage("Forestry", "waxCast", 0,1); + ItemStack forestryCandle = IHLUtils.getOtherModItemStackWithDamage("Forestry", "candle", 0,1); + ItemStack forestryBeesWax = IHLUtils.getOtherModItemStackWithDamage("Forestry", "beeswax", 0,1); if(forestryWaxCapsule!=null) { Recipes.advRecipes.addRecipe(forestryWaxCapsule, new Object[] { "SBS", " ", " ", Character.valueOf('S'), IHLUtils.getThisModItemStack("ingotStearin"),Character.valueOf('B'),forestryBeesWax}); @@ -523,14 +532,15 @@ public class IHLMod implements IFuelHandler{ FurnaceRecipes.smelting().func_151394_a(IHLUtils.getThisModItemStack("stickCoalElectrodePremix"), IHLUtils.getOreDictItemStack("stickCoal"), 20F); FurnaceRecipes.smelting().func_151394_a(IHLUtils.getThisModItemStack("plateRawCoal"), IHLUtils.getOreDictItemStack("plateCoal"), 20F); FurnaceRecipes.smelting().func_151394_a(IHLUtils.getOreDictItemStackWithSize("dustCalcite",3), IHLUtils.getOreDictItemStack("dustQuicklime"), 2F); + FurnaceRecipes.smelting().func_151394_a(IHLUtils.getThisModItemStack("catalystRawIronOxide"), IHLUtils.getThisModItemStack("catalystIronOxide"), 2F); ItemSubstance.postInit(); ItemStack lathingTool = Ic2Items.LathingTool.copy(); lathingTool.setItemDamage(OreDictionary.WILDCARD_VALUE); IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(Arrays.asList(new IRecipeInput[] {new RecipeInputDie("setOfDies1_5sqmm",240)}),Arrays.asList(new ItemStack[] {Ic2Items.copperCableItem}),Arrays.asList(new ItemStack[] {IHLUtils.getUninsulatedWire("Copper",1,240)}))); IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(Arrays.asList(new IRecipeInput[] {new RecipeInputDie("setOfDies1_5sqmm",240)}),Arrays.asList(new ItemStack[] {Ic2Items.ironCableItem}),Arrays.asList(new ItemStack[] {IHLUtils.getUninsulatedWire("Steel",1,240)}))); IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(null,Arrays.asList(new ItemStack[] {IHLUtils.getThisModItemStack("bucket_tarPitch"),new ItemStack(Items.stick)}),Arrays.asList(new ItemStack[] {new ItemStack(Items.bucket),IHLUtils.getOreDictItemStackWithSize("nuggetTarPitch",4),new ItemStack(Blocks.torch)}))); - List materialList3 = new ArrayList(); - materialList3.add(new RecipeInputItemStack(new ItemStack(Blocks.sand,1 , OreDictionary.WILDCARD_VALUE))); + List materialList3 = new ArrayList(); + materialList3.add(new RecipeInputItemStack(new ItemStack(Blocks.sand, 1 , OreDictionary.WILDCARD_VALUE))); materialList3.add(new RecipeInputOreDict("dustClay")); materialList3.add(new RecipeInputFluidContainer(FluidRegistry.WATER,1)); IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(null,materialList3,Arrays.asList(new ItemStack[]{InjectionMoldBlock.instance.getSandInjectionMoldForResult("ingot")}))); @@ -547,6 +557,7 @@ public class IHLMod implements IFuelHandler{ IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(null,materialList3,Arrays.asList(new ItemStack[]{InjectionMoldBlock.instance.getSandInjectionMoldForResult("handDrillSetOfMoldedParts")}))); IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(null,materialList3,Arrays.asList(new ItemStack[]{InjectionMoldBlock.instance.getSandInjectionMoldForResult("detonationSprayingMachineSetOfMoldedParts")}))); IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(null,materialList3,Arrays.asList(new ItemStack[]{InjectionMoldBlock.instance.getSandInjectionMoldForResult("viseSetOfMoldedParts")}))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(null,materialList3,Arrays.asList(new ItemStack[]{InjectionMoldBlock.instance.getSandInjectionMoldForResult("nozzle")}))); //Sand molds recipe section end List materialsForPrecisionMold = Arrays.asList(new ItemStack[]{IHLUtils.getThisModItemStack("ingotStearin"), IHLUtils.getOreDictItemStack("cellLiquidGlass"), IHLUtils.getOreDictItemStack("dustSiliconDioxide"), new ItemStack(Blocks.sand)}); IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(Arrays.asList(new ItemStack[] {IHLUtils.getThisModItemStack("sharpenedCarvingKnifeBronze")}),materialsForPrecisionMold,Arrays.asList(new ItemStack[]{InjectionMoldBlock.instance.getGypsumInjectionMoldForResult("rollingMachineSetOfMoldedParts"), Ic2Items.cell.copy()}))); @@ -554,8 +565,14 @@ public class IHLMod implements IFuelHandler{ IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(Arrays.asList(new ItemStack[] {IHLUtils.getThisModItemStack("sharpenedCarvingKnifeBronze")}),materialsForPrecisionMold,Arrays.asList(new ItemStack[]{InjectionMoldBlock.instance.getGypsumInjectionMoldForResult("turboCompressorSetOfMoldedParts"), Ic2Items.cell.copy()}))); IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(Arrays.asList(new ItemStack[] {IHLUtils.getThisModItemStack("sharpenedCarvingKnifeBronze")}),materialsForPrecisionMold,Arrays.asList(new ItemStack[]{InjectionMoldBlock.instance.getGypsumInjectionMoldForResult("extruderSetOfMoldedParts"), Ic2Items.cell.copy()}))); //Precision molds recipe section end - IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(Arrays.asList(new ItemStack[] {IHLUtils.getThisModItemStack("hammer"),IHLUtils.getThisModItemStack("viseSteel"),IHLUtils.getThisModItemStack("setOfFilesSteel"),IHLUtils.getThisModItemStack("chisel")}),Arrays.asList(new ItemStack[]{IHLUtils.getThisModItemStack("barD10SteelHot")}),Arrays.asList(new ItemStack[]{IHLUtils.getThisModItemStackWithSize("drillSteel",2)}))); - IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(Arrays.asList(new ItemStack[] {IHLUtils.getThisModItemStack("hammer"),IHLUtils.getThisModItemStack("chisel"),IHLUtils.getThisModItemStack("needleFile")}),Arrays.asList(new ItemStack[]{IHLUtils.getThisModItemStack("barD10SteelHot")}),Arrays.asList(new ItemStack[]{IHLUtils.getThisModItemStackWithSize("sawBladeSteel",2)}))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe( + Arrays.asList(new ItemStack[] { + IHLUtils.getThisModItemStack("hammer"), + IHLUtils.getThisModItemStack("chisel"), + IHLUtils.getThisModItemStack("needleFile")}), + Arrays.asList(new ItemStack[]{ + IHLUtils.getThisModItemStack("barD10SteelHot")}), + Arrays.asList(new ItemStack[]{IHLUtils.getThisModItemStackWithSize("sawBladeSteel",2)}))); IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(Arrays.asList(new ItemStack[] {IHLUtils.getThisModItemStack("hammer"),IHLUtils.getThisModItemStack("sharpenedCarvingKnifeBronze"),IHLUtils.getThisModItemStack("needleFile")}),Arrays.asList(new ItemStack[]{IHLUtils.getThisModItemStack("barD10Steel"),IHLUtils.getThisModItemStack("sawBladeSteelHardened"),new ItemStack(Items.stick)}),Arrays.asList(new ItemStack[]{IHLUtils.getThisModItemStack("hackSawSteel")}))); IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(Arrays.asList(new ItemStack[] {IHLUtils.getThisModItemStack("needleFile"),IHLUtils.getThisModItemStack("hackSawSteel")}),Arrays.asList(new ItemStack[]{IHLUtils.getOreDictItemStack("plateSteel")}),Arrays.asList(new ItemStack[]{IHLUtils.getThisModItemStackWithSize("blankSetOfFilesSteel",4)}))); IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(Arrays.asList(new ItemStack[] {IHLUtils.getThisModItemStack("setOfFilesSteel")}),Arrays.asList(new ItemStack[]{IHLUtils.getThisModItemStack("viseSetOfMoldedPartsSteel")}),Arrays.asList(new ItemStack[]{IHLUtils.getThisModItemStack("viseSteel")}))); @@ -795,7 +812,14 @@ public class IHLMod implements IFuelHandler{ new RecipeInputOreDict("foilCopper"), new RecipeInputWire("Copper",8,15,"Rubber",100,10000)}), Arrays.asList(new ItemStack[]{IHLUtils.getThisModItemStack("redstoneSignalConverter")}),Arrays.asList(new ItemStack[] {IHLUtils.getThisModItemStack("gasWeldingStation")}))); - + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(null, + Arrays.asList(new IRecipeInput[]{ + new RecipeInputOreDict("dustIronOxide",8), + new RecipeInputOreDict("dustBauxite"), + new RecipeInputOreDict("dustPotassiumOxide"), + }), + Arrays.asList(new ItemStack[]{ + IHLUtils.getThisModItemStackWithSize("dustIronOxideCatalystMix",10)}))); IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(Arrays.asList(new ItemStack[] {IHLUtils.getThisModItemStack("hackSawSteel"),IHLUtils.getThisModItemStack("viseSteel"),IHLUtils.getThisModItemStack("setOfFilesSteel"),IHLUtils.getThisModItemStack("drillSteelHardened"),IHLUtils.getThisModItemStack("handDrillBronze")}),Arrays.asList(new ItemStack[]{IHLUtils.getOreDictItemStack("plateSteel")}),Arrays.asList(new ItemStack[]{IHLUtils.getThisModItemStackWithSize("incisorSteel",4)}))); if(IHLMod.isGregTechModLoaded && IHLMod.isGT_API_Version_5) { @@ -825,24 +849,67 @@ public class IHLMod implements IFuelHandler{ IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(Arrays.asList(new ItemStack[]{IHLUtils.getThisModItemStack("sharpenedCarvingKnifeBronze")}),Arrays.asList(new ItemStack[]{IHLUtils.getInsulatedWire("Copper", 1,240,"Rubber",100)}),Arrays.asList(new ItemStack[]{IHLUtils.getUninsulatedWire("Copper", 1,240)}))); IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(Arrays.asList(new ItemStack[]{IHLUtils.getThisModItemStack("sharpenedCarvingKnifeBronze")}),Arrays.asList(new ItemStack[]{IHLUtils.getInsulatedWire("Steel", 1,15,"Rubber",100)}),Arrays.asList(new ItemStack[]{IHLUtils.getUninsulatedWire("Steel", 1,15)}))); IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(Arrays.asList(new ItemStack[]{IHLUtils.getThisModItemStack("sharpenedCarvingKnifeBronze")}),Arrays.asList(new ItemStack[]{IHLUtils.getInsulatedWire("Steel", 1,240,"Rubber",100)}),Arrays.asList(new ItemStack[]{IHLUtils.getUninsulatedWire("Steel", 1,240)}))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(Arrays.asList( + new ItemStack[] {IHLUtils.getThisModItemStack("tinSnipsSteel")}), + Arrays.asList(new IRecipeInput[]{ + new RecipeInputOreDict("plateGraphite",2), + new RecipeInputItemStack(IHLUtils.getThisModItemStackWithSize("highVoltageCapacitor",3),3), + new RecipeInputFluidContainer(IHLFluid.IHLFluidType.MineralOil.fluid, 144), + new RecipeInputOreDict("dustSolderingAlloy"), + new RecipeInputOreDict("foilMica"), + new RecipeInputWire(IHLUtils.getUninsulatedWire("copper", 5, 15)), + new RecipeInputItemStack(IHLUtils.getThisModItemStackWithSize("gu-81m",4)), + new RecipeInputOreDict("foilCopper"), + new RecipeInputItemStack(IHLUtils.getThisModItemStackWithSize("valveTube1C21P",6))}), + Arrays.asList(new ItemStack[]{ + IHLUtils.getThisModItemStack("vacuumInductionMeltingFurnace") + }), + Arrays.asList(new ItemStack[] { + IHLUtils.getThisModItemStack("gasWeldingStation")}))); + ItemStack detonator = IHLUtils.getItemStackWithTag("detonator","detonator_delay",5); + detonator.stackSize=16; + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe( + null, + Arrays.asList(new IRecipeInput[]{ + new RecipeInputOreDict("platePaper",2), + new RecipeInputItemStack(new ItemStack(Items.string)), + new RecipeInputOreDict("dustGunpowder",1), + new RecipeInputOreDict("dustPentaerythritolTetranitrate",1), + new RecipeInputOreDict("ingotTarPitch",1) + }), + Arrays.asList(new ItemStack[]{detonator}), + null + )); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe( + null, + Arrays.asList(new IRecipeInput[]{ + new RecipeInputOreDict("platePaper",2), + new RecipeInputOreDict("dustPentaerythritolTetranitrate",8), + new RecipeInputOreDict("ingotTarPitch",1), + new RecipeInputDetonator(detonator) + }), + Arrays.asList(new ItemStack[]{ + IHLUtils.getItemStackWithTag("ihlExplosive","explosionPower",1000) + }),null + )); AchesonFurnanceTileEntity.addRecipe(new RecipeInputOreDict("dustSiliconDioxide",2), new RecipeInputOreDict("dustCoal",4), "dustCarborundum"); AchesonFurnanceTileEntity.addRecipe(new RecipeInputOreDict("dustQuicklime"), new RecipeInputOreDict("dustCoal",4), "dustCalciumCarbide"); AchesonFurnanceTileEntity.addRecipe(new RecipeInputOreDict("stickCoal"), new RecipeInputOreDict("dustCoal"), "stickGraphite"); AchesonFurnanceTileEntity.addRecipe(new RecipeInputOreDict("dustTungsten"), new RecipeInputOreDict("dustCoal"), "ingotTungsten"); AchesonFurnanceTileEntity.addRecipe(new RecipeInputOreDict("dustBoricAcid",4), new RecipeInputOreDict("dustCoal",8), "dustBoronCarbide"); AchesonFurnanceTileEntity.addRecipe(new RecipeInputOreDict("plateCoal"), new RecipeInputOreDict("dustCoal",1), "plateGraphite"); - GoldChimneyKneeTileEntity.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("ic2steam", 1),IHLUtils.getFluidStackWithSize("sulfuricanhydride", 1)}),null), IHLUtils.getFluidStackWithSize("vapour.sulfuricacid", 1)); - if(FluidRegistry.isFluidRegistered("steam"))GoldChimneyKneeTileEntity.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("steam", 1),IHLUtils.getFluidStackWithSize("sulfuricanhydride", 1)}),null), IHLUtils.getFluidStackWithSize("vapour.sulfuricacid", 1)); - GoldChimneyKneeTileEntity.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("ic2superheatedsteam", 15),IHLUtils.getFluidStackWithSize("sulfuricanhydride", 4)}),null), IHLUtils.getFluidStackWithSize("vapour.sulfuricacid", 4)); - LeadOvenTileEntity.addRecipe(new UniversalRecipeInput(null,Arrays.asList(new ItemStack[] {IHLUtils.getOreDictItemStack("dustSulfur"), IHLUtils.getOreDictItemStack("dustSaltpeter")})), IHLUtils.getFluidStackWithSize("sulfuricanhydride", 23000)); - LeadOvenTileEntity.addRecipe(new UniversalRecipeInput(null,Arrays.asList(new ItemStack[] {IHLUtils.getOreDictItemStack("crushedPurifiedCinnabar")})), IHLUtils.getFluidStackWithSize("vapour.mercury", 3600)); + GoldChimneyKneeTileEntity.addRecipe(new UniversalRecipeInput((new FluidStack[] {IHLUtils.getFluidStackWithSize("ic2steam", 1),IHLUtils.getFluidStackWithSize("sulfuricanhydride", 1)}),null), IHLUtils.getFluidStackWithSize("vapour.sulfuricacid", 1)); + if(FluidRegistry.isFluidRegistered("steam"))GoldChimneyKneeTileEntity.addRecipe(new UniversalRecipeInput((new FluidStack[] {IHLUtils.getFluidStackWithSize("steam", 1),IHLUtils.getFluidStackWithSize("sulfuricanhydride", 1)}),null), IHLUtils.getFluidStackWithSize("vapour.sulfuricacid", 1)); + GoldChimneyKneeTileEntity.addRecipe(new UniversalRecipeInput((new FluidStack[] {IHLUtils.getFluidStackWithSize("ic2superheatedsteam", 15),IHLUtils.getFluidStackWithSize("sulfuricanhydride", 4)}),null), IHLUtils.getFluidStackWithSize("vapour.sulfuricacid", 4)); + LeadOvenTileEntity.addRecipe(new UniversalRecipeInput(null,(new ItemStack[] {IHLUtils.getOreDictItemStack("dustSulfur"), IHLUtils.getOreDictItemStack("dustSaltpeter")})), IHLUtils.getFluidStackWithSize("sulfuricanhydride", 23000)); + LeadOvenTileEntity.addRecipe(new UniversalRecipeInput(null,(new ItemStack[] {IHLUtils.getOreDictItemStack("crushedPurifiedCinnabar")})), IHLUtils.getFluidStackWithSize("vapour.mercury", 3600)); LeadOvenTileEntity.addRecipe(IHLUtils.getThisModItemStack("dustStibnite"), IHLUtils.getThisModItemStack("dustAntimonyOxide")); LeadOvenTileEntity.addRecipe(IHLUtils.getOreDictItemStackWithSize("dustSodiumHydrogenSulfate",2), IHLUtils.getFluidStackWithSize("vapour.sulfuricacid", 20000), IHLUtils.getOreDictItemStack("dustSodiumSulfate")); LeadOvenTileEntity.addRecipe(IHLUtils.getThisModItemStackWithSize("dustSodiumZeoliteCoked",2), IHLUtils.getThisModItemStack("dustSodiumZeolite")); - ImpregnatingMachineTileEntity.addChemicalRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {new FluidStack(FluidRegistry.WATER, 1500)}), Arrays.asList(new ItemStack[] {IHLUtils.getOreDictItemStackWithSize("dustQuicklime", 1)})), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("limemilk", 2500)}),null,20)); - ImpregnatingMachineTileEntity.addChemicalRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {new FluidStack(FluidRegistry.WATER, 130),IHLUtils.getFluidStackWithSize("limemilk", 142)}), Arrays.asList(new ItemStack[] {IHLUtils.getThisModItemStackWithSize("muttonLard", 6)})), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("glyceryl", 130)}),Arrays.asList(new ItemStack[] {IHLUtils.getThisModItemStackWithSize("ingotCalciumSoap", 5)}),200)); - ImpregnatingMachineTileEntity.addChemicalRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {new FluidStack(FluidRegistry.WATER, 600),IHLUtils.getFluidStackWithSize("sulfuricacid", 284)}), Arrays.asList(new ItemStack[] {IHLUtils.getThisModItemStackWithSize("ingotCalciumSoap", 6)})), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("oleicacid", 280)}),Arrays.asList(new RecipeOutputItemStack[] {new RecipeOutputItemStack(IHLUtils.getThisModItemStackWithSize("ingotStearin", 4)),new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustGypsum"),0.48f)}),200)); - ImpregnatingMachineTileEntity.addChemicalRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("limemilk", 1000)}), Arrays.asList(new ItemStack[] {IHLUtils.getOreDictItemStack("dustTrona")})), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("solution.natriumhydroxide", 1000)}),Arrays.asList(new ItemStack[] {IHLUtils.getOreDictItemStack("dustCalcite")}),200)); + ImpregnatingMachineTileEntity.addChemicalRecipe(new UniversalRecipeInput((new FluidStack[] {new FluidStack(FluidRegistry.WATER, 1500)}), (new ItemStack[] {IHLUtils.getOreDictItemStackWithSize("dustQuicklime", 1)})), new UniversalRecipeOutput((new FluidStack[] {IHLUtils.getFluidStackWithSize("limemilk", 2500)}),null,20)); + ImpregnatingMachineTileEntity.addChemicalRecipe(new UniversalRecipeInput((new FluidStack[] {new FluidStack(FluidRegistry.WATER, 130),IHLUtils.getFluidStackWithSize("limemilk", 142)}), (new ItemStack[] {IHLUtils.getThisModItemStackWithSize("muttonLard", 6)})), new UniversalRecipeOutput((new FluidStack[] {IHLUtils.getFluidStackWithSize("glyceryl", 130)}),(new ItemStack[] {IHLUtils.getThisModItemStackWithSize("ingotCalciumSoap", 5)}),200)); + ImpregnatingMachineTileEntity.addChemicalRecipe(new UniversalRecipeInput((new FluidStack[] {new FluidStack(FluidRegistry.WATER, 600),IHLUtils.getFluidStackWithSize("sulfuricacid", 284)}), (new ItemStack[] {IHLUtils.getThisModItemStackWithSize("ingotCalciumSoap", 6)})), new UniversalRecipeOutput((new FluidStack[] {IHLUtils.getFluidStackWithSize("oleicacid", 280)}),(new RecipeOutputItemStack[] {new RecipeOutputItemStack(IHLUtils.getThisModItemStackWithSize("ingotStearin", 4)),new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustGypsum"),0.48f)}),200)); + ImpregnatingMachineTileEntity.addChemicalRecipe(new UniversalRecipeInput((new FluidStack[] {IHLUtils.getFluidStackWithSize("limemilk", 1000)}), (new ItemStack[] {IHLUtils.getOreDictItemStack("dustTrona")})), new UniversalRecipeOutput((new FluidStack[] {IHLUtils.getFluidStackWithSize("solution.natriumhydroxide", 1000)}),(new ItemStack[] {IHLUtils.getOreDictItemStack("dustCalcite")}),200)); DetonationSprayingMachineTileEntity.addRecipe(IHLUtils.getThisModItemStack("blankNeedleFileSteel"), IHLUtils.getThisModItemStack("needleFile")); DetonationSprayingMachineTileEntity.addRecipe(IHLUtils.getThisModItemStack("blankSetOfFilesSteel"), IHLUtils.getThisModItemStack("setOfFilesSteel")); DetonationSprayingMachineTileEntity.addRecipe(IHLUtils.getThisModItemStack("incisorSteel"), IHLUtils.getThisModItemStack("incisorSteelDiamondCoated")); @@ -858,9 +925,9 @@ public class IHLMod implements IFuelHandler{ MuffleFurnanceTileEntity.addRecipe(IHLUtils.getThisModItemStack("sawBladeSteel"),IHLUtils.getThisModItemStack("sawBladeSteelHot")); MuffleFurnanceTileEntity.addRecipe(IHLUtils.getThisModItemStack("barD10Steel"),IHLUtils.getThisModItemStack("barD10SteelHot")); MuffleFurnanceTileEntity.addRecipe(IHLUtils.getThisModItemStack("linerIronGraphite"),IHLUtils.getThisModItemStack("linerIronGraphiteHot")); - MuffleFurnanceTileEntity.addRecipe(new UniversalRecipeInput(null, Arrays.asList(new ItemStack[] {IHLUtils.getOreDictItemStack("dustIronOxide"), IHLUtils.getOreDictItemStack("dustLithiumOxide")})), new UniversalRecipeOutput(null, Arrays.asList(new ItemStack[] {IHLUtils.getOreDictItemStackWithSize("dustFerrite",2)}),200)); - MuffleFurnanceTileEntity.addRecipe(new UniversalRecipeInput(null, Arrays.asList(new ItemStack[] {IHLUtils.getOreDictItemStackWithSize("dustSiliconDioxide",3), IHLUtils.getOreDictItemStackWithSize("dustMagnesium",2)})), new UniversalRecipeOutput(null, Arrays.asList(new ItemStack[] {IHLUtils.getOreDictItemStack("dustSilicon"), IHLUtils.getOreDictItemStackWithSize("dustMagnesiumOxide",4)}),200)); - MuffleFurnanceTileEntity.addRecipe(new UniversalRecipeInput(null, Arrays.asList(new ItemStack[] {IHLUtils.getOreDictItemStack("dustBauxite"), IHLUtils.getOreDictItemStack("dustSodiumHydroxide")})), new UniversalRecipeOutput(null, Arrays.asList(new ItemStack[] {IHLUtils.getOreDictItemStack("dustSodiumAluminate")}),200)); + MuffleFurnanceTileEntity.addRecipe(new UniversalRecipeInput(null, (new ItemStack[] {IHLUtils.getOreDictItemStack("dustIronOxide"), IHLUtils.getOreDictItemStack("dustLithiumOxide")})), new UniversalRecipeOutput(null, (new ItemStack[] {IHLUtils.getOreDictItemStackWithSize("dustFerrite",2)}),200)); + MuffleFurnanceTileEntity.addRecipe(new UniversalRecipeInput(null, (new ItemStack[] {IHLUtils.getOreDictItemStackWithSize("dustSiliconDioxide",3), IHLUtils.getOreDictItemStackWithSize("dustMagnesium",2)})), new UniversalRecipeOutput(null, (new ItemStack[] {IHLUtils.getOreDictItemStack("dustSilicon"), IHLUtils.getOreDictItemStackWithSize("dustMagnesiumOxide",4)}),200)); + MuffleFurnanceTileEntity.addRecipe(new UniversalRecipeInput(null, (new ItemStack[] {IHLUtils.getOreDictItemStack("dustBauxite"), IHLUtils.getOreDictItemStack("dustSodiumHydroxide")})), new UniversalRecipeOutput(null, (new ItemStack[] {IHLUtils.getOreDictItemStack("dustSodiumAluminate")}),200)); MuffleFurnanceTileEntity.addRecipe(IHLUtils.getThisModItemStack("drillSteel"),IHLUtils.getThisModItemStack("drillSteelHot")); MuffleFurnanceTileEntity.addRecipe(IHLUtils.getThisModItemStack("tapM10x1Steel"),IHLUtils.getThisModItemStack("tapM10x1SteelHot")); MuffleFurnanceTileEntity.addRecipe(IHLUtils.getThisModItemStack("diceM10x1Steel"),IHLUtils.getThisModItemStack("diceM10x1SteelHot")); @@ -875,39 +942,39 @@ public class IHLMod implements IFuelHandler{ ImpregnatingMachineTileEntity.addQuenchingRecipe("tapM10x1SteelHot","tapM10x1SteelHardened"); ImpregnatingMachineTileEntity.addQuenchingRecipe("drillSteelHot","drillSteelHardened"); ImpregnatingMachineTileEntity.addQuenchingRecipe("sawBladeSteelHot","sawBladeSteelHardened"); - ImpregnatingMachineTileEntity.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("oleicacid", 1)}), Arrays.asList(new ItemStack[] {IHLUtils.getThisModItemStack("linerIronGraphiteHot")})), new UniversalRecipeOutput(null, Arrays.asList(new ItemStack[] {IHLUtils.getThisModItemStack("linerIronGraphiteGreased")}),2)); - ImpregnatingMachineTileEntity.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("seedoil", 1)}), Arrays.asList(new ItemStack[] {IHLUtils.getThisModItemStack("linerIronGraphiteHot")})), new UniversalRecipeOutput(null, Arrays.asList(new ItemStack[] {IHLUtils.getThisModItemStack("linerIronGraphiteGreased")}),2)); - ImpregnatingMachineTileEntity.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("mineraloil", 1)}), Arrays.asList(new ItemStack[] {IHLUtils.getThisModItemStack("linerIronGraphiteHot")})), new UniversalRecipeOutput(null, Arrays.asList(new ItemStack[] {IHLUtils.getThisModItemStack("linerIronGraphiteGreased")}),2)); + ImpregnatingMachineTileEntity.addRecipe(new UniversalRecipeInput((new FluidStack[] {IHLUtils.getFluidStackWithSize("oleicacid", 1)}), (new ItemStack[] {IHLUtils.getThisModItemStack("linerIronGraphiteHot")})), new UniversalRecipeOutput(null, (new ItemStack[] {IHLUtils.getThisModItemStack("linerIronGraphiteGreased")}),2)); + ImpregnatingMachineTileEntity.addRecipe(new UniversalRecipeInput((new FluidStack[] {IHLUtils.getFluidStackWithSize("seedoil", 1)}), (new ItemStack[] {IHLUtils.getThisModItemStack("linerIronGraphiteHot")})), new UniversalRecipeOutput(null, (new ItemStack[] {IHLUtils.getThisModItemStack("linerIronGraphiteGreased")}),2)); + ImpregnatingMachineTileEntity.addRecipe(new UniversalRecipeInput((new FluidStack[] {IHLUtils.getFluidStackWithSize("mineraloil", 1)}), (new ItemStack[] {IHLUtils.getThisModItemStack("linerIronGraphiteHot")})), new UniversalRecipeOutput(null, (new ItemStack[] {IHLUtils.getThisModItemStack("linerIronGraphiteGreased")}),2)); MuffleFurnanceTileEntity.addRecipe(IHLUtils.getThisModItemStack("foilRubberWithSulfur"),IHLUtils.getThisModItemStack("foilRubber")); - MuffleFurnanceTileEntity.addRecipe(new UniversalRecipeInput(null, Arrays.asList(new IRecipeInput[] {new RecipeInputItemStack(IHLUtils.getThisModItemStack("pipeRubberWithSulfur"))})),new UniversalRecipeOutput(null, Arrays.asList(new ItemStack[] {IHLUtils.getThisModItemStack("pipeVulcanizedRubber")}), 20)); + MuffleFurnanceTileEntity.addRecipe(new UniversalRecipeInput(null, (new IRecipeInput[] {new RecipeInputItemStack(IHLUtils.getThisModItemStack("pipeRubberWithSulfur"))})),new UniversalRecipeOutput(null, (new ItemStack[] {IHLUtils.getThisModItemStack("pipeVulcanizedRubber")}), 20)); GasWeldingStationTileEntity.addGasRecipe(IHLUtils.getOreDictItemStack("dustCalciumCarbide"),IHLUtils.getFluidStackWithSize("water", 666), IHLUtils.getFluidStackWithSize("acetylene", 1333), IHLUtils.getFluidStackWithSize("limemilk", 333)); CryogenicDistillerTileEntity.addRecipe(IHLUtils.getFluidStackWithSize("air", 1000), IHLUtils.getFluidStackWithSize("nitrogen", 781), IHLUtils.getFluidStackWithSize("oxygen", 209), false); - ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("solution.natriumhydroxide", 500)}), Arrays.asList(new ItemStack[] {IHLUtils.getOreDictItemStack("dustSiliconDioxide")})), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("liquidglass", 500)}),null,200)); + ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput((new FluidStack[] {IHLUtils.getFluidStackWithSize("solution.natriumhydroxide", 500)}), (new ItemStack[] {IHLUtils.getOreDictItemStack("dustSiliconDioxide")})), new UniversalRecipeOutput((new FluidStack[] {IHLUtils.getFluidStackWithSize("liquidglass", 500)}),null,200)); PrecipitatorCondenserTileEntity.addRecipe("vapour.sulfuricacid", "sulfuricacid", 50); PrecipitatorCondenserTileEntity.addRecipe("vapour.mercury", "mercury", 50); PrecipitatorCondenserTileEntity.addRecipe("ic2steam", "ic2distilledwater", 100); - ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("glyceryl", 50),IHLUtils.getFluidStackWithSize("spruceresin", 1000)}),null), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("cablingcolophony", 600)}),null,200,true)); + ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput((new FluidStack[] {IHLUtils.getFluidStackWithSize("glyceryl", 50),IHLUtils.getFluidStackWithSize("spruceresin", 1000)}),null), new UniversalRecipeOutput((new FluidStack[] {IHLUtils.getFluidStackWithSize("cablingcolophony", 600)}),null,200,true)); CryogenicDistillerTileEntity.addRecipe(IHLUtils.getFluidStackWithSize("spruceresin", 1000), IHLUtils.getFluidStackWithSize("ic2distilledwater", 150), IHLUtils.getFluidStackWithSize("turpentine", 300), true); - ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("fueloil", 2000)}),null), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("molten.tarpitch", 144)}),null,200,true)); + ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput((new FluidStack[] {IHLUtils.getFluidStackWithSize("fueloil", 2000)}),null), new UniversalRecipeOutput((new FluidStack[] {IHLUtils.getFluidStackWithSize("molten.tarpitch", 144)}),null,200,true)); CryogenicDistillerTileEntity.addRecipe(IHLUtils.getFluidStackWithSize("fueloil", 2000), IHLUtils.getFluidStackWithSize("mineraloil", 1000), null, true); - ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("solution.natriumhydroxide", 4000)}), Arrays.asList(new ItemStack[] {IHLUtils.getOreDictItemStack("crushedPurifiedGyubnera")})), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("solution.natriumtungstate", 4000)}),Arrays.asList(new RecipeOutputItemStack[] {new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustTinyManganeseOxide"),3.75f),new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustTinyIronOxide"),9f/12f)}),200)); - ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("sulfuricacid", 1750)}), Arrays.asList(new ItemStack[] {IHLUtils.getOreDictItemStackWithSize("dustRockSalt",1)})), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("hydrogenchloride", 1000)}),Arrays.asList(new RecipeOutputItemStack[] {new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustPotassiumSulphate"),1.75f)}),200)); - ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("sulfuricacid", 3500)}), Arrays.asList(new ItemStack[] {IHLUtils.getOreDictItemStack("dustSalt")})), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("hydrogenchloride", 1000)}),Arrays.asList(new RecipeOutputItemStack[] {new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustSodiumHydrogenSulfate"),3.5f)}),200)); - ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("sulfuricacid", 7000/9),new FluidStack(FluidRegistry.WATER,6000/9+1000)}), Arrays.asList(new ItemStack[] {IHLUtils.getOreDictItemStack("dustDatolite")})), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("boricacid", 1777)}),Arrays.asList(new RecipeOutputItemStack[] {new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustGypsum"),12f/9f),new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustTinySiliconDioxide"),3f)}),200)); - ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("limemilk", 1667),IHLUtils.getFluidStackWithSize("hydrogenchloride", 1334)}), null), new UniversalRecipeOutput(null,Arrays.asList(new ItemStack[] {IHLUtils.getOreDictItemStack("dustCalciumChloride")}),200)); - ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("solution.natriumtungstate", 6667)}), Arrays.asList(new ItemStack[] {IHLUtils.getOreDictItemStack("dustCalciumChloride")})), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("saltwater", 6000)}),Arrays.asList(new ItemStack[] {IHLUtils.getOreDictItemStack("dustCalciumTungstate")}),200)); - ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("solution.natriumhydroxide", 2000)}), Arrays.asList(new ItemStack[] {IHLUtils.getOreDictItemStack("dustWood"),IHLUtils.getOreDictItemStack("dustSodiumSulfide")})), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("pulp.cellulose", 1500),IHLUtils.getFluidStackWithSize("ic2biomass", 500)}),null,200)); - ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("cablingcolophony", 50),new FluidStack(FluidRegistry.WATER,2000)}), Arrays.asList(new ItemStack[] {IHLUtils.getOreDictItemStack("dustMica")})), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("pulp.mica", 2000)}),null,200)); - ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("hydrogenchloride", 500),new FluidStack(FluidRegistry.WATER,7500)}), Arrays.asList(new ItemStack[] {IHLUtils.getOreDictItemStack("dustMagnesiumOxide")})), new UniversalRecipeOutput(null,Arrays.asList(new RecipeOutputItemStack[] {new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustBischofite"),8.75f)}),200)); - ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("liquidglass", 1000),new FluidStack(FluidRegistry.WATER,2000)}), Arrays.asList(new ItemStack[] {IHLUtils.getOreDictItemStack("dustSodiumAluminate")})), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("pulp.sodiumzeolite", 4000)}),null,200)); + ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput((new FluidStack[] {IHLUtils.getFluidStackWithSize("solution.natriumhydroxide", 4000)}), (new ItemStack[] {IHLUtils.getOreDictItemStack("crushedPurifiedGyubnera")})), new UniversalRecipeOutput((new FluidStack[] {IHLUtils.getFluidStackWithSize("solution.natriumtungstate", 4000)}),(new RecipeOutputItemStack[] {new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustTinyManganeseOxide"),3.75f),new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustTinyIronOxide"),9f/12f)}),200)); + ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput((new FluidStack[] {IHLUtils.getFluidStackWithSize("sulfuricacid", 1750)}), (new ItemStack[] {IHLUtils.getOreDictItemStackWithSize("dustRockSalt",1)})), new UniversalRecipeOutput((new FluidStack[] {IHLUtils.getFluidStackWithSize("hydrogenchloride", 1000)}),(new RecipeOutputItemStack[] {new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustPotassiumSulphate"),1.75f)}),200)); + ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput((new FluidStack[] {IHLUtils.getFluidStackWithSize("sulfuricacid", 3500)}), (new ItemStack[] {IHLUtils.getOreDictItemStack("dustSalt")})), new UniversalRecipeOutput((new FluidStack[] {IHLUtils.getFluidStackWithSize("hydrogenchloride", 1000)}),(new RecipeOutputItemStack[] {new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustSodiumHydrogenSulfate"),3.5f)}),200)); + ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput((new FluidStack[] {IHLUtils.getFluidStackWithSize("sulfuricacid", 7000/9),new FluidStack(FluidRegistry.WATER,6000/9+1000)}), (new ItemStack[] {IHLUtils.getOreDictItemStack("dustDatolite")})), new UniversalRecipeOutput((new FluidStack[] {IHLUtils.getFluidStackWithSize("boricacid", 1777)}),(new RecipeOutputItemStack[] {new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustGypsum"),12f/9f),new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustTinySiliconDioxide"),3f)}),200)); + ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput((new FluidStack[] {IHLUtils.getFluidStackWithSize("limemilk", 1667),IHLUtils.getFluidStackWithSize("hydrogenchloride", 1334)}), null), new UniversalRecipeOutput(null,(new ItemStack[] {IHLUtils.getOreDictItemStack("dustCalciumChloride")}),200)); + ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput((new FluidStack[] {IHLUtils.getFluidStackWithSize("solution.natriumtungstate", 6667)}), (new ItemStack[] {IHLUtils.getOreDictItemStack("dustCalciumChloride")})), new UniversalRecipeOutput((new FluidStack[] {IHLUtils.getFluidStackWithSize("saltwater", 6000)}),(new ItemStack[] {IHLUtils.getOreDictItemStack("dustCalciumTungstate")}),200)); + ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput((new FluidStack[] {IHLUtils.getFluidStackWithSize("solution.natriumhydroxide", 2000)}), (new ItemStack[] {IHLUtils.getOreDictItemStack("dustWood"),IHLUtils.getOreDictItemStack("dustSodiumSulfide")})), new UniversalRecipeOutput((new FluidStack[] {IHLUtils.getFluidStackWithSize("pulp.cellulose", 1500),IHLUtils.getFluidStackWithSize("ic2biomass", 500)}),null,200)); + ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput((new FluidStack[] {IHLUtils.getFluidStackWithSize("cablingcolophony", 50),new FluidStack(FluidRegistry.WATER,2000)}), (new ItemStack[] {IHLUtils.getOreDictItemStack("dustMica")})), new UniversalRecipeOutput((new FluidStack[] {IHLUtils.getFluidStackWithSize("pulp.mica", 2000)}),null,200)); + ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput((new FluidStack[] {IHLUtils.getFluidStackWithSize("hydrogenchloride", 500),new FluidStack(FluidRegistry.WATER,7500)}), (new ItemStack[] {IHLUtils.getOreDictItemStack("dustMagnesiumOxide")})), new UniversalRecipeOutput(null,(new RecipeOutputItemStack[] {new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustBischofite"),8.75f)}),200)); + ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput((new FluidStack[] {IHLUtils.getFluidStackWithSize("liquidglass", 1000),new FluidStack(FluidRegistry.WATER,2000)}), (new ItemStack[] {IHLUtils.getOreDictItemStack("dustSodiumAluminate")})), new UniversalRecipeOutput((new FluidStack[] {IHLUtils.getFluidStackWithSize("pulp.sodiumzeolite", 4000)}),null,200)); EvaporatorTileEntity.addRecipe(IHLUtils.getFluidStackWithSize("saltwater", 4000), IHLUtils.getOreDictItemStack("dustSalt")); EvaporatorTileEntity.addRecipe(IHLUtils.getFluidStackWithSize("boricacid", 2288), IHLUtils.getOreDictItemStack("dustBoricAcid")); EvaporatorTileEntity.addRecipe(IHLUtils.getFluidStackWithSize("solution.natriumhydroxide", 2000), IHLUtils.getOreDictItemStack("dustSodiumHydroxide")); EvaporatorTileEntity.addRecipe(IHLUtils.getFluidStackWithSize("pulp.sodiumzeolite", 4000), IHLUtils.getOreDictItemStack("dustSodiumZeolite")); EvaporatorTileEntity.addRecipe(IHLUtils.getFluidStackWithSize("solution.lithiumchloride", 4000), IHLUtils.getOreDictItemStack("dustLithiumChloride")); EvaporatorTileEntity.addRecipe(IHLUtils.getFluidStackWithSize("solution.calciumchloride", 4000), IHLUtils.getOreDictItemStack("dustCalciumChloride")); - ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("water", 2000),IHLUtils.getFluidStackWithSize("hydrogenchloride", 667)}), Arrays.asList(new IRecipeInput[] {new RecipeInputOreDict("dustCalciumTungstate")})), new UniversalRecipeOutput(Arrays.asList(new FluidStack [] {IHLUtils.getFluidStackWithSize("solution.calciumchloride", 2000)}),Arrays.asList(new RecipeOutputItemStack[] {new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustTungsticAcid"),1.16f)}),200)); - if(IHLUtils.hasOreDictionaryEntry("dustTungstate"))ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("water", 1000),IHLUtils.getFluidStackWithSize("hydrogenchloride",140)}), Arrays.asList(new IRecipeInput[] {new RecipeInputOreDict("dustTungstate")})), new UniversalRecipeOutput(Arrays.asList(new FluidStack [] {IHLUtils.getFluidStackWithSize("solution.lithiumchloride", 560)}),Arrays.asList(new RecipeOutputItemStack[] {new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustTungsticAcid"),1.0f)}),200)); + ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput((new FluidStack[] {IHLUtils.getFluidStackWithSize("water", 2000),IHLUtils.getFluidStackWithSize("hydrogenchloride", 667)}), (new IRecipeInput[] {new RecipeInputOreDict("dustCalciumTungstate")})), new UniversalRecipeOutput((new FluidStack [] {IHLUtils.getFluidStackWithSize("solution.calciumchloride", 2000)}),(new RecipeOutputItemStack[] {new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustTungsticAcid"),1.16f)}),200)); + if(IHLUtils.hasOreDictionaryEntry("dustTungstate"))ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput((new FluidStack[] {IHLUtils.getFluidStackWithSize("water", 1000),IHLUtils.getFluidStackWithSize("hydrogenchloride",140)}), (new IRecipeInput[] {new RecipeInputOreDict("dustTungstate")})), new UniversalRecipeOutput((new FluidStack [] {IHLUtils.getFluidStackWithSize("solution.lithiumchloride", 560)}),(new RecipeOutputItemStack[] {new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustTungsticAcid"),1.0f)}),200)); MuffleFurnanceTileEntity.addRecipe(IHLUtils.getOreDictItemStackWithSize("dustTungsticAcid",2), IHLUtils.getOreDictItemStack("dustTungstenOxide"),1.14f); MuffleFurnanceTileEntity.addRecipe(IHLUtils.getThisModItemStack("electrolysisBathRawPorcelain"), IHLUtils.getThisModItemStack("electrolysisBathPorcelain")); MuffleFurnanceTileEntity.addRecipe(IHLUtils.getThisModItemStack("ovenRawPorcelain"), IHLUtils.getThisModItemStack("leadOven")); @@ -929,8 +996,108 @@ public class IHLMod implements IFuelHandler{ FluidizedBedReactorTileEntity.addRecipe(IHLUtils.getFluidStackWithSize("oxygen", 500), IHLUtils.getOreDictItemStack("dustLithium"), null, new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustLithiumOxide"),1.5f)); FluidizedBedReactorTileEntity.addRecipe(IHLUtils.getFluidStackWithSize("oxygen", 1333), IHLUtils.getOreDictItemStack("dustLead"), null, new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustLeadPlumbate"),2.333f)); FluidizedBedReactorTileEntity.addRecipe(IHLUtils.getFluidStackWithSize("chlorine", 2000), IHLUtils.getOreDictItemStack("dustCarborundum"), IHLUtils.getFluidStackWithSize("silicontetrachloride", 2500), new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustCoal"),0.5f)); - FluidizedBedReactorTileEntity.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack [] {IHLUtils.getFluidStackWithSize("hydrogen", 445),IHLUtils.getFluidStackWithSize("silicontetrachloride", 1667)}),Arrays.asList(new ItemStack [] {IHLUtils.getOreDictItemStackWithSize("dustIridium", 0),IHLUtils.getOreDictItemStack("dustTinySilicon")})), new UniversalRecipeOutput(Arrays.asList(new FluidStack [] {IHLUtils.getFluidStackWithSize("trichlorosilane", 2112)}),null,200)); - FluidizedBedReactorTileEntity.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack [] {IHLUtils.getFluidStackWithSize("fueloil", 6000)}), Arrays.asList(new ItemStack [] {IHLUtils.getOreDictItemStack("dustSodiumZeolite")})), new UniversalRecipeOutput(Arrays.asList(new FluidStack [] {IHLUtils.getFluidStackWithSize("fuel", 4500),IHLUtils.getFluidStackWithSize("crackinggas", 500)}),Arrays.asList(new RecipeOutputItemStack [] { new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustSodiumZeoliteCoked"),1.9f)}), 2000)); + FluidizedBedReactorTileEntity.addRecipe(new UniversalRecipeInput((new FluidStack [] {IHLUtils.getFluidStackWithSize("hydrogen", 445),IHLUtils.getFluidStackWithSize("silicontetrachloride", 1667)}),(new ItemStack [] {IHLUtils.getOreDictItemStackWithSize("dustIridium", 0),IHLUtils.getOreDictItemStack("dustTinySilicon")})), new UniversalRecipeOutput((new FluidStack [] {IHLUtils.getFluidStackWithSize("trichlorosilane", 2112)}),null,200)); + FluidizedBedReactorTileEntity.addRecipe(new UniversalRecipeInput((new FluidStack [] {IHLUtils.getFluidStackWithSize("fueloil", 6000)}), (new ItemStack [] {IHLUtils.getOreDictItemStack("dustSodiumZeolite")})), new UniversalRecipeOutput((new FluidStack [] {IHLUtils.getFluidStackWithSize("fuel", 4500),IHLUtils.getFluidStackWithSize("crackinggas", 500)}),(new RecipeOutputItemStack [] { new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustSodiumZeoliteCoked"),1.9f)}), 2000)); + FluidizedBedReactorTileEntity.addRecipe( + new UniversalRecipeInput(null, + (new IRecipeInput [] {new RecipeInputOreDict("dustWood")})), + new UniversalRecipeOutput((new FluidStack [] { + IHLUtils.getFluidStackWithSize("molten.tarpitch", 8), + IHLUtils.getFluidStackWithSize("tarwater", 39), + IHLUtils.getFluidStackWithSize("crackinggas", 31)}), + (new RecipeOutputItemStack [] { + new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustCoal"),0.25f)}), 2000)); + ChemicalReactorTileEntity.addRecipe( + new UniversalRecipeInput((new FluidStack[] { + IHLUtils.getFluidStackWithSize("tarwater", 50)}), + (new IRecipeInput[] { + new RecipeInputOreDict("dustQuicklime")})), + new UniversalRecipeOutput((new FluidStack[] { + IHLUtils.getFluidStackWithSize("water", 10)}), + (new RecipeOutputItemStack [] { + new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustCalciumAcetate"),1f)}),200,true)); + CryogenicDistillerTileEntity.addRecipe( + IHLUtils.getFluidStackWithSize("tarwater", 50), + IHLUtils.getFluidStackWithSize("ic2distilledwater", 30), + IHLUtils.getFluidStackWithSize("methanol", 10), true); + FluidizedBedReactorTileEntity.addRecipe(new UniversalRecipeInput( + new FluidStack [] {IHLUtils.getFluidStackWithSize("methanol", 200),IHLUtils.getFluidStackWithSize("oxygen", 100)}, + new IRecipeInput [] {new RecipeInputOreDict("dustSilver", 0)}), + new UniversalRecipeOutput( + new FluidStack [] {IHLUtils.getFluidStackWithSize("formaldehyde", 300)},null,200)); + FluidizedBedReactorTileEntity.addRecipe(new UniversalRecipeInput( + new FluidStack [] {IHLUtils.getFluidStackWithSize("chlorine", 110), + IHLUtils.getFluidStackWithSize("mercury", 50)}, + null), + new UniversalRecipeOutput( + null,new RecipeOutputItemStack [] { + new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustMercuryChloride"),1f)},200)); + FluidizedBedReactorTileEntity.addRecipe( + new UniversalRecipeInput( + new FluidStack [] { + IHLUtils.getFluidStackWithSize("acetylene", 100), + IHLUtils.getFluidStackWithSize("ic2distilledwater", 100), + IHLUtils.getFluidStackWithSize("hydrogenchloride", 2)}, + new IRecipeInput [] {new RecipeInputOreDict("dustMercuryChloride", 0)}), + new UniversalRecipeOutput( + new FluidStack [] {IHLUtils.getFluidStackWithSize("acetaldehyde", 200)},null,200)); + ChemicalReactorTileEntity.addRecipe( + new UniversalRecipeInput(new FluidStack[] { + IHLUtils.getFluidStackWithSize("acetaldehyde", 100), + IHLUtils.getFluidStackWithSize("formaldehyde", 400), + IHLUtils.getFluidStackWithSize("solution.natriumhydroxide", 100)}, + null), + new UniversalRecipeOutput(null, + new RecipeOutputItemStack [] { + new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustSodiumFormate"),1f), + new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustPentaerythritol"),1f) + },200,false)); + ChemicalReactorTileEntity.addRecipe( + new UniversalRecipeInput( + new FluidStack[] { + IHLUtils.getFluidStackWithSize("sulfuricacid", 288)}, + new IRecipeInput[] { + new RecipeInputOreDict("dustSaltpeter")}), + new UniversalRecipeOutput(null, + new RecipeOutputItemStack [] { + new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustPotassiumSulphate"),2f)},200,true)); + CryogenicDistillerTileEntity.addRecipe( + IHLUtils.getFluidStackWithSize("sulfuricacid", 288), + IHLUtils.getFluidStackWithSize("nitricacid", 120), null, true); + FluidizedBedReactorTileEntity.addRecipe(new UniversalRecipeInput( + new FluidStack [] {IHLUtils.getFluidStackWithSize("hydrogen", 90)}, + new IRecipeInput[] {new RecipeInputItemStack(IHLUtils.getThisModItemStack("catalystIronOxide"))}), + new UniversalRecipeOutput( + null,new RecipeOutputItemStack [] { + new RecipeOutputItemStack(IHLUtils.getThisModItemStack("catalystIron"),1f)},200)); + FluidizedBedReactorTileEntity.addRecipe( + new UniversalRecipeInput( + new FluidStack [] { + IHLUtils.getFluidStackWithSize("nitrogen", 100), + IHLUtils.getFluidStackWithSize("hydrogen", 300)}, + new IRecipeInput[] {new RecipeInputItemStack(IHLUtils.getThisModItemStackWithSize("catalystIron",0),0)}), + new UniversalRecipeOutput( + new FluidStack [] {IHLUtils.getFluidStackWithSize("ammonia", 400)},null,200)); + FluidizedBedReactorTileEntity.addRecipe( + new UniversalRecipeInput( + new FluidStack [] { + IHLUtils.getFluidStackWithSize("ammonia", 100), + IHLUtils.getFluidStackWithSize("oxygen", 150)}, + new IRecipeInput[] {new RecipeInputOreDict("dustIridium",0)}), + new UniversalRecipeOutput( + new FluidStack [] {IHLUtils.getFluidStackWithSize("nitricacid", 250)},null,200)); + ChemicalReactorTileEntity.addRecipe( + new UniversalRecipeInput( + new FluidStack[] { + IHLUtils.getFluidStackWithSize("nitricacid", 50), + IHLUtils.getFluidStackWithSize("sulfuricacid", 50)}, + new IRecipeInput[] { + new RecipeInputOreDict("dustPentaerythritol"), + new RecipeInputItemStack(new ItemStack(Items.snowball,8))}), + new UniversalRecipeOutput(null, + new RecipeOutputItemStack [] { + new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustPentaerythritolTetranitrate"),1f)},200,false)); + Crucible.addRecipe("ingotSteel", IHLUtils.getFluidStackWithSize("molten.steel", 144)); Crucible.addRecipe("ingotBronze", IHLUtils.getFluidStackWithSize("molten.bronze", 144)); Crucible.addRecipe("ingotGold", IHLUtils.getFluidStackWithSize("molten.gold", 144)); @@ -938,6 +1105,7 @@ public class IHLMod implements IFuelHandler{ Crucible.addRecipe("dustGold", IHLUtils.getFluidStackWithSize("molten.gold", 144)); Crucible.addRecipe("dustSalt", IHLUtils.getFluidStackWithSize("molten.sodiumchloride", 144)); Crucible.addRecipe("dustGlass", IHLUtils.getFluidStackWithSize("molten.glass", 144)); + Crucible.addRecipe("dustRockSalt", IHLUtils.getFluidStackWithSize("molten.potassiumchloride", 144)); PaperMachineTileEntity.addRecipe(IHLUtils.getFluidStackWithSize("pulp.cellulose", 1500), new ItemStack(Items.paper)); PaperMachineTileEntity.addRecipe(IHLUtils.getFluidStackWithSize("pulp.mica", 500), IHLUtils.getThisModItemStack("foilMica")); FractionatorBottomTileEntity.addRecipe(IHLUtils.getFluidStackWithSize("oil", 100), IHLUtils.getFluidStackWithSize("fueloil", 60), IHLUtils.getFluidStackWithSize("fuel", 40)); @@ -945,8 +1113,9 @@ public class IHLMod implements IFuelHandler{ if(FluidRegistry.isFluidRegistered("liquid_medium_oil"))FractionatorBottomTileEntity.addRecipe(IHLUtils.getFluidStackWithSize("liquid_medium_oil", 100), IHLUtils.getFluidStackWithSize("fueloil", 60), IHLUtils.getFluidStackWithSize("fuel", 40)); if(FluidRegistry.isFluidRegistered("liquid_heavy_oil"))FractionatorBottomTileEntity.addRecipe(IHLUtils.getFluidStackWithSize("liquid_heavy_oil", 100), IHLUtils.getFluidStackWithSize("fueloil", 70), IHLUtils.getFluidStackWithSize("fuel", 30)); if(FluidRegistry.isFluidRegistered("liquid_extra_heavy_oil"))FractionatorBottomTileEntity.addRecipe(IHLUtils.getFluidStackWithSize("liquid_extra_heavy_oil", 100), IHLUtils.getFluidStackWithSize("fueloil", 80), IHLUtils.getFluidStackWithSize("fuel", 20)); - ElectrolysisBathTileEntity.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("molten.sodiumchloride", 1000)}), Arrays.asList(new ItemStack[] {IHLUtils.getOreDictItemStack("dustBischofite")})), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("molten.magnesium", 6)}),null,200)); - ElectrolysisBathTileEntity.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("molten.sodiumchloride", 1000)}), Arrays.asList(new ItemStack[] {IHLUtils.getOreDictItemStack("dustLithiumChloride")})), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("molten.lithium", 72)}),null,200)); + ElectrolysisBathTileEntity.addRecipe(new UniversalRecipeInput((new FluidStack[] {IHLUtils.getFluidStackWithSize("molten.sodiumchloride", 1000)}), (new ItemStack[] {IHLUtils.getOreDictItemStack("dustBischofite")})), new UniversalRecipeOutput((new FluidStack[] {IHLUtils.getFluidStackWithSize("molten.magnesium", 6)}),null,200)); + ElectrolysisBathTileEntity.addRecipe(new UniversalRecipeInput((new FluidStack[] {IHLUtils.getFluidStackWithSize("molten.sodiumchloride", 1000)}), (new ItemStack[] {IHLUtils.getOreDictItemStack("dustLithiumChloride")})), new UniversalRecipeOutput((new FluidStack[] {IHLUtils.getFluidStackWithSize("molten.lithium", 72)}),null,200)); + ElectrolysisBathTileEntity.addRecipe(new UniversalRecipeInput((new FluidStack[] {IHLUtils.getFluidStackWithSize("molten.potassiumchloride", 1000)}), (new ItemStack[] {IHLUtils.getOreDictItemStack("dustRockSalt")})), new UniversalRecipeOutput((new FluidStack[] {IHLUtils.getFluidStackWithSize("molten.potassium", 72)}),null,200)); // 1 mb of molten metal per 1 m of cable with transverse section equals to 1.5 sq. mm. fluidDictionary.registerFluidStack("water", IHLUtils.getFluidStackWithSize("water", 1000)); fluidDictionary.registerFluidStack("water", IHLUtils.getFluidStackWithSize("ic2distilledwater", 1000)); @@ -976,7 +1145,7 @@ public class IHLMod implements IFuelHandler{ { NEIModContainer.plugins.add(new NEIIHLConfig()); } - IHLMod.config.CheckLists(); + IHLMod.config.checkLists(); IHLMod.proxy.initBlockRenderer(); IHLMod.log.info("IHL loaded."); } @@ -987,6 +1156,7 @@ public class IHLMod implements IFuelHandler{ EntityRegistry.registerModEntity(CollectorHeavyEntity.class, "CollectorHeavyEntity", 1, this, 80, 3, true); EntityRegistry.registerModEntity(PowerCableNodeEntity.class, "PowerCableNodeEntity", 2, this, 80, 3, true); EntityRegistry.registerModEntity(NodeEntity.class, "NodeEntity", 3, this, 80, 3, true); + EntityRegistry.registerModEntity(IHLEntityFallingPile.class, "IHLEntityFallingPile", 4, this, 80, 3, true); EntityRegistry.registerGlobalEntityID(LostHeadEntity.class, "LostHead", EntityRegistry.findGlobalUniqueEntityId(), 0x0033FF, 0x00CCFF); if(IHLMod.config.enableWailers) { @@ -1023,33 +1193,19 @@ public class IHLMod implements IFuelHandler{ return 0; } + @SuppressWarnings("deprecation") private void loadGT5Recipes() { - ItemStack odi = ItemList.Circuit_Basic.get(1L, new Object[] {null}); - ItemStack crystal = ItemList.Circuit_Primitive.get(1L, new Object[] {null}); ItemStack advBattery = ItemList.Hull_MV.get(1L, new Object[] {null}); - ItemStack chargedReBattery = ItemList.Hull_LV.get(1L, new Object[] {null}); - ItemStack gypsumOreList = GT_OreDictUnificator.get(OrePrefixes.cableGt01, Materials.Tin, 1L); ItemStack oreListIterator = GT_OreDictUnificator.get(OrePrefixes.cableGt08, Materials.Gold, 1L); ItemStack sc = GT_OreDictUnificator.get(OrePrefixes.cableGt08, Materials.Silver, 1L); ItemStack ec = GT_OreDictUnificator.get(OrePrefixes.cableGt08, Materials.Electrum, 1L); ItemStack lp = GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Lazurite, 1L); ItemStack sp = GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Steel, 1L); - ItemStack sr = GT_OreDictUnificator.get(OrePrefixes.rod, Materials.Steel, 1L); - ItemStack ip = GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iron, 1L); - ItemStack ir = GT_OreDictUnificator.get(OrePrefixes.rod, Materials.Iron, 1L); - ItemStack is = GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Iron, 1L); - ItemStack cs = GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Copper, 1L); - ItemStack cr = GT_OreDictUnificator.get(OrePrefixes.rod, Materials.Copper, 1L); - ItemStack pp = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Plastic, 1L); - ItemStack copper_plate = GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Copper, 1L); - ItemStack copper_framebox = GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Copper, 1L); ItemStack rotor_lv = ItemList.Rotor_LV.get(1L, new Object[] {null}); ItemStack rotor_mv = ItemList.Rotor_MV.get(1L, new Object[] {null}); ItemStack motor_lv = ItemList.Electric_Motor_LV.get(1L, new Object[] {null}); ItemStack motor_mv = ItemList.Electric_Motor_MV.get(1L, new Object[] {null}); - ItemStack piston_lv = ItemList.Electric_Piston_LV.get(1L, new Object[] {null}); - ItemStack roboarm_lv = ItemList.Robot_Arm_LV.get(1L, new Object[] {null}); ItemStack sensor_lv = ItemList.Sensor_LV.get(1L, new Object[] {null}); ItemStack sensor_mv = ItemList.Sensor_MV.get(1L, new Object[] {null}); ItemStack battery_lv_c = ItemList.Battery_RE_LV_Cadmium.get(1L, new Object[] {null}); @@ -1119,11 +1275,11 @@ public class IHLMod implements IFuelHandler{ { GregTech_API.sRecipeAdder.addPulveriserRecipe(pfaacobblelimestone, new ItemStack[] {IHLUtils.getOreDictItemStackWithSize("dustCalcite", 4)}, new int[] {10000}, 600, 30); } - List gypsumOreList3 = IHLUtils.getEntryListForOre("oreGypsum"); - Iterator oreListIterator3 = gypsumOreList3.iterator(); + List gypsumOreList3 = IHLUtils.getEntryListForOre("oreGypsum"); + Iterator oreListIterator3 = gypsumOreList3.iterator(); while (oreListIterator3.hasNext()) { - GregTech_API.sRecipeAdder.addPulveriserRecipe(((ItemStack)oreListIterator3.next()), new ItemStack[] {IHLUtils.getOreDictItemStack("dustGypsum")}, new int[] {10000}, 600, 30); + GregTech_API.sRecipeAdder.addPulveriserRecipe((oreListIterator3.next()), new ItemStack[] {IHLUtils.getOreDictItemStack("dustGypsum")}, new int[] {10000}, 600, 30); } GregTech_API.sRecipeAdder.addPulveriserRecipe(IHLUtils.getThisModItemStack("orePotassiumFeldspar"), new ItemStack[] {IHLUtils.getOreDictItemStack("dustPotassiumFeldspar")}, new int[] {10000}, 600, 30); GregTech_API.sRecipeAdder.addPulveriserRecipe(IHLUtils.getThisModItemStack("oreLimestone"), new ItemStack[] {IHLUtils.getOreDictItemStackWithSize("dustCalcite", 4)}, new int[] {10000}, 600, 30); @@ -1148,31 +1304,16 @@ public class IHLMod implements IFuelHandler{ private void loadGT6Recipes() { - ItemStack ac = IL.Circuit_Basic.get(1,(Object) null); - ItemStack cp = IL.Circuit_Primitive.get(1,(Object) null); ItemStack hull_mv = Ic2Items.advancedMachine; - ItemStack hull_lv = Ic2Items.advancedMachine; - ItemStack tc = OreDictManager.INSTANCE.getStack(OP.cableGt01,MT.Tin, 1); ItemStack gc = OreDictManager.INSTANCE.getStack(OP.cableGt08,MT.Gold, 1); ItemStack sc = OreDictManager.INSTANCE.getStack(OP.cableGt08,MT.Silver, 1); ItemStack ec = OreDictManager.INSTANCE.getStack(OP.cableGt08,MT.Electrum, 1); ItemStack lp = OreDictManager.INSTANCE.getStack(OP.plate,MT.Lazurite, 1); ItemStack sp = OreDictManager.INSTANCE.getStack(OP.plate,MT.Steel, 1); - ItemStack sr = OreDictManager.INSTANCE.getStack(OP.rod,MT.Steel, 1); - ItemStack ip = OreDictManager.INSTANCE.getStack(OP.plate,MT.Iron, 1); - ItemStack ir = OreDictManager.INSTANCE.getStack(OP.rod,MT.Iron, 1); - ItemStack is = OreDictManager.INSTANCE.getStack(OP.screw,MT.Iron, 1); - ItemStack cs = OreDictManager.INSTANCE.getStack(OP.screw,MT.Copper, 1); - ItemStack cr = OreDictManager.INSTANCE.getStack(OP.rod,MT.Copper, 1); - ItemStack pp = OreDictManager.INSTANCE.getStack(OP.ingot,MT.Plastic, 1); - ItemStack copper_plate = OreDictManager.INSTANCE.getStack(OP.plate,MT.Copper, 1); - ItemStack copper_framebox = OreDictManager.INSTANCE.getStack(OP.frameGt,MT.Copper, 1); ItemStack rotor_lv = OreDictManager.INSTANCE.getStack(OP.rotor,MT.Iron, 1); ItemStack rotor_mv = OreDictManager.INSTANCE.getStack(OP.rotor,MT.Aluminium, 1); ItemStack motor_lv = IL.Electric_Motor_LV.get(1,(Object) null); ItemStack motor_mv = IL.Electric_Motor_MV.get(1,(Object) null); - ItemStack piston_lv = IL.Electric_Piston_LV.get(1,(Object) null); - ItemStack roboarm_lv = IL.Robot_Arm_LV.get(1,(Object) null); ItemStack sensor_lv = IL.Sensor_LV.get(1,(Object) null); ItemStack sensor_mv = IL.Sensor_MV.get(1,(Object) null); ItemStack battery_lv_c = IL.Battery_RE_LV_Cadmium.get(1,(Object) null); @@ -1185,17 +1326,16 @@ public class IHLMod implements IFuelHandler{ ItemStack pump = IL.Electric_Pump_MV.get(1,(Object) null); ItemStack pump_hv = IL.Electric_Pump_HV.get(1,(Object) null); - List dsmInputs1 = new ArrayList(); - ItemStack gregtechfile = IHLUtils.getOtherModItemStackWithDamage("gregtech", "gt.metatool.01", 18); - dsmInputs1.add(new RecipeInputItemStack(gregtechfile)); - dsmInputs1.add(new RecipeInputOreDict("dustDiamond")); - dsmInputs1.add(new RecipeInputOreDict("dustGunpowder")); - DetonationSprayingMachineTileEntity.addRecipe((new UniversalRecipeInput(null,dsmInputs1)), new UniversalRecipeOutput(null, Arrays.asList(new ItemStack[] {gregtechfile.copy()}),2)); + IRecipeInput[] dsmInputs1 = new IRecipeInput[3]; + ItemStack gregtechfile = IHLUtils.getOtherModItemStackWithDamage("gregtech", "gt.metatool.01", 18,1); + dsmInputs1[0] = new RecipeInputItemStack(gregtechfile); + dsmInputs1[1] = new RecipeInputOreDict("dustDiamond"); + dsmInputs1[2] = new RecipeInputOreDict("dustGunpowder"); + DetonationSprayingMachineTileEntity.addRecipe((new UniversalRecipeInput(null,dsmInputs1)), new UniversalRecipeOutput(null, new ItemStack[] {gregtechfile.copy()},2)); if(IHLMod.config.enableRubberTreeSack) { long[] chances={10000,2000,2000,1000,100,0}; - long[] chances2={10000,10000,10000,5000,500,10000}; Recipe.RecipeMap.sCoagulatorRecipes.addRecipe( true, new ItemStack[] {}, diff --git a/ihl/IHLModConfig.java b/ihl/IHLModConfig.java index c22b580..c48acba 100644 --- a/ihl/IHLModConfig.java +++ b/ihl/IHLModConfig.java @@ -2,6 +2,7 @@ package ihl; import ic2.api.item.IC2Items; import ic2.api.recipe.IRecipeInput; +import ic2.api.recipe.RecipeInputFluidContainer; import ic2.api.recipe.RecipeInputItemStack; import ic2.api.recipe.RecipeInputOreDict; import ic2.core.util.StackUtil; @@ -33,8 +34,10 @@ import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraftforge.common.config.Configuration; import net.minecraftforge.common.config.Property; +import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import net.minecraft.nbt.NBTTagCompound; public class IHLModConfig { @@ -287,12 +290,12 @@ public class IHLModConfig recipeOutput=parameter; } } - List recipeInputsItems = new ArrayList(); - List recipeInputsTools = new ArrayList(); - List recipeInputsMachines = new ArrayList(); + List recipeInputsItems = new ArrayList(); + List recipeInputsTools = new ArrayList(); + List recipeInputsMachines = new ArrayList(); if(recipeInput!=null) { - List recipeInputsFluids = new ArrayList(); + List recipeInputsFluids = new ArrayList(); String[] rifunctionAndParameters = extractFunctionAndParameters(recipeInput); List riparameters = splitParameters(rifunctionAndParameters[1]); Iterator riparametersi=riparameters.iterator(); @@ -304,9 +307,18 @@ public class IHLModConfig { List riItemStackparameters = splitParameters(riItemFunctionAndParameters[1]); String[] modAndItemName = riItemStackparameters.get(0).split(":"); - ItemStack stack = IHLUtils.getOtherModItemStackWithDamage(modAndItemName[0], modAndItemName[1], Integer.parseInt(riItemStackparameters.get(2))); - stack.stackSize = Integer.parseInt(riItemStackparameters.get(1)); - recipeInputsItems.add(new RecipeInputItemStack(stack,stack.stackSize)); + int iDamage = 0; + int iQuantity = Integer.parseInt(riItemStackparameters.get(1)); + String sDamage = riItemStackparameters.get(2); + if(sDamage.startsWith("hash")) + { + iDamage=extractFunctionAndParameters(sDamage)[1].hashCode() & Integer.MAX_VALUE; + } + else + { + iDamage=Integer.parseInt(sDamage); + } + recipeInputsItems.add(new RecipeInputItemStack(IHLUtils.getOtherModItemStackWithDamage(modAndItemName[0], modAndItemName[1], iDamage, iQuantity),iQuantity)); } else if(riItemFunctionAndParameters[0].startsWith("die")) { @@ -334,18 +346,27 @@ public class IHLModConfig List riItemStackparameters = splitParameters(riItemFunctionAndParameters[1]); recipeInputsItems.add(new RecipeInputOreDict(riItemStackparameters.get(0),Integer.parseInt(riItemStackparameters.get(1)))); } + else if(riItemFunctionAndParameters[0].startsWith("fluidcontainer")) + { + List riItemStackparameters = splitParameters(riItemFunctionAndParameters[1]); + recipeInputsItems.add(new RecipeInputFluidContainer(FluidRegistry.getFluid(riItemStackparameters.get(0)),Integer.parseInt(riItemStackparameters.get(1)))); + } else if(riItemFunctionAndParameters[0].startsWith("toolitemstack")) { List riItemStackparameters = splitParameters(riItemFunctionAndParameters[1]); String[] modAndItemName = riItemStackparameters.get(0).split(":"); - ItemStack stack = IHLUtils.getOtherModItemStackWithDamage(modAndItemName[0], modAndItemName[1], Integer.parseInt(riItemStackparameters.get(2))); - stack.stackSize = Integer.parseInt(riItemStackparameters.get(1)); + ItemStack stack = IHLUtils.getOtherModItemStackWithDamage(modAndItemName[0], modAndItemName[1], Integer.parseInt(riItemStackparameters.get(2)), Integer.parseInt(riItemStackparameters.get(1))); + stack.stackTagCompound = new NBTTagCompound(); + NBTTagCompound gtTagCompound = new NBTTagCompound(); + gtTagCompound.setInteger("Damage",0); + gtTagCompound.setInteger("MaxDamage",2000); + stack.stackTagCompound.setTag("GT.ToolStats", gtTagCompound); recipeInputsTools.add(new RecipeInputItemStack(stack,stack.stackSize)); } else if(riItemFunctionAndParameters[0].startsWith("tooloredict")) { - List riItemStackparameters = splitParameters(riItemFunctionAndParameters[1]); - recipeInputsTools.add(new RecipeInputOreDict(riItemStackparameters.get(0),Integer.parseInt(riItemStackparameters.get(1)))); + recipeInputsTools.add(new RecipeInputOreDict(splitParameters(riItemFunctionAndParameters[1]).get(0))); + } else if(riItemFunctionAndParameters[0].startsWith("machine")) { @@ -359,13 +380,13 @@ public class IHLModConfig recipeInputsFluids.add(IHLUtils.getFluidStackWithSize(riFluidStackparameters.get(0),Integer.parseInt(riFluidStackparameters.get(1)))); } } - uRecipeInput = new UniversalRecipeInput(recipeInputsFluids,recipeInputsItems); + uRecipeInput = new UniversalRecipeInput(recipeInputsFluids.toArray(),recipeInputsItems.toArray()); } - List recipeOutputsItems = new ArrayList(); - List recipeOutputsRecipeOut = new ArrayList(); + List recipeOutputsItems = new ArrayList(); + List recipeOutputsRecipeOut = new ArrayList(); if(recipeOutput!=null) { - List recipeOutputsFluids = new ArrayList(); + List recipeOutputsFluids = new ArrayList(); String[] rifunctionAndParameters = extractFunctionAndParameters(recipeOutput); List riparameters = splitParameters(rifunctionAndParameters[1]); Iterator riparametersi=riparameters.iterator(); @@ -377,31 +398,49 @@ public class IHLModConfig { List riItemStackparameters = splitParameters(riItemFunctionAndParameters[1]); String[] modAndItemName = riItemStackparameters.get(0).split(":"); - ItemStack stack = IHLUtils.getOtherModItemStackWithDamage(modAndItemName[0], modAndItemName[1], Integer.parseInt(riItemStackparameters.get(2))); - stack.stackSize = Integer.parseInt(riItemStackparameters.get(1)); + String sDamage = riItemStackparameters.get(2); + int iDamage = 0; + if(sDamage.startsWith("hash")) + { + iDamage=extractFunctionAndParameters(sDamage)[1].hashCode() & Integer.MAX_VALUE; + } + else + { + iDamage=Integer.parseInt(sDamage); + } + ItemStack stack = IHLUtils.getOtherModItemStackWithDamage(modAndItemName[0], modAndItemName[1], iDamage,Integer.parseInt(riItemStackparameters.get(1))); + if(stack==null) + { + throw new java.lang.IllegalArgumentException("Item not found: "+parameter); + } + if(riItemStackparameters.size()>3){ + stack.stackTagCompound = new NBTTagCompound(); + String[] fp = extractFunctionAndParameters(riItemStackparameters.get(3)); + Iterator iparams2 = splitParameters(fp[1]).iterator(); + while(iparams2.hasNext()){ + decodeNBT(iparams2.next(), stack.stackTagCompound); + } + } recipeOutputsItems.add(stack); - recipeOutputsRecipeOut.add(new RecipeOutputItemStack(stack,Float.parseFloat(riItemStackparameters.get(1)))); + recipeOutputsRecipeOut.add(new RecipeOutputItemStack(stack.copy(),Float.parseFloat(riItemStackparameters.get(1)))); } else if(riItemFunctionAndParameters[0].startsWith("fiber")) { List riItemStackparameters = splitParameters(riItemFunctionAndParameters[1]); - ItemStack stack = IHLUtils.getThisModWireItemStackWithLength(riItemStackparameters.get(0), Integer.parseInt(riItemStackparameters.get(1))); - recipeOutputsItems.add(stack); - recipeOutputsRecipeOut.add(new RecipeOutputItemStack(stack,1)); + recipeOutputsItems.add(IHLUtils.getThisModWireItemStackWithLength(riItemStackparameters.get(0), Integer.parseInt(riItemStackparameters.get(1)))); + recipeOutputsRecipeOut.add(new RecipeOutputItemStack(IHLUtils.getThisModWireItemStackWithLength(riItemStackparameters.get(0), Integer.parseInt(riItemStackparameters.get(1))),1)); } else if(riItemFunctionAndParameters[0].startsWith("wire")) { List riItemStackparameters = splitParameters(riItemFunctionAndParameters[1]); - ItemStack stack = IHLUtils.getUninsulatedWire(riItemStackparameters.get(0), Integer.parseInt(riItemStackparameters.get(1)), Integer.parseInt(riItemStackparameters.get(2))); - recipeOutputsItems.add(stack); - recipeOutputsRecipeOut.add(new RecipeOutputItemStack(stack,1)); + recipeOutputsItems.add(IHLUtils.getUninsulatedWire(riItemStackparameters.get(0), Integer.parseInt(riItemStackparameters.get(1)), Integer.parseInt(riItemStackparameters.get(2)))); + recipeOutputsRecipeOut.add(new RecipeOutputItemStack(IHLUtils.getUninsulatedWire(riItemStackparameters.get(0), Integer.parseInt(riItemStackparameters.get(1)), Integer.parseInt(riItemStackparameters.get(2))),1)); } else if(riItemFunctionAndParameters[0].startsWith("cable")) { List riItemStackparameters = splitParameters(riItemFunctionAndParameters[1]); - ItemStack stack = IHLUtils.getInsulatedWire(riItemStackparameters.get(0), Integer.parseInt(riItemStackparameters.get(1)), Integer.parseInt(riItemStackparameters.get(2)),riItemStackparameters.get(3),Integer.parseInt(riItemStackparameters.get(4))); - recipeOutputsItems.add(stack); - recipeOutputsRecipeOut.add(new RecipeOutputItemStack(stack,1)); + recipeOutputsItems.add(IHLUtils.getInsulatedWire(riItemStackparameters.get(0), Integer.parseInt(riItemStackparameters.get(1)), Integer.parseInt(riItemStackparameters.get(2)),riItemStackparameters.get(3),Integer.parseInt(riItemStackparameters.get(4)))); + recipeOutputsRecipeOut.add(new RecipeOutputItemStack(IHLUtils.getInsulatedWire(riItemStackparameters.get(0), Integer.parseInt(riItemStackparameters.get(1)), Integer.parseInt(riItemStackparameters.get(2)),riItemStackparameters.get(3),Integer.parseInt(riItemStackparameters.get(4))),1)); } else if(riItemFunctionAndParameters[0].startsWith("fluidstack")) { @@ -422,6 +461,10 @@ public class IHLModConfig UniversalRecipeManager.machineRecipeManagers.get(machineName).addRecipe(uRecipeInput, uRecipeOutput); } } + else if(action.equalsIgnoreCase("addcasting")) + { + IHLMod.moltenAmounts.put(parameters.get(0),Integer.parseInt(parameters.get(1))); + } else if(action.equalsIgnoreCase("removerecipe")) { if(machineName.equalsIgnoreCase("ironworkbench")) @@ -449,48 +492,70 @@ public class IHLModConfig } } - private List splitParameters(String string) { - ArrayList result = new ArrayList(); + private void decodeNBT(String string, NBTTagCompound out) { + String[] fp = extractFunctionAndParameters(string); + List params = splitParameters(fp[1]); + if(fp[0].equalsIgnoreCase("string")){ + out.setString(params.get(0), params.get(1)); + } + else if(fp[0].equalsIgnoreCase("boolean")){ + out.setBoolean(params.get(0), Boolean.getBoolean(params.get(1))); + } + else if(fp[0].equalsIgnoreCase("float")){ + out.setFloat(params.get(0), Float.parseFloat(params.get(1))); + } + else if(fp[0].equalsIgnoreCase("double")){ + out.setDouble(params.get(0), Double.parseDouble(params.get(1))); + } + else if(fp[0].equalsIgnoreCase("integer")){ + out.setInteger(params.get(0), Integer.parseInt(params.get(1))); + } + else if(fp[0].equalsIgnoreCase("long")){ + out.setLong(params.get(0), Long.parseLong(params.get(1))); + } + else if(fp[0].equalsIgnoreCase("nbt")){ + NBTTagCompound out2 = new NBTTagCompound(); + for(int i = 1; i < params.size(); i++){ + decodeNBT(params.get(i), out2); + } + out.setTag(params.get(0), out2); + } + } + + + + private List splitParameters(String string) { + ArrayList result = new ArrayList(); int bracketCounter=0; boolean modificatorStart=false; - String function = null; - String parameters = null; StringBuffer currentModificator = new StringBuffer(""); for(int i=0;i entityList = new HashMap(); - protected Set entityServerList = new HashSet(); - protected Map delayedEntityDataPacket = new HashMap(); - public Map> nodeEntityRegistry = new HashMap(); + protected Map entityList = new HashMap(); + protected Set entityServerList = new HashSet(); + protected Map delayedEntityDataPacket = new HashMap(); + public Map> nodeEntityRegistry = new HashMap>(); public ServerProxy() {} @@ -90,6 +84,48 @@ public class ServerProxy { } } + public void playSoundEffectFromServer(int soundId, World world, double x, double y, double z, float volume, float pitch) + { + ByteBuf bb = Unpooled.buffer(36); + ByteBufOutputStream byteBufOutputStream = new ByteBufOutputStream(bb); + try + { + byteBufOutputStream.write(3); + byteBufOutputStream.write(soundId); + byteBufOutputStream.writeFloat((float) x); + byteBufOutputStream.writeFloat((float) y); + byteBufOutputStream.writeFloat((float) z); + byteBufOutputStream.writeFloat(volume); + byteBufOutputStream.writeFloat(pitch); + channel.sendToAllAround(new FMLProxyPacket(byteBufOutputStream.buffer(),IHLModInfo.MODID), new TargetPoint(world.provider.dimensionId, x, y, z, volume+32d)); + byteBufOutputStream.close(); + } + catch (IOException e) + { + e.printStackTrace(); + } + } + + public void createExplosionEffectFromServer(World world, int x, int y, int z, float radius) + { + ByteBuf bb = Unpooled.buffer(36); + ByteBufOutputStream byteBufOutputStream = new ByteBufOutputStream(bb); + try + { + byteBufOutputStream.write(2); + byteBufOutputStream.writeInt(x); + byteBufOutputStream.writeInt(y); + byteBufOutputStream.writeInt(z); + byteBufOutputStream.writeFloat(radius); + channel.sendToAllAround(new FMLProxyPacket(byteBufOutputStream.buffer(),IHLModInfo.MODID), new TargetPoint(world.provider.dimensionId, x, y, z, radius+32d)); + byteBufOutputStream.close(); + } + catch (IOException e) + { + e.printStackTrace(); + } + } + public void registerIcons(Pre event) {} public void initBlockRenderer(){} public Object getRenderForEntityClass(Class entityClass) @@ -163,7 +199,22 @@ public class ServerProxy { ItemStack stack = ((Slot)player.openContainer.inventorySlots.get(containerSlotNumber)).getStack(); stack.stackTagCompound.setInteger(fieldName, fieldValue); player.openContainer.detectAndSendChanges(); - System.out.println("Field now "+stack.stackTagCompound.getInteger(fieldName)); + break; + case 1: + playerEntityId = byteBufInputStream.readInt(); + worldDimensionId = byteBufInputStream.readInt(); + int x = byteBufInputStream.readInt(); + int y = byteBufInputStream.readInt(); + int z = byteBufInputStream.readInt(); + World world = MinecraftServer.getServer().worldServerForDimension(worldDimensionId); + TileEntity te = world.getTileEntity(x, y, z); + if(te!=null && !te.isInvalid()) + { + NBTTagCompound nbt = new NBTTagCompound(); + te.writeToNBT(nbt); + player = (EntityPlayerMP) world.getEntityByID(playerEntityId); + player.playerNetServerHandler.sendPacket(new S35PacketUpdateTileEntity(x,y,z,6,nbt)); + } break; } @@ -219,4 +270,31 @@ public class ServerProxy { } public void sendItemStackNBTTagFromClientToServerPlayer(EntityPlayer player, int slotNumber, String fieldName, int fieldValue){} + + public void createExplosionEffect(World world, int x, int y, int z, float radius){} + + public void requestTileEntityInitdataFromClientToServer(int x, int y, int z){} + + public void sendChunksLightUpdateQuery(World world, int x, int y, int z, Set clientSideChunkXZKeySet) + { + int chunkNum = clientSideChunkXZKeySet.size(); + ByteBuf bb = Unpooled.buffer(8+(chunkNum<<3)); + ByteBufOutputStream byteBufOutputStream = new ByteBufOutputStream(bb); + try + { + byteBufOutputStream.write(4); + byteBufOutputStream.write(chunkNum); + Iterator cluI = clientSideChunkXZKeySet.iterator(); + while(cluI.hasNext()) + { + byteBufOutputStream.writeLong(cluI.next()); + } + channel.sendToAllAround(new FMLProxyPacket(byteBufOutputStream.buffer(),IHLModInfo.MODID), new TargetPoint(world.provider.dimensionId, x, y, z, 256d)); + byteBufOutputStream.close(); + } + catch (IOException e) + { + e.printStackTrace(); + } + } } diff --git a/ihl/collector/ChargerEjectorContainer.java b/ihl/collector/ChargerEjectorContainer.java index 8d18998..372f4c5 100644 --- a/ihl/collector/ChargerEjectorContainer.java +++ b/ihl/collector/ChargerEjectorContainer.java @@ -7,13 +7,13 @@ import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -public class ChargerEjectorContainer extends ContainerBase { +public class ChargerEjectorContainer extends ContainerBase { protected ChargerEjectorTileEntity tileEntity; public int lastStorage = -1; private final static int height=166; - public ChargerEjectorContainer(EntityPlayer entityPlayer, ChargerEjectorTileEntity tileEntity1){ + public ChargerEjectorContainer(EntityPlayer entityPlayer, ChargerEjectorTileEntity tileEntity1){ super(tileEntity1); this.tileEntity = tileEntity1; int col; @@ -55,7 +55,6 @@ public class ChargerEjectorContainer extends ContainerBase { icrafting.sendProgressBarUpdate(this, 0, (this.tileEntity.getStored()>>15) & Short.MAX_VALUE); icrafting.sendProgressBarUpdate(this, 1, (short)(this.tileEntity.getStored() & Short.MAX_VALUE)); } - short st = Short.MAX_VALUE; } this.lastStorage = this.tileEntity.getStored(); diff --git a/ihl/collector/ChargerEjectorGui.java b/ihl/collector/ChargerEjectorGui.java index 79a0c0c..1836dc9 100644 --- a/ihl/collector/ChargerEjectorGui.java +++ b/ihl/collector/ChargerEjectorGui.java @@ -10,7 +10,6 @@ import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; import org.lwjgl.opengl.GL11; -import ic2.core.network.NetworkManager; import ic2.core.util.GuiTooltipHelper; @SideOnly(Side.CLIENT) @@ -30,7 +29,8 @@ public class ChargerEjectorGui extends GuiContainer { this.container=container1; } - @Override + @SuppressWarnings("unchecked") + @Override public void initGui() { super.initGui(); diff --git a/ihl/collector/ChargerEjectorTileEntity.java b/ihl/collector/ChargerEjectorTileEntity.java index fdb18ed..cda75f4 100644 --- a/ihl/collector/ChargerEjectorTileEntity.java +++ b/ihl/collector/ChargerEjectorTileEntity.java @@ -26,7 +26,6 @@ import ic2.core.IHasGui; import ic2.core.block.TileEntityInventory; import ic2.core.block.invslot.InvSlot; import ic2.core.block.invslot.InvSlot.Access; -import ic2.core.network.NetworkManager; import ihl.IHLMod; import ihl.utils.IHLInvSlotDischarge; @@ -184,7 +183,7 @@ public class ChargerEjectorTileEntity extends TileEntityInventory implements IEn List eItemsList = this.getEItemsList(); if(eItemsList!=null && eItemsList.size()>0) { - Iterator ei = eItemsList.iterator(); + Iterator ei = eItemsList.iterator(); while(ei.hasNext()) { EntityItem entity=(EntityItem) ei.next(); @@ -413,7 +412,8 @@ public class ChargerEjectorTileEntity extends TileEntityInventory implements IEn } } - protected List getEItemsList() + @SuppressWarnings("unchecked") + protected List getEItemsList() { double range = 0.2D; AxisAlignedBB searchArea = AxisAlignedBB.getBoundingBox(this.xCoord-range,this.yCoord,this.zCoord-range,this.xCoord+1.0D+range,this.yCoord+1.0D+range,this.zCoord+1.0D+range); @@ -477,6 +477,7 @@ public class ChargerEjectorTileEntity extends TileEntityInventory implements IEn } } + @SuppressWarnings("unchecked") private void callCollectors() { double range = 64D; diff --git a/ihl/collector/CollectorEntity.java b/ihl/collector/CollectorEntity.java index ed0a163..55e89c8 100644 --- a/ihl/collector/CollectorEntity.java +++ b/ihl/collector/CollectorEntity.java @@ -44,14 +44,13 @@ public class CollectorEntity extends EntityFlying { public double waypointY; public double waypointZ; private IHL3dPathFinder pathFinder3D; - private int stuckCooldown=0; private boolean clientSideNeedEnergyUpdate = true; public int hopperx; public int hoppery; public int hopperz; protected int energyConsume=1; protected Item thisItem=IHLMod.collectorItem; - protected List eItemIgnoreList = new ArrayList(); + protected List eItemIgnoreList = new ArrayList(); public Tasks currentTask=Tasks.IDLE; private int teUpdateTimer = 0; private double[] last5TickPosX = new double[5]; @@ -145,7 +144,8 @@ public class CollectorEntity extends EntityFlying { return !this.isDead; } - @Override + @SuppressWarnings("unchecked") + @Override public void onUpdate() { super.onUpdate(); @@ -186,7 +186,7 @@ public class CollectorEntity extends EntityFlying { if(this.charger==null && teUpdateTimer==20) { List teList = this.worldObj.loadedTileEntityList; - Iterator teIterator=teList.iterator(); + Iterator teIterator=teList.iterator(); while(teIterator.hasNext()) { TileEntity te = (TileEntity) teIterator.next(); @@ -283,7 +283,7 @@ public class CollectorEntity extends EntityFlying { if(this.hopper==null && teUpdateTimer==10) { List teList = this.worldObj.loadedTileEntityList; - Iterator teIterator=teList.iterator(); + Iterator teIterator=teList.iterator(); while(teIterator.hasNext()) { TileEntity te = (TileEntity) teIterator.next(); @@ -450,7 +450,7 @@ public class CollectorEntity extends EntityFlying { } else { - Iterator ei = eItemsList.iterator(); + Iterator ei = eItemsList.iterator(); while(ei.hasNext()) { EntityItem newTarget=(EntityItem) ei.next(); @@ -583,30 +583,6 @@ public class CollectorEntity extends EntityFlying { return false; } - /** - * True if the ghast has an unobstructed line of travel to the waypoint. - */ - private boolean isCourseTraversable(double par1, double par3, double par5, double par7) - { - double var9 = (par1 - this.posX) / par7; - double var11 = (par3 - this.posY) / par7; - double var13 = (par5 - this.posZ) / par7; - AxisAlignedBB var15 = this.boundingBox.copy(); - - for (int var16 = 1; var16 < par7; ++var16) - { - var15.offset(var9, var11, var13); - - if (!this.worldObj.getCollidingBoundingBoxes(this, var15).isEmpty()) - { - return false; - } - } - - return true; - } - - public int getStored() { return this.energy; @@ -616,37 +592,21 @@ public class CollectorEntity extends EntityFlying { { this.energy=value; } - - private double mov(double motion) - { - double max=0.1D; - if(motion>max) - { - return max; - } - else if(motion<-max) - { - return -max; - } - else - { - return 0D; - } - } public ItemStack getVisibleItemStack() { return this.dataWatcher.getWatchableObjectItemStack(18); } - private void harvest() + @SuppressWarnings("unchecked") + private void harvest() { double range = 1D; AxisAlignedBB searchArea = AxisAlignedBB.getBoundingBox(this.posX-range,this.posY-range-1D,this.posZ-range,this.posX+range,this.posY+range,this.posZ+range); List eItemsList = this.worldObj.getEntitiesWithinAABB(EntityItem.class, searchArea); if(eItemsList!=null && eItemsList.size()>0) { - Iterator itemIterator = eItemsList.iterator(); + Iterator itemIterator = eItemsList.iterator(); while(itemIterator.hasNext()) { EntityItem eItem = (EntityItem) itemIterator.next(); @@ -937,7 +897,8 @@ public class CollectorEntity extends EntityFlying { this.setDead(); } - protected List getEItemsList() + @SuppressWarnings("unchecked") + protected List getEItemsList() { double range = 32D; AxisAlignedBB searchArea = AxisAlignedBB.getBoundingBox(this.lastItemX-range,this.lastItemY-range,this.lastItemZ-range,this.lastItemX+range,this.lastItemY+range,this.lastItemZ+range); diff --git a/ihl/collector/CollectorItem.java b/ihl/collector/CollectorItem.java index 67d7914..b4496fa 100644 --- a/ihl/collector/CollectorItem.java +++ b/ihl/collector/CollectorItem.java @@ -163,13 +163,14 @@ public class CollectorItem extends Item implements IElectricItem, IItemHudInfo { @Override public List getHudInfo(ItemStack itemStack) { - LinkedList info = new LinkedList(); + LinkedList info = new LinkedList(); info.add(ElectricItem.manager.getToolTip(itemStack)); info.add("Power Tier: " + this.tier); return info; } - @Override + @Override + @SuppressWarnings({ "rawtypes", "unchecked" }) public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean b) { info.add("PowerTier: " + this.tier); @@ -177,6 +178,7 @@ public class CollectorItem extends Item implements IElectricItem, IItemHudInfo { @Override @SideOnly(Side.CLIENT) + @SuppressWarnings({ "rawtypes", "unchecked" }) public void getSubItems(Item item, CreativeTabs tabs, List itemList) { itemList.add(this.getItemStack(this.maxCharge)); diff --git a/ihl/collector/GlassBoxContainer.java b/ihl/collector/GlassBoxContainer.java index 1ad7be7..8f6e52a 100644 --- a/ihl/collector/GlassBoxContainer.java +++ b/ihl/collector/GlassBoxContainer.java @@ -5,7 +5,7 @@ import ic2.core.slot.SlotInvSlot; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.Slot; -public class GlassBoxContainer extends ContainerBase { +public class GlassBoxContainer extends ContainerBase { protected GlassBoxTileEntity tileEntity; public int lastStorage = -1; diff --git a/ihl/collector/GlassBoxGui.java b/ihl/collector/GlassBoxGui.java index 4e09187..2210d06 100644 --- a/ihl/collector/GlassBoxGui.java +++ b/ihl/collector/GlassBoxGui.java @@ -5,15 +5,12 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; - import org.lwjgl.opengl.GL11; @SideOnly(Side.CLIENT) public class GlassBoxGui extends GuiContainer { private static final ResourceLocation background = new ResourceLocation("ihl", "textures/gui/GUIGlassBox.png"); private GlassBoxContainer container; - private String title = StatCollector.translateToLocal("ihl.gui.charger_ejector"); public GlassBoxGui (GlassBoxContainer container1) { //the container is instanciated and passed to the superclass for handling @@ -21,14 +18,6 @@ public class GlassBoxGui extends GuiContainer { this.container=container1; } - @Override - public void initGui() - { - super.initGui(); - int x = (width - xSize) / 2; - int y = (height - ySize) / 2; - } - @Override protected void drawGuiContainerForegroundLayer(int param1, int param2) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); diff --git a/ihl/collector/GlassBoxRender.java b/ihl/collector/GlassBoxRender.java index 764314d..305c6bd 100644 --- a/ihl/collector/GlassBoxRender.java +++ b/ihl/collector/GlassBoxRender.java @@ -24,12 +24,10 @@ public class GlassBoxRender extends TileEntitySpecialRenderer { double x, double y, double z, float par8) { GL11.glPushMatrix(); GL11.glTranslatef((float)x + 0.5F, (float)y+0.5F, (float)z + 0.5F); - float rotation=0F; for(int i=0;i eItemList = new ArrayList(); + List eItemList = new ArrayList(); for(int i=0;i getEItemsList() + @SuppressWarnings("unchecked") + protected List getEItemsList() { double range = 0.2D; AxisAlignedBB searchArea = AxisAlignedBB.getBoundingBox(this.xCoord,this.yCoord,this.zCoord,this.xCoord+1.0D,this.yCoord+1.0D+range,this.zCoord+1.0D); diff --git a/ihl/crop_harvestors/BlowerBlock.java b/ihl/crop_harvestors/BlowerBlock.java index 9d4c782..3ec49b7 100644 --- a/ihl/crop_harvestors/BlowerBlock.java +++ b/ihl/crop_harvestors/BlowerBlock.java @@ -147,7 +147,6 @@ public class BlowerBlock extends Block implements ITileEntityProvider{ @SideOnly(Side.CLIENT) public IIcon getIcon(int side, int meta) { - IIcon sideIcon = this.blockIcon; switch (side) { case 0: diff --git a/ihl/crop_harvestors/BlowerContainer.java b/ihl/crop_harvestors/BlowerContainer.java index 65393bf..2a64488 100644 --- a/ihl/crop_harvestors/BlowerContainer.java +++ b/ihl/crop_harvestors/BlowerContainer.java @@ -6,7 +6,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; -public class BlowerContainer extends ContainerBase { +public class BlowerContainer extends ContainerBase { protected BlowerTileEntity tileEntity; public int lastStorage = -1; diff --git a/ihl/crop_harvestors/BlowerGui.java b/ihl/crop_harvestors/BlowerGui.java index f74ac51..bedee1f 100644 --- a/ihl/crop_harvestors/BlowerGui.java +++ b/ihl/crop_harvestors/BlowerGui.java @@ -20,14 +20,6 @@ public class BlowerGui extends GuiContainer { this.container=container1; } - @Override - public void initGui() - { - super.initGui(); - int x = (width - xSize) / 2; - int y = (height - ySize) / 2; - } - @Override protected void drawGuiContainerForegroundLayer(int param1, int param2) { //the parameters for drawString are: string, x, y, color diff --git a/ihl/crop_harvestors/BlowerTileEntity.java b/ihl/crop_harvestors/BlowerTileEntity.java index 1c06f6c..e26632b 100644 --- a/ihl/crop_harvestors/BlowerTileEntity.java +++ b/ihl/crop_harvestors/BlowerTileEntity.java @@ -4,7 +4,6 @@ import java.util.ArrayList; import java.util.HashSet; import java.util.Iterator; import java.util.List; -import java.util.Random; import java.util.Set; import cpw.mods.fml.relauncher.Side; @@ -34,7 +33,6 @@ import ic2.core.block.TileEntityInventory; import ic2.core.block.invslot.InvSlot; import ic2.core.block.invslot.InvSlotUpgrade; import ic2.core.block.invslot.InvSlot.Access; -import ic2.core.network.NetworkManager; import ic2.core.upgrade.IUpgradableBlock; import ic2.core.upgrade.UpgradableProperty; import ihl.IHLMod; @@ -52,16 +50,13 @@ public class BlowerTileEntity extends TileEntityInventory implements IEnergySink private double energyConsume=5D; private int defaultAirSpeedBase=100; public int airSpeedBase=100; - private boolean shouldCalculateAirFlow=true; private int sCAFCount=0; public boolean addedToEnergyNet = false; - private boolean hasEntityInFlow=false; - private ArrayList aszlist = new ArrayList(); + private ArrayList aszlist = new ArrayList(); public final InvSlotUpgrade upgradeSlot; public final IHLInvSlotDischarge dischargeSlot; public int updateChecksum=-1; private final float lambda=0.00001F; - private Random rand = new Random(); public int operationRange=-1; public int lastOperationRange=0; @@ -254,7 +249,8 @@ public class BlowerTileEntity extends TileEntityInventory implements IEnergySink } - @Override + @SuppressWarnings("unchecked") + @Override public void updateEntityServer() { @@ -650,12 +646,7 @@ public class BlowerTileEntity extends TileEntityInventory implements IEnergySink return false; } } - - private boolean isCNE(int x,int y,int z,int x1,int y1,int z1) - { - return x!=x1||y!=y1||z!=z1; - } - + private boolean isAirPassable(int x,int y,int z) { Block block = worldObj.getBlock(x,y,z); diff --git a/ihl/crop_harvestors/RubberTreeBlock.java b/ihl/crop_harvestors/RubberTreeBlock.java index bb2128b..9cfdea1 100644 --- a/ihl/crop_harvestors/RubberTreeBlock.java +++ b/ihl/crop_harvestors/RubberTreeBlock.java @@ -69,7 +69,6 @@ public class RubberTreeBlock extends Block{ @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister par1IconRegister) { - ItemStack result; switch(type) { case RUBBERTREE: @@ -120,7 +119,6 @@ public class RubberTreeBlock extends Block{ @SideOnly(Side.CLIENT) public IIcon getIcon(int side, int meta) { - IIcon sideIcon = this.blockIcon; switch (side) { case 0: diff --git a/ihl/crop_harvestors/SackBlock.java b/ihl/crop_harvestors/SackBlock.java index 78a5735..abf8c46 100644 --- a/ihl/crop_harvestors/SackBlock.java +++ b/ihl/crop_harvestors/SackBlock.java @@ -43,6 +43,7 @@ public class SackBlock extends Block implements ITileEntityProvider{ this.blockIcon = par1IconRegister.registerIcon(IHLModInfo.MODID + ":sackItem"); } + @SuppressWarnings("rawtypes") @Override public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB aabb, List list, Entity entity) { diff --git a/ihl/crop_harvestors/SackTileEntity.java b/ihl/crop_harvestors/SackTileEntity.java index 9704b7f..69418d8 100644 --- a/ihl/crop_harvestors/SackTileEntity.java +++ b/ihl/crop_harvestors/SackTileEntity.java @@ -17,9 +17,9 @@ import net.minecraftforge.fluids.FluidTankInfo; import net.minecraftforge.fluids.IFluidHandler; import ic2.core.IC2; import ic2.core.block.TileEntityInventory; -import ic2.core.network.NetworkManager; import ihl.IHLMod; import ihl.utils.IHLFluidTank; +import ihl.utils.IHLUtils; public class SackTileEntity extends TileEntityInventory implements IFluidHandler { @@ -307,7 +307,7 @@ public class SackTileEntity extends TileEntityInventory implements IFluidHandler meta=worldObj.getBlockMetadata(xCoord+mX(), yCoord-h, zCoord+mZ()); if(!isLogBlock(block, meta)) { - if(block==Blocks.dirt) + if(IHLUtils.isBlockRegisteredInOreDictionaryAs(block, "blockDirt")) { return true; } diff --git a/ihl/datanet/Contact.java b/ihl/datanet/Contact.java index 3d5b6af..5dce365 100644 --- a/ihl/datanet/Contact.java +++ b/ihl/datanet/Contact.java @@ -20,7 +20,7 @@ public class Contact implements IDataNode { public final int innerId; private int dataGridID=-1; - private Set connectedContacts = new HashSet(); + private Set connectedContacts = new HashSet(8); public final InvSlotSignalProcessor attachedSlot; public final int attachedSlotNumber; public final int type; //Free:-1; A1:0; A2:1; C:2; NO:3; NC:4; diff --git a/ihl/datanet/DataCableItem.java b/ihl/datanet/DataCableItem.java index d8bce25..c8349ca 100644 --- a/ihl/datanet/DataCableItem.java +++ b/ihl/datanet/DataCableItem.java @@ -1,7 +1,6 @@ package ihl.datanet; import java.util.HashMap; -import java.util.Iterator; import java.util.List; import java.util.Map; @@ -10,35 +9,24 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTBase; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.IIcon; -import net.minecraft.util.MathHelper; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.util.Vec3; import net.minecraft.world.World; -import ihl.IHLCreativeTab; -import ihl.IHLMod; import ihl.IHLModInfo; import ihl.flexible_cable.NodeEntity; -import ihl.flexible_cable.PowerCableNodeEntity; import ihl.interfaces.IDataCableHolder; -import ihl.interfaces.IEnergyNetNode; -import ihl.interfaces.IWire; import ihl.items_blocks.FlexibleCableItem; import ihl.utils.IHLUtils; public class DataCableItem extends FlexibleCableItem { - private static Map iconMap = new HashMap(); - private static Map nameMap = new HashMap(); - private static Map descriptionMap = new HashMap(); + private static Map iconMap = new HashMap(); + private static Map nameMap = new HashMap(); + private static Map descriptionMap = new HashMap(); public static DataCableItem dataCableInstance; public DataCableItem() @@ -49,6 +37,7 @@ public class DataCableItem extends FlexibleCableItem { dataCableInstance=this; } + @SuppressWarnings({ "unchecked", "rawtypes" }) @Override @SideOnly(Side.CLIENT) public void getSubItems(Item item, CreativeTabs tabs, List itemList) @@ -121,7 +110,8 @@ public class DataCableItem extends FlexibleCableItem { } - @Override + @SuppressWarnings({ "rawtypes", "unchecked" }) + @Override public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean flag) { if(itemStack.stackTagCompound!=null) diff --git a/ihl/datanet/DataGrid.java b/ihl/datanet/DataGrid.java index 2c577b0..0f4f9f9 100644 --- a/ihl/datanet/DataGrid.java +++ b/ihl/datanet/DataGrid.java @@ -8,20 +8,13 @@ import java.util.Set; public class DataGrid { - public final Set telist = new HashSet(); + public final Set telist = new HashSet(); public double energy=0D; - private IDataNode sink; - private IDataNode source; - private double voltage; - private short frequency=0; - private double lastVoltage; public boolean isGridValid=true; - private double total20TicksEU; - private int lastTickCounter=0; public Set getListOfExcludedNodes() { - Set excludedNodes = new HashSet(); + Set excludedNodes = new HashSet(); if(this.telist.isEmpty()) { return excludedNodes; diff --git a/ihl/datanet/DataNet.java b/ihl/datanet/DataNet.java index 3f88c55..a241517 100644 --- a/ihl/datanet/DataNet.java +++ b/ihl/datanet/DataNet.java @@ -13,7 +13,7 @@ import net.minecraft.nbt.NBTTagCompound; public class DataNet { - public Map grids = new HashMap(); + public Map grids = new HashMap(); private int griduid=0; public DataNet() diff --git a/ihl/datanet/GuiInvisibleButton.java b/ihl/datanet/GuiInvisibleButton.java index 2222859..31e8b3f 100644 --- a/ihl/datanet/GuiInvisibleButton.java +++ b/ihl/datanet/GuiInvisibleButton.java @@ -8,6 +8,7 @@ import net.minecraft.client.gui.GuiButton; public class GuiInvisibleButton extends GuiButton { + @SuppressWarnings({ "rawtypes", "unchecked" }) public GuiInvisibleButton(int id1, int x, int y, int w, int h, Map linksCoordinatesMap, List buttonList) { super(id1, x, y, w, h, ""); diff --git a/ihl/datanet/RedstoneSignalConverterContainer.java b/ihl/datanet/RedstoneSignalConverterContainer.java index c075b38..261c9d5 100644 --- a/ihl/datanet/RedstoneSignalConverterContainer.java +++ b/ihl/datanet/RedstoneSignalConverterContainer.java @@ -5,12 +5,11 @@ import java.util.List; import ic2.core.ContainerBase; import ic2.core.IC2; import ic2.core.slot.SlotInvSlot; -import ihl.processing.invslots.SlotRedstoneConverterCableInvSlot; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; -public class RedstoneSignalConverterContainer extends ContainerBase { +public class RedstoneSignalConverterContainer extends ContainerBase { protected RedstoneSignalConverterTileEntity tileEntity; private int lastLinksAmount = -1; diff --git a/ihl/datanet/RedstoneSignalConverterGui.java b/ihl/datanet/RedstoneSignalConverterGui.java index b823f9f..ce7e2d4 100644 --- a/ihl/datanet/RedstoneSignalConverterGui.java +++ b/ihl/datanet/RedstoneSignalConverterGui.java @@ -12,15 +12,12 @@ import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; -import ic2.core.network.NetworkManager; import ihl.collector.GuiMultiTextureButton; @SideOnly(Side.CLIENT) public class RedstoneSignalConverterGui extends GuiContainer { private static final ResourceLocation background = new ResourceLocation("ihl", "textures/gui/GUIRedstoneSignalConverter.png"); private RedstoneSignalConverterContainer container; - private GuiInvisibleButton batterySlotPlus; - private GuiInvisibleButton batterySlotMinus; private GuiInvisibleButton[] sensorsEmittersPlus = new GuiInvisibleButton[6]; private GuiInvisibleButton[] sensorsEmittersMinus = new GuiInvisibleButton[6]; private GuiInvisibleButton[][] cableContacts = new GuiInvisibleButton[4][8]; @@ -37,15 +34,16 @@ public class RedstoneSignalConverterGui extends GuiContainer { this.xSize=RedstoneSignalConverterContainer.width; } - @Override + @SuppressWarnings("unchecked") + @Override public void initGui() { super.initGui(); int x = (width - xSize) / 2; int y = (height - ySize) / 2; int i,i1; - batterySlotPlus = new GuiInvisibleButton(0, x+24, y+121, 3, 3, linksCoordinatesMap, buttonList); - batterySlotMinus = new GuiInvisibleButton(1, x+24, y+124, 3, 3, linksCoordinatesMap, buttonList); + new GuiInvisibleButton(0, x+24, y+121, 3, 3, linksCoordinatesMap, buttonList); //battery plus + new GuiInvisibleButton(1, x+24, y+124, 3, 3, linksCoordinatesMap, buttonList); //battery minus for(i=0;i(); dischargeSlot = new IHLInvSlotDischarge(this, 2, Access.IO, 4); contacts[0]=new Contact(this,0,null,-1,0); contacts[1]=new Contact(this,1,null,-1,1); @@ -163,8 +160,8 @@ public class RedstoneSignalConverterTileEntity extends TileEntityInventory imple super.updateEntityServer(); if(this.linksOrInventoryChanged && this.energy>0) { - Set checkedGrids = new HashSet(); - Set unCheckedGrids = new HashSet(); + Set checkedGrids = new HashSet(); + Set unCheckedGrids = new HashSet(); InvSlotSignalProcessor slots = this.sensorEmitterSlots; for(int i=0;i getNetworkedFields() { - Vector ret = new Vector(2); + Vector ret = new Vector(2); ret.add("active"); ret.add("facing"); return ret; diff --git a/ihl/enviroment/MirrorBlock.java b/ihl/enviroment/MirrorBlock.java index fd1418e..d7d7473 100644 --- a/ihl/enviroment/MirrorBlock.java +++ b/ihl/enviroment/MirrorBlock.java @@ -13,16 +13,12 @@ import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.IIcon; import net.minecraft.util.MathHelper; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; public class MirrorBlock extends Block implements ITileEntityProvider { - private String unlocalizedName; - private IIcon blockIconSide; - public MirrorBlock(String unlocalizedName1) { super(Material.glass); @@ -36,7 +32,7 @@ public class MirrorBlock extends Block implements ITileEntityProvider { public static void init() { - MirrorBlock mblock = new MirrorBlock("mirror"); + new MirrorBlock("mirror"); GameRegistry.registerTileEntity(MirrorTileEntity.class, "mirror"); } @@ -76,8 +72,6 @@ public class MirrorBlock extends Block implements ITileEntityProvider { { MirrorTileEntity ate = (MirrorTileEntity) te; int var2 = ate.getFacing() & 7; - float var4 = 0.375F; - float var5 = 0.625F; float var6 = 0.5F; float var7 = 0.09F; if (var2 == 0) @@ -111,8 +105,6 @@ public class MirrorBlock extends Block implements ITileEntityProvider { private void setBlockBoundsBasedOnFacing(int facing) { int var2 = facing & 7; - float var4 = 0.375F; - float var5 = 0.625F; float var6 = 0.5F; float var7 = 0.09F; if (var2 == 0) @@ -205,18 +197,4 @@ public class MirrorBlock extends Block implements ITileEntityProvider { { this.dropBlockAsItem(world, x, y, z, IHLUtils.getThisModItemStack("dustGlass")); } - /* @Override - public boolean onBlockActivated(World world,int x,int y,int z,EntityPlayer player,int i,float pos_x,float pos_y,float pos_z){ - TileEntity te = world.getTileEntity(x,y,z); - if(IC2.platform.isRendering()) - { - MirrorTileEntity rtu = (MirrorTileEntity)te; - if(player.getCurrentEquippedItem()==null) - { - IC2.platform.messagePlayer(player, "ic2.tooltip.mode", new Object[] {"Facing " + rtu.getFacing()}); - } - } - return false; - } - */ } diff --git a/ihl/enviroment/MirrorRender.java b/ihl/enviroment/MirrorRender.java index 9e06f90..2166e7b 100644 --- a/ihl/enviroment/MirrorRender.java +++ b/ihl/enviroment/MirrorRender.java @@ -15,12 +15,8 @@ import net.minecraft.entity.Entity; import net.minecraft.tileentity.TileEntity; import org.lwjgl.BufferUtils; -import org.lwjgl.opengl.ARBFramebufferObject; import org.lwjgl.opengl.Display; -import org.lwjgl.opengl.EXTFramebufferObject; import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL14; -import org.lwjgl.opengl.GL20; import org.lwjgl.opengl.GL30; import org.lwjgl.util.glu.GLU; import org.lwjgl.util.glu.Project; @@ -42,7 +38,6 @@ private final int[] ydepth; private final int[] textureU; private final int[] textureV; private final Minecraft mc; -private static final boolean useARB = true; public MirrorRender() { @@ -54,7 +49,6 @@ public MirrorRender() } public void renderAModelAt(MirrorTileEntity tile, double x, double y, double z, float f) { - Tessellator tessellator=Tessellator.instance; float[] mAxis = tile.getMirrorAxis(); if(texture==-1) { @@ -73,10 +67,6 @@ public void renderAModelAt(MirrorTileEntity tile, double x, double y, double z, GL30.glRenderbufferStorage(GL30.GL_RENDERBUFFER, GL11.GL_DEPTH_COMPONENT, textureWidth, textureHeight); GL30.glFramebufferRenderbuffer(GL30.GL_FRAMEBUFFER, GL30.GL_DEPTH_ATTACHMENT, GL30.GL_RENDERBUFFER, depthBuffer); GL30.glFramebufferTexture2D(GL30.GL_FRAMEBUFFER, GL30.GL_COLOR_ATTACHMENT0, GL11.GL_TEXTURE_2D, texture, 0); - IntBuffer drawBuffs = BufferUtils.createIntBuffer(1); - drawBuffs.put(0, GL30.GL_COLOR_ATTACHMENT0); - GL20.glDrawBuffers(drawBuffs);// SPme parts of code here mindlessly taken from TheArni/Advanced-Graphics-Processing-Units. https://github.com/TheArni/Advanced-Graphics-Processing-Units/ - if (GL30.glCheckFramebufferStatus(GL30.GL_FRAMEBUFFER) != GL30.GL_FRAMEBUFFER_COMPLETE) { IHLMod.log.error("Something went wrong while creating frame buffer!"); diff --git a/ihl/enviroment/MirrorTileEntity.java b/ihl/enviroment/MirrorTileEntity.java index 083f61d..1808816 100644 --- a/ihl/enviroment/MirrorTileEntity.java +++ b/ihl/enviroment/MirrorTileEntity.java @@ -22,11 +22,10 @@ import ihl.utils.IHLUtils; public class MirrorTileEntity extends TileEntityBlock { - public final List bwc = new ArrayList(); - public final List reflectedEntity = new ArrayList(); - public final List reflectedTileEntity = new ArrayList(); + public final List bwc = new ArrayList(); + public final List reflectedEntity = new ArrayList(); + public final List reflectedTileEntity = new ArrayList(); private int bwcListPos=0; - private int reflectedEntityListPos=0; private int reflectedTileEntityListPos=0; private int reflectionVolumePos=0; boolean firstTick=true; @@ -52,7 +51,8 @@ public class MirrorTileEntity extends TileEntityBlock public MirrorTileEntity() {} - @Override + @SuppressWarnings("unchecked") + @Override public void updateEntityClient() { super.updateEntityClient(); @@ -189,24 +189,6 @@ public class MirrorTileEntity extends TileEntityBlock } } - private void dropMirrorStatusByDirection(ForgeDirection direction) - { - for(int i=1;i<=IHLMod.config.mirrorReflectionRange+2;i++) - { - TileEntity t = worldObj.getTileEntity(xCoord+direction.offsetX*i,yCoord+direction.offsetY*i, zCoord+direction.offsetZ*i); - if(t instanceof MirrorTileEntity) - { - MirrorTileEntity te = (MirrorTileEntity) t; - te.firstTick=false; - } - else - { - break; - } - } - - } - private boolean isBlockVisible(Block block, int x, int y, int z) { if(block instanceof MirrorBlock) @@ -329,7 +311,6 @@ public class MirrorTileEntity extends TileEntityBlock } if(reflectionVolumeSize>0) { - int range=IHLMod.config.mirrorReflectionRange; //reflectionVolumePos = x+y*maxX+z*maxX*maxY; int z = reflectionVolumePos / (maxX-minX) / (maxY-minY); int y = (reflectionVolumePos % ((maxX-minX) * (maxY-minY)))/ (maxX-minX); diff --git a/ihl/enviroment/SpotlightTileEntity.java b/ihl/enviroment/SpotlightTileEntity.java index 04b340b..b8bebab 100644 --- a/ihl/enviroment/SpotlightTileEntity.java +++ b/ihl/enviroment/SpotlightTileEntity.java @@ -1,7 +1,6 @@ package ihl.enviroment; import ic2.api.network.INetworkTileEntityEventListener; import ic2.core.IC2; -import ic2.core.network.NetworkManager; import ihl.IHLModInfo; import ihl.i_hate_liquids.XYZ; import ihl.utils.IHLUtils; @@ -24,8 +23,8 @@ public class SpotlightTileEntity extends LightBulbTileEntity implements INetwork { Vec3 directionVector=Vec3.createVectorHelper(1, 0, 0); private static final int maxLightRange=128; - private final Set xyzGlowningAir = new HashSet(); - private static final Set lightSphereVectors = new HashSet(); + private final Set xyzGlowningAir = new HashSet(); + private static final Set lightSphereVectors = new HashSet(); public float rotationPitch=0f; public float rotationYaw=0f; public float prevRotationPitch=0f; diff --git a/ihl/explosion/ChunkAndWorldLoadEventHandler.java b/ihl/explosion/ChunkAndWorldLoadEventHandler.java new file mode 100644 index 0000000..d52672c --- /dev/null +++ b/ihl/explosion/ChunkAndWorldLoadEventHandler.java @@ -0,0 +1,72 @@ +package ihl.explosion; + +import ihl.IHLMod; + +import java.util.Iterator; +import java.util.Set; + +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.Explosion; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +public class ChunkAndWorldLoadEventHandler +{ + public static ChunkAndWorldLoadEventHandler instance; + public ChunkAndWorldLoadEventHandler() + { + instance=this; + } + + @SubscribeEvent + public void onChunkLoadEvent(net.minecraftforge.event.world.ChunkEvent.Load event) + { + if(event.getChunk().isChunkLoaded && IHLMod.explosionHandler.blastWaveByDimensionId.containsKey(event.world.provider.dimensionId)) + { + WorldSavedDataBlastWave bwdata = IHLMod.explosionHandler.blastWaveByDimensionId.get(event.world.provider.dimensionId); + long cc = ChunkCoordIntPair.chunkXZ2Int(event.getChunk().xPosition, event.getChunk().zPosition); + if(bwdata.data.containsKey(cc)) + { + Set bwArraySet = bwdata.data.remove(cc); + int[] svset = new int[bwArraySet.size()]; + int[] directionMask = new int[3]; + int i=0; + Iterator bwArrayI = bwArraySet.iterator(); + Integer[] bwArray = null; + while(bwArrayI.hasNext()) + { + bwArray=bwArrayI.next(); + svset[i]=bwArray[0]; + i++; + directionMask[0]=bwArray[5]; + directionMask[1]=bwArray[6]; + directionMask[2]=bwArray[7]; + IHLMod.explosionHandler.setPower(bwArray[0], bwArray[4]); + } +/* IHLMod.log.info("Doing schleduled explosion. Direction: ("+ + directionMask[0]+";"+directionMask[1]+";"+directionMask[2]+") "+ + "svset.length"+svset.length);*/ + IHLMod.explosionHandler.doExplosion(event.world, bwArray[1], bwArray[2], bwArray[3], svset, directionMask, new Explosion(event.world, null, bwArray[1], bwArray[2], bwArray[3], 100f)); + IHLMod.explosionHandler.sendChunkUpdateToPlayersInExplosionAffectedZone(event.world, bwArray[1], bwArray[2], bwArray[3]); + } + } + } + + @SubscribeEvent + public void onWorldLoadEvent(net.minecraftforge.event.world.WorldEvent.Load event) + { + WorldSavedDataBlastWave blastWave = (WorldSavedDataBlastWave) event.world.mapStorage.loadData(WorldSavedDataBlastWave.class, "blastWave"); + if(blastWave!=null) + { + IHLMod.explosionHandler.blastWaveByDimensionId.put(event.world.provider.dimensionId,blastWave); + } + } + + @SubscribeEvent + public void onWorldSaveEvent(net.minecraftforge.event.world.WorldEvent.Save event) + { + if(IHLMod.explosionHandler.blastWaveByDimensionId.containsKey(event.world.provider.dimensionId)) + { + event.world.mapStorage.setData("blastWave",IHLMod.explosionHandler.blastWaveByDimensionId.get(event.world.provider.dimensionId)); + } + } +} diff --git a/ihl/explosion/DetonatorMiniGUI.java b/ihl/explosion/DetonatorMiniGUI.java new file mode 100644 index 0000000..c969983 --- /dev/null +++ b/ihl/explosion/DetonatorMiniGUI.java @@ -0,0 +1,83 @@ +package ihl.explosion; + +import java.awt.event.KeyEvent; +import org.lwjgl.opengl.GL11; + +import net.minecraft.client.gui.GuiTextField; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.inventory.Slot; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; +import ihl.IHLMod; +import ihl.interfaces.ItemMiniGUI; +import ihl.utils.IHLUtils; + +public class DetonatorMiniGUI extends ItemMiniGUI +{ + private static final ResourceLocation background = new ResourceLocation("ihl", "textures/gui/GUIIronWorkbench.png"); + private int detonator_delay; + private GuiTextField detonatorDelayTextField; + private int xPos; + private int yPos; + + public DetonatorMiniGUI(GuiContainer gui, Slot slot) + { + super(gui, slot); + detonator_delay=slot.getStack().stackTagCompound.getInteger("detonator_delay"); + xPos = this.slotBase.xDisplayPosition-18; + yPos = this.slotBase.yDisplayPosition+18; + detonatorDelayTextField=new GuiTextField(this.guiBase.mc.fontRenderer, xPos+78, yPos+3, 28, 11); + detonatorDelayTextField.setText(Integer.toString(detonator_delay)); + detonatorDelayTextField.setFocused(true); + } + + @Override + public void displayGUI() + { + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + this.guiBase.mc.renderEngine.bindTexture(background); + this.guiBase.drawTexturedModalRect(xPos, yPos, 0, 202, 126, 25); + int runnerXPos=xPos+5+114*detonator_delay/1350; + this.guiBase.drawTexturedModalRect(runnerXPos, yPos+18, 126, 202, 3, 5); + this.guiBase.mc.fontRenderer.drawStringWithShadow(StatCollector.translateToLocal("ihl.detonator_delay"), xPos+3, yPos+4, 0xFFCC00); + this.detonatorDelayTextField.drawTextBox(); + this.guiBase.mc.fontRenderer.drawStringWithShadow(StatCollector.translateToLocal("s"), xPos+110, yPos+4, 0xFFCC00); + } + + @Override + public boolean handleMouseClick(int mouseX, int mouseY, int mouseButton) + { + if(mouseX>=xPos+5 && mouseX<=xPos+119 && mouseY>=yPos+17 && mouseY<=yPos+24) + { + this.detonator_delay=Math.max(1, Math.min(1350,(mouseX-xPos-5)*1350/114)); + this.detonatorDelayTextField.setText(Integer.toString(detonator_delay)); + } + if(mouseX>=xPos+78 && mouseX<=xPos+78+28 && mouseY>=yPos+3 && mouseY<=yPos+3+11) + { + this.detonatorDelayTextField.setFocused(true); + } + return mouseX>=xPos && mouseX<=xPos+202 && mouseY>=yPos && mouseY<=yPos+25; + } + + @Override + public boolean handleKeyTyped(char characterTyped, int keyIndex) + { + this.detonatorDelayTextField.textboxKeyTyped(characterTyped, keyIndex); + if(keyIndex==KeyEvent.VK_ACCEPT || keyIndex==KeyEvent.VK_ENTER || keyIndex==28 || keyIndex==156)//28 - enter;156 - numpad enter + { + this.detonator_delay=Math.max(1, Math.min(1350,(int)(IHLUtils.parseIntSafe(this.detonatorDelayTextField.getText(),this.detonator_delay)))); + this.detonatorDelayTextField.setText(Integer.toString(detonator_delay)); + this.detonatorDelayTextField.setFocused(false); + return true; + } + return false; + } + + @Override + public void onGUIClosed() + { + IHLMod.proxy.sendItemStackNBTTagFromClientToServerPlayer(this.guiBase.mc.thePlayer, this.slotBase.slotNumber, "detonator_delay", this.detonator_delay); + } + +} diff --git a/ihl/explosion/ExplosionEntityFX.java b/ihl/explosion/ExplosionEntityFX.java new file mode 100644 index 0000000..38e1034 --- /dev/null +++ b/ihl/explosion/ExplosionEntityFX.java @@ -0,0 +1,177 @@ +package ihl.explosion; + +import java.util.Random; + +import ihl.utils.IHLMathUtils; +import net.minecraft.client.particle.EntityFX; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.world.World; + +public class ExplosionEntityFX extends EntityFX { + + private float radius; + private static final Random random = new Random(); + private final int[] particlesMaxAge; + private final int[] particlesTextureIndexX; + private final int[] particlesTextureIndexY; + private final double[][] startPos; + private final double[][] pos; + private final double[][] prevPos; + private final float[][] motion; + private final int[] center; + + public ExplosionEntityFX(World world, double x, double y, double z) + { + super(world, x, y, z); + this.renderDistanceWeight = 5.0D; + int numParticles = 1; + particlesMaxAge = new int[numParticles]; + particlesTextureIndexX = new int[numParticles]; + particlesTextureIndexY= new int[numParticles]; + startPos = new double[numParticles][3]; + pos = new double[numParticles][3]; + prevPos = new double[numParticles][3]; + motion = new float[numParticles][3]; + center = new int[3]; + } + + public ExplosionEntityFX(World par1World, int centerX1, int centerY1, int centerZ1, float radius1) + { + super(par1World, centerX1, centerY1, centerZ1, 0.0D, 0.0D, 0.0D); + this.particleMaxAge = 100; + this.center = new int[3]; + this.lastTickPosX=this.posX=this.prevPosX=this.center[0]=centerX1; + this.lastTickPosY=this.posY=this.prevPosY=this.center[1]=centerY1; + this.lastTickPosZ=this.posZ=this.prevPosZ=this.center[2]=centerZ1; + this.radius=radius1; + float r2 = radius*radius; + int numParticles = (int)(r2*radius/32)+64; + this.startPos = new double[numParticles][3]; + this.pos = new double[numParticles][3]; + this.prevPos = new double[numParticles][3]; + this.particleScale *= 40f; + this.particlesMaxAge = new int[numParticles]; + this.particlesTextureIndexX = new int[numParticles]; + this.particlesTextureIndexY= new int[numParticles]; + this.motion = new float[numParticles][3]; + for(int i=0;i= this.particleMaxAge) + { + this.setDead(); + } + for(int i=0;i> cachedBlockDrops = new HashMap>(128); + public final List dropBlocksPos = new ArrayList(64); + public Set chunksToUpdate=new HashSet(64); + public Map cachedDrops = new HashMap(128); + public Set dropBlocks = new HashSet(); + public Map blastWaveByDimensionId = new HashMap(); + private Entity[] cachedEntities = new Entity[maxArraySize]; + + public ExplosionVectorBlockV2() + { + this.precalculateExplosion(); + directionMasks[0] = new int[] {1,1,1}; + directionMasks[1] = new int[] {-1,1,1}; + directionMasks[2] = new int[] {1,-1,1}; + directionMasks[3] = new int[] {1,1,-1}; + directionMasks[4] = new int[] {-1,-1,1}; + directionMasks[5] = new int[] {1,-1,-1}; + directionMasks[6] = new int[] {-1,1,-1}; + directionMasks[7] = new int[] {-1,-1,-1}; + Arrays.fill(cachedBlockHardness,-1); + } + + private int encodeXYZ(int x, int y, int z) + { + return x<>bits*2,l>>bits&maxValue,l&maxValue}; + } + + public void precalculateExplosion() + { + startVectors[0]=0; + explosionPowerDampingFactor[0]=1f; + for(int levelRadius=1; levelRadiusMath.round(levelRadius*1.8f)) + { + pxyz[0]=IHLUtils.reduceVariableByAbsoluteValue(pxyz[0]); + pxyz[1]=IHLUtils.reduceVariableByAbsoluteValue(pxyz[1]); + pxyz[2]=IHLUtils.reduceVariableByAbsoluteValue(pxyz[2]); + } + else if(Math.abs(pxyz[0])<=Math.abs(pxyz[1]) && Math.abs(pxyz[0])<=Math.abs(pxyz[2])) + { + pxyz[1]=IHLUtils.reduceVariableByAbsoluteValue(pxyz[1]); + pxyz[2]=IHLUtils.reduceVariableByAbsoluteValue(pxyz[2]); + } + else if(Math.abs(pxyz[1])<=Math.abs(pxyz[0]) && Math.abs(pxyz[1])<=Math.abs(pxyz[2])) + { + pxyz[0]=IHLUtils.reduceVariableByAbsoluteValue(pxyz[0]); + pxyz[2]=IHLUtils.reduceVariableByAbsoluteValue(pxyz[2]); + } + else if(Math.abs(pxyz[2])<=Math.abs(pxyz[0]) && Math.abs(pxyz[2])<=Math.abs(pxyz[1])) + { + pxyz[1]=IHLUtils.reduceVariableByAbsoluteValue(pxyz[1]); + pxyz[0]=IHLUtils.reduceVariableByAbsoluteValue(pxyz[0]); + } + } + + public void setPower(int[] sv2, int power1) + { + for(int ev:sv2) + { + this.setPower(ev, power1); + } + } + + public void setPower(int ev, int power1) { + this.explosionPower[ev]=power1; + } + + public int[] breakBlocksAndGetDescendants(World world, int sourceX,int sourceY,int sourceZ, Explosion explosion, int ev, int[] directionMask) + { + int power1 = explosionPower[ev]; + power1 = this.getNewPowerAndProcessBlocks(world, ev, sourceX, sourceY, sourceZ, explosion, power1, directionMask); + power1 = (int)(power1*explosionPowerDampingFactor[ev])-1; + if(power1<=1 || this.vectors[ev][0]==0) + { + return null; + } + else + { + for(int d1:this.vectors[ev]) + { + if(d1!=0) + { + explosionPower[d1]=power1; + } + } + return this.vectors[ev]; + } + } + + private int getNewPowerAndProcessBlocks(World world, int ev, int sourceX, int sourceY, int sourceZ, Explosion explosion, int power2, int[] directionMask) + { + int power1=power2; + int[] xyz = decodeXYZ(ev); + int absX = xyz[0]*directionMask[0] + sourceX; + int absY = xyz[1]*directionMask[1] + sourceY; + int absZ = xyz[2]*directionMask[2] + sourceZ; + if(absY<0 || absY>=256) + { + return 0; + } + int absEBSX = absX>>4; + int absEBSZ = absZ>>4; + if(world.getChunkProvider().chunkExists(absEBSX, absEBSZ)) + { + if(world.getChunkProvider().provideChunk(absEBSX, absEBSZ).getTopFilledSegment()+24>=absY) + { + int explosionResistance = this.getBlockResistance(world, ev, absX, absY, absZ, sourceX, sourceY, sourceZ, explosion, directionMask); + if(explosionResistance>=power1) + { + if(this.cachedFluidBlocks[ev]!=0) + { + //IHLMod.log.info("Schleduling update for "+Block.getBlockById(this.cachedFluidBlocks[ev]).getUnlocalizedName()); + Block block = Block.getBlockById(this.cachedFluidBlocks[ev]); + block.onNeighborBlockChange(world, absX, absY, absZ, block); + } + else + { + this.dropBlocksPos.add(new int[] {absX, absY+1, absZ}); + } + return 0; + } + else + { + power1-=explosionResistance; + this.onBlockDestroy(world, ev, absX, absY, absZ, power1, explosion); + return power1; + } + } + else + { + return 0; + } + } + else + { + WorldSavedDataBlastWave blastWave = null; + int dimensionId = world.provider.dimensionId; + if(this.blastWaveByDimensionId.containsKey(dimensionId)) + { + blastWave=this.blastWaveByDimensionId.get(dimensionId); + } + else + { + blastWave=new WorldSavedDataBlastWave("blastWave"); + this.blastWaveByDimensionId.put(dimensionId, blastWave); + } + long chunkXZKey = ChunkCoordIntPair.chunkXZ2Int(absEBSX, absEBSZ); + blastWave.scheduleExplosionEffectsOnChunkLoad(chunkXZKey, ev, sourceX, sourceY, sourceZ, power1, directionMask); + return 0; + } + } + + public int getBlockResistance(World world, int ev, int absX, int absY, int absZ, int sourceX, int sourceY, int sourceZ, Explosion explosion, int[] directionMask) + { + if(this.cachedBlockHardness[ev]!=-1) + { + return this.cachedBlockHardness[ev]; + } + else + { + this.precacheEBSBlocks(world, absX, absY, absZ, sourceX, sourceY, sourceZ, explosion, directionMask); + return this.cachedBlockHardness[ev]; + } + } + + public void precacheEBSBlocks(World world, int absX, int absY, int absZ, int sourceX, int sourceY, int sourceZ, Explosion explosion, int[] directonMask) + { + Chunk chunk = world.getChunkProvider().provideChunk(absX>>4, absZ>>4); + List eList = this.getEntityList(chunk, absX, absY, absZ); + if(eList!=null) + { + Iterator eListI = eList.iterator(); + while(eListI.hasNext()) + { + Entity entity = eListI.next(); + int entityX = (int)entity.boundingBox.minX; + int entityY = (int)entity.boundingBox.minY; + int entityZ = (int)entity.boundingBox.minZ; + int rx = (entityX - sourceX) * directonMask[0]; + int ry = (entityY - sourceY) * directonMask[1]; + int rz = (entityZ - sourceZ) * directonMask[2]; + int ev = this.encodeXYZ(rx, ry, rz); + if(rx >= 0 && ry >= 0 && rz >= 0 && ev>=0 && ev>8) & 15)|(absY & 0xFFFFFFF0); + int blockWorldZ = ((i4>>4) & 15)|(absZ & 0xFFFFFFF0); + + int rx = (blockWorldX - sourceX) * directonMask[0]; + int ry = (blockWorldY - sourceY) * directonMask[1]; + int rz = (blockWorldZ - sourceZ) * directonMask[2]; + + int ev = this.encodeXYZ(rx, ry, rz); + if(rx >= 0 && ry >= 0 && rz >= 0 && ev>=0 && ev>8) & 15, (i4>>4) & 15) << 8; + } + int blockWorldX = (i4 & 15)|(absX & 0xFFFFFFF0); + int blockWorldY = ((i4>>8) & 15)|(absY & 0xFFFFFFF0); + int blockWorldZ = ((i4>>4) & 15)|(absZ & 0xFFFFFFF0); + int rx = (blockWorldX - sourceX) * directonMask[0]; + int ry = (blockWorldY - sourceY) * directonMask[1]; + int rz = (blockWorldZ - sourceZ) * directonMask[2]; + + int ev = this.encodeXYZ(rx, ry, rz); + if(rx >= 0 && ry >= 0 && rz >= 0 && ev>=0 && ev dropsList = (block.getDrops(world, blockWorldX, blockWorldY, blockWorldZ, ebs.getExtBlockMetadata(i4 & 15, (i4>>8) & 15, (i4>>4) & 15), 0)); + if(dropsList!=null) + { + this.cachedBlockDrops.put(ev, dropsList); + } + } + if(block.getBlockHardness(world, blockWorldX, blockWorldY, blockWorldZ)<0) + { + this.cachedBlockHardness[ev]=Integer.MAX_VALUE; + } + else if(ev==0 && directonMask[0]+directonMask[1]+directonMask[2]==3) + { + this.cachedBlockHardness[ev]=0; + } + else + { + int br=Math.round(block.getExplosionResistance(null, world, blockWorldX, blockWorldY, blockWorldZ, sourceX, sourceY, sourceZ)*10f); + this.cachedBlockHardness[ev]=br; + } + if(block.getMaterial().isLiquid()) + { + this.cachedFluidBlocks[ev]=var4; + } + } + } + } + } + + public ExtendedBlockStorage getEBS(Chunk chunk, int absX, int absY, int absZ) + { + ExtendedBlockStorage[] ebsA = chunk.getBlockStorageArray(); + ExtendedBlockStorage ebs = ebsA[absY>>4]; + if(ebs!=null) + { + this.chunksToUpdate.add(chunk); + } + return ebs; + } + + @SuppressWarnings("unchecked") + public List getEntityList(Chunk chunk, int absX, int absY, int absZ) + { + return chunk.entityLists[absY>>4]; + } + + + public void onBlockDestroy(World world, int ev, int absX,int absY,int absZ, int power, Explosion explosion) + { + Chunk chunk = world.getChunkProvider().provideChunk(absX>>4, absZ>>4); + ExtendedBlockStorage ebs = this.getEBS(chunk, absX, absY, absZ); + if(ebs==null || ebs.isEmpty()) + { + return; + } + int array_index = (absY & 15)<<8 | (absZ & 15)<<4 | (absX & 15); + if(ebs.getBlockLSBArray()[array_index] != 0 && + ebs.getBlockMSBArray()!=null && + ebs.getBlockMSBArray().get(absX & 15, absY & 15, absZ & 15) != 0) + { + ebs.blockRefCount--; + } + ebs.getBlockLSBArray()[array_index] = 0; + if(ebs.getBlockMSBArray()!=null){ + ebs.getBlockMSBArray().set(absX & 15, absY & 15, absZ & 15, 0); + } + if(this.cachedBlockDrops.containsKey(ev)) + { + Iterator drops = this.cachedBlockDrops.remove(ev).iterator(); + while(drops.hasNext()) + { + ItemStack drop = drops.next(); + int key = Item.getIdFromItem(drop.getItem())^(drop.getItemDamage()<<16); + if(this.cachedDrops.containsKey(key)) + { + this.cachedDrops.get(key).stackSize+=drop.stackSize; + } + else + { + this.cachedDrops.put(key, drop); + } + } + } + Entity victim = this.cachedEntities[ev]; + if(victim!=null) + { + victim.attackEntityFrom(DamageSource.setExplosionSource(explosion), power/10f); + this.cachedEntities[ev]=null; + } + this.dropBlocks.add(ev); + } + + private void addDrops(World world, int sourceX, int sourceY, int sourceZ, int[] directionMask) + { + Iterator> di = this.cachedDrops.entrySet().iterator(); + Entry cde = di.next(); + while(di.hasNext() && this.dropBlocksPos.size() > 0) + { + int[] xyz = this.dropBlocksPos.remove(this.dropBlocksPos.size()-1); + int x = xyz[0]; + int y = xyz[1]; + int z = xyz[2]; + int rx = (x - sourceX) * directionMask[0]; + int ry = (y - sourceY) * directionMask[1]; + int rz = (z - sourceZ) * directionMask[2]; + int ev = encodeXYZ(rx,ry,rz); + int ev2 = encodeXYZ(rx,ry-1,rz); + if(this.dropBlocks.contains(ev) && !this.dropBlocks.contains(ev2)) + { + ItemStack stack = cde.getValue(); + if(stack!=null && stack.getItem()!=null && stack.stackSize>0) + { + if(stack.stackSize <= stack.getMaxStackSize()) + { + if(stack.stackSize>0) + { + PileTileEntity pte = new PileTileEntity(); + pte.xCoord=x; + pte.yCoord=y; + pte.zCoord=z; + pte.setWorldObj(world); + pte.validate(); + pte.setContent(stack); + IHLUtils.setBlockAndTileEntityRaw(world, x, y, z, PileBlock.instance, pte); + } + di.remove(); + if(di.hasNext()) + { + cde = di.next(); + } + else + { + return; + } + } + else + { + ItemStack stack1=stack.copy(); + stack1.stackSize=stack.getMaxStackSize(); + PileTileEntity pte = new PileTileEntity(); + pte.content=stack1; + IHLUtils.setBlockAndTileEntityRaw(world, x, y, z, PileBlock.instance, pte); + stack.stackSize-=stack.getMaxStackSize(); + } + } + } + } + } + + public void sendChunkUpdateToPlayersInExplosionAffectedZone(World world, int sourceX, int sourceY, int sourceZ) + { +// Set clientSideChunkXZKeySet = new HashSet(); + Iterator ci = this.chunksToUpdate.iterator(); + while(ci.hasNext()) + { + Chunk chunk = ci.next(); + chunk.generateSkylightMap(); + Arrays.fill(chunk.updateSkylightColumns, true); + chunk.func_150804_b(false); +// long chunkXZKey = ChunkCoordIntPair.chunkXZ2Int(chunk.xPosition, chunk.zPosition); +// clientSideChunkXZKeySet.add(chunkXZKey); + } + List chunks = new ArrayList(); + chunks.addAll(this.chunksToUpdate); + for(Object player:world.playerEntities) + { + if(player instanceof EntityPlayerMP) + { + EntityPlayerMP playerMP = (EntityPlayerMP)player; + playerMP.playerNetServerHandler.sendPacket(new S26PacketMapChunkBulk(chunks)); + } + } +// IHLMod.proxy.sendChunksLightUpdateQuery(world, sourceX, sourceY, sourceZ, clientSideChunkXZKeySet); + this.chunksToUpdate.clear(); + } + + public void doExplosion(World world, int sourceX, int sourceY, int sourceZ, final int[] startVectors1, int[] directionMask, Explosion explosion) + { + boolean doExplosion=true; + int[] sv = null; + int svsize = 0; + while(doExplosion) + { + int[] sv2= new int[1< teclass1, boolean isNormalBlock1,ItemStack itemDroppedOnBlockDestroy1) + { + unlocalizedName=unlocalizedName1; + teclass=teclass1; + isNormalBlock=isNormalBlock1; + itemDroppedOnBlockDestroy=itemDroppedOnBlockDestroy1; + } + String unlocalizedName; + Class teclass; + boolean isNormalBlock=true; + ItemStack itemDroppedOnBlockDestroy; + } + + @Override + public int getRenderType() + { + return 0; + } + + @Override + public boolean isOpaqueCube() + { + return true; + } + + @Override + public boolean renderAsNormalBlock() + { + return true; + } + + @SideOnly(Side.CLIENT) + public IIcon getInnerTextureForBlockRenderer() + { + return this.blockIcon; + } + + @Override + public boolean canDropFromExplosion(Explosion explosion) + { + return false; + } + + @Override + public float getExplosionResistance(Entity entity) + { + return -1f; + } + + @Override + public float getExplosionResistance(Entity entity, World world, int x, int y ,int z, double explosionX, double explosionY, double explosionZ) + { + TileEntity te = world.getTileEntity(x, y, z); + if(te instanceof ExplosiveTileEntity && !((ExplosiveTileEntity)te).isInvalid()) + { + return -((ExplosiveTileEntity)te).explosionPower; + } + return -1f; + } + + @Override + public void onBlockDestroyedByExplosion(World world, int x, int y ,int z, Explosion explosion) + { + TileEntity te = world.getTileEntity(x, y, z); + if(te instanceof ExplosiveTileEntity) + { + ((ExplosiveTileEntity)te).createExplosion(null); + } + } + + +} diff --git a/ihl/explosion/ExplosiveTileEntity.java b/ihl/explosion/ExplosiveTileEntity.java new file mode 100644 index 0000000..002c959 --- /dev/null +++ b/ihl/explosion/ExplosiveTileEntity.java @@ -0,0 +1,85 @@ +package ihl.explosion; + +import ic2.core.IC2; +import ihl.IHLMod; +import ihl.utils.IHLMathUtils; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; + +public class ExplosiveTileEntity extends TileEntity { + + public int explosionPower=10000; + private int explosionType=1; + private int detonator_delay=1; + private int burn_time=0; + public boolean is_detonator_burning = false; + + + public void createExplosion(EntityPlayer player) + { + this.invalidate(); + int power = this.explosionPower; + this.explosionPower = 0; + IHLMod.explosionHandler.setPower(IHLMod.explosionHandler.startVectors, power); + IHLMod.explosionHandler.doExplosion(worldObj, xCoord, yCoord, zCoord, IHLMod.explosionHandler.startVectors); + IHLMod.proxy.createExplosionEffectFromServer(worldObj, xCoord, yCoord, zCoord, 32f*IHLMathUtils.sqrt(power/16384f)); + } + + @Override + public boolean canUpdate() + { + return IC2.platform.isSimulating(); + } + + @Override + public void updateEntity() + { + if(is_detonator_burning) + { + IHLMod.proxy.spawnParticleFromServer(4, worldObj, xCoord+0.5d, yCoord+1d, zCoord+0.5d, 0d, 0.2d, 0d, 1f); + if(this.burn_time++>detonator_delay*20) + { + this.createExplosion(null); + } + } + } + + @Override + public void readFromNBT(NBTTagCompound nbt) + { + if(nbt!=null) + { + explosionPower=nbt.getInteger("explosionPower"); + explosionType=nbt.getInteger("explosionType"); + detonator_delay=nbt.getInteger("detonator_delay"); + } + } + + @Override + public void writeToNBT(NBTTagCompound nbt) + { + nbt.setInteger("explosionPower",explosionPower); + nbt.setInteger("explosionType",explosionType); + nbt.setInteger("detonator_delay",detonator_delay); + } + + public boolean ignite(EntityPlayer player) + { + if(player!=null && + player.getCurrentEquippedItem()!=null && + player.getCurrentEquippedItem().getItem()==Items.flint_and_steel) + { + ignite(); + return true; + } + return false; + } + + public void ignite() + { + IHLMod.proxy.playSoundEffectFromServer(0, this.worldObj, this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, 10.0F, 1.0F); + this.is_detonator_burning=true; + } +} diff --git a/ihl/explosion/GroundRemoverItem.java b/ihl/explosion/GroundRemoverItem.java new file mode 100644 index 0000000..d3d2b80 --- /dev/null +++ b/ihl/explosion/GroundRemoverItem.java @@ -0,0 +1,106 @@ +package ihl.explosion; + +import java.util.HashSet; +import java.util.List; +import java.util.Random; +import java.util.Set; + +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import ihl.IHLCreativeTab; +import ihl.IHLMod; +import ihl.IHLModInfo; + +public class GroundRemoverItem extends Item{ + + private String registryName; + private final Set removableBlockSet = new HashSet(); + private final Random random = new Random(); + + public GroundRemoverItem(String registryName1) + { + super(); + this.registryName=registryName1; + this.setCreativeTab(IHLCreativeTab.tab); + this.setMaxStackSize(1); + this.setUnlocalizedName(registryName); + removableBlockSet.add(Blocks.sandstone); + removableBlockSet.add(Blocks.sand); + removableBlockSet.add(Blocks.stone); + removableBlockSet.add(Blocks.flowing_water); + removableBlockSet.add(Blocks.flowing_lava); + removableBlockSet.add(Blocks.water); + removableBlockSet.add(Blocks.lava); + removableBlockSet.add(Blocks.clay); + removableBlockSet.add(Blocks.gravel); + removableBlockSet.add(Blocks.dirt); + } + + public GroundRemoverItem() + { + super(); + } + + public static void init() + { + //GameRegistry.registerItem(new GroundRemoverItem("groundRemover"),"groundRemover"); + } + + @SuppressWarnings({ "rawtypes", "unchecked" }) + @Override + public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean flag) + { + info.add("Vanilla block remover tool"); + } + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister par1IconRegister) + { + this.itemIcon = par1IconRegister.registerIcon(IHLModInfo.MODID + ":vacuumSwitch"); + } + + @Override + public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int par7, float par8, float par9, float par10) + { + TileEntity t = world.getTileEntity(x, y, z); + if(world.isRemote) + { + IHLMod.proxy.createExplosionEffect(world, x, y, z, 16f); + } + return true; + } + + @Override + public void onUpdate(ItemStack stack, World world, Entity entity, int slotIndex, boolean isCurrentItem) + { +/* if(entity instanceof EntityPlayer && isCurrentItem && MinecraftServer.getServer().getTickCounter()%100==99) + { + int x = (int)entity.posX; + int y = (int)entity.posY; + int z = (int)entity.posZ; + for(int ix = x-16;ix < x+16;ix++) + { + for(int iz = z-16;iz < z+16;iz++) + { + for(int iy = 4;iy < y;iy++) + { + if(!(world.getBlock(ix, iy, iz) instanceof BlockOre || world.getBlock(ix, iy, iz) instanceof IHLFluidBlock)) + { + world.setBlockToAir(ix, iy, iz); + } + } + } + } + }*/ + } +} diff --git a/ihl/explosion/IHLEntityFallingPile.java b/ihl/explosion/IHLEntityFallingPile.java new file mode 100644 index 0000000..79973d8 --- /dev/null +++ b/ihl/explosion/IHLEntityFallingPile.java @@ -0,0 +1,152 @@ +package ihl.explosion; + +import ihl.utils.IHLUtils; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.ItemStack; +import net.minecraft.network.play.server.S23PacketBlockChange; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.entity.item.ItemExpireEvent; + +public class IHLEntityFallingPile extends EntityItem{ + + public IHLEntityFallingPile(World world) { + super(world); + } + + @Override + public void onUpdate() + { + ItemStack stack = this.getDataWatcher().getWatchableObjectItemStack(10); + if (stack != null && stack.getItem() != null) + { + if (stack.getItem().onEntityItemUpdate(this)) + { + return; + } + } + + if (this.getEntityItem() == null) + { + this.setDead(); + } + else + { + this.onEntityUpdate(); + + if (this.delayBeforeCanPickup > 0) + { + --this.delayBeforeCanPickup; + } + + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + this.motionY -= 0.03999999910593033D; + this.noClip = this.func_145771_j(this.posX, (this.boundingBox.minY + this.boundingBox.maxY) / 2.0D, this.posZ); + this.moveEntity(this.motionX, this.motionY, this.motionZ); + boolean flag = (int)this.prevPosX != (int)this.posX || (int)this.prevPosY != (int)this.posY || (int)this.prevPosZ != (int)this.posZ; + + if (flag || this.ticksExisted % 25 == 0) + { + if (this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)).getMaterial() == Material.lava) + { + this.motionY = 0.20000000298023224D; + this.motionX = (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F); + this.motionZ = (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F); + this.playSound("random.fizz", 0.4F, 2.0F + this.rand.nextFloat() * 0.4F); + } + + } + + this.motionX *= 0.98D; + this.motionY *= 0.98D; + this.motionZ *= 0.98D; + + if (this.onGround) + { + this.motionY *= -0.5D; + } + + ++this.age; + + ItemStack item = this.getEntityItem(); + + if (!this.worldObj.isRemote && + (this.age >= lifespan || this.onGround)) + { + if (item != null) + { + ItemExpireEvent event = new ItemExpireEvent(this, (item.getItem() == null ? 6000 : item.getItem().getEntityLifespan(item, worldObj))); + if (MinecraftForge.EVENT_BUS.post(event)) + { + lifespan += event.extraLife; + } + else + { + int x = (int)(this.boundingBox.minX); + int y = (int)(this.boundingBox.minY); + int z = (int)(this.boundingBox.minZ); + int i=1; + do + { + int[] xz = new int[] {0,0,1,0,-1,0}; + if(i+X + //[ ][2][ ] + return new boolean[] { + blockAccess.getBlock(x, y, z+1).isOpaqueCube(), + blockAccess.getBlock(x+1, y, z).isOpaqueCube(), + blockAccess.getBlock(x, y, z-1).isOpaqueCube(), + blockAccess.getBlock(x-1, y, z).isOpaqueCube(), + }; + } + + private void addBottom(Tessellator tessellator, int x, int y, int z, int[][][] brightness) + { + double[][] triangle1 = new double[3][3]; + double[][] triangle2 = new double[3][3]; + triangle1[0] = new double[] {0D,0D,1D}; + triangle1[1] = new double[] {0D,0D,0D}; + triangle1[2] = new double[] {1D,0D,0D}; + triangle2[0] = triangle1[0]; + triangle2[1] = triangle1[2]; + triangle2[2] = new double[] {1D,0D,1D}; + this.addTriangle(tessellator, triangle1, x, y, z, ForgeDirection.UP, brightness); + this.addTriangle(tessellator, triangle2, x, y, z, ForgeDirection.UP, brightness); + } + + private void addFlatTop(Tessellator tessellator, int x, int y, int z, int[][][] brightness) + { + double[][] triangle1 = new double[3][3]; + double[][] triangle2 = new double[3][3]; + double height = 0.9D; + triangle1[0] = new double[] {1D,height,0D}; + triangle1[1] = new double[] {0D,height,0D}; + triangle1[2] = new double[] {0D,height,1D}; + triangle2[0] = triangle1[2]; + triangle2[1] = new double[] {1D,height,1D}; + triangle2[2] = triangle1[0]; + this.addTriangle(tessellator, triangle1, x, y, z, ForgeDirection.UP, brightness); + this.addTriangle(tessellator, triangle2, x, y, z, ForgeDirection.UP, brightness); + } + + private void addSlope(Tessellator tessellator, int x, int y, int z, int px, int nx, int pz, int nz, int[][][] brightness) + { + double[][] triangle1 = new double[3][3]; + double[][] triangle2 = new double[3][3]; + if(px*pz+nx*nz==1) + { + triangle1[0] = new double[] {1D,px*nz,0D}; //+X -Z + triangle1[1] = new double[] {0D,nx*nz,0D}; //-X -Z + triangle1[2] = new double[] {1D,px*pz,1D}; //-X +Z + triangle2[0] = triangle1[2]; + triangle2[1] = triangle1[1]; //+X +Z + triangle2[2] = new double[] {0D,nx*pz,1D}; + } + else + { + triangle1[0] = new double[] {1D,px*nz,0D}; //+X -Z + triangle1[1] = new double[] {0D,nx*nz,0D}; //-X -Z + triangle1[2] = new double[] {0D,nx*pz,1D}; //-X +Z + triangle2[0] = triangle1[2]; + triangle2[1] = new double[] {1D,px*pz,1D}; //+X +Z + triangle2[2] = triangle1[0]; + } + this.addTriangle(tessellator, triangle1, x, y, z, ForgeDirection.UP, brightness); + this.addTriangle(tessellator, triangle2, x, y, z, ForgeDirection.UP, brightness); + } + + private void addPyramid(Tessellator tessellator, int x, int y, int z, int[][][] brightness) + { + double[][] triangle1 = new double[3][3]; + double[][] triangle2 = new double[3][3]; + double[][] triangle3 = new double[3][3]; + double[][] triangle4 = new double[3][3]; + double pileHeight = 0.3D; + triangle1[0] = new double[] {1D,0D,0D}; + triangle1[1] = new double[] {0D,0D,0D}; + triangle1[2] = new double[] {0.5D,pileHeight,0.5D}; + triangle2[0] = triangle1[1]; + triangle2[1] = new double[] {0D,0D,1D}; + triangle2[2] = triangle1[2]; + triangle3[0] = triangle2[1]; + triangle3[1] = new double[] {1D,0D,1D}; + triangle3[2] = triangle1[2]; + triangle4[0] = triangle3[1]; + triangle4[1] = triangle1[0]; + triangle4[2] = triangle1[2]; + this.addTriangle(tessellator, triangle1, x, y, z, ForgeDirection.UP, brightness); + this.addTriangle(tessellator, triangle2, x, y, z, ForgeDirection.UP, brightness); + this.addTriangle(tessellator, triangle3, x, y, z, ForgeDirection.UP, brightness); + this.addTriangle(tessellator, triangle4, x, y, z, ForgeDirection.UP, brightness); + } + + private void addTriangle(Tessellator tessellator, double[][] triangle, int x, int y, int z, ForgeDirection uvmapping, int[][][] brightness) + { + int iu = 0; + int iv = 2; + if(uvmapping.offsetY == 0) + { + iv = 1; + if(uvmapping.offsetZ == 0) + { + iu = 2; + } + } + float[] normal = IHLMathUtils.get_triangle_normal(triangle); + tessellator.setNormal(normal[0], normal[1], normal[2]); + tessellator.setBrightness(this.getBrightness(triangle[0], brightness)); + tessellator.addVertexWithUV(x+triangle[0][0], y+triangle[0][1], z+triangle[0][2], triangle[0][iu], triangle[0][iv]); + tessellator.setBrightness(this.getBrightness(triangle[1], brightness)); + tessellator.addVertexWithUV(x+triangle[1][0], y+triangle[1][1], z+triangle[1][2], triangle[1][iu], triangle[1][iv]); + tessellator.setBrightness(this.getBrightness(triangle[2], brightness)); + tessellator.addVertexWithUV(x+triangle[2][0], y+triangle[2][1], z+triangle[2][2], triangle[2][iu], triangle[2][iv]); + } + + public long getItemStackHash(ItemStack stack) + { + if(stack==null) + { + return 0; + } + return ((long)Item.getIdFromItem(stack.getItem())<<31^stack.getItemDamage()); + } + + private void generateBrightnessMatrix(IBlockAccess blockAccess, int x, int y, int z, int[][][] brightness) + { + for(int ix = -1; ix <= 1; ix++) + for(int iy = -1; iy <= 1; iy++) + for(int iz = -1; iz <= 1; iz++) + { + Block block = blockAccess.getBlock(ix+x, iy+y, iz+z); + if(block!=null && block!=Blocks.air) + { + brightness[ix+1][iy+1][iz+1] = block.getMixedBrightnessForBlock(blockAccess, ix+x, iy+y, iz+z); + } + else + { + brightness[ix+1][iy+1][iz+1] = block.getMixedBrightnessForBlock(blockAccess, x, y, z); + } + } + } + + private int getBrightness(double v[], int[][][] brightness) + { + int x1 = v[0]<0.5d?0:1; + int x2 = x1+1; + int y1 = v[1]<0.5d?0:1; + int y2 = y1+1; + int z1 = v[2]<0.5d?0:1; + int z2 = z1+1; + float dx = v[0]<0.5d?(float)v[0]*2f:(float)v[0]*2f-1f; + float dy = v[1]<0.5d?(float)v[1]*2f:(float)v[1]*2f-1f; + float dz = v[2]<0.5d?(float)v[2]*2f:(float)v[2]*2f-1f; + int brightness1 = brightness[x1][y1][z1]; + int brightness2 = brightness[x2][y2][z2]; + float d = IHLMathUtils.sqrt(dx*dx+dy*dy+dz*dz); + return (int)(brightness1*(1f-d)*0.8f+brightness2*d*0.8f+brightness[1][1][1]*0.2f) & 16711935; + } + + @Override + public boolean shouldRender3DInInventory(int arg0) + { + return true; + } +} + \ No newline at end of file diff --git a/ihl/explosion/PileTileEntity.java b/ihl/explosion/PileTileEntity.java new file mode 100644 index 0000000..b6046db --- /dev/null +++ b/ihl/explosion/PileTileEntity.java @@ -0,0 +1,91 @@ +package ihl.explosion; + +import ic2.core.IC2; +import ihl.IHLMod; +import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.tileentity.TileEntity; + +public class PileTileEntity extends TileEntity +{ + public ItemStack content = new ItemStack(Blocks.sandstone); + private boolean firstTick = true; + + @Override + public boolean canUpdate() + { + return IC2.platform.isRendering(); + } + + @Override + public void updateEntity() + { + if(firstTick && this.content!=null) + { + if(this.worldObj.isRemote) + { + IHLMod.proxy.requestTileEntityInitdataFromClientToServer(xCoord, yCoord, zCoord); + } + else + { + checkAndFall(); + } + firstTick = false; + } + } + + public void setContent(ItemStack other) + { + this.content=other; + } + + public boolean checkAndFall() + { + Block underblock = this.worldObj.getBlock(xCoord, yCoord-1, zCoord); + if(underblock.isAir(worldObj, xCoord, yCoord-1, zCoord) || underblock==Blocks.air || underblock.getCollisionBoundingBoxFromPool(worldObj, xCoord, yCoord-1, zCoord)==null) + { + IHLEntityFallingPile fallingPile = new IHLEntityFallingPile(worldObj); + fallingPile.setPosition(xCoord+0.5d, yCoord+0.5d, zCoord+0.5d); + fallingPile.setEntityItemStack(content); + this.worldObj.setBlockToAir(xCoord, yCoord, zCoord); + this.worldObj.spawnEntityInWorld(fallingPile); + return false; + } + return true; + } + + @Override + public void readFromNBT(NBTTagCompound nbttagcompound) + { + super.readFromNBT(nbttagcompound); + this.content = ItemStack.loadItemStackFromNBT(nbttagcompound.getCompoundTag("content")); + } + + @Override + public void writeToNBT(NBTTagCompound nbttagcompound) + { + super.writeToNBT(nbttagcompound); + NBTTagCompound contentNBT = new NBTTagCompound(); + this.content.writeToNBT(contentNBT); + nbttagcompound.setTag("content", contentNBT); + } + + public void updateBlockRender() + { + Minecraft.getMinecraft().renderGlobal.markBlockForRenderUpdate(xCoord, yCoord, zCoord); + } + + @Override + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) + { + this.readFromNBT(pkt.func_148857_g()); + Minecraft.getMinecraft().renderGlobal.markBlockForRenderUpdate(xCoord, yCoord, zCoord); + } +} + + diff --git a/ihl/explosion/PileTileEntityRender.java b/ihl/explosion/PileTileEntityRender.java new file mode 100644 index 0000000..ea8ab4f --- /dev/null +++ b/ihl/explosion/PileTileEntityRender.java @@ -0,0 +1,160 @@ +package ihl.explosion; + +import java.nio.IntBuffer; +import java.util.HashMap; +import java.util.Map; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; + +import org.lwjgl.BufferUtils; +import org.lwjgl.opengl.Display; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL30; +import org.lwjgl.util.glu.GLU; + +import ihl.IHLMod; +import ihl.utils.IHLItemRenderer; + +public class PileTileEntityRender extends TileEntitySpecialRenderer { + +private int fb=-1; +private final int textureWidth=64; +private final int textureHeight=64; +private final PileBlockRender pileBlockRender; +public final Map textureIdMap = new HashMap(); +private IntBuffer textureIDBuffer; +private int nextAvailableId = -1; +private boolean framebufferReady = false; +private Minecraft mc; +private final IHLItemRenderer ihlItemRenderer=new IHLItemRenderer(false); +private final Random random = new Random(); + +public PileTileEntityRender(PileBlockRender pileBlockRender1) +{ + pileBlockRender=pileBlockRender1; + mc = Minecraft.getMinecraft(); +} + +public void renderAModelAt(PileTileEntity tile, double x, double y, double z, float f) +{ + ItemStack stack = tile.content; + if(!framebufferReady) + { + this.generateFrameBuffer(); + Minecraft.getMinecraft().entityRenderer.setupCameraTransform(f, 0); + Minecraft.getMinecraft().getFramebuffer().bindFramebuffer(false); + } + else if(stack!=null) + { + long hash = this.pileBlockRender.getItemStackHash(stack); + if(!textureIdMap.containsKey(hash)) + { + textureIdMap.put(hash,textureIDBuffer.get(++nextAvailableId)); + this.preparetexture(nextAvailableId); + this.drawTexture(tile); + Minecraft.getMinecraft().entityRenderer.setupCameraTransform(f, 0); + Minecraft.getMinecraft().getFramebuffer().bindFramebuffer(false); + tile.updateBlockRender(); + } + } +} + +private void generateFrameBuffer() +{ + textureIDBuffer = BufferUtils.createIntBuffer(Short.MAX_VALUE); + GL11.glGenTextures(textureIDBuffer); + fb=GL30.glGenFramebuffers(); + this.preparetexture(0); + if (GL30.glCheckFramebufferStatus(GL30.GL_FRAMEBUFFER) != GL30.GL_FRAMEBUFFER_COMPLETE) + { + IHLMod.log.error("Something went wrong while creating frame buffer!"); + IHLMod.log.error(GL30.glCheckFramebufferStatus(GL30.GL_FRAMEBUFFER)); + } + else + { + IHLMod.log.info("FrameBuffer loaded correctly!"); + } + this.framebufferReady=true; +} + +private void preparetexture(int textureID) +{ + GL30.glBindFramebuffer(GL30.GL_FRAMEBUFFER, fb); + int texture = textureIDBuffer.get(textureID); + GL11.glBindTexture(GL11.GL_TEXTURE_2D, texture); + GL30.glFramebufferTexture2D(GL30.GL_FRAMEBUFFER, GL30.GL_COLOR_ATTACHMENT0, GL11.GL_TEXTURE_2D, texture, 0); + GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGB8, textureWidth, textureHeight, 0, GL11.GL_RGB, GL11.GL_UNSIGNED_BYTE, (java.nio.ByteBuffer)null); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_CLAMP); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_CLAMP); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER,GL11.GL_NEAREST); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST); +} + +private void drawTexture(PileTileEntity tile) +{ + GL11.glViewport(0, 0, textureWidth, textureHeight); + GL11.glClearColor(0f, 0f, 0f, 1f); + GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT); + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glLoadIdentity(); + GL11.glOrtho(-1d, 1d, -1d, 1d, 0.05F, this.mc.gameSettings.renderDistanceChunks * 32F); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glLoadIdentity(); + ItemStack stack = tile.content; + GL11.glTranslatef(0, 0, -1f); + GLU.gluLookAt(0, 0, 0, -32f/*x reference*/, 0f/*y reference*/, 0f/*z reference*/, 0.0f, 1.0f, 0.0f); + GL11.glColor4f(1f, 1f, 1f, 1f); + GL11.glRotatef(90f,0,1f,0); + GL11.glScalef(2f, 2f, 2f); + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 0xf0, 0xf0); +// Tessellator.instance.setBrightness(16711935); + if(stack.getItem() instanceof ItemBlock) + { + Block block = ((ItemBlock)stack.getItem()).field_150939_a; + IIcon icon = block.getIcon(0, stack.getItemDamage()); + double u1 = (double)icon.getInterpolatedU(0D); + double u2 = (double)icon.getInterpolatedU(16.0D); + double v1 = (double)icon.getInterpolatedV(0D); + double v2 = (double)icon.getInterpolatedV(16.0D); + Tessellator tessellator = Tessellator.instance; + bindTexture(TextureMap.locationBlocksTexture); + tessellator.startDrawingQuads(); + tessellator.setColorOpaque_F(1f, 1f, 1f); + tessellator.addVertexWithUV(-0.5,-0.5, 0,u1,v1); + tessellator.addVertexWithUV( 0.5,-0.5, 0,u1,v2); + tessellator.addVertexWithUV( 0.5, 0.5, 0,u2,v2); + tessellator.addVertexWithUV(-0.5, 0.5, 0,u2,v1); + tessellator.draw(); + } + for (int i = 0; i < 128; i++) + { + GL11.glPushMatrix(); + float tx = random.nextFloat()-0.5f; + float ty = random.nextFloat()-0.5f; + GL11.glTranslatef(tx, ty, 0); + this.ihlItemRenderer.doRender(RenderManager.instance,stack, 0f, 0f, 0f); + GL11.glTranslatef(-tx, -ty, 0); + GL11.glPopMatrix(); + } + GL11.glViewport(0, 0, Display.getWidth(), Display.getHeight()); +// IHLRenderUtils.instance.disableAmbientLighting(); +} + +@Override +public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8) +{ + this.renderAModelAt((PileTileEntity)par1TileEntity, par2, par4, par6, par8); +} + +} \ No newline at end of file diff --git a/ihl/explosion/WorldSavedDataBlastWave.java b/ihl/explosion/WorldSavedDataBlastWave.java new file mode 100644 index 0000000..73019b9 --- /dev/null +++ b/ihl/explosion/WorldSavedDataBlastWave.java @@ -0,0 +1,108 @@ +package ihl.explosion; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.world.WorldSavedData; + +public class WorldSavedDataBlastWave extends WorldSavedData { + Map> data = new HashMap>(256); + + public WorldSavedDataBlastWave(String name) + { + super(name); + } + + @Override + public void readFromNBT(NBTTagCompound nbt) + { + if(nbt.hasKey("entryList")) + { + NBTTagList entryList=nbt.getTagList("entryList", 10); + for(int i=0;i blastWaveArraySet= new HashSet(); + for(int i1=0;i1>> dataESI = data.entrySet().iterator(); + while(dataESI.hasNext()) + { + Entry> dataEntry = dataESI.next(); + Iterator bwArrayI = dataEntry.getValue().iterator(); + NBTTagCompound chunk = new NBTTagCompound(); + NBTTagList blastWaveList = new NBTTagList(); + while(bwArrayI.hasNext()) + { + NBTTagCompound blastWave = new NBTTagCompound(); + Integer[] bwArray = bwArrayI.next(); + blastWave.setInteger("ev", bwArray[0]); + blastWave.setInteger("sourceX", bwArray[1]); + blastWave.setInteger("sourceY", bwArray[2]); + blastWave.setInteger("sourceZ", bwArray[3]); + blastWave.setInteger("power", bwArray[4]); + blastWave.setInteger("directionX", bwArray[5]); + blastWave.setInteger("directionY", bwArray[6]); + blastWave.setInteger("directionZ", bwArray[7]); + blastWaveList.appendTag(blastWave); + } + chunk.setTag("blastWaveList", blastWaveList); + chunk.setLong("chunkHash", dataEntry.getKey()); + entryList.appendTag(chunk); + } + nbt.setTag("entryList", entryList); + } + + public void scheduleExplosionEffectsOnChunkLoad(long chunkXZKey, int ev, int sourceX, int sourceY, int sourceZ, int power1, int[] directionMask) + { + Set waves; + if(data.containsKey(chunkXZKey)) + { + waves=data.get(chunkXZKey); + } + else + { + waves=new HashSet(1024); + data.put(chunkXZKey, waves); + } + Integer[] wave = new Integer[8]; + wave[0]=ev; + wave[1]=sourceX; + wave[2]=sourceY; + wave[3]=sourceZ; + wave[4]=power1; + wave[5]=directionMask[0]; + wave[6]=directionMask[1]; + wave[7]=directionMask[2]; + waves.add(wave); + } +} diff --git a/ihl/flexible_cable/AnchorBlock.java b/ihl/flexible_cable/AnchorBlock.java index 7c12b49..9d9c1dc 100644 --- a/ihl/flexible_cable/AnchorBlock.java +++ b/ihl/flexible_cable/AnchorBlock.java @@ -1,10 +1,5 @@ package ihl.flexible_cable; -import ic2.core.IC2; -import ic2.core.item.tool.ItemToolWrench; -import ihl.IHLCreativeTab; import ihl.IHLModInfo; -import ihl.enviroment.LightBulbTileEntity; -import ihl.utils.IHLUtils; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -12,19 +7,14 @@ import net.minecraft.block.Block; import net.minecraft.block.ITileEntityProvider; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.IIcon; -import net.minecraft.util.MathHelper; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; public class AnchorBlock extends Block implements ITileEntityProvider { - private String unlocalizedName; private IIcon blockIconSide; public AnchorBlock(String unlocalizedName1) @@ -170,7 +160,6 @@ public class AnchorBlock extends Block implements ITileEntityProvider { { AnchorTileEntity ate = (AnchorTileEntity) te; float portSize=0.1f; - boolean firstBB=false; float bbMinX = 1f; float bbMaxX = 0f; float bbMinY = 1f; diff --git a/ihl/flexible_cable/AnchorTileEntity.java b/ihl/flexible_cable/AnchorTileEntity.java index b9057ba..b03a3d9 100644 --- a/ihl/flexible_cable/AnchorTileEntity.java +++ b/ihl/flexible_cable/AnchorTileEntity.java @@ -8,8 +8,6 @@ import ic2.api.energy.tile.IEnergySource; import ic2.core.ExplosionIC2; import ic2.core.IC2; import ic2.core.block.TileEntityBlock; -import ihl.IHLMod; -import ihl.interfaces.ICableHolder; import ihl.interfaces.IEnergyNetNode; import ihl.interfaces.IMultiPowerCableHolder; import ihl.utils.IHLUtils; @@ -19,15 +17,11 @@ import java.util.Iterator; import java.util.List; import java.util.Set; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.util.ForgeDirection; @@ -406,6 +400,7 @@ public class AnchorTileEntity extends TileEntityBlock implements IEnergySink, IE } } + @Override public boolean isCableRemoved(int chainUniqueID) { if(!checkCables) diff --git a/ihl/flexible_cable/BatterySwitchUnitTileEntity.java b/ihl/flexible_cable/BatterySwitchUnitTileEntity.java index 375cb21..f4fc6c1 100644 --- a/ihl/flexible_cable/BatterySwitchUnitTileEntity.java +++ b/ihl/flexible_cable/BatterySwitchUnitTileEntity.java @@ -12,19 +12,12 @@ import ic2.api.energy.tile.IEnergySource; import ic2.api.network.INetworkClientTileEntityEventListener; import ic2.core.ExplosionIC2; import ic2.core.IC2; -import ic2.core.block.TileEntityBlock; -import ihl.IHLMod; -import ihl.flexible_cable.IHLGrid; -import ihl.flexible_cable.NodeEntity; -import ihl.interfaces.IEnergyNetNode; import ihl.utils.IHLUtils; -import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.server.MinecraftServer; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.util.ForgeDirection; diff --git a/ihl/flexible_cable/FlexibleCableHolderBaseTileEntity.java b/ihl/flexible_cable/FlexibleCableHolderBaseTileEntity.java index ee8ebf7..34455ac 100644 --- a/ihl/flexible_cable/FlexibleCableHolderBaseTileEntity.java +++ b/ihl/flexible_cable/FlexibleCableHolderBaseTileEntity.java @@ -1,18 +1,10 @@ package ihl.flexible_cable; -import java.util.ArrayList; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Set; -import ic2.api.energy.event.EnergyTileLoadEvent; -import ic2.api.energy.event.EnergyTileUnloadEvent; -import ic2.api.energy.tile.IEnergySource; -import ic2.api.network.INetworkClientTileEntityEventListener; -import ic2.core.ExplosionIC2; -import ic2.core.IC2; -import ic2.core.block.TileEntityBlock; import ic2.core.block.TileEntityInventory; import ihl.IHLMod; import ihl.flexible_cable.IHLGrid; @@ -20,16 +12,10 @@ import ihl.flexible_cable.NodeEntity; import ihl.interfaces.IEnergyNetNode; import ihl.utils.IHLUtils; import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; -import net.minecraft.server.MinecraftServer; -import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.util.ForgeDirection; public abstract class FlexibleCableHolderBaseTileEntity extends TileEntityInventory implements IEnergyNetNode{ @@ -43,7 +29,7 @@ public abstract class FlexibleCableHolderBaseTileEntity extends TileEntityInvent public FlexibleCableHolderBaseTileEntity() { super(); - cableList=new HashSet(); + cableList=new HashSet(); } @Override @@ -57,6 +43,7 @@ public abstract class FlexibleCableHolderBaseTileEntity extends TileEntityInvent } } + @SuppressWarnings("unchecked") @Override public void setFacing(short facing1) { @@ -70,7 +57,7 @@ public abstract class FlexibleCableHolderBaseTileEntity extends TileEntityInvent setConnectionZ(this.zCoord+0.5D); if(!nodeList.isEmpty()) { - Iterator ei = nodeList.iterator(); + Iterator ei = nodeList.iterator(); while(ei.hasNext()) { NodeEntity ne=(NodeEntity) ei.next(); @@ -174,7 +161,6 @@ public abstract class FlexibleCableHolderBaseTileEntity extends TileEntityInvent if(newGridID!=-1) { this.gridID=newGridID; - IHLGrid newGrid = IHLMod.enet.getGrid(newGridID); IHLMod.enet.getGrid(newGridID).add(this); } else diff --git a/ihl/flexible_cable/IHLENet.java b/ihl/flexible_cable/IHLENet.java index 2429aa7..32b5ebf 100644 --- a/ihl/flexible_cable/IHLENet.java +++ b/ihl/flexible_cable/IHLENet.java @@ -12,8 +12,8 @@ import net.minecraft.nbt.NBTTagCompound; public class IHLENet { - public Map grids = new HashMap(); - public Map cablesToGrids = new HashMap(); + public Map grids = new HashMap(); + public Map cablesToGrids = new HashMap(); private int griduid=0; diff --git a/ihl/flexible_cable/IHLGrid.java b/ihl/flexible_cable/IHLGrid.java index 04a9d4c..a47c229 100644 --- a/ihl/flexible_cable/IHLGrid.java +++ b/ihl/flexible_cable/IHLGrid.java @@ -18,22 +18,21 @@ import net.minecraft.server.MinecraftServer; public class IHLGrid { private static final double powerLossLimitPerMeter=1.6D; - public final Set telist = new HashSet(); + public final Set telist = new HashSet(); public double energy=0D; private IEnergyNetNode sink; private IEnergyNetNode source; private double voltage; - private short frequency=0; private double lastVoltage; public boolean isGridValid=true; private double total20TicksEU; private int lastTickCounter=0; private int tickCounterFireStart=0; - public final List calculatedSinks = new ArrayList(); - public final List calculatedSources = new ArrayList(); - public final Set cablesOnFire = new HashSet(); - private final Map energyLossSinkMap = new HashMap(); - private final Map voltageSinkMap = new HashMap(); + public final List calculatedSinks = new ArrayList(); + public final List calculatedSources = new ArrayList(); + public final Set cablesOnFire = new HashSet (); + private final Map energyLossSinkMap = new HashMap(); + private final Map voltageSinkMap = new HashMap(); private double averageEUTransfered; private double lastAverageEUTransfered=0D; @@ -151,10 +150,10 @@ public class IHLGrid this.averageEUTransfered>this.lastAverageEUTransfered || this.voltage!=this.lastVoltage)) { - Map map = new HashMap(); - Set templist = new HashSet(); - Set processlist = new HashSet(); - Set templist2 = new HashSet(); + Map map = new HashMap(); + Set templist = new HashSet(); + Set processlist = new HashSet(); + Set templist2 = new HashSet(); templist.addAll(telist); processlist.add(sink); int threads=0; diff --git a/ihl/flexible_cable/InvSlotOutputInProgress.java b/ihl/flexible_cable/InvSlotOutputInProgress.java index 2b5bfda..3694aee 100644 --- a/ihl/flexible_cable/InvSlotOutputInProgress.java +++ b/ihl/flexible_cable/InvSlotOutputInProgress.java @@ -79,7 +79,7 @@ public class InvSlotOutputInProgress extends IronWorkbenchInvSlot{ public List getRecipeOutputs(int currentSlot) { int slotRecipeIndex=this.slotRecipe[currentSlot]; - List list = new ArrayList(); + List list = new ArrayList(); for(int i=0;i materials, int multiplier) + public Set substract(List materials, int multiplier) { + Set output = new HashSet(); Iterator i1 = materials.iterator(); while(i1.hasNext()) { @@ -59,6 +64,25 @@ public class InvSlotProcessableIronWorkbench extends IronWorkbenchInvSlot { is.stackSize=0; } } + else if(is1 instanceof RecipeInputFluidContainer) + { + if(is.stackSize==1) + { + output.add(FluidContainerRegistry.drainFluidContainer(is)); + is.stackSize=0; + } + else + { + is.stackSize-=is1.getAmount()*multiplier; + ItemStack iscopy = is.copy(); + iscopy.stackSize=1; + ItemStack emptyContainer = FluidContainerRegistry.drainFluidContainer(iscopy); + if(emptyContainer!=null) + { + output.add(emptyContainer); + } + } + } else { is.stackSize-=is1.getAmount()*multiplier; @@ -71,6 +95,7 @@ public class InvSlotProcessableIronWorkbench extends IronWorkbenchInvSlot { } } } + return output; } public int getAmountOf(ItemStack rubber) diff --git a/ihl/flexible_cable/InvSlotTool.java b/ihl/flexible_cable/InvSlotTool.java index b3a3855..0ffbcd9 100644 --- a/ihl/flexible_cable/InvSlotTool.java +++ b/ihl/flexible_cable/InvSlotTool.java @@ -9,77 +9,61 @@ import ic2.core.IC2; import ic2.core.Ic2Items; import ic2.core.item.ItemUpgradeModule; import ihl.interfaces.IWire; +import ihl.recipes.IronWorkbenchRecipe; import ihl.utils.IHLUtils; public class InvSlotTool extends IronWorkbenchInvSlot { - public InvSlotTool(IronWorkbenchTileEntity base1, String name1, - int oldStartIndex1, Access access1, int count) { + public InvSlotTool(IronWorkbenchTileEntity base1, String name1, int oldStartIndex1, Access access1, int count) { super(base1, name1, oldStartIndex1, access1, count); // TODO Auto-generated constructor stub } - public void damage(List tools) - { - if(tools!=null && !tools.isEmpty()) - { - for(int i=0;i tools) { + if (tools != null && !tools.isEmpty()) { + for (int i = 0; i < this.size(); i++) { ItemStack is = this.get(i); - Iterator i1 = tools.iterator(); - while(i1.hasNext()) - { + Iterator i1 = tools.iterator(); + while (i1.hasNext()) { IRecipeInput is1 = i1.next(); - if(is!=null && (is1.matches(is))) - { - if(!is.attemptDamageItem(1, IC2.random)) - { - if(is.stackTagCompound!=null && is.stackTagCompound.hasKey("GT.ToolStats")) - { + if (is != null && (is1.matches(is))) { + if (!is.attemptDamageItem(1, IC2.random)) { + if (is.stackTagCompound != null && is.stackTagCompound.hasKey("GT.ToolStats")) { IHLUtils.damageItemViaNBTTag(is, 1); } } - if(is.stackSize<=0) - { - this.put(i,null); + if (is.stackSize <= 0) { + this.put(i, null); } } } } } } - + @Override - public void put(int index, ItemStack content) - { + public void put(int index, ItemStack content) { super.put(index, content); - if(IC2.platform.isSimulating() && ((IronWorkbenchTileEntity)this.base).container!=null) - { - ((IronWorkbenchTileEntity)this.base).resetOutput(); - ((IronWorkbenchTileEntity)this.base).container.detectAndSendChanges(); + if (IC2.platform.isSimulating() && ((IronWorkbenchTileEntity) this.base).container != null) { + ((IronWorkbenchTileEntity) this.base).resetOutput(); + ((IronWorkbenchTileEntity) this.base).container.detectAndSendChanges(); } - } - + } + @Override - public boolean accepts(ItemStack itemStack) - { - if (itemStack != null && (itemStack.getItem() instanceof ItemUpgradeModule || itemStack.getItem() instanceof IWire|| itemStack.getItem()==Ic2Items.rubber.getItem())) - { - return false; - } - else - { - return true; - } - } + public boolean accepts(ItemStack itemStack) { + for (IronWorkbenchRecipe recipe : IronWorkbenchTileEntity.recipes) { + if (recipe.isTool(itemStack)) { + return true; + } + } + return false; + } - public boolean contain(ItemStack is1) - { - for(int i=0;i getItemStackList() { - List list = new ArrayList(); + List list = new ArrayList(); for(int i=1; i { protected IronWorkbenchTileEntity tileEntity; private int lastProgress1 = -1; @@ -37,14 +37,14 @@ public class IronWorkbenchContainer extends ContainerBase { { for(col=0;col<=1;col++) { - this.addSlotToContainer(new SlotInvSlot(tileEntity1.tools, row+col*6, 26+col*18, 8+row*18)); + this.addSlotToContainer(new SlotInvSlotIronWorkbench(tileEntity1.tools, row+col*6, 26+col*18, 8+row*18)); } } for(row=0;row<6;row++) { for(col=0;col<=1;col++) { - this.addSlotToContainer(new SlotInvSlot(tileEntity1.inputMaterial, row+col*6, 65+col*18, 8+row*18)); + this.addSlotToContainer(new SlotInvSlotIronWorkbench(tileEntity1.inputMaterial, row+col*6, 65+col*18, 8+row*18)); } } for (row = 0; row<6; ++row) diff --git a/ihl/flexible_cable/IronWorkbenchGui.java b/ihl/flexible_cable/IronWorkbenchGui.java index 131f2f7..dedb9d8 100644 --- a/ihl/flexible_cable/IronWorkbenchGui.java +++ b/ihl/flexible_cable/IronWorkbenchGui.java @@ -9,7 +9,6 @@ import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; -import ic2.core.network.NetworkManager; import ihl.interfaces.IItemHasMiniGUI; import ihl.interfaces.ItemMiniGUI; import ihl.utils.IHLRenderUtils; @@ -22,20 +21,11 @@ public class IronWorkbenchGui extends GuiContainer { private static final short outputslotoffset=66; public IronWorkbenchGui (IronWorkbenchContainer container1) { - //the container is instanciated and passed to the superclass for handling super(container1); this.container=container1; this.ySize=IronWorkbenchContainer.height; } - @Override - public void initGui() - { - super.initGui(); - int x = (width - xSize) / 2; - int y = (height - ySize) / 2; - } - @Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { @@ -103,7 +93,6 @@ public class IronWorkbenchGui extends GuiContainer { this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); if (this.container.tileEntity.progress > 0) { - int progressLevel=Math.min(Math.round(this.container.tileEntity.progress*16.0F/this.container.tileEntity.maxProgress),16); int frameNum=0; short slotRecipeNum=this.container.tileEntity.output.slotRecipe[0]; for(int row = 0;row<6;row++) diff --git a/ihl/flexible_cable/IronWorkbenchInvSlot.java b/ihl/flexible_cable/IronWorkbenchInvSlot.java index 830f9b4..380b6d3 100644 --- a/ihl/flexible_cable/IronWorkbenchInvSlot.java +++ b/ihl/flexible_cable/IronWorkbenchInvSlot.java @@ -15,7 +15,7 @@ public class IronWorkbenchInvSlot extends InvSlot { public List getItemStackList() { - List list = new ArrayList(); + List list = new ArrayList(); for(int i=0; i= 4 ? -0.5f : 0f; - float ix = (index % 2) * 0.4f-0.2f; - float iz = (index / 2) * 0.4f-0.2f + iy; - this.itemRenderer.doRender(RenderManager.instance,tile.tools.get(i),ix,iz,iy-0.002f*index); - index++; - } - } - GL11.glPopMatrix(); -} - - @Override - public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8) - { - this.renderAModelAt((IronWorkbenchTileEntity)par1TileEntity, par2, par4, par6, par8); - } -} diff --git a/ihl/flexible_cable/IronWorkbenchTileEntity.java b/ihl/flexible_cable/IronWorkbenchTileEntity.java index 3821a0c..73a3eb1 100644 --- a/ihl/flexible_cable/IronWorkbenchTileEntity.java +++ b/ihl/flexible_cable/IronWorkbenchTileEntity.java @@ -3,9 +3,11 @@ package ihl.flexible_cable; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; +import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.Set; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -14,29 +16,26 @@ import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; import ic2.api.network.INetworkClientTileEntityEventListener; import ic2.api.network.INetworkTileEntityEventListener; import ic2.api.recipe.IRecipeInput; -import ic2.api.recipe.RecipeInputItemStack; import ic2.core.ContainerBase; -import ic2.core.IC2; import ic2.core.IHasGui; -import ic2.core.Ic2Items; import ic2.core.block.TileEntityInventory; import ic2.core.block.invslot.InvSlot.Access; import ihl.IHLMod; import ihl.interfaces.IWire; -import ihl.items_blocks.FlexibleCableItem; -import ihl.processing.chemistry.GaedesMercuryRotaryPumpTileEntity; -import ihl.processing.metallurgy.GasWeldingStationTileEntity; import ihl.recipes.IronWorkbenchRecipe; +import ihl.recipes.RecipeInputDetonator; import ihl.recipes.RecipeInputDie; import ihl.recipes.RecipeInputObjectInstance; import ihl.utils.IHLUtils; public class IronWorkbenchTileEntity extends TileEntityInventory implements IHasGui, INetworkClientTileEntityEventListener, INetworkTileEntityEventListener{ - public static List recipes = new ArrayList(); + public static List recipes = new ArrayList(); public int progress; public int currentSlot=-1; public final int maxProgress; @@ -49,7 +48,8 @@ public class IronWorkbenchTileEntity extends TileEntityInventory implements IHas private boolean outputDefined=false; private EntityPlayer crafter; public ContainerBase container; - private Map slotRecipeMap = new HashMap(); + private Map slotRecipeMap = new HashMap(); + private boolean firstTick = true; public IronWorkbenchTileEntity() { @@ -77,7 +77,18 @@ public class IronWorkbenchTileEntity extends TileEntityInventory implements IHas { return IHLUtils.getThisModItemStack("ironWorkbench"); } - + + @Override + @SideOnly(Side.CLIENT) + public void updateEntityClient() + { + if(firstTick) + { + IHLMod.proxy.requestTileEntityInitdataFromClientToServer(xCoord, yCoord, zCoord); + this.firstTick=false; + } + } + @Override public void updateEntityServer() { @@ -102,6 +113,13 @@ public class IronWorkbenchTileEntity extends TileEntityInventory implements IHas newOutputs = ((RecipeInputDie)rinput).transformOutput(this.getMatchedItemStack(rinput),recipe.outputs); } } + for(IRecipeInput rinput:recipe.materials) + { + if(rinput instanceof RecipeInputDetonator) + { + newOutputs = ((RecipeInputDetonator)rinput).transformOutput(this.getMatchedItemStack(rinput),recipe.outputs); + } + } int slot = this.output.put(newOutputs); if(slot<0)break; slotRecipeMap.put(slot, recipe); @@ -109,7 +127,6 @@ public class IronWorkbenchTileEntity extends TileEntityInventory implements IHas } } } - List processingMaterials = new ArrayList(); for(int i=0; i crafterEmptyInventorySlotsList = getCrafterEmptyInventorySlotsList(); + Set crafterEmptyInventorySlotsList = getCrafterEmptyInventorySlotsList(); if(startProcess && crafterEmptyInventorySlotsList.size()>=this.slotRecipeMap.get(currentSlot).outputs.size()) { if(++this.progress>=this.maxProgress) @@ -150,10 +167,8 @@ public class IronWorkbenchTileEntity extends TileEntityInventory implements IHas { int slot = emptySlotsIterator.next(); ItemStack stack = optsi.next(); - this.crafter.inventory.mainInventory[slot]=stack.copy(); if(stack.getItem() instanceof IWire) { - System.out.println(multiplier); this.crafter.inventory.mainInventory[slot]=IHLUtils.getWireItemStackCopyWithLengthMultiplied(stack,multiplier); } else @@ -162,8 +177,23 @@ public class IronWorkbenchTileEntity extends TileEntityInventory implements IHas this.crafter.inventory.mainInventory[slot].stackSize*=multiplier; } } + Iterator emptyContainers = this.inputMaterial.substract(crecipe.materials, multiplier).iterator(); + while(emptyContainers.hasNext()) + { + if(emptySlotsIterator.hasNext()) + { + int slot = emptySlotsIterator.next(); + ItemStack stack = emptyContainers.next(); + this.crafter.inventory.mainInventory[slot]=stack.copy(); + this.crafter.inventory.mainInventory[slot].stackSize*=multiplier; + } + else + { + EntityItem eistack = new EntityItem(this.worldObj, this.xCoord, this.yCoord+1, this.zCoord, emptyContainers.next()); + this.worldObj.spawnEntityInWorld(eistack); + } + } this.crafter.inventoryContainer.detectAndSendChanges(); - this.inputMaterial.substract(crecipe.materials, multiplier); this.tools.damage(crecipe.tools); if(!crecipe.workspaceElements.isEmpty()) { @@ -196,9 +226,9 @@ public class IronWorkbenchTileEntity extends TileEntityInventory implements IHas return null; } - private List getCrafterEmptyInventorySlotsList() + private Set getCrafterEmptyInventorySlotsList() { - List list = new ArrayList(); + Set list = new HashSet(4); if(this.crafter!=null) { for (int var1 = 0; var1 < this.crafter.inventory.mainInventory.length; ++var1) @@ -213,7 +243,7 @@ public class IronWorkbenchTileEntity extends TileEntityInventory implements IHas } private List getListOfSameWires(ItemStack stack1) { - List list = new ArrayList(); + List list = new ArrayList(); for(int i=0; i recipes = new ArrayList(); - public int progress; - public int currentSlot=-1; - public final int maxProgress; - public final InvSlotTool tools; - public final InvSlotWorkspaceElement workspaceElements; - public final InvSlotProcessableIronWorkbench inputMaterial; - public final InvSlotOutputInProgress output; - public boolean isGuiScreenOpened=false; - private boolean startProcess=false; - private boolean outputDefined=false; - private EntityPlayer crafter; - public ContainerBase container; - private Map slotRecipeMap = new HashMap(); - - public IronWorkbenchTileEntity() - { - this.maxProgress=80; - this.workspaceElements = new InvSlotWorkspaceElement(this, "workspaceElements", 3, Access.NONE, 6); - this.tools=new InvSlotTool(this, "tools", 0, Access.IO, 12); - this.inputMaterial=new InvSlotProcessableIronWorkbench(this, "input", 1, Access.IO, 12); - this.output=new InvSlotOutputInProgress(this, "output", 2, 18); - } - - public static void addRecipe(IronWorkbenchRecipe recipe) - { - IronWorkbenchTileEntity.recipes.add(recipe); - } - - @Override - public String getInventoryName() - { - return "ironWorkbench"; - } - - - @Override - public ItemStack getWrenchDrop(EntityPlayer player) - { - return IHLUtils.getThisModItemStack("ironWorkbench"); - } - - @Override - public void updateEntityServer() - { - if(this.isGuiScreenOpened) - { - if(this.output.isEmpty() && !outputDefined) - { - this.workspaceElements.reset(); - Iterator iwri=IronWorkbenchTileEntity.recipes.iterator(); - while(iwri.hasNext()) - { - IronWorkbenchRecipe recipe = iwri.next(); - if(recipe.isCanBeCrafted(this.tools.getItemStackList(), this.inputMaterial.getItemStackList(), this.workspaceElements.getItemStackList())) - { - if(recipe.workspaceElements==null || recipe.workspaceElements.isEmpty() || this.workspaceElements.containsAndCanUse(recipe.workspaceElements)) - { - List newOutputs = recipe.outputs; - for(IRecipeInput rinput:recipe.tools) - { - if(rinput instanceof RecipeInputDie) - { - newOutputs = ((RecipeInputDie)rinput).transformOutput(this.getMatchedItemStack(rinput),recipe.outputs); - } - } - int slot = this.output.put(newOutputs); - if(slot<0)break; - slotRecipeMap.put(slot, recipe); - this.startProcess=false; - } - } - } - List processingMaterials = new ArrayList(); - for(int i=0; i list = this.getListOfSameWires(stack); - ItemStack result = stack.copy(); - result.stackTagCompound.setInteger("length", fullLength); - result.stackTagCompound.setInteger("fullLength", fullLength); - IronWorkbenchRecipe recipe = new IronWorkbenchRecipe(null, list, Arrays.asList(new ItemStack[] {result})); - int slot = this.output.put(recipe.outputs); - if(slot<0)break; - slotRecipeMap.put(slot, recipe); - this.startProcess=false; - break; - } - } - outputDefined=true; - } - else if(!this.output.isEmpty()) - { - List crafterEmptyInventorySlotsList = getCrafterEmptyInventorySlotsList(); - if(startProcess && crafterEmptyInventorySlotsList.size()>=this.slotRecipeMap.get(currentSlot).outputs.size()) - { - if(++this.progress>=this.maxProgress) - { - IronWorkbenchRecipe crecipe = this.slotRecipeMap.get(currentSlot); - List opts = this.output.getRecipeOutputs(currentSlot); - int multiplier = this.inputMaterial.getMultiplier(crecipe.materials); - Iterator optsi = opts.iterator(); - Iterator emptySlotsIterator = crafterEmptyInventorySlotsList.iterator(); - while(optsi.hasNext()) - { - int slot = emptySlotsIterator.next(); - ItemStack stack = optsi.next(); - this.crafter.inventory.mainInventory[slot]=stack.copy(); - if(stack.getItem() instanceof IWire) - { - System.out.println(multiplier); - this.crafter.inventory.mainInventory[slot]=IHLUtils.getWireItemStackCopyWithLengthMultiplied(stack,multiplier); - } - else - { - this.crafter.inventory.mainInventory[slot]=stack.copy(); - this.crafter.inventory.mainInventory[slot].stackSize*=multiplier; - } - } - this.crafter.inventoryContainer.detectAndSendChanges(); - this.inputMaterial.substract(crecipe.materials, multiplier); - this.tools.damage(crecipe.tools); - if(!crecipe.workspaceElements.isEmpty()) - { - this.workspaceElements.use(crecipe.workspaceElements); - } - this.resetOutput(); - } - } - } - } - } - - private ItemStack getMatchedItemStack(IRecipeInput rinput) - { - for(ItemStack tool:this.tools.getItemStackList()) - { - if(rinput.matches(tool)) - { - return tool; - } - } - for(ItemStack material:this.inputMaterial.getItemStackList()) - { - if(rinput.matches(material)) - { - return material; - } - } - - return null; - } - - private List getCrafterEmptyInventorySlotsList() - { - List list = new ArrayList(); - if(this.crafter!=null) - { - for (int var1 = 0; var1 < this.crafter.inventory.mainInventory.length; ++var1) - { - if (this.crafter.inventory.mainInventory[var1] == null) - { - list.add(var1); - } - } - } - return list; - } - - private List getListOfSameWires(ItemStack stack1) { - List list = new ArrayList(); - for(int i=0; i getGuiContainer(EntityPlayer player) { - resetOutput(); - this.isGuiScreenOpened=true; - this.crafter=player; - container = new IronWorkbenchContainer(player, this); - return container; - } - - @Override - public void onGuiClosed(EntityPlayer arg0) - { - this.isGuiScreenOpened=false; - } - - @Override - public void onNetworkEvent(EntityPlayer player, int event) - { - if(event==16) - { - this.isGuiScreenOpened=false; - this.crafter=null; - this.container=null; - return; - } - for(int i=event;i>=0;i--) - { - if(this.slotRecipeMap.containsKey(i)) - { - if(!this.slotRecipeMap.get(i).isCanBeCrafted(this.tools.getItemStackList(), this.inputMaterial.getItemStackList(), this.workspaceElements.getItemStackList())) - { - resetOutput(); - } - else - { - this.currentSlot=i; - this.startProcess=true; - return; - } - } - } - } - - public void resetOutput() - { - this.output.clear(); - this.slotRecipeMap.clear(); - this.progress=0; - this.startProcess=false; - this.currentSlot=-1; - this.outputDefined=false; - } - - - public void dropContents() { - for(int i=0;i recipeOutputsItems) - { - Iterator ri = recipes.iterator(); - while(ri.hasNext()) - { - IronWorkbenchRecipe recipe = ri.next(); - boolean removeEntry=false; - Iterator roi = recipe.outputs.iterator(); - while(roi.hasNext()) - { - if(IHLUtils.isItemStacksIsEqual(recipeOutputsItems.get(0), roi.next(), true)) - { - removeEntry=true; - } - } - if(removeEntry) - { - ri.remove(); - } - } - - } - - public static void removeRecipeByInput(List recipeInputsTools1,List recipeInputsItems1,List recipeInputsMachines) { - List recipeInputsTools = IHLUtils.convertRecipeInputToItemStackList(recipeInputsTools1); - List recipeInputsItems = IHLUtils.convertRecipeInputToItemStackList(recipeInputsItems1); - Iterator ri = recipes.iterator(); - while(ri.hasNext()) - { - IronWorkbenchRecipe recipe = ri.next(); - if(recipe.isCanBeCrafted(recipeInputsTools, recipeInputsItems, recipeInputsMachines)) - { - ri.remove(); - } - } - - } - -} diff --git a/ihl/flexible_cable/NodeEntity.java b/ihl/flexible_cable/NodeEntity.java index 623c9a1..b734cd1 100644 --- a/ihl/flexible_cable/NodeEntity.java +++ b/ihl/flexible_cable/NodeEntity.java @@ -6,36 +6,25 @@ import java.util.Iterator; import java.util.List; import java.util.Set; -import org.lwjgl.opengl.GL11; - -import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; import cpw.mods.fml.common.network.internal.FMLProxyPacket; import ihl.IHLMod; import ihl.IHLModInfo; import ihl.interfaces.ICableHolder; -import ihl.interfaces.IDataCableHolder; -import ihl.interfaces.IEnergyNetNode; import ihl.interfaces.IMultiPowerCableHolder; import ihl.interfaces.INetworkListener; import ihl.items_blocks.FlexibleCableItem; -import ihl.utils.IHLUtils; import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBufInputStream; import io.netty.buffer.ByteBufOutputStream; import io.netty.buffer.Unpooled; import net.minecraft.block.Block; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.Tessellator; import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTBase; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; import net.minecraft.server.MinecraftServer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; @@ -109,6 +98,7 @@ public class NodeEntity extends Entity implements INetworkListener{ @Override public void travelToDimension(int dimensionId){} + @Override public void setSize(float width, float heigth) { super.setSize(width, heigth); @@ -122,6 +112,7 @@ public class NodeEntity extends Entity implements INetworkListener{ this.registerAndSendData(null); } + @Override public void registerAndSendData(EntityPlayerMP player) { if(!worldObj.isRemote) @@ -135,7 +126,7 @@ public class NodeEntity extends Entity implements INetworkListener{ } else { - nes=new HashSet(); + nes=new HashSet(); IHLMod.proxy.nodeEntityRegistry.put(this.getChainUniqueID(),nes); } nes.add(this); @@ -172,7 +163,8 @@ public class NodeEntity extends Entity implements INetworkListener{ } } - @Override + @SuppressWarnings("unchecked") + @Override public void onUpdate() { super.onUpdate(); @@ -194,7 +186,7 @@ public class NodeEntity extends Entity implements INetworkListener{ List eItemsList = this.worldObj.getEntitiesWithinAABB(NodeEntity.class, searchArea); if(!eItemsList.isEmpty()) { - Iterator ei = eItemsList.iterator(); + Iterator ei = eItemsList.iterator(); while(ei.hasNext()) { NodeEntity node=(NodeEntity) ei.next(); @@ -227,7 +219,7 @@ public class NodeEntity extends Entity implements INetworkListener{ List eItemsList = this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, searchArea); if(!eItemsList.isEmpty()) { - Iterator ei = eItemsList.iterator(); + Iterator ei = eItemsList.iterator(); while(ei.hasNext()) { EntityPlayer player=(EntityPlayer) ei.next(); @@ -415,15 +407,10 @@ public class NodeEntity extends Entity implements INetworkListener{ xi=(dx1-2*x1+2*dx0+2*x0-dx0)*i*i*i+(3*x1-dx1-3*dx0-3*x0+dx0)*i*i+dx0*i+x0; yi=(dy1-2*y1+2*dy0+2*y0-dy0)*i*i*i+(3*y1-dy1-3*dy0-3*y0+dy0)*i*i+dy0*i+y0; zi=(dz1-2*z1+2*dz0+2*z0-dz0)*i*i*i+(3*z1-dz1-3*dz0-3*z0+dz0)*i*i+dz0*i+z0; - int blockX=(int)xi; - int blockY=(int)yi; - int blockZ=(int)zi; dxi-=xi; dyi-=yi; dzi-=zi; double var7 = MathHelper.sqrt_double(dxi * dxi + dzi * dzi); - float var9 = (float)(Math.atan2(dzi, dxi) * 180.0D / Math.PI) - 90.0F; - float var10 = (float)(-(Math.atan2(dyi, var7) * 180.0D / Math.PI)); float rotationPitch = (float) Math.atan2(dxi, dzi); float rotationYaw = (float) (-Math.atan2(dyi, var7)); rotationPitchArray[i1]=rotationPitch; diff --git a/ihl/flexible_cable/NodeRender.java b/ihl/flexible_cable/NodeRender.java index 61c272b..157be67 100644 --- a/ihl/flexible_cable/NodeRender.java +++ b/ihl/flexible_cable/NodeRender.java @@ -1,19 +1,11 @@ package ihl.flexible_cable; import ihl.IHLModInfo; -import ihl.model.IHLModelRenderer; import ihl.model.ModelTube; -import ihl.utils.IHLMathUtils; -import ihl.utils.IHLRenderUtils; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelBox; -import net.minecraft.client.renderer.ActiveRenderInfo; -import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.entity.Render; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.entity.Entity; -import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.util.ForgeDirection; @@ -26,7 +18,6 @@ public class NodeRender extends Render private ModelTube modelThin; private ResourceLocation tex; private float scale; - private boolean firstTick=true; public NodeRender() { diff --git a/ihl/flexible_cable/PowerCableNodeEntity.java b/ihl/flexible_cable/PowerCableNodeEntity.java index 42d07fd..ed5a7ea 100644 --- a/ihl/flexible_cable/PowerCableNodeEntity.java +++ b/ihl/flexible_cable/PowerCableNodeEntity.java @@ -1,34 +1,22 @@ package ihl.flexible_cable; -import java.util.ArrayList; import java.util.HashSet; -import java.util.Iterator; import java.util.List; import java.util.Set; -import ic2.api.network.INetworkClientTileEntityEventListener; -import ic2.core.IC2; import ic2.core.IC2DamageSource; import ic2.core.item.armor.ItemArmorHazmat; import ihl.IHLMod; import ihl.IHLModInfo; -import ihl.interfaces.IDataCableHolder; import ihl.interfaces.IEnergyNetNode; import ihl.utils.IHLUtils; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.network.play.server.S26PacketMapChunkBulk; import net.minecraft.network.play.server.S29PacketSoundEffect; import net.minecraft.network.play.server.S2APacketParticles; -import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.MathHelper; import net.minecraft.world.World; public class PowerCableNodeEntity extends NodeEntity implements IEnergyNetNode{ @@ -56,6 +44,8 @@ public class PowerCableNodeEntity extends NodeEntity implements IEnergyNetNode{ return !worldObj.isRemote && !this.noClip; } + @SuppressWarnings("unchecked") + @Override public void onUpdate() { super.onUpdate(); @@ -191,7 +181,7 @@ public class PowerCableNodeEntity extends NodeEntity implements IEnergyNetNode{ public Set getCableList() { if(cableList==null) { - cableList=new HashSet(1); + cableList=new HashSet(1); if(this.cable!=null) { cableList.add(this.cable); diff --git a/ihl/flexible_cable/RectifierTransformerUnitTileEntity.java b/ihl/flexible_cable/RectifierTransformerUnitTileEntity.java index 1d13d0a..484df85 100644 --- a/ihl/flexible_cable/RectifierTransformerUnitTileEntity.java +++ b/ihl/flexible_cable/RectifierTransformerUnitTileEntity.java @@ -1,6 +1,5 @@ package ihl.flexible_cable; -import java.util.Iterator; import java.util.List; import ic2.api.energy.event.EnergyTileLoadEvent; @@ -8,15 +7,10 @@ import ic2.api.energy.event.EnergyTileUnloadEvent; import ic2.api.energy.tile.IEnergySink; import ic2.api.network.INetworkClientTileEntityEventListener; import ic2.core.IC2; -import ic2.core.block.TileEntityBlock; import ic2.core.block.TileEntityInventory; -import ihl.IHLMod; -import ihl.flexible_cable.IHLGrid; -import ihl.flexible_cable.NodeEntity; import ihl.interfaces.IEnergyNetNode; import ihl.interfaces.IMultiPowerCableHolder; import ihl.utils.IHLUtils; -import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -280,6 +274,7 @@ public class RectifierTransformerUnitTileEntity extends TileEntityInventory impl return amount; } + @Override public boolean isCableRemoved(int chainUniqueID) { if(!checkCables) diff --git a/ihl/flexible_cable/SetOfDiesMiniGUI.java b/ihl/flexible_cable/SetOfDiesMiniGUI.java index c00a19b..43f905d 100644 --- a/ihl/flexible_cable/SetOfDiesMiniGUI.java +++ b/ihl/flexible_cable/SetOfDiesMiniGUI.java @@ -1,9 +1,6 @@ package ihl.flexible_cable; import java.awt.event.KeyEvent; -import java.awt.event.KeyListener; -import java.util.regex.Pattern; - import org.lwjgl.opengl.GL11; import net.minecraft.client.gui.GuiTextField; @@ -20,7 +17,6 @@ public class SetOfDiesMiniGUI extends ItemMiniGUI private static final ResourceLocation background = new ResourceLocation("ihl", "textures/gui/GUIIronWorkbench.png"); private int transverseSectionValue; private GuiTextField transverseSectionTextField; - private boolean leftMouseButtonPressed=false; private int xPos; private int yPos; diff --git a/ihl/flexible_cable/SubAnchorEnergyNetNode.java b/ihl/flexible_cable/SubAnchorEnergyNetNode.java index 6b84dd8..33f9fb3 100644 --- a/ihl/flexible_cable/SubAnchorEnergyNetNode.java +++ b/ihl/flexible_cable/SubAnchorEnergyNetNode.java @@ -1,13 +1,9 @@ package ihl.flexible_cable; import java.util.HashSet; -import java.util.Iterator; import java.util.Set; import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTBase; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.tileentity.TileEntity; @@ -16,9 +12,7 @@ import net.minecraftforge.common.util.ForgeDirection; import ic2.api.energy.EnergyNet; import ic2.api.energy.event.EnergyTileLoadEvent; import ic2.api.energy.event.EnergyTileUnloadEvent; -import ic2.api.energy.tile.IEnergyConductor; import ic2.api.energy.tile.IEnergySink; -import ic2.api.energy.tile.IEnergySource; import ic2.core.IC2; import ihl.IHLMod; import ihl.interfaces.IEnergyNetNode; @@ -29,7 +23,7 @@ public class SubAnchorEnergyNetNode implements IEnergyNetNode{ private AnchorTileEntity base; private short facing; private int gridID=-1; - private Set cableList = new HashSet(); + private Set cableList = new HashSet(); public SubAnchorEnergyNetNode(AnchorTileEntity base1, short facing1) { diff --git a/ihl/flexible_cable/SubRTUEnergyNetNode.java b/ihl/flexible_cable/SubRTUEnergyNetNode.java index 2dd0673..c068ba0 100644 --- a/ihl/flexible_cable/SubRTUEnergyNetNode.java +++ b/ihl/flexible_cable/SubRTUEnergyNetNode.java @@ -1,13 +1,9 @@ package ihl.flexible_cable; import java.util.HashSet; -import java.util.Iterator; import java.util.Set; import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTBase; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraftforge.common.MinecraftForge; @@ -23,7 +19,7 @@ public class SubRTUEnergyNetNode implements IEnergyNetNode{ private RectifierTransformerUnitTileEntity base; private short side; private int gridID=-1; - private Set cableList = new HashSet(); + private Set cableList = new HashSet(); public SubRTUEnergyNetNode(RectifierTransformerUnitTileEntity base1, short facing1) { diff --git a/ihl/guidebook/IHLGuidebookGui.java b/ihl/guidebook/IHLGuidebookGui.java index 343f522..316660b 100644 --- a/ihl/guidebook/IHLGuidebookGui.java +++ b/ihl/guidebook/IHLGuidebookGui.java @@ -9,7 +9,6 @@ import org.xml.sax.SAXException; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.client.renderer.texture.ITextureObject; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; @@ -22,14 +21,10 @@ public class IHLGuidebookGui extends GuiContainer public IHLGuidebookContainer container; private static final ResourceLocation background = new ResourceLocation("ihl", "textures/gui/GUIGuidebook.png"); public Map linksCoordinatesMap = new HashMap(); - private GuiInvisibleButton prevPageAreaButton; - private GuiInvisibleButton nextPageAreaButton; private String title; private String[] localisedContent=new String[2];;// By text block and row private ResourceLocation[] resourceLocationCache = new ResourceLocation[16];//By section number private int currentSection=0; - private int textBlockNumberOnPageTurn=0; - private int stringNumberOnPageTurn=0; private final int titleX=25; private final int titleY=7; private final int textBlockWidth=104; @@ -39,8 +34,6 @@ public class IHLGuidebookGui extends GuiContainer private final int textBlockY2=5; private final int textBlockMaxY=200; private int stringHeight=10; - private int textRowInRightPage=0; - private int textBlockInRightPage=0; private int textRowInNextPage=0; private int textBlockInNextPage=0; private int[] textRowStart=new int[2]; @@ -62,8 +55,8 @@ public class IHLGuidebookGui extends GuiContainer super.initGui(); int x = (width - xSize) / 2; int y = (height - ySize) / 2; - prevPageAreaButton = new GuiInvisibleButton(0, x, y, xSize/2, 162, linksCoordinatesMap, buttonList); - nextPageAreaButton = new GuiInvisibleButton(1, x+xSize/2, y, xSize/2, 162, linksCoordinatesMap, buttonList); + new GuiInvisibleButton(0, x, y, xSize/2, 162, linksCoordinatesMap, buttonList); + new GuiInvisibleButton(1, x+xSize/2, y, xSize/2, 162, linksCoordinatesMap, buttonList); this.clear(); try { IHLMod.xmlparser.setupGuidebookGUI(this, 0); @@ -147,15 +140,11 @@ public class IHLGuidebookGui extends GuiContainer @Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { IHLRenderUtils.instance.updateScreenSize(); - this.textRowInRightPage=0; - this.textBlockInRightPage=0; this.drawPage(this.textBlockX1,this.textBlockY1); } private void drawPage(int startX, int startY) { - int xOffset = (this.width - xSize) / 2; - int yOffset = (this.height - ySize) / 2; GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); this.fontRendererObj.drawString(this.title, this.titleX, this.titleY, 0); int xPos=startX; @@ -192,7 +181,6 @@ public class IHLGuidebookGui extends GuiContainer if(yPos+this.pictureHeight xyzlist = new ArrayList(); + List xyzlist = new ArrayList(); if(currentFlowDecay==0) { xyzlist.add(new XYZ(startx, starty, startz)); diff --git a/ihl/handpump/IHLHandPump.java b/ihl/handpump/IHLHandPump.java index b04b3a0..29192e2 100644 --- a/ihl/handpump/IHLHandPump.java +++ b/ihl/handpump/IHLHandPump.java @@ -182,13 +182,14 @@ public class IHLHandPump extends Item implements IElectricItem, IBoxable, IItemH @Override public List getHudInfo(ItemStack itemStack) { - LinkedList info = new LinkedList(); + LinkedList info = new LinkedList(); info.add(ElectricItem.manager.getToolTip(itemStack)); info.add("Power Tier: " + this.tier); return info; } - @Override + @SuppressWarnings({ "unchecked", "rawtypes" }) + @Override public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean b) { info.add("PowerTier: " + this.tier); @@ -207,6 +208,7 @@ public class IHLHandPump extends Item implements IElectricItem, IBoxable, IItemH @Override @SideOnly(Side.CLIENT) + @SuppressWarnings({ "unchecked", "rawtypes" }) public void getSubItems(Item item, CreativeTabs tabs, List itemList) { itemList.add(this.getItemStack(this.maxCharge)); diff --git a/ihl/i_hate_liquids/BlockDynamicLiquidPlus.java b/ihl/i_hate_liquids/BlockDynamicLiquidPlus.java index 7b7a8d7..ed8ddac 100644 --- a/ihl/i_hate_liquids/BlockDynamicLiquidPlus.java +++ b/ihl/i_hate_liquids/BlockDynamicLiquidPlus.java @@ -46,7 +46,6 @@ public class BlockDynamicLiquidPlus extends BlockLiquid{ } int meta2=16; int fd; - Block block; int xz[] = {0,-1,0,1,0}; for(int i=0;i<=3;i++) { diff --git a/ihl/i_hate_liquids/InvisibleMagicanEntity.java b/ihl/i_hate_liquids/InvisibleMagicanEntity.java index 88539dc..2ad56d3 100644 --- a/ihl/i_hate_liquids/InvisibleMagicanEntity.java +++ b/ihl/i_hate_liquids/InvisibleMagicanEntity.java @@ -14,14 +14,13 @@ import net.minecraftforge.fluids.IFluidBlock; public class InvisibleMagicanEntity extends Entity { private int entityAge=0; - private int timer=0; private int viscosityTimer=0; private int viscosity=5; public int x0=0; public int y0=0; public int z0=0; - public List flowXYZ = new ArrayList(); - public List blockList = new ArrayList(); + public List flowXYZ = new ArrayList(); + public List blockList = new ArrayList(); private Block block; private int lowestPointsCounter=0; @@ -103,7 +102,6 @@ public class InvisibleMagicanEntity extends Entity { xyz = this.flowXYZ.remove(0); if(this.flowXYZ.isEmpty()) { - this.timer=0; Block block1=this.blockList.get(0); //System.out.println("Trying to create new source"); if(this.setBlock(xyz.x, xyz.y, xyz.z, block1)) @@ -182,115 +180,6 @@ public class InvisibleMagicanEntity extends Entity { return block.getMaterial().isLiquid() ? this.worldObj.getBlockMetadata(par2, par3, par4) : -1; } - private boolean writeLowestFlowPoint() - { - int startx = this.x0; - int starty = this.y0; - int startz = this.z0; - int currentFlowDecay=getFlowDecay(startx, starty, startz); - for (int i=0; i<64;i++) - { - //Go search up, if possible. - if(getFlowDecay(startx, starty+1, startz)>=0) - { - starty++; - currentFlowDecay=getFlowDecay(startx, starty, startz); - } - - else if(getFlowDecay(startx+1, starty+1, startz)>=0) - { - starty++; - startx++; - currentFlowDecay=getFlowDecay(startx, starty, startz); - } - - else if(getFlowDecay(startx-1, starty+1, startz)>=0) - { - starty++; - startx--; - currentFlowDecay=getFlowDecay(startx, starty, startz); - } - - else if(getFlowDecay(startx, starty+1, startz+1)>=0) - { - starty++; - startz++; - currentFlowDecay=getFlowDecay(startx, starty, startz); - } - - else if(getFlowDecay(startx, starty+1, startz-1)>=0) - { - starty++; - startz--; - currentFlowDecay=getFlowDecay(startx, starty, startz); - } - //Start checking neighbor blocks to lower flow decay. - else if(getFlowDecay(startx-1, starty, startz)=7) - { - this.worldObj.setBlockToAir(startx, starty, startz); - } - else - { - this.worldObj.setBlockMetadataWithNotify(startx, starty, startz, currentFlowDecay+1, 0); - } - return false; - } - public boolean replaceBlock(int x,int y,int z, Block block) { if(!IHLMod.cccFiniteWater&&(block==Blocks.flowing_water || block==Blocks.water)) @@ -394,8 +283,7 @@ public class InvisibleMagicanEntity extends Entity { int x=x0; int y=y0; int z=z0; - List list = new ArrayList(); - list.clear(); + List list = new ArrayList(); this.flowXYZ.clear(); for(int thread=0;thread<=256;thread++) { @@ -502,7 +390,7 @@ public class InvisibleMagicanEntity extends Entity { } else {break;} } - List xyzlist = new ArrayList(); + List xyzlist = new ArrayList(); if(currentFlowDecay==0) { xyzlist.add(new XYZ(startx, starty, startz)); diff --git a/ihl/interfaces/IDataCableHolder.java b/ihl/interfaces/IDataCableHolder.java index 1bdaba1..f527f1b 100644 --- a/ihl/interfaces/IDataCableHolder.java +++ b/ihl/interfaces/IDataCableHolder.java @@ -1,12 +1,6 @@ package ihl.interfaces; import ihl.datanet.Contact; -import ihl.processing.invslots.InvSlotSignalProcessor; - -import java.util.Set; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; public interface IDataCableHolder extends ICableHolder diff --git a/ihl/interfaces/IItemHasMiniGUI.java b/ihl/interfaces/IItemHasMiniGUI.java index ce7badf..155d07b 100644 --- a/ihl/interfaces/IItemHasMiniGUI.java +++ b/ihl/interfaces/IItemHasMiniGUI.java @@ -2,7 +2,6 @@ package ihl.interfaces; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; diff --git a/ihl/interfaces/INetworkListener.java b/ihl/interfaces/INetworkListener.java index 042177d..53f10d5 100644 --- a/ihl/interfaces/INetworkListener.java +++ b/ihl/interfaces/INetworkListener.java @@ -1,7 +1,6 @@ package ihl.interfaces; import net.minecraft.entity.player.EntityPlayerMP; -import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBufInputStream; public interface INetworkListener diff --git a/ihl/interfaces/ItemMiniGUI.java b/ihl/interfaces/ItemMiniGUI.java index 3b9a53d..4be2fe9 100644 --- a/ihl/interfaces/ItemMiniGUI.java +++ b/ihl/interfaces/ItemMiniGUI.java @@ -1,10 +1,7 @@ package ihl.interfaces; -import net.minecraft.client.gui.Gui; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.inventory.Slot; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; public abstract class ItemMiniGUI { diff --git a/ihl/items_blocks/ExplosiveBlock.java b/ihl/items_blocks/ExplosiveBlock.java deleted file mode 100644 index 225873f..0000000 --- a/ihl/items_blocks/ExplosiveBlock.java +++ /dev/null @@ -1,255 +0,0 @@ -package ihl.items_blocks; - -import ic2.api.tile.IWrenchable; -import ic2.core.IC2; -import ihl.IHLCreativeTab; -import ihl.IHLModInfo; -import ihl.processing.chemistry.ExplosiveTileEntity; -import ihl.processing.metallurgy.MuffleFurnanceTileEntity; -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.block.ITileEntityProvider; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ExplosiveBlock extends Block implements ITileEntityProvider{ - - @SideOnly(Side.CLIENT) - IIcon textureSide, - textureBack, - textureTop; - - public ExplosiveBlock() - { - super(Material.tnt); - this.setCreativeTab(IHLCreativeTab.tab); - this.setBlockName("ihlExplosive"); - this.setHardness(2F); - this.setResistance(1F); - } - - - @Override - public void onNeighborBlockChange(World world, int x, int y, int z, Block block) - { - if(IC2.platform.isSimulating()) - { - } - } - - @Override - public void getSubBlocks(Item item, CreativeTabs par2CreativeTabs, List itemList) - { - ItemStack result = new ItemStack(item); - result.stackTagCompound=new NBTTagCompound(); - result.stackTagCompound.setInteger("explosionType", 0);//0 - IC2; 1- IHL - result.stackTagCompound.setInteger("explosionPower", 100000); - //itemList.add(result); - result = new ItemStack(item); - result.stackTagCompound=new NBTTagCompound(); - result.stackTagCompound.setInteger("explosionType", 1);//0 - IC2; 1- IHL - result.stackTagCompound.setInteger("explosionPower", Integer.MAX_VALUE);//31000 - itemList.add(result); - } - - @Override - public void onBlockPreDestroy(World world, int x, int y, int z, int meta) - { - if(!world.isRemote) - { - TileEntity te = world.getTileEntity(x, y, z); - } - super.onBlockPreDestroy(world, x, y, z, meta); - } - - @Override - public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB aabb, List list, Entity entity) - { - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.1F, 1.0F); - super.addCollisionBoxesToList(world, x, y, z, aabb, list, entity); - this.setBlockBounds(0.0F, 0.0F, 0.0F, 0.1F, 1.0F, 1.0F); - super.addCollisionBoxesToList(world, x, y, z, aabb, list, entity); - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.1F); - super.addCollisionBoxesToList(world, x, y, z, aabb, list, entity); - this.setBlockBounds(0.9F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); - super.addCollisionBoxesToList(world, x, y, z, aabb, list, entity); - this.setBlockBounds(0.0F, 0.0F, 0.9F, 1.0F, 1.0F, 1.0F); - super.addCollisionBoxesToList(world, x, y, z, aabb, list, entity); - this.setBlockBoundsForItemRender(); - } - - @Override - public void setBlockBoundsForItemRender() - { - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); - } - - @Override - public void setBlockBoundsBasedOnState(IBlockAccess blockAccess, int x, int y, int z) - { - int facing = 3; - TileEntity te = blockAccess.getTileEntity(x, y, z); - if(te!=null && te instanceof IWrenchable) - { - IWrenchable tebh = (IWrenchable) te; - facing=tebh.getFacing(); - } - super.setBlockBoundsBasedOnState(blockAccess, x, y, z); - } - - public static void init() - { - GameRegistry.registerBlock(new ExplosiveBlock(), IHLItemBlock.class,"ihlExplosive"); - GameRegistry.registerTileEntity(ExplosiveTileEntity.class, "explosiveTileEntity"); - ExplosiveType[] var1 = ExplosiveType.values(); - } - - @Override - public void dropBlockAsItemWithChance(World world, int x, int y, int z, int meta, float chance, int flag) - { - super.dropBlockAsItemWithChance(world, x, y, z, meta, chance, flag); - } - - @Override - public TileEntity createNewTileEntity(World world, int var2) { - return new ExplosiveTileEntity(); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) - { - this.blockIcon = par1IconRegister.registerIcon(IHLModInfo.MODID + ":brickOvenSide"); - this.textureBack = par1IconRegister.registerIcon(IHLModInfo.MODID + ":brickOvenBack"); - this.textureSide = par1IconRegister.registerIcon(IHLModInfo.MODID + ":brickOvenSide"); - this.textureTop = par1IconRegister.registerIcon(IHLModInfo.MODID + ":brickOvenTop"); - } - - @Override - public boolean hasTileEntity(int metadata) - { - return true; - } - - @Override - public boolean onBlockActivated(World world,int x,int y,int z,EntityPlayer player,int i,float pos_x,float pos_y,float pos_z){ - TileEntity te = world.getTileEntity(x,y,z); - if(IC2.platform.isSimulating() && te instanceof ExplosiveTileEntity) - { - ((ExplosiveTileEntity)te).createExplosion(player); - } - return false; - } - - - /** - * Called when the block is placed in the world. - */ - @Override - public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) - { - TileEntity t = world.getTileEntity(x, y, z); - if(t!=null) - { - t.readFromNBT(itemStack.stackTagCompound); - } - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) - { - int facing=3; - int mask[] = { - 0,1,2,3,4,5, - 1,0,3,2,4,5, - 2,3,0,1,4,5, - 2,3,1,0,4,5, - 2,3,5,4,0,1, - 2,3,4,5,1,0 - }; - TileEntity te = world.getTileEntity(x, y, z); - if(te instanceof IWrenchable) - { - IWrenchable tebh = (IWrenchable) te; - facing=tebh.getFacing(); - } - return this.getIconFromFacing(facing, side); - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int side, int meta) - { - return this.getIconFromFacing(3, side); - } - - @SideOnly(Side.CLIENT) - public IIcon getIconFromFacing(int facing, int side) - { - return this.textureSide; - } - - @Override - public boolean onBlockEventReceived(World world, int x, int y, int z, int metadata, int flag) - { - return true; - } - - public enum ExplosiveType - { - MuffleFurnace("muffleFurnance",MuffleFurnanceTileEntity.class, true, new ItemStack(Items.brick)); - ExplosiveType(String unlocalizedName1, Class teclass1, boolean isNormalBlock1,ItemStack itemDroppedOnBlockDestroy1) - { - unlocalizedName=unlocalizedName1; - teclass=teclass1; - isNormalBlock=isNormalBlock1; - itemDroppedOnBlockDestroy=itemDroppedOnBlockDestroy1; - } - String unlocalizedName; - Class teclass; - boolean isNormalBlock=true; - ItemStack itemDroppedOnBlockDestroy; - } - - @Override - public int getRenderType() - { - return 0; - } - - @Override - public boolean isOpaqueCube() - { - return true; - } - - @Override - public boolean renderAsNormalBlock() - { - return true; - } - - @SideOnly(Side.CLIENT) - public IIcon getInnerTextureForBlockRenderer() - { - return this.blockIcon; - } -} diff --git a/ihl/items_blocks/FiberItem.java b/ihl/items_blocks/FiberItem.java index 0682abb..73d62f3 100644 --- a/ihl/items_blocks/FiberItem.java +++ b/ihl/items_blocks/FiberItem.java @@ -47,7 +47,8 @@ public class FiberItem extends Item implements IWire { } } - @Override + @SuppressWarnings({ "rawtypes", "unchecked" }) + @Override @SideOnly(Side.CLIENT) public void getSubItems(Item item, CreativeTabs tabs, List itemList) { @@ -59,6 +60,7 @@ public class FiberItem extends Item implements IWire { } @Override + @SuppressWarnings({ "rawtypes", "unchecked" }) public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean flag) { if(itemStack.stackTagCompound!=null) diff --git a/ihl/items_blocks/FlexibleCableItem.java b/ihl/items_blocks/FlexibleCableItem.java index 11023c4..54710cb 100644 --- a/ihl/items_blocks/FlexibleCableItem.java +++ b/ihl/items_blocks/FlexibleCableItem.java @@ -1,34 +1,23 @@ package ihl.items_blocks; -import java.util.ArrayList; import java.util.HashSet; -import java.util.Iterator; import java.util.List; -import java.util.Map; import java.util.Set; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerChangedDimensionEvent; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTBase; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.server.MinecraftServer; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.IIcon; -import net.minecraft.util.MathHelper; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.util.Vec3; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; import ic2.api.energy.tile.IEnergyTile; @@ -60,7 +49,7 @@ public class FlexibleCableItem extends Item implements IWire { insulatedIronRuber, insulatedThickIronRuber; public static FlexibleCableItem instance; - public final Set yellowColoredWires = new HashSet(3); + public final Set yellowColoredWires = new HashSet(3); public boolean isDataCable=false; public FlexibleCableItem() @@ -77,6 +66,7 @@ public class FlexibleCableItem extends Item implements IWire { @Override @SideOnly(Side.CLIENT) + @SuppressWarnings({ "rawtypes", "unchecked" }) public void getSubItems(Item item, CreativeTabs tabs, List itemList) { itemList.add(IHLUtils.getUninsulatedWire("Copper", 160, 15)); @@ -98,7 +88,8 @@ public class FlexibleCableItem extends Item implements IWire { GameRegistry.registerItem(new FlexibleCableItem(),"copperWire"); } - public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int par7, float par8, float par9, float par10) + @Override + public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int par7, float par8, float par9, float par10) { TileEntity t = world.getTileEntity(x, y, z); short facing = IHLUtils.getFacingFromPlayerView(player, true); @@ -173,11 +164,11 @@ public class FlexibleCableItem extends Item implements IWire { { if(t2 instanceof IMultiPowerCableHolder) { - te = ((IMultiPowerCableHolder)t).getEnergyNetNode(facing); + te = ((IMultiPowerCableHolder)t2).getEnergyNetNode(facing); } else { - te = (ICableHolder)t; + te = (ICableHolder)t2; } te.setCableCheck(true); } @@ -447,6 +438,7 @@ public class FlexibleCableItem extends Item implements IWire { } @Override + @SuppressWarnings({ "rawtypes", "unchecked" }) public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean flag) { if(itemStack.stackTagCompound!=null) diff --git a/ihl/items_blocks/FlexiblePipeItem.java b/ihl/items_blocks/FlexiblePipeItem.java index 5de333f..5f1522e 100644 --- a/ihl/items_blocks/FlexiblePipeItem.java +++ b/ihl/items_blocks/FlexiblePipeItem.java @@ -21,10 +21,8 @@ import ihl.utils.IHLUtils; public class FlexiblePipeItem extends Item implements IWire { - private static Map iconMap = new HashMap(); - private static Map nameMap = new HashMap(); - private static Map infoMap = new HashMap(); - private static Map materialMap = new HashMap(); + private static Map iconMap = new HashMap(); + private static Map nameMap = new HashMap(); public FlexiblePipeItem() { @@ -46,7 +44,8 @@ public class FlexiblePipeItem extends Item implements IWire { } } - @Override + @SuppressWarnings({ "rawtypes", "unchecked" }) + @Override @SideOnly(Side.CLIENT) public void getSubItems(Item item, CreativeTabs tabs, List itemList) { @@ -62,6 +61,7 @@ public class FlexiblePipeItem extends Item implements IWire { } @Override + @SuppressWarnings({ "rawtypes", "unchecked" }) public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean flag) { if(itemStack.stackTagCompound!=null) diff --git a/ihl/items_blocks/GroundRemoverItem.java b/ihl/items_blocks/GroundRemoverItem.java deleted file mode 100644 index 47c5a1f..0000000 --- a/ihl/items_blocks/GroundRemoverItem.java +++ /dev/null @@ -1,92 +0,0 @@ -package ihl.items_blocks; - -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.server.MinecraftServer; -import net.minecraft.world.World; -import ihl.IHLCreativeTab; -import ihl.IHLModInfo; -import ihl.worldgen.ores.BlockOre; - -public class GroundRemoverItem extends Item{ - - private String registryName; - private final Set removableBlockSet = new HashSet(); - - public GroundRemoverItem(String registryName1) - { - super(); - this.registryName=registryName1; - this.setCreativeTab(IHLCreativeTab.tab); - this.setMaxStackSize(1); - this.setUnlocalizedName(registryName); - removableBlockSet.add(Blocks.sandstone); - removableBlockSet.add(Blocks.sand); - removableBlockSet.add(Blocks.stone); - removableBlockSet.add(Blocks.flowing_water); - removableBlockSet.add(Blocks.flowing_lava); - removableBlockSet.add(Blocks.water); - removableBlockSet.add(Blocks.lava); - removableBlockSet.add(Blocks.clay); - removableBlockSet.add(Blocks.gravel); - removableBlockSet.add(Blocks.dirt); - } - - public GroundRemoverItem() - { - super(); - } - - public static void init() - { - //GameRegistry.registerItem(new GroundRemoverItem("groundRemover"),"groundRemover"); - } - - @Override - public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean flag) - { - info.add("Vanilla block remover tool"); - } - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister par1IconRegister) - { - this.itemIcon = par1IconRegister.registerIcon(IHLModInfo.MODID + ":vacuumSwitch"); - } - - @Override - public void onUpdate(ItemStack stack, World world, Entity entity, int slotIndex, boolean isCurrentItem) - { - if(entity instanceof EntityPlayer && isCurrentItem && MinecraftServer.getServer().getTickCounter()%100==99) - { - int x = (int)entity.posX; - int y = (int)entity.posY; - int z = (int)entity.posZ; - for(int ix = x-16;ix < x+16;ix++) - { - for(int iz = z-16;iz < z+16;iz++) - { - for(int iy = 4;iy < y;iy++) - { - if(!(world.getBlock(ix, iy, iz) instanceof BlockOre || world.getBlock(ix, iy, iz) instanceof IHLFluidBlock)) - { - world.setBlockToAir(ix, iy, iz); - } - } - } - } - } - } -} diff --git a/ihl/items_blocks/IHLItemBlock.java b/ihl/items_blocks/IHLItemBlock.java index 8ac81a2..3bde475 100644 --- a/ihl/items_blocks/IHLItemBlock.java +++ b/ihl/items_blocks/IHLItemBlock.java @@ -14,7 +14,6 @@ import ihl.collector.ChargerEjectorTileEntity; import ihl.processing.metallurgy.PassiveBlock; import ihl.tunneling_shield.DriverTileEntity; import net.minecraft.block.Block; -import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; @@ -27,7 +26,7 @@ import net.minecraft.util.StatCollector; import net.minecraft.world.World; public class IHLItemBlock extends ItemBlock{ - public Map nameMap = new HashMap(); + public Map nameMap = new HashMap(); public IHLItemBlock(Block block1) { super(block1); @@ -216,9 +215,10 @@ public class IHLItemBlock extends ItemBlock{ } @Override + @SideOnly(Side.CLIENT) public CreativeTabs getCreativeTab() { - return IHLCreativeTab.tab; + return this.field_150939_a.getCreativeTabToDisplayOn(); } @Override @@ -255,12 +255,18 @@ public class IHLItemBlock extends ItemBlock{ return false; } - @Override + @SuppressWarnings({ "rawtypes", "unchecked" }) + @Override public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean flag) { if(itemStack.stackTagCompound!=null && itemStack.stackTagCompound.hasKey("resultSuffix")) { - info.add(StatCollector.translateToLocal("result_of_molding") + StatCollector.translateToLocal("ihl."+itemStack.stackTagCompound.getString("resultSuffix"))); + String result_suffix = itemStack.stackTagCompound.getString("resultSuffix"); + if(StatCollector.canTranslate("ihl."+result_suffix)) + { + result_suffix = StatCollector.translateToLocal("ihl."+result_suffix); + } + info.add(StatCollector.translateToLocal("result_of_molding")+result_suffix); if(itemStack.stackTagCompound.hasKey("isContainStearin") && itemStack.stackTagCompound.getBoolean("isContainStearin")) { info.add(StatCollector.translateToLocal("ihl.tooltip.step")+" 1: "+StatCollector.translateToLocal("remove_wax_using_muffle_furnace")); @@ -275,6 +281,10 @@ public class IHLItemBlock extends ItemBlock{ info.add(StatCollector.translateToLocal("ihl.tooltip.step")+" 2: "+StatCollector.translateToLocal("wait_for_10_seconds")); info.add(StatCollector.translateToLocal("ihl.tooltip.step")+" 3: "+StatCollector.translateToLocal("destroy_mold_to_get_results")); } + if(itemStack.stackTagCompound.hasKey("detonator_delay")) + { + info.add(StatCollector.translateToLocal("ihl.detonator_delay")+" "+itemStack.stackTagCompound.getInteger("detonator_delay")+StatCollector.translateToLocal("ihl.seconds")); + } } } } diff --git a/ihl/items_blocks/IHLTool.java b/ihl/items_blocks/IHLTool.java index 7ddf3fb..4e51b5b 100644 --- a/ihl/items_blocks/IHLTool.java +++ b/ihl/items_blocks/IHLTool.java @@ -35,7 +35,6 @@ import cpw.mods.fml.relauncher.SideOnly; import ic2.api.reactor.IReactor; import ic2.core.Ic2Items; import ihl.IHLCreativeTab; -import ihl.IHLMod; import ihl.IHLModInfo; import ihl.flexible_cable.SetOfDiesMiniGUI; import ihl.interfaces.IHasTemperature; @@ -44,12 +43,11 @@ import ihl.interfaces.ItemMiniGUI; import ihl.utils.IHLUtils; public class IHLTool extends Item implements IItemHasMiniGUI{ - private static Map iconMap = new HashMap(); - private static Map nameMap = new HashMap(); - private static Map hintMap = new HashMap(); - private static Map maxToolDamageMap = new HashMap(); - private static Map isWeaponMap = new HashMap(); - private static Map damageVersusEntityMap = new HashMap(); + private static Map iconMap = new HashMap(); + private static Map nameMap = new HashMap(); + private static Map hintMap = new HashMap(); + private static Map isWeaponMap = new HashMap(); + private static Map damageVersusEntityMap = new HashMap(); public static Item instance; private IIcon dice240; @@ -163,7 +161,8 @@ public class IHLTool extends Item implements IItemHasMiniGUI{ @Override @SideOnly(Side.CLIENT) - public void getSubItems(Item item, CreativeTabs tabs, List itemList) + @SuppressWarnings({ "rawtypes", "unchecked" }) + public void getSubItems(Item item, CreativeTabs tabs, List itemList) { Type[] var1 = Type.values(); for(int i=0;i iconMap = new HashMap(); - private static Map nameMap = new HashMap(); - private static Map descriptionMap = new HashMap(); + private static Map iconMap = new HashMap(); + private static Map nameMap = new HashMap(); + private static Map descriptionMap = new HashMap(); public static ItemSubstance instance; public ItemSubstance() @@ -118,6 +127,7 @@ public class ItemSubstance extends Item { } } + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override @SideOnly(Side.CLIENT) public void getSubItems(Item item, CreativeTabs tabs, List itemList) @@ -126,6 +136,11 @@ public class ItemSubstance extends Item { for(int i=0;i instances = new ArrayList(); + private static List instances = new ArrayList(); @SideOnly(Side.CLIENT) IIcon textureSide, @@ -203,6 +201,7 @@ public class MachineBaseBlock extends Block implements ITileEntityProvider{ super.onBlockPreDestroy(world, x, y, z, meta); } + @SuppressWarnings("rawtypes") @Override public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB aabb, List list, Entity entity) { @@ -468,14 +467,6 @@ public class MachineBaseBlock extends Block implements ITileEntityProvider{ public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) { int facing=3; - int mask[] = { - 0,1,2,3,4,5, - 1,0,3,2,4,5, - 2,3,0,1,4,5, - 2,3,1,0,4,5, - 2,3,5,4,0,1, - 2,3,4,5,1,0 - }; TileEntity te = world.getTileEntity(x, y, z); if(te instanceof IWrenchable) { @@ -793,7 +784,7 @@ public class MachineBaseBlock extends Block implements ITileEntityProvider{ BronzeTub("tubBronze",ImpregnatingMachineTileEntity.class, false, true, null), AchesonFurnace("achesonFurnance",AchesonFurnanceTileEntity.class, true, new ItemStack(Items.brick)), MuffleFurnace("muffleFurnance",MuffleFurnanceTileEntity.class, true, new ItemStack(Items.brick)); - MachineType(String unlocalizedName1, Class teclass1, boolean isNormalBlock1,ItemStack itemDroppedOnBlockDestroy1) + MachineType(String unlocalizedName1, Class teclass1, boolean isNormalBlock1,ItemStack itemDroppedOnBlockDestroy1) { unlocalizedName=unlocalizedName1; teclass=teclass1; @@ -808,7 +799,7 @@ public class MachineBaseBlock extends Block implements ITileEntityProvider{ } itemDroppedOnBlockDestroy=itemDroppedOnBlockDestroy1; } - MachineType(String unlocalizedName1, Class teclass1, boolean isNormalBlock1,boolean hasSpecialBlockRenderer1, ItemStack itemDroppedOnBlockDestroy1) + MachineType(String unlocalizedName1, Class teclass1, boolean isNormalBlock1,boolean hasSpecialBlockRenderer1, ItemStack itemDroppedOnBlockDestroy1) { unlocalizedName=unlocalizedName1; teclass=teclass1; @@ -818,7 +809,7 @@ public class MachineBaseBlock extends Block implements ITileEntityProvider{ } String unlocalizedName; - Class teclass; + Class teclass; boolean isNormalBlock=true; boolean hasSpecialBlockRenderer=false; int specialBlockRendererId=-2; diff --git a/ihl/metallurgy/constants/Details.java b/ihl/metallurgy/constants/Details.java index 2ece66a..80c715c 100644 --- a/ihl/metallurgy/constants/Details.java +++ b/ihl/metallurgy/constants/Details.java @@ -1,5 +1,7 @@ package ihl.metallurgy.constants; +import ihl.IHLMod; + public enum Details { block(1296), highPressureVessel(432), @@ -33,21 +35,21 @@ public enum Details { ring(36), toolHeadPickaxe(432), gearSmall(144), + nozzle(864), wire(48); Details(int moltenAmount1) { - moltenAmount=moltenAmount1; + IHLMod.moltenAmounts.put(this.name(), moltenAmount1); } - private int moltenAmount; public static int getMeltingFluidAmount(String name) { - if(Details.valueOf(name)==null) + if(IHLMod.moltenAmounts.containsKey(name)) { - return 0; + return IHLMod.moltenAmounts.get(name); } else { - return Details.valueOf(name).moltenAmount; + return 0; } } } diff --git a/ihl/model/CableHolderSelectionBoxSpecialRenderer.java b/ihl/model/CableHolderSelectionBoxSpecialRenderer.java index 9bb22f1..7d0de61 100644 --- a/ihl/model/CableHolderSelectionBoxSpecialRenderer.java +++ b/ihl/model/CableHolderSelectionBoxSpecialRenderer.java @@ -15,7 +15,8 @@ import org.lwjgl.opengl.GL11; public class CableHolderSelectionBoxSpecialRenderer implements ISelectionBoxSpecialRenderer { - public void drawSelectionBox(EntityPlayer player, ItemStack currentItem, MovingObjectPosition movingObjectPosition, float partialTick) + @Override + public void drawSelectionBox(EntityPlayer player, ItemStack currentItem, MovingObjectPosition movingObjectPosition, float partialTick) { AnchorTileEntity ate = (AnchorTileEntity) Minecraft.getMinecraft().theWorld.getTileEntity(movingObjectPosition.blockX, movingObjectPosition.blockY, movingObjectPosition.blockZ); short facing = IHLUtils.getFacingFromPlayerView(player, true); @@ -26,9 +27,9 @@ public class CableHolderSelectionBoxSpecialRenderer implements ISelectionBoxSpec GL11.glLineWidth(2.0F); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glDepthMask(false); - double offsetX = player.lastTickPosX + (player.posX - player.lastTickPosX) * (double)partialTick; - double offsetY = player.lastTickPosY + (player.posY - player.lastTickPosY) * (double)partialTick; - double offsetZ = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * (double)partialTick; + double offsetX = player.lastTickPosX + (player.posX - player.lastTickPosX) * partialTick; + double offsetY = player.lastTickPosY + (player.posY - player.lastTickPosY) * partialTick; + double offsetZ = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * partialTick; double size=0.1d; RenderGlobal.drawOutlinedBoundingBox(AxisAlignedBB.getBoundingBox(portPos[0]-size, portPos[1]-size, portPos[2]-size, portPos[0]+size, portPos[1]+size, portPos[2]+size).getOffsetBoundingBox(-offsetX, -offsetY, -offsetZ), -1); GL11.glDepthMask(true); diff --git a/ihl/model/FlexibleCableItemRender.java b/ihl/model/FlexibleCableItemRender.java index 86b53ee..92b2036 100644 --- a/ihl/model/FlexibleCableItemRender.java +++ b/ihl/model/FlexibleCableItemRender.java @@ -1,22 +1,13 @@ package ihl.model; -import ic2.core.block.RenderBlockDefault; -import ihl.datanet.DataCableItem; import ihl.items_blocks.FlexibleCableItem; -import ihl.items_blocks.IHLItemBlock; -import ihl.model.IHLModelRenderer; -import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityClientPlayerMP; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; import net.minecraft.client.renderer.GLAllocation; -import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.entity.RenderPlayer; import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.IItemRenderer; import net.minecraftforge.common.util.ForgeDirection; diff --git a/ihl/model/IHLModelRenderer.java b/ihl/model/IHLModelRenderer.java index c9b1b77..a9168f8 100644 --- a/ihl/model/IHLModelRenderer.java +++ b/ihl/model/IHLModelRenderer.java @@ -39,8 +39,8 @@ public class IHLModelRenderer { /** Hides the model. */ public boolean isHidden; - public List cubeList; - public List childModels; + public List cubeList; + public List childModels; public final String boxName; private ModelBase baseModel; public float offsetX; @@ -48,14 +48,14 @@ public class IHLModelRenderer { public float offsetZ; public boolean drawFromInside=false; - private static final String __OBFID = "CL_00000874"; - - public IHLModelRenderer(ModelBase par1ModelBase, String par2Str) + + @SuppressWarnings("unchecked") + public IHLModelRenderer(ModelBase par1ModelBase, String par2Str) { this.textureWidth = 64.0F; this.textureHeight = 32.0F; this.showModel = true; - this.cubeList = new ArrayList(); + this.cubeList = new ArrayList(); this.baseModel = par1ModelBase; par1ModelBase.boxList.add(this); this.boxName = par2Str; @@ -80,7 +80,7 @@ public class IHLModelRenderer { { if (this.childModels == null) { - this.childModels = new ArrayList(); + this.childModels = new ArrayList(); } this.childModels.add(par1ModelRenderer); diff --git a/ihl/model/IHLToolRenderer.java b/ihl/model/IHLToolRenderer.java index 6f2a30f..a5ba87b 100644 --- a/ihl/model/IHLToolRenderer.java +++ b/ihl/model/IHLToolRenderer.java @@ -9,7 +9,6 @@ import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; -import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.IItemRenderer; public class IHLToolRenderer implements IItemRenderer diff --git a/ihl/model/IronWorkbenchBlockRender.java b/ihl/model/IronWorkbenchBlockRender.java index 43793ed..b5bdec3 100644 --- a/ihl/model/IronWorkbenchBlockRender.java +++ b/ihl/model/IronWorkbenchBlockRender.java @@ -1,18 +1,11 @@ package ihl.model; -import ic2.api.tile.IWrenchable; -import ihl.items_blocks.MachineBaseBlock; -import ihl.utils.IHLRenderUtils; - import org.lwjgl.opengl.GL11; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; -import net.minecraftforge.common.util.ForgeDirection; import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import cpw.mods.fml.client.registry.RenderingRegistry; diff --git a/ihl/model/ModelTube.java b/ihl/model/ModelTube.java index b513c74..d4dcb08 100644 --- a/ihl/model/ModelTube.java +++ b/ihl/model/ModelTube.java @@ -1,9 +1,5 @@ package ihl.model; -import ihl.handpump.BlockWithCoordinates; - -import java.util.Iterator; - import org.lwjgl.opengl.GL11; import net.minecraft.client.model.PositionTextureVertex; diff --git a/ihl/model/MultiMetaBlockRender.java b/ihl/model/MultiMetaBlockRender.java index 196cb99..c995989 100644 --- a/ihl/model/MultiMetaBlockRender.java +++ b/ihl/model/MultiMetaBlockRender.java @@ -64,7 +64,6 @@ public class MultiMetaBlockRender implements ISimpleBlockRenderingHandler float var7 = (var6 >> 16 & 255) / 255.0F; float var8 = (var6 >> 8 & 255) / 255.0F; float var9 = (var6 & 255) / 255.0F; - float var11; var5.setColorOpaque_F(var7, var8, var9); return true; } diff --git a/ihl/model/RectifierTransformerUnitBlockRender.java b/ihl/model/RectifierTransformerUnitBlockRender.java index 081db7a..27d8ea9 100644 --- a/ihl/model/RectifierTransformerUnitBlockRender.java +++ b/ihl/model/RectifierTransformerUnitBlockRender.java @@ -1,7 +1,6 @@ package ihl.model; import ic2.api.tile.IWrenchable; -import ihl.items_blocks.MachineBaseBlock; import ihl.utils.IHLRenderUtils; import org.lwjgl.opengl.GL11; diff --git a/ihl/model/RectifierTransformerUnitSelectionBoxSpecialRenderer.java b/ihl/model/RectifierTransformerUnitSelectionBoxSpecialRenderer.java index 6e3e944..4cd52ea 100644 --- a/ihl/model/RectifierTransformerUnitSelectionBoxSpecialRenderer.java +++ b/ihl/model/RectifierTransformerUnitSelectionBoxSpecialRenderer.java @@ -1,30 +1,24 @@ package ihl.model; -import ic2.api.tile.IWrenchable; -import ihl.flexible_cable.AnchorTileEntity; import ihl.flexible_cable.RectifierTransformerUnitTileEntity; import ihl.interfaces.ISelectionBoxSpecialRenderer; -import ihl.utils.IHLUtils; import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.ActiveRenderInfo; import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.RenderGlobal; -import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.MovingObjectPosition; import org.lwjgl.opengl.GL11; public class RectifierTransformerUnitSelectionBoxSpecialRenderer implements ISelectionBoxSpecialRenderer { - public void drawSelectionBox(EntityPlayer player, ItemStack currentItem, MovingObjectPosition movingObjectPosition, float partialTick) + @Override + public void drawSelectionBox(EntityPlayer player, ItemStack currentItem, MovingObjectPosition movingObjectPosition, float partialTick) { - double offsetX = player.lastTickPosX + (player.posX - player.lastTickPosX) * (double)partialTick; - double offsetY = player.lastTickPosY + (player.posY - player.lastTickPosY) * (double)partialTick; - double offsetZ = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * (double)partialTick; + double offsetX = player.lastTickPosX + (player.posX - player.lastTickPosX) * partialTick; + double offsetY = player.lastTickPosY + (player.posY - player.lastTickPosY) * partialTick; + double offsetZ = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * partialTick; RectifierTransformerUnitTileEntity tile = (RectifierTransformerUnitTileEntity) Minecraft.getMinecraft().theWorld.getTileEntity(movingObjectPosition.blockX, movingObjectPosition.blockY, movingObjectPosition.blockZ); if(tile!=null && tile.getWorldObj() != null) { diff --git a/ihl/model/RenderGameOverlayEventHandler.java b/ihl/model/RenderGameOverlayEventHandler.java index e2bbde4..6770c3d 100644 --- a/ihl/model/RenderGameOverlayEventHandler.java +++ b/ihl/model/RenderGameOverlayEventHandler.java @@ -4,7 +4,6 @@ import ihl.utils.IHLRenderUtils; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import net.minecraft.client.Minecraft; import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.GuiIngameForge; import net.minecraftforge.client.event.RenderGameOverlayEvent; public class RenderGameOverlayEventHandler diff --git a/ihl/model/SwitchBoxBlockRender.java b/ihl/model/SwitchBoxBlockRender.java index 93f63a7..87c9fb9 100644 --- a/ihl/model/SwitchBoxBlockRender.java +++ b/ihl/model/SwitchBoxBlockRender.java @@ -109,9 +109,7 @@ public class SwitchBoxBlockRender implements ISimpleBlockRenderingHandler float var7 = (var6 >> 16 & 255) / 255.0F; float var8 = (var6 >> 8 & 255) / 255.0F; float var9 = (var6 & 255) / 255.0F; - float var11; var5.setColorOpaque_F(var7, var8, var9); - var11 = 0.0625F; blockRenderer.renderFaceXPos(block, x, y, z, sideToTypes[4]); blockRenderer.renderFaceXNeg(block, x, y, z, sideToTypes[5]); blockRenderer.renderFaceZPos(block, x, y, z, sideToTypes[2]); diff --git a/ihl/nei_integration/AchesonFurnaceRecipeHandler.java b/ihl/nei_integration/AchesonFurnaceRecipeHandler.java index 63dc0c8..8571f3a 100644 --- a/ihl/nei_integration/AchesonFurnaceRecipeHandler.java +++ b/ihl/nei_integration/AchesonFurnaceRecipeHandler.java @@ -86,7 +86,7 @@ public class AchesonFurnaceRecipeHandler extends MachineRecipeHandler @Override public List getAdditionalIngredients() { - List ps = new ArrayList(); + List ps = new ArrayList(); RecipeInputOreDictionaryList ari = new RecipeInputOreDictionaryList(new String[] {"stickCoal","stickGraphite"}); ps.add(new PositionedStack(ari.getInputs(),16-5,41-11)); ps.add(new PositionedStack(ari.getInputs(),52-5,41-11)); diff --git a/ihl/nei_integration/ChemicalReactorRecipeHandler.java b/ihl/nei_integration/ChemicalReactorRecipeHandler.java index 161bdfe..7dd6801 100644 --- a/ihl/nei_integration/ChemicalReactorRecipeHandler.java +++ b/ihl/nei_integration/ChemicalReactorRecipeHandler.java @@ -127,14 +127,4 @@ public class ChemicalReactorRecipeHandler extends MachineRecipeHandler { return ChemicalReactorTileEntity.getRecipes(); } - - private int getFrameY(int number) - { - return (number % 10) * 24 + 14; - } - - private int getFrameX(int number) - { - return (number / 10) * 24 + 176; - } } diff --git a/ihl/nei_integration/CrucibleRecipeHandler.java b/ihl/nei_integration/CrucibleRecipeHandler.java index dc2c012..d91b137 100644 --- a/ihl/nei_integration/CrucibleRecipeHandler.java +++ b/ihl/nei_integration/CrucibleRecipeHandler.java @@ -78,7 +78,7 @@ public class CrucibleRecipeHandler extends MachineRecipeHandler @Override public List getAdditionalIngredients() { - List ps = new ArrayList(); + List ps = new ArrayList(); ps.add(new PositionedStack(IHLUtils.getThisModItemStackWithDamage("crucible", 0),61-5,15-11)); ps.add(new PositionedStack(IHLUtils.getThisModItemStackWithDamage("crucible", 1),106-5,15-11)); return ps; diff --git a/ihl/nei_integration/CryogenicDistillerRecipeHandler.java b/ihl/nei_integration/CryogenicDistillerRecipeHandler.java index c3bcff3..5b1a637 100644 --- a/ihl/nei_integration/CryogenicDistillerRecipeHandler.java +++ b/ihl/nei_integration/CryogenicDistillerRecipeHandler.java @@ -80,7 +80,8 @@ public class CryogenicDistillerRecipeHandler extends MachineRecipeHandler return "cryogenicDistiller"; } - @Override + @SuppressWarnings("unchecked") + @Override public void drawExtras(int recipeNumber) { MachineRecipeHandler.CachedIORecipe recipe = (MachineRecipeHandler.CachedIORecipe) this.arecipes.get(recipeNumber); diff --git a/ihl/nei_integration/ElectricEvaporatorRecipeHandler.java b/ihl/nei_integration/ElectricEvaporatorRecipeHandler.java index 1c9cff3..535646f 100644 --- a/ihl/nei_integration/ElectricEvaporatorRecipeHandler.java +++ b/ihl/nei_integration/ElectricEvaporatorRecipeHandler.java @@ -4,7 +4,6 @@ import java.awt.Rectangle; import java.util.Map; import ihl.processing.chemistry.ElectricEvaporatorGui; -import ihl.processing.chemistry.ElectricEvaporatorTileEntity; import ihl.processing.chemistry.EvaporatorTileEntity; import ihl.recipes.UniversalRecipeInput; import ihl.recipes.UniversalRecipeOutput; diff --git a/ihl/nei_integration/IHLBlockHighlightHandler.java b/ihl/nei_integration/IHLBlockHighlightHandler.java index c6f8359..4862a9b 100644 --- a/ihl/nei_integration/IHLBlockHighlightHandler.java +++ b/ihl/nei_integration/IHLBlockHighlightHandler.java @@ -2,12 +2,7 @@ package ihl.nei_integration; import codechicken.nei.api.IHighlightHandler; import codechicken.nei.api.ItemInfo; -import codechicken.nei.guihook.GuiContainerManager; -import net.minecraft.block.BlockRedstoneWire; -import net.minecraft.client.Minecraft; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumChatFormatting; diff --git a/ihl/nei_integration/IHLRecipeHandler.java b/ihl/nei_integration/IHLRecipeHandler.java index 4c0ada6..a0d7f7f 100644 --- a/ihl/nei_integration/IHLRecipeHandler.java +++ b/ihl/nei_integration/IHLRecipeHandler.java @@ -68,11 +68,11 @@ public abstract class IHLRecipeHandler extends TemplateRecipeHandler { if (outputId.equals(this.getRecipeId())) { - Iterator i$ = this.getRecipeList().entrySet().iterator(); + Iterator> i$ = this.getRecipeList().entrySet().iterator(); while (i$.hasNext()) { - Entry entry = (Entry)i$.next(); + Entry entry = i$.next(); this.arecipes.add(new IHLRecipeHandler.CachedIORecipe((IRecipeInput)entry.getKey(), (RecipeOutput)entry.getValue())); } } @@ -85,16 +85,16 @@ public abstract class IHLRecipeHandler extends TemplateRecipeHandler @Override public void loadCraftingRecipes(ItemStack result) { - Iterator i$ = this.getRecipeList().entrySet().iterator(); + Iterator> i$ = this.getRecipeList().entrySet().iterator(); while (i$.hasNext()) { - Entry entry = (Entry)i$.next(); - Iterator i$1 = ((RecipeOutput)entry.getValue()).items.iterator(); + Entry entry = i$.next(); + Iterator i$1 = ((RecipeOutput)entry.getValue()).items.iterator(); while (i$1.hasNext()) { - ItemStack output = (ItemStack)i$1.next(); + ItemStack output = i$1.next(); if (NEIServerUtils.areStacksSameTypeCrafting(output, result)) { @@ -108,11 +108,11 @@ public abstract class IHLRecipeHandler extends TemplateRecipeHandler @Override public void loadUsageRecipes(ItemStack ingredient) { - Iterator i$ = this.getRecipeList().entrySet().iterator(); + Iterator> i$ = this.getRecipeList().entrySet().iterator(); while (i$.hasNext()) { - Entry entry = (Entry)i$.next(); + Entry entry = i$.next(); if (((IRecipeInput)entry.getKey()).matches(ingredient)) { @@ -148,9 +148,9 @@ public abstract class IHLRecipeHandler extends TemplateRecipeHandler public class CachedIORecipe extends CachedRecipe { - private final List ingredients = new ArrayList(); + private final List ingredients = new ArrayList(); private final PositionedStack output; - private final List otherStacks = new ArrayList(); + private final List otherStacks = new ArrayList(); @Override public List getIngredients() @@ -211,12 +211,12 @@ public abstract class IHLRecipeHandler extends TemplateRecipeHandler } else { - ArrayList items = new ArrayList(); - Iterator i = input.getInputs().iterator(); + ArrayList items = new ArrayList(); + Iterator i = input.getInputs().iterator(); while (i.hasNext()) { - ItemStack item = (ItemStack)i.next(); + ItemStack item = i.next(); items.add(StackUtil.copyWithSize(item, input.getAmount())); } diff --git a/ihl/nei_integration/IronWorkbenchRecipeHandler.java b/ihl/nei_integration/IronWorkbenchRecipeHandler.java index 1589f36..980f13a 100644 --- a/ihl/nei_integration/IronWorkbenchRecipeHandler.java +++ b/ihl/nei_integration/IronWorkbenchRecipeHandler.java @@ -5,14 +5,11 @@ import codechicken.nei.NEIServerUtils; import codechicken.nei.PositionedStack; import codechicken.nei.recipe.TemplateRecipeHandler; import ic2.api.recipe.IRecipeInput; -import ic2.core.Ic2Items; -import ihl.IHLMod; import ihl.recipes.IronWorkbenchRecipe; import ihl.utils.IHLUtils; import java.awt.Rectangle; import java.util.ArrayList; -import java.util.Arrays; import java.util.Iterator; import java.util.List; import net.minecraft.client.gui.inventory.GuiContainer; @@ -78,7 +75,6 @@ public class IronWorkbenchRecipeHandler extends TemplateRecipeHandler @Override public void drawBackground(int recipeNumber) { - IronWorkbenchRecipeHandler.CachedIORecipe recipe = (CachedIORecipe) this.arecipes.get(recipeNumber); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GuiDraw.changeTexture(this.getGuiTexture()); GuiDraw.drawTexturedModalRect(0, 0, 7, 7, 162, 108); @@ -128,10 +124,10 @@ public class IronWorkbenchRecipeHandler extends TemplateRecipeHandler while (i$.hasNext()) { IronWorkbenchRecipe entry = i$.next(); - Iterator i$1 = entry.outputs.iterator(); + Iterator i$1 = entry.outputs.iterator(); while (i$1.hasNext()) { - ItemStack output = (ItemStack)i$1.next(); + ItemStack output = i$1.next(); if (NEIServerUtils.areStacksSameTypeCrafting(output, result)) { this.arecipes.add(new IronWorkbenchRecipeHandler.CachedIORecipe(entry)); @@ -150,7 +146,7 @@ public class IronWorkbenchRecipeHandler extends TemplateRecipeHandler IronWorkbenchRecipe entry = i$.next(); if(entry.workspaceElements!=null && !entry.workspaceElements.isEmpty()) { - Iterator i$1 = entry.workspaceElements.iterator(); + Iterator i$1 = entry.workspaceElements.iterator(); while (i$1.hasNext()) { ItemStack output = (ItemStack)i$1.next(); @@ -193,9 +189,9 @@ public class IronWorkbenchRecipeHandler extends TemplateRecipeHandler public class CachedIORecipe extends CachedRecipe { - private final List ingredients = new ArrayList(); + private final List ingredients = new ArrayList(); private final PositionedStack output; - private final List otherStacks = new ArrayList(); + private final List otherStacks = new ArrayList(); @Override public List getIngredients() @@ -227,26 +223,26 @@ public class IronWorkbenchRecipeHandler extends TemplateRecipeHandler this.ingredients.add(new PositionedStack(IHLUtils.getThisModItemStack("ironWorkbench"), workspaceItemsPosX, workspaceItemsPosY)); if(recipe.workspaceElements!=null && !recipe.workspaceElements.isEmpty()) { - Iterator i = recipe.workspaceElements.iterator(); + Iterator i = recipe.workspaceElements.iterator(); int index = 1; while (i.hasNext()) { int x = workspaceItemsPosX; int y = workspaceItemsPosY + index * 18; - ItemStack stack = (ItemStack)i.next(); + ItemStack stack = i.next(); this.ingredients.add(new PositionedStack(stack, x, y)); index++; } } if(recipe.tools!=null && !recipe.tools.isEmpty()) { - Iterator i = recipe.tools.iterator(); + Iterator i = recipe.tools.iterator(); int index = 0; while (i.hasNext()) { int x = toolsPosX + (index % 2) * 18; int y = toolsPosY + index / 2 * 18; - IRecipeInput rInput = (IRecipeInput)i.next(); + IRecipeInput rInput = i.next(); this.ingredients.add(new PositionedStack(rInput.getInputs(), x, y)); index++; } @@ -254,7 +250,7 @@ public class IronWorkbenchRecipeHandler extends TemplateRecipeHandler if(recipe.materials!=null && !recipe.materials.isEmpty()) { - Iterator i = recipe.materials.iterator(); + Iterator i = recipe.materials.iterator(); int index = 0; while (i.hasNext()) { @@ -262,7 +258,7 @@ public class IronWorkbenchRecipeHandler extends TemplateRecipeHandler int y = materialsPosY + index / 2 * 18; IRecipeInput rInput = (IRecipeInput)i.next(); Iterator rInputsi = rInput.getInputs().iterator(); - List itemInputs = new ArrayList(); + List itemInputs = new ArrayList(); while(rInputsi.hasNext()) { ItemStack stack = rInputsi.next().copy(); @@ -277,13 +273,13 @@ public class IronWorkbenchRecipeHandler extends TemplateRecipeHandler } } this.output=new PositionedStack(recipe.outputs.get(0), outputPosX, outputPosY); - Iterator i = recipe.outputs.iterator(); + Iterator i = recipe.outputs.iterator(); int index = 0; while (i.hasNext()) { int x = outputPosX + (index % 3) * 18; int y = outputPosY + index / 3 * 18; - ItemStack stack = (ItemStack)i.next(); + ItemStack stack = i.next(); if(index>0) { this.otherStacks.add(new PositionedStack(stack, x, y)); diff --git a/ihl/nei_integration/LabElectrolyzerRecipeHandler.java b/ihl/nei_integration/LabElectrolyzerRecipeHandler.java index c36e27d..6948a31 100644 --- a/ihl/nei_integration/LabElectrolyzerRecipeHandler.java +++ b/ihl/nei_integration/LabElectrolyzerRecipeHandler.java @@ -1,7 +1,9 @@ package ihl.nei_integration; +import java.awt.Rectangle; import java.util.Map; +import codechicken.nei.recipe.TemplateRecipeHandler.RecipeTransferRect; import ihl.processing.chemistry.LabElectrolyzerGui; import ihl.processing.chemistry.LabElectrolyzerTileEntity; import ihl.recipes.UniversalRecipeInput; @@ -59,6 +61,14 @@ public class LabElectrolyzerRecipeHandler extends MachineRecipeHandler { return "ihl:textures/gui/GUILabElectrolyzer.png"; } + + @Override + public void loadTransferRects() + { + this.transferRects.add(new RecipeTransferRect(new Rectangle(7-5,32-10, 18, 18), this.getRecipeId(), new Object[0])); + this.transferRects.add(new RecipeTransferRect(new Rectangle(86-5,32-10, 37, 18), this.getRecipeId(), new Object[0])); + } + @Override public String getOverlayIdentifier() diff --git a/ihl/nei_integration/MachineRecipeHandler.java b/ihl/nei_integration/MachineRecipeHandler.java index aa5a30b..82b541a 100644 --- a/ihl/nei_integration/MachineRecipeHandler.java +++ b/ihl/nei_integration/MachineRecipeHandler.java @@ -61,6 +61,13 @@ public abstract class MachineRecipeHandler extends TemplateRecipeHandler { MachineRecipeHandler.CachedIORecipe recipe = (CachedIORecipe) this.arecipes.get(recipeNumber); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + for(PositionedStack stack:recipe.ingredients) + { + if(stack.item.stackSize==0) + { + GuiDraw.fontRenderer.drawStringWithShadow("0.001", stack.relx+3, stack.rely+9, 16777215); + } + } if(recipe.output instanceof IHLPositionedStack) { IHLPositionedStack rOutput = (IHLPositionedStack) recipe.output; @@ -112,12 +119,12 @@ public abstract class MachineRecipeHandler extends TemplateRecipeHandler { if (outputId.equals(this.getRecipeId())) { - Iterator i$ = this.getRecipeList().entrySet().iterator(); + Iterator> i$ = this.getRecipeList().entrySet().iterator(); while (i$.hasNext()) { - Entry entry = (Entry)i$.next(); - this.arecipes.add(new MachineRecipeHandler.CachedIORecipe((UniversalRecipeInput)entry.getKey(), (UniversalRecipeOutput)entry.getValue(),getAdditionalIngredients())); + Entry entry = i$.next(); + this.arecipes.add(new MachineRecipeHandler.CachedIORecipe(entry.getKey(), entry.getValue(),getAdditionalIngredients())); } } else @@ -129,7 +136,7 @@ public abstract class MachineRecipeHandler extends TemplateRecipeHandler @Override public void loadCraftingRecipes(ItemStack result) { - Iterator i$ = this.getRecipeList().entrySet().iterator(); + Iterator> i$ = this.getRecipeList().entrySet().iterator(); FluidStack fluidStack = FluidContainerRegistry.getFluidForFilledItem(result); if(fluidStack==null && result.getItem() instanceof IFluidContainerItem) { @@ -152,11 +159,11 @@ public abstract class MachineRecipeHandler extends TemplateRecipeHandler { while (i$.hasNext()) { - Entry entry = (Entry)i$.next(); - Iterator i$1 = ((UniversalRecipeOutput)entry.getValue()).getFluidOutputs().iterator(); + Entry entry = i$.next(); + Iterator i$1 = ((UniversalRecipeOutput)entry.getValue()).getFluidOutputs().iterator(); while (i$1.hasNext()) { - FluidStack output = (FluidStack)i$1.next(); + FluidStack output = i$1.next(); if (output!=null && output.getFluid()==fluidStack.getFluid()) { this.arecipes.add(new MachineRecipeHandler.CachedIORecipe((UniversalRecipeInput)entry.getKey(), (UniversalRecipeOutput)entry.getValue(),getAdditionalIngredients())); @@ -169,8 +176,8 @@ public abstract class MachineRecipeHandler extends TemplateRecipeHandler { while (i$.hasNext()) { - Entry entry = (Entry)i$.next(); - Iterator i$1 = ((UniversalRecipeOutput)entry.getValue()).getItemOutputs().iterator(); + Entry entry = i$.next(); + Iterator i$1 = (entry.getValue()).getItemOutputs().iterator(); while (i$1.hasNext()) { @@ -178,7 +185,7 @@ public abstract class MachineRecipeHandler extends TemplateRecipeHandler if (NEIServerUtils.areStacksSameTypeCrafting(output.itemStack, result) || IHLUtils.isItemsHaveSameOreDictionaryEntry(output.itemStack, result)) { - this.arecipes.add(new MachineRecipeHandler.CachedIORecipe((UniversalRecipeInput)entry.getKey(), (UniversalRecipeOutput)entry.getValue(),getAdditionalIngredients())); + this.arecipes.add(new MachineRecipeHandler.CachedIORecipe(entry.getKey(), entry.getValue(),getAdditionalIngredients())); break; } } @@ -195,7 +202,7 @@ public abstract class MachineRecipeHandler extends TemplateRecipeHandler @Override public void loadUsageRecipes(ItemStack ingredient) { - Iterator i$ = this.getRecipeList().entrySet().iterator(); + Iterator> i$ = this.getRecipeList().entrySet().iterator(); FluidStack fluidStack = FluidContainerRegistry.getFluidForFilledItem(ingredient); if(fluidStack==null && ingredient.getItem() instanceof IFluidContainerItem) { @@ -219,10 +226,10 @@ public abstract class MachineRecipeHandler extends TemplateRecipeHandler { while (i$.hasNext()) { - Entry entry = (Entry)i$.next(); + Entry entry = i$.next(); if (((UniversalRecipeInput)entry.getKey()).containFluidStack(fluidStack)) { - this.arecipes.add(new MachineRecipeHandler.CachedIORecipe((UniversalRecipeInput)entry.getKey(), (UniversalRecipeOutput)entry.getValue(),getAdditionalIngredients())); + this.arecipes.add(new MachineRecipeHandler.CachedIORecipe(entry.getKey(), entry.getValue(),getAdditionalIngredients())); } } } @@ -230,10 +237,10 @@ public abstract class MachineRecipeHandler extends TemplateRecipeHandler { while (i$.hasNext()) { - Entry entry = (Entry)i$.next(); + Entry entry = i$.next(); if (((UniversalRecipeInput)entry.getKey()).containItemStack(ingredient)) { - this.arecipes.add(new MachineRecipeHandler.CachedIORecipe((UniversalRecipeInput)entry.getKey(), (UniversalRecipeOutput)entry.getValue(),getAdditionalIngredients())); + this.arecipes.add(new MachineRecipeHandler.CachedIORecipe(entry.getKey(), entry.getValue(),getAdditionalIngredients())); } } } @@ -266,9 +273,9 @@ public abstract class MachineRecipeHandler extends TemplateRecipeHandler public class CachedIORecipe extends CachedRecipe { - private final List ingredients = new ArrayList(); + private final List ingredients = new ArrayList(); public PositionedStack output; - public final List otherStacks = new ArrayList(); + public final List otherStacks = new ArrayList(); public boolean specialConditions=false; @Override @@ -307,16 +314,16 @@ public abstract class MachineRecipeHandler extends TemplateRecipeHandler else { specialConditions=output1.specialConditions; - ArrayList> items = new ArrayList(); - ArrayList> fluidItems = new ArrayList(); + ArrayList> items = new ArrayList>(); + ArrayList> fluidItems = new ArrayList>(); if(input.getFluidInputs()!=null && !input.getFluidInputs().isEmpty()) { - Iterator i = input.getFluidInputs().iterator(); + Iterator i = input.getFluidInputs().iterator(); while (i.hasNext()) { IRecipeInputFluid fstackRI = (IRecipeInputFluid)i.next(); List fstackList = fstackRI.getInputs(); - List fContainers = new ArrayList(); + List fContainers = new ArrayList(); for(FluidStack fstack:fstackList) { ItemStack stack = Ic2Items.FluidCell.copy(); @@ -333,12 +340,12 @@ public abstract class MachineRecipeHandler extends TemplateRecipeHandler if(input.getItemInputs()!=null && !input.getItemInputs().isEmpty()) { - Iterator i = input.getItemInputs().iterator(); + Iterator i = input.getItemInputs().iterator(); while (i.hasNext()) { IRecipeInput rInput = (IRecipeInput)i.next(); Iterator rInputsi = rInput.getInputs().iterator(); - List itemInputs = new ArrayList(); + List itemInputs = new ArrayList(); while(rInputsi.hasNext()) { ItemStack stack = rInputsi.next().copy(); @@ -407,7 +414,7 @@ public abstract class MachineRecipeHandler extends TemplateRecipeHandler x = MachineRecipeHandler.this.getFluidOutputPosX()[0]; y = MachineRecipeHandler.this.getFluidOutputPosY()[0]; } - Iterator i = output1.getFluidOutputs().iterator(); + Iterator i = output1.getFluidOutputs().iterator(); if(skipOneFluidOutput) { i.next(); diff --git a/ihl/nei_integration/NEIIHLConfig.java b/ihl/nei_integration/NEIIHLConfig.java index 7ffc3fb..288ab24 100644 --- a/ihl/nei_integration/NEIIHLConfig.java +++ b/ihl/nei_integration/NEIIHLConfig.java @@ -19,7 +19,6 @@ import ihl.processing.metallurgy.MuffleFurnaceGui; import ihl.processing.metallurgy.RollingMachineGui; import ihl.processing.metallurgy.WireMillGui; import ihl.processing.metallurgy.WoodenRollingMachineGui; -import ihl.utils.IHLUtils; import codechicken.nei.api.API; import codechicken.nei.api.IConfigureNEI; import codechicken.nei.api.ItemInfo; diff --git a/ihl/processing/chemistry/ApparatusProcessableInvSlot.java b/ihl/processing/chemistry/ApparatusProcessableInvSlot.java index f0b69b3..3698160 100644 --- a/ihl/processing/chemistry/ApparatusProcessableInvSlot.java +++ b/ihl/processing/chemistry/ApparatusProcessableInvSlot.java @@ -18,7 +18,7 @@ public class ApparatusProcessableInvSlot extends InvSlot { public List getItemStackList() { - List list = new ArrayList(); + List list = new ArrayList(); for(int i=0; i iconMap = new HashMap(); - private static Map nameMap = new HashMap(); - private static Map descriptionMap = new HashMap(); + private static Map iconMap = new HashMap(); + private static Map nameMap = new HashMap(); + private static Map descriptionMap = new HashMap(); public BatteryItem() { @@ -96,7 +96,7 @@ public class BatteryItem extends Item implements IElectricItem, IItemHudInfo @Override public List getHudInfo(ItemStack itemStack) { - LinkedList info = new LinkedList(); + LinkedList info = new LinkedList(); info.add(ElectricItem.manager.getToolTip(itemStack)); return info; } @@ -125,11 +125,8 @@ public class BatteryItem extends Item implements IElectricItem, IItemHudInfo return nameMap.get(0);//stack.getItemDamage()); } - @SideOnly(Side.CLIENT) - - /** - * This returns the sub items - */ + @SideOnly(Side.CLIENT) + @SuppressWarnings({ "rawtypes", "unchecked" }) public void func_150895_a(Item item, CreativeTabs par2CreativeTabs, List itemList) { ItemStack itemStack = new ItemStack(this, 1); @@ -158,6 +155,7 @@ public class BatteryItem extends Item implements IElectricItem, IItemHudInfo } @Override + @SuppressWarnings({ "rawtypes", "unchecked" }) public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean flag) { if(BatteryItem.descriptionMap.containsKey(0))//itemStack.getItemDamage())) diff --git a/ihl/processing/chemistry/ChemicalReactorContainer.java b/ihl/processing/chemistry/ChemicalReactorContainer.java index ee60543..a20cc01 100644 --- a/ihl/processing/chemistry/ChemicalReactorContainer.java +++ b/ihl/processing/chemistry/ChemicalReactorContainer.java @@ -10,7 +10,7 @@ import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; import net.minecraftforge.fluids.FluidStack; -public class ChemicalReactorContainer extends ContainerBase { +public class ChemicalReactorContainer extends ContainerBase { protected ChemicalReactorTileEntity tileEntity; public int lastFluidAmount = -1; @@ -44,7 +44,7 @@ public class ChemicalReactorContainer extends ContainerBase { this.addSlotToContainer(new SlotInvSlot(tileEntity1.input, 1, 122, 15)); this.addSlotToContainer(new SlotInvSlot(tileEntity1.outputSlot, 0, 122-18, 51)); this.addSlotToContainer(new SlotInvSlot(tileEntity1.outputSlot, 1, 122, 51)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.engine, 0, 8, 33)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.dischargeSlot, 0, 8, 33)); } @Override diff --git a/ihl/processing/chemistry/ChemicalReactorGui.java b/ihl/processing/chemistry/ChemicalReactorGui.java index 6342d40..029281b 100644 --- a/ihl/processing/chemistry/ChemicalReactorGui.java +++ b/ihl/processing/chemistry/ChemicalReactorGui.java @@ -54,11 +54,6 @@ public class ChemicalReactorGui extends GuiContainer { { IHLRenderUtils.instance.renderIHLFluidTank(this.container.tileEntity.getFluidTank(), 102-18, 28, 114-18, 59, zLevel, par1, par2, xOffset, yOffset); } - if(!this.container.tileEntity.engine.correctContent()) - { - this.mc.renderEngine.bindTexture(background); - IHLRenderUtils.instance.drawMissingEngineTooltip(this, par1, par2, 26, 34, xOffset, yOffset); - } } @Override diff --git a/ihl/processing/chemistry/ChemicalReactorTileEntity.java b/ihl/processing/chemistry/ChemicalReactorTileEntity.java index 7720d2b..cec4177 100644 --- a/ihl/processing/chemistry/ChemicalReactorTileEntity.java +++ b/ihl/processing/chemistry/ChemicalReactorTileEntity.java @@ -50,7 +50,6 @@ public class ChemicalReactorTileEntity extends BasicElectricMotorTileEntity impl this.fillInputSlot = new InvSlotConsumableLiquidIHL(this, "fillInput", -1, InvSlot.Access.I, 1, InvSlot.InvSide.BOTTOM, InvSlotConsumableLiquid.OpType.Fill); this.emptyFluidItemsSlot = new InvSlotOutput(this, "fluidCellsOutput", 2, 1); this.input = new ApparatusProcessableInvSlot(this, "input", 3, Access.IO, 2, 64); - this.isGuiScreenOpened=true; } @Override @@ -131,69 +130,12 @@ public class ChemicalReactorTileEntity extends BasicElectricMotorTileEntity impl return "chemicalReactor"; } - private int mX() - { - switch(this.getFacing()) - { - case 4: - return -1; - case 5: - return 1; - default: - return 0; - } - } - - private int mZ() - { - switch(this.getFacing()) - { - case 3: - return 1; - case 2: - return -1; - case 4: - return 0; - case 5: - return 0; - default: - return -1; - } - } - - private short getFacingFromXZ(int x, int z) - { - switch(x) - { - case -1: - return (short)4; - case 1: - return (short)5; - default: - switch(z) - { - case 1: - return (short)3; - case -1: - return (short)2; - default: - return (short)2; - } - } - } - public float getRenderLiquidLevel() { return (float)this.fluidTank.getFluidAmount()/(float)this.fluidTank.getCapacity(); } @Override - public void onNetworkEvent(EntityPlayer player, int event) - { - // TODO Auto-generated method stub - } - - @Override public int gaugeProgressScaled(int i) { return this.progress * i / operationLength; @@ -245,11 +187,13 @@ public class ChemicalReactorTileEntity extends BasicElectricMotorTileEntity impl return false; } + @SuppressWarnings("unchecked") public UniversalRecipeOutput getOutput() { return ChemicalReactorTileEntity.recipeManager.getOutputFor(this.getInput()[0],this.getInput()[1], false, false); } + @SuppressWarnings({ "unchecked", "rawtypes" }) @Override public List[] getInput() { @@ -270,6 +214,7 @@ public class ChemicalReactorTileEntity extends BasicElectricMotorTileEntity impl } @Override + @SuppressWarnings({ "unchecked"}) public void operate() { UniversalRecipeInput recipeInput = ChemicalReactorTileEntity.recipeManager.getRecipeInput(this.getInput()[0],this.getInput()[1]); @@ -285,7 +230,7 @@ public class ChemicalReactorTileEntity extends BasicElectricMotorTileEntity impl if(te instanceof CryogenicDistillerTileEntity) { CryogenicDistillerTileEntity cgte = (CryogenicDistillerTileEntity)te; - int filled = cgte.fill(ForgeDirection.getOrientation(this.getFacing()), recipeInput.getFluidInputs().get(1).getInputs().get(0), true); + cgte.fill(ForgeDirection.getOrientation(this.getFacing()), recipeInput.getFluidInputs().get(1).getInputs().get(0), true); } } this.fluidTank.drain(recipeInput.getFluidInputs(), true); @@ -347,12 +292,12 @@ public class ChemicalReactorTileEntity extends BasicElectricMotorTileEntity impl public static void addRecipe(FluidStack fluidStackInput1, FluidStack fluidStackInput2, ItemStack itemStackInput, FluidStack fluidStackOutput, ItemStack itemStackOutput1, ItemStack itemStackOutput2) { - addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {fluidStackInput1, fluidStackInput2}), Arrays.asList(new ItemStack[] {itemStackInput})), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {fluidStackOutput}), Arrays.asList(new ItemStack[] {itemStackOutput1, itemStackOutput2}),200)); + addRecipe(new UniversalRecipeInput((new FluidStack[] {fluidStackInput1, fluidStackInput2}), (new ItemStack[] {itemStackInput})), new UniversalRecipeOutput((new FluidStack[] {fluidStackOutput}), (new ItemStack[] {itemStackOutput1, itemStackOutput2}),200)); } public static void addSpecialConditionsRecipe(FluidStack fluidStackInput1, FluidStack fluidStackInput2, ItemStack itemStackInput, FluidStack fluidStackOutput, ItemStack itemStackOutput1, ItemStack itemStackOutput2) { - addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {fluidStackInput1, fluidStackInput2}), Arrays.asList(new ItemStack[] {itemStackInput})), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {fluidStackOutput}), Arrays.asList(new ItemStack[] {itemStackOutput1, itemStackOutput2}),200, true)); + addRecipe(new UniversalRecipeInput((new FluidStack[] {fluidStackInput1, fluidStackInput2}), (new ItemStack[] {itemStackInput})), new UniversalRecipeOutput((new FluidStack[] {fluidStackOutput}), (new ItemStack[] {itemStackOutput1, itemStackOutput2}),200, true)); } public IHLFluidTank getFluidTank() diff --git a/ihl/processing/chemistry/CryogenicDistillerContainer.java b/ihl/processing/chemistry/CryogenicDistillerContainer.java index d3ed523..be35e2a 100644 --- a/ihl/processing/chemistry/CryogenicDistillerContainer.java +++ b/ihl/processing/chemistry/CryogenicDistillerContainer.java @@ -10,7 +10,7 @@ import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; import net.minecraftforge.fluids.FluidStack; -public class CryogenicDistillerContainer extends ContainerBase { +public class CryogenicDistillerContainer extends ContainerBase { public CryogenicDistillerTileEntity tileEntity; public int lastProgress = -1; @@ -39,7 +39,7 @@ public class CryogenicDistillerContainer extends ContainerBase { { this.addSlotToContainer(new Slot(entityPlayer.inventory, col, 8 + col * 18, height + -24)); } - this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.engine,0, 8, 32)); + this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.dischargeSlot,0, 8, 32)); this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.fillInputSlotInput,0, 58, 51)); this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.fillInputSlotProducts,0, 103, 51)); this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.fluidItemsSlot,0, 58, 15)); diff --git a/ihl/processing/chemistry/CryogenicDistillerGui.java b/ihl/processing/chemistry/CryogenicDistillerGui.java index ef18c53..3fbbfa4 100644 --- a/ihl/processing/chemistry/CryogenicDistillerGui.java +++ b/ihl/processing/chemistry/CryogenicDistillerGui.java @@ -42,11 +42,6 @@ public class CryogenicDistillerGui extends GuiContainer { { IHLRenderUtils.instance.renderIHLFluidTank(this.container.tileEntity.fluidTankProducts, 125, 28, 137, 67, zLevel, par1, par2, xOffset, yOffset); } - if(!this.container.tileEntity.engine.correctContent()) - { - this.mc.renderEngine.bindTexture(tex); - IHLRenderUtils.instance.drawMissingEngineTooltip(this, par1, par2, 26, 34, xOffset, yOffset); - } } @Override diff --git a/ihl/processing/chemistry/CryogenicDistillerTileEntity.java b/ihl/processing/chemistry/CryogenicDistillerTileEntity.java index 4c237d3..5a0194f 100644 --- a/ihl/processing/chemistry/CryogenicDistillerTileEntity.java +++ b/ihl/processing/chemistry/CryogenicDistillerTileEntity.java @@ -45,8 +45,7 @@ public class CryogenicDistillerTileEntity extends BasicElectricMotorTileEntity i public CryogenicDistillerTileEntity() { super(); - this.isGuiScreenOpened=true; - this.fillInputSlotInput = new InvSlotConsumableLiquidIHL(this, "fillInputSlotInput", -1, InvSlot.Access.I, 1, InvSlot.InvSide.BOTTOM, InvSlotConsumableLiquid.OpType.Fill); + this.fillInputSlotInput = new InvSlotConsumableLiquidIHL(this, "fillInputSlotInput", -1, InvSlot.Access.I, 1, InvSlot.InvSide.BOTTOM, InvSlotConsumableLiquid.OpType.Fill); this.fillInputSlotProducts = new InvSlotConsumableLiquidIHL(this, "fillInputSlotProducts", -1, InvSlot.Access.I, 1, InvSlot.InvSide.BOTTOM, InvSlotConsumableLiquid.OpType.Fill); this.fluidItemsSlot = new InvSlotOutput(this, "fluidCellsOutput", 2, 2); } @@ -61,10 +60,9 @@ public class CryogenicDistillerTileEntity extends BasicElectricMotorTileEntity i { super.updateEntityServer(); ForgeDirection dir = ForgeDirection.getOrientation(getFacing()); - TileEntity te = worldObj.getTileEntity(xCoord+dir.offsetX,yCoord+dir.offsetY,zCoord+dir.offsetZ); - if(this.processTimer++>20 && this.engine.correctContent() && this.energy>=this.energyConsume/this.engine.getEfficiency()) + if(this.processTimer++>20 && this.energy>=this.energyConsume) { - this.energy-=this.energyConsume/this.engine.getEfficiency(); + this.energy-=this.energyConsume; this.processTimer=0; dir = dir.getOpposite(); Block block = worldObj.getBlock(xCoord+dir.offsetX,yCoord+dir.offsetY,zCoord+dir.offsetZ); @@ -144,6 +142,7 @@ public class CryogenicDistillerTileEntity extends BasicElectricMotorTileEntity i } @Override + @SuppressWarnings({ "unchecked", "rawtypes" }) public List[] getInput() { return new List [] {Arrays.asList(new FluidStack [] {this.fluidTankInput.getLigthestFluid()}),null}; @@ -152,7 +151,7 @@ public class CryogenicDistillerTileEntity extends BasicElectricMotorTileEntity i @Override public boolean canOperate() { - return this.engine.correctContent() && this.getOutput()!=null; + return this.getOutput()!=null; } @Override @@ -182,11 +181,11 @@ public class CryogenicDistillerTileEntity extends BasicElectricMotorTileEntity i { if(output2!=null) { - recipeManager.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {input}),null), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {output,output2}),null,20,specialCondition)); + recipeManager.addRecipe(new UniversalRecipeInput(new FluidStack[] {input},null), new UniversalRecipeOutput(new FluidStack[] {output,output2},null,20,specialCondition)); } else { - recipeManager.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {input}),null), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {output}),null,20,specialCondition)); + recipeManager.addRecipe(new UniversalRecipeInput(new FluidStack[] {input},null), new UniversalRecipeOutput(new FluidStack[] {output},null,20,specialCondition)); } } @@ -197,7 +196,7 @@ public class CryogenicDistillerTileEntity extends BasicElectricMotorTileEntity i public boolean canProcess() { - return this.engine.correctContent() && this.energy>=this.maxStorage && this.fluidTankInput.getFluidAmount()<1000; + return this.energy>=this.maxStorage && this.fluidTankInput.getFluidAmount()<1000; } @Override diff --git a/ihl/processing/chemistry/ElectricEvaporatorBlock.java b/ihl/processing/chemistry/ElectricEvaporatorBlock.java index 2507b2e..f65b76d 100644 --- a/ihl/processing/chemistry/ElectricEvaporatorBlock.java +++ b/ihl/processing/chemistry/ElectricEvaporatorBlock.java @@ -185,7 +185,6 @@ public class ElectricEvaporatorBlock extends Block implements ITileEntityProvide @SideOnly(Side.CLIENT) public IIcon getIcon(int side, int meta) { - IIcon sideIcon = this.blockIcon; switch (side) { case 0: diff --git a/ihl/processing/chemistry/ElectricEvaporatorContainer.java b/ihl/processing/chemistry/ElectricEvaporatorContainer.java index 9dc136e..d981d94 100644 --- a/ihl/processing/chemistry/ElectricEvaporatorContainer.java +++ b/ihl/processing/chemistry/ElectricEvaporatorContainer.java @@ -8,7 +8,7 @@ import net.minecraft.inventory.Slot; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; -public class ElectricEvaporatorContainer extends ContainerBase { +public class ElectricEvaporatorContainer extends ContainerBase { protected ElectricEvaporatorTileEntity tileEntity; public int lastFluidAmount = -1; diff --git a/ihl/processing/chemistry/ElectricEvaporatorTileEntity.java b/ihl/processing/chemistry/ElectricEvaporatorTileEntity.java index 3505cda..1b5b647 100644 --- a/ihl/processing/chemistry/ElectricEvaporatorTileEntity.java +++ b/ihl/processing/chemistry/ElectricEvaporatorTileEntity.java @@ -27,7 +27,6 @@ import ic2.core.audio.AudioSource; import ic2.core.block.invslot.InvSlot; import ic2.core.block.invslot.InvSlotUpgrade; import ic2.core.block.invslot.InvSlot.Access; -import ic2.core.network.NetworkManager; import ic2.core.upgrade.IUpgradableBlock; import ic2.core.upgrade.IUpgradeItem; import ic2.core.upgrade.UpgradableProperty; @@ -39,7 +38,6 @@ public class ElectricEvaporatorTileEntity extends EvaporatorTileEntity implement { public final InvSlotUpgrade upgradeSlot; private int tier; - private int lastTier; public int maxStorage; private int defaultMaxStorage; private double energy; @@ -48,9 +46,6 @@ public class ElectricEvaporatorTileEntity extends EvaporatorTileEntity implement public final int defaultTier; public int energyConsume; public AudioSource audioSource; - private static final int EventStart = 0; - private static final int EventInterrupt = 1; - private static final int EventStop = 2; private int updateChecksum=0; private boolean addedToEnergyNet=false; @@ -60,7 +55,7 @@ public class ElectricEvaporatorTileEntity extends EvaporatorTileEntity implement this.defaultEnergyConsume = this.energyConsume = 8; this.defaultOperationLength = this.maxProgress = 400; this.energy=0D; - this.lastTier = this.tier = this.defaultTier = 1; + this.tier = this.defaultTier = 1; this.maxStorage = this.defaultMaxStorage = defaultEnergyConsume * defaultOperationLength; this.fuelSlot = new IHLInvSlotDischarge(this, 1, Access.IO, this.tier, InvSlot.InvSide.BOTTOM); this.upgradeSlot = new InvSlotUpgrade(this, "upgrade", 4, 4); @@ -206,7 +201,6 @@ public class ElectricEvaporatorTileEntity extends EvaporatorTileEntity implement } if(IC2.platform.isSimulating()) { - boolean needsInvUpdate = false; this.setOverclockRates(); if(this.getDemandedEnergy() > 1.0D) @@ -232,7 +226,6 @@ public class ElectricEvaporatorTileEntity extends EvaporatorTileEntity implement if (this.progress >= this.maxProgress) { this.operate(); - needsInvUpdate = true; this.progress = 0; IC2.network.get().initiateTileEntityEvent(this, 2, true); } @@ -253,20 +246,14 @@ public class ElectricEvaporatorTileEntity extends EvaporatorTileEntity implement { ItemStack stack = this.upgradeSlot.get(i); - if (stack != null && stack.getItem() instanceof IUpgradeItem && ((IUpgradeItem)stack.getItem()).onTick(stack, this)) + if (stack != null && stack.getItem() instanceof IUpgradeItem) { - needsInvUpdate = true; + ((IUpgradeItem)stack.getItem()).onTick(stack, this); } } } } - private static int applyModifier(int base, int extra, double multiplier) - { - double ret = Math.round(((double)base + (double)extra) * multiplier); - return ret > 2.147483647E9D ? Integer.MAX_VALUE : (int)ret; - } - @Override public void onNetworkEvent(int event) { @@ -317,7 +304,7 @@ public class ElectricEvaporatorTileEntity extends EvaporatorTileEntity implement } @Override - public ContainerBase getGuiContainer(EntityPlayer entityPlayer) + public ContainerBase getGuiContainer(EntityPlayer entityPlayer) { return new ElectricEvaporatorContainer(entityPlayer, this); } diff --git a/ihl/processing/chemistry/ElectrolysisBathContainer.java b/ihl/processing/chemistry/ElectrolysisBathContainer.java index f2cc74e..9797755 100644 --- a/ihl/processing/chemistry/ElectrolysisBathContainer.java +++ b/ihl/processing/chemistry/ElectrolysisBathContainer.java @@ -10,7 +10,7 @@ import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; import net.minecraftforge.fluids.FluidStack; -public class ElectrolysisBathContainer extends ContainerBase { +public class ElectrolysisBathContainer extends ContainerBase { protected ElectrolysisBathTileEntity tileEntity; public int lastFluidAmount = -1; diff --git a/ihl/processing/chemistry/ElectrolysisBathGui.java b/ihl/processing/chemistry/ElectrolysisBathGui.java index cb39044..a7788a5 100644 --- a/ihl/processing/chemistry/ElectrolysisBathGui.java +++ b/ihl/processing/chemistry/ElectrolysisBathGui.java @@ -8,7 +8,6 @@ import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; -import ic2.core.network.NetworkManager; import ihl.collector.GuiMultiTextureButton; import ihl.utils.IHLRenderUtils; @@ -25,6 +24,7 @@ public class ElectrolysisBathGui extends GuiContainer { this.container=container1; } + @SuppressWarnings("unchecked") @Override public void initGui() { diff --git a/ihl/processing/chemistry/ElectrolysisBathTileEntity.java b/ihl/processing/chemistry/ElectrolysisBathTileEntity.java index b549247..5a7a215 100644 --- a/ihl/processing/chemistry/ElectrolysisBathTileEntity.java +++ b/ihl/processing/chemistry/ElectrolysisBathTileEntity.java @@ -1,19 +1,16 @@ package ihl.processing.chemistry; import java.util.Arrays; -import java.util.Iterator; import java.util.List; import java.util.Map; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.gui.GuiScreen; -import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; @@ -23,17 +20,11 @@ import ic2.api.network.INetworkClientTileEntityEventListener; import ic2.core.ContainerBase; import ic2.core.IC2; import ic2.core.IHasGui; -import ic2.core.block.TileEntityInventory; import ic2.core.block.invslot.InvSlot; import ic2.core.block.invslot.InvSlot.Access; import ic2.core.block.invslot.InvSlotConsumableLiquid; import ic2.core.block.invslot.InvSlotOutput; -import ic2.core.network.NetworkManager; -import ihl.IHLMod; import ihl.flexible_cable.FlexibleCableHolderBaseTileEntity; -import ihl.flexible_cable.IHLGrid; -import ihl.flexible_cable.NodeEntity; -import ihl.interfaces.IEnergyNetNode; import ihl.processing.chemistry.ApparatusProcessableInvSlot; import ihl.processing.invslots.InvSlotConsumableLiquidIHL; import ihl.recipes.UniversalRecipeInput; @@ -77,7 +68,6 @@ public class ElectrolysisBathTileEntity extends FlexibleCableHolderBaseTileEntit NBTTagCompound fluidTankTag = new NBTTagCompound(); this.fluidTank.writeToNBT(fluidTankTag); nbttagcompound.setTag("fluidTank", fluidTankTag); - NBTTagCompound fractionalOutputNBT = new NBTTagCompound(); } @Override @@ -101,7 +91,6 @@ public class ElectrolysisBathTileEntity extends FlexibleCableHolderBaseTileEntit super.updateEntityServer(); temperature=(short) (this.fluidTank.getTemperature()-273); IHLUtils.handleFluidSlotsBehaviour(fillInputSlot, drainInputSlot, emptyFluidItemsSlot, fluidTank); - boolean needsInvUpdate = false; if (this.canOperate()) { this.setActive(true); @@ -120,7 +109,6 @@ public class ElectrolysisBathTileEntity extends FlexibleCableHolderBaseTileEntit if (this.progress >= this.operationLength) { this.operate(); - needsInvUpdate = true; this.progress = 0; IC2.network.get().initiateTileEntityEvent(this, 2, true); } @@ -209,6 +197,7 @@ public class ElectrolysisBathTileEntity extends FlexibleCableHolderBaseTileEntit return ElectrolysisBathTileEntity.recipeManager.getOutputFor(this.getInput(), false, false); } + @SuppressWarnings("rawtypes") public List[] getInput() { for(int i=0;i { protected EvaporatorTileEntity tileEntity; public int lastFluidAmount = -1; diff --git a/ihl/processing/chemistry/EvaporatorTileEntity.java b/ihl/processing/chemistry/EvaporatorTileEntity.java index e4eb8c0..8160d63 100644 --- a/ihl/processing/chemistry/EvaporatorTileEntity.java +++ b/ihl/processing/chemistry/EvaporatorTileEntity.java @@ -138,7 +138,6 @@ public class EvaporatorTileEntity extends TileEntityLiquidTankInventory implemen public void updateEntityServer() { super.updateEntityServer(); - boolean needsInvUpdate = false; if (this.needsFluid()) { IHLUtils.handleFluidSlotsBehaviour(fillItemsSlot, fluidItemsSlot, emptyFluidItemsSlot, fluidTank); @@ -146,11 +145,6 @@ public class EvaporatorTileEntity extends TileEntityLiquidTankInventory implemen if (this.fuel <= 0 && this.canOperate()) { this.fuel = this.maxFuel = ((InvSlotConsumableFuel) this.fuelSlot).consumeFuel(); - - if (this.fuel > 0) - { - needsInvUpdate = true; - } } if (this.isBurning() && this.canOperate()) @@ -161,7 +155,6 @@ public class EvaporatorTileEntity extends TileEntityLiquidTankInventory implemen { this.progress = 0; this.operate(); - needsInvUpdate = true; } } else @@ -177,7 +170,6 @@ public class EvaporatorTileEntity extends TileEntityLiquidTankInventory implemen if (this.getActive() != this.isBurning()) { this.setActive(this.isBurning()); - needsInvUpdate = true; } } @@ -219,7 +211,7 @@ public class EvaporatorTileEntity extends TileEntityLiquidTankInventory implemen } @Override - public ContainerBase getGuiContainer(EntityPlayer entityPlayer) + public ContainerBase getGuiContainer(EntityPlayer entityPlayer) { return new EvaporatorContainer(entityPlayer, this); } @@ -277,7 +269,7 @@ public class EvaporatorTileEntity extends TileEntityLiquidTankInventory implemen public static void addRecipe(FluidStack input, ItemStack output) { - recipeManager.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack [] {input}),null), new UniversalRecipeOutput(null, Arrays.asList(new ItemStack[] {output}),20)); + recipeManager.addRecipe(new UniversalRecipeInput((new FluidStack [] {input}),null), new UniversalRecipeOutput(null, (new ItemStack[] {output}),20)); } public UniversalRecipeOutput getOutput() diff --git a/ihl/processing/chemistry/ExplosiveTileEntity.java b/ihl/processing/chemistry/ExplosiveTileEntity.java deleted file mode 100644 index 777f527..0000000 --- a/ihl/processing/chemistry/ExplosiveTileEntity.java +++ /dev/null @@ -1,49 +0,0 @@ -package ihl.processing.chemistry; - -import ic2.core.ExplosionIC2; -import ic2.core.block.EntityIC2Explosive; -import ihl.utils.EntityIHLExplosion; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; - -public class ExplosiveTileEntity extends TileEntity { - - public int explosionPower=10000; - public int explosionType=1; - - public void createExplosion(EntityPlayer player) - { - switch(this.explosionType) - { - case 0: - ExplosionIC2 explosion = new ExplosionIC2(this.worldObj, new EntityIC2Explosive(worldObj), xCoord+0.5d, yCoord+0.5d, zCoord+0.5d, this.explosionPower/1000f, 0f, ExplosionIC2.Type.Normal,player, 0); - System.out.println("Start"); - explosion.doExplosion(); - System.out.println("End"); - break; - case 1: - EntityIHLExplosion ex1 = new EntityIHLExplosion(worldObj, xCoord, yCoord, zCoord,this.explosionPower); - worldObj.spawnEntityInWorld(ex1); - break; - } - } - - @Override - public void readFromNBT(NBTTagCompound nbt) - { - if(nbt!=null) - { - explosionPower=nbt.getInteger("explosionPower"); - explosionType=nbt.getInteger("explosionType"); - } - } - - @Override - public void writeToNBT(NBTTagCompound nbt) - { - nbt.setInteger("explosionPower",explosionPower); - nbt.setInteger("explosionType",explosionType); - } - -} diff --git a/ihl/processing/chemistry/FluidizedBedReactorContainer.java b/ihl/processing/chemistry/FluidizedBedReactorContainer.java index 4d42d29..b2c7738 100644 --- a/ihl/processing/chemistry/FluidizedBedReactorContainer.java +++ b/ihl/processing/chemistry/FluidizedBedReactorContainer.java @@ -10,7 +10,7 @@ import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; import net.minecraftforge.fluids.FluidStack; -public class FluidizedBedReactorContainer extends ContainerBase { +public class FluidizedBedReactorContainer extends ContainerBase { protected FluidizedBedReactorTileEntity tileEntity; public int lastFluidAmount = -1; @@ -43,7 +43,7 @@ public class FluidizedBedReactorContainer extends ContainerBase { this.addSlotToContainer(new SlotInvSlot(tileEntity1.input, 0, 8, 23)); this.addSlotToContainer(new SlotInvSlot(tileEntity1.input, 1, 8, 41)); this.addSlotToContainer(new SlotInvSlot(tileEntity1.outputSlot, 0, 43, 33)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.engine, 0, 151, 33)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.dischargeSlot, 0, 151, 33)); } @Override diff --git a/ihl/processing/chemistry/FluidizedBedReactorGui.java b/ihl/processing/chemistry/FluidizedBedReactorGui.java index 6d07aca..3b52c38 100644 --- a/ihl/processing/chemistry/FluidizedBedReactorGui.java +++ b/ihl/processing/chemistry/FluidizedBedReactorGui.java @@ -22,35 +22,30 @@ public class FluidizedBedReactorGui extends GuiContainer { @Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { - int xOffset = (this.width - xSize) / 2; - int yOffset = (this.height - ySize) / 2; - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.renderEngine.bindTexture(background); - int i1; - if (this.container.tileEntity.getEnergy() > 0D) - { - i1 = Math.min(this.container.tileEntity.getGUIEnergy(12),12); - this.drawTexturedModalRect(155, 17 + 12 - i1, 179, 12 - i1, 14, i1 + 2); - } - if (this.container.tileEntity.progress > 0) - { - i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(17),17); - this.drawTexturedModalRect(25, 34, 198, 0,i1,13); - if(mixerFrame++>3) - { - mixerFrame=0; - } - this.drawTexturedModalRect(126, 31, 244, 126+26*mixerFrame,12,26); - } - if (this.container.tileEntity.getTankAmount() > 0) - { - IHLRenderUtils.instance.renderIHLFluidTank(this.container.tileEntity.getFluidTank(), 126, 28, 138, 59, zLevel, par1, par2, xOffset, yOffset); - } - if(!this.container.tileEntity.engine.correctContent()) - { - this.mc.renderEngine.bindTexture(background); - IHLRenderUtils.instance.drawMissingEngineTooltip(this, par1, par2, 169, 34, xOffset, yOffset); - } + int xOffset = (this.width - xSize) / 2; + int yOffset = (this.height - ySize) / 2; + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.renderEngine.bindTexture(background); + int i1; + if (this.container.tileEntity.getEnergy() > 0D) + { + i1 = Math.min(this.container.tileEntity.getGUIEnergy(12),12); + this.drawTexturedModalRect(155, 17 + 12 - i1, 179, 12 - i1, 14, i1 + 2); + } + if (this.container.tileEntity.progress > 0) + { + i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(17),17); + this.drawTexturedModalRect(25, 34, 198, 0,i1,13); + if(mixerFrame++>3) + { + mixerFrame=0; + } + this.drawTexturedModalRect(126, 31, 244, 126+26*mixerFrame,12,26); + } + if (this.container.tileEntity.getTankAmount() > 0) + { + IHLRenderUtils.instance.renderIHLFluidTank(this.container.tileEntity.getFluidTank(), 126, 28, 138, 59, zLevel, par1, par2, xOffset, yOffset); + } } @Override diff --git a/ihl/processing/chemistry/FluidizedBedReactorTileEntity.java b/ihl/processing/chemistry/FluidizedBedReactorTileEntity.java index e9b2ec5..0e279b5 100644 --- a/ihl/processing/chemistry/FluidizedBedReactorTileEntity.java +++ b/ihl/processing/chemistry/FluidizedBedReactorTileEntity.java @@ -42,7 +42,6 @@ public class FluidizedBedReactorTileEntity extends BasicElectricMotorTileEntity public final InvSlotOutput emptyFluidItemsSlot; private final IHLFluidTank fluidTank = new IHLFluidTank(8000); public short temperature=20; - private int fractionalOutputAmount=0; public FluidizedBedReactorTileEntity() { super(); @@ -51,7 +50,6 @@ public class FluidizedBedReactorTileEntity extends BasicElectricMotorTileEntity this.fillInputSlot = new InvSlotConsumableLiquidIHL(this, "fillInput", -1, InvSlot.Access.I, 1, InvSlot.InvSide.BOTTOM, InvSlotConsumableLiquid.OpType.Fill); this.emptyFluidItemsSlot = new InvSlotOutput(this, "fluidCellsOutput", 2, 1); this.input = new ApparatusProcessableInvSlot(this, "input", 3, Access.IO, 2, 64); - this.isGuiScreenOpened=true; } @Override @@ -125,65 +123,8 @@ public class FluidizedBedReactorTileEntity extends BasicElectricMotorTileEntity public String getInventoryName() { return "fluidizedBedReactor"; } - - private int mX() - { - switch(this.getFacing()) - { - case 4: - return -1; - case 5: - return 1; - default: - return 0; - } - } - - private int mZ() - { - switch(this.getFacing()) - { - case 3: - return 1; - case 2: - return -1; - case 4: - return 0; - case 5: - return 0; - default: - return -1; - } - } - - private short getFacingFromXZ(int x, int z) - { - switch(x) - { - case -1: - return (short)4; - case 1: - return (short)5; - default: - switch(z) - { - case 1: - return (short)3; - case -1: - return (short)2; - default: - return (short)2; - } - } - } - - @Override - public void onNetworkEvent(EntityPlayer player, int event) - { - // TODO Auto-generated method stub - } - @Override + @Override public int gaugeProgressScaled(int i) { return this.progress * i / operationLength; @@ -240,6 +181,7 @@ public class FluidizedBedReactorTileEntity extends BasicElectricMotorTileEntity return FluidizedBedReactorTileEntity.recipeManager.getOutputFor(this.getInput(), false, false); } + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public List[] getInput() { @@ -267,6 +209,19 @@ public class FluidizedBedReactorTileEntity extends BasicElectricMotorTileEntity UniversalRecipeOutput output1 = getOutput(); this.fluidTank.drain(recipeInput.getFluidInputs(), true); this.input.consume(0, recipeInput.getItemInputs().get(0).getAmount()); + if(recipeInput.getItemInputs().get(0).getAmount()==0) + { + ItemStack stack = this.input.get(); + if(stack.stackTagCompound==null) + { + stack.stackTagCompound = new NBTTagCompound(); + } + stack.stackTagCompound.setInteger("catalyst_uses",stack.stackTagCompound.getInteger("catalyst_uses")+1); + if(stack.stackTagCompound.getInteger("catalyst_uses")>1000) + { + this.input.consume(0,1); + } + } if(recipeInput.getItemInputs().size()>1)this.input.consume(1, recipeInput.getItemInputs().get(1).getAmount()); if(output1.getFluidOutputs().size()>0)this.fluidTank.fill(output1.getFluidOutputs().get(0).copy(), true); if(output1.getFluidOutputs().size()>1)this.fluidTank.fill(output1.getFluidOutputs().get(1).copy(), true); @@ -331,11 +286,11 @@ public class FluidizedBedReactorTileEntity extends BasicElectricMotorTileEntity { if(fluidStackOutput!=null) { - addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {fluidStackInput1}), Arrays.asList(new ItemStack[] {itemStackInput})), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {fluidStackOutput}), Arrays.asList(new ItemStack[] {itemStackOutput1}),200)); + addRecipe(new UniversalRecipeInput((new FluidStack[] {fluidStackInput1}), (new ItemStack[] {itemStackInput})), new UniversalRecipeOutput((new FluidStack[] {fluidStackOutput}), (new ItemStack[] {itemStackOutput1}),200)); } else { - addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {fluidStackInput1}), Arrays.asList(new ItemStack[] {itemStackInput})), new UniversalRecipeOutput(null, Arrays.asList(new ItemStack[] {itemStackOutput1}),200)); + addRecipe(new UniversalRecipeInput((new FluidStack[] {fluidStackInput1}), (new ItemStack[] {itemStackInput})), new UniversalRecipeOutput(null, (new ItemStack[] {itemStackOutput1}),200)); } } @@ -347,11 +302,11 @@ public class FluidizedBedReactorTileEntity extends BasicElectricMotorTileEntity public static void addRecipe(FluidStack fluidStackInput1, ItemStack itemStackInput, FluidStack fluidStackOutput, RecipeOutputItemStack itemStackOutput1) { if(fluidStackOutput!=null) { - addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {fluidStackInput1}), Arrays.asList(new ItemStack[] {itemStackInput})), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {fluidStackOutput}), Arrays.asList(new RecipeOutputItemStack[] {itemStackOutput1}),200)); + addRecipe(new UniversalRecipeInput((new FluidStack[] {fluidStackInput1}), (new ItemStack[] {itemStackInput})), new UniversalRecipeOutput((new FluidStack[] {fluidStackOutput}), (new RecipeOutputItemStack[] {itemStackOutput1}),200)); } else { - addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {fluidStackInput1}), Arrays.asList(new ItemStack[] {itemStackInput})), new UniversalRecipeOutput(null, Arrays.asList(new RecipeOutputItemStack[] {itemStackOutput1}),200)); + addRecipe(new UniversalRecipeInput((new FluidStack[] {fluidStackInput1}), (new ItemStack[] {itemStackInput})), new UniversalRecipeOutput(null, (new RecipeOutputItemStack[] {itemStackOutput1}),200)); } } diff --git a/ihl/processing/chemistry/FractionatorBottomTileEntity.java b/ihl/processing/chemistry/FractionatorBottomTileEntity.java index 41840e0..20132e9 100644 --- a/ihl/processing/chemistry/FractionatorBottomTileEntity.java +++ b/ihl/processing/chemistry/FractionatorBottomTileEntity.java @@ -29,7 +29,6 @@ public class FractionatorBottomTileEntity extends TileEntityInventory { private final static UniversalRecipeManager recipeManager = new UniversalRecipeManager("fractionator"); private static float kF = 24000F; - private static float gasC = 1F; private static float fluidC = 4F; private static float H = 2256F; private final IHLFluidTank waterTank = new IHLFluidTank(100); @@ -38,7 +37,7 @@ public class FractionatorBottomTileEntity extends TileEntityInventory private int amountOfFluidEvaporated=0; private int systemHeat=0; private static final int maxSystemHeat=10000; - private final List listOfColumnSections = new ArrayList(); + private final List listOfColumnSections = new ArrayList(); private FractionatorCoverTileEntity columnCover; private RefluxCondenserTileEntity refluxCondenser; private IHeatSource heatSource; @@ -78,7 +77,7 @@ public class FractionatorBottomTileEntity extends TileEntityInventory public static void addRecipe(FluidStack fluidIn, FluidStack fluidOut1, FluidStack fluidOut2) { - recipeManager.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {fluidIn}), null), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {fluidOut1,fluidOut2}),null,2)); + recipeManager.addRecipe(new UniversalRecipeInput((new FluidStack[] {fluidIn}), null), new UniversalRecipeOutput((new FluidStack[] {fluidOut1,fluidOut2}),null,2)); } diff --git a/ihl/processing/chemistry/FractionatorCoverTileEntity.java b/ihl/processing/chemistry/FractionatorCoverTileEntity.java index d7addf2..048f953 100644 --- a/ihl/processing/chemistry/FractionatorCoverTileEntity.java +++ b/ihl/processing/chemistry/FractionatorCoverTileEntity.java @@ -6,7 +6,6 @@ import java.util.List; import ic2.api.network.INetworkDataProvider; import ic2.api.tile.IWrenchable; import ic2.core.IC2; -import ic2.core.network.NetworkManager; import ihl.utils.IHLUtils; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -32,7 +31,7 @@ public class FractionatorCoverTileEntity extends TileEntity implements IWrenchab @Override public List getNetworkedFields() { - List fields = new ArrayList(); + List fields = new ArrayList(); fields.add("facing"); return fields; } diff --git a/ihl/processing/chemistry/FractionatorSectionTileEntity.java b/ihl/processing/chemistry/FractionatorSectionTileEntity.java index 18314d6..ddd3f31 100644 --- a/ihl/processing/chemistry/FractionatorSectionTileEntity.java +++ b/ihl/processing/chemistry/FractionatorSectionTileEntity.java @@ -6,7 +6,6 @@ import java.util.List; import ic2.api.network.INetworkDataProvider; import ic2.api.tile.IWrenchable; import ic2.core.IC2; -import ic2.core.network.NetworkManager; import ihl.utils.IHLUtils; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -37,7 +36,7 @@ public class FractionatorSectionTileEntity extends TileEntity implements IWrench @Override public List getNetworkedFields() { - List fields = new ArrayList(); + List fields = new ArrayList(); fields.add("facing"); return fields; } diff --git a/ihl/processing/chemistry/GaedesMercuryRotaryPumpContainer.java b/ihl/processing/chemistry/GaedesMercuryRotaryPumpContainer.java index cbd3239..b283a48 100644 --- a/ihl/processing/chemistry/GaedesMercuryRotaryPumpContainer.java +++ b/ihl/processing/chemistry/GaedesMercuryRotaryPumpContainer.java @@ -6,7 +6,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; -public class GaedesMercuryRotaryPumpContainer extends ContainerBase { +public class GaedesMercuryRotaryPumpContainer extends ContainerBase { protected GaedesMercuryRotaryPumpTileEntity tileEntity; private final static int height=166; @@ -28,7 +28,7 @@ public class GaedesMercuryRotaryPumpContainer extends ContainerBase { { this.addSlotToContainer(new Slot(entityPlayer.inventory, col, 8 + col * 18, height + -24)); } - this.addSlotToContainer(new SlotInvSlot(tileEntity1.engine, 0, 61, 36)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.dischargeSlot, 0, 61, 36)); } @Override diff --git a/ihl/processing/chemistry/GaedesMercuryRotaryPumpGui.java b/ihl/processing/chemistry/GaedesMercuryRotaryPumpGui.java index 78f1b0c..28c9edc 100644 --- a/ihl/processing/chemistry/GaedesMercuryRotaryPumpGui.java +++ b/ihl/processing/chemistry/GaedesMercuryRotaryPumpGui.java @@ -2,7 +2,6 @@ package ihl.processing.chemistry; import org.lwjgl.opengl.GL11; -import ihl.utils.IHLRenderUtils; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.util.ResourceLocation; @@ -19,9 +18,6 @@ public class GaedesMercuryRotaryPumpGui extends GuiContainer { @Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { - int xOffset = (this.width - xSize) / 2; - int yOffset = (this.height - ySize) / 2; - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); this.mc.renderEngine.bindTexture(tex); int i1; @@ -39,11 +35,6 @@ public class GaedesMercuryRotaryPumpGui extends GuiContainer { i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(27),27); this.drawTexturedModalRect(17, 30, getFrameX(i1), getFrameY(i1),24,24); } - if(!this.container.tileEntity.engine.correctContent()) - { - this.mc.renderEngine.bindTexture(tex); - IHLRenderUtils.instance.drawMissingEngineTooltip(this, par1, par2, 79, 37, xOffset, yOffset); - } } @Override diff --git a/ihl/processing/chemistry/GaedesMercuryRotaryPumpTileEntity.java b/ihl/processing/chemistry/GaedesMercuryRotaryPumpTileEntity.java index 3a9b814..3227ab7 100644 --- a/ihl/processing/chemistry/GaedesMercuryRotaryPumpTileEntity.java +++ b/ihl/processing/chemistry/GaedesMercuryRotaryPumpTileEntity.java @@ -18,7 +18,6 @@ public class GaedesMercuryRotaryPumpTileEntity extends BasicElectricMotorTileEnt public GaedesMercuryRotaryPumpTileEntity() { - this.isGuiScreenOpened=true; } @Override @@ -33,6 +32,7 @@ public class GaedesMercuryRotaryPumpTileEntity extends BasicElectricMotorTileEnt return IHLUtils.getThisModItemStack("gaedesMercuryRotaryPump"); } + @SuppressWarnings({ "unchecked", "rawtypes" }) @Override public List[] getInput() { diff --git a/ihl/processing/chemistry/GoldChimneyKneeTileEntity.java b/ihl/processing/chemistry/GoldChimneyKneeTileEntity.java index 6c73a5b..34b3de2 100644 --- a/ihl/processing/chemistry/GoldChimneyKneeTileEntity.java +++ b/ihl/processing/chemistry/GoldChimneyKneeTileEntity.java @@ -8,7 +8,6 @@ import java.util.Map; import ic2.api.network.INetworkDataProvider; import ic2.api.tile.IWrenchable; import ic2.core.IC2; -import ic2.core.network.NetworkManager; import ihl.recipes.UniversalRecipeInput; import ihl.recipes.UniversalRecipeManager; import ihl.recipes.UniversalRecipeOutput; @@ -52,7 +51,7 @@ public class GoldChimneyKneeTileEntity extends TileEntity implements IWrenchable @Override public List getNetworkedFields() { - List fields = new ArrayList(); + List fields = new ArrayList(); fields.add("facing"); return fields; } @@ -273,7 +272,7 @@ public class GoldChimneyKneeTileEntity extends TileEntity implements IWrenchable public static void addRecipe(UniversalRecipeInput input, FluidStack fluidStackWithSize) { - recipeManager.addRecipe(input, new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {fluidStackWithSize}),null,20)); + recipeManager.addRecipe(input, new UniversalRecipeOutput((new FluidStack[] {fluidStackWithSize}),null,20)); } public UniversalRecipeOutput getOutput() @@ -281,6 +280,7 @@ public class GoldChimneyKneeTileEntity extends TileEntity implements IWrenchable return GoldChimneyKneeTileEntity.recipeManager.getOutputFor(this.getInput(), false, false); } + @SuppressWarnings("rawtypes") public List[] getInput() { return new List[] {Arrays.asList(new FluidStack[] {this.gasBuffer.getFluid(),this.fluidTank.getFluid()}),null}; diff --git a/ihl/processing/chemistry/LabElectrolyzerContainer.java b/ihl/processing/chemistry/LabElectrolyzerContainer.java index 5ee9caf..b1fec2f 100644 --- a/ihl/processing/chemistry/LabElectrolyzerContainer.java +++ b/ihl/processing/chemistry/LabElectrolyzerContainer.java @@ -10,7 +10,7 @@ import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; import net.minecraftforge.fluids.FluidStack; -public class LabElectrolyzerContainer extends ContainerBase { +public class LabElectrolyzerContainer extends ContainerBase { protected LabElectrolyzerTileEntity tileEntity; public short lastProgress = -1; @@ -53,7 +53,7 @@ public class LabElectrolyzerContainer extends ContainerBase { this.addSlotToContainer(new SlotInvSlot(tileEntity1.emptyFluidItemsSlot, 1, 42, 33)); this.addSlotToContainer(new SlotInvSlot(tileEntity1.emptyFluidItemsSlot, 2, 106, 15)); this.addSlotToContainer(new SlotInvSlot(tileEntity1.outputSlot, 1, 87, 51)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.engine, 0, 152, 15)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.dischargeSlot, 0, 152, 15)); } @Override diff --git a/ihl/processing/chemistry/LabElectrolyzerGui.java b/ihl/processing/chemistry/LabElectrolyzerGui.java index c5997ca..aea51f8 100644 --- a/ihl/processing/chemistry/LabElectrolyzerGui.java +++ b/ihl/processing/chemistry/LabElectrolyzerGui.java @@ -12,7 +12,6 @@ import ihl.utils.IHLRenderUtils; public class LabElectrolyzerGui extends GuiContainer { private static final ResourceLocation background = new ResourceLocation("ihl", "textures/gui/GUILabElectrolyzer.png"); private LabElectrolyzerContainer container; - private int mixerFrame=0; public LabElectrolyzerGui (LabElectrolyzerContainer container1) { //the container is instanciated and passed to the superclass for handling @@ -53,11 +52,6 @@ public class LabElectrolyzerGui extends GuiContainer { { IHLRenderUtils.instance.renderIHLFluidTank(this.container.tileEntity.fluidTankAnodeOutput, 125, 28, 137, 67, zLevel, par1, par2, xOffset, yOffset); } - if(!this.container.tileEntity.engine.correctContent()) - { - this.mc.renderEngine.bindTexture(background); - IHLRenderUtils.instance.drawMissingEngineTooltip(this, par1, par2, 170, 16, xOffset, yOffset); - } } @Override diff --git a/ihl/processing/chemistry/LabElectrolyzerTileEntity.java b/ihl/processing/chemistry/LabElectrolyzerTileEntity.java index cde3e39..10feef6 100644 --- a/ihl/processing/chemistry/LabElectrolyzerTileEntity.java +++ b/ihl/processing/chemistry/LabElectrolyzerTileEntity.java @@ -10,7 +10,6 @@ import net.minecraft.client.gui.GuiScreen; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; @@ -52,7 +51,6 @@ public class LabElectrolyzerTileEntity extends BasicElectricMotorTileEntity impl this.fillInputSlotAnodeOutput = new InvSlotConsumableLiquidIHL(this, "fillInputAnodeOutput", -1, InvSlot.Access.I, 1, InvSlot.InvSide.BOTTOM, InvSlotConsumableLiquid.OpType.Fill); this.fillInputSlotCathodeOutput = new InvSlotConsumableLiquidIHL(this, "fillInputCathodeOutput", -1, InvSlot.Access.I, 1, InvSlot.InvSide.BOTTOM, InvSlotConsumableLiquid.OpType.Fill); this.emptyFluidItemsSlot = new InvSlotOutput(this, "fluidCellsOutput", 2, 3); - this.isGuiScreenOpened=true; } @Override @@ -142,12 +140,6 @@ public class LabElectrolyzerTileEntity extends BasicElectricMotorTileEntity impl return "labElectrolizer"; } - @Override - public void onNetworkEvent(EntityPlayer player, int event) - { - // TODO Auto-generated method stub - } - @Override public int gaugeProgressScaled(int i) { @@ -188,23 +180,12 @@ public class LabElectrolyzerTileEntity extends BasicElectricMotorTileEntity impl return false; } - private boolean checkSpecialConditions() - { - ForgeDirection dir = ForgeDirection.getOrientation(this.getFacing()); - TileEntity te = worldObj.getTileEntity(xCoord+dir.offsetX, yCoord, zCoord+dir.offsetZ); - if(te instanceof CryogenicDistillerTileEntity) - { - CryogenicDistillerTileEntity cgte = (CryogenicDistillerTileEntity)te; - return cgte.getFacing()==this.getFacing() && cgte.canProcess(); - } - return false; - } - public UniversalRecipeOutput getOutput() { return LabElectrolyzerTileEntity.recipeManager.getOutputFor(this.getInput(), false, false); } + @SuppressWarnings({ "unchecked", "rawtypes" }) @Override public List[] getInput() { @@ -282,11 +263,11 @@ public class LabElectrolyzerTileEntity extends BasicElectricMotorTileEntity impl { if(itemStackOutput1!=null) { - addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {fluidStackInput1}), null), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {fluidStackOutputAnode, fluidStackOutputCathode}), Arrays.asList(new ItemStack[] {itemStackOutput1}),200)); + addRecipe(new UniversalRecipeInput((new FluidStack[] {fluidStackInput1}), null), new UniversalRecipeOutput((new FluidStack[] {fluidStackOutputAnode, fluidStackOutputCathode}), (new ItemStack[] {itemStackOutput1}),200)); } else { - addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {fluidStackInput1}), null), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {fluidStackOutputAnode, fluidStackOutputCathode}), null,200)); + addRecipe(new UniversalRecipeInput((new FluidStack[] {fluidStackInput1}), null), new UniversalRecipeOutput((new FluidStack[] {fluidStackOutputAnode, fluidStackOutputCathode}), null,200)); } } diff --git a/ihl/processing/chemistry/LeadOvenContainer.java b/ihl/processing/chemistry/LeadOvenContainer.java index aa0eafc..c273623 100644 --- a/ihl/processing/chemistry/LeadOvenContainer.java +++ b/ihl/processing/chemistry/LeadOvenContainer.java @@ -6,7 +6,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; -public class LeadOvenContainer extends ContainerBase { +public class LeadOvenContainer extends ContainerBase { protected LeadOvenTileEntity tileEntity; public int lastFluidAmount = -1; diff --git a/ihl/processing/chemistry/LeadOvenGui.java b/ihl/processing/chemistry/LeadOvenGui.java index 133cb4e..2d8e785 100644 --- a/ihl/processing/chemistry/LeadOvenGui.java +++ b/ihl/processing/chemistry/LeadOvenGui.java @@ -5,15 +5,12 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; import org.lwjgl.opengl.GL11; @SideOnly(Side.CLIENT) public class LeadOvenGui extends GuiContainer { private static final ResourceLocation background = new ResourceLocation("ihl", "textures/gui/GUILeadOven.png"); private LeadOvenContainer container; - private String title = StatCollector.translateToLocal("ihl.gui.leadOven"); - public LeadOvenGui (LeadOvenContainer container1) { //the container is instanciated and passed to the superclass for handling @@ -23,10 +20,8 @@ public class LeadOvenGui extends GuiContainer { @Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { - int xOffset = (this.width - xSize) / 2; - int yOffset = (this.height - ySize) / 2; - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.renderEngine.bindTexture(background); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.renderEngine.bindTexture(background); } @Override diff --git a/ihl/processing/chemistry/LeadOvenTileEntity.java b/ihl/processing/chemistry/LeadOvenTileEntity.java index 01f69bf..340d848 100644 --- a/ihl/processing/chemistry/LeadOvenTileEntity.java +++ b/ihl/processing/chemistry/LeadOvenTileEntity.java @@ -24,6 +24,7 @@ import ic2.core.block.TileEntityLiquidTankInventory; import ic2.core.block.invslot.InvSlotConsumableFuel; import ic2.core.block.invslot.InvSlot.Access; import ihl.processing.invslots.IHLInvSlotOutput; +import ihl.recipes.RecipeOutputItemStack; import ihl.recipes.UniversalRecipeInput; import ihl.recipes.UniversalRecipeManager; import ihl.recipes.UniversalRecipeOutput; @@ -152,7 +153,6 @@ public class LeadOvenTileEntity extends TileEntityLiquidTankInventory implements } } } - boolean needsInvUpdate = false; if (this.fuel <= 0 && this.canOperate()) { if(this.fuelSlot.get()!=null) @@ -168,11 +168,6 @@ public class LeadOvenTileEntity extends TileEntityLiquidTankInventory implements } } this.fuel = this.maxFuel = this.fuelSlot.consumeFuel(); - - if (this.fuel > 0) - { - needsInvUpdate = true; - } } if (this.isBurning() && this.canOperate()) @@ -183,7 +178,6 @@ public class LeadOvenTileEntity extends TileEntityLiquidTankInventory implements { this.progress = 0; this.operate(); - needsInvUpdate = true; } } else @@ -199,7 +193,6 @@ public class LeadOvenTileEntity extends TileEntityLiquidTankInventory implements if (this.getActive() != this.isBurning()) { this.setActive(this.isBurning()); - needsInvUpdate = true; } } @@ -223,12 +216,12 @@ public class LeadOvenTileEntity extends TileEntityLiquidTankInventory implements } @Override - public ContainerBase getGuiContainer(EntityPlayer entityPlayer) + public ContainerBase getGuiContainer(EntityPlayer entityPlayer) { return new LeadOvenContainer(entityPlayer, this); } - @Override + @Override @SideOnly(Side.CLIENT) public GuiScreen getGui(EntityPlayer entityPlayer, boolean isAdmin) { @@ -269,6 +262,7 @@ public class LeadOvenTileEntity extends TileEntityLiquidTankInventory implements return LeadOvenTileEntity.recipeManager.getOutputFor(this.getInput(), false, false); } + @SuppressWarnings("rawtypes") public List[] getInput() { if(this.inputSlot.get(1)!=null) @@ -287,7 +281,7 @@ public class LeadOvenTileEntity extends TileEntityLiquidTankInventory implements { this.getFluidTank().fill(output2.get(0), true); } - List itemOutputs = routput.getItemOutputs(); + List itemOutputs = routput.getItemOutputs(); if(itemOutputs!=null && !itemOutputs.isEmpty()) { this.outputSlot.add(itemOutputs); @@ -326,7 +320,7 @@ public class LeadOvenTileEntity extends TileEntityLiquidTankInventory implements public static void addRecipe(UniversalRecipeInput input, FluidStack fluidStackWithSize) { - recipeManager.addRecipe(input, new UniversalRecipeOutput(Arrays.asList(new FluidStack[]{fluidStackWithSize}),null,20)); + recipeManager.addRecipe(input, new UniversalRecipeOutput((new FluidStack[]{fluidStackWithSize}),null,20)); } public static Map getRecipes() { @@ -334,10 +328,10 @@ public class LeadOvenTileEntity extends TileEntityLiquidTankInventory implements } public static void addRecipe(ItemStack input, FluidStack fluidStackOutput, ItemStack output) { - recipeManager.addRecipe(new UniversalRecipeInput(null, Arrays.asList(new ItemStack[] {input})),new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {fluidStackOutput}),Arrays.asList(new ItemStack[] {output}),20)); + recipeManager.addRecipe(new UniversalRecipeInput(null, (new ItemStack[] {input})),new UniversalRecipeOutput((new FluidStack[] {fluidStackOutput}),(new ItemStack[] {output}),20)); } public static void addRecipe(ItemStack input, ItemStack output) { - recipeManager.addRecipe(new UniversalRecipeInput(null, Arrays.asList(new ItemStack[] {input})),new UniversalRecipeOutput(null,Arrays.asList(new ItemStack[] {output}),20)); + recipeManager.addRecipe(new UniversalRecipeInput(null, (new ItemStack[] {input})),new UniversalRecipeOutput(null,(new ItemStack[] {output}),20)); } } \ No newline at end of file diff --git a/ihl/processing/chemistry/LoomContainer.java b/ihl/processing/chemistry/LoomContainer.java index 4b8e182..2d480ef 100644 --- a/ihl/processing/chemistry/LoomContainer.java +++ b/ihl/processing/chemistry/LoomContainer.java @@ -6,7 +6,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; -public class LoomContainer extends ContainerBase { +public class LoomContainer extends ContainerBase { public LoomTileEntity tileEntity; public int lastProgress = -1; diff --git a/ihl/processing/chemistry/LoomGui.java b/ihl/processing/chemistry/LoomGui.java index 1052252..4964687 100644 --- a/ihl/processing/chemistry/LoomGui.java +++ b/ihl/processing/chemistry/LoomGui.java @@ -3,7 +3,6 @@ package ihl.processing.chemistry; import org.lwjgl.opengl.GL11; import ic2.core.IC2; -import ic2.core.network.NetworkManager; import ihl.utils.IHLRenderUtils; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.util.ResourceLocation; diff --git a/ihl/processing/chemistry/LoomTileEntity.java b/ihl/processing/chemistry/LoomTileEntity.java index df5ce20..e81680d 100644 --- a/ihl/processing/chemistry/LoomTileEntity.java +++ b/ihl/processing/chemistry/LoomTileEntity.java @@ -11,7 +11,6 @@ import ic2.core.IC2; import ic2.core.IHasGui; import ic2.core.block.TileEntityInventory; import ic2.core.block.invslot.InvSlot.Access; -import ic2.core.network.NetworkManager; import ihl.processing.chemistry.ApparatusProcessableInvSlot; import ihl.processing.invslots.IHLInvSlotOutput; import ihl.recipes.RecipeInputWire; @@ -106,7 +105,7 @@ public class LoomTileEntity extends TileEntityInventory implements IHasGui, INet public void operate() { List input1 = LoomTileEntity.recipeManager.getRecipeInput(getInput()).getItemInputs(); - List output1 = LoomTileEntity.recipeManager.getOutputFor(getInput(), false, false).getItemOutputs(); + List output1 = LoomTileEntity.recipeManager.getOutputFor(getInput(), false, false).getItemOutputs(); this.output.add(output1); if(input1.get(0) instanceof RecipeInputWire) { @@ -123,6 +122,7 @@ public class LoomTileEntity extends TileEntityInventory implements IHasGui, INet } } + @SuppressWarnings("rawtypes") public List[] getInput() { return new List[] {null,Arrays.asList(new ItemStack[] {input.get()})}; @@ -131,7 +131,7 @@ public class LoomTileEntity extends TileEntityInventory implements IHasGui, INet public boolean canOperate() { if(LoomTileEntity.recipeManager.getOutputFor(getInput(), false, false)==null) return false; - List output1 = LoomTileEntity.recipeManager.getOutputFor(getInput(), false, false).getItemOutputs(); + List output1 = LoomTileEntity.recipeManager.getOutputFor(getInput(), false, false).getItemOutputs(); return this.output.canAdd(output1); } @@ -141,7 +141,7 @@ public class LoomTileEntity extends TileEntityInventory implements IHasGui, INet public static void addRecipe(ItemStack input, ItemStack output) { if(input==null || output==null) throw new NullPointerException(); - recipeManager.addRecipe(new UniversalRecipeInput(null,Arrays.asList(new ItemStack[] {input})), new UniversalRecipeOutput(null, Arrays.asList(new ItemStack[] {output}),20)); + recipeManager.addRecipe(new UniversalRecipeInput(null,new ItemStack[] {input}), new UniversalRecipeOutput(null, new ItemStack[] {output},20)); } public int gaugeProgressScaled(int i) diff --git a/ihl/processing/chemistry/PaperMachineContainer.java b/ihl/processing/chemistry/PaperMachineContainer.java index 99bfa61..ea07afc 100644 --- a/ihl/processing/chemistry/PaperMachineContainer.java +++ b/ihl/processing/chemistry/PaperMachineContainer.java @@ -10,7 +10,7 @@ import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; import net.minecraftforge.fluids.FluidStack; -public class PaperMachineContainer extends ContainerBase { +public class PaperMachineContainer extends ContainerBase { protected PaperMachineTileEntity tileEntity; public int lastFluidAmount = -1; @@ -41,7 +41,7 @@ public class PaperMachineContainer extends ContainerBase { this.addSlotToContainer(new SlotInvSlot(tileEntity1.drainInputSlot, 0, 78, 15)); this.addSlotToContainer(new SlotInvSlot(tileEntity1.emptyFluidItemsSlot, 0, 78, 33)); this.addSlotToContainer(new SlotInvSlot(tileEntity1.outputSlot, 0, 122, 51)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.engine, 0, 8, 32)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.dischargeSlot, 0, 8, 32)); } @Override diff --git a/ihl/processing/chemistry/PaperMachineGui.java b/ihl/processing/chemistry/PaperMachineGui.java index 4c8cb72..b65f041 100644 --- a/ihl/processing/chemistry/PaperMachineGui.java +++ b/ihl/processing/chemistry/PaperMachineGui.java @@ -54,11 +54,6 @@ public class PaperMachineGui extends GuiContainer { { IHLRenderUtils.instance.renderIHLFluidTank(this.container.tileEntity.getFluidTank(), 102, 28, 114, 59, zLevel, par1, par2, xOffset, yOffset); } - if(!this.container.tileEntity.engine.correctContent()) - { - this.mc.renderEngine.bindTexture(background); - IHLRenderUtils.instance.drawMissingEngineTooltip(this, par1, par2, 26, 34, xOffset, yOffset); - } } @Override diff --git a/ihl/processing/chemistry/PaperMachineTileEntity.java b/ihl/processing/chemistry/PaperMachineTileEntity.java index a694b82..4784d38 100644 --- a/ihl/processing/chemistry/PaperMachineTileEntity.java +++ b/ihl/processing/chemistry/PaperMachineTileEntity.java @@ -39,7 +39,6 @@ public class PaperMachineTileEntity extends BasicElectricMotorTileEntity impleme public final InvSlotOutput emptyFluidItemsSlot; private final IHLFluidTank fluidTank = new IHLFluidTank(8000); public short temperature=20; - private int fractionalOutputAmount=0; public PaperMachineTileEntity() { super(); @@ -47,7 +46,6 @@ public class PaperMachineTileEntity extends BasicElectricMotorTileEntity impleme this.drainInputSlot = new InvSlotConsumableLiquidIHL(this, "drainInput", -1, InvSlot.Access.I, 1, InvSlot.InvSide.TOP, InvSlotConsumableLiquid.OpType.Drain); this.fillInputSlot = new InvSlotConsumableLiquidIHL(this, "fillInput", -1, InvSlot.Access.I, 1, InvSlot.InvSide.BOTTOM, InvSlotConsumableLiquid.OpType.Fill); this.emptyFluidItemsSlot = new InvSlotOutput(this, "fluidCellsOutput", 2, 1); - this.isGuiScreenOpened=true; } @Override @@ -64,7 +62,6 @@ public class PaperMachineTileEntity extends BasicElectricMotorTileEntity impleme NBTTagCompound fluidTankTag = new NBTTagCompound(); this.fluidTank.writeToNBT(fluidTankTag); nbttagcompound.setTag("fluidTank", fluidTankTag); - NBTTagCompound fractionalOutputNBT = new NBTTagCompound(); } @Override @@ -115,69 +112,12 @@ public class PaperMachineTileEntity extends BasicElectricMotorTileEntity impleme return "chemicalReactor"; } - private int mX() - { - switch(this.getFacing()) - { - case 4: - return -1; - case 5: - return 1; - default: - return 0; - } - } - - private int mZ() - { - switch(this.getFacing()) - { - case 3: - return 1; - case 2: - return -1; - case 4: - return 0; - case 5: - return 0; - default: - return -1; - } - } - - private short getFacingFromXZ(int x, int z) - { - switch(x) - { - case -1: - return (short)4; - case 1: - return (short)5; - default: - switch(z) - { - case 1: - return (short)3; - case -1: - return (short)2; - default: - return (short)2; - } - } - } - public float getRenderLiquidLevel() { return (float)this.fluidTank.getFluidAmount()/(float)this.fluidTank.getCapacity(); } @Override - public void onNetworkEvent(EntityPlayer player, int event) - { - // TODO Auto-generated method stub - } - - @Override public int gaugeProgressScaled(int i) { return this.progress * i / operationLength; @@ -235,6 +175,7 @@ public class PaperMachineTileEntity extends BasicElectricMotorTileEntity impleme } @Override + @SuppressWarnings({ "rawtypes", "unchecked" }) public List[] getInput() { return new List[] {Arrays.asList(new FluidStack[]{fluidTank.getFluid()}), null}; @@ -304,12 +245,12 @@ public class PaperMachineTileEntity extends BasicElectricMotorTileEntity impleme public static void addRecipe(FluidStack fluidStackInput1, ItemStack itemStackOutput1) { - addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {fluidStackInput1}), null), new UniversalRecipeOutput(null, Arrays.asList(new ItemStack[] {itemStackOutput1}),200)); + addRecipe(new UniversalRecipeInput((new FluidStack[] {fluidStackInput1}), null), new UniversalRecipeOutput(null, (new ItemStack[] {itemStackOutput1}),200)); } public static void addSpecialConditionsRecipe(FluidStack fluidStackInput1, FluidStack fluidStackInput2, ItemStack itemStackInput, FluidStack fluidStackOutput, ItemStack itemStackOutput1, ItemStack itemStackOutput2) { - addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {fluidStackInput1, fluidStackInput2}), Arrays.asList(new ItemStack[] {itemStackInput})), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {fluidStackOutput}), Arrays.asList(new ItemStack[] {itemStackOutput1, itemStackOutput2}),200, true)); + addRecipe(new UniversalRecipeInput(new FluidStack[] {fluidStackInput1, fluidStackInput2}, (new ItemStack[] {itemStackInput})), new UniversalRecipeOutput((new FluidStack[] {fluidStackOutput}), (new ItemStack[] {itemStackOutput1, itemStackOutput2}),200, true)); } public IHLFluidTank getFluidTank() diff --git a/ihl/processing/chemistry/PrecipitatorCondenserTileEntity.java b/ihl/processing/chemistry/PrecipitatorCondenserTileEntity.java index becd7e8..6f3b43f 100644 --- a/ihl/processing/chemistry/PrecipitatorCondenserTileEntity.java +++ b/ihl/processing/chemistry/PrecipitatorCondenserTileEntity.java @@ -25,7 +25,6 @@ public class PrecipitatorCondenserTileEntity extends TileEntityInventory impleme { private final static UniversalRecipeManager recipeManager = new UniversalRecipeManager("precipitatorcondenser"); private static float kF = 24000F; - private static float gasC = 1F; private static float fluidC = 4F; private static float H = 2256F; private final IHLFluidTank gasBuffer = new IHLFluidTank(10000); @@ -49,7 +48,7 @@ public class PrecipitatorCondenserTileEntity extends TileEntityInventory impleme public static void addRecipe(String fluidNameIn, String fluidNameOut, int conversionRateToGas) { - recipeManager.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize(fluidNameIn, conversionRateToGas)}), null), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize(fluidNameOut, 1)}),null,2)); + recipeManager.addRecipe(new UniversalRecipeInput((new FluidStack[] {IHLUtils.getFluidStackWithSize(fluidNameIn, conversionRateToGas)}), null), new UniversalRecipeOutput((new FluidStack[] {IHLUtils.getFluidStackWithSize(fluidNameOut, 1)}),null,2)); } @Override diff --git a/ihl/processing/chemistry/RefluxCondenserTileEntity.java b/ihl/processing/chemistry/RefluxCondenserTileEntity.java index 91366fb..b6cbcb0 100644 --- a/ihl/processing/chemistry/RefluxCondenserTileEntity.java +++ b/ihl/processing/chemistry/RefluxCondenserTileEntity.java @@ -6,7 +6,6 @@ import java.util.List; import ic2.api.network.INetworkDataProvider; import ic2.api.tile.IWrenchable; import ic2.core.IC2; -import ic2.core.network.NetworkManager; import ihl.utils.IHLUtils; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -37,7 +36,7 @@ public class RefluxCondenserTileEntity extends TileEntity implements IWrenchable @Override public List getNetworkedFields() { - List fields = new ArrayList(); + List fields = new ArrayList(); fields.add("facing"); return fields; } diff --git a/ihl/processing/invslots/IHLInvSlotOutput.java b/ihl/processing/invslots/IHLInvSlotOutput.java index 94bf3c8..7e10ab3 100644 --- a/ihl/processing/invslots/IHLInvSlotOutput.java +++ b/ihl/processing/invslots/IHLInvSlotOutput.java @@ -18,11 +18,12 @@ import ihl.utils.IHLUtils; public class IHLInvSlotOutput extends InvSlotOutput{ - private final Map substanceAmount = new HashMap(); + private final Map substanceAmount = new HashMap(); public IHLInvSlotOutput(TileEntityInventory base1, String name1, int oldStartIndex1, int count) { super(base1, name1, oldStartIndex1, count); } + @SuppressWarnings("rawtypes") @Override public boolean canAdd(List itemOutputs) { @@ -82,7 +83,6 @@ public class IHLInvSlotOutput extends InvSlotOutput{ public boolean objectMatchesSlot(Object obj, int slot) { - boolean matches=true; if(this.get(slot)==null) { return true; @@ -131,6 +131,7 @@ public class IHLInvSlotOutput extends InvSlotOutput{ } @Override + @SuppressWarnings("rawtypes") public int add(List itemOutputs) { if(itemOutputs==null || itemOutputs.isEmpty()) @@ -196,7 +197,6 @@ public class IHLInvSlotOutput extends InvSlotOutput{ { super.writeToNbt(nbtTagCompound); NBTTagList sAmountsList = new NBTTagList(); - int i = 0; Iterator> entrySetIterator = this.substanceAmount.entrySet().iterator(); while(entrySetIterator.hasNext()) { diff --git a/ihl/processing/invslots/InvSlotConsumableLiquidIHL.java b/ihl/processing/invslots/InvSlotConsumableLiquidIHL.java index c88584e..0a3b664 100644 --- a/ihl/processing/invslots/InvSlotConsumableLiquidIHL.java +++ b/ihl/processing/invslots/InvSlotConsumableLiquidIHL.java @@ -225,11 +225,11 @@ public class InvSlotConsumableLiquidIHL extends InvSlotConsumableLiquid{ return true; } - Iterator containerItem1 = this.getPossibleFluids().iterator(); + Iterator containerItem1 = this.getPossibleFluids().iterator(); while (containerItem1.hasNext()) { - Fluid prevFluid = (Fluid)containerItem1.next(); + Fluid prevFluid = containerItem1.next(); if (FluidContainerRegistry.fillFluidContainer(new FluidStack(prevFluid, Integer.MAX_VALUE), stack) != null) { @@ -250,11 +250,11 @@ public class InvSlotConsumableLiquidIHL extends InvSlotConsumableLiquid{ } ItemStack singleStack = StackUtil.copyWithSize(stack, 1); - Iterator i$ = this.getPossibleFluids().iterator(); + Iterator i$ = this.getPossibleFluids().iterator(); while (i$.hasNext()) { - Fluid fluid = (Fluid)i$.next(); + Fluid fluid = i$.next(); if (containerItem2.fill(singleStack, new FluidStack(fluid, Integer.MAX_VALUE), false) > 0) { diff --git a/ihl/processing/invslots/InvSlotSignalProcessor.java b/ihl/processing/invslots/InvSlotSignalProcessor.java index 6663db0..f66ab13 100644 --- a/ihl/processing/invslots/InvSlotSignalProcessor.java +++ b/ihl/processing/invslots/InvSlotSignalProcessor.java @@ -1,11 +1,9 @@ package ihl.processing.invslots; -import java.util.Iterator; import net.minecraft.block.Block; import net.minecraftforge.common.util.ForgeDirection; import ic2.core.Ic2Items; import ic2.core.block.invslot.InvSlot; -import ihl.IHLMod; import ihl.datanet.Contact; import ihl.datanet.RedstoneSignalConverterTileEntity; import ihl.interfaces.IDataNode; diff --git a/ihl/processing/invslots/SlotInvSlotIronWorkbench.java b/ihl/processing/invslots/SlotInvSlotIronWorkbench.java new file mode 100644 index 0000000..94354ea --- /dev/null +++ b/ihl/processing/invslots/SlotInvSlotIronWorkbench.java @@ -0,0 +1,31 @@ +package ihl.processing.invslots; + +import net.minecraft.entity.player.EntityPlayer; +import ic2.core.slot.SlotInvSlot; +import ihl.flexible_cable.*; + +public class SlotInvSlotIronWorkbench extends SlotInvSlot { + + public IronWorkbenchInvSlot invSlot; + + public SlotInvSlotIronWorkbench(IronWorkbenchInvSlot invSlot1, int index1, + int xDisplayPosition1, int yDisplayPosition1) { + super(invSlot1, index1, xDisplayPosition1, yDisplayPosition1); + this.invSlot=invSlot1; + + } + + @Override + public boolean canTakeStack(EntityPlayer player) + { + return this.invSlot.getCanTakeStack(); + } + + + @Override + public void onSlotChanged() + { + super.onSlotChanged(); + ((IronWorkbenchTileEntity)this.invSlot.base).resetOutput(); + } +} diff --git a/ihl/processing/metallurgy/AchesonFurnaceGui.java b/ihl/processing/metallurgy/AchesonFurnaceGui.java index bafa530..70e9d05 100644 --- a/ihl/processing/metallurgy/AchesonFurnaceGui.java +++ b/ihl/processing/metallurgy/AchesonFurnaceGui.java @@ -17,8 +17,6 @@ public class AchesonFurnaceGui extends GuiContainer { @Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { - int xOffset = (this.width - xSize) / 2; - int yOffset = (this.height - ySize) / 2; GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); this.mc.renderEngine.bindTexture(achesonFurnaceBackground); int i1; diff --git a/ihl/processing/metallurgy/AchesonFurnanceTileEntity.java b/ihl/processing/metallurgy/AchesonFurnanceTileEntity.java index 5d228fc..0c1b75f 100644 --- a/ihl/processing/metallurgy/AchesonFurnanceTileEntity.java +++ b/ihl/processing/metallurgy/AchesonFurnanceTileEntity.java @@ -1,6 +1,5 @@ package ihl.processing.metallurgy; -import java.util.Arrays; import java.util.List; import java.util.Map; @@ -35,7 +34,7 @@ public class AchesonFurnanceTileEntity extends MachineBaseTileEntity{ public static void addRecipe(IRecipeInput input1, IRecipeInput input2, String output1) { - recipeManager.addRecipe(new UniversalRecipeInput(null,Arrays.asList(new IRecipeInput [] {input1,input2})),new UniversalRecipeOutput(null,Arrays.asList(new ItemStack [] {IHLUtils.getThisModItemStack(output1)}),20)); + recipeManager.addRecipe(new UniversalRecipeInput(null,new IRecipeInput [] {input1,input2}),new UniversalRecipeOutput(null,new ItemStack [] {IHLUtils.getThisModItemStack(output1)},20)); } @Override @@ -46,13 +45,11 @@ public class AchesonFurnanceTileEntity extends MachineBaseTileEntity{ @Override public String getLoopSoundFile() { - // TODO Auto-generated method stub return null; } @Override public String getStopSoundFile() { - // TODO Auto-generated method stub return null; } @@ -104,7 +101,7 @@ public class AchesonFurnanceTileEntity extends MachineBaseTileEntity{ ItemStack crucible = input.getItemStack(IHLMod.crucible); if(crucible!=null) { - ItemStack stack = ((Crucible)crucible.getItem()).processContent(crucible, this); + ((Crucible)crucible.getItem()).processContent(crucible, this); } } @@ -117,7 +114,7 @@ public class AchesonFurnanceTileEntity extends MachineBaseTileEntity{ } @Override - public List[] getInput() + public List[] getInput() { return new List[] {null, this.input.getItemStackList()}; } diff --git a/ihl/processing/metallurgy/BasicElectricMotorTileEntity.java b/ihl/processing/metallurgy/BasicElectricMotorTileEntity.java index 11865a4..47cfda9 100644 --- a/ihl/processing/metallurgy/BasicElectricMotorTileEntity.java +++ b/ihl/processing/metallurgy/BasicElectricMotorTileEntity.java @@ -9,18 +9,12 @@ import ic2.api.energy.tile.IEnergySink; import ic2.api.network.INetworkClientTileEntityEventListener; import ic2.core.IC2; import ic2.core.IHasGui; -import ic2.core.block.TileEntityInventory; +import ic2.core.block.invslot.InvSlot; import ic2.core.block.invslot.InvSlot.Access; -import ic2.core.network.NetworkManager; -import ihl.IHLMod; import ihl.flexible_cable.FlexibleCableHolderBaseTileEntity; -import ihl.flexible_cable.IHLGrid; import ihl.flexible_cable.NodeEntity; -import ihl.interfaces.IEnergyNetNode; -import ihl.utils.IHLUtils; -import net.minecraft.entity.item.EntityItem; +import ihl.utils.IHLInvSlotDischarge; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; @@ -29,10 +23,9 @@ import net.minecraftforge.common.util.ForgeDirection; public abstract class BasicElectricMotorTileEntity extends FlexibleCableHolderBaseTileEntity implements IHasGui, INetworkClientTileEntityEventListener, IEnergySink{ - public final ElectricEngineInvSlot engine; + public final IHLInvSlotDischarge dischargeSlot; public short progress; protected short operationLength=600; - public boolean isGuiScreenOpened=false; protected final double energyConsume=0.1D; public double energy; public int maxStorage=128; @@ -41,7 +34,7 @@ public abstract class BasicElectricMotorTileEntity extends FlexibleCableHolderBa public BasicElectricMotorTileEntity() { super(); - engine = new ElectricEngineInvSlot(this, "engine", 0, Access.IO, 1, 1); + dischargeSlot = new IHLInvSlotDischarge(this, 1, Access.IO, 4, InvSlot.InvSide.BOTTOM); } @@ -79,6 +72,7 @@ public abstract class BasicElectricMotorTileEntity extends FlexibleCableHolderBa } + @SuppressWarnings("unchecked") @Override public void setFacing(short facing1) { @@ -125,10 +119,10 @@ public abstract class BasicElectricMotorTileEntity extends FlexibleCableHolderBa } if(!nodeList.isEmpty()) { - Iterator ei = nodeList.iterator(); + Iterator ei = nodeList.iterator(); while(ei.hasNext()) { - NodeEntity ne=(NodeEntity) ei.next(); + NodeEntity ne= ei.next(); if((ne.prevAnchorEntity==null||ne.nextAnchorEntity==null) && this.cableListContains(ne.getChainUniqueID())) { ne.setVirtualNodePos(connectionX,connectionY,connectionZ); @@ -194,7 +188,6 @@ public abstract class BasicElectricMotorTileEntity extends FlexibleCableHolderBa switch(event) { case 0: - this.isGuiScreenOpened=false; break; } } @@ -204,14 +197,19 @@ public abstract class BasicElectricMotorTileEntity extends FlexibleCableHolderBa @Override public void updateEntityServer() { - if(this.gridID!=-1 && this.getGrid().energy>0D && this.energy=this.energyConsume/this.engine.getEfficiency()) + if(this.getDemandedEnergy() > 1.0D) + { + double amount = this.dischargeSlot.discharge(this.getDemandedEnergy(), false); + this.energy += amount; + } + if(this.gridID!=-1 && this.getGrid().energy>0D && this.energy=this.energyConsume) + { + this.energy-=this.energyConsume; if (this.progress == 0) { IC2.network.get().initiateTileEntityEvent(this, 0, true); @@ -238,7 +236,7 @@ public abstract class BasicElectricMotorTileEntity extends FlexibleCableHolderBa } - public abstract List[] getInput(); + public abstract List[] getInput(); public abstract boolean canOperate(); @Override public void onGuiClosed(EntityPlayer arg0) {} @@ -294,6 +292,7 @@ public abstract class BasicElectricMotorTileEntity extends FlexibleCableHolderBa return 0d; } + @Override public void injectEnergyInThisNode(double amount, double voltage) { this.energy+=amount; diff --git a/ihl/processing/metallurgy/CoilerContainer.java b/ihl/processing/metallurgy/CoilerContainer.java index ba809d2..710a708 100644 --- a/ihl/processing/metallurgy/CoilerContainer.java +++ b/ihl/processing/metallurgy/CoilerContainer.java @@ -6,7 +6,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; -public class CoilerContainer extends ContainerBase { +public class CoilerContainer extends ContainerBase { public CoilerTileEntity tileEntity; private short lastEnergy = -1; @@ -31,7 +31,7 @@ public class CoilerContainer extends ContainerBase { this.addSlotToContainer(new Slot(entityPlayer.inventory, col, 8 + col * 18, height + -24)); } this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.output, 0, 69, 22)); - this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.engine,0, 22, 55)); + this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.dischargeSlot,0, 22, 55)); } @Override diff --git a/ihl/processing/metallurgy/CoilerGui.java b/ihl/processing/metallurgy/CoilerGui.java index fd3b7cd..b635506 100644 --- a/ihl/processing/metallurgy/CoilerGui.java +++ b/ihl/processing/metallurgy/CoilerGui.java @@ -31,10 +31,6 @@ public class CoilerGui extends GuiContainer { { i1 = Math.min(this.container.tileEntity.getGUIEnergy(12),12); this.drawTexturedModalRect(39, 55 + 12 - i1, 179, 12 - i1, 14, i1 + 2); - } - if(!this.container.tileEntity.engine.correctContent()) - { - IHLRenderUtils.instance.drawMissingEngineTooltip(this, par1, par2, 47, 56, xOffset, yOffset); } IHLRenderUtils.instance.drawTooltip(par1,par2,9,11,xOffset,yOffset,StatCollector.translateToLocal("ihl.coiler.tip")); } diff --git a/ihl/processing/metallurgy/CoilerRender.java b/ihl/processing/metallurgy/CoilerRender.java index 646b342..f3da8fa 100644 --- a/ihl/processing/metallurgy/CoilerRender.java +++ b/ihl/processing/metallurgy/CoilerRender.java @@ -70,11 +70,8 @@ private final float scale=1F/16F; { model.CoilRotating.render(scale); } - if(cte.hasEngine) - { - model.MotorPart1.render(scale); - model.MotorPart2.render(scale); - } + model.MotorPart1.render(scale); + model.MotorPart2.render(scale); } model.RotatingPart2.render(scale); GL11.glPopMatrix(); //end diff --git a/ihl/processing/metallurgy/CoilerTileEntity.java b/ihl/processing/metallurgy/CoilerTileEntity.java index 6a671b0..5fdcf13 100644 --- a/ihl/processing/metallurgy/CoilerTileEntity.java +++ b/ihl/processing/metallurgy/CoilerTileEntity.java @@ -5,7 +5,6 @@ import java.util.List; import ic2.core.ContainerBase; import ic2.core.IC2; import ic2.core.block.invslot.InvSlotOutput; -import ic2.core.network.NetworkManager; import ihl.interfaces.IWire; import ihl.utils.IHLUtils; import net.minecraft.client.gui.GuiScreen; @@ -19,13 +18,11 @@ public class CoilerTileEntity extends BasicElectricMotorTileEntity implements IP public final InvSlotOutput output; private int activeTimer=0; public boolean hasCoil=false; - public boolean hasEngine=false; public CoilerTileEntity() { super(); this.output = new InvSlotOutput(this, "output", 1, 1); - this.isGuiScreenOpened=true; } @@ -39,7 +36,6 @@ public class CoilerTileEntity extends BasicElectricMotorTileEntity implements IP { List fields = super.getNetworkedFields(); fields.add("hasCoil"); - fields.add("hasEngine"); return fields; } @@ -89,34 +85,22 @@ public class CoilerTileEntity extends BasicElectricMotorTileEntity implements IP this.hasCoil=true; IC2.network.get().updateTileEntityField(this, "hasCoil"); } - if(this.engine.isEmpty() && hasEngine==true) - { - this.hasEngine=false; - IC2.network.get().updateTileEntityField(this, "hasEngine"); - } - else if(this.engine.correctContent() && hasEngine==false) - { - this.hasEngine=true; - IC2.network.get().updateTileEntityField(this, "hasEngine"); - } - } @Override public void operate() {} - + @SuppressWarnings({ "unchecked", "rawtypes" }) @Override public List[] getInput() { return null; } - @Override public boolean canProcess(ItemStack cable) { - if(this.engine.correctContent() && this.energy>1D/this.engine.getEfficiency() && cable.getItem() instanceof IWire) + if(this.energy>1D && cable.getItem() instanceof IWire) { if(this.output.isEmpty()) { @@ -139,7 +123,7 @@ public class CoilerTileEntity extends BasicElectricMotorTileEntity implements IP public void process(ItemStack cable) { if(cable.getItem() instanceof IWire) { - this.energy-=1D/this.engine.getEfficiency(); + this.energy-=1D; if(this.output.isEmpty()) { setActive(true); diff --git a/ihl/processing/metallurgy/Crucible.java b/ihl/processing/metallurgy/Crucible.java index a435e49..3f14f48 100644 --- a/ihl/processing/metallurgy/Crucible.java +++ b/ihl/processing/metallurgy/Crucible.java @@ -25,7 +25,6 @@ import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.IFluidContainerItem; import net.minecraftforge.fluids.IFluidHandler; -import net.minecraftforge.oredict.OreDictionary; import ic2.api.item.IItemHudInfo; import ic2.api.recipe.IRecipeInput; import ic2.api.recipe.RecipeInputOreDict; @@ -62,7 +61,7 @@ public class Crucible extends Item implements IHandHeldInventory, IFluidContaine public static void addRecipe(String string, FluidStack output) { - recipeManager.addRecipe(new UniversalRecipeInput(null, Arrays.asList(new IRecipeInput[] {new RecipeInputOreDict(string)})), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {output}),null,20)); + recipeManager.addRecipe(new UniversalRecipeInput(null, new IRecipeInput[] {new RecipeInputOreDict(string)}), new UniversalRecipeOutput(new FluidStack[] {output},null,20)); } @Override @@ -84,7 +83,8 @@ public class Crucible extends Item implements IHandHeldInventory, IFluidContaine /** * allows items to add custom lines of information to the mouseover description */ - @Override + @SuppressWarnings({ "rawtypes", "unchecked" }) + @Override public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean b) { super.addInformation(itemStack, player, info, b); @@ -103,7 +103,7 @@ public class Crucible extends Item implements IHandHeldInventory, IFluidContaine @Override public List getHudInfo(ItemStack itemStack) { - LinkedList info = new LinkedList(); + LinkedList info = new LinkedList(); FluidStack fs = this.getFluid(itemStack); if (fs != null) @@ -249,29 +249,7 @@ public class Crucible extends Item implements IHandHeldInventory, IFluidContaine } } } - private String getFormattedFluidNameFromMaterialName(String input) - { - if(input.length()<6) - { - return ""; - } - String input2 = input.substring(5); - return "molten."+input2.toLowerCase(); - } - - private String getOreName(ItemStack stack) - { - int[] arrayIDs = OreDictionary.getOreIDs(stack); - for(int i=0; i if (stack != null) { - NBTTagCompound nbtTagCompoundSlot = StackUtil.getOrCreateNbtData(stack); + StackUtil.getOrCreateNbtData(stack); if (this.box.isThisContainer(stack)) { diff --git a/ihl/processing/metallurgy/CrucibleGui.java b/ihl/processing/metallurgy/CrucibleGui.java index b0bfc85..e92347c 100644 --- a/ihl/processing/metallurgy/CrucibleGui.java +++ b/ihl/processing/metallurgy/CrucibleGui.java @@ -27,8 +27,6 @@ public class CrucibleGui extends GuiContainer @Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { - int xOffset = (this.width - xSize) / 2; - int yOffset = (this.height - ySize) / 2; fontRendererObj.drawString(title, 68, 0, 6171880); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); } diff --git a/ihl/processing/metallurgy/DetonationSprayingMachineContainer.java b/ihl/processing/metallurgy/DetonationSprayingMachineContainer.java index 3bfd2b0..94d479c 100644 --- a/ihl/processing/metallurgy/DetonationSprayingMachineContainer.java +++ b/ihl/processing/metallurgy/DetonationSprayingMachineContainer.java @@ -5,7 +5,7 @@ import ic2.core.slot.SlotInvSlot; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.Slot; -public class DetonationSprayingMachineContainer extends ContainerBase { +public class DetonationSprayingMachineContainer extends ContainerBase { protected DetonationSprayingMachineTileEntity tileEntity; public int lastFluidAmount = -1; diff --git a/ihl/processing/metallurgy/DetonationSprayingMachineGui.java b/ihl/processing/metallurgy/DetonationSprayingMachineGui.java index cc4d455..66d9acb 100644 --- a/ihl/processing/metallurgy/DetonationSprayingMachineGui.java +++ b/ihl/processing/metallurgy/DetonationSprayingMachineGui.java @@ -17,24 +17,21 @@ import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class DetonationSprayingMachineGui extends GuiContainer { private static final ResourceLocation background = new ResourceLocation("ihl", "textures/gui/GUIDetonationSprayingMachine.png"); - private DetonationSprayingMachineContainer container; private static final String hint = StatCollector.translateToLocal("ihl.dsmhint"); public DetonationSprayingMachineGui (DetonationSprayingMachineContainer detonationSprayingMachineContainer) { //the container is instanciated and passed to the superclass for handling super(detonationSprayingMachineContainer); - this.container=detonationSprayingMachineContainer; } @Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { - int xOffset = (this.width - xSize) / 2; - int yOffset = (this.height - ySize) / 2; - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.renderEngine.bindTexture(background); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.renderEngine.bindTexture(background); } - @Override + @SuppressWarnings("unchecked") + @Override protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { //draw your Gui here, only thing you need to change is the path diff --git a/ihl/processing/metallurgy/DetonationSprayingMachineModel.java b/ihl/processing/metallurgy/DetonationSprayingMachineModel.java index 48329d5..7335125 100644 --- a/ihl/processing/metallurgy/DetonationSprayingMachineModel.java +++ b/ihl/processing/metallurgy/DetonationSprayingMachineModel.java @@ -2,7 +2,6 @@ package ihl.processing.metallurgy; import ihl.model.IHLModelRenderer; import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; import net.minecraftforge.common.util.ForgeDirection; @@ -48,13 +47,6 @@ public class DetonationSprayingMachineModel extends ModelBase { Base.addTube("Tube11", -1F, 10F, -8F, 2, 2, 1, 0F,1F,ForgeDirection.NORTH); } - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - @Override public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) { diff --git a/ihl/processing/metallurgy/DetonationSprayingMachineRender.java b/ihl/processing/metallurgy/DetonationSprayingMachineRender.java index 9bb0c6e..ee64b65 100644 --- a/ihl/processing/metallurgy/DetonationSprayingMachineRender.java +++ b/ihl/processing/metallurgy/DetonationSprayingMachineRender.java @@ -49,7 +49,7 @@ public void renderAModelAt(DetonationSprayingMachineTileEntity tile, double x, d bindTexture(tex); //texture GL11.glScalef(1F, -1F, -1F); GL11.glTranslatef(0F, -1.0F, 0F); - model.Base.render(1.0F/16.0F); + model.Base.render(scale); GL11.glPopMatrix(); } diff --git a/ihl/processing/metallurgy/DetonationSprayingMachineTileEntity.java b/ihl/processing/metallurgy/DetonationSprayingMachineTileEntity.java index 590f6e9..f9d2cb6 100644 --- a/ihl/processing/metallurgy/DetonationSprayingMachineTileEntity.java +++ b/ihl/processing/metallurgy/DetonationSprayingMachineTileEntity.java @@ -23,7 +23,6 @@ import ic2.core.audio.AudioSource; import ic2.core.audio.PositionSpec; import ic2.core.block.TileEntityInventory; import ic2.core.block.invslot.InvSlot.Access; -import ic2.core.network.NetworkManager; import ihl.processing.chemistry.ApparatusProcessableInvSlot; import ihl.recipes.RecipeOutputItemStack; import ihl.recipes.UniversalRecipeInput; @@ -76,58 +75,6 @@ public class DetonationSprayingMachineTileEntity extends TileEntityInventory imp return "detonationSprayingMachine"; } - private int mX() - { - switch(this.getFacing()) - { - case 4: - return -1; - case 5: - return 1; - default: - return 0; - } - } - - private int mZ() - { - switch(this.getFacing()) - { - case 3: - return 1; - case 2: - return -1; - case 4: - return 0; - case 5: - return 0; - default: - return -1; - } - } - - private short getFacingFromXZ(int x, int z) - { - switch(x) - { - case -1: - return (short)4; - case 1: - return (short)5; - default: - switch(z) - { - case 1: - return (short)3; - case -1: - return (short)2; - default: - return (short)2; - } - } - } - - @Override public void onNetworkEvent(int event) { @@ -158,7 +105,7 @@ public class DetonationSprayingMachineTileEntity extends TileEntityInventory imp return DetonationSprayingMachineTileEntity.recipeManager.getOutputFor(this.getInput(), false, false); } - public List[] getInput() + public List[] getInput() { return new List[] {null,this.input.getItemStackList()}; } @@ -226,11 +173,11 @@ public class DetonationSprayingMachineTileEntity extends TileEntityInventory imp public static void addRecipe(ItemStack input, ItemStack output) { - List dsmInputs1 = new ArrayList(); - dsmInputs1.add(new RecipeInputItemStack(input)); - dsmInputs1.add(new RecipeInputOreDict("dustDiamond")); - dsmInputs1.add(new RecipeInputOreDict("dustGunpowder")); - recipeManager.addRecipe(new UniversalRecipeInput(null, dsmInputs1), new UniversalRecipeOutput(null,Arrays.asList(new ItemStack[] {output}),1)); + IRecipeInput[] dsmInputs1 = new IRecipeInput[3]; + dsmInputs1[0]=new RecipeInputItemStack(input); + dsmInputs1[1]=new RecipeInputOreDict("dustDiamond"); + dsmInputs1[2]=new RecipeInputOreDict("dustGunpowder"); + recipeManager.addRecipe(new UniversalRecipeInput(null, dsmInputs1), new UniversalRecipeOutput(null,new ItemStack[] {output},1)); } public static void addRecipe(UniversalRecipeInput input, UniversalRecipeOutput output) diff --git a/ihl/processing/metallurgy/DrawingDeskContainer.java b/ihl/processing/metallurgy/DrawingDeskContainer.java deleted file mode 100644 index ca570a1..0000000 --- a/ihl/processing/metallurgy/DrawingDeskContainer.java +++ /dev/null @@ -1,36 +0,0 @@ -package ihl.processing.metallurgy; - -import ic2.core.ContainerBase; -import ic2.core.slot.SlotInvSlot; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.ICrafting; -import net.minecraft.inventory.Slot; - -public class DrawingDeskContainer extends ContainerBase { - - public DrawingDeskTileEntity tileEntity; - public int lastProgress = -1; - private final static int height=166; - - public DrawingDeskContainer(EntityPlayer entityPlayer, - DrawingDeskTileEntity tileEntity1) { - super(tileEntity1); - tileEntity=tileEntity1; - int col; - - for (col = 0; col < 3; ++col) - { - for (int col1 = 0; col1 < 9; ++col1) - { - this.addSlotToContainer(new Slot(entityPlayer.inventory, col1 + col * 9 + 9, 8 + col1 * 18, height + -82 + col * 18)); - } - } - - for (col = 0; col < 9; ++col) - { - this.addSlotToContainer(new Slot(entityPlayer.inventory, col, 8 + col * 18, height + -24)); - } - this.addSlotToContainer(new SlotInvSlot(tileEntity1.input, 0, 8, 44)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.output, 0, 127, 44)); - } -} diff --git a/ihl/processing/metallurgy/DrawingDeskGui.java b/ihl/processing/metallurgy/DrawingDeskGui.java deleted file mode 100644 index 301e072..0000000 --- a/ihl/processing/metallurgy/DrawingDeskGui.java +++ /dev/null @@ -1,59 +0,0 @@ -package ihl.processing.metallurgy; - -import org.lwjgl.opengl.GL11; - -import ic2.core.IC2; -import ic2.core.network.NetworkManager; -import ihl.utils.IHLRenderUtils; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.util.ResourceLocation; - -public class DrawingDeskGui extends GuiContainer { - - private DrawingDeskContainer container; - protected static final ResourceLocation tex = new ResourceLocation("ihl", "textures/gui/GUIDrawingDesk.png"); - - public DrawingDeskGui(DrawingDeskContainer latheContainer) { - super(latheContainer); - container = latheContainer; - } - - - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - int xOffset = (this.width - xSize) / 2; - int yOffset = (this.height - ySize) / 2; - - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.renderEngine.bindTexture(tex); - int i1; - if (this.container.tileEntity.progress > 0) - { - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.99F); - i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(38),38); - this.drawTexturedModalRect(68, 30, 176, 0, i1 + 1, 10); - } - } - - @Override - protected void drawGuiContainerBackgroundLayer(float par1, int par2, - int par3) { - //draw your Gui here, only thing you need to change is the path - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.renderEngine.bindTexture(tex); - int x = (width - xSize) / 2; - int y = (height - ySize) / 2; - this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); - } - - @Override - public void onGuiClosed() - { - super.onGuiClosed(); - this.container.tileEntity.isGuiScreenOpened=false; - IC2.network.get().initiateClientTileEntityEvent(this.container.tileEntity, 0); - } - -} diff --git a/ihl/processing/metallurgy/DrawingDeskModel.java b/ihl/processing/metallurgy/DrawingDeskModel.java deleted file mode 100644 index 55f1c84..0000000 --- a/ihl/processing/metallurgy/DrawingDeskModel.java +++ /dev/null @@ -1,66 +0,0 @@ -package ihl.processing.metallurgy; - -import net.minecraft.client.model.ModelBase; -import net.minecraftforge.common.util.ForgeDirection; -import ihl.model.IHLModelRenderer; - -public class DrawingDeskModel extends ModelBase -{ - //fields - IHLModelRenderer RotatePart; - IHLModelRenderer Piece1; - - public DrawingDeskModel() - { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("RotatePart.Shape1", 0, 14); - setTextureOffset("RotatePart.Pipe2", 0, 17); - setTextureOffset("RotatePart.Shape4", 3, 14); - setTextureOffset("RotatePart.Shape3", 0, 26); - setTextureOffset("RotatePart.Pipe5", 16, 20); - setTextureOffset("RotatePart.Pipe6", 0, 18); - setTextureOffset("RotatePart.Pipe11", 13, 22); - setTextureOffset("RotatePart.Pipe12", 13, 22); - setTextureOffset("RotatePart.Pipe13", 13, 22); - setTextureOffset("RotatePart.Pipe14", 13, 22); - setTextureOffset("RotatePart.Pipe15", 13, 22); - setTextureOffset("Piece1.Shape7", 0, 17); - setTextureOffset("Piece1.Shape8", 0, 17); - setTextureOffset("Piece1.PipeW9", 0, 18); - setTextureOffset("Piece1.PipeW10", 0, 20); - setTextureOffset("Piece1.Shape2", 0, 0); - - RotatePart = new IHLModelRenderer(this, "RotatePart"); - RotatePart.setRotationPoint(0F, 23F, -6F); - setRotation(RotatePart, 0.4F, 0F, 0F); - RotatePart.mirror = true; - RotatePart.addBox("Shape1", 7F, -1F, -1F, 1, 2, 16,false); - RotatePart.addTube("Pipe2", -7.5F, -3F, 0F, 1, 2, 1, 0F,1F,ForgeDirection.UP); - RotatePart.addBox("Shape4", -8F, -1F, -1F, 1, 2, 16,false); - RotatePart.addBox("Shape3", -7F, -1F, -1F, 14, 2, 2,false); - RotatePart.addTube("Pipe5", -5.5F, -3F, 0F, 1, 2, 1, 0F,1F,ForgeDirection.UP); - RotatePart.addTube("Pipe6", -3.5F, -3F, 0F, 1, 2, 1, 0F,1F,ForgeDirection.UP); - RotatePart.addTube("Pipe11", -1.5F, -3F, 0F, 1, 2, 1, 0F,1F,ForgeDirection.UP); - RotatePart.addTube("Pipe12", 0.5F, -3F, 0F, 1, 2, 1, 0F,1F,ForgeDirection.UP); - RotatePart.addTube("Pipe13", 2.5F, -3F, 0F, 1, 2, 1, 0F,1F,ForgeDirection.UP); - RotatePart.addTube("Pipe14", 4.5F, -3F, 0F, 1, 2, 1, 0F,1F,ForgeDirection.UP); - RotatePart.addTube("Pipe15", 6.5F, -3F, 0F, 1, 2, 1, 0F,1F,ForgeDirection.UP); - Piece1 = new IHLModelRenderer(this, "Piece1"); - Piece1.setRotationPoint(0F, 16F, 0F); - setRotation(Piece1, 0F, 0F, 0F); - Piece1.mirror = true; - Piece1.addBox("Shape7", 6F, -4F, 6F, 1, 12, 2,false); - Piece1.addBox("Shape8", -7F, -4F, 6F, 1, 12, 2,false); - Piece1.addTube("PipeW9", -6F, 7F, 7F, 12, 1, 1, 0F,1F,ForgeDirection.EAST); - Piece1.addTube("PipeW10", -6F, -4F, 6F, 12, 1, 1, 0F,1F,ForgeDirection.EAST); - Piece1.addBox("Shape2", 0F, 7F, 0F, 4, 1, 1,false); - } - - private void setRotation(IHLModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } -} diff --git a/ihl/processing/metallurgy/DrawingDeskTileEntity.java b/ihl/processing/metallurgy/DrawingDeskTileEntity.java deleted file mode 100644 index aed1a97..0000000 --- a/ihl/processing/metallurgy/DrawingDeskTileEntity.java +++ /dev/null @@ -1,173 +0,0 @@ -package ihl.processing.metallurgy; - -import java.util.Arrays; -import java.util.List; -import java.util.Map; - -import ic2.api.network.INetworkClientTileEntityEventListener; -import ic2.api.recipe.IRecipeInput; -import ic2.core.ContainerBase; -import ic2.core.IC2; -import ic2.core.IHasGui; -import ic2.core.block.TileEntityInventory; -import ic2.core.block.invslot.InvSlot.Access; -import ic2.core.network.NetworkManager; -import ihl.processing.chemistry.ApparatusProcessableInvSlot; -import ihl.processing.invslots.IHLInvSlotOutput; -import ihl.recipes.RecipeInputWire; -import ihl.recipes.UniversalRecipeInput; -import ihl.recipes.UniversalRecipeManager; -import ihl.recipes.UniversalRecipeOutput; -import ihl.utils.IHLUtils; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class DrawingDeskTileEntity extends TileEntityInventory implements IHasGui, INetworkClientTileEntityEventListener -{ - protected static UniversalRecipeManager recipeManager = new UniversalRecipeManager("DrawingDesk"); - public short progress; - protected short operationLength=200; - public final ApparatusProcessableInvSlot input; - public final IHLInvSlotOutput output; - boolean isGuiScreenOpened=false; - - public DrawingDeskTileEntity() - { - super(); - input = new ApparatusProcessableInvSlot(this, "input", 0, Access.IO, 1, 64); - output = new IHLInvSlotOutput(this, "output", 1, 1); - } - - public boolean enableUpdateEntity() - { - return IC2.platform.isSimulating(); - } - - @Override - public void updateEntityServer() - { - super.updateEntityServer(); - if (this.canOperate() && this.isGuiScreenOpened) - { - this.setActive(true); - - if (this.progress == 0) - { - IC2.network.get().initiateTileEntityEvent(this, 0, true); - } - ++this.progress; - if (this.progress >= this.operationLength) - { - this.operate(); - this.progress = 0; - IC2.network.get().initiateTileEntityEvent(this, 2, true); - } - } - else - { - if (this.progress != 0 && this.getActive()) - { - IC2.network.get().initiateTileEntityEvent(this, 1, true); - } - if (!this.canOperate()) - { - this.progress = 0; - } - this.setActive(false); - } - } - - @Override - public String getInventoryName() { - return "DrawingDesk"; - } - - @Override - public ItemStack getWrenchDrop(EntityPlayer player) - { - return IHLUtils.getThisModItemStack("DrawingDesk"); - } - - @Override - @SideOnly(Side.CLIENT) - public GuiScreen getGui(EntityPlayer player, boolean arg1) { - return new DrawingDeskGui(new DrawingDeskContainer(player, this)); - } - - @Override - public ContainerBase getGuiContainer(EntityPlayer player) { - this.isGuiScreenOpened=true; - return new DrawingDeskContainer(player, this); - } - - public void operate() - { - List input1 = DrawingDeskTileEntity.recipeManager.getRecipeInput(getInput()).getItemInputs(); - List output1 = DrawingDeskTileEntity.recipeManager.getOutputFor(getInput(), false, false).getItemOutputs(); - this.output.add(output1); - if(input1.get(0) instanceof RecipeInputWire) - { - int fiberLength = input1.get(0).getAmount(); - boolean isFiberConsumed = IHLUtils.adjustWireLength(this.input.get(), -fiberLength); - if(isFiberConsumed) - { - this.input.put(null); - } - } - else - { - this.input.consume(0, input1.get(0).getAmount()); - } - } - - public List[] getInput() - { - return new List[] {null,Arrays.asList(new ItemStack[] {input.get()})}; - } - - public boolean canOperate() - { - if(DrawingDeskTileEntity.recipeManager.getOutputFor(getInput(), false, false)==null) return false; - List output1 = DrawingDeskTileEntity.recipeManager.getOutputFor(getInput(), false, false).getItemOutputs(); - return this.output.canAdd(output1); - } - - @Override - public void onGuiClosed(EntityPlayer arg0) {} - - public static void addRecipe(ItemStack input, ItemStack output) - { - if(input==null || output==null) throw new NullPointerException(); - recipeManager.addRecipe(new UniversalRecipeInput(null,Arrays.asList(new ItemStack[] {input})), new UniversalRecipeOutput(null, Arrays.asList(new ItemStack[] {output}),20)); - } - - public int gaugeProgressScaled(int i) - { - return this.progress * i / this.operationLength; - } - - @Override - public void onNetworkEvent(EntityPlayer player, int event) - { - switch(event) - { - case 0: - this.isGuiScreenOpened=false; - break; - } - } - - public static Map getRecipes() { - return recipeManager.getRecipes(); - } - - @Override - public boolean shouldRenderInPass(int pass) - { - return pass==0; - } - -} diff --git a/ihl/processing/metallurgy/ElectricEngineItem.java b/ihl/processing/metallurgy/ElectricEngineItem.java index ec1bdf6..59d6d07 100644 --- a/ihl/processing/metallurgy/ElectricEngineItem.java +++ b/ihl/processing/metallurgy/ElectricEngineItem.java @@ -18,8 +18,8 @@ import ihl.IHLModInfo; public class ElectricEngineItem extends Item{ public Type type; - public static List instances = new ArrayList(); - private static Map iconMap = new HashMap(); + public static List instances = new ArrayList (); + private static Map iconMap = new HashMap(); public ElectricEngineItem(Type type1) diff --git a/ihl/processing/metallurgy/ExtruderContainer.java b/ihl/processing/metallurgy/ExtruderContainer.java index f4af0c0..77b92e6 100644 --- a/ihl/processing/metallurgy/ExtruderContainer.java +++ b/ihl/processing/metallurgy/ExtruderContainer.java @@ -6,7 +6,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; -public class ExtruderContainer extends ContainerBase { +public class ExtruderContainer extends ContainerBase { public ExtruderTileEntity tileEntity; public int lastProgress = -1; @@ -33,7 +33,7 @@ public class ExtruderContainer extends ContainerBase { } this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.input, 0, 39, 32)); this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.input2, 0, 57, 32)); - this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.engine,0, 8, 32)); + this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.dischargeSlot,0, 8, 32)); } @Override diff --git a/ihl/processing/metallurgy/ExtruderGui.java b/ihl/processing/metallurgy/ExtruderGui.java index 1c10b89..acf1a76 100644 --- a/ihl/processing/metallurgy/ExtruderGui.java +++ b/ihl/processing/metallurgy/ExtruderGui.java @@ -2,7 +2,6 @@ package ihl.processing.metallurgy; import org.lwjgl.opengl.GL11; -import ihl.utils.IHLRenderUtils; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.util.ResourceLocation; @@ -19,9 +18,6 @@ public class ExtruderGui extends GuiContainer { @Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { - int xOffset = (this.width - xSize) / 2; - int yOffset = (this.height - ySize) / 2; - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); this.mc.renderEngine.bindTexture(tex); int i1; @@ -38,11 +34,6 @@ public class ExtruderGui extends GuiContainer { i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(18),18); this.drawTexturedModalRect(74, 34, 198, 0, i1 + 1, 13); } - if(!this.container.tileEntity.engine.correctContent()) - { - this.mc.renderEngine.bindTexture(tex); - IHLRenderUtils.instance.drawMissingEngineTooltip(this, par1, par2, 26, 34, xOffset, yOffset); - } } @Override diff --git a/ihl/processing/metallurgy/ExtruderTileEntity.java b/ihl/processing/metallurgy/ExtruderTileEntity.java index de7a4c7..a654bfc 100644 --- a/ihl/processing/metallurgy/ExtruderTileEntity.java +++ b/ihl/processing/metallurgy/ExtruderTileEntity.java @@ -5,9 +5,7 @@ import java.util.List; import java.util.Map; import ic2.core.ContainerBase; -import ic2.core.IC2; import ic2.core.block.invslot.InvSlot.Access; -import ic2.core.network.NetworkManager; import ihl.processing.chemistry.ApparatusProcessableInvSlot; import ihl.recipes.UniversalRecipeInput; import ihl.recipes.UniversalRecipeManager; @@ -30,7 +28,6 @@ public class ExtruderTileEntity extends BasicElectricMotorTileEntity{ public final ApparatusProcessableInvSlot input; public final ApparatusProcessableInvSlot input2; - public boolean hasEngine; private int processTimer=0; private FluidTank fluidTank = new FluidTank(1000); protected static final UniversalRecipeManager recipeManager = new UniversalRecipeManager("extruder"); @@ -40,7 +37,6 @@ public class ExtruderTileEntity extends BasicElectricMotorTileEntity{ super(); input = new ApparatusProcessableInvSlot(this, "input", 1, Access.IO, 1, 64); input2 = new ApparatusProcessableInvSlot(this, "input2", 2, Access.IO, 1, 64); - isGuiScreenOpened=true; } @@ -48,9 +44,7 @@ public class ExtruderTileEntity extends BasicElectricMotorTileEntity{ @Override public List getNetworkedFields() { - List fields = super.getNetworkedFields(); - fields.add("hasEngine"); - return fields; + return super.getNetworkedFields(); } @@ -63,16 +57,6 @@ public class ExtruderTileEntity extends BasicElectricMotorTileEntity{ public void updateEntityServer() { super.updateEntityServer(); - if(this.engine.isEmpty() && hasEngine==true) - { - this.hasEngine=false; - IC2.network.get().updateTileEntityField(this, "hasEngine"); - } - else if(this.engine.correctContent() && hasEngine==false) - { - this.hasEngine=true; - IC2.network.get().updateTileEntityField(this, "hasEngine"); - } ForgeDirection dir = ForgeDirection.getOrientation(getFacing()); TileEntity te = worldObj.getTileEntity(xCoord+dir.offsetX,yCoord+dir.offsetY,zCoord+dir.offsetZ); if(checkCorrectAccembly() && this.fluidTank.getFluidAmount()>0 && this.processTimer++>20) @@ -114,6 +98,7 @@ public class ExtruderTileEntity extends BasicElectricMotorTileEntity{ return ExtruderTileEntity.recipeManager.getOutputFor(this.getInput(), false, false); } + @SuppressWarnings({ "unchecked", "rawtypes" }) @Override public List[] getInput() { @@ -123,7 +108,7 @@ public class ExtruderTileEntity extends BasicElectricMotorTileEntity{ @Override public boolean canOperate() { - return this.fluidTank.getFluidAmount() { protected GasWeldingStationTileEntity tileEntity; public short lastProgress2 = -1; diff --git a/ihl/processing/metallurgy/GasWeldingStationGui.java b/ihl/processing/metallurgy/GasWeldingStationGui.java index 7a34fa6..6248159 100644 --- a/ihl/processing/metallurgy/GasWeldingStationGui.java +++ b/ihl/processing/metallurgy/GasWeldingStationGui.java @@ -8,7 +8,6 @@ import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.inventory.Slot; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; -import ic2.core.network.NetworkManager; import ihl.utils.IHLRenderUtils; @SideOnly(Side.CLIENT) diff --git a/ihl/processing/metallurgy/GasWeldingStationTileEntity.java b/ihl/processing/metallurgy/GasWeldingStationTileEntity.java index 764b524..ff15f5a 100644 --- a/ihl/processing/metallurgy/GasWeldingStationTileEntity.java +++ b/ihl/processing/metallurgy/GasWeldingStationTileEntity.java @@ -127,57 +127,6 @@ public class GasWeldingStationTileEntity extends TileEntityInventory implements return "detonationSprayingMachine"; } - private int mX() - { - switch(this.getFacing()) - { - case 4: - return -1; - case 5: - return 1; - default: - return 0; - } - } - - private int mZ() - { - switch(this.getFacing()) - { - case 3: - return 1; - case 2: - return -1; - case 4: - return 0; - case 5: - return 0; - default: - return -1; - } - } - - private short getFacingFromXZ(int x, int z) - { - switch(x) - { - case -1: - return (short)4; - case 1: - return (short)5; - default: - switch(z) - { - case 1: - return (short)3; - case -1: - return (short)2; - default: - return (short)2; - } - } - } - @Override @SideOnly(Side.CLIENT) public GuiScreen getGui(EntityPlayer player, boolean arg1) { @@ -225,12 +174,12 @@ public class GasWeldingStationTileEntity extends TileEntityInventory implements public UniversalRecipeInput getInput() { - return new UniversalRecipeInput(Arrays.asList(new FluidStack[] {this.flammableGasTank.getLigthestFluid(), this.oxygenTank.getFluid()}), Arrays.asList(new ItemStack[]{this.input.get(0),this.input.get(1),this.input.get(2)})); + return new UniversalRecipeInput(new FluidStack[] {this.flammableGasTank.getLigthestFluid(), this.oxygenTank.getFluid()}, new ItemStack[]{this.input.get(0),this.input.get(1),this.input.get(2)}); } public static void addGasRecipe(ItemStack input, FluidStack inputFluid, FluidStack output, FluidStack output2) { - acetyleneRecipeManager.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {inputFluid}), Arrays.asList(new ItemStack[] {input})), new UniversalRecipeOutput(Arrays.asList(new FluidStack [] {output, output2}),Arrays.asList(new ItemStack [] {}),20)); + acetyleneRecipeManager.addRecipe(new UniversalRecipeInput(new FluidStack[] {inputFluid},new ItemStack[] {input}), new UniversalRecipeOutput(new FluidStack [] {output, output2},new ItemStack [] {}, 20)); } public static Map getGasRecipes() { diff --git a/ihl/processing/metallurgy/ImpregnatingMachineContainer.java b/ihl/processing/metallurgy/ImpregnatingMachineContainer.java index 4489af2..2a95dcb 100644 --- a/ihl/processing/metallurgy/ImpregnatingMachineContainer.java +++ b/ihl/processing/metallurgy/ImpregnatingMachineContainer.java @@ -10,7 +10,7 @@ import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; import net.minecraftforge.fluids.FluidStack; -public class ImpregnatingMachineContainer extends ContainerBase { +public class ImpregnatingMachineContainer extends ContainerBase { protected ImpregnatingMachineTileEntity tileEntity; public int lastFluidAmount = -1; diff --git a/ihl/processing/metallurgy/ImpregnatingMachineTileEntity.java b/ihl/processing/metallurgy/ImpregnatingMachineTileEntity.java index 89a8a63..2ea5d2e 100644 --- a/ihl/processing/metallurgy/ImpregnatingMachineTileEntity.java +++ b/ihl/processing/metallurgy/ImpregnatingMachineTileEntity.java @@ -25,7 +25,6 @@ import ic2.core.block.invslot.InvSlot; import ic2.core.block.invslot.InvSlot.Access; import ic2.core.block.invslot.InvSlotConsumableLiquid; import ic2.core.block.invslot.InvSlotOutput; -import ic2.core.network.NetworkManager; import ihl.interfaces.IHasTemperature; import ihl.processing.chemistry.ApparatusProcessableInvSlot; import ihl.processing.chemistry.ChemicalReactorTileEntity; @@ -125,7 +124,6 @@ public class ImpregnatingMachineTileEntity extends TileEntityInventory implement } temperature=(short) (this.fluidTank.getTemperature()-273); IHLUtils.handleFluidSlotsBehaviour(fillInputSlot, drainInputSlot, emptyFluidItemsSlot, fluidTank); - boolean needsInvUpdate = false; if (this.canOperate()) { this.setActive(true); @@ -138,7 +136,6 @@ public class ImpregnatingMachineTileEntity extends TileEntityInventory implement if (this.progress >= this.operationLength) { this.operate(); - needsInvUpdate = true; this.progress = 0; IC2.network.get().initiateTileEntityEvent(this, 2, true); } @@ -181,57 +178,6 @@ public class ImpregnatingMachineTileEntity extends TileEntityInventory implement return "impregnatingMachine"; } - private int mX() - { - switch(this.getFacing()) - { - case 4: - return -1; - case 5: - return 1; - default: - return 0; - } - } - - private int mZ() - { - switch(this.getFacing()) - { - case 3: - return 1; - case 2: - return -1; - case 4: - return 0; - case 5: - return 0; - default: - return -1; - } - } - - private short getFacingFromXZ(int x, int z) - { - switch(x) - { - case -1: - return (short)4; - case 1: - return (short)5; - default: - switch(z) - { - case 1: - return (short)3; - case -1: - return (short)2; - default: - return (short)2; - } - } - } - public float getRenderLiquidLevel() { return (float)this.visibleFluidAmount/(float)this.fluidTank.getCapacity(); @@ -273,6 +219,7 @@ public class ImpregnatingMachineTileEntity extends TileEntityInventory implement return ImpregnatingMachineTileEntity.recipeManager.getOutputFor(this.getInput(), false, false); } + @SuppressWarnings("rawtypes") public List[] getInput() { for(int i=0;i resultList = OreDictionary.getOres(this.resultSuffix+formattedFluidName); - if(resultList.isEmpty()) + if(resultList.isEmpty() || fluidAmountPerItem<=0) { - resultList=new ArrayList(); - if(IHLUtils.getItemStackIfExist(this.resultSuffix+formattedFluidName)!=null)resultList.add(IHLUtils.getItemStackIfExist(this.resultSuffix+formattedFluidName)); +// IHLMod.log.info("Injection mold: resultList.isEmpty() || fluidAmountPerItem<=0"); + resultList=new ArrayList(); + List fi = Arrays.asList(new FluidStack[] {this.fluidTank.getFluid()}); + List ii = Arrays.asList(new ItemStack[] {IHLUtils.getThisModItemStackWithDamage("injectionMold", this.resultSuffix.hashCode() & Integer.MAX_VALUE)}); + UniversalRecipeOutput ro = recipeManager.getOutputFor(fi, ii, false, false); + if(ro!=null) + { + // IHLMod.log.info("Injection mold: ro not null"); + ItemStack stack = ro.getItemOutputs().get(0).itemStack.copy(); + stack.stackSize=Math.round(ro.getItemOutputs().get(0).quantity); + resultList.add(stack); + UniversalRecipeInput ri = recipeManager.getRecipeInput(fi, ii); + fluidAmountPerItem = ri.getFluidInputs().get(0).getAmount(); + // IHLMod.log.info("fluidAmountPerItem="+fluidAmountPerItem); + } + else + { + // IHLMod.log.info("Injection mold: ro is null. Input stack: "+ii.get(0).toString()); + } } + int fluidAmountPerItem2 = Details.getMeltingFluidAmount("nugget"); ArrayList resultList2 = OreDictionary.getOres("nugget"+formattedFluidName); if(!resultList.isEmpty()) { @@ -132,10 +150,6 @@ public class InjectionMoldTileEntity extends TileEntity implements IFluidHandler private String getFormattedMaterialName(String input) { - if(input.length()<8) - { - return ""; - } String input2 = input.replace("molten.", "").replace(".molten", ""); String firstletter = String.valueOf(input2.charAt(0)).toUpperCase(); input2 = input2.replaceFirst(".", firstletter); diff --git a/ihl/processing/metallurgy/LatheContainer.java b/ihl/processing/metallurgy/LatheContainer.java index c863f7b..5e79a2a 100644 --- a/ihl/processing/metallurgy/LatheContainer.java +++ b/ihl/processing/metallurgy/LatheContainer.java @@ -6,7 +6,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; -public class LatheContainer extends ContainerBase { +public class LatheContainer extends ContainerBase { public LathePart1TileEntity tileEntity; public int lastProgress = -1; @@ -30,7 +30,7 @@ public class LatheContainer extends ContainerBase { { this.addSlotToContainer(new Slot(entityPlayer.inventory, col, 8 + col * 18, height + -24)); } - this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.engine,0, 22, 55)); + this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.dischargeSlot,0, 22, 55)); } @Override diff --git a/ihl/processing/metallurgy/LatheGui.java b/ihl/processing/metallurgy/LatheGui.java index e09f414..16f64c5 100644 --- a/ihl/processing/metallurgy/LatheGui.java +++ b/ihl/processing/metallurgy/LatheGui.java @@ -2,7 +2,6 @@ package ihl.processing.metallurgy; import org.lwjgl.opengl.GL11; -import ihl.utils.IHLRenderUtils; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; @@ -20,9 +19,6 @@ public class LatheGui extends GuiContainer { @Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { - int xOffset = (this.width - xSize) / 2; - int yOffset = (this.height - ySize) / 2; - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); fontRendererObj.drawString(StatCollector.translateToLocal("ihl.gui.lathe"), 50, 10, 14722081); this.mc.renderEngine.bindTexture(tex); @@ -40,11 +36,6 @@ public class LatheGui extends GuiContainer { i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(50),50); this.drawTexturedModalRect(64, 63, 197, 0, i1 + 1, 13); } - if(!this.container.tileEntity.engine.correctContent()) - { - this.mc.renderEngine.bindTexture(tex); - IHLRenderUtils.instance.drawMissingEngineTooltip(this, par1, par2, 47, 56, xOffset, yOffset); - } } @Override diff --git a/ihl/processing/metallurgy/LathePart1TileEntity.java b/ihl/processing/metallurgy/LathePart1TileEntity.java index 9241ba1..ddf834b 100644 --- a/ihl/processing/metallurgy/LathePart1TileEntity.java +++ b/ihl/processing/metallurgy/LathePart1TileEntity.java @@ -19,7 +19,6 @@ public class LathePart1TileEntity extends BasicElectricMotorTileEntity implement public LathePart1TileEntity() { super(); - this.isGuiScreenOpened=true; } @@ -52,6 +51,7 @@ public class LathePart1TileEntity extends BasicElectricMotorTileEntity implement } + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public List[] getInput() { diff --git a/ihl/processing/metallurgy/LathePart2TileEntity.java b/ihl/processing/metallurgy/LathePart2TileEntity.java index 4543afa..7d4dac7 100644 --- a/ihl/processing/metallurgy/LathePart2TileEntity.java +++ b/ihl/processing/metallurgy/LathePart2TileEntity.java @@ -6,7 +6,6 @@ import java.util.List; import ic2.api.network.INetworkDataProvider; import ic2.api.tile.IWrenchable; import ic2.core.IC2; -import ic2.core.network.NetworkManager; import ihl.utils.IHLUtils; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; diff --git a/ihl/processing/metallurgy/MachineBaseTileEntity.java b/ihl/processing/metallurgy/MachineBaseTileEntity.java index 51df187..de20f5a 100644 --- a/ihl/processing/metallurgy/MachineBaseTileEntity.java +++ b/ihl/processing/metallurgy/MachineBaseTileEntity.java @@ -6,10 +6,8 @@ import ic2.api.energy.tile.IEnergySink; import ic2.core.ContainerBase; import ic2.core.IC2; import ic2.core.IHasGui; -import ic2.core.audio.AudioSource; import ic2.core.block.TileEntityInventory; import ic2.core.block.invslot.InvSlot.Access; -import ic2.core.network.NetworkManager; import ihl.processing.chemistry.ApparatusProcessableInvSlot; import ihl.recipes.UniversalRecipeOutput; import java.util.List; @@ -26,9 +24,6 @@ public abstract class MachineBaseTileEntity extends TileEntityInventory implemen { public short progress; protected short operationLength=200; - private AudioSource startAS; - private AudioSource loopAS; - private AudioSource stopAS; protected double energy; public int maxStorage; public int energyConsume; @@ -222,6 +217,7 @@ public abstract class MachineBaseTileEntity extends TileEntityInventory implemen public abstract UniversalRecipeOutput getOutput(); + @SuppressWarnings("rawtypes") public List[] getInput() { return new List[]{null, this.input.getItemStackList()}; diff --git a/ihl/processing/metallurgy/MuffleFurnanceTileEntity.java b/ihl/processing/metallurgy/MuffleFurnanceTileEntity.java index 73d12de..c5a54c7 100644 --- a/ihl/processing/metallurgy/MuffleFurnanceTileEntity.java +++ b/ihl/processing/metallurgy/MuffleFurnanceTileEntity.java @@ -110,7 +110,7 @@ public class MuffleFurnanceTileEntity extends MachineBaseTileEntity{ public static void addRecipe(ItemStack input1, ItemStack output) { - recipeManager.addRecipe(new UniversalRecipeInput(null, Arrays.asList(new ItemStack [] {input1})),new UniversalRecipeOutput(null, Arrays.asList(new ItemStack [] {output}),20)); + recipeManager.addRecipe(new UniversalRecipeInput(null, (new ItemStack [] {input1})),new UniversalRecipeOutput(null, (new ItemStack [] {output}),20)); } @@ -130,6 +130,6 @@ public class MuffleFurnanceTileEntity extends MachineBaseTileEntity{ } public static void addRecipe(ItemStack input1, ItemStack output, float f) { - recipeManager.addRecipe(new UniversalRecipeInput(null, Arrays.asList(new ItemStack [] {input1})),new UniversalRecipeOutput(null, Arrays.asList(new RecipeOutputItemStack [] {new RecipeOutputItemStack(output,f)}),20)); + recipeManager.addRecipe(new UniversalRecipeInput(null, (new ItemStack [] {input1})),new UniversalRecipeOutput(null, (new RecipeOutputItemStack [] {new RecipeOutputItemStack(output,f)}),20)); } } diff --git a/ihl/processing/metallurgy/RollingMachineContainer.java b/ihl/processing/metallurgy/RollingMachineContainer.java index c3bdb31..7a83d9d 100644 --- a/ihl/processing/metallurgy/RollingMachineContainer.java +++ b/ihl/processing/metallurgy/RollingMachineContainer.java @@ -6,7 +6,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; -public class RollingMachineContainer extends ContainerBase { +public class RollingMachineContainer extends ContainerBase { public RollingMachinePart1TileEntity tileEntity; public int lastProgress = -1; @@ -33,7 +33,7 @@ public class RollingMachineContainer extends ContainerBase { } this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.input, 0, 54, 25)); this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.output, 0, 105, 25)); - this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.engine,0, 22, 55)); + this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.dischargeSlot,0, 22, 55)); } @Override diff --git a/ihl/processing/metallurgy/RollingMachineGui.java b/ihl/processing/metallurgy/RollingMachineGui.java index 16ccdac..a792bd3 100644 --- a/ihl/processing/metallurgy/RollingMachineGui.java +++ b/ihl/processing/metallurgy/RollingMachineGui.java @@ -2,7 +2,6 @@ package ihl.processing.metallurgy; import org.lwjgl.opengl.GL11; -import ihl.utils.IHLRenderUtils; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.util.ResourceLocation; @@ -19,9 +18,6 @@ public class RollingMachineGui extends GuiContainer { @Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { - int xOffset = (this.width - xSize) / 2; - int yOffset = (this.height - ySize) / 2; - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); this.mc.renderEngine.bindTexture(tex); int i1; @@ -39,11 +35,6 @@ public class RollingMachineGui extends GuiContainer { i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(50),50); this.drawTexturedModalRect(64, 63, 197, 0, i1 + 1, 13); } - if(!this.container.tileEntity.engine.correctContent()) - { - this.mc.renderEngine.bindTexture(tex); - IHLRenderUtils.instance.drawMissingEngineTooltip(this, par1, par2, 47, 56, xOffset, yOffset); - } } @Override diff --git a/ihl/processing/metallurgy/RollingMachinePart1TileEntity.java b/ihl/processing/metallurgy/RollingMachinePart1TileEntity.java index 9c02a47..a3d6ae6 100644 --- a/ihl/processing/metallurgy/RollingMachinePart1TileEntity.java +++ b/ihl/processing/metallurgy/RollingMachinePart1TileEntity.java @@ -7,7 +7,6 @@ import java.util.Map; import ic2.core.ContainerBase; import ic2.core.IC2; import ic2.core.block.invslot.InvSlot.Access; -import ic2.core.network.NetworkManager; import ihl.processing.chemistry.ApparatusProcessableInvSlot; import ihl.processing.invslots.IHLInvSlotOutput; import ihl.recipes.RecipeOutputItemStack; @@ -27,7 +26,6 @@ public class RollingMachinePart1TileEntity extends BasicElectricMotorTileEntity{ public final ApparatusProcessableInvSlot input; public final IHLInvSlotOutput output; - public boolean hasEngine; public boolean assembled; protected static final UniversalRecipeManager recipeManager = new UniversalRecipeManager("rollingmachine"); @@ -36,7 +34,6 @@ public class RollingMachinePart1TileEntity extends BasicElectricMotorTileEntity{ super(); input = new ApparatusProcessableInvSlot(this, "input", 1, Access.IO, 1, 64); output = new IHLInvSlotOutput(this, "output", 2, 1); - isGuiScreenOpened=true; } public UniversalRecipeOutput getOutput() @@ -49,7 +46,6 @@ public class RollingMachinePart1TileEntity extends BasicElectricMotorTileEntity{ { List fields = super.getNetworkedFields(); fields.add("assembled"); - fields.add("hasEngine"); return fields; } @@ -73,17 +69,6 @@ public class RollingMachinePart1TileEntity extends BasicElectricMotorTileEntity{ assembled=true; IC2.network.get().updateTileEntityField(this, "assembled"); } - if(this.engine.isEmpty() && hasEngine==true) - { - this.hasEngine=false; - IC2.network.get().updateTileEntityField(this, "hasEngine"); - } - else if(this.engine.correctContent() && hasEngine==false) - { - this.hasEngine=true; - IC2.network.get().updateTileEntityField(this, "hasEngine"); - } - if (this.getActive() && this.progress == 0 && !this.canOperate()) { this.setActive(false); @@ -121,6 +106,7 @@ public class RollingMachinePart1TileEntity extends BasicElectricMotorTileEntity{ this.input.consume(0, 1); } + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public List[] getInput() { @@ -130,7 +116,7 @@ public class RollingMachinePart1TileEntity extends BasicElectricMotorTileEntity{ @Override public boolean canOperate() { - return this.engine.correctContent() && this.getOutput()!=null && this.output.canAdd(this.getOutput().getItemOutputs()) && checkCorrectAccembly(); + return this.getOutput()!=null && this.output.canAdd(this.getOutput().getItemOutputs()) && checkCorrectAccembly(); } private boolean checkCorrectAccembly() @@ -144,7 +130,7 @@ public class RollingMachinePart1TileEntity extends BasicElectricMotorTileEntity{ public static void addRecipe(ItemStack input, ItemStack output) { - recipeManager.addRecipe(new UniversalRecipeInput(null, Arrays.asList(new ItemStack [] {input})), new UniversalRecipeOutput(null, Arrays.asList(new ItemStack[] {output}), 20)); + recipeManager.addRecipe(new UniversalRecipeInput(null, (new ItemStack [] {input})), new UniversalRecipeOutput(null, (new ItemStack[] {output}), 20)); } diff --git a/ihl/processing/metallurgy/RollingMachinePart2TileEntity.java b/ihl/processing/metallurgy/RollingMachinePart2TileEntity.java index 6bab8c4..13f4f6c 100644 --- a/ihl/processing/metallurgy/RollingMachinePart2TileEntity.java +++ b/ihl/processing/metallurgy/RollingMachinePart2TileEntity.java @@ -6,7 +6,6 @@ import java.util.List; import ic2.api.network.INetworkDataProvider; import ic2.api.tile.IWrenchable; import ic2.core.IC2; -import ic2.core.network.NetworkManager; import ihl.utils.IHLUtils; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; diff --git a/ihl/processing/metallurgy/RollingMachineRender.java b/ihl/processing/metallurgy/RollingMachineRender.java index ee8b567..1990769 100644 --- a/ihl/processing/metallurgy/RollingMachineRender.java +++ b/ihl/processing/metallurgy/RollingMachineRender.java @@ -72,11 +72,8 @@ private final float scale=1F/16F; model.RotatingPart1.render(scale); model.RotatingPart2.render(scale); } - if(cte.hasEngine) - { - model.MotorPart1.render(scale); - model.MotorPart2.render(scale); - } + model.MotorPart1.render(scale); + model.MotorPart2.render(scale); } GL11.glPopMatrix(); //end diff --git a/ihl/processing/metallurgy/VacuumInductionMeltingFurnaceGui.java b/ihl/processing/metallurgy/VacuumInductionMeltingFurnaceGui.java index 8b9ea9e..2f22a4d 100644 --- a/ihl/processing/metallurgy/VacuumInductionMeltingFurnaceGui.java +++ b/ihl/processing/metallurgy/VacuumInductionMeltingFurnaceGui.java @@ -1,7 +1,6 @@ package ihl.processing.metallurgy; import ic2.core.IC2; -import ic2.core.network.NetworkManager; import ihl.collector.GuiMultiTextureButton; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.inventory.GuiContainer; @@ -22,6 +21,7 @@ public class VacuumInductionMeltingFurnaceGui extends GuiContainer { this.container=vacuumInductionMeltingFurnaceContainer; } + @SuppressWarnings("unchecked") @Override public void initGui() { @@ -46,8 +46,6 @@ public class VacuumInductionMeltingFurnaceGui extends GuiContainer { @Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { - int xOffset = (this.width - xSize) / 2; - int yOffset = (this.height - ySize) / 2; GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); fontRendererObj.drawString(StatCollector.translateToLocal("ihl.gui.muffleFurnace"), 40, 12, 14722081); this.mc.renderEngine.bindTexture(background); diff --git a/ihl/processing/metallurgy/VacuumInductionMeltingFurnaceTileEntity.java b/ihl/processing/metallurgy/VacuumInductionMeltingFurnaceTileEntity.java index 3fc85a8..e2867bc 100644 --- a/ihl/processing/metallurgy/VacuumInductionMeltingFurnaceTileEntity.java +++ b/ihl/processing/metallurgy/VacuumInductionMeltingFurnaceTileEntity.java @@ -4,14 +4,13 @@ import java.util.Arrays; import java.util.Map; import ic2.api.network.INetworkClientTileEntityEventListener; +import ic2.api.recipe.IRecipeInput; +import ic2.api.recipe.RecipeInputOreDict; import ic2.core.ContainerBase; -import ihl.IHLMod; import ihl.processing.chemistry.GaedesMercuryRotaryPumpTileEntity; import ihl.recipes.UniversalRecipeInput; import ihl.recipes.UniversalRecipeManager; import ihl.recipes.UniversalRecipeOutput; -import ihl.tunneling_shield.IMultiBlock; -import ihl.tunneling_shield.MultiBlockSpacerBlock; import ihl.utils.IHLFluidTank; import ihl.utils.IHLUtils; import net.minecraft.client.gui.GuiScreen; @@ -24,13 +23,12 @@ import net.minecraftforge.fluids.FluidStack; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -public class VacuumInductionMeltingFurnaceTileEntity extends MachineBaseTileEntity implements INetworkClientTileEntityEventListener, IMultiBlock{ +public class VacuumInductionMeltingFurnaceTileEntity extends MachineBaseTileEntity implements INetworkClientTileEntityEventListener{ protected static UniversalRecipeManager recipeManager = new UniversalRecipeManager("vacuuminductionmeltingfurnace"); public final IHLFluidTank fluidTank = new IHLFluidTank(864); public boolean vacuumPumpConnected=false; private GaedesMercuryRotaryPumpTileEntity lastGMRP; - private int minX,minY,minZ,maxX,maxY,maxZ; public VacuumInductionMeltingFurnaceTileEntity() { @@ -42,27 +40,6 @@ public class VacuumInductionMeltingFurnaceTileEntity extends MachineBaseTileEnti { short facing2 = (short) Math.max(facing1, 2); super.setFacing(facing2); - switch(facing2) - { - case 0: - setupMultiblockStructure(-1,-2,0); - break; - case 1: - setupMultiblockStructure(-1,0,0); - break; - case 2: - setupMultiblockStructure(-1,0,-2); - break; - case 3: - setupMultiblockStructure(-1,0,0); - break; - case 4: - setupMultiblockStructure(-2,0,-1); - break; - case 5: - setupMultiblockStructure(0,0,-1); - break; - } } @Override @@ -159,9 +136,9 @@ public class VacuumInductionMeltingFurnaceTileEntity extends MachineBaseTileEnti return IHLUtils.getThisModItemStack("vacuumInductionMeltingFurnace"); } - public static void addRecipe(ItemStack input, FluidStack output) + public static void addRecipe(String input, int amount, String input2, int amount2, FluidStack output) { - recipeManager.addRecipe(new UniversalRecipeInput(null, Arrays.asList(new ItemStack [] {input})),new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {output}),null,20)); + recipeManager.addRecipe(new UniversalRecipeInput(null, (new IRecipeInput [] {new RecipeInputOreDict(input,amount),new RecipeInputOreDict(input2,amount2)})),new UniversalRecipeOutput((new FluidStack[] {output}),null,20)); } @@ -220,41 +197,4 @@ public class VacuumInductionMeltingFurnaceTileEntity extends MachineBaseTileEnti this.fluidTank.writeToNBT(fluidTankTag); nbttagcompound.setTag("fluidTank", fluidTankTag); } - - private void setupMultiblockStructure(int x0,int y0,int z0) - { - minX=xCoord+x0; - maxX=xCoord+x0+3; - minY=yCoord+y0; - maxY=yCoord+y0+3; - minZ=zCoord+z0; - maxZ=zCoord+z0+3; - for(int ix=xCoord+x0;ix=minX && x<=maxX && y>=minY && y<=maxY && z>=minZ && z<=maxZ; - } - - @Override - public boolean getIsInvalid() - { - return this.isInvalid(); - } - } diff --git a/ihl/processing/metallurgy/VulcanizationExtrudingMoldTileEntity.java b/ihl/processing/metallurgy/VulcanizationExtrudingMoldTileEntity.java index 6feca57..40d44e4 100644 --- a/ihl/processing/metallurgy/VulcanizationExtrudingMoldTileEntity.java +++ b/ihl/processing/metallurgy/VulcanizationExtrudingMoldTileEntity.java @@ -11,7 +11,6 @@ import ic2.api.energy.tile.IEnergySink; import ic2.api.network.INetworkDataProvider; import ic2.api.tile.IWrenchable; import ic2.core.IC2; -import ic2.core.network.NetworkManager; import ihl.items_blocks.FlexibleCableItem; import ihl.recipes.UniversalRecipeInput; import ihl.recipes.UniversalRecipeManager; @@ -47,7 +46,7 @@ public class VulcanizationExtrudingMoldTileEntity extends TileEntity implements public static void addRecipe(FluidStack inputFluid,ItemStack input,ItemStack output1) { - recipeManager.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {inputFluid}),Arrays.asList(new ItemStack[] {input})),new UniversalRecipeOutput(null,Arrays.asList(new ItemStack[] {output1}),200)); + recipeManager.addRecipe(new UniversalRecipeInput((new FluidStack[] {inputFluid}),(new ItemStack[] {input})),new UniversalRecipeOutput(null,(new ItemStack[] {output1}),200)); } public boolean enableUpdateEntity() diff --git a/ihl/processing/metallurgy/WireMillContainer.java b/ihl/processing/metallurgy/WireMillContainer.java index ec1ddc0..34f79de 100644 --- a/ihl/processing/metallurgy/WireMillContainer.java +++ b/ihl/processing/metallurgy/WireMillContainer.java @@ -10,7 +10,7 @@ import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; import net.minecraftforge.fluids.FluidStack; -public class WireMillContainer extends ContainerBase { +public class WireMillContainer extends ContainerBase { public WireMillTileEntity tileEntity; public int lastProgress = -1; @@ -51,7 +51,7 @@ public class WireMillContainer extends ContainerBase { this.addSlotToContainer(new SlotInvSlot(tileEntity.drainInputSlot, 0, 26+18, 14)); this.addSlotToContainer(new SlotInvSlot(tileEntity.fillInputSlot, 0, 26+18, 50)); this.addSlotToContainer(new SlotInvSlot(tileEntity.emptyFluidItemsSlot, 0, 26+18, 32)); - this.addSlotToContainer(new SlotInvSlot(tileEntity.engine,0, 8, 14)); + this.addSlotToContainer(new SlotInvSlot(tileEntity.dischargeSlot,0, 8, 14)); } @Override diff --git a/ihl/processing/metallurgy/WireMillGui.java b/ihl/processing/metallurgy/WireMillGui.java index e09b4ab..8a3d583 100644 --- a/ihl/processing/metallurgy/WireMillGui.java +++ b/ihl/processing/metallurgy/WireMillGui.java @@ -52,10 +52,6 @@ public class WireMillGui extends GuiContainer { } this.mc.renderEngine.bindTexture(tex); - if(!this.container.tileEntity.engine.correctContent()) - { - IHLRenderUtils.instance.drawMissingEngineTooltip(this, par1, par2, 25, 14, xOffset, yOffset); - } IHLRenderUtils.instance.drawTooltip(par1,par2,9,11,xOffset,yOffset,StatCollector.translateToLocal("ihl.wiremill.tip")); } diff --git a/ihl/processing/metallurgy/WireMillTileEntity.java b/ihl/processing/metallurgy/WireMillTileEntity.java index 16eaa4b..4216960 100644 --- a/ihl/processing/metallurgy/WireMillTileEntity.java +++ b/ihl/processing/metallurgy/WireMillTileEntity.java @@ -4,17 +4,13 @@ import java.util.Arrays; import java.util.List; import java.util.Map; -import org.apache.commons.lang3.mutable.MutableObject; - import ic2.api.recipe.IRecipeInput; import ic2.api.recipe.RecipeInputOreDict; import ic2.core.ContainerBase; import ic2.core.block.invslot.InvSlot; -import ic2.core.block.invslot.InvSlotConsumableItemStack; import ic2.core.block.invslot.InvSlotConsumableLiquid; import ic2.core.block.invslot.InvSlotOutput; import ic2.core.block.invslot.InvSlot.Access; -import ic2.core.block.invslot.InvSlot.InvSide; import ihl.IHLMod; import ihl.items_blocks.IHLTool; import ihl.processing.chemistry.ApparatusProcessableInvSlot; @@ -23,7 +19,6 @@ import ihl.recipes.IRecipeInputFluid; import ihl.recipes.RecipeInputDie; import ihl.recipes.RecipeInputFluidDictionary; import ihl.recipes.RecipeInputFluidStack; -import ihl.recipes.RecipeOutputItemStack; import ihl.recipes.UniversalRecipeInput; import ihl.recipes.UniversalRecipeManager; import ihl.recipes.UniversalRecipeOutput; @@ -36,7 +31,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidTankInfo; import net.minecraftforge.fluids.IFluidHandler; @@ -62,7 +56,6 @@ public class WireMillTileEntity extends BasicElectricMotorTileEntity implements fillInputSlot = new InvSlotConsumableLiquidIHL(this, "fillInput", -1, InvSlot.Access.I, 1, InvSlot.InvSide.BOTTOM, InvSlotConsumableLiquid.OpType.Fill); drainInputSlot = new InvSlotConsumableLiquidIHL(this, "drainInput", -1, InvSlot.Access.I, 1, InvSlot.InvSide.BOTTOM, InvSlotConsumableLiquid.OpType.Drain, "ingot"); dice = new ApparatusProcessableInvSlot(this, "dice", 3, Access.IO, 1, 64); - this.isGuiScreenOpened=true; this.operationLength=600; } @@ -142,7 +135,6 @@ public class WireMillTileEntity extends BasicElectricMotorTileEntity implements { this.metalFluidTank.fill(rOutput.getFluidOutputs().get(0), true); } - ForgeDirection dir = ForgeDirection.getOrientation(getFacing()).getRotation(ForgeDirection.DOWN); TileEntity te = worldObj.getTileEntity(xCoord+ForgeDirection.getOrientation(getFacing()).offsetX,yCoord+ForgeDirection.getOrientation(getFacing()).offsetY,zCoord+ForgeDirection.getOrientation(getFacing()).offsetZ); if(rOutputItemStack!=null && te instanceof IProductionLine) { @@ -156,6 +148,7 @@ public class WireMillTileEntity extends BasicElectricMotorTileEntity implements } } + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public List[] getInput() { @@ -169,12 +162,12 @@ public class WireMillTileEntity extends BasicElectricMotorTileEntity implements public static void addRecipe(FluidStack moltenMetal, IRecipeInput inputDice,ItemStack output1) { - recipeManager.addRecipe(new UniversalRecipeInput(Arrays.asList(new IRecipeInputFluid[] {new RecipeInputFluidDictionary("lubricant", 1),new RecipeInputFluidDictionary("water", 1),new RecipeInputFluidStack(moltenMetal)}),Arrays.asList(new IRecipeInput[] {inputDice})),new UniversalRecipeOutput(null,Arrays.asList(new ItemStack[] {output1}),200)); + recipeManager.addRecipe(new UniversalRecipeInput((new IRecipeInputFluid[] {new RecipeInputFluidDictionary("lubricant", 1),new RecipeInputFluidDictionary("water", 1),new RecipeInputFluidStack(moltenMetal)}),(new IRecipeInput[] {inputDice})),new UniversalRecipeOutput(null,(new ItemStack[] {output1}),200)); } public static void addRecipe(String string, FluidStack fluidStack) { - recipeManager.addRecipe(new UniversalRecipeInput(null, Arrays.asList(new IRecipeInput [] {new RecipeInputOreDict(string)})),new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {fluidStack}),null,200)); + recipeManager.addRecipe(new UniversalRecipeInput(null, (new IRecipeInput [] {new RecipeInputOreDict(string)})),new UniversalRecipeOutput((new FluidStack[] {fluidStack}),null,200)); } diff --git a/ihl/processing/metallurgy/WoodenRollingMachineContainer.java b/ihl/processing/metallurgy/WoodenRollingMachineContainer.java index 100da1b..ba191f8 100644 --- a/ihl/processing/metallurgy/WoodenRollingMachineContainer.java +++ b/ihl/processing/metallurgy/WoodenRollingMachineContainer.java @@ -6,7 +6,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; -public class WoodenRollingMachineContainer extends ContainerBase { +public class WoodenRollingMachineContainer extends ContainerBase { public WoodenRollingMachinePart1TileEntity tileEntity; public int lastProgress = -1; @@ -35,7 +35,7 @@ public class WoodenRollingMachineContainer extends ContainerBase { this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.input, 0, 123, 15)); this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.input, 1, 123, 34)); this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.input, 2, 123, 53)); - this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.engine,0, 22, 55)); + this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.dischargeSlot,0, 22, 55)); } @Override diff --git a/ihl/processing/metallurgy/WoodenRollingMachineGui.java b/ihl/processing/metallurgy/WoodenRollingMachineGui.java index d7b3456..085dae5 100644 --- a/ihl/processing/metallurgy/WoodenRollingMachineGui.java +++ b/ihl/processing/metallurgy/WoodenRollingMachineGui.java @@ -2,7 +2,6 @@ package ihl.processing.metallurgy; import org.lwjgl.opengl.GL11; -import ihl.utils.IHLRenderUtils; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.util.ResourceLocation; @@ -19,9 +18,6 @@ public class WoodenRollingMachineGui extends GuiContainer { @Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { - int xOffset = (this.width - xSize) / 2; - int yOffset = (this.height - ySize) / 2; - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); this.mc.renderEngine.bindTexture(tex); int i1; @@ -39,11 +35,6 @@ public class WoodenRollingMachineGui extends GuiContainer { i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(27),27); this.drawTexturedModalRect(18, 22, getFrameX(i1), getFrameY(i1),24,24); } - if(!this.container.tileEntity.engine.correctContent()) - { - this.mc.renderEngine.bindTexture(tex); - IHLRenderUtils.instance.drawMissingEngineTooltip(this, par1, par2, 47, 56, xOffset, yOffset); - } } @Override diff --git a/ihl/processing/metallurgy/WoodenRollingMachinePart1TileEntity.java b/ihl/processing/metallurgy/WoodenRollingMachinePart1TileEntity.java index eb40389..31b6386 100644 --- a/ihl/processing/metallurgy/WoodenRollingMachinePart1TileEntity.java +++ b/ihl/processing/metallurgy/WoodenRollingMachinePart1TileEntity.java @@ -1,6 +1,5 @@ package ihl.processing.metallurgy; -import java.util.Arrays; import java.util.List; import java.util.Map; @@ -8,7 +7,6 @@ import ic2.api.recipe.IRecipeInput; import ic2.core.ContainerBase; import ic2.core.IC2; import ic2.core.block.invslot.InvSlot.Access; -import ic2.core.network.NetworkManager; import ihl.processing.chemistry.ApparatusProcessableInvSlot; import ihl.processing.invslots.IHLInvSlotOutput; import ihl.recipes.RecipeOutputItemStack; @@ -28,7 +26,6 @@ public class WoodenRollingMachinePart1TileEntity extends BasicElectricMotorTileE public final ApparatusProcessableInvSlot input; public final IHLInvSlotOutput output; - public boolean hasEngine; public boolean assembled; protected static final UniversalRecipeManager recipeManager = new UniversalRecipeManager("woodenrollingmachine"); @@ -37,7 +34,6 @@ public class WoodenRollingMachinePart1TileEntity extends BasicElectricMotorTileE super(); input = new ApparatusProcessableInvSlot(this, "input", 1, Access.IO, 3, 64); output = new IHLInvSlotOutput(this, "output", 2, 1); - isGuiScreenOpened=true; } public UniversalRecipeOutput getOutput() @@ -50,7 +46,6 @@ public class WoodenRollingMachinePart1TileEntity extends BasicElectricMotorTileE { List fields = super.getNetworkedFields(); fields.add("assembled"); - fields.add("hasEngine"); return fields; } @@ -74,17 +69,6 @@ public class WoodenRollingMachinePart1TileEntity extends BasicElectricMotorTileE assembled=true; IC2.network.get().updateTileEntityField(this, "assembled"); } - if(this.engine.isEmpty() && hasEngine==true) - { - this.hasEngine=false; - IC2.network.get().updateTileEntityField(this, "hasEngine"); - } - else if(this.engine.correctContent() && hasEngine==false) - { - this.hasEngine=true; - IC2.network.get().updateTileEntityField(this, "hasEngine"); - } - if (this.getActive() && this.progress == 0 && !this.canOperate()) { this.setActive(false); @@ -126,6 +110,7 @@ public class WoodenRollingMachinePart1TileEntity extends BasicElectricMotorTileE } } + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public List[] getInput() { @@ -135,7 +120,7 @@ public class WoodenRollingMachinePart1TileEntity extends BasicElectricMotorTileE @Override public boolean canOperate() { - return this.engine.correctContent() && this.getOutput()!=null && this.output.canAdd(this.getOutput().getItemOutputs()) && checkCorrectAccembly(); + return this.getOutput()!=null && this.output.canAdd(this.getOutput().getItemOutputs()) && checkCorrectAccembly(); } private boolean checkCorrectAccembly() @@ -149,7 +134,7 @@ public class WoodenRollingMachinePart1TileEntity extends BasicElectricMotorTileE public static void addRecipe(ItemStack input, ItemStack input2, ItemStack input3, ItemStack output) { - recipeManager.addRecipe(new UniversalRecipeInput(null, Arrays.asList(new ItemStack[] {input,input2,input3})), new UniversalRecipeOutput(null,Arrays.asList(new ItemStack[] {output}),20)); + recipeManager.addRecipe(new UniversalRecipeInput(null, (new ItemStack[] {input,input2,input3})), new UniversalRecipeOutput(null,(new ItemStack[] {output}),20)); } @@ -159,7 +144,7 @@ public class WoodenRollingMachinePart1TileEntity extends BasicElectricMotorTileE public static void addRecipe(ItemStack input, ItemStack input3, ItemStack output) { - recipeManager.addRecipe(new UniversalRecipeInput(null, Arrays.asList(new ItemStack[] {input,input3})), new UniversalRecipeOutput(null,Arrays.asList(new ItemStack[] {output}),20)); + recipeManager.addRecipe(new UniversalRecipeInput(null, (new ItemStack[] {input,input3})), new UniversalRecipeOutput(null,(new ItemStack[] {output}),20)); } @Override diff --git a/ihl/processing/metallurgy/WoodenRollingMachinePart2TileEntity.java b/ihl/processing/metallurgy/WoodenRollingMachinePart2TileEntity.java index 165d84b..9aec41b 100644 --- a/ihl/processing/metallurgy/WoodenRollingMachinePart2TileEntity.java +++ b/ihl/processing/metallurgy/WoodenRollingMachinePart2TileEntity.java @@ -6,7 +6,6 @@ import java.util.List; import ic2.api.network.INetworkDataProvider; import ic2.api.tile.IWrenchable; import ic2.core.IC2; -import ic2.core.network.NetworkManager; import ihl.utils.IHLUtils; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; diff --git a/ihl/processing/metallurgy/WoodenRollingMachineRender.java b/ihl/processing/metallurgy/WoodenRollingMachineRender.java index 84fbcd6..f5fd12a 100644 --- a/ihl/processing/metallurgy/WoodenRollingMachineRender.java +++ b/ihl/processing/metallurgy/WoodenRollingMachineRender.java @@ -80,13 +80,10 @@ private final float scale=1F/16F; model.RotatingPart3.render(scale); model.RotatingPart4.render(scale); } - if(cte.hasEngine) - { - model.MotorPart1.render(scale); - model.MotorPart2.render(scale); - model.Belt1.render(scale); - model.Belt2.render(scale); - } + model.MotorPart1.render(scale); + model.MotorPart2.render(scale); + model.Belt1.render(scale); + model.Belt2.render(scale); } GL11.glPopMatrix(); //end diff --git a/ihl/recipes/IRecipeInputFluid.java b/ihl/recipes/IRecipeInputFluid.java index 8faf15d..823c0ae 100644 --- a/ihl/recipes/IRecipeInputFluid.java +++ b/ihl/recipes/IRecipeInputFluid.java @@ -1,8 +1,6 @@ package ihl.recipes; import java.util.List; - -import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; public interface IRecipeInputFluid { diff --git a/ihl/recipes/IronWorkbenchRecipe.java b/ihl/recipes/IronWorkbenchRecipe.java index 8ecb8df..f0bd81f 100644 --- a/ihl/recipes/IronWorkbenchRecipe.java +++ b/ihl/recipes/IronWorkbenchRecipe.java @@ -16,11 +16,11 @@ public class IronWorkbenchRecipe { public List materials=new ArrayList(); public List outputs = new ArrayList(); - public IronWorkbenchRecipe(List tools1, List materials1, List output1_1) + public IronWorkbenchRecipe(List tools1, List materials1, List output1_1) { if(tools1!=null) { - Iterator iTools1 = tools1.iterator(); + Iterator iTools1 = tools1.iterator(); while(iTools1.hasNext()) { Object tool = iTools1.next(); @@ -37,13 +37,13 @@ public class IronWorkbenchRecipe { tools.add(new RecipeInputItemStack(stack)); } } - else + else { tools.add((IRecipeInput) tool); } } } - Iterator iMaterials1 = materials1.iterator(); + Iterator iMaterials1 = materials1.iterator(); while(iMaterials1.hasNext()) { Object material = iMaterials1.next(); @@ -77,9 +77,33 @@ public class IronWorkbenchRecipe { } } - public IronWorkbenchRecipe(List asList, List asList2, List asList3, List workspaceElements1) { + public IronWorkbenchRecipe(List asList, List asList2, List asList3, List workspaceElements1) { this(asList, asList2, asList3); + if(workspaceElements1!=null) + { this.workspaceElements.addAll(workspaceElements1); + } + } + + public boolean isTool(ItemStack tool1) + { + if(tools!=null && !tools.isEmpty()) + { + if(tool1==null) + { + return false; + } + Iterator i1 = tools.iterator(); + while(i1.hasNext()) + { + IRecipeInput tool = i1.next(); + if(tool.matches(tool1)) + { + return true; + } + } + } + return false; } public boolean isCanBeCrafted(List tools1, List materials1, List workspaceElements1) diff --git a/ihl/recipes/RecipeInputDetonator.java b/ihl/recipes/RecipeInputDetonator.java new file mode 100644 index 0000000..efef075 --- /dev/null +++ b/ihl/recipes/RecipeInputDetonator.java @@ -0,0 +1,73 @@ +package ihl.recipes; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import ic2.api.recipe.IRecipeInput; +import ihl.utils.IHLUtils; +import net.minecraft.item.ItemStack; + +public class RecipeInputDetonator implements IRecipeInput +{ + public final ItemStack input; + public final int detonator_delay; + + public RecipeInputDetonator(String string, int detonator_delay) + { + this(IHLUtils.getItemStackWithTag(string, "detonator_delay", detonator_delay)); + } + + public RecipeInputDetonator(ItemStack itemStack) + { + input=itemStack; + detonator_delay=itemStack.stackTagCompound.getInteger("detonator_delay"); + } + + @Override + public boolean matches(ItemStack subject) + { + return subject.getItem() == this.input.getItem() && (subject.getItemDamage() == this.input.getItemDamage() || this.input.getItemDamage() == 32767); + } + + @Override + public int getAmount() + { + return 1; + } + + @Override + public List getInputs() + { + return Arrays.asList(new ItemStack[] {this.input}); + } + + @Override + public String toString() + { + ItemStack stack = this.input.copy(); + return "RInputDice<" + stack + ">"; + } + + public List transformOutput(ItemStack matchedItemStack, List outputs) + { + List newOutputs = new ArrayList(); + int misTS = matchedItemStack.stackTagCompound.getInteger("detonator_delay"); + ItemStack material; + for(ItemStack material1:outputs) + { + if(IHLUtils.getFirstOreDictName(material1) == "blockExplosive") + { + material=material1.copy(); + material.stackTagCompound.setInteger("detonator_delay", misTS); + newOutputs.add(material); + } + else + { + newOutputs.add(material1); + } + } + return newOutputs; + } +} + diff --git a/ihl/recipes/RecipeInputDie.java b/ihl/recipes/RecipeInputDie.java index c8356ca..8fbd4db 100644 --- a/ihl/recipes/RecipeInputDie.java +++ b/ihl/recipes/RecipeInputDie.java @@ -6,7 +6,6 @@ import java.util.List; import ic2.api.recipe.IRecipeInput; import ihl.interfaces.IWire; -import ihl.items_blocks.FlexibleCableItem; import ihl.utils.IHLUtils; import net.minecraft.item.ItemStack; @@ -53,7 +52,7 @@ public class RecipeInputDie implements IRecipeInput public List transformOutput(ItemStack matchedItemStack, List outputs) { - List newOutputs = new ArrayList(); + List newOutputs = new ArrayList(); int misTS = matchedItemStack.stackTagCompound.getInteger("transverseSection"); ItemStack material; for(ItemStack material1:outputs) @@ -75,7 +74,7 @@ public class RecipeInputDie implements IRecipeInput } return newOutputs; } - + public int transformOutput(ItemStack matchedItemStack, ItemStack material) { int consumeAmountMultiplier=1; diff --git a/ihl/recipes/RecipeInputFluidDictionary.java b/ihl/recipes/RecipeInputFluidDictionary.java index 46c51eb..e1581c3 100644 --- a/ihl/recipes/RecipeInputFluidDictionary.java +++ b/ihl/recipes/RecipeInputFluidDictionary.java @@ -1,12 +1,8 @@ package ihl.recipes; -import java.util.Arrays; import java.util.List; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; -import ic2.api.recipe.IRecipeInput; import ihl.IHLMod; public class RecipeInputFluidDictionary implements IRecipeInputFluid @@ -39,5 +35,12 @@ public class RecipeInputFluidDictionary implements IRecipeInputFluid public List getInputs() { return IHLMod.fluidDictionary.getFluids(input); } + + @Override + public String toString() + { + return "RInputFluidStackDictionary<" + this.amount + "x" + this.input; + } + } diff --git a/ihl/recipes/RecipeInputFluidStack.java b/ihl/recipes/RecipeInputFluidStack.java index a7b5d0e..e4c116d 100644 --- a/ihl/recipes/RecipeInputFluidStack.java +++ b/ihl/recipes/RecipeInputFluidStack.java @@ -3,10 +3,8 @@ package ihl.recipes; import java.util.Arrays; import java.util.List; -import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; -import ic2.api.recipe.IRecipeInput; public class RecipeInputFluidStack implements IRecipeInputFluid { @@ -37,5 +35,11 @@ public class RecipeInputFluidStack implements IRecipeInputFluid public List getInputs() { return Arrays.asList(new FluidStack[] {new FluidStack(fluid,amount)}); } + + @Override + public String toString() + { + return "RInputFluidStack<" + this.amount + "x" + this.fluid.getName(); + } } diff --git a/ihl/recipes/RecipeInputObjectInstance.java b/ihl/recipes/RecipeInputObjectInstance.java index eeadc5c..8648e72 100644 --- a/ihl/recipes/RecipeInputObjectInstance.java +++ b/ihl/recipes/RecipeInputObjectInstance.java @@ -5,8 +5,6 @@ import java.util.List; import net.minecraft.item.ItemStack; import ic2.api.recipe.IRecipeInput; -import ihl.interfaces.IWire; -import ihl.items_blocks.FlexibleCableItem; import ihl.utils.IHLUtils; public class RecipeInputObjectInstance implements IRecipeInput diff --git a/ihl/recipes/RecipeInputOreDictionaryList.java b/ihl/recipes/RecipeInputOreDictionaryList.java index 3c4b551..572f15b 100644 --- a/ihl/recipes/RecipeInputOreDictionaryList.java +++ b/ihl/recipes/RecipeInputOreDictionaryList.java @@ -35,14 +35,14 @@ public class RecipeInputOreDictionaryList implements IRecipeInput this.meta = meta; } - @Override + @Override public boolean matches(ItemStack subject) { - List inputs = this.getOres(); + List inputs = this.getOres(); boolean useOreStackMeta = this.meta == null; Item subjectItem = subject.getItem(); int subjectMeta = subject.getItemDamage(); - Iterator i$ = inputs.iterator(); + Iterator i$ = inputs.iterator(); Item oreItem; int metaRequired; @@ -59,7 +59,7 @@ public class RecipeInputOreDictionaryList implements IRecipeInput return false; } - oreStack = (ItemStack)i$.next(); + oreStack = i$.next(); oreItem = oreStack.getItem(); } while (oreItem == null); @@ -82,13 +82,13 @@ public class RecipeInputOreDictionaryList implements IRecipeInput @Override public List getInputs() { - List ores = this.getOres(); + List ores = this.getOres(); boolean hasInvalidEntries = false; - Iterator ret = ores.iterator(); + Iterator ret = ores.iterator(); while (ret.hasNext()) { - ItemStack i$ = (ItemStack)ret.next(); + ItemStack i$ = ret.next(); if (i$.getItem() == null) { @@ -103,12 +103,12 @@ public class RecipeInputOreDictionaryList implements IRecipeInput } else { - ArrayList ret1 = new ArrayList(ores.size()); - Iterator i$1 = ores.iterator(); + ArrayList ret1 = new ArrayList(ores.size()); + Iterator i$1 = ores.iterator(); while (i$1.hasNext()) { - ItemStack stack = (ItemStack)i$1.next(); + ItemStack stack = i$1.next(); if (stack.getItem() != null) { @@ -134,10 +134,10 @@ public class RecipeInputOreDictionaryList implements IRecipeInput } else { - this.ores = new ArrayList(); + this.ores = new ArrayList(); for(int i=0;i ret = OreDictionary.getOres(this.input[i]); if (ret != OreDictionary.EMPTY_LIST) { this.ores.addAll(ret); diff --git a/ihl/recipes/UniversalRecipeInput.java b/ihl/recipes/UniversalRecipeInput.java index f0b42e2..1d2b06c 100644 --- a/ihl/recipes/UniversalRecipeInput.java +++ b/ihl/recipes/UniversalRecipeInput.java @@ -15,29 +15,16 @@ import net.minecraftforge.fluids.FluidStack; public class UniversalRecipeInput{ - private final List fluidInputs=new ArrayList(); - private final List itemInputs=new ArrayList(); - private boolean sharp=true; - private int temperatureMin = 273; - private int temperatureMax = Integer.MAX_VALUE; - private float speedFactor=-1.0f;//=-Ea/R (k=k0*exp(-Ea/(RT))) + private final List fluidInputs=new ArrayList(); + private final List itemInputs=new ArrayList(); private int multiplier=Integer.MAX_VALUE; - - public UniversalRecipeInput(List fluidInputs1, List itemInputs1, boolean sharp1) - { - this(fluidInputs1, itemInputs1); - this.sharp=false; - } - - public UniversalRecipeInput(List fluidInputs1, List itemInputs1) + public UniversalRecipeInput(Object[] fluidStacks, Object[] iRecipeInputs) { - if(fluidInputs1!=null) + if(fluidStacks!=null) { - Iterator ifluidInputs1 = fluidInputs1.iterator(); - while(ifluidInputs1.hasNext()) + for(Object material:fluidStacks) { - Object material = ifluidInputs1.next(); if(material==null) { throw new NullPointerException("Recipe input cannot be null!"); @@ -52,12 +39,10 @@ public class UniversalRecipeInput{ } } } - if(itemInputs1!=null) + if(iRecipeInputs!=null) { - Iterator iitemInputs1 = itemInputs1.iterator(); - while(iitemInputs1.hasNext()) + for(Object material:iRecipeInputs) { - Object material = iitemInputs1.next(); if(material==null) { throw new NullPointerException("Recipe input cannot be null!"); @@ -103,13 +88,13 @@ public class UniversalRecipeInput{ public boolean matches(UniversalRecipeInput input) { List rInputs = input.getItemInputs(); Iterator ii = rInputs.iterator(); - List rInputsItems = new ArrayList(); + List rInputsItems = new ArrayList(); while(ii.hasNext()) { IRecipeInput is = ii.next(); rInputsItems.add(is.getInputs().get(0)); } - List rInputsFluids = new ArrayList(); + List rInputsFluids = new ArrayList(); List rInputsF = input.getFluidInputs(); Iterator iiF = rInputsF.iterator(); while(iiF.hasNext()) @@ -226,13 +211,13 @@ public class UniversalRecipeInput{ public boolean adjustAmounts(UniversalRecipeInput input, boolean doAdjustAmounts) { List rInputs = input.getItemInputs(); Iterator ii = rInputs.iterator(); - List rInputsItems = new ArrayList(); + List rInputsItems = new ArrayList(); while(ii.hasNext()) { IRecipeInput is = ii.next(); rInputsItems.add(is.getInputs().get(0)); } - List rInputsFluids = new ArrayList(); + List rInputsFluids = new ArrayList(); List rInputsF = input.getFluidInputs(); Iterator iiF = rInputsF.iterator(); while(iiF.hasNext()) diff --git a/ihl/recipes/UniversalRecipeManager.java b/ihl/recipes/UniversalRecipeManager.java index 443a67f..99f43bc 100644 --- a/ihl/recipes/UniversalRecipeManager.java +++ b/ihl/recipes/UniversalRecipeManager.java @@ -6,9 +6,9 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; +import ic2.api.recipe.IRecipeInput; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; -import ic2.api.recipe.IRecipeInput; import ihl.utils.IHLUtils; public class UniversalRecipeManager { @@ -25,7 +25,8 @@ public class UniversalRecipeManager { machineRecipeManagers.put(machine1, this); } - private final Map recipes = new HashMap(); + private final Map recipes = new HashMap(); + private final Map keywordMap = new HashMap(); public void addRecipe(UniversalRecipeInput input, UniversalRecipeOutput output) { @@ -41,31 +42,53 @@ public class UniversalRecipeManager { } } - Iterator var8 = this.recipes.keySet().iterator(); + Iterator var8 = this.recipes.keySet().iterator(); while (var8.hasNext()) { UniversalRecipeInput existingInput = (UniversalRecipeInput)var8.next(); if (existingInput.matches(input)) { - Iterator ilist1 = existingInput.getItemInputs().iterator(); - Iterator ilist2 = input.getItemInputs().iterator(); - while(ilist1.hasNext()) + StringBuffer ssError =new StringBuffer(255); + ssError.append("Ambiguous recipe. \n"); + ssError.append("Existing input: \n"); + Iterator iii1 = existingInput.getItemInputs().iterator(); + Iterator fii1 = existingInput.getFluidInputs().iterator(); + while(iii1!=null && iii1.hasNext()) + { + ssError.append(iii1.next().toString()); + ssError.append(" \n"); + } + while(fii1!=null && fii1.hasNext()) { - IRecipeInput is = ilist1.next(); + ssError.append(fii1.next().toString()); + ssError.append(" \n"); } - System.out.println("recipe 2:"); - while(ilist2.hasNext()) + ssError.append("New input: \n"); + Iterator iii2 = input.getItemInputs().iterator(); + Iterator fii2 = input.getFluidInputs().iterator(); + while(iii2!=null && iii2.hasNext()) { - IRecipeInput is = ilist2.next(); + ssError.append(iii2.next().toString()); + ssError.append(" \n"); } - throw new RuntimeException("Ambiguous recipe."); + while(fii2!=null && fii2.hasNext()) + { + ssError.append(fii2.next().toString()); + ssError.append(" \n"); + } + throw new RuntimeException(ssError.toString()); } } this.recipes.put(input, output); } + public void addRecipe(String keyword, UniversalRecipeInput input, UniversalRecipeOutput output) + { + this.addRecipe(input, output); + this.keywordMap.put(keyword, input); + } public UniversalRecipeOutput getOutputFor(List fluidInputs, List itemInputs, boolean adjustInput, boolean inputAffectOutput) { @@ -75,14 +98,14 @@ public class UniversalRecipeManager { } else { - Iterator i$ = this.recipes.entrySet().iterator(); + Iterator> i$ = this.recipes.entrySet().iterator(); while (true) { if (i$.hasNext()) { - Entry entry = (Entry)i$.next(); - UniversalRecipeInput recipeInput = (UniversalRecipeInput)entry.getKey(); + Entry entry = i$.next(); + UniversalRecipeInput recipeInput = entry.getKey(); if (!recipeInput.matches(fluidInputs, itemInputs)) { @@ -91,7 +114,7 @@ public class UniversalRecipeManager { if (recipeInput.adjustAmounts(fluidInputs, itemInputs,true, false)) { - UniversalRecipeOutput output = (UniversalRecipeOutput)entry.getValue(); + UniversalRecipeOutput output = entry.getValue(); if (adjustInput) { if(inputAffectOutput) @@ -121,14 +144,14 @@ public class UniversalRecipeManager { public UniversalRecipeInput getRecipeInput(List fluidInputs1, List itemInputs1) { { - Iterator i$ = this.recipes.entrySet().iterator(); + Iterator> i$ = this.recipes.entrySet().iterator(); while (true) { if (i$.hasNext()) { - Entry entry = (Entry)i$.next(); - UniversalRecipeInput recipeInput = (UniversalRecipeInput)entry.getKey(); + Entry entry = i$.next(); + UniversalRecipeInput recipeInput = entry.getKey(); if (!recipeInput.matches(fluidInputs1,itemInputs1)) { @@ -147,12 +170,14 @@ public class UniversalRecipeManager { } + @SuppressWarnings({ "unchecked", "rawtypes" }) public UniversalRecipeOutput getOutputFor(List[] input, boolean adjustInput, boolean inputAffectOutput) { return this.getOutputFor(input[0], input[1], adjustInput, inputAffectOutput); } + @SuppressWarnings({ "unchecked", "rawtypes" }) public UniversalRecipeInput getRecipeInput(List[] input) { return this.getRecipeInput(input[0], input[1]); @@ -161,36 +186,34 @@ public class UniversalRecipeManager { public void removeRecipeByInput(UniversalRecipeInput uRecipeInput) { - Entry entryToRemove = null; List fluidInputs = IHLUtils.convertRecipeInputToFluidStackList(uRecipeInput.getFluidInputs()); List itemInputs = IHLUtils.convertRecipeInputToItemStackList(uRecipeInput.getItemInputs()); { - Iterator i$ = this.recipes.entrySet().iterator(); + Iterator> i$ = this.recipes.entrySet().iterator(); while (i$.hasNext()) { - Entry entry = (Entry)i$.next(); - UniversalRecipeInput recipeInput = (UniversalRecipeInput)entry.getKey(); - if (recipeInput.matches(fluidInputs, itemInputs)) - { - i$.remove(); - break; - } + Entry entry = i$.next(); + UniversalRecipeInput recipeInput = entry.getKey(); + if (recipeInput.matches(fluidInputs, itemInputs)) + { + i$.remove(); + break; + } } } } public void removeRecipeByOutput(UniversalRecipeOutput uRecipeOutput) { - Entry entryToRemove = null; - Iterator i$ = this.recipes.entrySet().iterator(); + Iterator> i$ = this.recipes.entrySet().iterator(); while (i$.hasNext()) { - Entry entry = (Entry)i$.next(); - UniversalRecipeOutput recipeOutput = (UniversalRecipeOutput)entry.getValue(); - if (recipeOutputHasCommonEntries(recipeOutput,uRecipeOutput)) - { - i$.remove(); - } + Entry entry = i$.next(); + UniversalRecipeOutput recipeOutput = entry.getValue(); + if (recipeOutputHasCommonEntries(recipeOutput,uRecipeOutput)) + { + i$.remove(); + } } } diff --git a/ihl/recipes/UniversalRecipeOutput.java b/ihl/recipes/UniversalRecipeOutput.java index bda2bcf..17c20e4 100644 --- a/ihl/recipes/UniversalRecipeOutput.java +++ b/ihl/recipes/UniversalRecipeOutput.java @@ -9,24 +9,22 @@ import net.minecraftforge.fluids.FluidStack; public class UniversalRecipeOutput{ - private final List fluidOutputs=new ArrayList(); - private final List itemOutputs=new ArrayList(); + private final List fluidOutputs=new ArrayList(); + private final List itemOutputs=new ArrayList(); private final int time; public final boolean specialConditions; - public UniversalRecipeOutput(List fluidOutputs1, List itemOutputs1, int time1) + public UniversalRecipeOutput(FluidStack[] fluidOutputs1, Object[] itemOutputs1, int time1) { this(fluidOutputs1, itemOutputs1, time1,false); } - public UniversalRecipeOutput(List fluidOutputs1, List itemOutputs1, int time1, boolean specialConditions1) + public UniversalRecipeOutput(FluidStack[] fluidStacks, Object[] recipeOutputItemStacks, int time1, boolean specialConditions1) { - if(fluidOutputs1!=null) + if(fluidStacks!=null) { - Iterator ioi = fluidOutputs1.iterator(); - while(ioi.hasNext()) + for(FluidStack fStack:fluidStacks) { - FluidStack fStack = ioi.next(); if(fStack==null) { throw new NullPointerException("Recipe cannot contain null elements!"); @@ -34,12 +32,10 @@ public class UniversalRecipeOutput{ fluidOutputs.add(fStack); } } - if(itemOutputs1!=null) + if(recipeOutputItemStacks!=null) { - Iterator ioi = itemOutputs1.iterator(); - while(ioi.hasNext()) + for(Object io:recipeOutputItemStacks) { - Object io = ioi.next(); if(io==null) { throw new NullPointerException("Recipe output cannot be null!"); @@ -58,6 +54,14 @@ public class UniversalRecipeOutput{ time=time1; } + public UniversalRecipeOutput(List recipeOutputsFluids, + List recipeOutputsRecipeOut, int time1) { + this.fluidOutputs.addAll(recipeOutputsFluids); + this.itemOutputs.addAll(recipeOutputsRecipeOut); + this.time=time1; + this.specialConditions=false; + } + public boolean matches(List fluidOutputs1, List itemOutputs1) { if(fluidOutputs.size()!=fluidOutputs1.size()||itemOutputs.size()!=itemOutputs.size()) @@ -98,27 +102,27 @@ public class UniversalRecipeOutput{ } public UniversalRecipeOutput copyWithMultiplier(int mulipier) { - ArrayList fluidStacks = new ArrayList(); - ArrayList itemStacks = new ArrayList(); + FluidStack[] fluidStacks = null; + RecipeOutputItemStack[] itemStacks = null; if(fluidOutputs!=null && !fluidOutputs.isEmpty()) { - Iterator fi = fluidOutputs.iterator(); - while(fi.hasNext()) + fluidStacks = new FluidStack[fluidOutputs.size()]; + for(int i=0;i ii = itemOutputs.iterator(); - while(ii.hasNext()) + itemStacks = new RecipeOutputItemStack[itemOutputs.size()]; + for(int i=0;i var6 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D)); double var7 = 0.0D; int var9; float var11; @@ -165,8 +166,6 @@ public class LostHeadEntity extends EntityFlying implements IMob { if (var4.entityHit instanceof EntityLivingBase) { - EntityLivingBase var24 = (EntityLivingBase)var4.entityHit; - var26 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); if (var26 > 0.0F) { @@ -244,7 +243,6 @@ public class LostHeadEntity extends EntityFlying implements IMob if (this.targetedEntity != null && this.targetedEntity.getDistanceSqToEntity(this) < var9 * var9) { double var11 = this.targetedEntity.posX - this.posX; - double var13 = this.targetedEntity.boundingBox.minY + this.targetedEntity.height / 2.0F - (this.posY + this.height / 2.0F); double var15 = this.targetedEntity.posZ - this.posZ; this.renderYawOffset = this.rotationYaw = -((float)Math.atan2(var11, var15)) * 180.0F / (float)Math.PI; diff --git a/ihl/trans_dimensional_item_teleporter/TDITContainer.java b/ihl/trans_dimensional_item_teleporter/TDITContainer.java index 6afac87..35dd1a0 100644 --- a/ihl/trans_dimensional_item_teleporter/TDITContainer.java +++ b/ihl/trans_dimensional_item_teleporter/TDITContainer.java @@ -6,7 +6,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; -public class TDITContainer extends ContainerBase { +public class TDITContainer extends ContainerBase { protected TDITTileEntity tileEntity; public int lastStorage = -1; diff --git a/ihl/trans_dimensional_item_teleporter/TDITFrequencyTransmitter.java b/ihl/trans_dimensional_item_teleporter/TDITFrequencyTransmitter.java index 3ccf1dd..43701eb 100644 --- a/ihl/trans_dimensional_item_teleporter/TDITFrequencyTransmitter.java +++ b/ihl/trans_dimensional_item_teleporter/TDITFrequencyTransmitter.java @@ -124,7 +124,7 @@ public class TDITFrequencyTransmitter extends Item implements IItemHudInfo { @Override public List getHudInfo(ItemStack itemStack) { - LinkedList info = new LinkedList(); + LinkedList info = new LinkedList(); if(itemStack.stackTagCompound!=null) { NBTTagCompound nbtData = StackUtil.getOrCreateNbtData(itemStack); diff --git a/ihl/trans_dimensional_item_teleporter/TDITGui.java b/ihl/trans_dimensional_item_teleporter/TDITGui.java index 5d4dcfd..ab17b17 100644 --- a/ihl/trans_dimensional_item_teleporter/TDITGui.java +++ b/ihl/trans_dimensional_item_teleporter/TDITGui.java @@ -19,15 +19,7 @@ public class TDITGui extends GuiContainer { super(container1); this.container=container1; } - - @Override - public void initGui() - { - super.initGui(); - int x = (width - xSize) / 2; - int y = (height - ySize) / 2; - } - + @Override protected void drawGuiContainerForegroundLayer(int param1, int param2) { diff --git a/ihl/trans_dimensional_item_teleporter/TDITTileEntity.java b/ihl/trans_dimensional_item_teleporter/TDITTileEntity.java index df0cb6f..6c6f268 100644 --- a/ihl/trans_dimensional_item_teleporter/TDITTileEntity.java +++ b/ihl/trans_dimensional_item_teleporter/TDITTileEntity.java @@ -3,7 +3,6 @@ package ihl.trans_dimensional_item_teleporter; import java.util.ArrayList; import java.util.HashSet; import java.util.List; -import java.util.Random; import java.util.Set; import cpw.mods.fml.relauncher.Side; @@ -42,7 +41,6 @@ import ihl.utils.IHLInvSlotDischarge; public class TDITTileEntity extends TileEntityInventory implements IEnergySink, IHasGui, IUpgradableBlock { - private int startUpCounter=0; private int tier=4; private int defaultTier=4; public int maxStorage=12000; @@ -56,7 +54,6 @@ public class TDITTileEntity extends TileEntityInventory implements IEnergySink, public final InvSlot inputSlot; public int updateChecksum=-1; - private Random rand = new Random(); private AudioSource startAS; public boolean targetSet=false; @@ -427,7 +424,7 @@ public class TDITTileEntity extends TileEntityInventory implements IEnergySink, if(te!=null && te instanceof TDITTileEntity) { TDITTileEntity tdit = (TDITTileEntity) te; - List itemStackList = new ArrayList(); + List itemStackList = new ArrayList(); for(int i=0;i { protected DriverTileEntity tileEntity; public int lastStorage = -1; diff --git a/ihl/tunneling_shield/DriverGui.java b/ihl/tunneling_shield/DriverGui.java index c7c8664..446c9f1 100644 --- a/ihl/tunneling_shield/DriverGui.java +++ b/ihl/tunneling_shield/DriverGui.java @@ -10,7 +10,6 @@ import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; import org.lwjgl.opengl.GL11; -import ic2.core.network.NetworkManager; @SideOnly(Side.CLIENT) public class DriverGui extends GuiContainer { @@ -23,7 +22,8 @@ public class DriverGui extends GuiContainer { this.container=container1; } - @Override + @SuppressWarnings("unchecked") + @Override public void initGui() { super.initGui(); diff --git a/ihl/tunneling_shield/DriverRenderEntity.java b/ihl/tunneling_shield/DriverRenderEntity.java index 127c9a3..40ed977 100644 --- a/ihl/tunneling_shield/DriverRenderEntity.java +++ b/ihl/tunneling_shield/DriverRenderEntity.java @@ -11,11 +11,8 @@ public class DriverRenderEntity extends Render{ private DriverModel model = new DriverModel(); private ResourceLocation tex = new ResourceLocation(IHLModInfo.MODID+":textures/blocks/shield.png"); - private float rotationSpeed=0F; private float rotationAmount=1F; private float rotationAmount2=0F; - private float shiftCorrection=0F; - public DriverRenderEntity() { super(); diff --git a/ihl/tunneling_shield/DriverTileEntity.java b/ihl/tunneling_shield/DriverTileEntity.java index 2c3f2d8..f547dec 100644 --- a/ihl/tunneling_shield/DriverTileEntity.java +++ b/ihl/tunneling_shield/DriverTileEntity.java @@ -26,7 +26,6 @@ import ic2.core.block.invslot.InvSlotConsumableId; import ic2.core.block.invslot.InvSlot; import ic2.core.block.invslot.InvSlotUpgrade; import ic2.core.block.invslot.InvSlot.Access; -import ic2.core.network.NetworkManager; import ic2.core.upgrade.IUpgradableBlock; import ic2.core.upgrade.UpgradableProperty; import ic2.core.util.StackUtil; @@ -86,8 +85,8 @@ public class DriverTileEntity extends TileEntityInventory implements IEnergySink public boolean reverseModeOn=false; public boolean autoReverseModeOn=true; private float lastModelShiftAmount=1F; - private List blockBlackList = new ArrayList(); - private List blockWhiteList = new ArrayList(); + private List blockBlackList = new ArrayList(); + private List blockWhiteList = new ArrayList(); public boolean advancedShield=false; public DriverTileEntity() @@ -225,7 +224,8 @@ public class DriverTileEntity extends TileEntityInventory implements IEnergySink } - @Override + @SuppressWarnings("unchecked") + @Override public void updateEntityClient() { super.updateEntityClient(); @@ -318,7 +318,8 @@ public class DriverTileEntity extends TileEntityInventory implements IEnergySink } } - @Override + @SuppressWarnings("unchecked") + @Override public void updateEntityServer() { if (IC2.platform.isSimulating()) @@ -720,7 +721,7 @@ public class DriverTileEntity extends TileEntityInventory implements IEnergySink } @Override - public ContainerBase getGuiContainer(EntityPlayer arg0) { + public ContainerBase getGuiContainer(EntityPlayer arg0) { return new DriverContainer(arg0, this); } @@ -799,9 +800,6 @@ public class DriverTileEntity extends TileEntityInventory implements IEnergySink private AxisAlignedBB getShieldBladesZone(double offset) { - int x=this.xCoord; - int y=this.yCoord; - int z=this.zCoord; double extension=this.getModelShiftAmount()+offset; double xShieldMinD=this.xCoord+extension*this.mX()-1D*Math.max(this.mX(), 0)-2D*Math.abs(this.mZ()); double xShieldMaxD=this.xCoord+extension*this.mX()-1D*Math.min(this.mX(), 0)+3D*Math.abs(this.mZ()); @@ -960,7 +958,7 @@ public class DriverTileEntity extends TileEntityInventory implements IEnergySink HydrotransportPulpRegeneratorTileEntity hprte = (HydrotransportPulpRegeneratorTileEntity) te; if(hprte.getActive()) { - ArrayList drops1 = new ArrayList(); + ArrayList drops1 = new ArrayList(); Iterator dropsIterator = drops.iterator(); while(dropsIterator.hasNext()) { diff --git a/ihl/tunneling_shield/HorizontalMiningPipe.java b/ihl/tunneling_shield/HorizontalMiningPipe.java index 8048d45..9409d27 100644 --- a/ihl/tunneling_shield/HorizontalMiningPipe.java +++ b/ihl/tunneling_shield/HorizontalMiningPipe.java @@ -23,7 +23,7 @@ import net.minecraft.world.World; public class HorizontalMiningPipe extends Block { - public static ArrayList teList = new ArrayList(); + public static ArrayList teList = new ArrayList(); public HorizontalMiningPipe() { super(Material.iron); diff --git a/ihl/tunneling_shield/HydrotransportPulpRegeneratorContainer.java b/ihl/tunneling_shield/HydrotransportPulpRegeneratorContainer.java index fade7a0..82445d7 100644 --- a/ihl/tunneling_shield/HydrotransportPulpRegeneratorContainer.java +++ b/ihl/tunneling_shield/HydrotransportPulpRegeneratorContainer.java @@ -10,7 +10,7 @@ import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; import net.minecraftforge.fluids.FluidStack; -public class HydrotransportPulpRegeneratorContainer extends ContainerBase { +public class HydrotransportPulpRegeneratorContainer extends ContainerBase { protected HydrotransportPulpRegeneratorTileEntity tileEntity; public int lastFluidAmount = -1; @@ -18,6 +18,7 @@ public class HydrotransportPulpRegeneratorContainer extends ContainerBase { public short lastProgress = -1; public short lastTemperature = -1; private int lastEnergy = -1; + @SuppressWarnings("unused") private List fluidTankFluidList; private final static int height=166; @@ -39,7 +40,7 @@ public class HydrotransportPulpRegeneratorContainer extends ContainerBase { } this.addSlotToContainer(new SlotInvSlot(tileEntity1.drainInputSlot, 0, 32, 13)); this.addSlotToContainer(new SlotInvSlot(tileEntity1.emptyFluidItemsSlot, 0, 32, 51)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.engine, 0, 8, 32)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.dischargeSlot, 0, 8, 32)); for(col=0;col<4;col++) { for(row=0;row<3;row++) diff --git a/ihl/tunneling_shield/HydrotransportPulpRegeneratorGui.java b/ihl/tunneling_shield/HydrotransportPulpRegeneratorGui.java index 263d2e1..bd86dd7 100644 --- a/ihl/tunneling_shield/HydrotransportPulpRegeneratorGui.java +++ b/ihl/tunneling_shield/HydrotransportPulpRegeneratorGui.java @@ -44,10 +44,6 @@ public class HydrotransportPulpRegeneratorGui extends GuiContainer { IHLRenderUtils.instance.renderIHLFluidTank(this.container.tileEntity.fluidTank, 57, 16, 69, 63, zLevel, par1, par2, xOffset, yOffset); } this.mc.renderEngine.bindTexture(background); - if(!this.container.tileEntity.engine.correctContent()) - { - IHLRenderUtils.instance.drawMissingEngineTooltip(this, par1, par2, 26, 33, xOffset, yOffset); - } } @Override diff --git a/ihl/tunneling_shield/HydrotransportPulpRegeneratorTileEntity.java b/ihl/tunneling_shield/HydrotransportPulpRegeneratorTileEntity.java index e1d2b39..dc5e114 100644 --- a/ihl/tunneling_shield/HydrotransportPulpRegeneratorTileEntity.java +++ b/ihl/tunneling_shield/HydrotransportPulpRegeneratorTileEntity.java @@ -40,7 +40,6 @@ public class HydrotransportPulpRegeneratorTileEntity extends BasicElectricMotorT this.drainInputSlot = new InvSlotConsumableLiquidIHL(this, "drainInput", -1, InvSlot.Access.I, 1, InvSlot.InvSide.TOP, InvSlotConsumableLiquid.OpType.Drain); this.emptyFluidItemsSlot = new InvSlotOutput(this, "fluidCellsOutput", 2, 1); this.outputSlot = new InvSlotOutput(this, "output", 3, 12); - this.isGuiScreenOpened=true; this.operationLength=26; } @@ -211,9 +210,10 @@ public class HydrotransportPulpRegeneratorTileEntity extends BasicElectricMotorT private boolean isMachineOperational() { - return this.engine.correctContent() && this.energy>=this.energyConsume/this.engine.getEfficiency(); + return this.energy>=this.energyConsume; } + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public List[] getInput() { diff --git a/ihl/tunneling_shield/MultiBlockSpacerBlock.java b/ihl/tunneling_shield/MultiBlockSpacerBlock.java index 511d8cd..79e5955 100644 --- a/ihl/tunneling_shield/MultiBlockSpacerBlock.java +++ b/ihl/tunneling_shield/MultiBlockSpacerBlock.java @@ -22,7 +22,7 @@ import net.minecraft.world.World; public class MultiBlockSpacerBlock extends Block { - public static Set teList = new HashSet(); + public static Set teList = new HashSet(); public MultiBlockSpacerBlock() { @@ -37,7 +37,12 @@ public class MultiBlockSpacerBlock extends Block { { return -2; } - + + @Override + public ArrayList getDrops(World world,int x, int y, int z, int meta, int flag) + { + return new ArrayList(); + } @Override public void onBlockDestroyedByExplosion(World world, int x, int y, int z, Explosion explosion) { @@ -100,14 +105,6 @@ public class MultiBlockSpacerBlock extends Block { return null; } - @Override - public ArrayList getDrops(World world,int x, int y, int z, int meta, int flag) - { - ArrayList nothing = new ArrayList(); - nothing.clear(); - return nothing; - } - /** * Is this block (a) opaque and (B) a full 1m cube? This determines whether or not to render the shared face of two * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. diff --git a/ihl/utils/ChunkAndWorldLoadEventHandler.java b/ihl/utils/ChunkAndWorldLoadEventHandler.java deleted file mode 100644 index 3fb51f7..0000000 --- a/ihl/utils/ChunkAndWorldLoadEventHandler.java +++ /dev/null @@ -1,63 +0,0 @@ -package ihl.utils; - -import ihl.IHLMod; - -import java.util.HashSet; -import java.util.Set; - -import net.minecraft.world.ChunkCoordIntPair; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; - -public class ChunkAndWorldLoadEventHandler -{ - public static ChunkAndWorldLoadEventHandler instance; - public ChunkAndWorldLoadEventHandler() - { - instance=this; - } - - @SubscribeEvent - public void onChunkLoadEvent(net.minecraftforge.event.world.ChunkEvent.Load event) - { - if(event.getChunk().isChunkLoaded && IHLMod.explosionHandler.blastWaveByDimensionId.containsKey(event.world.provider.dimensionId)) - { - WorldSavedDataBlastWave bwdata = IHLMod.explosionHandler.blastWaveByDimensionId.get(event.world.provider.dimensionId); - long cc = ChunkCoordIntPair.chunkXZ2Int(event.getChunk().xPosition, event.getChunk().zPosition); - if(bwdata.data.containsKey(cc)) - { - Long[][] bwArray = bwdata.data.remove(cc); - Set svset = new HashSet(16); - int sourceIndex=0; - for(int i1=0;i1<16;i1++) - { - if(bwArray[i1][0]!=null && !bwArray[i1][0].equals(0)) - { - sourceIndex=i1; - svset.add(bwArray[i1][0]); - IHLMod.explosionHandler.setPower(bwArray[i1][0], bwArray[i1][4].intValue()); - } - } - IHLMod.explosionHandler.doExplosion(event.world, bwArray[sourceIndex][1].intValue(), bwArray[sourceIndex][2].intValue(), bwArray[sourceIndex][3].intValue(), svset); - } - } - } - - @SubscribeEvent - public void onWorldLoadEvent(net.minecraftforge.event.world.WorldEvent.Load event) - { - WorldSavedDataBlastWave blastWave = (WorldSavedDataBlastWave) event.world.mapStorage.loadData(WorldSavedDataBlastWave.class, "blastWave"); - if(blastWave!=null) - { - IHLMod.explosionHandler.blastWaveByDimensionId.put(event.world.provider.dimensionId,blastWave); - } - } - - @SubscribeEvent - public void onWorldSaveEvent(net.minecraftforge.event.world.WorldEvent.Save event) - { - if(IHLMod.explosionHandler.blastWaveByDimensionId.containsKey(event.world.provider.dimensionId)) - { - event.world.mapStorage.setData("blastWave",IHLMod.explosionHandler.blastWaveByDimensionId.get(event.world.provider.dimensionId)); - } - } -} diff --git a/ihl/utils/EntityIHLExplosion.java b/ihl/utils/EntityIHLExplosion.java deleted file mode 100644 index df0dc18..0000000 --- a/ihl/utils/EntityIHLExplosion.java +++ /dev/null @@ -1,187 +0,0 @@ -package ihl.utils; - -import ihl.IHLMod; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Map; -import java.util.Set; - -import net.minecraft.block.Block; -import net.minecraft.entity.Entity; -import net.minecraft.init.Blocks; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.Explosion; -import net.minecraft.world.World; - -public class EntityIHLExplosion extends Entity { - private Explosion explosion; - private boolean explosionDone=false; - public Set effectBorderBlocks; - public Set effectBorderBlocksWithLowPosition; - public Set blocksConnectedWithBedrock; - public Set blocksNotConnectedWithBedrock; - public int explosionPower; - public int x; - public int y; - public int z; - private Map entityCache = new HashMap(); - - public EntityIHLExplosion(World world,int x1,int y1,int z1, int explosionPower1) { - super(world); - this.effectBorderBlocks=new HashSet(); - this.effectBorderBlocksWithLowPosition=new HashSet(); - this.blocksConnectedWithBedrock=new HashSet(); - this.blocksNotConnectedWithBedrock=new HashSet(); - this.isImmuneToFire=true; - this.noClip=true; - this.setSize(0F, 0F); - this.x=x1; - this.y=y1; - this.z=z1; - this.setPosition(x+0.5d, y+0.5d, z+0.5d); - this.explosionPower = explosionPower1; - } - - - - @Override - public void onUpdate() - { - if(!worldObj.isRemote) - { - if(!effectBorderBlocks.isEmpty()) - { - boolean hasSomeBlocksStickedToAir=false; - Iterator ebbi = effectBorderBlocks.iterator(); - while(ebbi.hasNext()) - { - long longNumber = ebbi.next(); - int[] xyz = IHLUtils.decodeXYZ(longNumber); - Block block = worldObj.getBlock(x+xyz[0], y+xyz[1], z+xyz[2]); - if(block!=Blocks.air && !block.isAir(worldObj, x+xyz[0], y+xyz[1], z+xyz[2])) - { - if(block.getMaterial().isLiquid()) - { - block.onNeighborBlockChange(worldObj, x+xyz[0], y+xyz[1], z+xyz[2], block); - } - else if(!this.isBlockConnectedWithBedrock(longNumber)) - { - hasSomeBlocksStickedToAir=true; - } - } - } - Iterator bnctbi = this.blocksNotConnectedWithBedrock.iterator(); - while(bnctbi.hasNext()) - { - long longNumber5 = bnctbi.next(); - int[] xyz = IHLUtils.decodeXYZ(longNumber5); - Block block = worldObj.getBlock(x+xyz[0], y+xyz[1], z+xyz[2]); - float bh = block.getBlockHardness(worldObj, x+xyz[0], y+xyz[1], z+xyz[2]); - if(bh>=0f && bh path = new HashSet(); - Iterator pathi = path.iterator(); - Set deadlockBlocks = new HashSet(); - int[] xyz = IHLUtils.decodeXYZ(longNumber); - int absX=x+xyz[0]; - int absY=y+xyz[1]; - int absZ=z+xyz[2]; - path.add(longNumber); - while(absY>4) - { - int xyzi[] = {0,0,-1,0,0,1,0,0}; - Block block; - int x2,y2,z2; - boolean deadlock = true; - for(int i=0;i<=5;i++) - { - x2=absX+xyzi[i]; - y2=absY+xyzi[i+2]; - z2=absZ+xyzi[i+1]; - long longNumber2 = IHLUtils.encodeXYZ(x2-x, y2-y, z2-z); - if(this.blocksConnectedWithBedrock.contains(longNumber2)) - { - this.blocksConnectedWithBedrock.addAll(path); - return true; - } - if(!path.contains(longNumber2)) - { - block = worldObj.getBlock(x2,y2,z2); - if(block!=Blocks.air && !block.isAir(worldObj, x2,y2,z2) && !block.getMaterial().isLiquid()) - { - absX=x2; - absY=y2; - absZ=z2; - path.add(longNumber2); - if(absY<=4) - { - this.blocksConnectedWithBedrock.addAll(path); - return true; - } - deadlock = false; - break; - } - } - } - if(deadlock) - { - long longNumber3 = IHLUtils.encodeXYZ(absX-x, absY-y, absZ-z); - deadlockBlocks.add(longNumber3); - boolean deadEnd=true; - while(pathi.hasNext()) - { - long longNumber4 = pathi.next(); - if(!deadlockBlocks.contains(longNumber4)) - { - int[] xyz2 = IHLUtils.decodeXYZ(longNumber4); - absX=x+xyz2[0]; - absY=y+xyz2[1]; - absZ=z+xyz2[2]; - deadEnd=false; - break; - } - } - if(deadEnd) - { - this.blocksNotConnectedWithBedrock.addAll(path); - return false; - } - } - } - this.blocksConnectedWithBedrock.addAll(path); - return true; - } - - - @Override - protected void entityInit() {} - - @Override - protected void readEntityFromNBT(NBTTagCompound arg0) {} - - @Override - protected void writeEntityToNBT(NBTTagCompound arg0) {} - - -} diff --git a/ihl/utils/ExplosionVector.java b/ihl/utils/ExplosionVector.java deleted file mode 100644 index d341fd3..0000000 --- a/ihl/utils/ExplosionVector.java +++ /dev/null @@ -1,453 +0,0 @@ -package ihl.utils; - -import ihl.IHLMod; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Random; -import java.util.Set; - -import net.minecraft.block.Block; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.network.play.server.S26PacketMapChunkBulk; -import net.minecraft.util.DamageSource; -import net.minecraft.world.ChunkCoordIntPair; -import net.minecraft.world.Explosion; -import net.minecraft.world.World; -import net.minecraft.world.chunk.Chunk; -import net.minecraft.world.chunk.NibbleArray; -import net.minecraft.world.chunk.storage.ExtendedBlockStorage; - -public class ExplosionVector -{ - public Set startVectors = new HashSet(); - private Set sv; - private Set chunksToUpdate=new HashSet(64); - public Map> vectors = new HashMap(32786); - public Map explosions = new HashMap(); - public Map explosionPower = new HashMap(); - public Map explosionPowerDampingFactor = new HashMap(32786); - public Map cachedEBS = new HashMap(128); - public Map cachedEBSHardness = new HashMap(128); - public Map> cachedEBSDrops = new HashMap(128); - public Map> cachedEBSEntity = new HashMap(128); - public Map blastWaveByDimensionId = new HashMap(); - - private Random random = new Random(); - - public ExplosionVector() - { - this.precalculateExplosion(); - } - - public void precalculateExplosion() - { - int maxExplosionRadius=32; - for(int levelRadius=1; levelRadiusMath.round(levelRadius*1.8f)) - { - prevX=IHLUtils.reduceVariableByAbsoluteValue(prevX); - prevY=IHLUtils.reduceVariableByAbsoluteValue(prevY); - prevZ=IHLUtils.reduceVariableByAbsoluteValue(prevZ); - } - else if(Math.abs(ix)<=Math.abs(iy) && Math.abs(ix)<=Math.abs(iz)) - { - prevY=IHLUtils.reduceVariableByAbsoluteValue(prevY); - prevZ=IHLUtils.reduceVariableByAbsoluteValue(prevZ); - } - else if(Math.abs(iy)<=Math.abs(ix) && Math.abs(iy)<=Math.abs(iz)) - { - prevX=IHLUtils.reduceVariableByAbsoluteValue(prevX); - prevZ=IHLUtils.reduceVariableByAbsoluteValue(prevZ); - } - else if(Math.abs(iz)<=Math.abs(ix) && Math.abs(iz)<=Math.abs(iy)) - { - prevY=IHLUtils.reduceVariableByAbsoluteValue(prevY); - prevX=IHLUtils.reduceVariableByAbsoluteValue(prevX); - } - long prevKey = IHLUtils.encodeXYZ(prevX,prevY,prevZ); - if(prevX==ix && prevY==iy && prevZ==iz && levelRadius>1) - { - IHLMod.log.error("Was:"+ix+"/" +iy+"/" +iz+"/"); - IHLMod.log.error("Now:"+prevX+"/" +prevY+"/" +prevZ+"/"); - throw new ArithmeticException("Variables are out of expected range. \n Expected are not equal: "+ix+"="+prevX+" "+iy+"="+prevY+" "+iz+"="+prevZ); - } - if(levelRadius==1) - { - startVectors.add(coordinateKey); - this.addElement(coordinateKey, prevX, prevY, prevZ, ix, iy, iz); - } - else if(vectors.containsKey(prevKey)) - { - //prevKey=this.getParentWithLowestDescendantsRate(prevKey, prevX, prevY, prevZ, levelRadius); - vectors.get(prevKey).add(coordinateKey); - this.addElement(coordinateKey, prevX, prevY, prevZ, ix, iy, iz); - } - else - { - IHLMod.log.error("Was:"+ix+"/" +iy+"/" +iz+"/"); - IHLMod.log.error("Now:"+prevX+"/" +prevY+"/" +prevZ+"/"); - IHLMod.log.info("ExplosionVector is missing parent! Help him!"); - } - } - } - } - } - } - } - } - - private void addElement(long coordinateKey, int prevX, int prevY, int prevZ, int ix, int iy, int iz) - { - vectors.put(coordinateKey, new HashSet()); - float df = (float)(prevX*prevX+prevY*prevY+prevZ*prevZ+1)/(float)(ix*ix+iy*iy+iz*iz+1); - explosionPowerDampingFactor.put(coordinateKey,df); - } - - public void setPower(Set sv2, int power1) - { - for(long ev:sv2) - { - this.setPower(ev, power1); - } - } - - public void setPower(Long ev, int power1) { - this.explosionPower.put(ev, power1); - } -/* - public Set breakBlocksAndGetDescendants(World world, EntityIHLExplosion exploder, Explosion explosion, long longNumber) - { - int multiplier = exploder.multiplier; - int[] xyz = IHLUtils.decodeXYZ(longNumber); - int power1 = explosionPower.get(longNumber); - int repeat=0; - //System.out.println("Power before " + power1); - if(Math.abs(xyz[0])>=Math.abs(xyz[1]) && Math.abs(xyz[0])>=Math.abs(xyz[2])) - { - for(int ix=xyz[0]>0?0:multiplier-1;ix=0;ix=xyz[0]>0?ix+1:ix-1) - { - for(int iy=xyz[1]>0?0:multiplier-1;iy=0;iy=xyz[1]>0?iy+1:iy-1) - { - for(int iz=xyz[2]>0?0:multiplier-1;iz=0;iz=xyz[2]>0?iz+1:iz-1) - { - power1 = this.getNewPowerAndProcessBlocks(world, exploder, explosion, xyz, multiplier, ix, iy, iz, power1); - } - } - } - } - else if(Math.abs(xyz[1])>=Math.abs(xyz[0]) && Math.abs(xyz[1])>=Math.abs(xyz[2])) - { - for(int iy=xyz[1]>0?0:multiplier-1;iy=0;iy=xyz[1]>0?iy+1:iy-1) - { - for(int ix=xyz[0]>0?0:multiplier-1;ix=0;ix=xyz[0]>0?ix+1:ix-1) - { - for(int iz=xyz[2]>0?0:multiplier-1;iz=0;iz=xyz[2]>0?iz+1:iz-1) - { - power1 = this.getNewPowerAndProcessBlocks(world, exploder, explosion, xyz, multiplier, ix, iy, iz, power1); - } - } - } - } - else - { - for(int iz=xyz[2]>0?0:multiplier-1;iz=0;iz=xyz[2]>0?iz+1:iz-1) - { - for(int ix=xyz[0]>0?0:multiplier-1;ix=0;ix=xyz[0]>0?ix+1:ix-1) - { - for(int iy=xyz[1]>0?0:multiplier-1;iy=0;iy=xyz[1]>0?iy+1:iy-1) - { - power1 = this.getNewPowerAndProcessBlocks(world, exploder, explosion, xyz, multiplier, ix, iy, iz, power1); - } - } - } - } - power1=Math.round(power1*explosionPowerDampingFactor.get(longNumber)-0.5f); - //System.out.println("Power after " + power1 + " \n repeats "+repeat); - if(power1<=1 || !vectors.containsKey(longNumber)|| vectors.get(longNumber).isEmpty()) - { - exploder.effectBorderBlocks.add(longNumber); - if(xyz[1]<0 || (exploder.y<=6 && xyz[1]<=6)) - { - exploder.effectBorderBlocksWithLowPosition.add(longNumber); - } - return null; - } - else - { - for(long d1:vectors.get(longNumber)) - { - explosionPower.put(d1, power1); - } - return vectors.get(longNumber); - } - } - */ - - public Set breakBlocksAndGetDescendantsForEBS(World world, int sourceX,int sourceY,int sourceZ, Explosion explosion, long longNumber) - { - int[] xyz = IHLUtils.decodeXYZ(longNumber); - int power1 = explosionPower.remove(longNumber); - power1 = this.getNewPowerAndProcessBlocksEBS(world, longNumber, sourceX, sourceY, sourceZ, explosion, xyz, power1); - power1=Math.round(power1*explosionPowerDampingFactor.get(longNumber)-0.5f); - if(power1<=1 || !vectors.containsKey(longNumber)|| vectors.get(longNumber).isEmpty()) - { - return null; - } - else - { - for(long d1:vectors.get(longNumber)) - { - explosionPower.put(d1, power1); - } - return vectors.get(longNumber); - } - - } -/* - private int getNewPowerAndProcessBlocks(World world, EntityIHLExplosion exploder, Explosion explosion, int xyz[], int multiplier, int ix, int iy, int iz, int power2) - { - int power1=power2; - int x = exploder.x+xyz[0]*multiplier+ix; - int y = exploder.y+xyz[1]*multiplier+iy; - int z = exploder.z+xyz[2]*multiplier+iz; - if(y<=4 || y>256) - { - return 0; - } - Block block = exploder.getBlock(x, y, z); - int explosionResistance = Math.round(block.getExplosionResistance(exploder, world, x, y, z, exploder.x, exploder.y, exploder.z)*10f); - if(explosionResistance>=power1) - { - power1=0; - } - else - { - power1-=Math.round(block.getExplosionResistance(exploder, world, x, y, z, exploder.x, exploder.y, exploder.z)*10f); - Entity entity = exploder.getEntity(x, y, z); - if(entity!=null) - { - entity.attackEntityFrom(exploder.damageSource, power1/10f); - } - block.onBlockDestroyedByExplosion(world, x, y, z, explosion); - exploder.setBlockToAir(x, y, z); - } - return power1; - } - */ - private int getNewPowerAndProcessBlocksEBS(World world, long longNumber, int sourceX, int sourceY, int sourceZ, Explosion explosion, int xyz[], int power2) - { - int power1=power2; - int absEBSX = xyz[0] + (sourceX>>4); - int absEBSY = xyz[1] + (sourceY>>4); - int absEBSZ = xyz[2] + (sourceZ>>4); - long chunkXZKey = ChunkCoordIntPair.chunkXZ2Int(absEBSX, absEBSZ); - if(absEBSY<0 || absEBSY>=16) - { - return 0; - } - if(world.getChunkProvider().chunkExists(absEBSX, absEBSZ)) - { - long absEBShash = IHLUtils.getXYZHash(absEBSX, absEBSY, absEBSZ); - int explosionResistance = this.getEBSResistance(world, absEBShash, absEBSX, absEBSY, absEBSZ, sourceX, sourceY, sourceZ); - if(explosionResistance>=power1) - { - power1=0; - } - else - { - power1-=explosionResistance; - if(this.cachedEBSEntity.containsKey(absEBShash)) - { - List entityList = this.cachedEBSEntity.get(absEBShash); - for(Object entity:entityList.toArray()) - { - if(entity!=null) - { - ((Entity) entity).attackEntityFrom(DamageSource.setExplosionSource(explosion), power1/10f); - } - } - } - this.onEBSDestroy(world, absEBShash, absEBSX, absEBSY, absEBSZ); - } - } - else - { - WorldSavedDataBlastWave blastWave = null; - int dimensionId = world.provider.dimensionId; - if(this.blastWaveByDimensionId.containsKey(dimensionId)) - { - blastWave=this.blastWaveByDimensionId.get(dimensionId); - } - else - { - blastWave=new WorldSavedDataBlastWave("blastWave"); - this.blastWaveByDimensionId.put(dimensionId, blastWave); - } - blastWave.scheduleExplosionEffectsOnChunkLoad(chunkXZKey, longNumber, sourceX, sourceY, sourceZ, power1, absEBSY); - } - return power1; - } - - public int getEBSResistance(World world, long absEBShash, int absEBSX, int absEBSY, int absEBSZ, int sourceX, int sourceY, int sourceZ) - { - - if(this.cachedEBSHardness.containsKey(absEBShash)) - { - return this.cachedEBSHardness.get(absEBShash); - } - else - { - this.precacheChunk(world, absEBSX,absEBSZ, sourceX, sourceY, sourceZ); - return this.cachedEBSHardness.containsKey(absEBShash)?this.cachedEBSHardness.get(absEBShash):0; - } - } - - public void precacheChunk(World world, int absEBSX, int absEBSZ, int sourceX, int sourceY, int sourceZ) - { - Chunk chunk = world.getChunkProvider().provideChunk(absEBSX, absEBSZ); - ExtendedBlockStorage[] ebsA = chunk.getBlockStorageArray(); - for(int y3=0;y3 drops = new HashMap(); - for(int i4=0;i4>8) & 15, (i4>>4) & 15) << 8; - } - int blockWorldX = (i4 & 15)+(absEBSX<<4); - int blockWorldY = ((i4>>8) & 15)+(y3<<4); - int blockWorldZ = ((i4>>4) & 15)+(absEBSZ<<4); - Block block = Block.getBlockById(var4); - List dropsList = (block.getDrops(world, blockWorldX, blockWorldY, blockWorldZ, ebs.getExtBlockMetadata(i4 & 15, (i4>>8) & 15, (i4>>4) & 15), 0)); - if(dropsList!=null) - { - for(ItemStack drop:dropsList) - { - long key = (Item.getIdFromItem(drop.getItem())<<16)|drop.getItemDamage(); - if(drops.containsKey(key)) - { - int ss = drops.get(key); - drops.put(key, drop.stackSize+ss); - } - else - { - drops.put(key, drop.stackSize); - } - } - } - if(block.getBlockHardness(world, blockWorldX, blockWorldY, blockWorldZ)<0) - { - ebsHardness=Integer.MAX_VALUE; - break; - } - else - { - ebsHardness+=Math.round(block.getExplosionResistance(null, world, blockWorldX, blockWorldY, blockWorldZ, sourceX, sourceY, sourceZ)*10f); - } - } - this.cachedEBSDrops.put(absEBShash1, drops); - this.cachedEBSEntity.put(absEBShash1, chunk.entityLists[y3]); - this.cachedEBSHardness.put(absEBShash1, ebsHardness); - this.cachedEBS.put(absEBShash1, ebs); - } - } - } - - public void onEBSDestroy(World world,long absEBShash,int absEBSX,int absEBSY,int absEBSZ) - { - if(this.cachedEBS.containsKey(absEBShash)) - { - ExtendedBlockStorage ebs = this.cachedEBS.get(absEBShash); - ebs.setBlockMSBArray(new NibbleArray(4096, 4)); - ebs.setBlockLSBArray(new byte[4096]); - this.cachedEBS.remove(absEBShash); - this.cachedEBSDrops.remove(absEBShash); - this.cachedEBSEntity.remove(absEBShash); - this.cachedEBSHardness.remove(absEBShash); - this.chunksToUpdate.add(world.getChunkProvider().provideChunk(absEBSX, absEBSZ)); - } - } - - public void sendChunkUpdateToPlayersInExplosionAffectedZone(World world) - { - for(Object player:world.playerEntities) - { - if(player instanceof EntityPlayerMP) - { - EntityPlayerMP playerMP = (EntityPlayerMP)player; - List chunks = new ArrayList(); - chunks.addAll(this.chunksToUpdate); - playerMP.playerNetServerHandler.sendPacket(new S26PacketMapChunkBulk(chunks)); - this.chunksToUpdate.clear(); - } - } - } - - public void doExplosion(World world, int sourceX, int sourceY, int sourceZ, Set startVectors1) - { - boolean doExplosion=true; - long sourceHash = IHLUtils.getXYZHash(sourceX, sourceY, sourceZ); - Explosion explosion = new Explosion(world, null, sourceX, sourceY, sourceZ, 100f); - explosions.put(sourceHash, explosion); - while(doExplosion) - { - Set sv2=new HashSet(); - if(sv==null) - { - sv = startVectors1; - } - for(long ev:sv) - { - Set sv3 = this.breakBlocksAndGetDescendantsForEBS(world, sourceX, sourceY, sourceZ, explosion, ev); - if(sv3!=null) - { - sv2.addAll(sv3); - } - } - if(sv2.isEmpty()) - { - doExplosion=false; - sv = null; - sendChunkUpdateToPlayersInExplosionAffectedZone(world); - break; - } - else - { - sv=sv2; - } - } - - - } - - -} diff --git a/ihl/utils/FluidDictionary.java b/ihl/utils/FluidDictionary.java index fa5b96a..8dcd18f 100644 --- a/ihl/utils/FluidDictionary.java +++ b/ihl/utils/FluidDictionary.java @@ -10,8 +10,8 @@ import net.minecraftforge.fluids.FluidStack; public class FluidDictionary { - private Map> nameToStack = new HashMap(); - private Map fluidToName = new HashMap(); + private Map> nameToStack = new HashMap>(); + private Map fluidToName = new HashMap(); public FluidDictionary(){} public List getFluids(String fdName) @@ -27,7 +27,7 @@ public class FluidDictionary } else { - List list = new ArrayList(); + List list = new ArrayList(); list.add(fstack); nameToStack.put(fdName, list); } diff --git a/ihl/utils/IHLFluidTank.java b/ihl/utils/IHLFluidTank.java index aef2b46..21eb5b7 100644 --- a/ihl/utils/IHLFluidTank.java +++ b/ihl/utils/IHLFluidTank.java @@ -20,7 +20,6 @@ public class IHLFluidTank implements IFluidTank { private final List fluidList = new ArrayList(); private final int capacity; - private boolean isOpenVessel=false; private int temperature=293; public IHLFluidTank(int capacity) @@ -30,7 +29,6 @@ public class IHLFluidTank implements IFluidTank public IHLFluidTank(int capacity, boolean isOpenVessel1) { - this.isOpenVessel=isOpenVessel1; this.capacity = capacity; } @@ -295,7 +293,7 @@ public class IHLFluidTank implements IFluidTank public void sortFluidsByDensity() { - Map sortMap = new HashMap(); + Map sortMap = new HashMap(); int[] keysArray = new int[fluidList.size()]; Iterator fli = fluidList.iterator(); while(fli.hasNext()) @@ -357,11 +355,11 @@ public class IHLFluidTank implements IFluidTank return this.fluidList; } - public void drain(List fluidInputs, boolean doDrain) + public void drain(List fluidInputs, boolean doDrain) { if(fluidInputs!=null && !fluidInputs.isEmpty()) { - Iterator fsi = fluidInputs.iterator(); + Iterator fsi = fluidInputs.iterator(); while(fsi.hasNext()) { this.drain(fsi.next(), doDrain); diff --git a/ihl/utils/IHLItemRenderer.java b/ihl/utils/IHLItemRenderer.java index caed0a3..38e98b2 100644 --- a/ihl/utils/IHLItemRenderer.java +++ b/ihl/utils/IHLItemRenderer.java @@ -30,9 +30,9 @@ public class IHLItemRenderer { public IHLItemRenderer(){} - public IHLItemRenderer(boolean b) + public IHLItemRenderer(boolean noRotation1) { - noRotation=b; + noRotation=noRotation1; } public void doRender(RenderManager renderManager, ItemStack stack, double x, double y, double z) diff --git a/ihl/utils/IHLMathUtils.java b/ihl/utils/IHLMathUtils.java index cfd6931..1200fd5 100644 --- a/ihl/utils/IHLMathUtils.java +++ b/ihl/utils/IHLMathUtils.java @@ -3,8 +3,9 @@ package ihl.utils; public class IHLMathUtils { private final static int accuracy_level=65536; - private static float[] sin_table=new float[accuracy_level]; - private static float[] atan_table=new float[accuracy_level]; + private final static float[] sin_table=new float[accuracy_level]; + private final static float[] atan_table=new float[accuracy_level]; + private final static float[] sqrt_table=new float[accuracy_level]; private final static float PI=(float)Math.PI; public static float sin(float angle) @@ -17,6 +18,18 @@ public class IHLMathUtils return sin_table[(int)(angle1*accuracy_level/2/PI)]; } + public static float sqrt(float value) + { + float value1 = value; + int multiplier = 2; + while(value1 >= 1.0f) + { + multiplier*=multiplier; + value1 /=multiplier*multiplier; + } + return ((multiplier>2)?multiplier:1)*sqrt_table[(int)(value1*accuracy_level)]; + } + public static float atan(float tan_value) { if(tan_value<-32f) @@ -32,7 +45,54 @@ public class IHLMathUtils return atan_table[(int)((tan_value+32f)*accuracy_level/64f)]; } } + + public static float[] vector_vector_multiply(float[] v1, float[] v2) + { + float c_x = v1[1]*v2[2] - v2[1]*v1[2]; + float c_y = v2[0]*v1[2] - v1[0]*v2[2]; + float c_z = v1[0]*v2[1] - v2[0]*v1[1]; + return new float[] {c_x,c_y,c_z}; + } + + public static void normalize_vector(float[] v1) + { + float d = (float)Math.sqrt(v1[0]*v1[0]+v1[1]*v1[1]+v1[2]*v1[2]); + if(d == 0) + { // Nothing can we do. Create new vector towards up direction. + v1[0]=0; + v1[1]=1; + v1[2]=0; + } + else + { + v1[0]/=d; + v1[1]/=d; + v1[2]/=d; + } + } + public static void scale_vector_to_value(float[] v1, float v2) + { + float d = (float)Math.sqrt(v1[0]*v1[0]+v1[1]*v1[1]+v1[2]*v1[2]); + if(d == 0) + { // Nothing can we do. Create new vector towards up direction. + v1[0]=0; + v1[1]=v2; + v1[2]=0; + } + else + { + v1[0]=v1[0]*v2/d; + v1[1]=v1[1]*v2/d; + v1[2]=v1[2]*v2/d; + } + } + + public static void vector_add(float[] fs, float x, float y, float z) { + fs[0]+=x; + fs[1]+=y; + fs[2]+=z; + } static { @@ -44,5 +104,49 @@ public class IHLMathUtils { atan_table[i]=(float) Math.atan(-32d+64d*i/accuracy_level); } + for(int i=0;i(); } public void renderIHLFluidTank(IHLFluidTank fluidTank, int x1, int y1, int x2, int y2, float zLevel, int par1, int par2, int xOffset, int yOffset) @@ -323,9 +320,6 @@ public class IHLRenderUtils { lastPlayerYaw = Minecraft.getMinecraft().renderViewEntity.prevRotationYaw; lastPlayerPitch = Minecraft.getMinecraft().renderViewEntity.prevRotationPitch; - lastPlayerPosX = Minecraft.getMinecraft().renderViewEntity.prevPosX; - lastPlayerPosY = Minecraft.getMinecraft().renderViewEntity.prevPosY; - lastPlayerPosZ = Minecraft.getMinecraft().renderViewEntity.prevPosZ; } public void drawKnee(double xPos, double yPos, double zPos, ForgeDirection direction12, ForgeDirection direction22, double radius1, double radius2, IIcon icon) @@ -539,7 +533,6 @@ public class IHLRenderUtils public void drawSquare(double xPos, double yPos, double zPos, double[][] vertexes, IIcon icon) { - Tessellator var9 = Tessellator.instance; double u1 = icon.getInterpolatedU(this.renderMinZ * 16.0D); double u2 = icon.getInterpolatedU(this.renderMaxZ * 16.0D); double v2 = icon.getInterpolatedV(16.0D - this.renderMaxY * 16.0D); @@ -554,16 +547,23 @@ public class IHLRenderUtils v2 = icon.getMinV(); v1 = icon.getMaxV(); } + this.drawSquare(xPos, yPos, zPos, u1, u2, v1, v2, vertexes); + } + + + public void drawSquare(double xPos, double yPos, double zPos, double u1, double u2, double v1, double v2, double[][] vertexes) + { + Tessellator var9 = Tessellator.instance; double[] us = new double[]{u1,u1,u2,u2}; double[] vs = new double[]{v1,v2,v2,v1}; double xDelta=this.renderMaxX-this.renderMinX; double yDelta=this.renderMaxY-this.renderMinY; double zDelta=this.renderMaxZ-this.renderMinZ; int startFrom=0; - int endTo=3; + int endTo=vertexes.length-1; if(this.renderFromInside) { - startFrom=3; + startFrom=vertexes.length-1; endTo=0; } for(int i=startFrom;(i<=endTo&&!this.renderFromInside)||(i>=endTo&&this.renderFromInside);i+=(endTo-startFrom)/3) @@ -617,6 +617,7 @@ public class IHLRenderUtils var9.addVertexWithUV(xPos+vX, yPos+vY, zPos+vZ, us[i], vs[i]); } } + public void setRenderBounds(double minX, double minY, double minZ, double maxX, double maxY, double maxZ) { @@ -735,9 +736,6 @@ public class IHLRenderUtils { this.rotationZ=rotationZ1; } -// this.rotationX=rotationX1; - // this.rotationY=rotationY1; - //this.rotationZ=rotationZ1; } public void reset() @@ -762,10 +760,9 @@ public class IHLRenderUtils public List splitStringByWidth(String string, int stringWidth) { - List output = new ArrayList(); + List output = new ArrayList(); StringBuffer sb = new StringBuffer(); String[] splittedBySpaces = string.split(" "); - int arrayIndex=0; for(String word:splittedBySpaces) { if(!word.contains("/n") && getStringWidth(sb)+getStringWidth(word) ihlItemStackRegistry = new HashMap(); + private static Map ihlItemStackRegistry = new HashMap(); private static final String Digits = "(\\p{Digit}+)"; private static final String HexDigits = "(\\p{XDigit}+)"; private static final String Exp = "[eE][+-]?"+Digits; @@ -159,10 +166,10 @@ public class IHLUtils } } - public static ItemStack getOtherModItemStackWithDamage(String modname, String name,int damage) { + public static ItemStack getOtherModItemStackWithDamage(String modname, String name, int damage, int quantity) { if(GameRegistry.findItem(modname, name)!=null) { - return new ItemStack(GameRegistry.findItem(modname, name),1,damage); + return new ItemStack(GameRegistry.findItem(modname, name),quantity,damage); } else if(GameRegistry.findBlock(modname, name)==null) { @@ -170,7 +177,7 @@ public class IHLUtils } else { - return new ItemStack(GameRegistry.findBlock(modname, name),1,damage); + return new ItemStack(GameRegistry.findBlock(modname, name),quantity,damage); } } @@ -477,6 +484,20 @@ public class IHLUtils //IHLMod.log.info("IC2 metal former (rolling) recipe for "+input+" already exist. Skipped."); } } + + public static void addIC2ExtrudingRecipe(ItemStack input, ItemStack output) + { + if(Recipes.metalformerExtruding.getOutputFor(input, false)==null) + { + NBTTagCompound tag = new NBTTagCompound(); + Recipes.metalformerExtruding.addRecipe(new RecipeInputItemStack(input), tag, output); + } + else + { + //IHLMod.log.info("IC2 metal former (rolling) recipe for "+input+" already exist. Skipped."); + } + } + public static void addIC2CentrifugeRecipe(String input, ItemStack output, ItemStack output2) { @@ -536,7 +557,7 @@ public class IHLUtils public static int getDamageValueViaNBTTag(ItemStack stack) { NBTTagCompound gtTagCompound = null; - if(stack!=null && stack.stackTagCompound.hasKey("GT.ToolStats")) + if(stack!=null && stack.stackTagCompound!=null && stack.stackTagCompound.hasKey("GT.ToolStats")) { gtTagCompound = stack.stackTagCompound.getCompoundTag("GT.ToolStats"); } @@ -557,7 +578,7 @@ public class IHLUtils public static int getMaxDamageValueViaNBTTag(ItemStack stack) { NBTTagCompound gtTagCompound = null; - if(stack!=null && stack.stackTagCompound.hasKey("GT.ToolStats")) + if(stack!=null && stack.stackTagCompound!=null && stack.stackTagCompound.hasKey("GT.ToolStats")) { gtTagCompound = stack.stackTagCompound.getCompoundTag("GT.ToolStats"); } @@ -641,28 +662,28 @@ public class IHLUtils public static void handleFluidSlotsBehaviour(InvSlotConsumableLiquidIHL fillInputSlot, InvSlotConsumableLiquidIHL drainInputSlot, InvSlotOutput emptyFluidItemsSlot, IFluidTank fluidTank) { - MutableObject output; + MutableObject output; if (drainInputSlot!=null && !drainInputSlot.isEmpty()) { - output = new MutableObject(); - if(fluidTank.fill(drainInputSlot.drain(null, fluidTank.getCapacity()-fluidTank.getFluidAmount(), output, true),false)>0 && (output.getValue() == null || emptyFluidItemsSlot.canAdd((ItemStack)output.getValue()))) + output = new MutableObject(); + if(fluidTank.fill(drainInputSlot.drain(null, fluidTank.getCapacity()-fluidTank.getFluidAmount(), output, true),false)>0 && (output.getValue() == null || emptyFluidItemsSlot.canAdd(output.getValue()))) { fluidTank.fill(drainInputSlot.drain(null, fluidTank.getCapacity()-fluidTank.getFluidAmount(), output, false),true); if(output.getValue()!=null) { - emptyFluidItemsSlot.add((ItemStack)output.getValue()); + emptyFluidItemsSlot.add(output.getValue()); } } } if (fillInputSlot!=null && !fillInputSlot.isEmpty()) { - output = new MutableObject(); - if (fillInputSlot.transferFromTank(fluidTank, output, true) && (output.getValue() == null || emptyFluidItemsSlot.canAdd((ItemStack)output.getValue()))) + output = new MutableObject(); + if (fillInputSlot.transferFromTank(fluidTank, output, true) && (output.getValue() == null || emptyFluidItemsSlot.canAdd(output.getValue()))) { fillInputSlot.transferFromTank(fluidTank, output, false); if(output.getValue()!=null) { - emptyFluidItemsSlot.add((ItemStack)output.getValue()); + emptyFluidItemsSlot.add(output.getValue()); } } } @@ -788,7 +809,7 @@ public class IHLUtils public static List convertRecipeInputToItemStackList(List input) { Iterator irii=input.iterator(); - List output = new ArrayList(); + List output = new ArrayList(); while(irii.hasNext()) { IRecipeInput iri = irii.next(); @@ -801,7 +822,7 @@ public class IHLUtils public static List convertRecipeInputToFluidStackList(List input) { Iterator irii=input.iterator(); - List output = new ArrayList(); + List output = new ArrayList(); while(irii.hasNext()) { IRecipeInputFluid iri = irii.next(); @@ -840,7 +861,8 @@ public class IHLUtils public static long getXYZHash(int x,int y,int z) { - return ((x&0x1FFFFF)<<42)|((y&0x1FFFFF)<<21)|(z&0x1FFFFF); + int sign_bits = (x & 0x80000000) >> 29 | (y & 0x80000000) >> 30 | (z & 0x80000000) >> 31; + return (long)x<<31 ^ (long)y<<17 ^ (long)z<<3 ^ sign_bits; } public static String trim(String str) @@ -1105,6 +1127,118 @@ public class IHLUtils else { return useSafeValue; } + } + + public static int parseIntSafe(String string, int useSafeValue) + { + if (Pattern.matches(fpRegex, string)) + return Integer.valueOf(string); + else { + return useSafeValue; + } + } + + public static boolean isBlockRegisteredInOreDictionaryAs(Block block, String string) { + Iterator isoi = OreDictionary.getOres(string).iterator(); + while(isoi.hasNext()) + { + if(Block.getBlockFromItem(isoi.next().getItem())==block) + { + return true; + } + } + return false; + } + + public static void setBlockAndTileEntityRaw(World world, int x, int y, int z, Block block, TileEntity te) + { + Chunk chunk = world.getChunkProvider().provideChunk(x>>4, z>>4); + ExtendedBlockStorage[] ebsA = chunk.getBlockStorageArray(); + ExtendedBlockStorage ebs = ebsA[y>>4]; + if(ebs==null) + { + ebs = new ExtendedBlockStorage(y, true); + ebsA[y>>4] = ebs; + } + setBlockRaw(ebs,x & 15,y & 15,z & 15,block); + te.xCoord=x; + te.yCoord=y; + te.zCoord=z; + te.setWorldObj(world); + chunk.addTileEntity(te); } + + public static void setBlockRaw(ExtendedBlockStorage ebs, int x, int y, int z, Block block) + { + int l = ebs.blockLSBArray[y << 8 | z << 4 | x] & 255; + + if (ebs.blockMSBArray != null) + { + l |= ebs.blockMSBArray.get(x, y, z) << 8; + } + + Block block1 = Block.getBlockById(l); + + if (block1 != Blocks.air) + { + --ebs.blockRefCount; + + if (block1.getTickRandomly()) + { + --ebs.tickRefCount; + } + } + + if (block != Blocks.air) + { + ++ebs.blockRefCount; + + if (block.getTickRandomly()) + { + ++ebs.tickRefCount; + } + } + + int i1 = Block.getIdFromBlock(block); + ebs.blockLSBArray[y << 8 | z << 4 | x] = (byte)(i1 & 255); + + if (i1 > 255) + { + if (ebs.blockMSBArray == null) + { + ebs.blockMSBArray = new NibbleArray(ebs.blockLSBArray.length, 4); + } + + ebs.blockMSBArray.set(x, y, z, (i1 & 3840) >> 8); + } + else if (ebs.blockMSBArray != null) + { + ebs.blockMSBArray.set(x, y, z, 0); + } + } + + public static void dumpToFile(Set unlocalisedNames, String filename) { + try { + OutputStreamWriter osWriter = new OutputStreamWriter(new FileOutputStream(getFile(filename)), "UTF-8"); + BufferedWriter writer = new BufferedWriter(osWriter); + for(String string:unlocalisedNames) + { + writer.append(string); + writer.newLine(); + } + writer.close(); + osWriter.close(); + } catch (Exception e) { + e.printStackTrace(); + } + } + + private static File getFile(String filename) + { + File folder = new File(IHLMod.proxy.getMinecraftDir(), "logs"); + folder.mkdirs(); + return new File(folder, filename); + } + } diff --git a/ihl/utils/IHLXMLParser.java b/ihl/utils/IHLXMLParser.java index 67d246b..8073542 100644 --- a/ihl/utils/IHLXMLParser.java +++ b/ihl/utils/IHLXMLParser.java @@ -3,15 +3,7 @@ package ihl.utils; import ihl.IHLMod; import ihl.guidebook.IHLGuidebookGui; -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileOutputStream; import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.LineNumberReader; -import java.io.OutputStreamWriter; -import java.net.URL; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; @@ -20,9 +12,6 @@ import javax.xml.parsers.ParserConfigurationException; import org.w3c.dom.*; import org.xml.sax.SAXException; -import com.google.common.io.Files; - - public class IHLXMLParser { public DocumentBuilderFactory dbf; @@ -55,7 +44,7 @@ public class IHLXMLParser { else if(e.getTagName().equals("itemstack")) { String[] innername = IHLUtils.trim(e.getTextContent()).split(":"); - ihlGuidebookGui.addItemStack(IHLUtils.getOtherModItemStackWithDamage(innername[0], innername[1], Integer.parseInt(e.getAttribute("damage")))); + ihlGuidebookGui.addItemStack(IHLUtils.getOtherModItemStackWithDamage(innername[0], innername[1], Integer.parseInt(e.getAttribute("damage")),1)); } else if(e.getTagName().equals("text")) { @@ -100,42 +89,4 @@ public class IHLXMLParser { Document doc = db.parse(IHLMod.class.getResourceAsStream("/assets/ihl/config/ihl-guidebook.xml")); visit(doc, 0, sectionNumber, ihlGuidebookGui); } - - private File getGuidebookFile() throws IOException - { - File folder = new File(IHLMod.proxy.getMinecraftDir(), "config"); - folder.mkdirs(); - File file = new File(folder, "ihl-guidebook.xml"); - if(!file.exists()) - { - InputStream in = IHLMod.class.getResourceAsStream("/assets/ihl/config/ihl-guidebook.xml"); - InputStreamReader isReader = new InputStreamReader(in, "UTF-8"); - LineNumberReader reader = new LineNumberReader(isReader); - OutputStreamWriter osWriter = new OutputStreamWriter(new FileOutputStream(file), "UTF-8"); - BufferedWriter writer = new BufferedWriter(osWriter); - String line; - while ((line = reader.readLine()) != null) - { - writer.append(line); - writer.newLine(); - } - writer.close(); - osWriter.close(); - in = IHLMod.class.getResourceAsStream("/assets/ihl/config/adress.xsd"); - isReader = new InputStreamReader(in, "UTF-8"); - reader = new LineNumberReader(isReader); - file = new File(folder, "adress.xsd"); - osWriter = new OutputStreamWriter(new FileOutputStream(file), "UTF-8"); - writer = new BufferedWriter(osWriter); - while ((line = reader.readLine()) != null) - { - writer.append(line); - writer.newLine(); - } - writer.close(); - osWriter.close(); - } - return file; - } - } diff --git a/ihl/utils/WorldSavedDataBlastWave.java b/ihl/utils/WorldSavedDataBlastWave.java deleted file mode 100644 index 06e1b41..0000000 --- a/ihl/utils/WorldSavedDataBlastWave.java +++ /dev/null @@ -1,92 +0,0 @@ -package ihl.utils; - -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import java.util.Map.Entry; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.world.WorldSavedData; - -public class WorldSavedDataBlastWave extends WorldSavedData { - Map data = new HashMap(256); - public static long memoryUsage=0L; - - public WorldSavedDataBlastWave(String name) - { - super(name); - } - - @Override - public void readFromNBT(NBTTagCompound nbt) - { - if(nbt.hasKey("entryList")) - { - NBTTagList entryList=nbt.getTagList("entryList", 10); - for(int i=0;i> dataESI = data.entrySet().iterator(); - while(dataESI.hasNext()) - { - Entry dataEntry = dataESI.next(); - Long[][] bwArray = dataEntry.getValue(); - NBTTagCompound chunk = new NBTTagCompound(); - NBTTagList blastWaveList = new NBTTagList(); - for(int i1=0;i1<16;i1++) - { - NBTTagCompound blastWave = new NBTTagCompound(); - blastWave.setLong("longNumber", bwArray[i1][0]); - blastWave.setInteger("sourceX", bwArray[i1][1].intValue()); - blastWave.setInteger("sourceY", bwArray[i1][2].intValue()); - blastWave.setInteger("sourceZ", bwArray[i1][3].intValue()); - blastWave.setInteger("power", bwArray[i1][4].intValue()); - blastWaveList.appendTag(blastWave); - } - chunk.setTag("blastWaveList", blastWaveList); - chunk.setLong("chunkHash", dataEntry.getKey()); - entryList.appendTag(chunk); - } - nbt.setTag("entryList", entryList); - } - - public void scheduleExplosionEffectsOnChunkLoad(long chunkXZKey, long longNumber, int sourceX, int sourceY, int sourceZ, int power1, int absEBSY) - { - Long[][] waves; - if(data.containsKey(chunkXZKey)) - { - waves=data.get(chunkXZKey); - } - else - { - waves=new Long[16][5]; - data.put(chunkXZKey, waves); - } - waves[absEBSY][0]=longNumber; - waves[absEBSY][1]=(long)sourceX; - waves[absEBSY][2]=(long)sourceY; - waves[absEBSY][3]=(long)sourceZ; - waves[absEBSY][4]=(long)power1; - } -} diff --git a/ihl/worldgen/IHLWorldGenerator.java b/ihl/worldgen/IHLWorldGenerator.java index 71478b3..7a5c83d 100644 --- a/ihl/worldgen/IHLWorldGenerator.java +++ b/ihl/worldgen/IHLWorldGenerator.java @@ -36,9 +36,9 @@ public class IHLWorldGenerator implements IWorldGenerator { saltwaterGenerator, bischofiteGenerator; private WorldGenMinableMeta currentGenerator; - protected final Map> oreCoordinatesToChunkCoordinates = new HashMap(); - protected final Map blockToOreCoordinates = new HashMap(); - public final Set precalculatedChunkChache = new HashSet(); + protected final Map> oreCoordinatesToChunkCoordinates = new HashMap>(); + protected final Map blockToOreCoordinates = new HashMap(); + public final Set precalculatedChunkChache = new HashSet(); public static IHLWorldGenerator instance; @@ -67,7 +67,6 @@ public class IHLWorldGenerator implements IWorldGenerator { @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { - int x1 = 0,y1 = 0,z1 = 0; for(int ix=-16+chunkX;ix<=16+chunkX;ix++) { for(int iz=-16+chunkZ;iz<=16+chunkZ;iz++) @@ -104,10 +103,7 @@ public class IHLWorldGenerator implements IWorldGenerator { int y0 = oreCoordinate[1]; int z0 = oreCoordinate[2]; long oreCoordinatesKey = (x0<<30)+(y0<<15)+z0; - if(this.blockToOreCoordinates.get(oreCoordinatesKey).generate(world, random, x0, y0, z0)) - { - x1=x0;y1=y0;z1=z0; - } + this.blockToOreCoordinates.get(oreCoordinatesKey).generate(world, random, x0, y0, z0); } } } diff --git a/ihl/worldgen/WorldGenMinableMeta.java b/ihl/worldgen/WorldGenMinableMeta.java index 3c5f094..f80edba 100644 --- a/ihl/worldgen/WorldGenMinableMeta.java +++ b/ihl/worldgen/WorldGenMinableMeta.java @@ -16,7 +16,7 @@ import net.minecraftforge.common.util.ForgeDirection; public class WorldGenMinableMeta extends WorldGenerator { protected final Block mineableBlock; - protected final Set replaceableBlocks=new HashSet(); + protected final Set replaceableBlocks=new HashSet(); protected final Block liquidBedBlock; protected final int mineableBlockMeta; protected final int numberOfBlocks; @@ -54,7 +54,6 @@ public class WorldGenMinableMeta extends WorldGenerator { @Override public boolean generate(World world, Random random, int x, int y, int z) { - boolean success=false; int chunkX = x>>4; int chunkZ = z>>4; int xyz[] = {0,0,1,0,0,-1,0,0}; @@ -68,7 +67,6 @@ public class WorldGenMinableMeta extends WorldGenerator { if(replaceableBlocks.contains(world.getBlock(x0, y0, z0))) { world.setBlock(x0, y0, z0, mineableBlock, mineableBlockMeta, 2); - success=true; } } } @@ -119,7 +117,7 @@ public class WorldGenMinableMeta extends WorldGenerator { } else { - Set oreCoordinatesS = new HashSet(); + Set oreCoordinatesS = new HashSet(); oreCoordinatesS.add(oreCoordinates); this.oreCoordinatesToChunkCoordinates.put(chunkKey, oreCoordinatesS); } diff --git a/ihl/worldgen/ores/BlockOre.java b/ihl/worldgen/ores/BlockOre.java index a88f3b7..4b0c7a7 100644 --- a/ihl/worldgen/ores/BlockOre.java +++ b/ihl/worldgen/ores/BlockOre.java @@ -24,8 +24,8 @@ import net.minecraftforge.oredict.OreDictionary; public class BlockOre extends Block { private Type type; - private static List instances = new ArrayList(); - private static Map iconMap = new HashMap(); + private static List instances = new ArrayList(); + private static Map iconMap = new HashMap(); public BlockOre(Type type1) { diff --git a/ihl/worldgen/ores/DebugScannerContainer.java b/ihl/worldgen/ores/DebugScannerContainer.java index 52d4990..1413ddb 100644 --- a/ihl/worldgen/ores/DebugScannerContainer.java +++ b/ihl/worldgen/ores/DebugScannerContainer.java @@ -5,7 +5,7 @@ import ic2.core.slot.SlotInvSlot; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.Slot; -public class DebugScannerContainer extends ContainerBase { +public class DebugScannerContainer extends ContainerBase { protected DebugScannerTileEntity tileEntity; public int lastFluidAmount = -1; diff --git a/ihl/worldgen/ores/DebugScannerGui.java b/ihl/worldgen/ores/DebugScannerGui.java index 9d379fe..2d79300 100644 --- a/ihl/worldgen/ores/DebugScannerGui.java +++ b/ihl/worldgen/ores/DebugScannerGui.java @@ -24,8 +24,6 @@ public class DebugScannerGui extends GuiContainer { @Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { - int xOffset = (this.width - xSize) / 2; - int yOffset = (this.height - ySize) / 2; List ode = container.tileEntity.oreDictionaryEntries; int verticalOffset = 31; for(int i=0;i oreDictionaryEntries = new ArrayList(); + public List oreDictionaryEntries = new ArrayList(); public DebugScannerTileEntity() { @@ -54,7 +54,7 @@ public class DebugScannerTileEntity extends TileEntityInventory implements IHasG if(this.itemsSlot.get().stackTagCompound!=null) { this.oreDictionaryEntries.add("NBT keys:"); - Iterator iterator = this.itemsSlot.get().stackTagCompound.func_150296_c().iterator(); + Iterator iterator = this.itemsSlot.get().stackTagCompound.func_150296_c().iterator(); while(iterator.hasNext()) { String entry = (String) iterator.next(); @@ -65,7 +65,7 @@ public class DebugScannerTileEntity extends TileEntityInventory implements IHasG if(ct!=null && ct.func_150296_c()!=null && !ct.func_150296_c().isEmpty()) { this.oreDictionaryEntries.add(" -NBT compound tag subkeys:"); - Iterator stIterator = ct.func_150296_c().iterator(); + Iterator stIterator = ct.func_150296_c().iterator(); while(stIterator.hasNext()) { String entry2 = (String) stIterator.next(); @@ -138,7 +138,7 @@ public class DebugScannerTileEntity extends TileEntityInventory implements IHasG } @Override - public ContainerBase getGuiContainer(EntityPlayer entityPlayer) + public ContainerBase getGuiContainer(EntityPlayer entityPlayer) { return new DebugScannerContainer(entityPlayer, this); } diff --git a/ihl/worldgen/ores/IHLFluid.java b/ihl/worldgen/ores/IHLFluid.java index 804a52c..beab11b 100644 --- a/ihl/worldgen/ores/IHLFluid.java +++ b/ihl/worldgen/ores/IHLFluid.java @@ -16,7 +16,6 @@ import net.minecraft.block.Block; import net.minecraft.block.material.MapColor; import net.minecraft.block.material.Material; import net.minecraft.block.material.MaterialLiquid; -import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.item.Item; import net.minecraft.item.ItemBucket; @@ -29,11 +28,11 @@ import net.minecraftforge.fluids.FluidStack; public class IHLFluid extends Fluid { private IHLFluidType type; - private static List fluidInstances = new ArrayList(); - private static Map localFluidRegistry = new HashMap(); - private static Map realDensityMap = new HashMap(); - private static Map condensationMap = new HashMap(); - private static Map> solutionMap = new HashMap(); + private static List fluidInstances = new ArrayList(); + private static Map localFluidRegistry = new HashMap(); + private static Map realDensityMap = new HashMap(); + private static Map condensationMap = new HashMap(); + private static Map> solutionMap = new HashMap>(); public static final int maxGaseousStateVapoursDensity = 40; public IHLFluid(IHLFluidType type1) { @@ -42,8 +41,8 @@ public class IHLFluid extends Fluid this.setTemperature(type.temperature); this.setDensity(Math.round(type.density)); realDensityMap.put(type1.fluidRegistryName, type.density); - this.setGaseous(type.isGaseous); this.setUnlocalizedName(type.fluidRegistryName.replaceFirst("fluid", "")); + this.setGaseous(type.isGaseous); Fluid instance = this; if (!FluidRegistry.registerFluid(instance)) { @@ -53,6 +52,7 @@ public class IHLFluid extends Fluid { instance.setBlock(new IHLFluidBlock(instance, type.blockMaterial, type.textureName, "fluid"+type.fluidName.replaceFirst("fluid", "")).setFlammable(type.flammable).setBlockName("block"+type.fluidName).setCreativeTab(IHLCreativeTab.tab)); } + instance.setGaseous(type.isGaseous); if(type.haveBucket) { Item bucket = new ItemBucket(block).setTextureName(IHLModInfo.MODID+":bucket_"+type.fluidName).setUnlocalizedName("bucket_"+type.fluidName).setCreativeTab(IHLCreativeTab.tab); @@ -151,6 +151,11 @@ public class IHLFluid extends Fluid public enum IHLFluidType { //Methane("Methane","fluidAcetylene",10047, 293, 249, 373, 1150, "methane", Material.water, false, false, false, false), + Ammonia("Ammonia", 10051, 273, 273-78, 273-33, 0.772F, "ammonia", new MaterialLiquid(MapColor.airColor), false, false, true), + Acetaldehyde("Acetaldehyde",10050, 273, 273-123, 294, 784, "acetaldehyde", Material.water, false, false, false), + Formaldehyde("Formaldehyde",10049, 254, 273-118, 254, 815, "formaldehyde", Material.water, false, false, false), + TarWater("TarWater",10048, 293, 176, 338, 1032, "tarwater", Material.water, false, false, false), + Methanol("Methanol",10047, 293, 176, 338, 792, "methanol", Material.water, true, false, false), LithiumChloride("LithiumChlorideDissolvedInWater",10046, 293, 249, 373, 1530, "solution.lithiumchloride", Material.water, false, false, false), CalciumChloride("CalciumChlorideDissolvedInWater",10045, 293, 249, 373, 1630, "solution.calciumchloride", Material.water, false, false, false), ZeolitePulp("ZeolitePulp","fluidPulpZeolite",10044, 293, 249, 373, 1150, "pulp.sodiumzeolite", Material.water, false, false, false), @@ -165,11 +170,11 @@ public class IHLFluid extends Fluid Fuel("Fuel", 10035, 293, 268, 633, 840, "fuel", Material.water, true, false, true), MineralOil("MineralOil", 10034, 293, 238, 704, 845, "mineraloil", Material.water, true, false, true), FuelOil("FuelOil", 10033, 293, 293, 693, 991, "fueloil", Material.water, true, false, true), - Oil("Oil", 10032, 293, 284, 773, 850, "oil", Material.water, true, false, true), + Oil("Oil","fluidOil", 10032, 293, 284, 773, 850f, "oil", Material.water, true, false, true, false), Mercury("Mercury", 10031, 293, 234, 630, 13546), VapourMercury("VapourMercury",10030, 630, 234, 630, 9.229F, "vapour.mercury", new MaterialLiquid(MapColor.cyanColor), false, false, false), Hydrogen("Hydrogen", 10029, 293, 14, 20, 0.046F, "hydrogen", new MaterialLiquid(MapColor.blueColor), true, false, true), - SaltWater("SaltWater", 10028, 293, 253, 373, 1360), + SaltWater("SaltWater","fluidSaltWater", 10028, 293, 253, 373, 1360f,"saltwater", Material.water, true, false, false, false), HydrogenChloride("HydrogenChloride", 10027, 293, 159, 188, 1.477F, "hydrogenchloride", new MaterialLiquid(MapColor.yellowColor), true, false, true), NatriumTungstate("NatriumTungstateDissolvedInWater",10026, 293, 249, 373, 1730, "solution.natriumtungstate", Material.water, true, false, false), Turpentine("Turpentine",10025, 293, 217, 453, 1470, "turpentine", Material.water, true, false, true), @@ -192,7 +197,9 @@ public class IHLFluid extends Fluid NickelSulfateDissolvedInWater("NickelSulfateDissolvedInWater",10009, 293, 253, 373, 1220, "solution.nickelsulfate", Material.water, true, false, false), BlueVitriolDissolvedInWater("BlueVitriolDissolvedInWater",10008, 293, 253, 373, 1180, "solution.bluevitriol", Material.water, true, false, false), MoltenRubberWithSulfur("MoltenRubberWithSulfur",10007, 600, 600, 1000, 1200, "molten.rubber", Material.lava, false, false, true), + MoltenPotassium("MoltenPotassium","fluidMolten",10042, 336, 336, 1047, 856, "molten.potassium", Material.lava, false, false, false, true), MoltenLithium("MoltenLithium","fluidMolten",10042, 454, 454, 1613, 512, "molten.lithium", Material.lava, false, false, false), + MoltenPotassiumChloride("MoltenPotassiumChloride","fluidMolten",10006, 776+273, 776+273, 1407+273, 1556, "molten.potassiumchloride", Material.lava, false, false, false, true), MoltenSodiumChloride("MoltenSodiumChloride","fluidMolten",10006, 1273, 1273, 1740, 1556, "molten.sodiumchloride", Material.lava, false, false, false), MoltenGlass("MoltenGlass","fluidMolten",10048, 600, 600, 1950, 2270, "molten.glass", Material.lava, false, false, false, true), MoltenMagnesium("MoltenMagnesium","fluidMolten",10006, 923, 923, 1623, 1584, "molten.magnesium", Material.lava, false, false, false), @@ -295,7 +302,7 @@ public class IHLFluid extends Fluid float density; boolean isGaseous; boolean flammable=false; - boolean noBlock=false; + boolean noBlock=true; boolean haveBucket; Material blockMaterial = Material.water; int meltingPoint; @@ -306,6 +313,7 @@ public class IHLFluid extends Fluid public final int damage; } + @SuppressWarnings("deprecation") public static FluidStack getCondensationResult(FluidStack condensatedGas) { String fluidname = condensationMap.get(condensatedGas.getFluid().getName()); diff --git a/license.txt b/license.txt new file mode 100644 index 0000000..ecdd832 --- /dev/null +++ b/license.txt @@ -0,0 +1,190 @@ +GNU GENERAL PUBLIC LICENSE + +Version 3, 29 June 2007 + +Copyright � 2007 Free Software Foundation, Inc. + +Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. +Preamble + +The GNU General Public License is a free, copyleft license for software and other kinds of works. + +The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. + +When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. + +To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. + +For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. + +Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. + +For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. + +Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. + +Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. + +The precise terms and conditions for copying, distribution and modification follow. +TERMS AND CONDITIONS +0. Definitions. + +�This License� refers to version 3 of the GNU General Public License. + +�Copyright� also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. + +�The Program� refers to any copyrightable work licensed under this License. Each licensee is addressed as �you�. �Licensees� and �recipients� may be individuals or organizations. + +To �modify� a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a �modified version� of the earlier work or a work �based on� the earlier work. + +A �covered work� means either the unmodified Program or a work based on the Program. + +To �propagate� a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. + +To �convey� a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. + +An interactive user interface displays �Appropriate Legal Notices� to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. +1. Source Code. + +The �source code� for a work means the preferred form of the work for making modifications to it. �Object code� means any non-source form of a work. + +A �Standard Interface� means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. + +The �System Libraries� of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A �Major Component�, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. + +The �Corresponding Source� for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. + +The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. + +The Corresponding Source for a work in source code form is that same work. +2. Basic Permissions. + +All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. + +You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. + +Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. +3. Protecting Users' Legal Rights From Anti-Circumvention Law. + +No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. + +When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. +4. Conveying Verbatim Copies. + +You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. + +You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. +5. Conveying Modified Source Versions. + +You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified it, and giving a relevant date. + b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to �keep intact all notices�. + c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. + d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. + +A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an �aggregate� if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. +6. Conveying Non-Source Forms. + +You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: + + a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. + b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. + c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. + d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. + e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. + +A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. + +A �User Product� is either (1) a �consumer product�, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, �normally used� refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. + +�Installation Information� for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. + +If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). + +The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. + +Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. +7. Additional Terms. + +�Additional permissions� are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. + +When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. + +Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or + b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or + c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or + d) Limiting the use for publicity purposes of names of licensors or authors of the material; or + e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or + f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. + +All other non-permissive additional terms are considered �further restrictions� within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. + +If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. + +Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. +8. Termination. + +You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). + +However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. + +Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. + +Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. +9. Acceptance Not Required for Having Copies. + +You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. +10. Automatic Licensing of Downstream Recipients. + +Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. + +An �entity transaction� is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. + +You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. +11. Patents. + +A �contributor� is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's �contributor version�. + +A contributor's �essential patent claims� are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, �control� includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. + +Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. + +In the following three paragraphs, a �patent license� is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To �grant� such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. + +If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. �Knowingly relying� means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. + +If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. + +A patent license is �discriminatory� if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. + +Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. +12. No Surrender of Others' Freedom. + +If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. +13. Use with the GNU Affero General Public License. + +Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. +14. Revised Versions of this License. + +The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License �or any later version� applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. + +If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. + +Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. +15. Disclaimer of Warranty. + +THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM �AS IS� WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. +16. Limitation of Liability. + +IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. +17. Interpretation of Sections 15 and 16. + +If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. + +END OF TERMS AND CONDITIONS + -- cgit v1.2.3