From 0427ab89f1753a44b30cbc35ce021cbbdc845109 Mon Sep 17 00:00:00 2001 From: Foghrye4 Date: Thu, 10 Aug 2017 18:52:45 +0300 Subject: fix missing source folder --- src/main/java/assets/ihl/config/ihl-recipe.cfg | 89 + src/main/java/assets/ihl/lang/en_US.lang | 584 +++++ src/main/java/assets/ihl/lang/zh_CN.lang | 584 +++++ src/main/java/assets/ihl/sounds.json | 82 + src/main/java/assets/ihl/sounds/electrocution.ogg | Bin 0 -> 5642 bytes src/main/java/assets/ihl/sounds/explosion.ogg | Bin 0 -> 34262 bytes src/main/java/assets/ihl/sounds/fuse.ogg | Bin 0 -> 25668 bytes src/main/java/assets/ihl/sounds/handpumpOne.ogg | Bin 0 -> 6985 bytes .../java/assets/ihl/sounds/lostHeadCry-001.ogg | Bin 0 -> 18140 bytes .../java/assets/ihl/sounds/lostHeadCry-002.ogg | Bin 0 -> 29497 bytes .../java/assets/ihl/sounds/lostHeadCry-003.ogg | Bin 0 -> 28530 bytes .../java/assets/ihl/sounds/lostHeadCry-004.ogg | Bin 0 -> 19197 bytes .../java/assets/ihl/sounds/lostHeadCry-005.ogg | Bin 0 -> 20662 bytes .../java/assets/ihl/sounds/lostHeadCry-006.ogg | Bin 0 -> 31730 bytes .../java/assets/ihl/sounds/lostHeadCry-007.ogg | Bin 0 -> 11296 bytes src/main/java/assets/ihl/sounds/lostHeadCry.ogg | Bin 0 -> 20363 bytes src/main/java/assets/ihl/sounds/lostHeadDeath.ogg | Bin 0 -> 26564 bytes .../java/assets/ihl/sounds/lostHeadLaught-001.ogg | Bin 0 -> 16241 bytes .../java/assets/ihl/sounds/lostHeadLaught-002.ogg | Bin 0 -> 7651 bytes .../java/assets/ihl/sounds/lostHeadLaught-003.ogg | Bin 0 -> 19666 bytes src/main/java/assets/ihl/sounds/lostHeadLaught.ogg | Bin 0 -> 14338 bytes .../java/assets/ihl/sounds/lostHeadLaughtLong.ogg | Bin 0 -> 28661 bytes .../java/assets/ihl/sounds/lostHeadScream-001.ogg | Bin 0 -> 15479 bytes .../java/assets/ihl/sounds/lostHeadScream-002.ogg | Bin 0 -> 20674 bytes .../java/assets/ihl/sounds/lostHeadScream-003.ogg | Bin 0 -> 24577 bytes .../java/assets/ihl/sounds/lostHeadScream-004.ogg | Bin 0 -> 25455 bytes src/main/java/assets/ihl/sounds/lostHeadScream.ogg | Bin 0 -> 15344 bytes .../java/assets/ihl/sounds/spotlightRotating.ogg | Bin 0 -> 8540 bytes src/main/java/assets/ihl/sounds/zap.ogg | Bin 0 -> 7852 bytes .../assets/ihl/textures/blocks/achesonOvenTop.png | Bin 0 -> 994 bytes .../ihl/textures/blocks/batterySwitchUnit.png | Bin 0 -> 1940 bytes .../ihl/textures/blocks/blockRubWoodFront.png | Bin 0 -> 583 bytes .../ihl/textures/blocks/blockRubWoodSide.png | Bin 0 -> 405 bytes .../assets/ihl/textures/blocks/blockRubWoodTop.png | Bin 0 -> 384 bytes .../ihl/textures/blocks/blockSpruceFront.png | Bin 0 -> 609 bytes .../assets/ihl/textures/blocks/boneBlockSide1.png | Bin 0 -> 14081 bytes .../assets/ihl/textures/blocks/boneBlockSide2.png | Bin 0 -> 14012 bytes .../assets/ihl/textures/blocks/boneBlockSide3.png | Bin 0 -> 12636 bytes .../assets/ihl/textures/blocks/boneBlockSide4.png | Bin 0 -> 6319 bytes .../assets/ihl/textures/blocks/boneBlockTop.png | Bin 0 -> 18344 bytes .../assets/ihl/textures/blocks/brickOvenBack.png | Bin 0 -> 368 bytes .../assets/ihl/textures/blocks/brickOvenSide.png | Bin 0 -> 294 bytes .../assets/ihl/textures/blocks/brickOvenTop.png | Bin 0 -> 829 bytes .../assets/ihl/textures/blocks/cannonBronze.png | Bin 0 -> 4588 bytes .../textures/blocks/chemicalReactorOutputSide.png | Bin 0 -> 1280 bytes .../java/assets/ihl/textures/blocks/coiler.png | Bin 0 -> 3258 bytes .../ihl/textures/blocks/cryogenicDistillerBack.png | Bin 0 -> 1267 bytes .../blocks/cryogenicDistillerInputSide.png | Bin 0 -> 1293 bytes .../blocks/cryogenicDistillerNitrogenSide.png | Bin 0 -> 1414 bytes .../blocks/cryogenicDistillerOxygenSide.png | Bin 0 -> 1429 bytes .../textures/blocks/detonationSprayingMachine.png | Bin 0 -> 2369 bytes .../blocks/detonationSprayingMachineIcon.png | Bin 0 -> 3002 bytes .../assets/ihl/textures/blocks/dosingPumpBack.png | Bin 0 -> 870 bytes .../assets/ihl/textures/blocks/dosingPumpFront.png | Bin 0 -> 1009 bytes .../assets/ihl/textures/blocks/dosingPumpLeft.png | Bin 0 -> 747 bytes .../assets/ihl/textures/blocks/dosingPumpRight.png | Bin 0 -> 836 bytes .../assets/ihl/textures/blocks/dosingPumpTop.png | Bin 0 -> 687 bytes .../textures/blocks/electricEvaporatorBottom.png | Bin 0 -> 499 bytes .../textures/blocks/electricEvaporatorFront.png | Bin 0 -> 1285 bytes .../blocks/electricEvaporatorFrontActive.png | Bin 0 -> 1453 bytes .../ihl/textures/blocks/electricEvaporatorSide.png | Bin 0 -> 1247 bytes .../ihl/textures/blocks/electricEvaporatorTop.png | Bin 0 -> 2045 bytes .../ihl/textures/blocks/electrolysisBath.png | Bin 0 -> 5616 bytes .../ihl/textures/blocks/explosiveBlockBottom.png | Bin 0 -> 1013 bytes .../ihl/textures/blocks/explosiveBlockSide.png | Bin 0 -> 1097 bytes .../ihl/textures/blocks/explosiveBlockTop.png | Bin 0 -> 1705 bytes .../java/assets/ihl/textures/blocks/extruder.png | Bin 0 -> 2359 bytes .../textures/blocks/fiberglassSpinneretsBack.png | Bin 0 -> 784 bytes .../textures/blocks/fiberglassSpinneretsFront.png | Bin 0 -> 1043 bytes .../textures/blocks/fiberglassSpinneretsLeft.png | Bin 0 -> 1062 bytes .../textures/blocks/fiberglassSpinneretsRight.png | Bin 0 -> 1147 bytes .../textures/blocks/fiberglassSpinneretsTop.png | Bin 0 -> 739 bytes .../textures/blocks/fluidAcetaldehydeFlowing.png | Bin 0 -> 2857 bytes .../ihl/textures/blocks/fluidAcetaldehydeStill.png | Bin 0 -> 2790 bytes .../ihl/textures/blocks/fluidAcetyleneFlowing.png | Bin 0 -> 1977 bytes .../blocks/fluidAcetyleneFlowing.png.mcmeta | 5 + .../ihl/textures/blocks/fluidAcetyleneStill.png | Bin 0 -> 3047 bytes .../textures/blocks/fluidAcetyleneStill.png.mcmeta | 5 + .../assets/ihl/textures/blocks/fluidAirFlowing.png | Bin 0 -> 74 bytes .../assets/ihl/textures/blocks/fluidAirStill.png | Bin 0 -> 74 bytes .../ihl/textures/blocks/fluidAmmoniaFlowing.png | Bin 0 -> 2914 bytes .../ihl/textures/blocks/fluidAmmoniaStill.png | Bin 0 -> 2790 bytes .../ihl/textures/blocks/fluidAquaRegiaFlowing.png | Bin 0 -> 5651 bytes .../blocks/fluidAquaRegiaFlowing.png.mcmeta | 5 + .../ihl/textures/blocks/fluidAquaRegiaStill.png | Bin 0 -> 6620 bytes .../textures/blocks/fluidAquaRegiaStill.png.mcmeta | 5 + .../fluidBlueVitriolDissolvedInWaterFlowing.png | Bin 0 -> 5470 bytes ...idBlueVitriolDissolvedInWaterFlowing.png.mcmeta | 5 + .../fluidBlueVitriolDissolvedInWaterStill.png | Bin 0 -> 6523 bytes ...luidBlueVitriolDissolvedInWaterStill.png.mcmeta | 5 + .../ihl/textures/blocks/fluidBoricAcidFlowing.png | Bin 0 -> 5417 bytes .../blocks/fluidBoricAcidFlowing.png.mcmeta | 5 + .../ihl/textures/blocks/fluidBoricAcidStill.png | Bin 0 -> 18103 bytes .../textures/blocks/fluidBoricAcidStill.png.mcmeta | 5 + .../blocks/fluidCablingColophonyFlowing.png | Bin 0 -> 7244 bytes .../blocks/fluidCablingColophonyFlowing.png.mcmeta | 5 + .../textures/blocks/fluidCablingColophonyStill.png | Bin 0 -> 5915 bytes .../blocks/fluidCablingColophonyStill.png.mcmeta | 5 + ...fluidCalciumChlorideDissolvedInWaterFlowing.png | Bin 0 -> 2877 bytes .../fluidCalciumChlorideDissolvedInWaterStill.png | Bin 0 -> 2734 bytes .../ihl/textures/blocks/fluidChlorineFlowing.png | Bin 0 -> 3047 bytes .../blocks/fluidChlorineFlowing.png.mcmeta | 5 + .../ihl/textures/blocks/fluidChlorineStill.png | Bin 0 -> 5810 bytes .../textures/blocks/fluidChlorineStill.png.mcmeta | 5 + .../textures/blocks/fluidFormaldehydeFlowing.png | Bin 0 -> 2906 bytes .../ihl/textures/blocks/fluidFormaldehydeStill.png | Bin 0 -> 2790 bytes .../ihl/textures/blocks/fluidFuelFlowing.png | Bin 0 -> 4930 bytes .../textures/blocks/fluidFuelFlowing.png.mcmeta | 5 + .../ihl/textures/blocks/fluidFuelOilFlowing.png | Bin 0 -> 85 bytes .../ihl/textures/blocks/fluidFuelOilStill.png | Bin 0 -> 85 bytes .../assets/ihl/textures/blocks/fluidFuelStill.png | Bin 0 -> 4021 bytes .../ihl/textures/blocks/fluidFuelStill.png.mcmeta | 5 + .../ihl/textures/blocks/fluidGlycerolFlowing.png | Bin 0 -> 4444 bytes .../blocks/fluidGlycerolFlowing.png.mcmeta | 5 + .../ihl/textures/blocks/fluidGlycerolStill.png | Bin 0 -> 5131 bytes .../textures/blocks/fluidGlycerolStill.png.mcmeta | 5 + .../blocks/fluidHydrogenChlorideFlowing.png | Bin 0 -> 56449 bytes .../blocks/fluidHydrogenChlorideFlowing.png.mcmeta | 5 + .../textures/blocks/fluidHydrogenChlorideStill.png | Bin 0 -> 22497 bytes .../blocks/fluidHydrogenChlorideStill.png.mcmeta | 5 + .../ihl/textures/blocks/fluidHydrogenFlowing.png | Bin 0 -> 38989 bytes .../blocks/fluidHydrogenFlowing.png.mcmeta | 5 + .../ihl/textures/blocks/fluidHydrogenStill.png | Bin 0 -> 16261 bytes .../textures/blocks/fluidHydrogenStill.png.mcmeta | 5 + .../ihl/textures/blocks/fluidLimemilkFlowing.png | Bin 0 -> 3725 bytes .../blocks/fluidLimemilkFlowing.png.mcmeta | 5 + .../ihl/textures/blocks/fluidLimemilkStill.png | Bin 0 -> 4698 bytes .../textures/blocks/fluidLimemilkStill.png.mcmeta | 5 + .../textures/blocks/fluidLiquidGlassFlowing.png | Bin 0 -> 4905 bytes .../blocks/fluidLiquidGlassFlowing.png.mcmeta | 5 + .../ihl/textures/blocks/fluidLiquidGlassStill.png | Bin 0 -> 5954 bytes .../blocks/fluidLiquidGlassStill.png.mcmeta | 5 + ...fluidLithiumChlorideDissolvedInWaterFlowing.png | Bin 0 -> 2824 bytes .../fluidLithiumChlorideDissolvedInWaterStill.png | Bin 0 -> 2734 bytes .../ihl/textures/blocks/fluidMercuryFlowing.png | Bin 0 -> 1239 bytes .../textures/blocks/fluidMercuryFlowing.png.mcmeta | 5 + .../ihl/textures/blocks/fluidMercuryStill.png | Bin 0 -> 3903 bytes .../textures/blocks/fluidMercuryStill.png.mcmeta | 5 + .../ihl/textures/blocks/fluidMethanolFlowing.png | Bin 0 -> 2870 bytes .../ihl/textures/blocks/fluidMethanolStill.png | Bin 0 -> 2789 bytes .../ihl/textures/blocks/fluidMineralOilFlowing.png | Bin 0 -> 85 bytes .../ihl/textures/blocks/fluidMineralOilStill.png | Bin 0 -> 85 bytes .../textures/blocks/fluidMoltenBronzeFlowing.png | Bin 0 -> 2862 bytes .../blocks/fluidMoltenBronzeFlowing.png.mcmeta | 5 + .../ihl/textures/blocks/fluidMoltenBronzeStill.png | Bin 0 -> 9704 bytes .../blocks/fluidMoltenBronzeStill.png.mcmeta | 5 + .../ihl/textures/blocks/fluidMoltenFlowing.png | Bin 0 -> 3123 bytes .../textures/blocks/fluidMoltenFlowing.png.mcmeta | 5 + .../ihl/textures/blocks/fluidMoltenGoldFlowing.png | Bin 0 -> 3691 bytes .../blocks/fluidMoltenGoldFlowing.png.mcmeta | 5 + .../ihl/textures/blocks/fluidMoltenGoldStill.png | Bin 0 -> 11184 bytes .../blocks/fluidMoltenGoldStill.png.mcmeta | 5 + .../blocks/fluidMoltenRubberWithSulfurFlowing.png | Bin 0 -> 15053 bytes .../fluidMoltenRubberWithSulfurFlowing.png.mcmeta | 5 + .../blocks/fluidMoltenRubberWithSulfurStill.png | Bin 0 -> 3264 bytes .../fluidMoltenRubberWithSulfurStill.png.mcmeta | 5 + .../ihl/textures/blocks/fluidMoltenStill.png | Bin 0 -> 6637 bytes .../textures/blocks/fluidMoltenStill.png.mcmeta | 5 + ...luidNatriumHydroxideDissolvedInWaterFlowing.png | Bin 0 -> 4203 bytes ...riumHydroxideDissolvedInWaterFlowing.png.mcmeta | 5 + .../fluidNatriumHydroxideDissolvedInWaterStill.png | Bin 0 -> 5019 bytes ...atriumHydroxideDissolvedInWaterStill.png.mcmeta | 5 + ...luidNatriumTungstateDissolvedInWaterFlowing.png | Bin 0 -> 1910 bytes ...riumTungstateDissolvedInWaterFlowing.png.mcmeta | 5 + .../fluidNatriumTungstateDissolvedInWaterStill.png | Bin 0 -> 3397 bytes ...atriumTungstateDissolvedInWaterStill.png.mcmeta | 5 + .../fluidNickelSulfateDissolvedInWaterFlowing.png | Bin 0 -> 5605 bytes ...NickelSulfateDissolvedInWaterFlowing.png.mcmeta | 5 + .../fluidNickelSulfateDissolvedInWaterStill.png | Bin 0 -> 6620 bytes ...idNickelSulfateDissolvedInWaterStill.png.mcmeta | 5 + .../ihl/textures/blocks/fluidNitricAcidFlowing.png | Bin 0 -> 4470 bytes .../blocks/fluidNitricAcidFlowing.png.mcmeta | 5 + .../ihl/textures/blocks/fluidNitricAcidStill.png | Bin 0 -> 5392 bytes .../blocks/fluidNitricAcidStill.png.mcmeta | 5 + .../textures/blocks/fluidNitroGlycerinFlowing.png | Bin 0 -> 2891 bytes .../textures/blocks/fluidNitroGlycerinStill.png | Bin 0 -> 2790 bytes .../ihl/textures/blocks/fluidNitrogenFlowing.png | Bin 0 -> 40831 bytes .../blocks/fluidNitrogenFlowing.png.mcmeta | 5 + .../ihl/textures/blocks/fluidNitrogenStill.png | Bin 0 -> 17127 bytes .../textures/blocks/fluidNitrogenStill.png.mcmeta | 5 + .../assets/ihl/textures/blocks/fluidOilFlowing.png | Bin 0 -> 85 bytes .../assets/ihl/textures/blocks/fluidOilStill.png | Bin 0 -> 85 bytes .../ihl/textures/blocks/fluidOleicAcidFlowing.png | Bin 0 -> 4444 bytes .../blocks/fluidOleicAcidFlowing.png.mcmeta | 5 + .../ihl/textures/blocks/fluidOleicAcidStill.png | Bin 0 -> 5121 bytes .../textures/blocks/fluidOleicAcidStill.png.mcmeta | 5 + .../blocks/fluidOsmiumTetroxideFlowing.png | Bin 0 -> 4869 bytes .../blocks/fluidOsmiumTetroxideFlowing.png.mcmeta | 5 + .../textures/blocks/fluidOsmiumTetroxideStill.png | Bin 0 -> 5771 bytes .../blocks/fluidOsmiumTetroxideStill.png.mcmeta | 5 + .../ihl/textures/blocks/fluidOxygenFlowing.png | Bin 0 -> 40597 bytes .../textures/blocks/fluidOxygenFlowing.png.mcmeta | 5 + .../ihl/textures/blocks/fluidOxygenStill.png | Bin 0 -> 18036 bytes .../textures/blocks/fluidOxygenStill.png.mcmeta | 5 + .../textures/blocks/fluidPulpCelluloseFlowing.png | Bin 0 -> 3256 bytes .../blocks/fluidPulpCelluloseFlowing.png.mcmeta | 5 + .../textures/blocks/fluidPulpCelluloseStill.png | Bin 0 -> 2626 bytes .../blocks/fluidPulpCelluloseStill.png.mcmeta | 5 + .../ihl/textures/blocks/fluidPulpMicaFlowing.png | Bin 0 -> 3256 bytes .../blocks/fluidPulpMicaFlowing.png.mcmeta | 5 + .../ihl/textures/blocks/fluidPulpMicaStill.png | Bin 0 -> 2626 bytes .../textures/blocks/fluidPulpMicaStill.png.mcmeta | 5 + .../textures/blocks/fluidPulpZeoliteFlowing.png | Bin 0 -> 10846 bytes .../blocks/fluidPulpZeoliteFlowing.png.mcmeta | 5 + .../ihl/textures/blocks/fluidPulpZeoliteStill.png | Bin 0 -> 10057 bytes .../blocks/fluidPulpZeoliteStill.png.mcmeta | 5 + .../textures/blocks/fluidRubberTreeSapFlowing.png | Bin 0 -> 2226 bytes .../blocks/fluidRubberTreeSapFlowing.png.mcmeta | 5 + .../textures/blocks/fluidRubberTreeSapStill.png | Bin 0 -> 2633 bytes .../blocks/fluidRubberTreeSapStill.png.mcmeta | 5 + .../ihl/textures/blocks/fluidSaltWaterFlowing.png | Bin 0 -> 4690 bytes .../blocks/fluidSaltWaterFlowing.png.mcmeta | 5 + .../ihl/textures/blocks/fluidSaltWaterStill.png | Bin 0 -> 4941 bytes .../textures/blocks/fluidSaltWaterStill.png.mcmeta | 5 + .../ihl/textures/blocks/fluidSeedOilFlowing.png | Bin 0 -> 4470 bytes .../textures/blocks/fluidSeedOilFlowing.png.mcmeta | 5 + .../ihl/textures/blocks/fluidSeedOilStill.png | Bin 0 -> 4650 bytes .../textures/blocks/fluidSeedOilStill.png.mcmeta | 5 + .../textures/blocks/fluidSodiumPeroxideFlowing.png | Bin 0 -> 15053 bytes .../blocks/fluidSodiumPeroxideFlowing.png.mcmeta | 5 + .../textures/blocks/fluidSodiumPeroxideStill.png | Bin 0 -> 3264 bytes .../blocks/fluidSodiumPeroxideStill.png.mcmeta | 5 + .../textures/blocks/fluidSpruceResinFlowing.png | Bin 0 -> 12272 bytes .../blocks/fluidSpruceResinFlowing.png.mcmeta | 5 + .../ihl/textures/blocks/fluidSpruceResinStill.png | Bin 0 -> 7594 bytes .../blocks/fluidSpruceResinStill.png.mcmeta | 5 + .../textures/blocks/fluidSulfuricAcidFlowing.png | Bin 0 -> 4815 bytes .../blocks/fluidSulfuricAcidFlowing.png.mcmeta | 5 + .../ihl/textures/blocks/fluidSulfuricAcidStill.png | Bin 0 -> 8628 bytes .../blocks/fluidSulfuricAcidStill.png.mcmeta | 5 + .../blocks/fluidSulfuricAnhydrideFlowing.png | Bin 0 -> 44807 bytes .../fluidSulfuricAnhydrideFlowing.png.mcmeta | 5 + .../blocks/fluidSulfuricAnhydrideStill.png | Bin 0 -> 20122 bytes .../blocks/fluidSulfuricAnhydrideStill.png.mcmeta | 5 + .../ihl/textures/blocks/fluidTarWaterFlowing.png | Bin 0 -> 2876 bytes .../ihl/textures/blocks/fluidTarWaterStill.png | Bin 0 -> 2789 bytes .../ihl/textures/blocks/fluidTurpentineFlowing.png | Bin 0 -> 4872 bytes .../blocks/fluidTurpentineFlowing.png.mcmeta | 5 + .../ihl/textures/blocks/fluidTurpentineStill.png | Bin 0 -> 4739 bytes .../blocks/fluidTurpentineStill.png.mcmeta | 5 + .../textures/blocks/fluidVapourMercuryFlowing.png | Bin 0 -> 19861 bytes .../blocks/fluidVapourMercuryFlowing.png.mcmeta | 5 + .../textures/blocks/fluidVapourMercuryStill.png | Bin 0 -> 9951 bytes .../blocks/fluidVapourMercuryStill.png.mcmeta | 5 + .../blocks/fluidVapourSulfuricAcidFlowing.png | Bin 0 -> 56383 bytes .../fluidVapourSulfuricAcidFlowing.png.mcmeta | 5 + .../blocks/fluidVapourSulfuricAcidStill.png | Bin 0 -> 23170 bytes .../blocks/fluidVapourSulfuricAcidStill.png.mcmeta | 5 + .../java/assets/ihl/textures/blocks/frameSteel.png | Bin 0 -> 102 bytes .../ihl/textures/blocks/gasWeldingStation.png | Bin 0 -> 2274 bytes .../assets/ihl/textures/blocks/goldChimneyKnee.png | Bin 0 -> 2266 bytes .../java/assets/ihl/textures/blocks/greenPaint.png | Bin 0 -> 1030 bytes .../ihl/textures/blocks/injectionMoldSide.png | Bin 0 -> 656 bytes .../ihl/textures/blocks/injectionMoldTop.png | Bin 0 -> 719 bytes .../assets/ihl/textures/blocks/ironWorkbench.png | Bin 0 -> 2258 bytes .../ihl/textures/blocks/ironWorkbenchTrumbnail.png | Bin 0 -> 2182 bytes .../assets/ihl/textures/blocks/junctionBox.png | Bin 0 -> 271 bytes .../assets/ihl/textures/blocks/leadOvenTop.png | Bin 0 -> 946 bytes .../java/assets/ihl/textures/blocks/lightBulb.png | Bin 0 -> 1283 bytes .../assets/ihl/textures/blocks/metalShards.png | Bin 0 -> 7894 bytes .../java/assets/ihl/textures/blocks/mirror.png | Bin 0 -> 70 bytes .../assets/ihl/textures/blocks/muffleOvenFront.png | Bin 0 -> 1174 bytes .../java/assets/ihl/textures/blocks/oreApatite.png | Bin 0 -> 343 bytes .../java/assets/ihl/textures/blocks/oreBauxite.png | Bin 0 -> 10080 bytes .../assets/ihl/textures/blocks/oreBischofite.png | Bin 0 -> 9616 bytes .../assets/ihl/textures/blocks/oreChromite.png | Bin 0 -> 3119 bytes .../assets/ihl/textures/blocks/oreCinnabar.png | Bin 0 -> 3083 bytes .../assets/ihl/textures/blocks/oreDatolite.png | Bin 0 -> 735 bytes .../java/assets/ihl/textures/blocks/oreGypsum.png | Bin 0 -> 2199 bytes .../assets/ihl/textures/blocks/oreGyubnera.png | Bin 0 -> 10578 bytes .../assets/ihl/textures/blocks/oreLimestone.png | Bin 0 -> 2419 bytes .../java/assets/ihl/textures/blocks/oreMica.png | Bin 0 -> 2650 bytes .../ihl/textures/blocks/orePotassiumFeldspar.png | Bin 0 -> 2307 bytes .../assets/ihl/textures/blocks/oreRockSalt.png | Bin 0 -> 2594 bytes .../assets/ihl/textures/blocks/oreSaltpeter.png | Bin 0 -> 272 bytes .../assets/ihl/textures/blocks/oreStibnite.png | Bin 0 -> 41684 bytes .../java/assets/ihl/textures/blocks/oreTrona.png | Bin 0 -> 2967 bytes .../ihl/textures/blocks/paperMachineFront.png | Bin 0 -> 757 bytes .../ihl/textures/blocks/pileTextureSpace.png | Bin 0 -> 299 bytes .../assets/ihl/textures/blocks/porcelainBox.png | Bin 0 -> 2720 bytes .../ihl/textures/blocks/porcelainFurnaceFront.png | Bin 0 -> 579 bytes .../ihl/textures/blocks/porcelainFurnaceSide.png | Bin 0 -> 1440 bytes .../ihl/textures/blocks/porcelainFurnaceTop.png | Bin 0 -> 1278 bytes .../java/assets/ihl/textures/blocks/powerPort.png | Bin 0 -> 636 bytes .../java/assets/ihl/textures/blocks/redPaint.png | Bin 0 -> 896 bytes .../ihl/textures/blocks/rubberInsulatedCase.png | Bin 0 -> 503 bytes src/main/java/assets/ihl/textures/blocks/sack.png | Bin 0 -> 8575 bytes .../java/assets/ihl/textures/blocks/sackItem.png | Bin 0 -> 1826 bytes .../ihl/textures/blocks/solarEvaporatorSide.png | Bin 0 -> 627 bytes .../textures/blocks/solidFuelEvaporatorBottom.png | Bin 0 -> 215 bytes .../textures/blocks/solidFuelEvaporatorFront.png | Bin 0 -> 269 bytes .../blocks/solidFuelEvaporatorFrontActive.png | Bin 0 -> 450 bytes .../textures/blocks/solidFuelEvaporatorSide.png | Bin 0 -> 240 bytes .../ihl/textures/blocks/solidFuelEvaporatorTop.png | Bin 0 -> 233 bytes .../ihl/textures/blocks/splitInjectionMold.png | Bin 0 -> 3368 bytes .../java/assets/ihl/textures/blocks/spotlight.png | Bin 0 -> 871 bytes src/main/java/assets/ihl/textures/blocks/steel.png | Bin 0 -> 533 bytes .../java/assets/ihl/textures/blocks/tditBack.png | Bin 0 -> 490 bytes .../java/assets/ihl/textures/blocks/tditBottom.png | Bin 0 -> 315 bytes .../java/assets/ihl/textures/blocks/tditLeft.png | Bin 0 -> 663 bytes .../java/assets/ihl/textures/blocks/tditRight.png | Bin 0 -> 597 bytes .../java/assets/ihl/textures/blocks/tditTop.png | Bin 0 -> 628 bytes .../assets/ihl/textures/blocks/tubBronzeSide.png | Bin 0 -> 475 bytes .../assets/ihl/textures/blocks/tubBronzeTop.png | Bin 0 -> 150 bytes .../ihl/textures/blocks/woodenRollingMachine.png | Bin 0 -> 2771 bytes .../assets/ihl/textures/gui/GUIAchesonFurnace.png | Bin 0 -> 853 bytes .../java/assets/ihl/textures/gui/GUICastingNEI.png | Bin 0 -> 793 bytes .../assets/ihl/textures/gui/GUIChemicalReactor.png | Bin 0 -> 3357 bytes .../assets/ihl/textures/gui/GUIChimneyKneeNEI.png | Bin 0 -> 2418 bytes .../java/assets/ihl/textures/gui/GUICoiler.png | Bin 0 -> 5116 bytes .../assets/ihl/textures/gui/GUICondenserNEI.png | Bin 0 -> 2003 bytes .../java/assets/ihl/textures/gui/GUICrucible.png | Bin 0 -> 6292 bytes .../assets/ihl/textures/gui/GUICrucibleNEI.png | Bin 0 -> 3552 bytes .../ihl/textures/gui/GUICryogenicDistiller.png | Bin 0 -> 2107 bytes .../assets/ihl/textures/gui/GUIDebugScanner.png | Bin 0 -> 1264 bytes .../textures/gui/GUIDetonationSprayingMachine.png | Bin 0 -> 2970 bytes .../java/assets/ihl/textures/gui/GUIDosingPump.png | Bin 0 -> 4440 bytes .../ihl/textures/gui/GUIElectricEvaporator.png | Bin 0 -> 5848 bytes .../ihl/textures/gui/GUIElectrolysisBath.png | Bin 0 -> 5097 bytes .../java/assets/ihl/textures/gui/GUIExtruder.png | Bin 0 -> 917 bytes .../ihl/textures/gui/GUIFluidizedBedReactor.png | Bin 0 -> 5281 bytes .../ihl/textures/gui/GUIFractionationColumn.png | Bin 0 -> 1655 bytes .../textures/gui/GUIGaedesMercuryRotaryPump.png | Bin 0 -> 6204 bytes .../ihl/textures/gui/GUIGasWeldingStation.png | Bin 0 -> 4619 bytes .../assets/ihl/textures/gui/GUIIronWorkbench.png | Bin 0 -> 2641 bytes .../assets/ihl/textures/gui/GUILabElectrolyzer.png | Bin 0 -> 4036 bytes src/main/java/assets/ihl/textures/gui/GUILathe.png | Bin 0 -> 2176 bytes .../java/assets/ihl/textures/gui/GUILeadOven.png | Bin 0 -> 2079 bytes src/main/java/assets/ihl/textures/gui/GUILoom.png | Bin 0 -> 9584 bytes .../assets/ihl/textures/gui/GUIPaperMachine.png | Bin 0 -> 3326 bytes .../assets/ihl/textures/gui/GUIRollingMachine.png | Bin 0 -> 9224 bytes .../assets/ihl/textures/gui/GUISolarEvaporator.png | Bin 0 -> 4608 bytes .../ihl/textures/gui/GUISolidFuelEvaporator.png | Bin 0 -> 5841 bytes src/main/java/assets/ihl/textures/gui/GUITDIT.png | Bin 0 -> 2709 bytes .../java/assets/ihl/textures/gui/GUITubBronze.png | Bin 0 -> 7300 bytes .../gui/GUIVulcanizationExtrudingMoldNEI.png | Bin 0 -> 1570 bytes .../java/assets/ihl/textures/gui/GUIWireMill.png | Bin 0 -> 6708 bytes .../ihl/textures/gui/GUIWoodenRollingMachine.png | Bin 0 -> 9008 bytes .../ihl/textures/items/EightPinDataCable.png | Bin 0 -> 3272 bytes .../java/assets/ihl/textures/items/barD10Gold.png | Bin 0 -> 210 bytes .../java/assets/ihl/textures/items/barD10Steel.png | Bin 0 -> 555 bytes .../assets/ihl/textures/items/barD10SteelHot.png | Bin 0 -> 555 bytes .../ihl/textures/items/batteryCellsEbonite.png | Bin 0 -> 884 bytes .../ihl/textures/items/batteryCellsRawEbonite.png | Bin 0 -> 959 bytes .../assets/ihl/textures/items/blankChiselSteel.png | Bin 0 -> 865 bytes .../ihl/textures/items/blankNeedleFileSteel.png | Bin 0 -> 610 bytes .../ihl/textures/items/blankSetOfFilesSteel.png | Bin 0 -> 168 bytes .../assets/ihl/textures/items/boltM10x1Steel.png | Bin 0 -> 1502 bytes .../assets/ihl/textures/items/breadWithLard.png | Bin 0 -> 3504 bytes .../ihl/textures/items/bucket_SpruceResin.png | Bin 0 -> 303 bytes .../textures/items/bucket_fluidRubberTreeSap.png | Bin 0 -> 608 bytes .../assets/ihl/textures/items/bucket_tarPitch.png | Bin 0 -> 307 bytes .../ihl/textures/items/carvingKnifeBronze.png | Bin 0 -> 3159 bytes .../assets/ihl/textures/items/catalystIron.png | Bin 0 -> 800 bytes .../ihl/textures/items/catalystIronOxide.png | Bin 0 -> 907 bytes .../ihl/textures/items/catalystRawIronOxide.png | Bin 0 -> 469 bytes src/main/java/assets/ihl/textures/items/chisel.png | Bin 0 -> 946 bytes .../java/assets/ihl/textures/items/copperWire.png | Bin 0 -> 1863 bytes .../assets/ihl/textures/items/copperWire16x.png | Bin 0 -> 2354 bytes .../java/assets/ihl/textures/items/crucible.png | Bin 0 -> 949 bytes .../java/assets/ihl/textures/items/crucibleHot.png | Bin 0 -> 841 bytes .../assets/ihl/textures/items/crucibleMixture.png | Bin 0 -> 577 bytes .../assets/ihl/textures/items/crushedBauxite.png | Bin 0 -> 2031 bytes .../assets/ihl/textures/items/crushedChromite.png | Bin 0 -> 1732 bytes .../assets/ihl/textures/items/crushedCinnabar.png | Bin 0 -> 3636 bytes .../assets/ihl/textures/items/crushedGyubnera.png | Bin 0 -> 3467 bytes .../ihl/textures/items/crushedPurifiedBauxite.png | Bin 0 -> 1683 bytes .../ihl/textures/items/crushedPurifiedChromite.png | Bin 0 -> 1444 bytes .../ihl/textures/items/crushedPurifiedCinnabar.png | Bin 0 -> 2333 bytes .../ihl/textures/items/crushedPurifiedGyubnera.png | Bin 0 -> 786 bytes .../ihl/textures/items/crushedPurifiedStibnite.png | Bin 0 -> 2177 bytes .../assets/ihl/textures/items/crushedStibnite.png | Bin 0 -> 1871 bytes ...nationSprayingMachineSetOfMoldedPartsBronze.png | Bin 0 -> 508 bytes .../java/assets/ihl/textures/items/detonator.png | Bin 0 -> 1482 bytes .../assets/ihl/textures/items/diceM10x1Steel.png | Bin 0 -> 1055 bytes .../ihl/textures/items/diceM10x1SteelHardened.png | Bin 0 -> 1739 bytes .../ihl/textures/items/diceM10x1SteelHot.png | Bin 0 -> 1723 bytes .../assets/ihl/textures/items/diceS10x2Steel.png | Bin 0 -> 1314 bytes .../java/assets/ihl/textures/items/drillSteel.png | Bin 0 -> 246 bytes .../ihl/textures/items/drillSteelHardened.png | Bin 0 -> 246 bytes .../assets/ihl/textures/items/drillSteelHot.png | Bin 0 -> 672 bytes .../assets/ihl/textures/items/dustAntimony.png | Bin 0 -> 284 bytes .../ihl/textures/items/dustAntimonyOxide.png | Bin 0 -> 400 bytes .../java/assets/ihl/textures/items/dustBauxite.png | Bin 0 -> 3358 bytes .../assets/ihl/textures/items/dustBischofite.png | Bin 0 -> 471 bytes .../assets/ihl/textures/items/dustBoricAcid.png | Bin 0 -> 607 bytes .../assets/ihl/textures/items/dustBoronCarbide.png | Bin 0 -> 654 bytes .../java/assets/ihl/textures/items/dustBrick.png | Bin 0 -> 293 bytes .../java/assets/ihl/textures/items/dustCalcite.png | Bin 0 -> 831 bytes .../ihl/textures/items/dustCalciumAcetate.png | Bin 0 -> 549 bytes .../ihl/textures/items/dustCalciumCarbide.png | Bin 0 -> 513 bytes .../ihl/textures/items/dustCalciumChloride.png | Bin 0 -> 317 bytes .../ihl/textures/items/dustCalciumTungstate.png | Bin 0 -> 389 bytes .../assets/ihl/textures/items/dustCarborundum.png | Bin 0 -> 293 bytes .../assets/ihl/textures/items/dustChromite.png | Bin 0 -> 508 bytes .../ihl/textures/items/dustCoalElectrodePremix.png | Bin 0 -> 351 bytes .../assets/ihl/textures/items/dustDatolite.png | Bin 0 -> 884 bytes .../ihl/textures/items/dustDehydratedGypsum.png | Bin 0 -> 756 bytes .../java/assets/ihl/textures/items/dustFerrite.png | Bin 0 -> 395 bytes .../assets/ihl/textures/items/dustFerrochrome.png | Bin 0 -> 442 bytes .../java/assets/ihl/textures/items/dustGlass.png | Bin 0 -> 351 bytes .../assets/ihl/textures/items/dustGraphite.png | Bin 0 -> 421 bytes .../java/assets/ihl/textures/items/dustGypsum.png | Bin 0 -> 811 bytes .../java/assets/ihl/textures/items/dustIridium.png | Bin 0 -> 500 bytes .../textures/items/dustIridiumAndSodiumOxide.png | Bin 0 -> 607 bytes .../assets/ihl/textures/items/dustIronOxide.png | Bin 0 -> 705 bytes .../textures/items/dustIronOxideCatalystMix.png | Bin 0 -> 302 bytes .../assets/ihl/textures/items/dustIrongraphite.png | Bin 0 -> 338 bytes .../assets/ihl/textures/items/dustLeadPlumbate.png | Bin 0 -> 465 bytes .../ihl/textures/items/dustLithiumChloride.png | Bin 0 -> 3185 bytes .../assets/ihl/textures/items/dustLithiumOxide.png | Bin 0 -> 319 bytes .../assets/ihl/textures/items/dustMagnesium.png | Bin 0 -> 375 bytes .../ihl/textures/items/dustMagnesiumOxide.png | Bin 0 -> 285 bytes .../ihl/textures/items/dustManganeseOxide.png | Bin 0 -> 713 bytes .../ihl/textures/items/dustMercuryChloride.png | Bin 0 -> 539 bytes .../ihl/textures/items/dustMercuryFulminate.png | Bin 0 -> 566 bytes .../java/assets/ihl/textures/items/dustMica.png | Bin 0 -> 369 bytes .../ihl/textures/items/dustPentaerythritol.png | Bin 0 -> 387 bytes .../items/dustPentaerythritolTetranitrate.png | Bin 0 -> 387 bytes .../ihl/textures/items/dustPlatinumGroupSludge.png | Bin 0 -> 3064 bytes .../assets/ihl/textures/items/dustPorcelain.png | Bin 0 -> 379 bytes .../ihl/textures/items/dustPotassiumFeldspar.png | Bin 0 -> 861 bytes .../ihl/textures/items/dustPotassiumOxide.png | Bin 0 -> 332 bytes .../ihl/textures/items/dustPotassiumSulphate.png | Bin 0 -> 274 bytes .../assets/ihl/textures/items/dustQuicklime.png | Bin 0 -> 848 bytes .../assets/ihl/textures/items/dustRockSalt.png | Bin 0 -> 519 bytes .../java/assets/ihl/textures/items/dustSalt.png | Bin 0 -> 342 bytes .../assets/ihl/textures/items/dustSaltpeter.png | Bin 0 -> 259 bytes .../java/assets/ihl/textures/items/dustSilicon.png | Bin 0 -> 318 bytes .../ihl/textures/items/dustSodiumAluminate.png | Bin 0 -> 2991 bytes .../ihl/textures/items/dustSodiumFormate.png | Bin 0 -> 309 bytes .../textures/items/dustSodiumHydrogenSulfate.png | Bin 0 -> 351 bytes .../ihl/textures/items/dustSodiumHydroxide.png | Bin 0 -> 2970 bytes .../ihl/textures/items/dustSodiumPeroxide.png | Bin 0 -> 627 bytes .../ihl/textures/items/dustSodiumSulfate.png | Bin 0 -> 375 bytes .../ihl/textures/items/dustSodiumSulfide.png | Bin 0 -> 344 bytes .../ihl/textures/items/dustSodiumZeolite.png | Bin 0 -> 3038 bytes .../ihl/textures/items/dustSodiumZeoliteCoked.png | Bin 0 -> 3038 bytes .../ihl/textures/items/dustSolderingAlloy.png | Bin 0 -> 520 bytes .../assets/ihl/textures/items/dustStibnite.png | Bin 0 -> 531 bytes .../assets/ihl/textures/items/dustTinyAntimony.png | Bin 0 -> 141 bytes .../assets/ihl/textures/items/dustTinyGypsum.png | Bin 0 -> 3187 bytes .../ihl/textures/items/dustTinyIronOxide.png | Bin 0 -> 3446 bytes .../ihl/textures/items/dustTinyManganeseOxide.png | Bin 0 -> 2817 bytes .../textures/items/dustTinyPlatinumGroupSludge.png | Bin 0 -> 309 bytes .../assets/ihl/textures/items/dustTinySilicon.png | Bin 0 -> 321 bytes .../ihl/textures/items/dustTinySiliconDioxide.png | Bin 0 -> 2893 bytes .../assets/ihl/textures/items/dustTinyTungsten.png | Bin 0 -> 3273 bytes .../java/assets/ihl/textures/items/dustTrona.png | Bin 0 -> 942 bytes .../assets/ihl/textures/items/dustTungsten.png | Bin 0 -> 938 bytes .../ihl/textures/items/dustTungstenOxide.png | Bin 0 -> 282 bytes .../assets/ihl/textures/items/dustTungsticAcid.png | Bin 0 -> 494 bytes .../java/assets/ihl/textures/items/dustWood.png | Bin 0 -> 513 bytes .../ihl/textures/items/electricMotorLVLEDC.png | Bin 0 -> 1205 bytes .../textures/items/electrolysisBathPorcelain.png | Bin 0 -> 819 bytes .../items/electrolysisBathRawPorcelain.png | Bin 0 -> 603 bytes .../items/extruderSetOfMoldedPartsSteel.png | Bin 0 -> 1510 bytes src/main/java/assets/ihl/textures/items/fabric.png | Bin 0 -> 378 bytes .../java/assets/ihl/textures/items/fiberGlass.png | Bin 0 -> 1833 bytes .../ihl/textures/items/fiberGlassDieSteel.png | Bin 0 -> 1364 bytes .../items/flexibleCableCopperVulcanizedRubber2.png | Bin 0 -> 399 bytes .../ihl/textures/items/flexibleCableSteel2.png | Bin 0 -> 401 bytes .../java/assets/ihl/textures/items/foilCopper.png | Bin 0 -> 1970 bytes .../java/assets/ihl/textures/items/foilGold.png | Bin 0 -> 1571 bytes .../java/assets/ihl/textures/items/foilLead.png | Bin 0 -> 1642 bytes .../java/assets/ihl/textures/items/foilMica.png | Bin 0 -> 2829 bytes .../java/assets/ihl/textures/items/foilRubber.png | Bin 0 -> 1326 bytes .../ihl/textures/items/foilRubberWithSulfur.png | Bin 0 -> 651 bytes .../java/assets/ihl/textures/items/foilSteel.png | Bin 0 -> 1591 bytes .../assets/ihl/textures/items/foilTungsten.png | Bin 0 -> 702 bytes .../textures/items/gaedesPumpBarrelPorcelain.png | Bin 0 -> 1128 bytes .../items/gaedesPumpBarrelRawPorcelain.png | Bin 0 -> 913 bytes .../java/assets/ihl/textures/items/gasJetSteel.png | Bin 0 -> 679 bytes .../assets/ihl/textures/items/gasReducerSteel.png | Bin 0 -> 217 bytes .../java/assets/ihl/textures/items/gemApatite.png | Bin 0 -> 366 bytes .../ihl/textures/items/glassBlowingTubeSteel.png | Bin 0 -> 1428 bytes .../java/assets/ihl/textures/items/graverSteel.png | Bin 0 -> 337 bytes .../ihl/textures/items/graverSteelHardened.png | Bin 0 -> 539 bytes .../assets/ihl/textures/items/graverSteelHot.png | Bin 0 -> 633 bytes .../java/assets/ihl/textures/items/grindstone.png | Bin 0 -> 1743 bytes src/main/java/assets/ihl/textures/items/gu-81m.png | Bin 0 -> 1391 bytes .../java/assets/ihl/textures/items/guidebook.png | Bin 0 -> 1159 bytes .../assets/ihl/textures/items/hackSawSteel.png | Bin 0 -> 340 bytes .../java/assets/ihl/textures/items/hallSensor.png | Bin 0 -> 442 bytes src/main/java/assets/ihl/textures/items/hammer.png | Bin 0 -> 3293 bytes .../assets/ihl/textures/items/hammerBronze.png | Bin 0 -> 1283 bytes .../assets/ihl/textures/items/handDrillBronze.png | Bin 0 -> 887 bytes .../items/handDrillSetOfMoldedPartsBronze.png | Bin 0 -> 781 bytes .../ihl/textures/items/highPressureVesselSteel.png | Bin 0 -> 1467 bytes .../ihl/textures/items/highVoltageCapacitor.png | Bin 0 -> 1466 bytes .../java/assets/ihl/textures/items/ignitron.png | Bin 0 -> 1759 bytes .../assets/ihl/textures/items/incisorSteel.png | Bin 0 -> 750 bytes .../textures/items/incisorSteelDiamondCoated.png | Bin 0 -> 1090 bytes .../assets/ihl/textures/items/ingotCalciumSoap.png | Bin 0 -> 1794 bytes .../assets/ihl/textures/items/ingotHotSteel.png | Bin 0 -> 536 bytes .../assets/ihl/textures/items/ingotHotTungsten.png | Bin 0 -> 525 bytes .../assets/ihl/textures/items/ingotLithium.png | Bin 0 -> 3401 bytes .../assets/ihl/textures/items/ingotMagnesium.png | Bin 0 -> 480 bytes .../assets/ihl/textures/items/ingotPotassium.png | Bin 0 -> 337 bytes .../assets/ihl/textures/items/ingotStearin.png | Bin 0 -> 944 bytes .../assets/ihl/textures/items/ingotTarPitch.png | Bin 0 -> 434 bytes .../assets/ihl/textures/items/ingotTungsten.png | Bin 0 -> 392 bytes .../ihl/textures/items/insulatorPorcelain.png | Bin 0 -> 309 bytes .../ihl/textures/items/insulatorRawPorcelain.png | Bin 0 -> 396 bytes .../items/itemAdvancedElectricHandpump.png | Bin 0 -> 1204 bytes .../ihl/textures/items/itemCellAcetylene.png | Bin 0 -> 249 bytes .../assets/ihl/textures/items/itemCellAmmonia.png | Bin 0 -> 331 bytes .../ihl/textures/items/itemCellAquaRegia.png | Bin 0 -> 277 bytes .../items/itemCellBlueVitriolDissolvedInWater.png | Bin 0 -> 278 bytes .../textures/items/itemCellCablingColophony.png | Bin 0 -> 240 bytes .../assets/ihl/textures/items/itemCellChlorine.png | Bin 0 -> 274 bytes .../assets/ihl/textures/items/itemCellFuel.png | Bin 0 -> 278 bytes .../assets/ihl/textures/items/itemCellFuelOil.png | Bin 0 -> 274 bytes .../assets/ihl/textures/items/itemCellGlycerol.png | Bin 0 -> 283 bytes .../assets/ihl/textures/items/itemCellHydrogen.png | Bin 0 -> 275 bytes .../textures/items/itemCellHydrogenChloride.png | Bin 0 -> 298 bytes .../assets/ihl/textures/items/itemCellLimemilk.png | Bin 0 -> 203 bytes .../ihl/textures/items/itemCellLiquidGlass.png | Bin 0 -> 262 bytes .../assets/ihl/textures/items/itemCellMercury.png | Bin 0 -> 183 bytes .../assets/ihl/textures/items/itemCellMethanol.png | Bin 0 -> 320 bytes .../ihl/textures/items/itemCellMineralOil.png | Bin 0 -> 265 bytes .../ihl/textures/items/itemCellMoltenBronze.png | Bin 0 -> 327 bytes .../ihl/textures/items/itemCellMoltenSteel.png | Bin 0 -> 315 bytes .../itemCellNatriumHydroxideDissolvedInWater.png | Bin 0 -> 256 bytes .../itemCellNatriumTungstateDissolvedInWater.png | Bin 0 -> 261 bytes .../itemCellNickelSulfateDissolvedInWater.png | Bin 0 -> 280 bytes .../ihl/textures/items/itemCellNitricAcid.png | Bin 0 -> 277 bytes .../ihl/textures/items/itemCellNitroGlycerin.png | Bin 0 -> 2875 bytes .../assets/ihl/textures/items/itemCellNitrogen.png | Bin 0 -> 274 bytes .../java/assets/ihl/textures/items/itemCellOil.png | Bin 0 -> 195 bytes .../ihl/textures/items/itemCellOleicAcid.png | Bin 0 -> 251 bytes .../ihl/textures/items/itemCellOsmiumTetroxide.png | Bin 0 -> 263 bytes .../assets/ihl/textures/items/itemCellOxygen.png | Bin 0 -> 258 bytes .../ihl/textures/items/itemCellSaltWater.png | Bin 0 -> 294 bytes .../assets/ihl/textures/items/itemCellSeedOil.png | Bin 0 -> 282 bytes .../items/itemCellSiliconTetrachloride.png | Bin 0 -> 293 bytes .../ihl/textures/items/itemCellSodiumPeroxide.png | Bin 0 -> 268 bytes .../ihl/textures/items/itemCellSpruceResin.png | Bin 0 -> 285 bytes .../ihl/textures/items/itemCellSulfuricAcid.png | Bin 0 -> 433 bytes .../textures/items/itemCellSulfuricAnhydride.png | Bin 0 -> 257 bytes .../ihl/textures/items/itemCellTrichlorosilane.png | Bin 0 -> 291 bytes .../ihl/textures/items/itemCellTurpentine.png | Bin 0 -> 264 bytes .../textures/items/itemCellVapourSulfuricAcid.png | Bin 0 -> 278 bytes .../textures/items/itemCellfluidRubberTreeSap.png | Bin 0 -> 250 bytes .../ihl/textures/items/itemElectricHandpump.png | Bin 0 -> 1658 bytes .../java/assets/ihl/textures/items/itemTDITFT.png | Bin 0 -> 269 bytes .../assets/ihl/textures/items/itemTDITFT_1.png | Bin 0 -> 282 bytes .../ihl/textures/items/lampHolderPorcelain.png | Bin 0 -> 2186 bytes .../ihl/textures/items/lampHolderRawPorcelain.png | Bin 0 -> 1250 bytes .../textures/items/latheSetOfMoldedPartsSteel.png | Bin 0 -> 1824 bytes .../assets/ihl/textures/items/leadAcidBattery.png | Bin 0 -> 835 bytes .../ihl/textures/items/linerIronGraphite.png | Bin 0 -> 1387 bytes .../textures/items/linerIronGraphiteGreased.png | Bin 0 -> 548 bytes .../ihl/textures/items/linerIronGraphiteHot.png | Bin 0 -> 2115 bytes .../items/machineCasingSetOfPartsSteel.png | Bin 0 -> 2961 bytes .../ihl/textures/items/mercuryThermometer.png | Bin 0 -> 3020 bytes .../java/assets/ihl/textures/items/meshGlass.png | Bin 0 -> 613 bytes .../java/assets/ihl/textures/items/mixerSteel.png | Bin 0 -> 273 bytes .../java/assets/ihl/textures/items/muttonLard.png | Bin 0 -> 1423 bytes .../java/assets/ihl/textures/items/nailSteel.png | Bin 0 -> 284 bytes .../java/assets/ihl/textures/items/needleFile.png | Bin 0 -> 636 bytes .../assets/ihl/textures/items/nuggetTarPitch.png | Bin 0 -> 162 bytes .../assets/ihl/textures/items/nutM10x1Steel.png | Bin 0 -> 281 bytes .../assets/ihl/textures/items/ovenRawPorcelain.png | Bin 0 -> 1234 bytes src/main/java/assets/ihl/textures/items/pencil.png | Bin 0 -> 1127 bytes .../ihl/textures/items/pipeRubberWithSulfur.png | Bin 0 -> 1021 bytes .../ihl/textures/items/pipeVulcanizedRubber.png | Bin 0 -> 1004 bytes .../textures/items/pipelineAccessoriesSteel.png | Bin 0 -> 443 bytes .../ihl/textures/items/pistonCylinderSteel.png | Bin 0 -> 604 bytes .../java/assets/ihl/textures/items/plateCoal.png | Bin 0 -> 420 bytes .../assets/ihl/textures/items/plateGraphite.png | Bin 0 -> 257 bytes .../assets/ihl/textures/items/plateHotSteel.png | Bin 0 -> 375 bytes .../assets/ihl/textures/items/plateHotTungsten.png | Bin 0 -> 344 bytes .../java/assets/ihl/textures/items/plateMica.png | Bin 0 -> 773 bytes .../textures/items/plateNonVulcanizedRubber.png | Bin 0 -> 381 bytes .../assets/ihl/textures/items/plateRawCoal.png | Bin 0 -> 3189 bytes .../assets/ihl/textures/items/plateTungsten.png | Bin 0 -> 194 bytes .../ihl/textures/items/polishingPucksSteel.png | Bin 0 -> 2153 bytes .../java/assets/ihl/textures/items/ringFerrite.png | Bin 0 -> 369 bytes .../assets/ihl/textures/items/ringPorcelain.png | Bin 0 -> 1648 bytes .../assets/ihl/textures/items/ringRawFerrite.png | Bin 0 -> 375 bytes .../assets/ihl/textures/items/ringRawPorcelain.png | Bin 0 -> 1581 bytes .../items/rollingMachineSetOfMoldedPartsSteel.png | Bin 0 -> 1699 bytes .../assets/ihl/textures/items/sawBladeSteel.png | Bin 0 -> 538 bytes .../ihl/textures/items/sawBladeSteelHardened.png | Bin 0 -> 799 bytes .../assets/ihl/textures/items/sawBladeSteelHot.png | Bin 0 -> 777 bytes .../assets/ihl/textures/items/setOfDies1_5sqmm.png | Bin 0 -> 948 bytes .../assets/ihl/textures/items/setOfDies24sqmm.png | Bin 0 -> 1042 bytes .../assets/ihl/textures/items/setOfFilesSteel.png | Bin 0 -> 176 bytes .../items/setOfPartsForLVElemotorSteel.png | Bin 0 -> 857 bytes .../textures/items/setOfPartsGasReducerSteel.png | Bin 0 -> 344 bytes .../java/assets/ihl/textures/items/shaftSteel.png | Bin 0 -> 407 bytes .../textures/items/sharpenedCarvingKnifeBronze.png | Bin 0 -> 3159 bytes src/main/java/assets/ihl/textures/items/skull.png | Bin 0 -> 74239 bytes .../ihl/textures/items/smallRoundPolishedSteel.png | Bin 0 -> 1588 bytes .../assets/ihl/textures/items/smallRoundSteel.png | Bin 0 -> 1572 bytes .../java/assets/ihl/textures/items/springSteel.png | Bin 0 -> 603 bytes .../java/assets/ihl/textures/items/steelWire.png | Bin 0 -> 1429 bytes .../assets/ihl/textures/items/steelWire16x.png | Bin 0 -> 2110 bytes .../ihl/textures/items/stickBoronCarbide.png | Bin 0 -> 804 bytes .../java/assets/ihl/textures/items/stickCoal.png | Bin 0 -> 641 bytes .../textures/items/stickCoalElectrodePremix.png | Bin 0 -> 646 bytes .../assets/ihl/textures/items/stickGraphite.png | Bin 0 -> 609 bytes .../java/assets/ihl/textures/items/stickSteel.png | Bin 0 -> 268 bytes .../assets/ihl/textures/items/tapM10x1Steel.png | Bin 0 -> 193 bytes .../ihl/textures/items/tapM10x1SteelHardened.png | Bin 0 -> 264 bytes .../assets/ihl/textures/items/tapM10x1SteelHot.png | Bin 0 -> 593 bytes .../assets/ihl/textures/items/tapS10x2Steel.png | Bin 0 -> 454 bytes .../assets/ihl/textures/items/tinSnipsSteel.png | Bin 0 -> 681 bytes .../textures/items/toolHeadHammerSmallSteel.png | Bin 0 -> 226 bytes .../ihl/textures/items/toolTinSnipsPartsSteel.png | Bin 0 -> 425 bytes .../turboCompressorSetOfMoldedPartsBronze.png | Bin 0 -> 3777 bytes .../assets/ihl/textures/items/vacuumSwitch.png | Bin 0 -> 1107 bytes .../assets/ihl/textures/items/valveTube1C21P.png | Bin 0 -> 1521 bytes .../textures/items/viseSetOfMoldedPartsSteel.png | Bin 0 -> 700 bytes .../java/assets/ihl/textures/items/viseSteel.png | Bin 0 -> 580 bytes .../java/assets/ihl/textures/particles/blast.png | Bin 0 -> 26113 bytes .../java/assets/ihl/textures/particles/blob.png | Bin 0 -> 519 bytes .../assets/ihl/textures/particles/blobOfResin.png | Bin 0 -> 242 bytes .../assets/ihl/textures/particles/explosion.png | Bin 0 -> 357813 bytes .../assets/ihl/textures/particles/flameTongue.png | Bin 0 -> 4210 bytes src/main/java/gregtech/api/GregTech_API.java | 577 +++++ .../api/damagesources/GT_DamageSources.java | 90 + .../java/gregtech/api/enums/ConfigCategories.java | 64 + src/main/java/gregtech/api/enums/Dyes.java | 104 + src/main/java/gregtech/api/enums/Element.java | 311 +++ src/main/java/gregtech/api/enums/GT_Values.java | 159 ++ src/main/java/gregtech/api/enums/ItemList.java | 783 +++++++ src/main/java/gregtech/api/enums/Materials.java | 1673 ++++++++++++++ src/main/java/gregtech/api/enums/OreDictNames.java | 78 + src/main/java/gregtech/api/enums/OrePrefixes.java | 801 +++++++ src/main/java/gregtech/api/enums/SubTag.java | 306 +++ src/main/java/gregtech/api/enums/TC_Aspects.java | 102 + src/main/java/gregtech/api/enums/TextureSet.java | 184 ++ src/main/java/gregtech/api/enums/Textures.java | 454 ++++ src/main/java/gregtech/api/enums/Tier.java | 91 + .../java/gregtech/api/enums/ToolDictNames.java | 32 + .../gregtech/api/events/BlockScanningEvent.java | 41 + src/main/java/gregtech/api/gui/GT_Container.java | 562 +++++ .../api/gui/GT_ContainerMetaTile_Machine.java | 151 ++ .../java/gregtech/api/gui/GT_Container_1by1.java | 27 + .../java/gregtech/api/gui/GT_Container_2by2.java | 30 + .../java/gregtech/api/gui/GT_Container_3by3.java | 35 + .../java/gregtech/api/gui/GT_Container_4by4.java | 42 + .../api/gui/GT_Container_BasicMachine.java | 248 +++ .../gregtech/api/gui/GT_Container_BasicTank.java | 68 + .../api/gui/GT_Container_MaintenanceHatch.java | 30 + .../api/gui/GT_Container_MultiMachine.java | 35 + .../java/gregtech/api/gui/GT_GUIContainer.java | 67 + .../api/gui/GT_GUIContainerMetaTile_Machine.java | 39 + .../gregtech/api/gui/GT_GUIContainer_1by1.java | 29 + .../gregtech/api/gui/GT_GUIContainer_2by2.java | 29 + .../gregtech/api/gui/GT_GUIContainer_3by3.java | 29 + .../gregtech/api/gui/GT_GUIContainer_4by4.java | 29 + .../api/gui/GT_GUIContainer_BasicMachine.java | 64 + .../api/gui/GT_GUIContainer_BasicTank.java | 36 + .../api/gui/GT_GUIContainer_MaintenanceHatch.java | 27 + .../api/gui/GT_GUIContainer_MultiMachine.java | 56 + src/main/java/gregtech/api/gui/GT_Slot_Armor.java | 27 + .../java/gregtech/api/gui/GT_Slot_DataOrb.java | 17 + src/main/java/gregtech/api/gui/GT_Slot_Holo.java | 46 + src/main/java/gregtech/api/gui/GT_Slot_Output.java | 16 + src/main/java/gregtech/api/gui/GT_Slot_Render.java | 22 + .../api/interfaces/IColorModulationContainer.java | 5 + .../java/gregtech/api/interfaces/ICondition.java | 104 + .../gregtech/api/interfaces/IDamagableItem.java | 7 + .../gregtech/api/interfaces/IDebugableBlock.java | 26 + .../java/gregtech/api/interfaces/IDescribable.java | 11 + .../java/gregtech/api/interfaces/IFoodStat.java | 21 + .../gregtech/api/interfaces/IIconContainer.java | 21 + .../gregtech/api/interfaces/IItemBehaviour.java | 29 + .../gregtech/api/interfaces/IItemContainer.java | 24 + .../api/interfaces/IOreRecipeRegistrator.java | 15 + .../gregtech/api/interfaces/IProjectileItem.java | 16 + .../api/interfaces/IRedstoneCircuitBlock.java | 66 + .../gregtech/api/interfaces/ISubTagContainer.java | 20 + .../java/gregtech/api/interfaces/ITexture.java | 15 + .../java/gregtech/api/interfaces/IToolStats.java | 146 ++ .../api/interfaces/internal/IBCTileEntity.java | 8 + .../interfaces/internal/IGT_CraftingRecipe.java | 7 + .../gregtech/api/interfaces/internal/IGT_Mod.java | 34 + .../api/interfaces/internal/IGT_RecipeAdder.java | 411 ++++ .../api/interfaces/internal/IIC2TileEntity.java | 13 + .../api/interfaces/internal/IThaumcraftCompat.java | 40 + .../api/interfaces/internal/IUETileEntity.java | 6 + .../interfaces/metatileentity/IMetaTileEntity.java | 382 ++++ .../metatileentity/IMetaTileEntityCable.java | 9 + .../metatileentity/IMetaTileEntityItemPipe.java | 96 + .../tileentity/IBasicEnergyContainer.java | 99 + .../interfaces/tileentity/IColoredTileEntity.java | 14 + .../api/interfaces/tileentity/ICoverable.java | 35 + .../api/interfaces/tileentity/IDigitalChest.java | 29 + .../interfaces/tileentity/IEnergyConductor.java | 40 + .../interfaces/tileentity/IEnergyConnected.java | 69 + .../tileentity/IExperimentalEnergyTileEntity.java | 79 + .../api/interfaces/tileentity/IFibreConnected.java | 31 + .../tileentity/IGearEnergyTileEntity.java | 16 + .../tileentity/IGregTechDeviceInformation.java | 20 + .../interfaces/tileentity/IGregTechTileEntity.java | 123 ++ .../api/interfaces/tileentity/IHasInventory.java | 33 + .../tileentity/IHasWorldObjectAndCoords.java | 132 ++ .../tileentity/IMachineBlockUpdateable.java | 16 + .../interfaces/tileentity/IMachineProgress.java | 69 + .../tileentity/IPipeRenderedTileEntity.java | 9 + .../interfaces/tileentity/IRedstoneEmitter.java | 37 + .../interfaces/tileentity/IRedstoneReceiver.java | 29 + .../interfaces/tileentity/IRedstoneTileEntity.java | 17 + .../interfaces/tileentity/ITexturedTileEntity.java | 10 + .../api/interfaces/tileentity/ITurnable.java | 33 + .../interfaces/tileentity/IUpgradableMachine.java | 42 + .../gregtech/api/items/GT_CoolantCellIC_Item.java | 75 + .../gregtech/api/items/GT_CoolantCell_Item.java | 59 + .../gregtech/api/items/GT_EnergyArmor_Item.java | 323 +++ .../java/gregtech/api/items/GT_Generic_Block.java | 20 + .../java/gregtech/api/items/GT_Generic_Item.java | 142 ++ .../java/gregtech/api/items/GT_MetaBase_Item.java | 555 +++++ .../gregtech/api/items/GT_MetaGenerated_Item.java | 326 +++ .../api/items/GT_MetaGenerated_Item_X01.java | 159 ++ .../api/items/GT_MetaGenerated_Item_X32.java | 169 ++ .../gregtech/api/items/GT_MetaGenerated_Tool.java | 499 +++++ .../api/items/GT_RadioactiveCellIC_Item.java | 177 ++ .../api/items/GT_RadioactiveCell_Item.java | 162 ++ .../gregtech/api/items/GT_SolderingTool_Item.java | 40 + .../java/gregtech/api/items/GT_Spray_Bug_Item.java | 66 + .../gregtech/api/items/GT_Spray_Foam_Item.java | 161 ++ .../gregtech/api/items/GT_Spray_Hardener_Item.java | 71 + .../api/items/GT_Spray_Hydration_Item.java | 53 + .../java/gregtech/api/items/GT_Spray_Ice_Item.java | 81 + .../gregtech/api/items/GT_Spray_Pepper_Item.java | 51 + src/main/java/gregtech/api/items/GT_Tool_Item.java | 25 + .../api/metatileentity/BaseMetaPipeEntity.java | 1020 +++++++++ .../api/metatileentity/BaseMetaTileEntity.java | 1352 ++++++++++++ .../api/metatileentity/BaseMetaTileEntityUE.java | 98 + .../api/metatileentity/BaseTileEntity.java | 228 ++ .../api/metatileentity/MetaPipeEntity.java | 534 +++++ .../api/metatileentity/MetaTileEntity.java | 721 ++++++ .../examples/GT_MetaTileEntity_E_Furnace.java | 56 + .../implementations/GT_MetaPipeEntity_Cable.java | 229 ++ .../implementations/GT_MetaPipeEntity_Fluid.java | 343 +++ .../implementations/GT_MetaPipeEntity_Frame.java | 64 + .../implementations/GT_MetaPipeEntity_Item.java | 271 +++ .../GT_MetaTileEntity_BasicBatteryBuffer.java | 151 ++ .../GT_MetaTileEntity_BasicGenerator.java | 167 ++ .../GT_MetaTileEntity_BasicHull.java | 100 + .../GT_MetaTileEntity_BasicHull_NonElectric.java | 32 + .../GT_MetaTileEntity_BasicMachine.java | 596 +++++ .../GT_MetaTileEntity_BasicMachine_Bronze.java | 187 ++ .../GT_MetaTileEntity_BasicMachine_GT_Recipe.java | 323 +++ .../GT_MetaTileEntity_BasicMachine_Steel.java | 103 + .../GT_MetaTileEntity_BasicTank.java | 206 ++ .../implementations/GT_MetaTileEntity_Buffer.java | 173 ++ .../implementations/GT_MetaTileEntity_Hatch.java | 84 + .../GT_MetaTileEntity_Hatch_Dynamo.java | 55 + .../GT_MetaTileEntity_Hatch_Energy.java | 56 + .../GT_MetaTileEntity_Hatch_Input.java | 86 + .../GT_MetaTileEntity_Hatch_InputBus.java | 108 + .../GT_MetaTileEntity_Hatch_Maintenance.java | 106 + .../GT_MetaTileEntity_Hatch_Muffler.java | 58 + .../GT_MetaTileEntity_Hatch_Output.java | 141 ++ .../GT_MetaTileEntity_Hatch_OutputBus.java | 86 + .../GT_MetaTileEntity_MultiBlockBase.java | 645 ++++++ .../GT_MetaTileEntity_TieredMachineBlock.java | 66 + .../GT_MetaTileEntity_Transformer.java | 112 + src/main/java/gregtech/api/net/GT_Packet.java | 29 + .../gregtech/api/net/GT_Packet_Block_Event.java | 59 + .../java/gregtech/api/net/GT_Packet_Sound.java | 56 + .../gregtech/api/net/GT_Packet_TileEntity.java | 83 + .../java/gregtech/api/net/IGT_NetworkHandler.java | 12 + .../java/gregtech/api/objects/ElementStack.java | 41 + .../java/gregtech/api/objects/GT_ArrayList.java | 59 + .../api/objects/GT_CopiedBlockTexture.java | 96 + .../gregtech/api/objects/GT_Cover_Default.java | 68 + .../java/gregtech/api/objects/GT_Cover_None.java | 89 + src/main/java/gregtech/api/objects/GT_Fluid.java | 29 + .../java/gregtech/api/objects/GT_FluidStack.java | 54 + src/main/java/gregtech/api/objects/GT_HashSet.java | 84 + .../java/gregtech/api/objects/GT_ItemStack.java | 52 + .../java/gregtech/api/objects/GT_MultiTexture.java | 53 + .../gregtech/api/objects/GT_RenderedTexture.java | 140 ++ .../java/gregtech/api/objects/GT_SidedTexture.java | 169 ++ src/main/java/gregtech/api/objects/ItemData.java | 119 + .../java/gregtech/api/objects/MaterialStack.java | 41 + .../threads/GT_Runnable_MachineBlockUpdate.java | 37 + .../gregtech/api/threads/GT_Runnable_Sound.java | 26 + src/main/java/gregtech/api/util/GT_BaseCrop.java | 129 ++ .../gregtech/api/util/GT_CircuitryBehavior.java | 178 ++ src/main/java/gregtech/api/util/GT_Config.java | 83 + .../java/gregtech/api/util/GT_CoverBehavior.java | 218 ++ .../java/gregtech/api/util/GT_CreativeTab.java | 24 + src/main/java/gregtech/api/util/GT_FoodStat.java | 103 + .../java/gregtech/api/util/GT_IBoxableWrapper.java | 13 + .../api/util/GT_ItsNotMyFaultException.java | 16 + .../java/gregtech/api/util/GT_LanguageManager.java | 95 + src/main/java/gregtech/api/util/GT_Log.java | 35 + src/main/java/gregtech/api/util/GT_ModHandler.java | 1729 +++++++++++++++ .../gregtech/api/util/GT_OreDictUnificator.java | 332 +++ .../java/gregtech/api/util/GT_PlayedSound.java | 28 + src/main/java/gregtech/api/util/GT_Recipe.java | 1045 +++++++++ .../gregtech/api/util/GT_RecipeRegistrator.java | 317 +++ .../java/gregtech/api/util/GT_Shaped_Recipe.java | 95 + .../gregtech/api/util/GT_Shapeless_Recipe.java | 95 + .../gregtech/api/util/GT_SpawnEventHandler.java | 35 + src/main/java/gregtech/api/util/GT_Utility.java | 1768 +++++++++++++++ src/main/java/gregtech/api/world/GT_Worldgen.java | 60 + .../gregtech/api/world/GT_Worldgen_Boulder.java | 70 + .../java/gregtech/api/world/GT_Worldgen_Ore.java | 28 + .../gregtech/api/world/GT_Worldgen_Ore_Normal.java | 69 + .../api/world/GT_Worldgen_Ore_SingleBlock.java | 30 + .../GT_Worldgen_Ore_SingleBlock_UnderLava.java | 30 + .../java/gregtech/common/covers/GT_Cover_Arm.java | 131 ++ .../common/covers/GT_Cover_Blastproof.java | 33 + .../common/covers/GT_Cover_ControlsWork.java | 101 + .../gregtech/common/covers/GT_Cover_Conveyor.java | 151 ++ .../gregtech/common/covers/GT_Cover_Crafting.java | 39 + .../gregtech/common/covers/GT_Cover_DoesWork.java | 110 + .../gregtech/common/covers/GT_Cover_Drain.java | 117 + .../gregtech/common/covers/GT_Cover_EUMeter.java | 154 ++ .../common/covers/GT_Cover_EnergyOnly.java | 122 ++ .../gregtech/common/covers/GT_Cover_ItemMeter.java | 109 + .../java/gregtech/common/covers/GT_Cover_Lens.java | 27 + .../common/covers/GT_Cover_LiquidMeter.java | 113 + .../common/covers/GT_Cover_NeedMaintainance.java | 129 ++ .../common/covers/GT_Cover_PlayerDetector.java | 126 ++ .../java/gregtech/common/covers/GT_Cover_Pump.java | 205 ++ .../common/covers/GT_Cover_RedstoneConductor.java | 100 + .../covers/GT_Cover_RedstoneReceiverExternal.java | 33 + .../covers/GT_Cover_RedstoneReceiverInternal.java | 32 + .../common/covers/GT_Cover_RedstoneSignalizer.java | 96 + .../GT_Cover_RedstoneTransmitterExternal.java | 33 + .../GT_Cover_RedstoneTransmitterInternal.java | 33 + .../covers/GT_Cover_RedstoneWirelessBase.java | 113 + .../gregtech/common/covers/GT_Cover_Screen.java | 100 + .../gregtech/common/covers/GT_Cover_Shutter.java | 103 + .../common/covers/GT_Cover_SolarPanel.java | 47 + .../java/gregtech/common/covers/GT_Cover_Vent.java | 49 + .../gregtech/common/entities/GT_Entity_Arrow.java | 397 ++++ .../common/entities/GT_Entity_Arrow_Potion.java | 79 + .../gregtech/common/gui/GT_Container_Boiler.java | 101 + .../gui/GT_Container_BronzeBlastFurnace.java | 43 + .../common/gui/GT_Container_ChestBuffer.java | 97 + .../gregtech/common/gui/GT_Container_Filter.java | 152 ++ .../common/gui/GT_Container_QuantumChest.java | 68 + .../common/gui/GT_Container_Regulator.java | 186 ++ .../common/gui/GT_Container_SuperBuffer.java | 92 + .../common/gui/GT_Container_TypeFilter.java | 132 ++ .../common/gui/GT_GUIContainer_Boiler.java | 54 + .../gui/GT_GUIContainer_BronzeBlastFurnace.java | 38 + .../common/gui/GT_GUIContainer_ChestBuffer.java | 29 + .../common/gui/GT_GUIContainer_Filter.java | 29 + .../common/gui/GT_GUIContainer_FusionReactor.java | 52 + .../common/gui/GT_GUIContainer_QuantumChest.java | 37 + .../common/gui/GT_GUIContainer_Regulator.java | 43 + .../common/gui/GT_GUIContainer_SuperBuffer.java | 29 + .../common/gui/GT_GUIContainer_TypeFilter.java | 29 + .../redstonecircuits/GT_Circuit_BasicLogic.java | 121 + .../common/redstonecircuits/GT_Circuit_BitAnd.java | 93 + .../GT_Circuit_CombinationLock.java | 131 ++ .../common/redstonecircuits/GT_Circuit_Equals.java | 89 + .../common/redstonecircuits/GT_Circuit_Pulser.java | 107 + .../redstonecircuits/GT_Circuit_Randomizer.java | 108 + .../redstonecircuits/GT_Circuit_RedstoneMeter.java | 111 + .../redstonecircuits/GT_Circuit_Repeater.java | 111 + .../common/redstonecircuits/GT_Circuit_Timer.java | 138 ++ .../automation/GT_MetaTileEntity_ChestBuffer.java | 86 + .../automation/GT_MetaTileEntity_Filter.java | 101 + .../automation/GT_MetaTileEntity_Regulator.java | 120 + .../automation/GT_MetaTileEntity_SuperBuffer.java | 54 + .../automation/GT_MetaTileEntity_TypeFilter.java | 145 ++ .../boilers/GT_MetaTileEntity_Boiler.java | 356 +++ .../boilers/GT_MetaTileEntity_Boiler_Bronze.java | 181 ++ .../boilers/GT_MetaTileEntity_Boiler_Lava.java | 172 ++ .../boilers/GT_MetaTileEntity_Boiler_Solar.java | 161 ++ .../boilers/GT_MetaTileEntity_Boiler_Steel.java | 191 ++ .../GT_MetaTileEntity_DieselGenerator.java | 145 ++ .../GT_MetaTileEntity_FluidNaquadahReactor.java | 119 + .../generators/GT_MetaTileEntity_GasTurbine.java | 131 ++ .../GT_MetaTileEntity_MagicEnergyConverter.java | 125 ++ .../GT_MetaTileEntity_MagicalEnergyAbsorber.java | 264 +++ .../GT_MetaTileEntity_PlasmaGenerator.java | 125 ++ .../GT_MetaTileEntity_SolidNaquadahReactor.java | 119 + .../generators/GT_MetaTileEntity_SteamTurbine.java | 144 ++ .../GT_MetaTileEntity_BasicHull_Bronze.java | 48 + .../GT_MetaTileEntity_BasicHull_BronzeBricks.java | 51 + .../GT_MetaTileEntity_BasicHull_Steel.java | 50 + .../GT_MetaTileEntity_BasicHull_SteelBricks.java | 50 + .../GT_MetaTileEntity_AlloySmelter_Bronze.java | 130 ++ .../GT_MetaTileEntity_AlloySmelter_Steel.java | 130 ++ .../steam/GT_MetaTileEntity_Compressor_Bronze.java | 128 ++ .../steam/GT_MetaTileEntity_Compressor_Steel.java | 128 ++ .../steam/GT_MetaTileEntity_Extractor_Bronze.java | 128 ++ .../steam/GT_MetaTileEntity_Extractor_Steel.java | 128 ++ .../GT_MetaTileEntity_ForgeHammer_Bronze.java | 130 ++ .../steam/GT_MetaTileEntity_ForgeHammer_Steel.java | 130 ++ .../steam/GT_MetaTileEntity_Furnace_Bronze.java | 128 ++ .../steam/GT_MetaTileEntity_Furnace_Steel.java | 128 ++ .../steam/GT_MetaTileEntity_Macerator_Bronze.java | 135 ++ .../steam/GT_MetaTileEntity_Macerator_Steel.java | 141 ++ .../storage/GT_MetaTileEntity_Locker.java | 225 ++ .../storage/GT_MetaTileEntity_QuantumChest.java | 202 ++ .../storage/GT_MetaTileEntity_QuantumTank.java | 104 + .../java/gregtech/nei/GT_NEI_DefaultHandler.java | 868 ++++++++ src/main/java/gregtech/nei/NEI_GT_Config.java | 33 + src/main/java/ihl/ClientProxy.java | 496 +++++ src/main/java/ihl/IHLCreativeTab.java | 35 + src/main/java/ihl/IHLMod.java | 2318 ++++++++++++++++++++ src/main/java/ihl/IHLModConfig.java | 562 +++++ src/main/java/ihl/IHLModInfo.java | 7 + src/main/java/ihl/ServerProxy.java | 338 +++ .../java/ihl/crop_harvestors/BlobEntityFX.java | 84 + .../java/ihl/crop_harvestors/BlobRenderFX.java | 64 + .../java/ihl/crop_harvestors/RubberTreeBlock.java | 165 ++ src/main/java/ihl/crop_harvestors/SackBlock.java | 169 ++ src/main/java/ihl/crop_harvestors/SackModel.java | 103 + src/main/java/ihl/crop_harvestors/SackRender.java | 95 + .../java/ihl/crop_harvestors/SackTileEntity.java | 569 +++++ .../ihl/enviroment/LaserHitMirrorEventHandler.java | 48 + src/main/java/ihl/enviroment/MirrorBlock.java | 200 ++ src/main/java/ihl/enviroment/MirrorRender.java | 416 ++++ src/main/java/ihl/enviroment/MirrorTileEntity.java | 433 ++++ .../explosion/ChunkAndWorldLoadEventHandler.java | 59 + src/main/java/ihl/explosion/DetonatorMiniGUI.java | 82 + src/main/java/ihl/explosion/ExplosionEntityFX.java | 177 ++ src/main/java/ihl/explosion/ExplosionRenderFX.java | 52 + .../java/ihl/explosion/ExplosionVectorBlockV2.java | 363 +++ src/main/java/ihl/explosion/ExplosiveBlock.java | 252 +++ .../java/ihl/explosion/ExplosiveTileEntity.java | 78 + src/main/java/ihl/explosion/GroundRemoverItem.java | 105 + .../java/ihl/explosion/IHLEntityFallingPile.java | 152 ++ .../ihl/explosion/IHLEntityFallingPileRender.java | 51 + src/main/java/ihl/explosion/PileBlock.java | 133 ++ src/main/java/ihl/explosion/PileBlockRender.java | 285 +++ src/main/java/ihl/explosion/PileTileEntity.java | 78 + .../java/ihl/explosion/PileTileEntityRender.java | 187 ++ .../ihl/explosion/WorldSavedDataBlastWave.java | 108 + src/main/java/ihl/flexible_cable/AnchorBlock.java | 111 + .../java/ihl/flexible_cable/AnchorTileEntity.java | 342 +++ .../ihl/flexible_cable/BatterySwitchUnitModel.java | 48 + .../BatterySwitchUnitTileEntity.java | 295 +++ .../java/ihl/flexible_cable/BlastEntityFX.java | 68 + .../FlexibleCableHolderBaseTileEntity.java | 237 ++ src/main/java/ihl/flexible_cable/IHLCable.java | 111 + src/main/java/ihl/flexible_cable/IHLENet.java | 168 ++ src/main/java/ihl/flexible_cable/IHLGrid.java | 291 +++ .../flexible_cable/InvSlotOutputInProgress.java | 93 + .../InvSlotProcessableIronWorkbench.java | 131 ++ src/main/java/ihl/flexible_cable/InvSlotTool.java | 69 + .../flexible_cable/InvSlotWorkspaceElement.java | 184 ++ .../ihl/flexible_cable/IronWorkbenchContainer.java | 131 ++ .../java/ihl/flexible_cable/IronWorkbenchGui.java | 185 ++ .../ihl/flexible_cable/IronWorkbenchInvSlot.java | 30 + .../ihl/flexible_cable/IronWorkbenchModel.java | 48 + .../ihl/flexible_cable/IronWorkbenchRender.java | 36 + .../flexible_cable/IronWorkbenchTileEntity.java | 351 +++ src/main/java/ihl/flexible_cable/NodeEntity.java | 604 +++++ src/main/java/ihl/flexible_cable/NodeRender.java | 76 + .../ihl/flexible_cable/PowerCableNodeEntity.java | 243 ++ .../RectifierTransformerUnitTileEntity.java | 336 +++ .../java/ihl/flexible_cable/SetOfDiesMiniGUI.java | 81 + .../ihl/flexible_cable/SubAnchorEnergyNetNode.java | 346 +++ .../ihl/flexible_cable/SubRTUEnergyNetNode.java | 320 +++ src/main/java/ihl/handpump/AdvancedHandPump.java | 351 +++ .../java/ihl/handpump/BlockWithCoordinates.java | 96 + src/main/java/ihl/handpump/IHLHandPump.java | 351 +++ src/main/java/ihl/handpump/XYZ.java | 26 + src/main/java/ihl/interfaces/ICableHolder.java | 10 + src/main/java/ihl/interfaces/IEnergyNetNode.java | 21 + src/main/java/ihl/interfaces/IFluidTankVisual.java | 8 + src/main/java/ihl/interfaces/IItemHasMiniGUI.java | 12 + .../ihl/interfaces/IMultiPowerCableHolder.java | 11 + src/main/java/ihl/interfaces/INetworkListener.java | 12 + .../interfaces/ISelectionBoxSpecialRenderer.java | 10 + src/main/java/ihl/interfaces/IWire.java | 9 + .../java/ihl/interfaces/IWorkspaceElement.java | 10 + src/main/java/ihl/interfaces/ItemMiniGUI.java | 29 + src/main/java/ihl/items_blocks/FiberItem.java | 109 + .../java/ihl/items_blocks/FlexibleCableItem.java | 434 ++++ .../java/ihl/items_blocks/FlexiblePipeItem.java | 107 + .../java/ihl/items_blocks/IHLBucketHandler.java | 20 + src/main/java/ihl/items_blocks/IHLFluidBlock.java | 120 + src/main/java/ihl/items_blocks/IHLItemBlock.java | 219 ++ src/main/java/ihl/items_blocks/IHLTool.java | 444 ++++ src/main/java/ihl/items_blocks/ItemSubstance.java | 413 ++++ .../java/ihl/items_blocks/MachineBaseBlock.java | 662 ++++++ src/main/java/ihl/items_blocks/RecipeInputs.java | 25 + .../java/ihl/metallurgy/constants/Details.java | 55 + .../metallurgy/constants/ElectricConductor.java | 49 + .../java/ihl/metallurgy/constants/Insulation.java | 40 + .../CableHolderSelectionBoxSpecialRenderer.java | 42 + .../java/ihl/model/FlexibleCableItemRender.java | 178 ++ src/main/java/ihl/model/FluidRenderer.java | 158 ++ src/main/java/ihl/model/IHLBlockRenderer.java | 78 + src/main/java/ihl/model/IHLModelRenderer.java | 369 ++++ src/main/java/ihl/model/IHLToolRenderer.java | 69 + .../ihl/model/ImpregnatingMachineBlockRender.java | 126 ++ .../java/ihl/model/IronWorkbenchBlockRender.java | 107 + src/main/java/ihl/model/ModelKnee.java | 228 ++ src/main/java/ihl/model/ModelToplessBox.java | 207 ++ src/main/java/ihl/model/ModelTube.java | 274 +++ .../model/RectifierTransformerUnitBlockRender.java | 415 ++++ ...TransformerUnitSelectionBoxSpecialRenderer.java | 51 + .../java/ihl/model/RefluxCondenserBlockRender.java | 125 ++ src/main/java/ihl/model/RenderInfo.java | 71 + src/main/java/ihl/model/UniversalTileRender.java | 76 + .../AchesonFurnaceRecipeHandler.java | 74 + .../ChemicalReactorRecipeHandler.java | 125 ++ .../ihl/nei_integration/CrucibleRecipeHandler.java | 79 + .../CryogenicDistillerRecipeHandler.java | 106 + .../DetonationSprayingMachineRecipeHandler.java | 82 + .../ElectricEvaporatorRecipeHandler.java | 74 + .../ElectrolysisBathRecipeHandler.java | 74 + .../nei_integration/EvaporatorRecipeHandler.java | 74 + .../ihl/nei_integration/ExtruderRecipeHandler.java | 63 + .../FluidizedBedReactorRecipeHandler.java | 106 + .../FractionationColumnRecipeHandler.java | 66 + .../GasWeldingStationGasRecipeHandler.java | 74 + .../nei_integration/IHLBlockHighlightHandler.java | 46 + .../ihl/nei_integration/IHLPositionedStack.java | 45 + .../java/ihl/nei_integration/IHLRecipeHandler.java | 242 ++ .../ImpregnatingMachineRecipeHandler.java | 106 + .../InjectionMoldRecipeHandler.java | 64 + .../IronWorkbenchRecipeHandler.java | 283 +++ .../LabElectrolyzerRecipeHandler.java | 77 + .../ihl/nei_integration/LeadOvenRecipeHandler.java | 83 + .../ihl/nei_integration/LoomRecipeHandler.java | 74 + .../ihl/nei_integration/MachineRecipeHandler.java | 413 ++++ .../MuffleFurnaceRecipeHandler.java | 83 + .../java/ihl/nei_integration/NEIIHLConfig.java | 116 + .../nei_integration/PaperMachineRecipeHandler.java | 75 + .../RollingMachineRecipeHandler.java | 67 + .../VulcanizationExtrudingMoldRecipeHandler.java | 66 + .../ihl/nei_integration/WireMillRecipeHandler.java | 101 + .../WoodenRollingMachineRecipeHandler.java | 74 + .../chemistry/ApparatusProcessableInvSlot.java | 59 + .../chemistry/BasicElectricMotorContainer.java | 74 + .../java/ihl/processing/chemistry/BatteryItem.java | 194 ++ .../chemistry/ChemicalReactorContainer.java | 37 + .../processing/chemistry/ChemicalReactorGui.java | 79 + .../chemistry/ChemicalReactorTileEntity.java | 294 +++ .../chemistry/CryogenicDistillerContainer.java | 39 + .../chemistry/CryogenicDistillerGui.java | 71 + .../chemistry/CryogenicDistillerTileEntity.java | 229 ++ .../processing/chemistry/DosingPumpContainer.java | 95 + .../ihl/processing/chemistry/DosingPumpGui.java | 103 + .../processing/chemistry/DosingPumpTileEntity.java | 226 ++ .../chemistry/ElectricEvaporatorBlock.java | 220 ++ .../chemistry/ElectricEvaporatorContainer.java | 113 + .../chemistry/ElectricEvaporatorGui.java | 85 + .../chemistry/ElectricEvaporatorTileEntity.java | 430 ++++ .../chemistry/ElectrolysisBathContainer.java | 79 + .../processing/chemistry/ElectrolysisBathGui.java | 100 + .../chemistry/ElectrolysisBathModel.java | 86 + .../chemistry/ElectrolysisBathTileEntity.java | 297 +++ .../ihl/processing/chemistry/EvaporatorBlock.java | 221 ++ .../processing/chemistry/EvaporatorContainer.java | 100 + .../ihl/processing/chemistry/EvaporatorGui.java | 84 + .../processing/chemistry/EvaporatorTileEntity.java | 290 +++ .../ihl/processing/chemistry/ExtruderModel.java | 100 + .../chemistry/FluidizedBedReactorContainer.java | 44 + .../chemistry/FluidizedBedReactorGui.java | 59 + .../chemistry/FluidizedBedReactorTileEntity.java | 318 +++ .../chemistry/FractionatorBottomModel.java | 48 + .../chemistry/FractionatorBottomTileEntity.java | 352 +++ .../chemistry/FractionatorCoverModel.java | 52 + .../chemistry/FractionatorCoverTileEntity.java | 104 + .../chemistry/FractionatorSectionModel.java | 47 + .../chemistry/FractionatorSectionTileEntity.java | 148 ++ .../GaedesMercuryRotaryPumpContainer.java | 76 + .../chemistry/GaedesMercuryRotaryPumpGui.java | 60 + .../chemistry/GaedesMercuryRotaryPumpModel.java | 64 + .../GaedesMercuryRotaryPumpTileEntity.java | 83 + .../chemistry/LabElectrolyzerContainer.java | 73 + .../processing/chemistry/LabElectrolyzerGui.java | 74 + .../chemistry/LabElectrolyzerTileEntity.java | 272 +++ .../processing/chemistry/LeadOvenContainer.java | 95 + .../java/ihl/processing/chemistry/LeadOvenGui.java | 55 + .../processing/chemistry/LeadOvenTileEntity.java | 286 +++ .../ihl/processing/chemistry/LoomContainer.java | 66 + .../java/ihl/processing/chemistry/LoomGui.java | 60 + .../java/ihl/processing/chemistry/LoomModel.java | 66 + .../ihl/processing/chemistry/LoomTileEntity.java | 172 ++ .../chemistry/PaperMachineContainer.java | 41 + .../ihl/processing/chemistry/PaperMachineGui.java | 79 + .../chemistry/PaperMachineTileEntity.java | 261 +++ .../processing/chemistry/RefluxCondenserModel.java | 70 + .../chemistry/RefluxCondenserTileEntity.java | 148 ++ .../chemistry/SolarEvaporatorContainer.java | 112 + .../processing/chemistry/SolarEvaporatorGui.java | 78 + .../chemistry/SolarEvaporatorTileEntity.java | 108 + .../ihl/processing/invslots/IHLInvSlotOutput.java | 166 ++ .../invslots/InvSlotConsumableLiquidIHL.java | 271 +++ .../ihl/processing/invslots/InvSlotUpgradeIHL.java | 61 + .../invslots/SlotInvSlotIronWorkbench.java | 32 + .../invslots/SlotInvSlotOutputInProgress.java | 23 + .../processing/metallurgy/AchesonFurnaceGui.java | 46 + .../metallurgy/AchesonFurnanceContainer.java | 16 + .../metallurgy/AchesonFurnanceTileEntity.java | 101 + .../metallurgy/BasicElectricMotorTileEntity.java | 272 +++ .../ihl/processing/metallurgy/CoilerContainer.java | 65 + .../java/ihl/processing/metallurgy/CoilerGui.java | 48 + .../ihl/processing/metallurgy/CoilerModel.java | 103 + .../ihl/processing/metallurgy/CoilerRender.java | 80 + .../processing/metallurgy/CoilerTileEntity.java | 155 ++ .../java/ihl/processing/metallurgy/Crucible.java | 366 ++++ .../processing/metallurgy/CrucibleContainer.java | 66 + .../ihl/processing/metallurgy/CrucibleGui.java | 84 + .../processing/metallurgy/CrucibleInventory.java | 126 ++ .../ihl/processing/metallurgy/CrucibleSlot.java | 18 + .../DetonationSprayingMachineContainer.java | 39 + .../metallurgy/DetonationSprayingMachineGui.java | 48 + .../metallurgy/DetonationSprayingMachineModel.java | 57 + .../DetonationSprayingMachineRender.java | 61 + .../DetonationSprayingMachineTileEntity.java | 198 ++ .../processing/metallurgy/ElectricEngineItem.java | 84 + .../processing/metallurgy/ExtruderContainer.java | 75 + .../ihl/processing/metallurgy/ExtruderGui.java | 49 + .../ihl/processing/metallurgy/ExtruderModel.java | 100 + .../processing/metallurgy/ExtruderTileEntity.java | 155 ++ .../metallurgy/GasWeldingStationContainer.java | 99 + .../metallurgy/GasWeldingStationGui.java | 78 + .../metallurgy/GasWeldingStationModel.java | 108 + .../metallurgy/GasWeldingStationTileEntity.java | 286 +++ .../ihl/processing/metallurgy/IProductionLine.java | 12 + .../metallurgy/ImpregnatingMachineContainer.java | 105 + .../metallurgy/ImpregnatingMachineGui.java | 63 + .../metallurgy/ImpregnatingMachineRender.java | 55 + .../metallurgy/ImpregnatingMachineTileEntity.java | 343 +++ .../processing/metallurgy/InjectionMoldBlock.java | 248 +++ .../metallurgy/InjectionMoldTileEntity.java | 201 ++ .../ihl/processing/metallurgy/LatheContainer.java | 72 + .../java/ihl/processing/metallurgy/LatheGui.java | 51 + .../ihl/processing/metallurgy/LathePart1Model.java | 93 + .../metallurgy/LathePart1TileEntity.java | 99 + .../ihl/processing/metallurgy/LathePart2Model.java | 87 + .../metallurgy/LathePart2TileEntity.java | 104 + .../metallurgy/MachineBaseContainer.java | 74 + .../metallurgy/MachineBaseTileEntity.java | 279 +++ .../processing/metallurgy/MuffleFurnaceGui.java | 48 + .../metallurgy/MuffleFurnanceContainer.java | 16 + .../metallurgy/MuffleFurnanceTileEntity.java | 119 + .../metallurgy/RollingMachineContainer.java | 75 + .../processing/metallurgy/RollingMachineGui.java | 50 + .../metallurgy/RollingMachinePart1Model.java | 97 + .../metallurgy/RollingMachinePart1TileEntity.java | 149 ++ .../metallurgy/RollingMachinePart2Model.java | 42 + .../metallurgy/RollingMachinePart2TileEntity.java | 104 + .../metallurgy/RollingMachineRender.java | 81 + .../VulcanizationExtrudingMoldModel.java | 54 + .../VulcanizationExtrudingMoldTileEntity.java | 256 +++ .../processing/metallurgy/WireMillContainer.java | 113 + .../ihl/processing/metallurgy/WireMillGui.java | 68 + .../processing/metallurgy/WireMillTileEntity.java | 378 ++++ .../metallurgy/WoodenRollingMachineContainer.java | 77 + .../metallurgy/WoodenRollingMachineGui.java | 60 + .../metallurgy/WoodenRollingMachinePart1Model.java | 122 ++ .../WoodenRollingMachinePart1TileEntity.java | 158 ++ .../metallurgy/WoodenRollingMachinePart2Model.java | 44 + .../WoodenRollingMachinePart2TileEntity.java | 104 + .../metallurgy/WoodenRollingMachineRender.java | 91 + src/main/java/ihl/recipes/IRecipeInputFluid.java | 11 + src/main/java/ihl/recipes/IronWorkbenchRecipe.java | 214 ++ .../java/ihl/recipes/RecipeInputDetonator.java | 73 + src/main/java/ihl/recipes/RecipeInputDie.java | 97 + .../ihl/recipes/RecipeInputFluidDictionary.java | 46 + .../java/ihl/recipes/RecipeInputFluidStack.java | 45 + .../ihl/recipes/RecipeInputObjectInstance.java | 44 + .../ihl/recipes/RecipeInputOreDictionaryList.java | 122 ++ src/main/java/ihl/recipes/RecipeInputWire.java | 72 + .../java/ihl/recipes/RecipeOutputItemStack.java | 52 + .../java/ihl/recipes/UniversalRecipeInput.java | 205 ++ .../java/ihl/recipes/UniversalRecipeManager.java | 195 ++ .../java/ihl/recipes/UniversalRecipeOutput.java | 149 ++ src/main/java/ihl/servitor/BoneBlock.java | 108 + src/main/java/ihl/servitor/FlameEntityFX.java | 87 + src/main/java/ihl/servitor/FlameRenderFX.java | 55 + src/main/java/ihl/servitor/LostHeadEntity.java | 475 ++++ src/main/java/ihl/servitor/LostHeadRender.java | 40 + src/main/java/ihl/servitor/SkullItemRender.java | 78 + src/main/java/ihl/servitor/SkullModel.java | 153 ++ src/main/java/ihl/servitor/SkullModel.txt | 165 ++ .../TDITBlock.java | 132 ++ .../TDITContainer.java | 93 + .../TDITFrequencyTransmitter.java | 172 ++ .../trans_dimensional_item_teleporter/TDITGui.java | 48 + .../TDITTileEntity.java | 497 +++++ src/main/java/ihl/utils/BlockItemRender.java | 218 ++ .../java/ihl/utils/EntityDropEventHandler.java | 16 + src/main/java/ihl/utils/FluidDictionary.java | 42 + src/main/java/ihl/utils/GuiMultiTextureButton.java | 47 + src/main/java/ihl/utils/IHLFluidTank.java | 322 +++ src/main/java/ihl/utils/IHLInvSlotDischarge.java | 83 + src/main/java/ihl/utils/IHLItemRenderer.java | 297 +++ src/main/java/ihl/utils/IHLMathUtils.java | 103 + src/main/java/ihl/utils/IHLRenderUtils.java | 819 +++++++ src/main/java/ihl/utils/IHLUtils.java | 953 ++++++++ src/main/java/ihl/worldgen/IHLWorldGenerator.java | 101 + src/main/java/ihl/worldgen/WorldGeneratorBase.java | 90 + .../ihl/worldgen/WorldGeneratorSurfaceLake.java | 42 + .../worldgen/WorldGeneratorUndergroundLake.java | 60 + src/main/java/ihl/worldgen/WorldGeneratorVein.java | 26 + src/main/java/ihl/worldgen/ores/BlockOre.java | 137 ++ .../java/ihl/worldgen/ores/DebugScannerBlock.java | 46 + .../ihl/worldgen/ores/DebugScannerContainer.java | 49 + .../java/ihl/worldgen/ores/DebugScannerGui.java | 69 + .../ihl/worldgen/ores/DebugScannerTileEntity.java | 157 ++ src/main/java/ihl/worldgen/ores/IHLFluid.java | 333 +++ src/main/resources/META-INF/ihl_at.cfg | 5 + src/main/resources/mcmod.info | 16 + 1207 files changed, 87573 insertions(+) create mode 100644 src/main/java/assets/ihl/config/ihl-recipe.cfg create mode 100644 src/main/java/assets/ihl/lang/en_US.lang create mode 100644 src/main/java/assets/ihl/lang/zh_CN.lang create mode 100644 src/main/java/assets/ihl/sounds.json create mode 100644 src/main/java/assets/ihl/sounds/electrocution.ogg create mode 100644 src/main/java/assets/ihl/sounds/explosion.ogg create mode 100644 src/main/java/assets/ihl/sounds/fuse.ogg create mode 100644 src/main/java/assets/ihl/sounds/handpumpOne.ogg create mode 100644 src/main/java/assets/ihl/sounds/lostHeadCry-001.ogg create mode 100644 src/main/java/assets/ihl/sounds/lostHeadCry-002.ogg create mode 100644 src/main/java/assets/ihl/sounds/lostHeadCry-003.ogg create mode 100644 src/main/java/assets/ihl/sounds/lostHeadCry-004.ogg create mode 100644 src/main/java/assets/ihl/sounds/lostHeadCry-005.ogg create mode 100644 src/main/java/assets/ihl/sounds/lostHeadCry-006.ogg create mode 100644 src/main/java/assets/ihl/sounds/lostHeadCry-007.ogg create mode 100644 src/main/java/assets/ihl/sounds/lostHeadCry.ogg create mode 100644 src/main/java/assets/ihl/sounds/lostHeadDeath.ogg create mode 100644 src/main/java/assets/ihl/sounds/lostHeadLaught-001.ogg create mode 100644 src/main/java/assets/ihl/sounds/lostHeadLaught-002.ogg create mode 100644 src/main/java/assets/ihl/sounds/lostHeadLaught-003.ogg create mode 100644 src/main/java/assets/ihl/sounds/lostHeadLaught.ogg create mode 100644 src/main/java/assets/ihl/sounds/lostHeadLaughtLong.ogg create mode 100644 src/main/java/assets/ihl/sounds/lostHeadScream-001.ogg create mode 100644 src/main/java/assets/ihl/sounds/lostHeadScream-002.ogg create mode 100644 src/main/java/assets/ihl/sounds/lostHeadScream-003.ogg create mode 100644 src/main/java/assets/ihl/sounds/lostHeadScream-004.ogg create mode 100644 src/main/java/assets/ihl/sounds/lostHeadScream.ogg create mode 100644 src/main/java/assets/ihl/sounds/spotlightRotating.ogg create mode 100644 src/main/java/assets/ihl/sounds/zap.ogg create mode 100644 src/main/java/assets/ihl/textures/blocks/achesonOvenTop.png create mode 100644 src/main/java/assets/ihl/textures/blocks/batterySwitchUnit.png create mode 100644 src/main/java/assets/ihl/textures/blocks/blockRubWoodFront.png create mode 100644 src/main/java/assets/ihl/textures/blocks/blockRubWoodSide.png create mode 100644 src/main/java/assets/ihl/textures/blocks/blockRubWoodTop.png create mode 100644 src/main/java/assets/ihl/textures/blocks/blockSpruceFront.png create mode 100644 src/main/java/assets/ihl/textures/blocks/boneBlockSide1.png create mode 100644 src/main/java/assets/ihl/textures/blocks/boneBlockSide2.png create mode 100644 src/main/java/assets/ihl/textures/blocks/boneBlockSide3.png create mode 100644 src/main/java/assets/ihl/textures/blocks/boneBlockSide4.png create mode 100644 src/main/java/assets/ihl/textures/blocks/boneBlockTop.png create mode 100644 src/main/java/assets/ihl/textures/blocks/brickOvenBack.png create mode 100644 src/main/java/assets/ihl/textures/blocks/brickOvenSide.png create mode 100644 src/main/java/assets/ihl/textures/blocks/brickOvenTop.png create mode 100644 src/main/java/assets/ihl/textures/blocks/cannonBronze.png create mode 100644 src/main/java/assets/ihl/textures/blocks/chemicalReactorOutputSide.png create mode 100644 src/main/java/assets/ihl/textures/blocks/coiler.png create mode 100644 src/main/java/assets/ihl/textures/blocks/cryogenicDistillerBack.png create mode 100644 src/main/java/assets/ihl/textures/blocks/cryogenicDistillerInputSide.png create mode 100644 src/main/java/assets/ihl/textures/blocks/cryogenicDistillerNitrogenSide.png create mode 100644 src/main/java/assets/ihl/textures/blocks/cryogenicDistillerOxygenSide.png create mode 100644 src/main/java/assets/ihl/textures/blocks/detonationSprayingMachine.png create mode 100644 src/main/java/assets/ihl/textures/blocks/detonationSprayingMachineIcon.png create mode 100644 src/main/java/assets/ihl/textures/blocks/dosingPumpBack.png create mode 100644 src/main/java/assets/ihl/textures/blocks/dosingPumpFront.png create mode 100644 src/main/java/assets/ihl/textures/blocks/dosingPumpLeft.png create mode 100644 src/main/java/assets/ihl/textures/blocks/dosingPumpRight.png create mode 100644 src/main/java/assets/ihl/textures/blocks/dosingPumpTop.png create mode 100644 src/main/java/assets/ihl/textures/blocks/electricEvaporatorBottom.png create mode 100644 src/main/java/assets/ihl/textures/blocks/electricEvaporatorFront.png create mode 100644 src/main/java/assets/ihl/textures/blocks/electricEvaporatorFrontActive.png create mode 100644 src/main/java/assets/ihl/textures/blocks/electricEvaporatorSide.png create mode 100644 src/main/java/assets/ihl/textures/blocks/electricEvaporatorTop.png create mode 100644 src/main/java/assets/ihl/textures/blocks/electrolysisBath.png create mode 100644 src/main/java/assets/ihl/textures/blocks/explosiveBlockBottom.png create mode 100644 src/main/java/assets/ihl/textures/blocks/explosiveBlockSide.png create mode 100644 src/main/java/assets/ihl/textures/blocks/explosiveBlockTop.png create mode 100644 src/main/java/assets/ihl/textures/blocks/extruder.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fiberglassSpinneretsBack.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fiberglassSpinneretsFront.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fiberglassSpinneretsLeft.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fiberglassSpinneretsRight.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fiberglassSpinneretsTop.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidAcetaldehydeFlowing.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidAcetaldehydeStill.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidAcetyleneFlowing.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidAcetyleneFlowing.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidAcetyleneStill.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidAcetyleneStill.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidAirFlowing.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidAirStill.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidAmmoniaFlowing.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidAmmoniaStill.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidAquaRegiaFlowing.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidAquaRegiaFlowing.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidAquaRegiaStill.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidAquaRegiaStill.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidBlueVitriolDissolvedInWaterFlowing.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidBlueVitriolDissolvedInWaterFlowing.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidBlueVitriolDissolvedInWaterStill.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidBlueVitriolDissolvedInWaterStill.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidBoricAcidFlowing.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidBoricAcidFlowing.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidBoricAcidStill.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidBoricAcidStill.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidCablingColophonyFlowing.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidCablingColophonyFlowing.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidCablingColophonyStill.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidCablingColophonyStill.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidCalciumChlorideDissolvedInWaterFlowing.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidCalciumChlorideDissolvedInWaterStill.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidChlorineFlowing.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidChlorineFlowing.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidChlorineStill.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidChlorineStill.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidFormaldehydeFlowing.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidFormaldehydeStill.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidFuelFlowing.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidFuelFlowing.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidFuelOilFlowing.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidFuelOilStill.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidFuelStill.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidFuelStill.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidGlycerolFlowing.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidGlycerolFlowing.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidGlycerolStill.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidGlycerolStill.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidHydrogenChlorideFlowing.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidHydrogenChlorideFlowing.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidHydrogenChlorideStill.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidHydrogenChlorideStill.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidHydrogenFlowing.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidHydrogenFlowing.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidHydrogenStill.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidHydrogenStill.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidLimemilkFlowing.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidLimemilkFlowing.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidLimemilkStill.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidLimemilkStill.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidLiquidGlassFlowing.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidLiquidGlassFlowing.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidLiquidGlassStill.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidLiquidGlassStill.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidLithiumChlorideDissolvedInWaterFlowing.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidLithiumChlorideDissolvedInWaterStill.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidMercuryFlowing.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidMercuryFlowing.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidMercuryStill.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidMercuryStill.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidMethanolFlowing.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidMethanolStill.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidMineralOilFlowing.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidMineralOilStill.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidMoltenBronzeFlowing.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidMoltenBronzeFlowing.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidMoltenBronzeStill.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidMoltenBronzeStill.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidMoltenFlowing.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidMoltenFlowing.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidMoltenGoldFlowing.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidMoltenGoldFlowing.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidMoltenGoldStill.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidMoltenGoldStill.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidMoltenRubberWithSulfurFlowing.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidMoltenRubberWithSulfurFlowing.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidMoltenRubberWithSulfurStill.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidMoltenRubberWithSulfurStill.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidMoltenStill.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidMoltenStill.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidNatriumHydroxideDissolvedInWaterFlowing.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidNatriumHydroxideDissolvedInWaterFlowing.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidNatriumHydroxideDissolvedInWaterStill.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidNatriumHydroxideDissolvedInWaterStill.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidNatriumTungstateDissolvedInWaterFlowing.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidNatriumTungstateDissolvedInWaterFlowing.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidNatriumTungstateDissolvedInWaterStill.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidNatriumTungstateDissolvedInWaterStill.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidNickelSulfateDissolvedInWaterFlowing.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidNickelSulfateDissolvedInWaterFlowing.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidNickelSulfateDissolvedInWaterStill.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidNickelSulfateDissolvedInWaterStill.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidNitricAcidFlowing.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidNitricAcidFlowing.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidNitricAcidStill.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidNitricAcidStill.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidNitroGlycerinFlowing.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidNitroGlycerinStill.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidNitrogenFlowing.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidNitrogenFlowing.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidNitrogenStill.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidNitrogenStill.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidOilFlowing.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidOilStill.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidOleicAcidFlowing.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidOleicAcidFlowing.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidOleicAcidStill.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidOleicAcidStill.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidOsmiumTetroxideFlowing.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidOsmiumTetroxideFlowing.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidOsmiumTetroxideStill.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidOsmiumTetroxideStill.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidOxygenFlowing.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidOxygenFlowing.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidOxygenStill.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidOxygenStill.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidPulpCelluloseFlowing.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidPulpCelluloseFlowing.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidPulpCelluloseStill.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidPulpCelluloseStill.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidPulpMicaFlowing.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidPulpMicaFlowing.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidPulpMicaStill.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidPulpMicaStill.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidPulpZeoliteFlowing.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidPulpZeoliteFlowing.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidPulpZeoliteStill.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidPulpZeoliteStill.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidRubberTreeSapFlowing.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidRubberTreeSapFlowing.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidRubberTreeSapStill.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidRubberTreeSapStill.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidSaltWaterFlowing.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidSaltWaterFlowing.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidSaltWaterStill.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidSaltWaterStill.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidSeedOilFlowing.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidSeedOilFlowing.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidSeedOilStill.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidSeedOilStill.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidSodiumPeroxideFlowing.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidSodiumPeroxideFlowing.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidSodiumPeroxideStill.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidSodiumPeroxideStill.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidSpruceResinFlowing.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidSpruceResinFlowing.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidSpruceResinStill.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidSpruceResinStill.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidSulfuricAcidFlowing.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidSulfuricAcidFlowing.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidSulfuricAcidStill.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidSulfuricAcidStill.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidSulfuricAnhydrideFlowing.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidSulfuricAnhydrideFlowing.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidSulfuricAnhydrideStill.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidSulfuricAnhydrideStill.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidTarWaterFlowing.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidTarWaterStill.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidTurpentineFlowing.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidTurpentineFlowing.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidTurpentineStill.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidTurpentineStill.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidVapourMercuryFlowing.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidVapourMercuryFlowing.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidVapourMercuryStill.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidVapourMercuryStill.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidVapourSulfuricAcidFlowing.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidVapourSulfuricAcidFlowing.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidVapourSulfuricAcidStill.png create mode 100644 src/main/java/assets/ihl/textures/blocks/fluidVapourSulfuricAcidStill.png.mcmeta create mode 100644 src/main/java/assets/ihl/textures/blocks/frameSteel.png create mode 100644 src/main/java/assets/ihl/textures/blocks/gasWeldingStation.png create mode 100644 src/main/java/assets/ihl/textures/blocks/goldChimneyKnee.png create mode 100644 src/main/java/assets/ihl/textures/blocks/greenPaint.png create mode 100644 src/main/java/assets/ihl/textures/blocks/injectionMoldSide.png create mode 100644 src/main/java/assets/ihl/textures/blocks/injectionMoldTop.png create mode 100644 src/main/java/assets/ihl/textures/blocks/ironWorkbench.png create mode 100644 src/main/java/assets/ihl/textures/blocks/ironWorkbenchTrumbnail.png create mode 100644 src/main/java/assets/ihl/textures/blocks/junctionBox.png create mode 100644 src/main/java/assets/ihl/textures/blocks/leadOvenTop.png create mode 100644 src/main/java/assets/ihl/textures/blocks/lightBulb.png create mode 100644 src/main/java/assets/ihl/textures/blocks/metalShards.png create mode 100644 src/main/java/assets/ihl/textures/blocks/mirror.png create mode 100644 src/main/java/assets/ihl/textures/blocks/muffleOvenFront.png create mode 100644 src/main/java/assets/ihl/textures/blocks/oreApatite.png create mode 100644 src/main/java/assets/ihl/textures/blocks/oreBauxite.png create mode 100644 src/main/java/assets/ihl/textures/blocks/oreBischofite.png create mode 100644 src/main/java/assets/ihl/textures/blocks/oreChromite.png create mode 100644 src/main/java/assets/ihl/textures/blocks/oreCinnabar.png create mode 100644 src/main/java/assets/ihl/textures/blocks/oreDatolite.png create mode 100644 src/main/java/assets/ihl/textures/blocks/oreGypsum.png create mode 100644 src/main/java/assets/ihl/textures/blocks/oreGyubnera.png create mode 100644 src/main/java/assets/ihl/textures/blocks/oreLimestone.png create mode 100644 src/main/java/assets/ihl/textures/blocks/oreMica.png create mode 100644 src/main/java/assets/ihl/textures/blocks/orePotassiumFeldspar.png create mode 100644 src/main/java/assets/ihl/textures/blocks/oreRockSalt.png create mode 100644 src/main/java/assets/ihl/textures/blocks/oreSaltpeter.png create mode 100644 src/main/java/assets/ihl/textures/blocks/oreStibnite.png create mode 100644 src/main/java/assets/ihl/textures/blocks/oreTrona.png create mode 100644 src/main/java/assets/ihl/textures/blocks/paperMachineFront.png create mode 100644 src/main/java/assets/ihl/textures/blocks/pileTextureSpace.png create mode 100644 src/main/java/assets/ihl/textures/blocks/porcelainBox.png create mode 100644 src/main/java/assets/ihl/textures/blocks/porcelainFurnaceFront.png create mode 100644 src/main/java/assets/ihl/textures/blocks/porcelainFurnaceSide.png create mode 100644 src/main/java/assets/ihl/textures/blocks/porcelainFurnaceTop.png create mode 100644 src/main/java/assets/ihl/textures/blocks/powerPort.png create mode 100644 src/main/java/assets/ihl/textures/blocks/redPaint.png create mode 100644 src/main/java/assets/ihl/textures/blocks/rubberInsulatedCase.png create mode 100644 src/main/java/assets/ihl/textures/blocks/sack.png create mode 100644 src/main/java/assets/ihl/textures/blocks/sackItem.png create mode 100644 src/main/java/assets/ihl/textures/blocks/solarEvaporatorSide.png create mode 100644 src/main/java/assets/ihl/textures/blocks/solidFuelEvaporatorBottom.png create mode 100644 src/main/java/assets/ihl/textures/blocks/solidFuelEvaporatorFront.png create mode 100644 src/main/java/assets/ihl/textures/blocks/solidFuelEvaporatorFrontActive.png create mode 100644 src/main/java/assets/ihl/textures/blocks/solidFuelEvaporatorSide.png create mode 100644 src/main/java/assets/ihl/textures/blocks/solidFuelEvaporatorTop.png create mode 100644 src/main/java/assets/ihl/textures/blocks/splitInjectionMold.png create mode 100644 src/main/java/assets/ihl/textures/blocks/spotlight.png create mode 100644 src/main/java/assets/ihl/textures/blocks/steel.png create mode 100644 src/main/java/assets/ihl/textures/blocks/tditBack.png create mode 100644 src/main/java/assets/ihl/textures/blocks/tditBottom.png create mode 100644 src/main/java/assets/ihl/textures/blocks/tditLeft.png create mode 100644 src/main/java/assets/ihl/textures/blocks/tditRight.png create mode 100644 src/main/java/assets/ihl/textures/blocks/tditTop.png create mode 100644 src/main/java/assets/ihl/textures/blocks/tubBronzeSide.png create mode 100644 src/main/java/assets/ihl/textures/blocks/tubBronzeTop.png create mode 100644 src/main/java/assets/ihl/textures/blocks/woodenRollingMachine.png create mode 100644 src/main/java/assets/ihl/textures/gui/GUIAchesonFurnace.png create mode 100644 src/main/java/assets/ihl/textures/gui/GUICastingNEI.png create mode 100644 src/main/java/assets/ihl/textures/gui/GUIChemicalReactor.png create mode 100644 src/main/java/assets/ihl/textures/gui/GUIChimneyKneeNEI.png create mode 100644 src/main/java/assets/ihl/textures/gui/GUICoiler.png create mode 100644 src/main/java/assets/ihl/textures/gui/GUICondenserNEI.png create mode 100644 src/main/java/assets/ihl/textures/gui/GUICrucible.png create mode 100644 src/main/java/assets/ihl/textures/gui/GUICrucibleNEI.png create mode 100644 src/main/java/assets/ihl/textures/gui/GUICryogenicDistiller.png create mode 100644 src/main/java/assets/ihl/textures/gui/GUIDebugScanner.png create mode 100644 src/main/java/assets/ihl/textures/gui/GUIDetonationSprayingMachine.png create mode 100644 src/main/java/assets/ihl/textures/gui/GUIDosingPump.png create mode 100644 src/main/java/assets/ihl/textures/gui/GUIElectricEvaporator.png create mode 100644 src/main/java/assets/ihl/textures/gui/GUIElectrolysisBath.png create mode 100644 src/main/java/assets/ihl/textures/gui/GUIExtruder.png create mode 100644 src/main/java/assets/ihl/textures/gui/GUIFluidizedBedReactor.png create mode 100644 src/main/java/assets/ihl/textures/gui/GUIFractionationColumn.png create mode 100644 src/main/java/assets/ihl/textures/gui/GUIGaedesMercuryRotaryPump.png create mode 100644 src/main/java/assets/ihl/textures/gui/GUIGasWeldingStation.png create mode 100644 src/main/java/assets/ihl/textures/gui/GUIIronWorkbench.png create mode 100644 src/main/java/assets/ihl/textures/gui/GUILabElectrolyzer.png create mode 100644 src/main/java/assets/ihl/textures/gui/GUILathe.png create mode 100644 src/main/java/assets/ihl/textures/gui/GUILeadOven.png create mode 100644 src/main/java/assets/ihl/textures/gui/GUILoom.png create mode 100644 src/main/java/assets/ihl/textures/gui/GUIPaperMachine.png create mode 100644 src/main/java/assets/ihl/textures/gui/GUIRollingMachine.png create mode 100644 src/main/java/assets/ihl/textures/gui/GUISolarEvaporator.png create mode 100644 src/main/java/assets/ihl/textures/gui/GUISolidFuelEvaporator.png create mode 100644 src/main/java/assets/ihl/textures/gui/GUITDIT.png create mode 100644 src/main/java/assets/ihl/textures/gui/GUITubBronze.png create mode 100644 src/main/java/assets/ihl/textures/gui/GUIVulcanizationExtrudingMoldNEI.png create mode 100644 src/main/java/assets/ihl/textures/gui/GUIWireMill.png create mode 100644 src/main/java/assets/ihl/textures/gui/GUIWoodenRollingMachine.png create mode 100644 src/main/java/assets/ihl/textures/items/EightPinDataCable.png create mode 100644 src/main/java/assets/ihl/textures/items/barD10Gold.png create mode 100644 src/main/java/assets/ihl/textures/items/barD10Steel.png create mode 100644 src/main/java/assets/ihl/textures/items/barD10SteelHot.png create mode 100644 src/main/java/assets/ihl/textures/items/batteryCellsEbonite.png create mode 100644 src/main/java/assets/ihl/textures/items/batteryCellsRawEbonite.png create mode 100644 src/main/java/assets/ihl/textures/items/blankChiselSteel.png create mode 100644 src/main/java/assets/ihl/textures/items/blankNeedleFileSteel.png create mode 100644 src/main/java/assets/ihl/textures/items/blankSetOfFilesSteel.png create mode 100644 src/main/java/assets/ihl/textures/items/boltM10x1Steel.png create mode 100644 src/main/java/assets/ihl/textures/items/breadWithLard.png create mode 100644 src/main/java/assets/ihl/textures/items/bucket_SpruceResin.png create mode 100644 src/main/java/assets/ihl/textures/items/bucket_fluidRubberTreeSap.png create mode 100644 src/main/java/assets/ihl/textures/items/bucket_tarPitch.png create mode 100644 src/main/java/assets/ihl/textures/items/carvingKnifeBronze.png create mode 100644 src/main/java/assets/ihl/textures/items/catalystIron.png create mode 100644 src/main/java/assets/ihl/textures/items/catalystIronOxide.png create mode 100644 src/main/java/assets/ihl/textures/items/catalystRawIronOxide.png create mode 100644 src/main/java/assets/ihl/textures/items/chisel.png create mode 100644 src/main/java/assets/ihl/textures/items/copperWire.png create mode 100644 src/main/java/assets/ihl/textures/items/copperWire16x.png create mode 100644 src/main/java/assets/ihl/textures/items/crucible.png create mode 100644 src/main/java/assets/ihl/textures/items/crucibleHot.png create mode 100644 src/main/java/assets/ihl/textures/items/crucibleMixture.png create mode 100644 src/main/java/assets/ihl/textures/items/crushedBauxite.png create mode 100644 src/main/java/assets/ihl/textures/items/crushedChromite.png create mode 100644 src/main/java/assets/ihl/textures/items/crushedCinnabar.png create mode 100644 src/main/java/assets/ihl/textures/items/crushedGyubnera.png create mode 100644 src/main/java/assets/ihl/textures/items/crushedPurifiedBauxite.png create mode 100644 src/main/java/assets/ihl/textures/items/crushedPurifiedChromite.png create mode 100644 src/main/java/assets/ihl/textures/items/crushedPurifiedCinnabar.png create mode 100644 src/main/java/assets/ihl/textures/items/crushedPurifiedGyubnera.png create mode 100644 src/main/java/assets/ihl/textures/items/crushedPurifiedStibnite.png create mode 100644 src/main/java/assets/ihl/textures/items/crushedStibnite.png create mode 100644 src/main/java/assets/ihl/textures/items/detonationSprayingMachineSetOfMoldedPartsBronze.png create mode 100644 src/main/java/assets/ihl/textures/items/detonator.png create mode 100644 src/main/java/assets/ihl/textures/items/diceM10x1Steel.png create mode 100644 src/main/java/assets/ihl/textures/items/diceM10x1SteelHardened.png create mode 100644 src/main/java/assets/ihl/textures/items/diceM10x1SteelHot.png create mode 100644 src/main/java/assets/ihl/textures/items/diceS10x2Steel.png create mode 100644 src/main/java/assets/ihl/textures/items/drillSteel.png create mode 100644 src/main/java/assets/ihl/textures/items/drillSteelHardened.png create mode 100644 src/main/java/assets/ihl/textures/items/drillSteelHot.png create mode 100644 src/main/java/assets/ihl/textures/items/dustAntimony.png create mode 100644 src/main/java/assets/ihl/textures/items/dustAntimonyOxide.png create mode 100644 src/main/java/assets/ihl/textures/items/dustBauxite.png create mode 100644 src/main/java/assets/ihl/textures/items/dustBischofite.png create mode 100644 src/main/java/assets/ihl/textures/items/dustBoricAcid.png create mode 100644 src/main/java/assets/ihl/textures/items/dustBoronCarbide.png create mode 100644 src/main/java/assets/ihl/textures/items/dustBrick.png create mode 100644 src/main/java/assets/ihl/textures/items/dustCalcite.png create mode 100644 src/main/java/assets/ihl/textures/items/dustCalciumAcetate.png create mode 100644 src/main/java/assets/ihl/textures/items/dustCalciumCarbide.png create mode 100644 src/main/java/assets/ihl/textures/items/dustCalciumChloride.png create mode 100644 src/main/java/assets/ihl/textures/items/dustCalciumTungstate.png create mode 100644 src/main/java/assets/ihl/textures/items/dustCarborundum.png create mode 100644 src/main/java/assets/ihl/textures/items/dustChromite.png create mode 100644 src/main/java/assets/ihl/textures/items/dustCoalElectrodePremix.png create mode 100644 src/main/java/assets/ihl/textures/items/dustDatolite.png create mode 100644 src/main/java/assets/ihl/textures/items/dustDehydratedGypsum.png create mode 100644 src/main/java/assets/ihl/textures/items/dustFerrite.png create mode 100644 src/main/java/assets/ihl/textures/items/dustFerrochrome.png create mode 100644 src/main/java/assets/ihl/textures/items/dustGlass.png create mode 100644 src/main/java/assets/ihl/textures/items/dustGraphite.png create mode 100644 src/main/java/assets/ihl/textures/items/dustGypsum.png create mode 100644 src/main/java/assets/ihl/textures/items/dustIridium.png create mode 100644 src/main/java/assets/ihl/textures/items/dustIridiumAndSodiumOxide.png create mode 100644 src/main/java/assets/ihl/textures/items/dustIronOxide.png create mode 100644 src/main/java/assets/ihl/textures/items/dustIronOxideCatalystMix.png create mode 100644 src/main/java/assets/ihl/textures/items/dustIrongraphite.png create mode 100644 src/main/java/assets/ihl/textures/items/dustLeadPlumbate.png create mode 100644 src/main/java/assets/ihl/textures/items/dustLithiumChloride.png create mode 100644 src/main/java/assets/ihl/textures/items/dustLithiumOxide.png create mode 100644 src/main/java/assets/ihl/textures/items/dustMagnesium.png create mode 100644 src/main/java/assets/ihl/textures/items/dustMagnesiumOxide.png create mode 100644 src/main/java/assets/ihl/textures/items/dustManganeseOxide.png create mode 100644 src/main/java/assets/ihl/textures/items/dustMercuryChloride.png create mode 100644 src/main/java/assets/ihl/textures/items/dustMercuryFulminate.png create mode 100644 src/main/java/assets/ihl/textures/items/dustMica.png create mode 100644 src/main/java/assets/ihl/textures/items/dustPentaerythritol.png create mode 100644 src/main/java/assets/ihl/textures/items/dustPentaerythritolTetranitrate.png create mode 100644 src/main/java/assets/ihl/textures/items/dustPlatinumGroupSludge.png create mode 100644 src/main/java/assets/ihl/textures/items/dustPorcelain.png create mode 100644 src/main/java/assets/ihl/textures/items/dustPotassiumFeldspar.png create mode 100644 src/main/java/assets/ihl/textures/items/dustPotassiumOxide.png create mode 100644 src/main/java/assets/ihl/textures/items/dustPotassiumSulphate.png create mode 100644 src/main/java/assets/ihl/textures/items/dustQuicklime.png create mode 100644 src/main/java/assets/ihl/textures/items/dustRockSalt.png create mode 100644 src/main/java/assets/ihl/textures/items/dustSalt.png create mode 100644 src/main/java/assets/ihl/textures/items/dustSaltpeter.png create mode 100644 src/main/java/assets/ihl/textures/items/dustSilicon.png create mode 100644 src/main/java/assets/ihl/textures/items/dustSodiumAluminate.png create mode 100644 src/main/java/assets/ihl/textures/items/dustSodiumFormate.png create mode 100644 src/main/java/assets/ihl/textures/items/dustSodiumHydrogenSulfate.png create mode 100644 src/main/java/assets/ihl/textures/items/dustSodiumHydroxide.png create mode 100644 src/main/java/assets/ihl/textures/items/dustSodiumPeroxide.png create mode 100644 src/main/java/assets/ihl/textures/items/dustSodiumSulfate.png create mode 100644 src/main/java/assets/ihl/textures/items/dustSodiumSulfide.png create mode 100644 src/main/java/assets/ihl/textures/items/dustSodiumZeolite.png create mode 100644 src/main/java/assets/ihl/textures/items/dustSodiumZeoliteCoked.png create mode 100644 src/main/java/assets/ihl/textures/items/dustSolderingAlloy.png create mode 100644 src/main/java/assets/ihl/textures/items/dustStibnite.png create mode 100644 src/main/java/assets/ihl/textures/items/dustTinyAntimony.png create mode 100644 src/main/java/assets/ihl/textures/items/dustTinyGypsum.png create mode 100644 src/main/java/assets/ihl/textures/items/dustTinyIronOxide.png create mode 100644 src/main/java/assets/ihl/textures/items/dustTinyManganeseOxide.png create mode 100644 src/main/java/assets/ihl/textures/items/dustTinyPlatinumGroupSludge.png create mode 100644 src/main/java/assets/ihl/textures/items/dustTinySilicon.png create mode 100644 src/main/java/assets/ihl/textures/items/dustTinySiliconDioxide.png create mode 100644 src/main/java/assets/ihl/textures/items/dustTinyTungsten.png create mode 100644 src/main/java/assets/ihl/textures/items/dustTrona.png create mode 100644 src/main/java/assets/ihl/textures/items/dustTungsten.png create mode 100644 src/main/java/assets/ihl/textures/items/dustTungstenOxide.png create mode 100644 src/main/java/assets/ihl/textures/items/dustTungsticAcid.png create mode 100644 src/main/java/assets/ihl/textures/items/dustWood.png create mode 100644 src/main/java/assets/ihl/textures/items/electricMotorLVLEDC.png create mode 100644 src/main/java/assets/ihl/textures/items/electrolysisBathPorcelain.png create mode 100644 src/main/java/assets/ihl/textures/items/electrolysisBathRawPorcelain.png create mode 100644 src/main/java/assets/ihl/textures/items/extruderSetOfMoldedPartsSteel.png create mode 100644 src/main/java/assets/ihl/textures/items/fabric.png create mode 100644 src/main/java/assets/ihl/textures/items/fiberGlass.png create mode 100644 src/main/java/assets/ihl/textures/items/fiberGlassDieSteel.png create mode 100644 src/main/java/assets/ihl/textures/items/flexibleCableCopperVulcanizedRubber2.png create mode 100644 src/main/java/assets/ihl/textures/items/flexibleCableSteel2.png create mode 100644 src/main/java/assets/ihl/textures/items/foilCopper.png create mode 100644 src/main/java/assets/ihl/textures/items/foilGold.png create mode 100644 src/main/java/assets/ihl/textures/items/foilLead.png create mode 100644 src/main/java/assets/ihl/textures/items/foilMica.png create mode 100644 src/main/java/assets/ihl/textures/items/foilRubber.png create mode 100644 src/main/java/assets/ihl/textures/items/foilRubberWithSulfur.png create mode 100644 src/main/java/assets/ihl/textures/items/foilSteel.png create mode 100644 src/main/java/assets/ihl/textures/items/foilTungsten.png create mode 100644 src/main/java/assets/ihl/textures/items/gaedesPumpBarrelPorcelain.png create mode 100644 src/main/java/assets/ihl/textures/items/gaedesPumpBarrelRawPorcelain.png create mode 100644 src/main/java/assets/ihl/textures/items/gasJetSteel.png create mode 100644 src/main/java/assets/ihl/textures/items/gasReducerSteel.png create mode 100644 src/main/java/assets/ihl/textures/items/gemApatite.png create mode 100644 src/main/java/assets/ihl/textures/items/glassBlowingTubeSteel.png create mode 100644 src/main/java/assets/ihl/textures/items/graverSteel.png create mode 100644 src/main/java/assets/ihl/textures/items/graverSteelHardened.png create mode 100644 src/main/java/assets/ihl/textures/items/graverSteelHot.png create mode 100644 src/main/java/assets/ihl/textures/items/grindstone.png create mode 100644 src/main/java/assets/ihl/textures/items/gu-81m.png create mode 100644 src/main/java/assets/ihl/textures/items/guidebook.png create mode 100644 src/main/java/assets/ihl/textures/items/hackSawSteel.png create mode 100644 src/main/java/assets/ihl/textures/items/hallSensor.png create mode 100644 src/main/java/assets/ihl/textures/items/hammer.png create mode 100644 src/main/java/assets/ihl/textures/items/hammerBronze.png create mode 100644 src/main/java/assets/ihl/textures/items/handDrillBronze.png create mode 100644 src/main/java/assets/ihl/textures/items/handDrillSetOfMoldedPartsBronze.png create mode 100644 src/main/java/assets/ihl/textures/items/highPressureVesselSteel.png create mode 100644 src/main/java/assets/ihl/textures/items/highVoltageCapacitor.png create mode 100644 src/main/java/assets/ihl/textures/items/ignitron.png create mode 100644 src/main/java/assets/ihl/textures/items/incisorSteel.png create mode 100644 src/main/java/assets/ihl/textures/items/incisorSteelDiamondCoated.png create mode 100644 src/main/java/assets/ihl/textures/items/ingotCalciumSoap.png create mode 100644 src/main/java/assets/ihl/textures/items/ingotHotSteel.png create mode 100644 src/main/java/assets/ihl/textures/items/ingotHotTungsten.png create mode 100644 src/main/java/assets/ihl/textures/items/ingotLithium.png create mode 100644 src/main/java/assets/ihl/textures/items/ingotMagnesium.png create mode 100644 src/main/java/assets/ihl/textures/items/ingotPotassium.png create mode 100644 src/main/java/assets/ihl/textures/items/ingotStearin.png create mode 100644 src/main/java/assets/ihl/textures/items/ingotTarPitch.png create mode 100644 src/main/java/assets/ihl/textures/items/ingotTungsten.png create mode 100644 src/main/java/assets/ihl/textures/items/insulatorPorcelain.png create mode 100644 src/main/java/assets/ihl/textures/items/insulatorRawPorcelain.png create mode 100644 src/main/java/assets/ihl/textures/items/itemAdvancedElectricHandpump.png create mode 100644 src/main/java/assets/ihl/textures/items/itemCellAcetylene.png create mode 100644 src/main/java/assets/ihl/textures/items/itemCellAmmonia.png create mode 100644 src/main/java/assets/ihl/textures/items/itemCellAquaRegia.png create mode 100644 src/main/java/assets/ihl/textures/items/itemCellBlueVitriolDissolvedInWater.png create mode 100644 src/main/java/assets/ihl/textures/items/itemCellCablingColophony.png create mode 100644 src/main/java/assets/ihl/textures/items/itemCellChlorine.png create mode 100644 src/main/java/assets/ihl/textures/items/itemCellFuel.png create mode 100644 src/main/java/assets/ihl/textures/items/itemCellFuelOil.png create mode 100644 src/main/java/assets/ihl/textures/items/itemCellGlycerol.png create mode 100644 src/main/java/assets/ihl/textures/items/itemCellHydrogen.png create mode 100644 src/main/java/assets/ihl/textures/items/itemCellHydrogenChloride.png create mode 100644 src/main/java/assets/ihl/textures/items/itemCellLimemilk.png create mode 100644 src/main/java/assets/ihl/textures/items/itemCellLiquidGlass.png create mode 100644 src/main/java/assets/ihl/textures/items/itemCellMercury.png create mode 100644 src/main/java/assets/ihl/textures/items/itemCellMethanol.png create mode 100644 src/main/java/assets/ihl/textures/items/itemCellMineralOil.png create mode 100644 src/main/java/assets/ihl/textures/items/itemCellMoltenBronze.png create mode 100644 src/main/java/assets/ihl/textures/items/itemCellMoltenSteel.png create mode 100644 src/main/java/assets/ihl/textures/items/itemCellNatriumHydroxideDissolvedInWater.png create mode 100644 src/main/java/assets/ihl/textures/items/itemCellNatriumTungstateDissolvedInWater.png create mode 100644 src/main/java/assets/ihl/textures/items/itemCellNickelSulfateDissolvedInWater.png create mode 100644 src/main/java/assets/ihl/textures/items/itemCellNitricAcid.png create mode 100644 src/main/java/assets/ihl/textures/items/itemCellNitroGlycerin.png create mode 100644 src/main/java/assets/ihl/textures/items/itemCellNitrogen.png create mode 100644 src/main/java/assets/ihl/textures/items/itemCellOil.png create mode 100644 src/main/java/assets/ihl/textures/items/itemCellOleicAcid.png create mode 100644 src/main/java/assets/ihl/textures/items/itemCellOsmiumTetroxide.png create mode 100644 src/main/java/assets/ihl/textures/items/itemCellOxygen.png create mode 100644 src/main/java/assets/ihl/textures/items/itemCellSaltWater.png create mode 100644 src/main/java/assets/ihl/textures/items/itemCellSeedOil.png create mode 100644 src/main/java/assets/ihl/textures/items/itemCellSiliconTetrachloride.png create mode 100644 src/main/java/assets/ihl/textures/items/itemCellSodiumPeroxide.png create mode 100644 src/main/java/assets/ihl/textures/items/itemCellSpruceResin.png create mode 100644 src/main/java/assets/ihl/textures/items/itemCellSulfuricAcid.png create mode 100644 src/main/java/assets/ihl/textures/items/itemCellSulfuricAnhydride.png create mode 100644 src/main/java/assets/ihl/textures/items/itemCellTrichlorosilane.png create mode 100644 src/main/java/assets/ihl/textures/items/itemCellTurpentine.png create mode 100644 src/main/java/assets/ihl/textures/items/itemCellVapourSulfuricAcid.png create mode 100644 src/main/java/assets/ihl/textures/items/itemCellfluidRubberTreeSap.png create mode 100644 src/main/java/assets/ihl/textures/items/itemElectricHandpump.png create mode 100644 src/main/java/assets/ihl/textures/items/itemTDITFT.png create mode 100644 src/main/java/assets/ihl/textures/items/itemTDITFT_1.png create mode 100644 src/main/java/assets/ihl/textures/items/lampHolderPorcelain.png create mode 100644 src/main/java/assets/ihl/textures/items/lampHolderRawPorcelain.png create mode 100644 src/main/java/assets/ihl/textures/items/latheSetOfMoldedPartsSteel.png create mode 100644 src/main/java/assets/ihl/textures/items/leadAcidBattery.png create mode 100644 src/main/java/assets/ihl/textures/items/linerIronGraphite.png create mode 100644 src/main/java/assets/ihl/textures/items/linerIronGraphiteGreased.png create mode 100644 src/main/java/assets/ihl/textures/items/linerIronGraphiteHot.png create mode 100644 src/main/java/assets/ihl/textures/items/machineCasingSetOfPartsSteel.png create mode 100644 src/main/java/assets/ihl/textures/items/mercuryThermometer.png create mode 100644 src/main/java/assets/ihl/textures/items/meshGlass.png create mode 100644 src/main/java/assets/ihl/textures/items/mixerSteel.png create mode 100644 src/main/java/assets/ihl/textures/items/muttonLard.png create mode 100644 src/main/java/assets/ihl/textures/items/nailSteel.png create mode 100644 src/main/java/assets/ihl/textures/items/needleFile.png create mode 100644 src/main/java/assets/ihl/textures/items/nuggetTarPitch.png create mode 100644 src/main/java/assets/ihl/textures/items/nutM10x1Steel.png create mode 100644 src/main/java/assets/ihl/textures/items/ovenRawPorcelain.png create mode 100644 src/main/java/assets/ihl/textures/items/pencil.png create mode 100644 src/main/java/assets/ihl/textures/items/pipeRubberWithSulfur.png create mode 100644 src/main/java/assets/ihl/textures/items/pipeVulcanizedRubber.png create mode 100644 src/main/java/assets/ihl/textures/items/pipelineAccessoriesSteel.png create mode 100644 src/main/java/assets/ihl/textures/items/pistonCylinderSteel.png create mode 100644 src/main/java/assets/ihl/textures/items/plateCoal.png create mode 100644 src/main/java/assets/ihl/textures/items/plateGraphite.png create mode 100644 src/main/java/assets/ihl/textures/items/plateHotSteel.png create mode 100644 src/main/java/assets/ihl/textures/items/plateHotTungsten.png create mode 100644 src/main/java/assets/ihl/textures/items/plateMica.png create mode 100644 src/main/java/assets/ihl/textures/items/plateNonVulcanizedRubber.png create mode 100644 src/main/java/assets/ihl/textures/items/plateRawCoal.png create mode 100644 src/main/java/assets/ihl/textures/items/plateTungsten.png create mode 100644 src/main/java/assets/ihl/textures/items/polishingPucksSteel.png create mode 100644 src/main/java/assets/ihl/textures/items/ringFerrite.png create mode 100644 src/main/java/assets/ihl/textures/items/ringPorcelain.png create mode 100644 src/main/java/assets/ihl/textures/items/ringRawFerrite.png create mode 100644 src/main/java/assets/ihl/textures/items/ringRawPorcelain.png create mode 100644 src/main/java/assets/ihl/textures/items/rollingMachineSetOfMoldedPartsSteel.png create mode 100644 src/main/java/assets/ihl/textures/items/sawBladeSteel.png create mode 100644 src/main/java/assets/ihl/textures/items/sawBladeSteelHardened.png create mode 100644 src/main/java/assets/ihl/textures/items/sawBladeSteelHot.png create mode 100644 src/main/java/assets/ihl/textures/items/setOfDies1_5sqmm.png create mode 100644 src/main/java/assets/ihl/textures/items/setOfDies24sqmm.png create mode 100644 src/main/java/assets/ihl/textures/items/setOfFilesSteel.png create mode 100644 src/main/java/assets/ihl/textures/items/setOfPartsForLVElemotorSteel.png create mode 100644 src/main/java/assets/ihl/textures/items/setOfPartsGasReducerSteel.png create mode 100644 src/main/java/assets/ihl/textures/items/shaftSteel.png create mode 100644 src/main/java/assets/ihl/textures/items/sharpenedCarvingKnifeBronze.png create mode 100644 src/main/java/assets/ihl/textures/items/skull.png create mode 100644 src/main/java/assets/ihl/textures/items/smallRoundPolishedSteel.png create mode 100644 src/main/java/assets/ihl/textures/items/smallRoundSteel.png create mode 100644 src/main/java/assets/ihl/textures/items/springSteel.png create mode 100644 src/main/java/assets/ihl/textures/items/steelWire.png create mode 100644 src/main/java/assets/ihl/textures/items/steelWire16x.png create mode 100644 src/main/java/assets/ihl/textures/items/stickBoronCarbide.png create mode 100644 src/main/java/assets/ihl/textures/items/stickCoal.png create mode 100644 src/main/java/assets/ihl/textures/items/stickCoalElectrodePremix.png create mode 100644 src/main/java/assets/ihl/textures/items/stickGraphite.png create mode 100644 src/main/java/assets/ihl/textures/items/stickSteel.png create mode 100644 src/main/java/assets/ihl/textures/items/tapM10x1Steel.png create mode 100644 src/main/java/assets/ihl/textures/items/tapM10x1SteelHardened.png create mode 100644 src/main/java/assets/ihl/textures/items/tapM10x1SteelHot.png create mode 100644 src/main/java/assets/ihl/textures/items/tapS10x2Steel.png create mode 100644 src/main/java/assets/ihl/textures/items/tinSnipsSteel.png create mode 100644 src/main/java/assets/ihl/textures/items/toolHeadHammerSmallSteel.png create mode 100644 src/main/java/assets/ihl/textures/items/toolTinSnipsPartsSteel.png create mode 100644 src/main/java/assets/ihl/textures/items/turboCompressorSetOfMoldedPartsBronze.png create mode 100644 src/main/java/assets/ihl/textures/items/vacuumSwitch.png create mode 100644 src/main/java/assets/ihl/textures/items/valveTube1C21P.png create mode 100644 src/main/java/assets/ihl/textures/items/viseSetOfMoldedPartsSteel.png create mode 100644 src/main/java/assets/ihl/textures/items/viseSteel.png create mode 100644 src/main/java/assets/ihl/textures/particles/blast.png create mode 100644 src/main/java/assets/ihl/textures/particles/blob.png create mode 100644 src/main/java/assets/ihl/textures/particles/blobOfResin.png create mode 100644 src/main/java/assets/ihl/textures/particles/explosion.png create mode 100644 src/main/java/assets/ihl/textures/particles/flameTongue.png create mode 100644 src/main/java/gregtech/api/GregTech_API.java create mode 100644 src/main/java/gregtech/api/damagesources/GT_DamageSources.java create mode 100644 src/main/java/gregtech/api/enums/ConfigCategories.java create mode 100644 src/main/java/gregtech/api/enums/Dyes.java create mode 100644 src/main/java/gregtech/api/enums/Element.java create mode 100644 src/main/java/gregtech/api/enums/GT_Values.java create mode 100644 src/main/java/gregtech/api/enums/ItemList.java create mode 100644 src/main/java/gregtech/api/enums/Materials.java create mode 100644 src/main/java/gregtech/api/enums/OreDictNames.java create mode 100644 src/main/java/gregtech/api/enums/OrePrefixes.java create mode 100644 src/main/java/gregtech/api/enums/SubTag.java create mode 100644 src/main/java/gregtech/api/enums/TC_Aspects.java create mode 100644 src/main/java/gregtech/api/enums/TextureSet.java create mode 100644 src/main/java/gregtech/api/enums/Textures.java create mode 100644 src/main/java/gregtech/api/enums/Tier.java create mode 100644 src/main/java/gregtech/api/enums/ToolDictNames.java create mode 100644 src/main/java/gregtech/api/events/BlockScanningEvent.java create mode 100644 src/main/java/gregtech/api/gui/GT_Container.java create mode 100644 src/main/java/gregtech/api/gui/GT_ContainerMetaTile_Machine.java create mode 100644 src/main/java/gregtech/api/gui/GT_Container_1by1.java create mode 100644 src/main/java/gregtech/api/gui/GT_Container_2by2.java create mode 100644 src/main/java/gregtech/api/gui/GT_Container_3by3.java create mode 100644 src/main/java/gregtech/api/gui/GT_Container_4by4.java create mode 100644 src/main/java/gregtech/api/gui/GT_Container_BasicMachine.java create mode 100644 src/main/java/gregtech/api/gui/GT_Container_BasicTank.java create mode 100644 src/main/java/gregtech/api/gui/GT_Container_MaintenanceHatch.java create mode 100644 src/main/java/gregtech/api/gui/GT_Container_MultiMachine.java create mode 100644 src/main/java/gregtech/api/gui/GT_GUIContainer.java create mode 100644 src/main/java/gregtech/api/gui/GT_GUIContainerMetaTile_Machine.java create mode 100644 src/main/java/gregtech/api/gui/GT_GUIContainer_1by1.java create mode 100644 src/main/java/gregtech/api/gui/GT_GUIContainer_2by2.java create mode 100644 src/main/java/gregtech/api/gui/GT_GUIContainer_3by3.java create mode 100644 src/main/java/gregtech/api/gui/GT_GUIContainer_4by4.java create mode 100644 src/main/java/gregtech/api/gui/GT_GUIContainer_BasicMachine.java create mode 100644 src/main/java/gregtech/api/gui/GT_GUIContainer_BasicTank.java create mode 100644 src/main/java/gregtech/api/gui/GT_GUIContainer_MaintenanceHatch.java create mode 100644 src/main/java/gregtech/api/gui/GT_GUIContainer_MultiMachine.java create mode 100644 src/main/java/gregtech/api/gui/GT_Slot_Armor.java create mode 100644 src/main/java/gregtech/api/gui/GT_Slot_DataOrb.java create mode 100644 src/main/java/gregtech/api/gui/GT_Slot_Holo.java create mode 100644 src/main/java/gregtech/api/gui/GT_Slot_Output.java create mode 100644 src/main/java/gregtech/api/gui/GT_Slot_Render.java create mode 100644 src/main/java/gregtech/api/interfaces/IColorModulationContainer.java create mode 100644 src/main/java/gregtech/api/interfaces/ICondition.java create mode 100644 src/main/java/gregtech/api/interfaces/IDamagableItem.java create mode 100644 src/main/java/gregtech/api/interfaces/IDebugableBlock.java create mode 100644 src/main/java/gregtech/api/interfaces/IDescribable.java create mode 100644 src/main/java/gregtech/api/interfaces/IFoodStat.java create mode 100644 src/main/java/gregtech/api/interfaces/IIconContainer.java create mode 100644 src/main/java/gregtech/api/interfaces/IItemBehaviour.java create mode 100644 src/main/java/gregtech/api/interfaces/IItemContainer.java create mode 100644 src/main/java/gregtech/api/interfaces/IOreRecipeRegistrator.java create mode 100644 src/main/java/gregtech/api/interfaces/IProjectileItem.java create mode 100644 src/main/java/gregtech/api/interfaces/IRedstoneCircuitBlock.java create mode 100644 src/main/java/gregtech/api/interfaces/ISubTagContainer.java create mode 100644 src/main/java/gregtech/api/interfaces/ITexture.java create mode 100644 src/main/java/gregtech/api/interfaces/IToolStats.java create mode 100644 src/main/java/gregtech/api/interfaces/internal/IBCTileEntity.java create mode 100644 src/main/java/gregtech/api/interfaces/internal/IGT_CraftingRecipe.java create mode 100644 src/main/java/gregtech/api/interfaces/internal/IGT_Mod.java create mode 100644 src/main/java/gregtech/api/interfaces/internal/IGT_RecipeAdder.java create mode 100644 src/main/java/gregtech/api/interfaces/internal/IIC2TileEntity.java create mode 100644 src/main/java/gregtech/api/interfaces/internal/IThaumcraftCompat.java create mode 100644 src/main/java/gregtech/api/interfaces/internal/IUETileEntity.java create mode 100644 src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java create mode 100644 src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntityCable.java create mode 100644 src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntityItemPipe.java create mode 100644 src/main/java/gregtech/api/interfaces/tileentity/IBasicEnergyContainer.java create mode 100644 src/main/java/gregtech/api/interfaces/tileentity/IColoredTileEntity.java create mode 100644 src/main/java/gregtech/api/interfaces/tileentity/ICoverable.java create mode 100644 src/main/java/gregtech/api/interfaces/tileentity/IDigitalChest.java create mode 100644 src/main/java/gregtech/api/interfaces/tileentity/IEnergyConductor.java create mode 100644 src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java create mode 100644 src/main/java/gregtech/api/interfaces/tileentity/IExperimentalEnergyTileEntity.java create mode 100644 src/main/java/gregtech/api/interfaces/tileentity/IFibreConnected.java create mode 100644 src/main/java/gregtech/api/interfaces/tileentity/IGearEnergyTileEntity.java create mode 100644 src/main/java/gregtech/api/interfaces/tileentity/IGregTechDeviceInformation.java create mode 100644 src/main/java/gregtech/api/interfaces/tileentity/IGregTechTileEntity.java create mode 100644 src/main/java/gregtech/api/interfaces/tileentity/IHasInventory.java create mode 100644 src/main/java/gregtech/api/interfaces/tileentity/IHasWorldObjectAndCoords.java create mode 100644 src/main/java/gregtech/api/interfaces/tileentity/IMachineBlockUpdateable.java create mode 100644 src/main/java/gregtech/api/interfaces/tileentity/IMachineProgress.java create mode 100644 src/main/java/gregtech/api/interfaces/tileentity/IPipeRenderedTileEntity.java create mode 100644 src/main/java/gregtech/api/interfaces/tileentity/IRedstoneEmitter.java create mode 100644 src/main/java/gregtech/api/interfaces/tileentity/IRedstoneReceiver.java create mode 100644 src/main/java/gregtech/api/interfaces/tileentity/IRedstoneTileEntity.java create mode 100644 src/main/java/gregtech/api/interfaces/tileentity/ITexturedTileEntity.java create mode 100644 src/main/java/gregtech/api/interfaces/tileentity/ITurnable.java create mode 100644 src/main/java/gregtech/api/interfaces/tileentity/IUpgradableMachine.java create mode 100644 src/main/java/gregtech/api/items/GT_CoolantCellIC_Item.java create mode 100644 src/main/java/gregtech/api/items/GT_CoolantCell_Item.java create mode 100644 src/main/java/gregtech/api/items/GT_EnergyArmor_Item.java create mode 100644 src/main/java/gregtech/api/items/GT_Generic_Block.java create mode 100644 src/main/java/gregtech/api/items/GT_Generic_Item.java create mode 100644 src/main/java/gregtech/api/items/GT_MetaBase_Item.java create mode 100644 src/main/java/gregtech/api/items/GT_MetaGenerated_Item.java create mode 100644 src/main/java/gregtech/api/items/GT_MetaGenerated_Item_X01.java create mode 100644 src/main/java/gregtech/api/items/GT_MetaGenerated_Item_X32.java create mode 100644 src/main/java/gregtech/api/items/GT_MetaGenerated_Tool.java create mode 100644 src/main/java/gregtech/api/items/GT_RadioactiveCellIC_Item.java create mode 100644 src/main/java/gregtech/api/items/GT_RadioactiveCell_Item.java create mode 100644 src/main/java/gregtech/api/items/GT_SolderingTool_Item.java create mode 100644 src/main/java/gregtech/api/items/GT_Spray_Bug_Item.java create mode 100644 src/main/java/gregtech/api/items/GT_Spray_Foam_Item.java create mode 100644 src/main/java/gregtech/api/items/GT_Spray_Hardener_Item.java create mode 100644 src/main/java/gregtech/api/items/GT_Spray_Hydration_Item.java create mode 100644 src/main/java/gregtech/api/items/GT_Spray_Ice_Item.java create mode 100644 src/main/java/gregtech/api/items/GT_Spray_Pepper_Item.java create mode 100644 src/main/java/gregtech/api/items/GT_Tool_Item.java create mode 100644 src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java create mode 100644 src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java create mode 100644 src/main/java/gregtech/api/metatileentity/BaseMetaTileEntityUE.java create mode 100644 src/main/java/gregtech/api/metatileentity/BaseTileEntity.java create mode 100644 src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java create mode 100644 src/main/java/gregtech/api/metatileentity/MetaTileEntity.java create mode 100644 src/main/java/gregtech/api/metatileentity/examples/GT_MetaTileEntity_E_Furnace.java create mode 100644 src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java create mode 100644 src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java create mode 100644 src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Frame.java create mode 100644 src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java create mode 100644 src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBatteryBuffer.java create mode 100644 src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java create mode 100644 src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicHull.java create mode 100644 src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicHull_NonElectric.java create mode 100644 src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java create mode 100644 src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_Bronze.java create mode 100644 src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java create mode 100644 src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_Steel.java create mode 100644 src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicTank.java create mode 100644 src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java create mode 100644 src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch.java create mode 100644 src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Dynamo.java create mode 100644 src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Energy.java create mode 100644 src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Input.java create mode 100644 src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBus.java create mode 100644 src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Maintenance.java create mode 100644 src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java create mode 100644 src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Output.java create mode 100644 src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBus.java create mode 100644 src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java create mode 100644 src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_TieredMachineBlock.java create mode 100644 src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Transformer.java create mode 100644 src/main/java/gregtech/api/net/GT_Packet.java create mode 100644 src/main/java/gregtech/api/net/GT_Packet_Block_Event.java create mode 100644 src/main/java/gregtech/api/net/GT_Packet_Sound.java create mode 100644 src/main/java/gregtech/api/net/GT_Packet_TileEntity.java create mode 100644 src/main/java/gregtech/api/net/IGT_NetworkHandler.java create mode 100644 src/main/java/gregtech/api/objects/ElementStack.java create mode 100644 src/main/java/gregtech/api/objects/GT_ArrayList.java create mode 100644 src/main/java/gregtech/api/objects/GT_CopiedBlockTexture.java create mode 100644 src/main/java/gregtech/api/objects/GT_Cover_Default.java create mode 100644 src/main/java/gregtech/api/objects/GT_Cover_None.java create mode 100644 src/main/java/gregtech/api/objects/GT_Fluid.java create mode 100644 src/main/java/gregtech/api/objects/GT_FluidStack.java create mode 100644 src/main/java/gregtech/api/objects/GT_HashSet.java create mode 100644 src/main/java/gregtech/api/objects/GT_ItemStack.java create mode 100644 src/main/java/gregtech/api/objects/GT_MultiTexture.java create mode 100644 src/main/java/gregtech/api/objects/GT_RenderedTexture.java create mode 100644 src/main/java/gregtech/api/objects/GT_SidedTexture.java create mode 100644 src/main/java/gregtech/api/objects/ItemData.java create mode 100644 src/main/java/gregtech/api/objects/MaterialStack.java create mode 100644 src/main/java/gregtech/api/threads/GT_Runnable_MachineBlockUpdate.java create mode 100644 src/main/java/gregtech/api/threads/GT_Runnable_Sound.java create mode 100644 src/main/java/gregtech/api/util/GT_BaseCrop.java create mode 100644 src/main/java/gregtech/api/util/GT_CircuitryBehavior.java create mode 100644 src/main/java/gregtech/api/util/GT_Config.java create mode 100644 src/main/java/gregtech/api/util/GT_CoverBehavior.java create mode 100644 src/main/java/gregtech/api/util/GT_CreativeTab.java create mode 100644 src/main/java/gregtech/api/util/GT_FoodStat.java create mode 100644 src/main/java/gregtech/api/util/GT_IBoxableWrapper.java create mode 100644 src/main/java/gregtech/api/util/GT_ItsNotMyFaultException.java create mode 100644 src/main/java/gregtech/api/util/GT_LanguageManager.java create mode 100644 src/main/java/gregtech/api/util/GT_Log.java create mode 100644 src/main/java/gregtech/api/util/GT_ModHandler.java create mode 100644 src/main/java/gregtech/api/util/GT_OreDictUnificator.java create mode 100644 src/main/java/gregtech/api/util/GT_PlayedSound.java create mode 100644 src/main/java/gregtech/api/util/GT_Recipe.java create mode 100644 src/main/java/gregtech/api/util/GT_RecipeRegistrator.java create mode 100644 src/main/java/gregtech/api/util/GT_Shaped_Recipe.java create mode 100644 src/main/java/gregtech/api/util/GT_Shapeless_Recipe.java create mode 100644 src/main/java/gregtech/api/util/GT_SpawnEventHandler.java create mode 100644 src/main/java/gregtech/api/util/GT_Utility.java create mode 100644 src/main/java/gregtech/api/world/GT_Worldgen.java create mode 100644 src/main/java/gregtech/api/world/GT_Worldgen_Boulder.java create mode 100644 src/main/java/gregtech/api/world/GT_Worldgen_Ore.java create mode 100644 src/main/java/gregtech/api/world/GT_Worldgen_Ore_Normal.java create mode 100644 src/main/java/gregtech/api/world/GT_Worldgen_Ore_SingleBlock.java create mode 100644 src/main/java/gregtech/api/world/GT_Worldgen_Ore_SingleBlock_UnderLava.java create mode 100644 src/main/java/gregtech/common/covers/GT_Cover_Arm.java create mode 100644 src/main/java/gregtech/common/covers/GT_Cover_Blastproof.java create mode 100644 src/main/java/gregtech/common/covers/GT_Cover_ControlsWork.java create mode 100644 src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java create mode 100644 src/main/java/gregtech/common/covers/GT_Cover_Crafting.java create mode 100644 src/main/java/gregtech/common/covers/GT_Cover_DoesWork.java create mode 100644 src/main/java/gregtech/common/covers/GT_Cover_Drain.java create mode 100644 src/main/java/gregtech/common/covers/GT_Cover_EUMeter.java create mode 100644 src/main/java/gregtech/common/covers/GT_Cover_EnergyOnly.java create mode 100644 src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java create mode 100644 src/main/java/gregtech/common/covers/GT_Cover_Lens.java create mode 100644 src/main/java/gregtech/common/covers/GT_Cover_LiquidMeter.java create mode 100644 src/main/java/gregtech/common/covers/GT_Cover_NeedMaintainance.java create mode 100644 src/main/java/gregtech/common/covers/GT_Cover_PlayerDetector.java create mode 100644 src/main/java/gregtech/common/covers/GT_Cover_Pump.java create mode 100644 src/main/java/gregtech/common/covers/GT_Cover_RedstoneConductor.java create mode 100644 src/main/java/gregtech/common/covers/GT_Cover_RedstoneReceiverExternal.java create mode 100644 src/main/java/gregtech/common/covers/GT_Cover_RedstoneReceiverInternal.java create mode 100644 src/main/java/gregtech/common/covers/GT_Cover_RedstoneSignalizer.java create mode 100644 src/main/java/gregtech/common/covers/GT_Cover_RedstoneTransmitterExternal.java create mode 100644 src/main/java/gregtech/common/covers/GT_Cover_RedstoneTransmitterInternal.java create mode 100644 src/main/java/gregtech/common/covers/GT_Cover_RedstoneWirelessBase.java create mode 100644 src/main/java/gregtech/common/covers/GT_Cover_Screen.java create mode 100644 src/main/java/gregtech/common/covers/GT_Cover_Shutter.java create mode 100644 src/main/java/gregtech/common/covers/GT_Cover_SolarPanel.java create mode 100644 src/main/java/gregtech/common/covers/GT_Cover_Vent.java create mode 100644 src/main/java/gregtech/common/entities/GT_Entity_Arrow.java create mode 100644 src/main/java/gregtech/common/entities/GT_Entity_Arrow_Potion.java create mode 100644 src/main/java/gregtech/common/gui/GT_Container_Boiler.java create mode 100644 src/main/java/gregtech/common/gui/GT_Container_BronzeBlastFurnace.java create mode 100644 src/main/java/gregtech/common/gui/GT_Container_ChestBuffer.java create mode 100644 src/main/java/gregtech/common/gui/GT_Container_Filter.java create mode 100644 src/main/java/gregtech/common/gui/GT_Container_QuantumChest.java create mode 100644 src/main/java/gregtech/common/gui/GT_Container_Regulator.java create mode 100644 src/main/java/gregtech/common/gui/GT_Container_SuperBuffer.java create mode 100644 src/main/java/gregtech/common/gui/GT_Container_TypeFilter.java create mode 100644 src/main/java/gregtech/common/gui/GT_GUIContainer_Boiler.java create mode 100644 src/main/java/gregtech/common/gui/GT_GUIContainer_BronzeBlastFurnace.java create mode 100644 src/main/java/gregtech/common/gui/GT_GUIContainer_ChestBuffer.java create mode 100644 src/main/java/gregtech/common/gui/GT_GUIContainer_Filter.java create mode 100644 src/main/java/gregtech/common/gui/GT_GUIContainer_FusionReactor.java create mode 100644 src/main/java/gregtech/common/gui/GT_GUIContainer_QuantumChest.java create mode 100644 src/main/java/gregtech/common/gui/GT_GUIContainer_Regulator.java create mode 100644 src/main/java/gregtech/common/gui/GT_GUIContainer_SuperBuffer.java create mode 100644 src/main/java/gregtech/common/gui/GT_GUIContainer_TypeFilter.java create mode 100644 src/main/java/gregtech/common/redstonecircuits/GT_Circuit_BasicLogic.java create mode 100644 src/main/java/gregtech/common/redstonecircuits/GT_Circuit_BitAnd.java create mode 100644 src/main/java/gregtech/common/redstonecircuits/GT_Circuit_CombinationLock.java create mode 100644 src/main/java/gregtech/common/redstonecircuits/GT_Circuit_Equals.java create mode 100644 src/main/java/gregtech/common/redstonecircuits/GT_Circuit_Pulser.java create mode 100644 src/main/java/gregtech/common/redstonecircuits/GT_Circuit_Randomizer.java create mode 100644 src/main/java/gregtech/common/redstonecircuits/GT_Circuit_RedstoneMeter.java create mode 100644 src/main/java/gregtech/common/redstonecircuits/GT_Circuit_Repeater.java create mode 100644 src/main/java/gregtech/common/redstonecircuits/GT_Circuit_Timer.java create mode 100644 src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ChestBuffer.java create mode 100644 src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Filter.java create mode 100644 src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Regulator.java create mode 100644 src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_SuperBuffer.java create mode 100644 src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_TypeFilter.java create mode 100644 src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler.java create mode 100644 src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java create mode 100644 src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Lava.java create mode 100644 src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar.java create mode 100644 src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Steel.java create mode 100644 src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java create mode 100644 src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_FluidNaquadahReactor.java create mode 100644 src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java create mode 100644 src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicEnergyConverter.java create mode 100644 src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java create mode 100644 src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_PlasmaGenerator.java create mode 100644 src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SolidNaquadahReactor.java create mode 100644 src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SteamTurbine.java create mode 100644 src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Bronze.java create mode 100644 src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_BronzeBricks.java create mode 100644 src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Steel.java create mode 100644 src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_SteelBricks.java create mode 100644 src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Bronze.java create mode 100644 src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Steel.java create mode 100644 src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Bronze.java create mode 100644 src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Steel.java create mode 100644 src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Bronze.java create mode 100644 src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Steel.java create mode 100644 src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Bronze.java create mode 100644 src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Steel.java create mode 100644 src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Bronze.java create mode 100644 src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Steel.java create mode 100644 src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Bronze.java create mode 100644 src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Steel.java create mode 100644 src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_Locker.java create mode 100644 src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumChest.java create mode 100644 src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumTank.java create mode 100644 src/main/java/gregtech/nei/GT_NEI_DefaultHandler.java create mode 100644 src/main/java/gregtech/nei/NEI_GT_Config.java create mode 100644 src/main/java/ihl/ClientProxy.java create mode 100644 src/main/java/ihl/IHLCreativeTab.java create mode 100644 src/main/java/ihl/IHLMod.java create mode 100644 src/main/java/ihl/IHLModConfig.java create mode 100644 src/main/java/ihl/IHLModInfo.java create mode 100644 src/main/java/ihl/ServerProxy.java create mode 100644 src/main/java/ihl/crop_harvestors/BlobEntityFX.java create mode 100644 src/main/java/ihl/crop_harvestors/BlobRenderFX.java create mode 100644 src/main/java/ihl/crop_harvestors/RubberTreeBlock.java create mode 100644 src/main/java/ihl/crop_harvestors/SackBlock.java create mode 100644 src/main/java/ihl/crop_harvestors/SackModel.java create mode 100644 src/main/java/ihl/crop_harvestors/SackRender.java create mode 100644 src/main/java/ihl/crop_harvestors/SackTileEntity.java create mode 100644 src/main/java/ihl/enviroment/LaserHitMirrorEventHandler.java create mode 100644 src/main/java/ihl/enviroment/MirrorBlock.java create mode 100644 src/main/java/ihl/enviroment/MirrorRender.java create mode 100644 src/main/java/ihl/enviroment/MirrorTileEntity.java create mode 100644 src/main/java/ihl/explosion/ChunkAndWorldLoadEventHandler.java create mode 100644 src/main/java/ihl/explosion/DetonatorMiniGUI.java create mode 100644 src/main/java/ihl/explosion/ExplosionEntityFX.java create mode 100644 src/main/java/ihl/explosion/ExplosionRenderFX.java create mode 100644 src/main/java/ihl/explosion/ExplosionVectorBlockV2.java create mode 100644 src/main/java/ihl/explosion/ExplosiveBlock.java create mode 100644 src/main/java/ihl/explosion/ExplosiveTileEntity.java create mode 100644 src/main/java/ihl/explosion/GroundRemoverItem.java create mode 100644 src/main/java/ihl/explosion/IHLEntityFallingPile.java create mode 100644 src/main/java/ihl/explosion/IHLEntityFallingPileRender.java create mode 100644 src/main/java/ihl/explosion/PileBlock.java create mode 100644 src/main/java/ihl/explosion/PileBlockRender.java create mode 100644 src/main/java/ihl/explosion/PileTileEntity.java create mode 100644 src/main/java/ihl/explosion/PileTileEntityRender.java create mode 100644 src/main/java/ihl/explosion/WorldSavedDataBlastWave.java create mode 100644 src/main/java/ihl/flexible_cable/AnchorBlock.java create mode 100644 src/main/java/ihl/flexible_cable/AnchorTileEntity.java create mode 100644 src/main/java/ihl/flexible_cable/BatterySwitchUnitModel.java create mode 100644 src/main/java/ihl/flexible_cable/BatterySwitchUnitTileEntity.java create mode 100644 src/main/java/ihl/flexible_cable/BlastEntityFX.java create mode 100644 src/main/java/ihl/flexible_cable/FlexibleCableHolderBaseTileEntity.java create mode 100644 src/main/java/ihl/flexible_cable/IHLCable.java create mode 100644 src/main/java/ihl/flexible_cable/IHLENet.java create mode 100644 src/main/java/ihl/flexible_cable/IHLGrid.java create mode 100644 src/main/java/ihl/flexible_cable/InvSlotOutputInProgress.java create mode 100644 src/main/java/ihl/flexible_cable/InvSlotProcessableIronWorkbench.java create mode 100644 src/main/java/ihl/flexible_cable/InvSlotTool.java create mode 100644 src/main/java/ihl/flexible_cable/InvSlotWorkspaceElement.java create mode 100644 src/main/java/ihl/flexible_cable/IronWorkbenchContainer.java create mode 100644 src/main/java/ihl/flexible_cable/IronWorkbenchGui.java create mode 100644 src/main/java/ihl/flexible_cable/IronWorkbenchInvSlot.java create mode 100644 src/main/java/ihl/flexible_cable/IronWorkbenchModel.java create mode 100644 src/main/java/ihl/flexible_cable/IronWorkbenchRender.java create mode 100644 src/main/java/ihl/flexible_cable/IronWorkbenchTileEntity.java create mode 100644 src/main/java/ihl/flexible_cable/NodeEntity.java create mode 100644 src/main/java/ihl/flexible_cable/NodeRender.java create mode 100644 src/main/java/ihl/flexible_cable/PowerCableNodeEntity.java create mode 100644 src/main/java/ihl/flexible_cable/RectifierTransformerUnitTileEntity.java create mode 100644 src/main/java/ihl/flexible_cable/SetOfDiesMiniGUI.java create mode 100644 src/main/java/ihl/flexible_cable/SubAnchorEnergyNetNode.java create mode 100644 src/main/java/ihl/flexible_cable/SubRTUEnergyNetNode.java create mode 100644 src/main/java/ihl/handpump/AdvancedHandPump.java create mode 100644 src/main/java/ihl/handpump/BlockWithCoordinates.java create mode 100644 src/main/java/ihl/handpump/IHLHandPump.java create mode 100644 src/main/java/ihl/handpump/XYZ.java create mode 100644 src/main/java/ihl/interfaces/ICableHolder.java create mode 100644 src/main/java/ihl/interfaces/IEnergyNetNode.java create mode 100644 src/main/java/ihl/interfaces/IFluidTankVisual.java create mode 100644 src/main/java/ihl/interfaces/IItemHasMiniGUI.java create mode 100644 src/main/java/ihl/interfaces/IMultiPowerCableHolder.java create mode 100644 src/main/java/ihl/interfaces/INetworkListener.java create mode 100644 src/main/java/ihl/interfaces/ISelectionBoxSpecialRenderer.java create mode 100644 src/main/java/ihl/interfaces/IWire.java create mode 100644 src/main/java/ihl/interfaces/IWorkspaceElement.java create mode 100644 src/main/java/ihl/interfaces/ItemMiniGUI.java create mode 100644 src/main/java/ihl/items_blocks/FiberItem.java create mode 100644 src/main/java/ihl/items_blocks/FlexibleCableItem.java create mode 100644 src/main/java/ihl/items_blocks/FlexiblePipeItem.java create mode 100644 src/main/java/ihl/items_blocks/IHLBucketHandler.java create mode 100644 src/main/java/ihl/items_blocks/IHLFluidBlock.java create mode 100644 src/main/java/ihl/items_blocks/IHLItemBlock.java create mode 100644 src/main/java/ihl/items_blocks/IHLTool.java create mode 100644 src/main/java/ihl/items_blocks/ItemSubstance.java create mode 100644 src/main/java/ihl/items_blocks/MachineBaseBlock.java create mode 100644 src/main/java/ihl/items_blocks/RecipeInputs.java create mode 100644 src/main/java/ihl/metallurgy/constants/Details.java create mode 100644 src/main/java/ihl/metallurgy/constants/ElectricConductor.java create mode 100644 src/main/java/ihl/metallurgy/constants/Insulation.java create mode 100644 src/main/java/ihl/model/CableHolderSelectionBoxSpecialRenderer.java create mode 100644 src/main/java/ihl/model/FlexibleCableItemRender.java create mode 100644 src/main/java/ihl/model/FluidRenderer.java create mode 100644 src/main/java/ihl/model/IHLBlockRenderer.java create mode 100644 src/main/java/ihl/model/IHLModelRenderer.java create mode 100644 src/main/java/ihl/model/IHLToolRenderer.java create mode 100644 src/main/java/ihl/model/ImpregnatingMachineBlockRender.java create mode 100644 src/main/java/ihl/model/IronWorkbenchBlockRender.java create mode 100644 src/main/java/ihl/model/ModelKnee.java create mode 100644 src/main/java/ihl/model/ModelToplessBox.java create mode 100644 src/main/java/ihl/model/ModelTube.java create mode 100644 src/main/java/ihl/model/RectifierTransformerUnitBlockRender.java create mode 100644 src/main/java/ihl/model/RectifierTransformerUnitSelectionBoxSpecialRenderer.java create mode 100644 src/main/java/ihl/model/RefluxCondenserBlockRender.java create mode 100644 src/main/java/ihl/model/RenderInfo.java create mode 100644 src/main/java/ihl/model/UniversalTileRender.java create mode 100644 src/main/java/ihl/nei_integration/AchesonFurnaceRecipeHandler.java create mode 100644 src/main/java/ihl/nei_integration/ChemicalReactorRecipeHandler.java create mode 100644 src/main/java/ihl/nei_integration/CrucibleRecipeHandler.java create mode 100644 src/main/java/ihl/nei_integration/CryogenicDistillerRecipeHandler.java create mode 100644 src/main/java/ihl/nei_integration/DetonationSprayingMachineRecipeHandler.java create mode 100644 src/main/java/ihl/nei_integration/ElectricEvaporatorRecipeHandler.java create mode 100644 src/main/java/ihl/nei_integration/ElectrolysisBathRecipeHandler.java create mode 100644 src/main/java/ihl/nei_integration/EvaporatorRecipeHandler.java create mode 100644 src/main/java/ihl/nei_integration/ExtruderRecipeHandler.java create mode 100644 src/main/java/ihl/nei_integration/FluidizedBedReactorRecipeHandler.java create mode 100644 src/main/java/ihl/nei_integration/FractionationColumnRecipeHandler.java create mode 100644 src/main/java/ihl/nei_integration/GasWeldingStationGasRecipeHandler.java create mode 100644 src/main/java/ihl/nei_integration/IHLBlockHighlightHandler.java create mode 100644 src/main/java/ihl/nei_integration/IHLPositionedStack.java create mode 100644 src/main/java/ihl/nei_integration/IHLRecipeHandler.java create mode 100644 src/main/java/ihl/nei_integration/ImpregnatingMachineRecipeHandler.java create mode 100644 src/main/java/ihl/nei_integration/InjectionMoldRecipeHandler.java create mode 100644 src/main/java/ihl/nei_integration/IronWorkbenchRecipeHandler.java create mode 100644 src/main/java/ihl/nei_integration/LabElectrolyzerRecipeHandler.java create mode 100644 src/main/java/ihl/nei_integration/LeadOvenRecipeHandler.java create mode 100644 src/main/java/ihl/nei_integration/LoomRecipeHandler.java create mode 100644 src/main/java/ihl/nei_integration/MachineRecipeHandler.java create mode 100644 src/main/java/ihl/nei_integration/MuffleFurnaceRecipeHandler.java create mode 100644 src/main/java/ihl/nei_integration/NEIIHLConfig.java create mode 100644 src/main/java/ihl/nei_integration/PaperMachineRecipeHandler.java create mode 100644 src/main/java/ihl/nei_integration/RollingMachineRecipeHandler.java create mode 100644 src/main/java/ihl/nei_integration/VulcanizationExtrudingMoldRecipeHandler.java create mode 100644 src/main/java/ihl/nei_integration/WireMillRecipeHandler.java create mode 100644 src/main/java/ihl/nei_integration/WoodenRollingMachineRecipeHandler.java create mode 100644 src/main/java/ihl/processing/chemistry/ApparatusProcessableInvSlot.java create mode 100644 src/main/java/ihl/processing/chemistry/BasicElectricMotorContainer.java create mode 100644 src/main/java/ihl/processing/chemistry/BatteryItem.java create mode 100644 src/main/java/ihl/processing/chemistry/ChemicalReactorContainer.java create mode 100644 src/main/java/ihl/processing/chemistry/ChemicalReactorGui.java create mode 100644 src/main/java/ihl/processing/chemistry/ChemicalReactorTileEntity.java create mode 100644 src/main/java/ihl/processing/chemistry/CryogenicDistillerContainer.java create mode 100644 src/main/java/ihl/processing/chemistry/CryogenicDistillerGui.java create mode 100644 src/main/java/ihl/processing/chemistry/CryogenicDistillerTileEntity.java create mode 100644 src/main/java/ihl/processing/chemistry/DosingPumpContainer.java create mode 100644 src/main/java/ihl/processing/chemistry/DosingPumpGui.java create mode 100644 src/main/java/ihl/processing/chemistry/DosingPumpTileEntity.java create mode 100644 src/main/java/ihl/processing/chemistry/ElectricEvaporatorBlock.java create mode 100644 src/main/java/ihl/processing/chemistry/ElectricEvaporatorContainer.java create mode 100644 src/main/java/ihl/processing/chemistry/ElectricEvaporatorGui.java create mode 100644 src/main/java/ihl/processing/chemistry/ElectricEvaporatorTileEntity.java create mode 100644 src/main/java/ihl/processing/chemistry/ElectrolysisBathContainer.java create mode 100644 src/main/java/ihl/processing/chemistry/ElectrolysisBathGui.java create mode 100644 src/main/java/ihl/processing/chemistry/ElectrolysisBathModel.java create mode 100644 src/main/java/ihl/processing/chemistry/ElectrolysisBathTileEntity.java create mode 100644 src/main/java/ihl/processing/chemistry/EvaporatorBlock.java create mode 100644 src/main/java/ihl/processing/chemistry/EvaporatorContainer.java create mode 100644 src/main/java/ihl/processing/chemistry/EvaporatorGui.java create mode 100644 src/main/java/ihl/processing/chemistry/EvaporatorTileEntity.java create mode 100644 src/main/java/ihl/processing/chemistry/ExtruderModel.java create mode 100644 src/main/java/ihl/processing/chemistry/FluidizedBedReactorContainer.java create mode 100644 src/main/java/ihl/processing/chemistry/FluidizedBedReactorGui.java create mode 100644 src/main/java/ihl/processing/chemistry/FluidizedBedReactorTileEntity.java create mode 100644 src/main/java/ihl/processing/chemistry/FractionatorBottomModel.java create mode 100644 src/main/java/ihl/processing/chemistry/FractionatorBottomTileEntity.java create mode 100644 src/main/java/ihl/processing/chemistry/FractionatorCoverModel.java create mode 100644 src/main/java/ihl/processing/chemistry/FractionatorCoverTileEntity.java create mode 100644 src/main/java/ihl/processing/chemistry/FractionatorSectionModel.java create mode 100644 src/main/java/ihl/processing/chemistry/FractionatorSectionTileEntity.java create mode 100644 src/main/java/ihl/processing/chemistry/GaedesMercuryRotaryPumpContainer.java create mode 100644 src/main/java/ihl/processing/chemistry/GaedesMercuryRotaryPumpGui.java create mode 100644 src/main/java/ihl/processing/chemistry/GaedesMercuryRotaryPumpModel.java create mode 100644 src/main/java/ihl/processing/chemistry/GaedesMercuryRotaryPumpTileEntity.java create mode 100644 src/main/java/ihl/processing/chemistry/LabElectrolyzerContainer.java create mode 100644 src/main/java/ihl/processing/chemistry/LabElectrolyzerGui.java create mode 100644 src/main/java/ihl/processing/chemistry/LabElectrolyzerTileEntity.java create mode 100644 src/main/java/ihl/processing/chemistry/LeadOvenContainer.java create mode 100644 src/main/java/ihl/processing/chemistry/LeadOvenGui.java create mode 100644 src/main/java/ihl/processing/chemistry/LeadOvenTileEntity.java create mode 100644 src/main/java/ihl/processing/chemistry/LoomContainer.java create mode 100644 src/main/java/ihl/processing/chemistry/LoomGui.java create mode 100644 src/main/java/ihl/processing/chemistry/LoomModel.java create mode 100644 src/main/java/ihl/processing/chemistry/LoomTileEntity.java create mode 100644 src/main/java/ihl/processing/chemistry/PaperMachineContainer.java create mode 100644 src/main/java/ihl/processing/chemistry/PaperMachineGui.java create mode 100644 src/main/java/ihl/processing/chemistry/PaperMachineTileEntity.java create mode 100644 src/main/java/ihl/processing/chemistry/RefluxCondenserModel.java create mode 100644 src/main/java/ihl/processing/chemistry/RefluxCondenserTileEntity.java create mode 100644 src/main/java/ihl/processing/chemistry/SolarEvaporatorContainer.java create mode 100644 src/main/java/ihl/processing/chemistry/SolarEvaporatorGui.java create mode 100644 src/main/java/ihl/processing/chemistry/SolarEvaporatorTileEntity.java create mode 100644 src/main/java/ihl/processing/invslots/IHLInvSlotOutput.java create mode 100644 src/main/java/ihl/processing/invslots/InvSlotConsumableLiquidIHL.java create mode 100644 src/main/java/ihl/processing/invslots/InvSlotUpgradeIHL.java create mode 100644 src/main/java/ihl/processing/invslots/SlotInvSlotIronWorkbench.java create mode 100644 src/main/java/ihl/processing/invslots/SlotInvSlotOutputInProgress.java create mode 100644 src/main/java/ihl/processing/metallurgy/AchesonFurnaceGui.java create mode 100644 src/main/java/ihl/processing/metallurgy/AchesonFurnanceContainer.java create mode 100644 src/main/java/ihl/processing/metallurgy/AchesonFurnanceTileEntity.java create mode 100644 src/main/java/ihl/processing/metallurgy/BasicElectricMotorTileEntity.java create mode 100644 src/main/java/ihl/processing/metallurgy/CoilerContainer.java create mode 100644 src/main/java/ihl/processing/metallurgy/CoilerGui.java create mode 100644 src/main/java/ihl/processing/metallurgy/CoilerModel.java create mode 100644 src/main/java/ihl/processing/metallurgy/CoilerRender.java create mode 100644 src/main/java/ihl/processing/metallurgy/CoilerTileEntity.java create mode 100644 src/main/java/ihl/processing/metallurgy/Crucible.java create mode 100644 src/main/java/ihl/processing/metallurgy/CrucibleContainer.java create mode 100644 src/main/java/ihl/processing/metallurgy/CrucibleGui.java create mode 100644 src/main/java/ihl/processing/metallurgy/CrucibleInventory.java create mode 100644 src/main/java/ihl/processing/metallurgy/CrucibleSlot.java create mode 100644 src/main/java/ihl/processing/metallurgy/DetonationSprayingMachineContainer.java create mode 100644 src/main/java/ihl/processing/metallurgy/DetonationSprayingMachineGui.java create mode 100644 src/main/java/ihl/processing/metallurgy/DetonationSprayingMachineModel.java create mode 100644 src/main/java/ihl/processing/metallurgy/DetonationSprayingMachineRender.java create mode 100644 src/main/java/ihl/processing/metallurgy/DetonationSprayingMachineTileEntity.java create mode 100644 src/main/java/ihl/processing/metallurgy/ElectricEngineItem.java create mode 100644 src/main/java/ihl/processing/metallurgy/ExtruderContainer.java create mode 100644 src/main/java/ihl/processing/metallurgy/ExtruderGui.java create mode 100644 src/main/java/ihl/processing/metallurgy/ExtruderModel.java create mode 100644 src/main/java/ihl/processing/metallurgy/ExtruderTileEntity.java create mode 100644 src/main/java/ihl/processing/metallurgy/GasWeldingStationContainer.java create mode 100644 src/main/java/ihl/processing/metallurgy/GasWeldingStationGui.java create mode 100644 src/main/java/ihl/processing/metallurgy/GasWeldingStationModel.java create mode 100644 src/main/java/ihl/processing/metallurgy/GasWeldingStationTileEntity.java create mode 100644 src/main/java/ihl/processing/metallurgy/IProductionLine.java create mode 100644 src/main/java/ihl/processing/metallurgy/ImpregnatingMachineContainer.java create mode 100644 src/main/java/ihl/processing/metallurgy/ImpregnatingMachineGui.java create mode 100644 src/main/java/ihl/processing/metallurgy/ImpregnatingMachineRender.java create mode 100644 src/main/java/ihl/processing/metallurgy/ImpregnatingMachineTileEntity.java create mode 100644 src/main/java/ihl/processing/metallurgy/InjectionMoldBlock.java create mode 100644 src/main/java/ihl/processing/metallurgy/InjectionMoldTileEntity.java create mode 100644 src/main/java/ihl/processing/metallurgy/LatheContainer.java create mode 100644 src/main/java/ihl/processing/metallurgy/LatheGui.java create mode 100644 src/main/java/ihl/processing/metallurgy/LathePart1Model.java create mode 100644 src/main/java/ihl/processing/metallurgy/LathePart1TileEntity.java create mode 100644 src/main/java/ihl/processing/metallurgy/LathePart2Model.java create mode 100644 src/main/java/ihl/processing/metallurgy/LathePart2TileEntity.java create mode 100644 src/main/java/ihl/processing/metallurgy/MachineBaseContainer.java create mode 100644 src/main/java/ihl/processing/metallurgy/MachineBaseTileEntity.java create mode 100644 src/main/java/ihl/processing/metallurgy/MuffleFurnaceGui.java create mode 100644 src/main/java/ihl/processing/metallurgy/MuffleFurnanceContainer.java create mode 100644 src/main/java/ihl/processing/metallurgy/MuffleFurnanceTileEntity.java create mode 100644 src/main/java/ihl/processing/metallurgy/RollingMachineContainer.java create mode 100644 src/main/java/ihl/processing/metallurgy/RollingMachineGui.java create mode 100644 src/main/java/ihl/processing/metallurgy/RollingMachinePart1Model.java create mode 100644 src/main/java/ihl/processing/metallurgy/RollingMachinePart1TileEntity.java create mode 100644 src/main/java/ihl/processing/metallurgy/RollingMachinePart2Model.java create mode 100644 src/main/java/ihl/processing/metallurgy/RollingMachinePart2TileEntity.java create mode 100644 src/main/java/ihl/processing/metallurgy/RollingMachineRender.java create mode 100644 src/main/java/ihl/processing/metallurgy/VulcanizationExtrudingMoldModel.java create mode 100644 src/main/java/ihl/processing/metallurgy/VulcanizationExtrudingMoldTileEntity.java create mode 100644 src/main/java/ihl/processing/metallurgy/WireMillContainer.java create mode 100644 src/main/java/ihl/processing/metallurgy/WireMillGui.java create mode 100644 src/main/java/ihl/processing/metallurgy/WireMillTileEntity.java create mode 100644 src/main/java/ihl/processing/metallurgy/WoodenRollingMachineContainer.java create mode 100644 src/main/java/ihl/processing/metallurgy/WoodenRollingMachineGui.java create mode 100644 src/main/java/ihl/processing/metallurgy/WoodenRollingMachinePart1Model.java create mode 100644 src/main/java/ihl/processing/metallurgy/WoodenRollingMachinePart1TileEntity.java create mode 100644 src/main/java/ihl/processing/metallurgy/WoodenRollingMachinePart2Model.java create mode 100644 src/main/java/ihl/processing/metallurgy/WoodenRollingMachinePart2TileEntity.java create mode 100644 src/main/java/ihl/processing/metallurgy/WoodenRollingMachineRender.java create mode 100644 src/main/java/ihl/recipes/IRecipeInputFluid.java create mode 100644 src/main/java/ihl/recipes/IronWorkbenchRecipe.java create mode 100644 src/main/java/ihl/recipes/RecipeInputDetonator.java create mode 100644 src/main/java/ihl/recipes/RecipeInputDie.java create mode 100644 src/main/java/ihl/recipes/RecipeInputFluidDictionary.java create mode 100644 src/main/java/ihl/recipes/RecipeInputFluidStack.java create mode 100644 src/main/java/ihl/recipes/RecipeInputObjectInstance.java create mode 100644 src/main/java/ihl/recipes/RecipeInputOreDictionaryList.java create mode 100644 src/main/java/ihl/recipes/RecipeInputWire.java create mode 100644 src/main/java/ihl/recipes/RecipeOutputItemStack.java create mode 100644 src/main/java/ihl/recipes/UniversalRecipeInput.java create mode 100644 src/main/java/ihl/recipes/UniversalRecipeManager.java create mode 100644 src/main/java/ihl/recipes/UniversalRecipeOutput.java create mode 100644 src/main/java/ihl/servitor/BoneBlock.java create mode 100644 src/main/java/ihl/servitor/FlameEntityFX.java create mode 100644 src/main/java/ihl/servitor/FlameRenderFX.java create mode 100644 src/main/java/ihl/servitor/LostHeadEntity.java create mode 100644 src/main/java/ihl/servitor/LostHeadRender.java create mode 100644 src/main/java/ihl/servitor/SkullItemRender.java create mode 100644 src/main/java/ihl/servitor/SkullModel.java create mode 100644 src/main/java/ihl/servitor/SkullModel.txt create mode 100644 src/main/java/ihl/trans_dimensional_item_teleporter/TDITBlock.java create mode 100644 src/main/java/ihl/trans_dimensional_item_teleporter/TDITContainer.java create mode 100644 src/main/java/ihl/trans_dimensional_item_teleporter/TDITFrequencyTransmitter.java create mode 100644 src/main/java/ihl/trans_dimensional_item_teleporter/TDITGui.java create mode 100644 src/main/java/ihl/trans_dimensional_item_teleporter/TDITTileEntity.java create mode 100644 src/main/java/ihl/utils/BlockItemRender.java create mode 100644 src/main/java/ihl/utils/EntityDropEventHandler.java create mode 100644 src/main/java/ihl/utils/FluidDictionary.java create mode 100644 src/main/java/ihl/utils/GuiMultiTextureButton.java create mode 100644 src/main/java/ihl/utils/IHLFluidTank.java create mode 100644 src/main/java/ihl/utils/IHLInvSlotDischarge.java create mode 100644 src/main/java/ihl/utils/IHLItemRenderer.java create mode 100644 src/main/java/ihl/utils/IHLMathUtils.java create mode 100644 src/main/java/ihl/utils/IHLRenderUtils.java create mode 100644 src/main/java/ihl/utils/IHLUtils.java create mode 100644 src/main/java/ihl/worldgen/IHLWorldGenerator.java create mode 100644 src/main/java/ihl/worldgen/WorldGeneratorBase.java create mode 100644 src/main/java/ihl/worldgen/WorldGeneratorSurfaceLake.java create mode 100644 src/main/java/ihl/worldgen/WorldGeneratorUndergroundLake.java create mode 100644 src/main/java/ihl/worldgen/WorldGeneratorVein.java create mode 100644 src/main/java/ihl/worldgen/ores/BlockOre.java create mode 100644 src/main/java/ihl/worldgen/ores/DebugScannerBlock.java create mode 100644 src/main/java/ihl/worldgen/ores/DebugScannerContainer.java create mode 100644 src/main/java/ihl/worldgen/ores/DebugScannerGui.java create mode 100644 src/main/java/ihl/worldgen/ores/DebugScannerTileEntity.java create mode 100644 src/main/java/ihl/worldgen/ores/IHLFluid.java create mode 100644 src/main/resources/META-INF/ihl_at.cfg create mode 100644 src/main/resources/mcmod.info (limited to 'src') diff --git a/src/main/java/assets/ihl/config/ihl-recipe.cfg b/src/main/java/assets/ihl/config/ihl-recipe.cfg new file mode 100644 index 0000000..45451a3 --- /dev/null +++ b/src/main/java/assets/ihl/config/ihl-recipe.cfg @@ -0,0 +1,89 @@ +// <- 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", "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. +// For removing add any of those. +// 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) +// fiber(internal_itemname, length) +// wire(material, length, transverseSection) +// cable(material, length, transverseSection, insulationMaterial, insulationThickness, insulationBreakdownVoltage) +// tooloredict(oredict_entry,quantity) //For iron workbench only +// oredict(oredict_entry,quantity) +// fluidstack(fluid,quantity) +// First parameter are string, others are integer. +// For finding modname:internal_itemname, damage or ore dictionary entry use in-game +// "ore dictionary item scanner" from IHL in creative mode. +// For internal fluid names check universal fluid cells tooltip. +// For "recipeoutput" those parameters are: +// itemstack(modname:internal_itemname,stacksize,damage) Stacksize can be float. +// fiber(internal_itemname, length) +// wire(material, length, transverseSection) +// cable(material, length, transverseSection, insulationMaterial, insulationThickness, insulationBreakdownVoltage) +// 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, +//recipeinput(fluidstack(water,100)), +//recipeoutput(itemstack(minecraft:diamond,1,0)) +//) + +//addrecipe +//( +//wiremill, +//recipeinput(fluidstack(liquidglass,10),die(150)), +//recipeoutput(wire(Uran,10,100)) +//) + +//removerecipe +//( +//evaporator, +//recipeinput(fluidstack(saltwater,4000)) +//) + +//removerecipe +//( +//evaporator, +//recipeoutput(itemstack(ihl:item.ihlSimpleItem,1,144)) +//) diff --git a/src/main/java/assets/ihl/lang/en_US.lang b/src/main/java/assets/ihl/lang/en_US.lang new file mode 100644 index 0000000..9f6d3ec --- /dev/null +++ b/src/main/java/assets/ihl/lang/en_US.lang @@ -0,0 +1,584 @@ +language.name=HAYO +language.region=US +language.code=en_US + +ihl.solarEvaporator=Solar evaporator +ihl.achesonFurnace=Acheson furnace +ihl.chemicalReactor=Chemical reactor +ihl.crucible=Crucible +ihl.cryogenicDistiller=Cryogenic distiller +ihl.detonationSprayingMachine=Detonation spraying machine +ihl.electricEvaporator=Electric evaporator +ihl.electrolysisBath=Electrolysis bath +ihl.evaporator=Evaporator +ihl.extruder=Extruder +ihl.fluidizedBedReactor=Fluidized bed reactor +ihl.fractionator=Fractionation column +ihl.gasWeldingStationGas=Gas wielding station +ihl.impregnatingMachine=Bronze tub +ihl.injectionMold=Injection mold +ihl.ironWorkbench=Iron workbench +ihl.labElectrolyzer=Lab electrolyzer +ihl.leadOven=Chemical oven +ihl.loom=Loom +ihl.muffleFurnace=Muffle furnace +ihl.paperMachine=Paper machine +ihl.rollingMachine=Rolling machine +ihl.woodenRollingMachine=Wooden rolling machine +ihl.wireMill=Wire mill +ihl.vulcanizationExtrudingMold=Vulcanization extruding mold +ihl.dosingPump.tip=Type desired amount of fluids /n to be injected to fluid tank near /n dosing pump. Use redstone impulse /n signal to perform injection. /n Press [enter] to accept number. +ihl.detonatorHint=RMB while crafting this to set detonator delay +ihl.setOfDiesHint=RMB while crafting this to set transverse section +ihl.lenght=Length +ihl.resistivity=Resistivity +ihl.wire_material=Wire material +ihl.transverse_section=Transverse section +ihl.insulation_material=Insulation material +ihl.insulation_thickness=Insulation thickness +ihl.insulation_beakdown_voltage=Insulation breakdown voltage +ihl.powerCableTooltip=This cable could be used to provide power thru unloaded chunks. +ihl.detonator_delay=Detonation delay: +ihl.explosionPower=Explosion power: +ihl.mTNT=gram of TNT +ihl.seconds=s +tile.pileBlock.name=Pile of something +tile.dosingPump.name=Dosing pump +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 +dustMercuryFulminate.name=Mercury fulminate +dustCalciumAcetate.name=Calcium acetate +itemCellMethanol.name=Methanol cell +itemCellNitroGlycerin.name=Nitro glycerin cell +itemCellAmmonia.name=Ammonia cell +itemCellGlycerol.name=Glycerol +item.skull.name=Wailer remains +item.guidebook.name=IHL manual +item.handpump.name=IHL handpump +item.advanced_handpump.name=IHL advanced handpump +item.collector.name=IHL Collector +item.collectorHeavy.name=IHL Heavy Collector +item.handpump_discharged.name=IHL handpump + +tile.boneBlock.name=Bone pillar +entity.LostHead.name=Wailer +tile.ihlExplosive.name=Explosive pack +tile.solarEvaporator.name=Solar evaporator +tile.evaporatorBlock.name=Evaporator +tile.electricEvaporatorBlock.name=Electric evaporator +tile.sackBlock.name=Rubber tree sap gathering sack +tile.rubberTreeBlock.name=Rubber tree +ihl.gui.evaporator=IHL evaporator +ihl.gui.electricEvaporator=IHL electric evaporator +ihl.gui.tdit.message0=Ready, charged +ihl.gui.tdit.message1=Not enough energy +ihl.gui.tdit.message2=Receiver not responding +ihl.gui.tdit.message3=Receiver not defined +ihl.gui.tdit.message4=Clean receiver chamber! +tile.blockFluidRubberTreeSap.name=Rubber tree sap +itemCellfluidRubberTreeSap.name=Rubber tree sap cell +tile.blockFluidAquaRegia.name=Aqua Regia +itemCellAquaRegia.name=Aqua Regia cell +tile.blockFluidSodiumPeroxide.name=Sodium peroxide +itemCellSodiumPeroxide.name=Sodium peroxide cell +tile.blockFluidOsmiumTetroxide.name=Osmium tetroxide +itemCellOsmiumTetroxide.name=Osmium tetroxide cell +tile.blockFluidNickelSulfateDissolvedInWater.name=Nickel sulfate water solution +itemCellNickelSulfateDissolvedInWater.name=Nickel sulfate water solution cell +tile.blockFluidBlueVitriolDissolvedInWater.name=Blue Vitriol water solution +itemCellBlueVitriolDissolvedInWater.name=Blue Vitriol water solution cell +tile.blockFluidNitricAcid.name=Nitric acid +item.itemCellNitricAcid.name=Nitric acid cell +tile.blockMoltenGold.name=Molten gold +itemDustSludge.name=Polymetallic ore undissolved sludge +itemDustSludgeTiny.name=Tiny pile of polymetallic ore undissolved sludge +itemDustSodiumPeroxide.name=Sodium Peroxide +itemDustIridiumAndSodiumOxide.name=Iridium and sodium oxide + +tile.tditBlock.name=Transdimensional item teleporter +item.tditFrequencyTransmitter.name=T.D.I.T. frequency transmitter + +tile.cableAnchor.name=Junction box +wire.name=Uninsulated wire +cable.name=Cable +tile.ironWorkbench.name=Iron workbench +item.ironWorkbenchItem.name=Iron workbench +setOfDies1_5sqmm.name=Set of dies for wire drawing +ihl.gui.achesonFurnance=Acheson furnace +ihl.gui.coiler=Coiler +ihl.gui.muffleFurnace=Muffle furnace + +tile.blockAquaRegia.name=Aqua regia +tile.blockOsmiumTetroxide.name=Osmium tetroxide +tile.blockNickelSulfateDissolvedInWater.name=Nickel sulfate dissolved in water +tile.blockBlueVitriolDissolvedInWater.name=Blue vitriol dissolved in water +tile.blockNitricAcid.name=Nitric acid +tile.blockSodiumPeroxide.name=Sodium peroxide +tile.blockCablingColophony.name=Cabling colophony +tile.blockSpruceResin.name=Spruce resin +tile.blockfluidRubberTreeSap.name=Rubber tree sap +tile.blockGlyceryl.name=Glyceryl +tile.blockSeedOil.name=Seed Oil +tile.blockMoltenSteel.name=Molten Steel +tile.debugScanner.name=Ore dictionary item scanner +tile.oreApatite.name=Apatite +tile.oreSaltpeter.name=Saltpeter +tile.achesonFurnance.name=Acheson furnance +item.crucible.name=Crucible +item.bucket_SpruceResin.name=Bucket of spruce resin + +item.bucket_fluidRubberTreeSap.name=Bucket of rubber tree sap +bucket_tarPitch.name=Bucket of tar pitch +gemApatite.name=Piece of apatite +ingotTarPitch.name=Tar pitch bar +nuggetTarPitch.name=Small piece of tar pitch +stickCoal.name=Coal electrode +stickCoalElectrodePremix.name=Formed coal electrode premix +dustCoalElectrodePremix.name=Coal electrode premix +stickGraphite.name=Graphite electrode +dustCarborundum.name=Carborundum dust +dustSaltpeter.name=Saltpeter +spruceBlock.name=Peeled spruce +itemCellSpruceResin.name=Spruce resin cell +itemCellCablingColophony.name=Cabling colophony cell +itemCellSeedOil.name=Seed oil cell +itemCellGlyceryl.name=Glyceryl cell +itemCellMoltenSteel.name=Molten steel cell +ihl.gui.blueprint=Set of blueprints +ihl.temperature.units=C +molten.bronze=Molten bronze +molten.iron=Molten iron +amount=Amount: + +tile.blockOleicAcid.name=Oleic acid +tile.blockLimemilk.name=Limemilk +tile.blockMoltenRubberWithSulfur.name=Pre-vulcanized rubber +tile.blockMoltenBronze.name=Molten Bronze +tile.blockVapourSulfuricAcid.name=Vapours of sulfuric acid +tile.blockSulfuricAcidAnhydride.name=Vapours of sulfuric acid anhydride +tile.blockSulfuricAcid.name=Sulfuric Acid +tile.wireMill.name=Wire mill +tile.vulcanizationExtrudingMold.name=Vulcanization extruding mold +tile.extruder.name=Extruder +tile.rollingMachinePart1.name=Rolling machine p.#1 +tile.rollingMachinePart2.name=Rolling machine p.#2 +tile.loom.name=Loom +tile.coiler.name=Coiler +tile.lathePart1.name=Lathe p.#1 +tile.lathePart2.name=Lathe p.#2 +tile.fiberglassSpinnerets.name=Fiberglass spinnerets +tile.goldPrecipitatorCondenser.name=Precipitator/Condenser +tile.goldChimneyKnee.name=Chimney knee with steam injector +tile.leadOven.name=Chemically resistant solid fuel oven +tile.cannonBronze.name=Detonation spraying machine +tile.tubBronze.name=Bronze tub +tile.achesonFurnance.name=Acheson furnace +tile.muffleFurnance.name=Muffle furnace +pipeRubberWithSulfur.name=Non-vulcanized rubber pipe +pipeVulcanizedRubber.name=Vulcanized rubber pipe +tinSnipsSteel.name=Tin snips +hammer.name=Hammer +grindstone.name=Grindstone +chisel.name=Chisel +needleFile.name=Needle file +drillSteelHardened.name=Steel hardened drill +hackSawSteel.name=Steel hack saw +handDrillBronze.name=Bronze hand drill +setOfFilesSteel.name=Set of files +viseSteel.name=Steel vise +tapM10x1SteelHardened.name=Tap M10x1 (hardened) +diceM10x1SteelHardened.name=Dice M10x1 (hardened) +graverSteelHardened.name=Graver (hardened) +sharpenedCarvingKnifeBronze.name=Sharpened bronze carving knife +tile.oreTrona.name=Trona +tile.oreLimestone.name=Limestone +tile.oreGypsum.name=Gypsum +tile.orePotassiumFeldspar.name=Potassium feldspar +tile.injectionMold.name=Injection mold +itemCellNitricAcid.name=Nitric acid cell +itemCellSulfuricAcid.name=Sulfuric acid cell +itemCellSulfuricAnhydride.name=Sulfuric anhydride cell +itemCellVapourSulfuricAcid.name=Sulfuric acid vapours cell +itemCellMoltenBronze.name=Molten bronze cell +itemCellLimemilk.name=Limemilk cell +itemCellOleicAcid.name=Oleic acid cell +itemCellLiquidGlass.name=Liquid glass cell +itemCellNatriumHydroxideDissolvedInWater.name=Sodium hydroxide solution cell +itemCellOxygen.name=Oxygen cell +itemCellAcetylene.name=Acetylene cell +itemCellNitrogen.name=Nitrogen cell +springSteel.name=Steel spring +toolTinSnipsPartsSteel.name=Tin snips parts +toolHeadHammerSmallSteel.name=Steel hammer head +blankNeedleFileSteel.name=Steel blank for needle file +dustDehydratedGypsum.name=Dehydrated gypsum +carvingKnifeBronze.name=Carving knife (sharpen me!) +muttonLard.name=Mutton lard +ingotStearin.name=Stearin +ingotCalciumSoap.name=Calcium soap +dustBrick.name=Brick dust +dustGraphite.name=Graphite dust +crucibleMixture.name=Crucible mixture +blankChiselSteel.name=Steel blank for chisel +plateHotSteel.name=Hot steel plate +dustIrongraphite.name=Irongraphite dust +viseSetOfMoldedPartsSteel.name=Set of molded parts for vise +latheSetOfMoldedPartsSteel.name=Set of molded parts for lathe +handDrillSetOfMoldedPartsBronze.name=Set of molded parts for hand drill +blankSetOfFilesSteel.name=Blanks for set of files +diceM10x1Steel.name=Dice M10x1 (not yet hardened) +tapM10x1Steel.name=Tap M10x1 (not yet hardened) +shaftSteel.name=Steel shaft +meshGlass.name=Fiberglass mesh +extruderSetOfMoldedPartsSteel.name=Set of molded parts for extruder +boltM10x1Steel.name=Bolt M10x1 +linerIronGraphiteGreased.name=Irongraphite liner (greased and ready to use) +linerIronGraphiteHot.name=Hot irongraphite liner +linerIronGraphite.name=Irongraphite liner (not yet sintered) +sawBladeSteelHardened.name=Hardened blade for saw +sawBladeSteelHot.name=Hot blade for saw +sawBladeSteel.name=Blade for saw (harden me!) +barD10SteelHot.name=Hot tiny steel bar (D=10 mm) +barD10Steel.name=Tiny steel bar (D=10 mm) +drillSteelHot.name=Hot steel drill +drillSteel.name=Steel drill (harden me!) +graverSteelHot.name=Hot steel graver +graverSteel.name=Steel graver (harden me!) +nutM10x1Steel.name=Nut M10x1 +nailSteel.name=Two Inch Nails +diceM10x1SteelHot.name=Hot dice M10x1 +tapM10x1SteelHot.name=Hot tap M10x1 +plateNonVulcanizedRubber.name=Non vulcanized rubber plate +machineCasingSetOfPartsSteel.name=Set of parts for basic machine +setOfPartsForLVElemotorSteel.name=Set of parts for basic DC engine +detonationSprayingMachineSetOfMoldedPartsBronze.name=Set of molded parts for detonation spraying machine +foilRubberWithSulfur.name=Roll of non-vulcanized rubber +foilRubber.name=Roll of vulcanized rubber +dustCalciumCarbide.name=Calcium carbide +barD10Gold.name=Tiny gold bar (D=10 mm) +ingotHotSteel.name=Hot steel ingot +blankGasReducerSteel.name=Forged billet for gas reducer +setOfPartsGasReducerSteel.name=Machined billet for gas reducer +gasReducerSteel.name=Gas reducer +electricMotorLVLEDC.name=Lov voltage low efficiency DC electric motor +item.electricMotorLVLEDC.name=Lov voltage low efficiency DC electric motor +fiberGlass.name=Fiberglass +tile.blockAir.name=Compressed air +tile.blockNitrogen.name=Compressed nitrogen +tile.blockAcetylene.name=Compressed acetylene +tile.blockOxygen.name=Compressed oxygen +tile.cryogenicDistiller.name=Cryogenic distiller +tile.gasWeldingStation.name=Gas welding station +tile.woodenRollingMachinePart1.name=Wooden rolling machine part #1 +tile.woodenRollingMachinePart2.name=Wooden rolling machine part #2 +tile.blockLiquidGlass.name=Liquid glass +tile.blockNatriumHydroxideDissolvedInWater.name=Sodium hydroxide solution +tile.spruceBlock.name=Carved spruce +tile.impregnatingMachine.name=(reserved) +tile.blockSulfuricAnhydride.name=Sulfuric anhydride +fabric.name=Fabric +foilSteel.name=Roll of steel sheet +stickSteel.name=Steel rod +dustQuicklime.name=Quicklime +dustCalcite.name=Calcite dust +dustGypsum.name=Gypsum +dustPotassiumFeldspar.name=Potassium feldspar dust +tile.oreBauxite.name=Bauxite +tile.oreCinnabar.name=Cinnabar +tile.oreRockSalt.name=Rock salt +tile.oreGyubnera.name=Gyubnera +tile.blockPulpMica.name=Mica pulp +tile.blockPulpCellulose.name=Cellulose pulp +tile.blockFuel.name=Diesel fuel +tile.blockMineralOil.name=Mineral oil +tile.blockFuelOil.name=Fuel oil (masut) +tile.blockOil.name=Oil +tile.blockMercury.name=Mercury +tile.blockVapourMercury.name=Mercury vapours +tile.blockHydrogen.name=Compressed hydrogen +tile.blockSaltWater.name=Saltwater +tile.blockHydrogenChloride.name=Hydrogen chloride (gaseous) +tile.blockNatriumTungstateDissolvedInWater.name=NaWO4 (water solution) +tile.blockTurpentine.name=Turpentine +tile.blockTrichlorosilane.name=Trichlorosilane +tile.blockSiliconTetrachloride.name=Silicon tetrachloride +tile.blockChlorine.name=Chlorine +itemCellTrichlorosilane.name=Trichlorosilane cell +itemCellSiliconTetrachloride.name=Silicon tetrachloride cell +itemCellChlorine.name=Chlorine cell +tile.gaedesMercuryRotaryPump.name=Gaedes mercury rotary pump +tile.labElectrolyzer.name=Laboratory electrolyzer +tile.electrolysisBath.name=Electrolysis bath +tile.fluidizedBedReactor.name=Fluidized bed reactor +tile.chemicalReactor.name=Chemical reactor +tile.paperMachine.name=Paper machine +tile.oreMica.name=Mica ore +tile.fractionatorCover.name=Fractionator cover +tile.fractionatorSection.name=Fractionator section +tile.fractionatorBottom.name=Fractionator bottom +tile.refluxCondenser.name=Reflux condenser +tile.rectifierTransformerUnit.name=Rectifier/transformer unit +tile.grounding.name=Grounding +tile.frequencyGenerator.name=Frequency generator +tile.batterySwitchUnit.name=Battery-switch unit +tile.oreChromite.name=Chromite +tile.oreStibnite.name=Stibnite +tile.oreDatolite.name=Datolite +tile.blockBoricAcid.name=Boric acid +ignitron.name=Ignitron +stickBoronCarbide.name=Boron carbide electrode +foilLead.name=Lead sheet +dustLeadPlumbate.name=Red lead (minium) +vacuumSwitch.name=Vacuum switch +hallSensor.name=Hall sensor +batteryCellsEbonite.name=Ebonite battery cells +plateMica.name=Mica plate +dustBoronCarbide.name=Boron carbide +dustBoricAcid.name=Boric acid +dustDatolite.name=Milled datolite +dustFerrite.name=Ferrite dust +ringFerrite.name=Ferrite ring +ringRawFerrite.name=Ferrite ring (not yet sintered) +dustLithiumOxide.name=Lithium oxide +dustSolderingAlloy.name=Soldering alloy +dustTinyAntimony.name=Tiny pile of antimony dust +insulatorPorcelain.name=Porcelain insulator +insulatorRawPorcelain.name=Porcelain insulator (not yet sintered) +dustAntimony.name=Antimony dust +dustAntimonyOxide.name=Antimony oxide +dustStibnite.name=Milled stibnite +crushedPurifiedStibnite.name=Crushed pufified stibnite ore +crushedStibnite.name=Crushed stibnite ore +ringPorcelain.name=Porcelain ring +ringRawPorcelain.name=Porcelain ring (not yet sintered) +foilCopper.name=Coper foil +crushedPurifiedBauxite.name=Crushed pufified bauxite ore +crushedBauxite.name=Crushed bauxite ore +dustSodiumSulfide.name=Sodium sulfide +dustSodiumSulfate.name=Sodium sulfate +dustWood.name=Wood flour +valveTube1C21P.name=Valve tube 1C21P +highVoltageCapacitor.name=HV capacitor +foilMica.name=Mica foil +dustMica.name=Milled mica +gaedesPumpBarrelPorcelain.name=Gaedes mercury rotary pump barrel +gaedesPumpBarrelRawPorcelain.name=Gaedes pump barrel (not yet sintered) +dustGlass.name=Glass dust +gu-81m.name=GU-81m vacuum lamp +foilTungsten.name=Tungsten foil +ingotTungsten.name=Tungsten ingot +plateTungsten.name=Tungsten plate +plateHotTungsten.name=Hot tungsten plate +crushedPurifiedCinnabar.name=Crushed pufified cinnabar ore +crushedCinnabar.name=Crushed cinnabar ore +ovenRawPorcelain.name=Chemically resistant oven (not yet sintered) +chimneyKneeRawPorcelain.name=Porcelain chimney knee (not yet sintered) +dustTungsten.name=Tungsten dust +electrolysisBathPorcelain.name=Porcelain electrolysis bath +electrolysisBathRawPorcelain.name=Porcelain electrolysis bath (not yet sintered) +dustPorcelain.name=Porcelain dust +foilGold.name=Gold foil +dustTungsticAcid.name=Tungstic acid +turboCompressorSetOfMoldedPartsBronze.name=Parts for turbo compressor +cycloneFilterSteel.name=Cyclone filter +dustTungstenOxide.name=Tungsten oxide +dustCalciumTungstate.name=Calcium tungstate +dustSodiumHydrogenSulfate.name=Sodium hydrogen sulfate +dustSalt.name=Sodium chloride (salt) +dustCalciumChloride.name=Calcium chloride +dustPotassiumSulphate.name=Potassium sulphate +dustRockSalt.name=Potassium chloride (rock salt) +crushedPurifiedGyubnera.name=Crushed pufified gyubnera ore +crushedGyubnera.name=Crushed gyubnera ore +dustManganeseOxide.name=Manganese oxide +dustIronOxide.name=Iron oxide (III) +smallRoundSteel.name=Small steel round +smallRoundPolishedSteel.name=Small polished steel round +rollingMachineSetOfMoldedpartsSteel.name=Parts for rolling machine +pistonCylinderSteel.name=Piston and cylinder +blankPistonCylinderSteel.name=Blanks for piston and cylinder +mixerSteel.name=Steel mixer +pipelineAccessoriesSteel.name=Pipeline accessories +dustTrona.name=Trona +dustSilicon.name=Silicon dust +highPressureVesselSteel.name=High pressure vessel +gasJetSteel.name=Gas jet +dustIridiumAndSodiumOxide.name=Iridium and sodium oxide +dustPlatinumGroupSludge.name=Platinum group metals sludge +dustTinyPlatinumGroupSludge.name=Tiny pile of platinum group metals sludge +dustSodiumPeroxide.name=Sodium peroxide +itemCellFuel.name=Diesel fuel cell +itemCellMineralOil.name=Mineral oil cell +itemCellFuelOil.name=Fuel oil (masut) cell +itemCellOil.name=Oil cell +itemCellMercury.name=Mercury cell +itemCellHydrogen.name=Hydrogen cell +itemCellSaltWater.name=Saltwater cell +itemCellHydrogenChloride.name=Hydrogen chloride cell +itemCellNatriumTungstateDissolvedInWater.name=Sodium tugstate solution cell +itemCellTurpentine.name=Turpentine cell +leadAcidBattery.name=Lead acid battery +plateRawGraphite.name=Graphite plate premix +dustIridium.name=Iridium dust +dustTinySilicon.name=Tiny pile of technical silicon +dustMagnesiumOxide.name=Magnesium oxide +dustSilicon.name=Technical silicon +dustBischofite.name=Milled bischofite +dustMagnesium.name=Magnesium dust +ingotMagnesium.name=Magnesium ingot +plateGraphite.name=Graphite plate +dustTinySiliconDioxide.name=Tiny pile of silicon dioxide dust +dustTinyIronOxide.name=Tiny pile of iron oxide dust +dustTinyManganeseOxide.name=Tiny pile of manganese oxide dust +dustTinyGypsum.name=Tiny pile of gypsum dust +mercuryThermometer.name=Mercury thermometer +tile.mirror.name=Mirror +polishingPucksSteel.name=Polishing pucks +glassBlowingTubeSteel.name=Glass blowing tube +item.precipitatorCondenserRawPorcelain.name=Precipitator/Condenser (not yet sintered) +precipitatorCondenserRawPorcelain.name=Precipitator/Condenser (not yet sintered) +rollingMachineSetOfMoldedPartsSteel.name=Set of molded parts for rolling machine +tile.oreBischofite.name=Bischofite +tile.blockMoltenSodiumChloride.name=Molten sodium chloride +tile.blockMoltenMagnesium.name=Molten magnesium +tile.horizontalMiningPipeX.name=Mining pipe +tile.horizontalMiningPipeZ.name=Mining pipe +tile.lightBulb.name=Light bulb +ihl.as_byproduct_of_processing_of=As byproduct of processing +ihl.in_chemical_reactor=in chemical reactor. +ihl.check_usage=Check usage here: +ihl.transversesection=Transverse section: + +fluid.nitricacid=Nitric acid +fluid.sulfuricacid=Sulfuric acid +fluid.sulfuricanhydride=Sulfuric anhydride +fluid.vapour.sulfuricacid=Sulfuric acid vapours +fluid.molten.gold=Molten gold +fluid.molten.glass=Molten glass +fluid.molten.bronze=Molten bronze +fluid.molten.copper=Molten copper +fluid.molten.steel=Molten steel +fluid.molten.magnesium=Molten magnesium +fluid.molten.sodiumchloride=Molten sodium chloride +fluid.molten.lithium=Molten lithium +fluid.molten.rubberwithsulfur=Molten rubber with sulfur +fluid.solution.bluevitriol=Blue Vitriol water solution +fluid.solution.nickelsulfate=Nickel sulfate water solution +fluid.limemilk=Limemilk +fluid.oleicacid=Oleic acid +fluid.osmiumtetroxide=Osmium tetroxide +fluid.sodiumperoxide=Sodium peroxide +fluid.aquaregia=Aqua Regia +fluid.seedoil=Seed oil +fluid.glyceryl=Glycerol +fluid.cablingcolophony=Cabling colophony +fluid.spruceresin=Spruce resin +fluid.rubbertreesap=Rubber tree sap +fluid.liquidglass="Liquid glass" +fluid.solution.natriumhydroxide=Water solution of sodium hydroxide +fluid.oxygen=Oxygen +fluid.acetylene=Acetylene +fluid.nitrogen=Nitrogen +fluid.air=Air +fluid.turpentine=Turpentine +fluid.solution.natriumtungstate=Water solution of sodium tungstate +fluid.hydrogenchloride=Hydrogen chloride +fluid.saltwater=Saltwater +fluid.hydrogen=Hydrogen +fluid.vapour.mercury=Mercury vapours +fluid.mercury=Mercury +fluid.oil=Oil +fluid.fueloil=Mazut +fluid.mineraloil=Mineral oil +fluid.fuel=Diesel fuel +fluid.pulp.cellulose=Cellulose pulp +fluid.pulp.mica=Mica pulp +fluid.boricacid=Boric acid +fluid.chlorine=Chlorine +fluid.silicontetrachloride=Silicon tetrachloride +fluid.trichlorosilane=Trichlorosilane +fluid.tile.water=Water +fluid.tile.lava=Lava +fluid.pulp.sodiumzeolite=Sodium zeolite pulp +fluid.molten.tarpitch=Tar pitch +fluid.crackinggas=Cracking gas +fluid.solution.lithiumchloride=Lithium chloride dissolved in water +fluid.solution.calciumchloride=Calcium chloride dissolved in water + +ihl.use_with_cryogenic_distiller=Use with cryogenic distiller +ihl.dsmhint=Use flint & steel on this block to get result. +ihl.gui.lathe=Lathe +tile.glowningAir.name=Air +tile.glassBoxBlock.name=Glass box +tile.spotlight.name=Spotlight +lampHolderPorcelain.name=Porcelain lamp holder +lampHolderRawPorcelain.name=Porcelain lamp holder (not yet sintered) +ihl.durability=Durability: +ihl.mutton_drop_hint=Kill a sheep with this to get a mutton lard. +ihl.attack_damage=Attack damage: +fiberGlassDieSteel.name=Fiberglass die +item.fiberGlass.name=Fiberglass +tile.gasWeldingStation.tooltip=Check amount of oxygen in /n blue tank and amount of /n acetylene in red tank +tile.gaedesMercuryRotaryPump.tooltip=Check if machine are ready, /n check electric motor slot /n and check if machine is /n supplied with energy +tile.lathePart1.tooltip=Check if machine are ready, check /n electric motor slot, check if machine /n is supplied with energy and check if a /n second part of lathe oriented correctly +advancedShieldAssemblyUnitBlock.name=Hydrotransport shield assembly unit +IHLShieldAssemblyUnitBlock.name=Shield assembly unit +tile.IHLMultiBlockSpacerBlock.name=Multiblock spacer +tile.vacuumInductionMeltingFurnace.name=Vacuum induction melting furnace +tile.hydrotransportPulpRegenerator.name=Hydrotransport pulp regenerator +tile.blockZeolitePulp.name=Zeolite pulp +tile.blockMoltenTarPitch.name=Molten tar pitch +dustSodiumZeolite.name=Sodium zeolite +dustSodiumZeoliteCoked.name=Coked sodium zeolite +dustSodiumAluminate.name=Sodium aluminate +dustSodiumHydroxide.name=Sodium hydroxide +dustTinyTungsten.name=Tiny pile of tungsten dust +dustBauxite.name=Bauxite dust +incisorSteelDiamondCoated.name=Diamond coated incisor +incisorSteel.name=Incisor +plateCoal.name=Coal plate +plateRawCoal.name=Premix for coal plate +ingotLithium.name=Lithium ingot +dustLithiumChloride.name=Lithium chloride +tile.blockMoltenLithium.name=Molten lithium +remove_last_link=Remove last link +clear_all_links=Clear all links +result_of_molding=Result of molding: +ihl.tooltip.step=Step +remove_wax_using_muffle_furnace=Remove wax using muffle furnace +fill_from_top_with_molten_metal=Fill from top with molten metal +wait_for_10_seconds=Wait for 10 seconds +destroy_mold_to_get_results=Destroy mold to get result +item.breadWithLard.name=Bread with lard +redstoneEmitter.name=Redstone emitter +redstoneSensor.name=Redstone sensor +ihl.wiremill.tip=This machine need a coiler device /n installed near output side of /n block to process. Bobbin side of /n coiler must be closest to wire mill. /n If you need to produce insulated /n cables, install vulcanisation /n extruding mold inbetween. +ihl.coiler.tip=You can join together unused /n segments of fibers and /n wires at iron workbench. +mB=mB +ihl.ingot=ingot +ihl.tub=tub +ihl.blankChisel=blank for chisel +ihl.carvingKnife=carving knife +ihl.toolHeadHammerSmall=hammer head +ihl.barD10=tiny bar +ihl.stick=rod +ihl.setOfPartsForLVElemotor=set of parts for basic DC engine +ihl.pipelineAccessories=pipeline accessories +ihl.highPressureVessel=high pressure vessel +ihl.gasJet=gas jet +ihl.handDrillSetOfMoldedParts=set of parts for hand drill +ihl.detonationSprayingMachineSetOfMoldedParts=set of parts for detonation spraying machine +ihl.viseSetOfMoldedParts=set of parts for vise +ihl.rollingMachineSetOfMoldedParts=parts for rolling machine +ihl.polishingPucks=polishing pucks +ihl.turboCompressorSetOfMoldedParts=parts for turbo compressor +ihl.extruderSetOfMoldedParts=set of parts for extruder \ No newline at end of file diff --git a/src/main/java/assets/ihl/lang/zh_CN.lang b/src/main/java/assets/ihl/lang/zh_CN.lang new file mode 100644 index 0000000..cf9ad14 --- /dev/null +++ b/src/main/java/assets/ihl/lang/zh_CN.lang @@ -0,0 +1,584 @@ +language.name=HAYO +language.region=CN +language.code=zh_CN + +ihl.solarEvaporator=太阳能蒸发器 +ihl.achesonFurnace=Acheson furnace +ihl.chemicalReactor=化学反应器 +ihl.crucible=高温陶瓷坩埚 +ihl.cryogenicDistiller=低温蒸馏器 +ihl.detonationSprayingMachine=爆炸喷涂机 +ihl.electricEvaporator=电热蒸发器 +ihl.electrolysisBath=瓷电解槽 +ihl.evaporator=蒸发器 +ihl.extruder=硫化橡胶挤出模 +ihl.fluidizedBedReactor=流化床反应器 +ihl.fractionator=分流器 +ihl.gasWeldingStationGas=Gas wielding station +ihl.impregnatingMachine=青铜反应槽 +ihl.injectionMold=浇铸模具 +ihl.ironWorkbench=铁质工作台 +ihl.labElectrolyzer=电解槽 +ihl.leadOven=固体化学反应炉 +ihl.loom=纺织机 +ihl.muffleFurnace=隔焰炉 +ihl.paperMachine=造纸机 +ihl.rollingMachine=辊压机 +ihl.woodenRollingMachine=轧制机 +ihl.wireMill=线材轧机 +ihl.vulcanizationExtrudingMold=硫化混合挤出口 +ihl.dosingPump.tip=输入每次收到红石信号输出的液体量 /n 按回车确认 +ihl.detonatorHint=合成时右键点击可以设置引爆延迟时间 +ihl.setOfDiesHint=合成时右键点击可以设置截面面积 +ihl.lenght=长度 +ihl.resistivity=电阻率 +ihl.wire_material=线缆材料 +ihl.transverse_section=截面面积 +ihl.insulation_material=绝缘材料 +ihl.insulation_thickness=绝缘厚度 +ihl.insulation_beakdown_voltage=绝缘失效电压 +ihl.powerCableTooltip=这根黑科技线缆可以穿过未载入的区块传输能源。 +ihl.detonator_delay=起爆延迟: +ihl.explosionPower=爆炸当量: +ihl.mTNT=克TNT炸药 +ihl.seconds=秒 +tile.pileBlock.name=碎片堆 +tile.dosingPump.name=计量泵 +detonator.name=雷管 +dustPentaerythritolTetranitrate.name=季戊四醇四硝酸酯 +dustPentaerythritol.name=季戊四醇 +dustPotassiumOxide=氧化钾 +ingotPotassium.name=钾锭 +catalystIron.name=铁催化剂 +catalystIronOxide.name=氧化铁催化剂粗胚 +catalystRawIronOxide.name=氧化铁催化剂粗胚(未烧结) +dustIronOxideCatalystMix.name=氧化铁催化剂粉 +dustSodiumFormate.name=甲酸钠粉 +dustMercuryChloride.name=氯化汞粉 +dustMercuryFulminate.name=雷酸汞粉 +dustCalciumAcetate.name=钙粉 +itemCellMethanol=甲醇单元 +itemCellNitroGlycerin=硝酸甘油单元 +itemCellAmmonia.name=氨单元 +itemCellGlycerol.name=甘油单元 +item.skull.name=遗失之魂碎片 +item.guidebook.name=IHL手册 +item.handpump.name=IHL手动泵 +item.advanced_handpump.name=IHL高级手动泵 +item.collector.name=IHL Collector +item.collectorHeavy.name=IHL Heavy Collector +item.handpump_discharged.name=IHL手动泵 + +tile.boneBlock.name=骨头块 +entity.LostHead.name=遗失之魂 +tile.ihlExplosive.name=炸药包 +tile.solarEvaporator.name=太阳能蒸发器 +tile.evaporatorBlock.name=蒸发器 +tile.electricEvaporatorBlock.name=电热蒸发器 +tile.sackBlock.name=乳胶收集袋 +tile.rubberTreeBlock.name=橡胶树原木 +ihl.gui.evaporator=IHL 蒸发器 +ihl.gui.electricEvaporator=电热蒸发器 +ihl.gui.tdit.message0=就绪, 已上电 +ihl.gui.tdit.message1=能源不足 +ihl.gui.tdit.message2=接收器无响应 +ihl.gui.tdit.message3=接收器未定义 +ihl.gui.tdit.message4=清空接收器内部空间! +tile.blockFluidRubberTreeSap.name=乳胶 +itemCellfluidRubberTreeSap.name=乳胶单元 +tile.blockFluidAquaRegia.name=王水 +itemCellAquaRegia.name=王水单元 +tile.blockFluidSodiumPeroxide.name=过氧化钠 +itemCellSodiumPeroxide.name=过氧化钠单元 +tile.blockFluidOsmiumTetroxide.name=四氧化锇 +itemCellOsmiumTetroxide.name=四氧化锇单元 +tile.blockFluidNickelSulfateDissolvedInWater.name=硫酸镍溶液 +itemCellNickelSulfateDissolvedInWater.name=硫酸镍溶液单元 +tile.blockFluidBlueVitriolDissolvedInWater.name=五水合硫酸铜溶液 +itemCellBlueVitriolDissolvedInWater.name=五水合硫酸铜溶液单元 +tile.blockFluidNitricAcid.name=硝酸 +item.itemCellNitricAcid.name=硝酸单元 +tile.blockMoltenGold.name=熔融金 +itemDustSludge.name=矿物未溶解污泥 +itemDustSludgeTiny.name=小撮矿物未溶解污泥 +itemDustSodiumPeroxide.name=过氧化钠 +itemDustIridiumAndSodiumOxide.name=氧化铱和钠 + +tile.tditBlock.name=跨维物品传送器 +item.tditFrequencyTransmitter.name=T.D.I.T. 频率发射器 + +tile.cableAnchor.name=接线盒 +wire.name=未绝缘电线 +cable.name=电线 +tile.ironWorkbench.name=铁制工作台 +item.ironWorkbenchItem.name=铁制工作台 +setOfDies1_5sqmm.name=一套拉丝磨具 +ihl.gui.achesonFurnance=艾奇逊电炉 +ihl.gui.coiler=卷线机 +ihl.gui.muffleFurnace=隔焰炉 + +tile.blockAquaRegia.name=王水 +tile.blockOsmiumTetroxide.name=四氧化锇 +tile.blockNickelSulfateDissolvedInWater.name=硫酸镍溶液 +tile.blockBlueVitriolDissolvedInWater.name=五水合硫酸铜溶液 +tile.blockNitricAcid.name=硝酸 +tile.blockSodiumPeroxide.name=过氧化钠 +tile.blockCablingColophony.name=松香 +tile.blockSpruceResin.name=松脂 +tile.blockfluidRubberTreeSap.name=乳胶 +tile.blockGlyceryl.name=甘油 +tile.blockSeedOil.name=种子油 +tile.blockMoltenSteel.name=熔融钢 +tile.debugScanner.name=矿物辞典扫描仪 +tile.oreApatite.name=磷灰石矿石 +tile.oreSaltpeter.name=硝石矿石 +tile.achesonFurnance.name=艾奇逊电炉 +item.crucible.name=高温陶瓷坩埚 +item.bucket_SpruceResin.name=松脂桶 + +item.bucket_fluidRubberTreeSap.name=乳胶桶 +bucket_tarPitch.name=焦油沥青桶 +gemApatite.name=磷灰石 +ingotTarPitch.name=焦油沥青锭 +nuggetTarPitch.name=焦油沥青颗粒 +stickCoal.name=煤沥青 +stickCoalElectrodePremix.name=煤沥青杆 +dustCoalElectrodePremix.name=煤沥青粉 +stickGraphite.name=石墨电极 +dustCarborundum.name=碳化硅粉 +dustSaltpeter.name=硝 +spruceBlock.name=剥皮云杉 +itemCellSpruceResin.name=松脂单元 +itemCellCablingColophony.name=松香单元 +itemCellSeedOil.name=种子油单元 +itemCellGlyceryl.name=甘油单元 +itemCellMoltenSteel.name=熔融钢单元 +ihl.gui.blueprint=一套蓝图 +ihl.temperature.units=C +molten.bronze=熔融青铜 +molten.iron=熔融铁 +amount=合计: + +tile.blockOleicAcid.name=油酸 +tile.blockLimemilk.name=石灰乳 +tile.blockMoltenRubberWithSulfur.name=预硫化橡胶 +tile.blockMoltenBronze.name=熔融青铜 +tile.blockVapourSulfuricAcid.name=硫酸蒸汽 +tile.blockSulfuricAcidAnhydride.name=硫酸酐蒸汽 +tile.blockSulfuricAcid.name=硫酸 +tile.wireMill.name=线材轧机 +tile.vulcanizationExtrudingMold.name=硫化混合挤出口 +tile.extruder.name=硫化橡胶挤出模 +tile.rollingMachinePart1.name=辊压机 p.#1 +tile.rollingMachinePart2.name=辊压机 p.#2 +tile.loom.name=纺织机 +tile.coiler.name=卷线机 +tile.lathePart1.name=车床 p.#1 +tile.lathePart2.name=车床 p.#2 +tile.fiberglassSpinnerets.name=玻璃纤维喷丝板 +tile.goldPrecipitatorCondenser.name=冷凝器 +tile.goldChimneyKnee.name=弯曲烟囱+蒸汽喷射器 +tile.leadOven.name=固体化学反应炉 +tile.cannonBronze.name=爆炸喷涂机 +tile.tubBronze.name=青铜反应槽 +tile.achesonFurnance.name=艾奇逊电炉 +tile.muffleFurnance.name=隔焰炉 +pipeRubberWithSulfur.name=天然橡胶管道 +pipeVulcanizedRubber.name=硫化橡胶管道 +tinSnipsSteel.name=铁皮剪 +hammer.name=锤子 +grindstone.name=磨刀石 +chisel.name=凿子 +needleFile.name=细锉 +drillSteelHardened.name=钢淬火钻头 +hackSawSteel.name=钢手锯 +handDrillBronze.name=青铜手提钻 +setOfFilesSteel.name=一套细锉 +viseSteel.name=钢夹具 +tapM10x1SteelHardened.name=M10x1型丝锥 (淬火) +diceM10x1SteelHardened.name=M10x1型圆模 (淬火) +graverSteelHardened.name=雕刻刀 (淬火) +sharpenedCarvingKnifeBronze.name=开封青铜小刀 +tile.oreTrona.name=天然碱矿石 +tile.oreLimestone.name=石灰石 +tile.oreGypsum.name=石膏矿石 +tile.orePotassiumFeldspar.name=钾长石 +tile.injectionMold.name=浇铸模具 +itemCellNitricAcid.name=硝酸单元 +itemCellSulfuricAcid.name=硫酸单元 +itemCellSulfuricAnhydride.name=硫酸酐单元 +itemCellVapourSulfuricAcid.name=硫酸蒸汽单元 +itemCellMoltenBronze.name=熔融青铜单元 +itemCellLimemilk.name=石灰乳单元 +itemCellOleicAcid.name=油酸单元 +itemCellLiquidGlass.name=熔融玻璃单元 +itemCellNatriumHydroxideDissolvedInWater.name=氢氧化钠溶液单元 +itemCellOxygen.name=氧气单元 +itemCellAcetylene.name=乙炔单元 +itemCellNitrogen.name=氮气单元 +springSteel.name=钢弹簧 +toolTinSnipsPartsSteel.name=锡剪刀部件 +toolHeadHammerSmallSteel.name=钢 锤头 +blankNeedleFileSteel.name=钢锉刀盒 +dustDehydratedGypsum.name=脱水石膏 +carvingKnifeBronze.name=小刀 (需要开封) +muttonLard.name=羊油 +ingotStearin.name=硬脂精 +ingotCalciumSoap.name=硬脂酸钙 +dustBrick.name=陶瓷粉 +dustGraphite.name=石墨粉 +crucibleMixture.name=高温陶土 +blankChiselSteel.name=钢粗制凿子 +plateHotSteel.name=红热钢板 +dustIrongraphite.name=铁石墨粉 +viseSetOfMoldedPartsSteel.name=夹具部件 +latheSetOfMoldedPartsSteel.name=车床部件 +handDrillSetOfMoldedPartsBronze.name=手提钻部件 +blankSetOfFilesSteel.name=锉刀盒 +diceM10x1Steel.name=M10x1型圆模(尚未淬火) +tapM10x1Steel.name=M10x1型丝锥(尚未淬火) +shaftSteel.name=钢轴 +meshGlass.name=玻璃纤维网 +extruderSetOfMoldedPartsSteel.name=硫化橡胶挤出模部件 +boltM10x1Steel.name=M10x1型螺栓 +linerIronGraphiteGreased.name=铁石墨轴瓦 (上油并且可以用了) +linerIronGraphiteHot.name=红热铁石墨轴瓦 +linerIronGraphite.name=铁石墨轴瓦(未烧结) +sawBladeSteelHardened.name=淬火锯片 +sawBladeSteelHot.name=红热锯片 +sawBladeSteel.name=锯片(需要淬火!) +barD10SteelHot.name=小块红热钢条 (D=10 mm) +barD10Steel.name=微型钢条 (D=10 mm) +drillSteelHot.name=红热钢钻头 +drillSteel.name=钢钻头(需要淬火!) +graverSteelHot.name=红热钢雕刻刀 +graverSteel.name=钢雕刻刀(需要淬火!) +nutM10x1Steel.name=M10x1型螺母 +nailSteel.name=钉子(2英尺) +diceM10x1SteelHot.name=红热M10x1型圆模 +tapM10x1SteelHot.name=红热M10x1型丝锥 +plateNonVulcanizedRubber.name=天然橡胶板 +machineCasingSetOfPartsSteel.name=基本机器部件 +setOfPartsForLVElemotorSteel.name=直流电机部件 +detonationSprayingMachineSetOfMoldedPartsBronze.name=爆炸喷涂机部件 +foilRubberWithSulfur.name=天然橡胶卷 +foilRubber.name=硫化橡胶卷 +dustCalciumCarbide.name=碳化钙粉 +barD10Gold.name=微型金条(D=10 mm) +ingotHotSteel.name=红热钢锭 +blankGasReducerSteel.name=Forged billet for gas reducer +setOfPartsGasReducerSteel.name=Machined billet for gas reducer +gasReducerSteel.name=气体减压器 +electricMotorLVLEDC.name=低压低效能直流电机 +item.electricMotorLVLEDC.name=低压低效能直流电机 +fiberGlass.name=玻璃纤维 +tile.blockAir.name=压缩空气 +tile.blockNitrogen.name=压缩氮气 +tile.blockAcetylene.name=压缩乙炔 +tile.blockOxygen.name=压缩氧气 +tile.cryogenicDistiller.name=低温蒸馏器 +tile.gasWeldingStation.name=气焊机 +tile.woodenRollingMachinePart1.name=轧制机 #1 +tile.woodenRollingMachinePart2.name=轧制机 #2 +tile.blockLiquidGlass.name=熔融玻璃 +tile.blockNatriumHydroxideDissolvedInWater.name=氢氧化钠溶液 +tile.spruceBlock.name=割开的云杉木 +tile.impregnatingMachine.name=(保留) +tile.blockSulfuricAnhydride.name=硫酸酐 +fabric.name=纱布 +foilSteel.name=钢箔卷 +stickSteel.name=钢杆 +dustQuicklime.name=生石灰 +dustCalcite.name=方解石粉 +dustGypsum.name=石膏 +dustPotassiumFeldspar.name=钾长石粉 +tile.oreBauxite.name=铝土矿石 +tile.oreCinnabar.name=朱砂矿石 +tile.oreRockSalt.name=岩盐矿石 +tile.oreGyubnera.name=钨锰铁矿石 +tile.blockPulpMica.name=云母粉 +tile.blockPulpCellulose.name=纤维素浆 +tile.blockFuel.name=柴油 +tile.blockMineralOil.name=矿物油 +tile.blockFuelOil.name=重油 +tile.blockOil.name=石油 +tile.blockMercury.name=汞 +tile.blockVapourMercury.name=汞蒸汽 +tile.blockHydrogen.name=压缩氢气 +tile.blockSaltWater.name=盐水 +tile.blockHydrogenChloride.name=氯化氢(气态) +tile.blockNatriumTungstateDissolvedInWater.name=钨酸钠(溶液) +tile.blockTurpentine.name=松节油 +tile.blockTrichlorosilane.name=三氯氢硅 +tile.blockSiliconTetrachloride.name=四氯化硅 +tile.blockChlorine.name=氯 +itemCellTrichlorosilane.name=三氯氢硅单元 +itemCellSiliconTetrachloride.name=四氯化硅单元 +itemCellChlorine.name=氯单元 +tile.gaedesMercuryRotaryPump.name=转动式水银真空泵 +tile.labElectrolyzer.name=电解槽 +tile.electrolysisBath.name=瓷电解槽 +tile.fluidizedBedReactor.name=流化床反应器 +tile.chemicalReactor.name=化学反应器 +tile.paperMachine.name=造纸机 +tile.oreMica.name=云母矿石 +tile.fractionatorCover.name=分流器盖 +tile.fractionatorSection.name=分流器身 +tile.fractionatorBottom.name=分流器底 +tile.refluxCondenser.name=回流冷凝器 +tile.rectifierTransformerUnit.name=整流器/变压器 +tile.grounding.name=接地 +tile.frequencyGenerator.name=直流转交流逆变器 +tile.batterySwitchUnit.name=开关电源 +tile.oreChromite.name=铬铁矿石 +tile.oreStibnite.name=辉锑矿石 +tile.oreDatolite.name=硅钙硼石 +tile.blockBoricAcid.name=硼酸 +ignitron.name=水银半波整流管 +stickBoronCarbide.name=碳化硼电极 +foilLead.name=铅箔 +dustLeadPlumbate.name=四氧化三铅(铅丹)粉 +vacuumSwitch.name=真空开关管 +hallSensor.name=霍尔传感器 +batteryCellsEbonite.name=硬橡胶电池外壳 +plateMica.name=云母板 +dustBoronCarbide.name=碳化硼粉 +dustBoricAcid.name=硼酸粉 +dustDatolite.name=硅钙硼石粉 +dustFerrite.name=铁氧体粉 +ringFerrite.name=铁氧体环 +ringRawFerrite.name=铁氧体环(未烧结) +dustLithiumOxide.name=氧化锂 +dustSolderingAlloy.name=钎焊合金粉 +dustTinyAntimony.name=小撮锑粉 +insulatorPorcelain.name=瓷绝缘子 +insulatorRawPorcelain.name=瓷绝缘子(未烧结) +dustAntimony.name=锑粉 +dustAntimonyOxide.name=氧化锑 +dustStibnite.name=辉锑矿粉 +crushedPurifiedStibnite.name=纯净粉碎辉锑矿 +crushedStibnite.name=粉碎辉锑矿 +ringPorcelain.name=瓷环 +ringRawPorcelain.name=瓷环(未烧结) +foilCopper.name=铜箔 +crushedPurifiedBauxite.name=纯净粉碎铝土矿 +crushedBauxite.name=粉碎铝土矿 +dustSodiumSulfide.name=硫化钠 +dustSodiumSulfate.name=硫酸钠 +dustWood.name=锯末 +valveTube1C21P.name=1C21P型真空管 +highVoltageCapacitor.name=HV电容器 +foilMica.name=云母箔 +dustMica.name=云母粉 +gaedesPumpBarrelPorcelain.name=转动式水银真空泵机身 +gaedesPumpBarrelRawPorcelain.name=转动式水银真空泵机身 (未烧结) +dustGlass.name=玻璃 粉 +gu-81m.name=GU-81m真空灯 +foilTungsten.name=钨箔 +ingotTungsten.name=钨锭 +plateTungsten.name=钨板 +plateHotTungsten.name=红热钨板 +crushedPurifiedCinnabar.name=纯净粉碎朱砂矿 +crushedCinnabar.name=粉碎朱砂矿 +ovenRawPorcelain.name=化学反应炉 (未烧结) +chimneyKneeRawPorcelain.name=瓷弯曲烟囱 (未烧结) +dustTungsten.name=钨粉 +electrolysisBathPorcelain.name=瓷电解槽 +electrolysisBathRawPorcelain.name=瓷电解槽(未烧结) +dustPorcelain.name=瓷粉 +foilGold.name=金箔 +dustTungsticAcid.name=钨酸粉 +turboCompressorSetOfMoldedPartsBronze.name=涡轮压缩机部件 +cycloneFilterSteel.name=漩风滤器 +dustTungstenOxide.name=氧化钨粉 +dustCalciumTungstate.name=钨酸钙粉 +dustSodiumHydrogenSulfate.name=硫酸氢钠粉 +dustSalt.name=氯化钠(盐)粉 +dustCalciumChloride.name=氯化钙粉 +dustPotassiumSulphate.name=硫酸钾 +dustRockSalt.name=氯化钾(岩盐)粉 +crushedPurifiedGyubnera.name=纯净粉碎钨锰铁矿 +crushedGyubnera.name=粉碎钨锰铁矿 +dustManganeseOxide.name=氧化锰粉 +dustIronOxide.name=氧化铁 (III)粉 +smallRoundSteel.name=小型钢圈 +smallRoundPolishedSteel.name=小型抛光钢圈 +rollingMachineSetOfMoldedpartsSteel.name=辊压机部件 +pistonCylinderSteel.name=活塞和气缸 +blankPistonCylinderSteel.name=空白活塞和气缸 +mixerSteel.name=钢混合器 +pipelineAccessoriesSteel.name=管道配件 +dustTrona.name=天然碱粉 +dustSilicon.name=硅粉 +highPressureVesselSteel.name=高压容器 +gasJetSteel.name=气体喷射管 +dustIridiumAndSodiumOxide.name=氧化铱和钠粉 +dustPlatinumGroupSludge.name=铂族泥 +dustTinyPlatinumGroupSludge.name=小撮铂族泥 +dustSodiumPeroxide.name=过氧化钠粉 +itemCellFuel.name=柴油单元 +itemCellMineralOil.name=矿物油单元 +itemCellFuelOil.name=重油单元 +itemCellOil.name=油单元 +itemCellMercury.name=汞单元 +itemCellHydrogen.name=氢气单元 +itemCellSaltWater.name=盐水单元 +itemCellHydrogenChloride.name=氯化氢单元 +itemCellNatriumTungstateDissolvedInWater.name=钨酸钠溶液单元 +itemCellTurpentine.name=松节油单元 +leadAcidBattery.name=铅酸电池 +plateRawGraphite.name=石墨板 +dustIridium.name=铱粉 +dustTinySilicon.name=小撮硅粉 +dustMagnesiumOxide.name=氧化镁 +dustSilicon.name=硅粉 +dustBischofite.name=水氯镁石粉 +dustMagnesium.name=镁粉 +ingotMagnesium.name=镁锭 +plateGraphite.name=石墨板 +dustTinySiliconDioxide.name=小撮二氧化硅粉 +dustTinyIronOxide.name=小撮氧化铁粉 +dustTinyManganeseOxide.name=小撮氧化锰粉 +dustTinyGypsum.name=小撮石膏粉 +mercuryThermometer.name=汞温度计 +tile.mirror.name=镜子 +polishingPucksSteel.name=抛光片 +glassBlowingTubeSteel.name=玻璃吹管 +item.precipitatorCondenserRawPorcelain.name=冷凝器(未烧结) +precipitatorCondenserRawPorcelain.name=冷凝器(未烧结) +rollingMachineSetOfMoldedPartsSteel.name=辊压机部件 +tile.oreBischofite.name=水氯镁石 +tile.blockMoltenSodiumChloride.name=熔融氯化钠 +tile.blockMoltenMagnesium.name=熔融镁 +tile.horizontalMiningPipeX.name=采矿管道 +tile.horizontalMiningPipeZ.name=采矿管道 +tile.lightBulb.name=灯泡 +ihl.as_byproduct_of_processing_of=作为附产物产出 +ihl.in_chemical_reactor=在化学反应器. +ihl.check_usage=Check usage here: +ihl.transversesection=横断面: + +fluid.nitricacid=硝酸 +fluid.sulfuricacid=硫酸 +fluid.sulfuricanhydride=硫酸酐 +fluid.vapour.sulfuricacid=硫酸蒸汽 +fluid.molten.gold=熔融金 +fluid.molten.glass=熔融玻璃 +fluid.molten.bronze=熔融青铜 +fluid.molten.copper=熔融铜 +fluid.molten.steel=熔融钢 +fluid.molten.magnesium=熔融镁 +fluid.molten.sodiumchloride=熔融氯化钠 +fluid.molten.lithium=熔融锂 +fluid.molten.rubberwithsulfur=熔融硫磺橡胶 +fluid.solution.bluevitriol=五水合硫酸铜溶液 +fluid.solution.nickelsulfate=硫酸镍溶液 +fluid.limemilk=石灰乳 +fluid.oleicacid=油酸 +fluid.osmiumtetroxide=四氧化锇 +fluid.sodiumperoxide=过氧化钠 +fluid.aquaregia=王水 +fluid.seedoil=种子油 +fluid.glyceryl=甘油 +fluid.cablingcolophony=松香 +fluid.spruceresin=松脂 +fluid.rubbertreesap=乳胶 +fluid.liquidglass=熔融玻璃 +fluid.solution.natriumhydroxide=氢氧化钠溶液 +fluid.oxygen=氧气 +fluid.acetylene=乙炔 +fluid.nitrogen=氮气 +fluid.air=空气 +fluid.turpentine=松节油 +fluid.solution.natriumtungstate=钨酸钠溶液 +fluid.hydrogenchloride=氯化氢 +fluid.saltwater=盐水 +fluid.hydrogen=氢气 +fluid.vapour.mercury=汞蒸汽 +fluid.mercury=汞 +fluid.oil=油 +fluid.fueloil=重油 +fluid.mineraloil=矿物油 +fluid.fuel=柴油 +fluid.pulp.cellulose=纤维素浆 +fluid.pulp.mica=云母粉 +fluid.boricacid=硼酸 +fluid.chlorine=氯 +fluid.silicontetrachloride=四氯化硅 +fluid.trichlorosilane=三氯氢硅 +fluid.tile.water=水 +fluid.tile.lava=岩浆 +fluid.pulp.sodiumzeolite=钠沸石浆 +fluid.molten.tarpitch=焦油沥青 +fluid.crackinggas=裂解气体 +fluid.solution.lithiumchloride=氯化锂溶液 +fluid.solution.calciumchloride=氯化钙溶液 + +ihl.use_with_cryogenic_distiller=和低温蒸馏器一起使用 +ihl.dsmhint=在这个方块上使用打火石以获得产物。 +ihl.gui.lathe=车床 +tile.glowningAir.name=空气 +tile.glassBoxBlock.name=玻璃盒 +tile.spotlight.name=聚光灯 +lampHolderPorcelain.name=瓷灯座 +lampHolderRawPorcelain.name=瓷灯座 (未烧结) +ihl.durability=耐久: +ihl.mutton_drop_hint=使用这个工具杀羊可以获得羊油. +ihl.attack_damage=伤害: +fiberGlassDieSteel.name=玻璃纤维模具 +item.fiberGlass.name=玻璃纤维 +tile.gasWeldingStation.tooltip=确认在蓝色容器中 /n 的氧气量与红色 /n 容器中的乙炔量 +tile.gaedesMercuryRotaryPump.tooltip=确认机器一切正常 +tile.lathePart1.tooltip=确认机器一切正常 +advancedShieldAssemblyUnitBlock.name=Hydrotransport shield assembly unit +IHLShieldAssemblyUnitBlock.name=Shield assembly unit +tile.IHLMultiBlockSpacerBlock.name=Multiblock spacer +tile.vacuumInductionMeltingFurnace.name=Vacuum induction melting furnace +tile.hydrotransportPulpRegenerator.name=水力纸浆再生器 +tile.blockZeolitePulp.name=钠沸石浆 +tile.blockMoltenTarPitch.name=熔融焦油沥青 +dustSodiumZeolite.name=钠沸石粉 +dustSodiumZeoliteCoked.name=焦化钠沸石粉 +dustSodiumAluminate.name=铝酸钠粉 +dustSodiumHydroxide.name=氢氧化钠粉 +dustTinyTungsten.name=小撮钨粉 +dustBauxite.name=铝土粉 +incisorSteelDiamondCoated.name=钻石涂层刮刀 +incisorSteel.name=刮刀 +plateCoal.name=煤板 +plateRawCoal.name=煤沥青板 +ingotLithium.name=锂锭 +dustLithiumChloride.name=氯化锂粉 +tile.blockMoltenLithium.name=熔融锂 +remove_last_link=清除最后一个链接 +clear_all_links=清除所有链接 +result_of_molding=模具产物: +ihl.tooltip.step=步骤 +remove_wax_using_muffle_furnace=使用隔焰炉融化表面的蜡 +fill_from_top_with_molten_metal=从顶部填充融化的金属 +wait_for_10_seconds=等待10秒钟 +destroy_mold_to_get_results=破坏模具以获得产物 +item.breadWithLard.name=羊油面包 +redstoneEmitter.name=红石信号发生器 +redstoneSensor.name=红石信号传感器 +ihl.wiremill.tip=这台机器需要在边上 /n 紧贴一台卷线机如果 /n 需要对线缆进行绝缘 /n 你需要在卷线机和线 /n 材轧机之间放置一台 /n 硫化橡胶挤出模。 +ihl.coiler.tip=你可以在铁质工作 /n 台里合并未使用的 /n 纤维或电线卷。 +mB=mB +ihl.ingot=锭 +ihl.tub=tub +ihl.blankChisel=粗制凿子 +ihl.carvingKnife=小刀 +ihl.toolHeadHammerSmall=锤头 +ihl.barD10=微型条 +ihl.stick=杆 +ihl.setOfPartsForLVElemotor=直流电机部件 +ihl.pipelineAccessories=管道配件 +ihl.highPressureVessel=高压容器 +ihl.gasJet=气体喷射管 +ihl.handDrillSetOfMoldedParts=手提钻部件 +ihl.detonationSprayingMachineSetOfMoldedParts=爆炸喷涂机部件 +ihl.viseSetOfMoldedParts=夹具部件 +ihl.rollingMachineSetOfMoldedParts=辊压机部件 +ihl.polishingPucks=抛光圆盘 +ihl.turboCompressorSetOfMoldedParts=涡轮压缩机部件 +ihl.extruderSetOfMoldedParts=硫化橡胶挤出模部件 diff --git a/src/main/java/assets/ihl/sounds.json b/src/main/java/assets/ihl/sounds.json new file mode 100644 index 0000000..c51e488 --- /dev/null +++ b/src/main/java/assets/ihl/sounds.json @@ -0,0 +1,82 @@ +{ + "handpumpOne": { + "category": "neutral", + "sounds": [ + "handpumpOne" + ] + }, + "lostHeadCry": { + "category": "hostile", + "sounds": [ + "lostHeadCry", + "lostHeadCry-001", + "lostHeadCry-002", + "lostHeadCry-003", + "lostHeadCry-004", + "lostHeadCry-005", + "lostHeadCry-006", + "lostHeadCry-007" + ] + }, + "lostHeadLaught": { + "category": "hostile", + "sounds": [ + "lostHeadLaught", + "lostHeadLaught-001", + "lostHeadLaught-002", + "lostHeadLaught-003" + ] + }, + "lostHeadLaughtLong": { + "category": "hostile", + "sounds": [ + "lostHeadLaughtLong" + ] + }, + "lostHeadScream": { + "category": "hostile", + "sounds": [ + "lostHeadScream", + "lostHeadScream-001", + "lostHeadScream-002", + "lostHeadScream-003", + "lostHeadScream-004" + ] + }, + "lostHeadDeath": { + "category": "hostile", + "sounds": [ + "lostHeadDeath" + ] + }, + "spotlightRotating": { + "category": "master", + "sounds": [ + "spotlightRotating" + ] + }, + "electrocution": { + "category": "master", + "sounds": [ + "electrocution" + ] + }, + "zap": { + "category": "master", + "sounds": [ + "zap" + ] + }, + "explosion": { + "category": "master", + "sounds": [ + "explosion" + ] + }, + "fuse": { + "category": "master", + "sounds": [ + "fuse" + ] + } +} diff --git a/src/main/java/assets/ihl/sounds/electrocution.ogg b/src/main/java/assets/ihl/sounds/electrocution.ogg new file mode 100644 index 0000000..225fc13 Binary files /dev/null and b/src/main/java/assets/ihl/sounds/electrocution.ogg differ diff --git a/src/main/java/assets/ihl/sounds/explosion.ogg b/src/main/java/assets/ihl/sounds/explosion.ogg new file mode 100644 index 0000000..56d4c4c Binary files /dev/null and b/src/main/java/assets/ihl/sounds/explosion.ogg differ diff --git a/src/main/java/assets/ihl/sounds/fuse.ogg b/src/main/java/assets/ihl/sounds/fuse.ogg new file mode 100644 index 0000000..9693279 Binary files /dev/null and b/src/main/java/assets/ihl/sounds/fuse.ogg differ diff --git a/src/main/java/assets/ihl/sounds/handpumpOne.ogg b/src/main/java/assets/ihl/sounds/handpumpOne.ogg new file mode 100644 index 0000000..0d69c97 Binary files /dev/null and b/src/main/java/assets/ihl/sounds/handpumpOne.ogg differ diff --git a/src/main/java/assets/ihl/sounds/lostHeadCry-001.ogg b/src/main/java/assets/ihl/sounds/lostHeadCry-001.ogg new file mode 100644 index 0000000..6d18146 Binary files /dev/null and b/src/main/java/assets/ihl/sounds/lostHeadCry-001.ogg differ diff --git a/src/main/java/assets/ihl/sounds/lostHeadCry-002.ogg b/src/main/java/assets/ihl/sounds/lostHeadCry-002.ogg new file mode 100644 index 0000000..bf17566 Binary files /dev/null and b/src/main/java/assets/ihl/sounds/lostHeadCry-002.ogg differ diff --git a/src/main/java/assets/ihl/sounds/lostHeadCry-003.ogg b/src/main/java/assets/ihl/sounds/lostHeadCry-003.ogg new file mode 100644 index 0000000..fa85ab7 Binary files /dev/null and b/src/main/java/assets/ihl/sounds/lostHeadCry-003.ogg differ diff --git a/src/main/java/assets/ihl/sounds/lostHeadCry-004.ogg b/src/main/java/assets/ihl/sounds/lostHeadCry-004.ogg new file mode 100644 index 0000000..05aee6c Binary files /dev/null and b/src/main/java/assets/ihl/sounds/lostHeadCry-004.ogg differ diff --git a/src/main/java/assets/ihl/sounds/lostHeadCry-005.ogg b/src/main/java/assets/ihl/sounds/lostHeadCry-005.ogg new file mode 100644 index 0000000..a3a6327 Binary files /dev/null and b/src/main/java/assets/ihl/sounds/lostHeadCry-005.ogg differ diff --git a/src/main/java/assets/ihl/sounds/lostHeadCry-006.ogg b/src/main/java/assets/ihl/sounds/lostHeadCry-006.ogg new file mode 100644 index 0000000..5bece60 Binary files /dev/null and b/src/main/java/assets/ihl/sounds/lostHeadCry-006.ogg differ diff --git a/src/main/java/assets/ihl/sounds/lostHeadCry-007.ogg b/src/main/java/assets/ihl/sounds/lostHeadCry-007.ogg new file mode 100644 index 0000000..261b18b Binary files /dev/null and b/src/main/java/assets/ihl/sounds/lostHeadCry-007.ogg differ diff --git a/src/main/java/assets/ihl/sounds/lostHeadCry.ogg b/src/main/java/assets/ihl/sounds/lostHeadCry.ogg new file mode 100644 index 0000000..e4a69b1 Binary files /dev/null and b/src/main/java/assets/ihl/sounds/lostHeadCry.ogg differ diff --git a/src/main/java/assets/ihl/sounds/lostHeadDeath.ogg b/src/main/java/assets/ihl/sounds/lostHeadDeath.ogg new file mode 100644 index 0000000..9cc065e Binary files /dev/null and b/src/main/java/assets/ihl/sounds/lostHeadDeath.ogg differ diff --git a/src/main/java/assets/ihl/sounds/lostHeadLaught-001.ogg b/src/main/java/assets/ihl/sounds/lostHeadLaught-001.ogg new file mode 100644 index 0000000..240472d Binary files /dev/null and b/src/main/java/assets/ihl/sounds/lostHeadLaught-001.ogg differ diff --git a/src/main/java/assets/ihl/sounds/lostHeadLaught-002.ogg b/src/main/java/assets/ihl/sounds/lostHeadLaught-002.ogg new file mode 100644 index 0000000..84c4edd Binary files /dev/null and b/src/main/java/assets/ihl/sounds/lostHeadLaught-002.ogg differ diff --git a/src/main/java/assets/ihl/sounds/lostHeadLaught-003.ogg b/src/main/java/assets/ihl/sounds/lostHeadLaught-003.ogg new file mode 100644 index 0000000..e694bbf Binary files /dev/null and b/src/main/java/assets/ihl/sounds/lostHeadLaught-003.ogg differ diff --git a/src/main/java/assets/ihl/sounds/lostHeadLaught.ogg b/src/main/java/assets/ihl/sounds/lostHeadLaught.ogg new file mode 100644 index 0000000..7816cb0 Binary files /dev/null and b/src/main/java/assets/ihl/sounds/lostHeadLaught.ogg differ diff --git a/src/main/java/assets/ihl/sounds/lostHeadLaughtLong.ogg b/src/main/java/assets/ihl/sounds/lostHeadLaughtLong.ogg new file mode 100644 index 0000000..57e156c Binary files /dev/null and b/src/main/java/assets/ihl/sounds/lostHeadLaughtLong.ogg differ diff --git a/src/main/java/assets/ihl/sounds/lostHeadScream-001.ogg b/src/main/java/assets/ihl/sounds/lostHeadScream-001.ogg new file mode 100644 index 0000000..73e1855 Binary files /dev/null and b/src/main/java/assets/ihl/sounds/lostHeadScream-001.ogg differ diff --git a/src/main/java/assets/ihl/sounds/lostHeadScream-002.ogg b/src/main/java/assets/ihl/sounds/lostHeadScream-002.ogg new file mode 100644 index 0000000..fe41928 Binary files /dev/null and b/src/main/java/assets/ihl/sounds/lostHeadScream-002.ogg differ diff --git a/src/main/java/assets/ihl/sounds/lostHeadScream-003.ogg b/src/main/java/assets/ihl/sounds/lostHeadScream-003.ogg new file mode 100644 index 0000000..100948e Binary files /dev/null and b/src/main/java/assets/ihl/sounds/lostHeadScream-003.ogg differ diff --git a/src/main/java/assets/ihl/sounds/lostHeadScream-004.ogg b/src/main/java/assets/ihl/sounds/lostHeadScream-004.ogg new file mode 100644 index 0000000..e09b844 Binary files /dev/null and b/src/main/java/assets/ihl/sounds/lostHeadScream-004.ogg differ diff --git a/src/main/java/assets/ihl/sounds/lostHeadScream.ogg b/src/main/java/assets/ihl/sounds/lostHeadScream.ogg new file mode 100644 index 0000000..7b2fe78 Binary files /dev/null and b/src/main/java/assets/ihl/sounds/lostHeadScream.ogg differ diff --git a/src/main/java/assets/ihl/sounds/spotlightRotating.ogg b/src/main/java/assets/ihl/sounds/spotlightRotating.ogg new file mode 100644 index 0000000..1575598 Binary files /dev/null and b/src/main/java/assets/ihl/sounds/spotlightRotating.ogg differ diff --git a/src/main/java/assets/ihl/sounds/zap.ogg b/src/main/java/assets/ihl/sounds/zap.ogg new file mode 100644 index 0000000..4efbcca Binary files /dev/null and b/src/main/java/assets/ihl/sounds/zap.ogg differ diff --git a/src/main/java/assets/ihl/textures/blocks/achesonOvenTop.png b/src/main/java/assets/ihl/textures/blocks/achesonOvenTop.png new file mode 100644 index 0000000..12e9d92 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/achesonOvenTop.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/batterySwitchUnit.png b/src/main/java/assets/ihl/textures/blocks/batterySwitchUnit.png new file mode 100644 index 0000000..620dca0 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/batterySwitchUnit.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/blockRubWoodFront.png b/src/main/java/assets/ihl/textures/blocks/blockRubWoodFront.png new file mode 100644 index 0000000..057adf0 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/blockRubWoodFront.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/blockRubWoodSide.png b/src/main/java/assets/ihl/textures/blocks/blockRubWoodSide.png new file mode 100644 index 0000000..a03321d Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/blockRubWoodSide.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/blockRubWoodTop.png b/src/main/java/assets/ihl/textures/blocks/blockRubWoodTop.png new file mode 100644 index 0000000..f631f66 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/blockRubWoodTop.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/blockSpruceFront.png b/src/main/java/assets/ihl/textures/blocks/blockSpruceFront.png new file mode 100644 index 0000000..45d6451 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/blockSpruceFront.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/boneBlockSide1.png b/src/main/java/assets/ihl/textures/blocks/boneBlockSide1.png new file mode 100644 index 0000000..35789d2 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/boneBlockSide1.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/boneBlockSide2.png b/src/main/java/assets/ihl/textures/blocks/boneBlockSide2.png new file mode 100644 index 0000000..e9cc808 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/boneBlockSide2.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/boneBlockSide3.png b/src/main/java/assets/ihl/textures/blocks/boneBlockSide3.png new file mode 100644 index 0000000..b198a22 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/boneBlockSide3.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/boneBlockSide4.png b/src/main/java/assets/ihl/textures/blocks/boneBlockSide4.png new file mode 100644 index 0000000..74b3125 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/boneBlockSide4.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/boneBlockTop.png b/src/main/java/assets/ihl/textures/blocks/boneBlockTop.png new file mode 100644 index 0000000..905a559 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/boneBlockTop.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/brickOvenBack.png b/src/main/java/assets/ihl/textures/blocks/brickOvenBack.png new file mode 100644 index 0000000..cb2b664 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/brickOvenBack.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/brickOvenSide.png b/src/main/java/assets/ihl/textures/blocks/brickOvenSide.png new file mode 100644 index 0000000..550e0f7 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/brickOvenSide.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/brickOvenTop.png b/src/main/java/assets/ihl/textures/blocks/brickOvenTop.png new file mode 100644 index 0000000..b06afda Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/brickOvenTop.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/cannonBronze.png b/src/main/java/assets/ihl/textures/blocks/cannonBronze.png new file mode 100644 index 0000000..983f019 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/cannonBronze.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/chemicalReactorOutputSide.png b/src/main/java/assets/ihl/textures/blocks/chemicalReactorOutputSide.png new file mode 100644 index 0000000..74317eb Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/chemicalReactorOutputSide.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/coiler.png b/src/main/java/assets/ihl/textures/blocks/coiler.png new file mode 100644 index 0000000..df22c21 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/coiler.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/cryogenicDistillerBack.png b/src/main/java/assets/ihl/textures/blocks/cryogenicDistillerBack.png new file mode 100644 index 0000000..ffd95bd Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/cryogenicDistillerBack.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/cryogenicDistillerInputSide.png b/src/main/java/assets/ihl/textures/blocks/cryogenicDistillerInputSide.png new file mode 100644 index 0000000..0c289b5 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/cryogenicDistillerInputSide.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/cryogenicDistillerNitrogenSide.png b/src/main/java/assets/ihl/textures/blocks/cryogenicDistillerNitrogenSide.png new file mode 100644 index 0000000..18a73ea Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/cryogenicDistillerNitrogenSide.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/cryogenicDistillerOxygenSide.png b/src/main/java/assets/ihl/textures/blocks/cryogenicDistillerOxygenSide.png new file mode 100644 index 0000000..abb06cc Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/cryogenicDistillerOxygenSide.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/detonationSprayingMachine.png b/src/main/java/assets/ihl/textures/blocks/detonationSprayingMachine.png new file mode 100644 index 0000000..9d27cf4 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/detonationSprayingMachine.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/detonationSprayingMachineIcon.png b/src/main/java/assets/ihl/textures/blocks/detonationSprayingMachineIcon.png new file mode 100644 index 0000000..5b37fb2 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/detonationSprayingMachineIcon.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/dosingPumpBack.png b/src/main/java/assets/ihl/textures/blocks/dosingPumpBack.png new file mode 100644 index 0000000..4064af6 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/dosingPumpBack.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/dosingPumpFront.png b/src/main/java/assets/ihl/textures/blocks/dosingPumpFront.png new file mode 100644 index 0000000..1a98225 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/dosingPumpFront.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/dosingPumpLeft.png b/src/main/java/assets/ihl/textures/blocks/dosingPumpLeft.png new file mode 100644 index 0000000..8cb9d8a Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/dosingPumpLeft.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/dosingPumpRight.png b/src/main/java/assets/ihl/textures/blocks/dosingPumpRight.png new file mode 100644 index 0000000..603d57e Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/dosingPumpRight.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/dosingPumpTop.png b/src/main/java/assets/ihl/textures/blocks/dosingPumpTop.png new file mode 100644 index 0000000..711ab59 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/dosingPumpTop.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/electricEvaporatorBottom.png b/src/main/java/assets/ihl/textures/blocks/electricEvaporatorBottom.png new file mode 100644 index 0000000..7f09822 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/electricEvaporatorBottom.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/electricEvaporatorFront.png b/src/main/java/assets/ihl/textures/blocks/electricEvaporatorFront.png new file mode 100644 index 0000000..dfb4182 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/electricEvaporatorFront.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/electricEvaporatorFrontActive.png b/src/main/java/assets/ihl/textures/blocks/electricEvaporatorFrontActive.png new file mode 100644 index 0000000..1eb9ec6 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/electricEvaporatorFrontActive.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/electricEvaporatorSide.png b/src/main/java/assets/ihl/textures/blocks/electricEvaporatorSide.png new file mode 100644 index 0000000..c5ed6f7 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/electricEvaporatorSide.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/electricEvaporatorTop.png b/src/main/java/assets/ihl/textures/blocks/electricEvaporatorTop.png new file mode 100644 index 0000000..94e8d8e Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/electricEvaporatorTop.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/electrolysisBath.png b/src/main/java/assets/ihl/textures/blocks/electrolysisBath.png new file mode 100644 index 0000000..a47b26b Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/electrolysisBath.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/explosiveBlockBottom.png b/src/main/java/assets/ihl/textures/blocks/explosiveBlockBottom.png new file mode 100644 index 0000000..eddc613 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/explosiveBlockBottom.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/explosiveBlockSide.png b/src/main/java/assets/ihl/textures/blocks/explosiveBlockSide.png new file mode 100644 index 0000000..91729a2 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/explosiveBlockSide.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/explosiveBlockTop.png b/src/main/java/assets/ihl/textures/blocks/explosiveBlockTop.png new file mode 100644 index 0000000..b313484 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/explosiveBlockTop.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/extruder.png b/src/main/java/assets/ihl/textures/blocks/extruder.png new file mode 100644 index 0000000..2894cbd Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/extruder.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fiberglassSpinneretsBack.png b/src/main/java/assets/ihl/textures/blocks/fiberglassSpinneretsBack.png new file mode 100644 index 0000000..12c1d2e Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fiberglassSpinneretsBack.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fiberglassSpinneretsFront.png b/src/main/java/assets/ihl/textures/blocks/fiberglassSpinneretsFront.png new file mode 100644 index 0000000..a802cc1 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fiberglassSpinneretsFront.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fiberglassSpinneretsLeft.png b/src/main/java/assets/ihl/textures/blocks/fiberglassSpinneretsLeft.png new file mode 100644 index 0000000..0f5102c Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fiberglassSpinneretsLeft.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fiberglassSpinneretsRight.png b/src/main/java/assets/ihl/textures/blocks/fiberglassSpinneretsRight.png new file mode 100644 index 0000000..2839480 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fiberglassSpinneretsRight.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fiberglassSpinneretsTop.png b/src/main/java/assets/ihl/textures/blocks/fiberglassSpinneretsTop.png new file mode 100644 index 0000000..f306ec4 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fiberglassSpinneretsTop.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidAcetaldehydeFlowing.png b/src/main/java/assets/ihl/textures/blocks/fluidAcetaldehydeFlowing.png new file mode 100644 index 0000000..084e79e Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidAcetaldehydeFlowing.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidAcetaldehydeStill.png b/src/main/java/assets/ihl/textures/blocks/fluidAcetaldehydeStill.png new file mode 100644 index 0000000..af64436 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidAcetaldehydeStill.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidAcetyleneFlowing.png b/src/main/java/assets/ihl/textures/blocks/fluidAcetyleneFlowing.png new file mode 100644 index 0000000..2da5458 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidAcetyleneFlowing.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidAcetyleneFlowing.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidAcetyleneFlowing.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidAcetyleneFlowing.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidAcetyleneStill.png b/src/main/java/assets/ihl/textures/blocks/fluidAcetyleneStill.png new file mode 100644 index 0000000..234786b Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidAcetyleneStill.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidAcetyleneStill.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidAcetyleneStill.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidAcetyleneStill.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidAirFlowing.png b/src/main/java/assets/ihl/textures/blocks/fluidAirFlowing.png new file mode 100644 index 0000000..35626c5 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidAirFlowing.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidAirStill.png b/src/main/java/assets/ihl/textures/blocks/fluidAirStill.png new file mode 100644 index 0000000..35626c5 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidAirStill.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidAmmoniaFlowing.png b/src/main/java/assets/ihl/textures/blocks/fluidAmmoniaFlowing.png new file mode 100644 index 0000000..faa27db Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidAmmoniaFlowing.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidAmmoniaStill.png b/src/main/java/assets/ihl/textures/blocks/fluidAmmoniaStill.png new file mode 100644 index 0000000..9619e25 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidAmmoniaStill.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidAquaRegiaFlowing.png b/src/main/java/assets/ihl/textures/blocks/fluidAquaRegiaFlowing.png new file mode 100644 index 0000000..3a5e652 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidAquaRegiaFlowing.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidAquaRegiaFlowing.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidAquaRegiaFlowing.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidAquaRegiaFlowing.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidAquaRegiaStill.png b/src/main/java/assets/ihl/textures/blocks/fluidAquaRegiaStill.png new file mode 100644 index 0000000..82e7ea0 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidAquaRegiaStill.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidAquaRegiaStill.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidAquaRegiaStill.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidAquaRegiaStill.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidBlueVitriolDissolvedInWaterFlowing.png b/src/main/java/assets/ihl/textures/blocks/fluidBlueVitriolDissolvedInWaterFlowing.png new file mode 100644 index 0000000..6bbed87 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidBlueVitriolDissolvedInWaterFlowing.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidBlueVitriolDissolvedInWaterFlowing.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidBlueVitriolDissolvedInWaterFlowing.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidBlueVitriolDissolvedInWaterFlowing.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidBlueVitriolDissolvedInWaterStill.png b/src/main/java/assets/ihl/textures/blocks/fluidBlueVitriolDissolvedInWaterStill.png new file mode 100644 index 0000000..ae4798b Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidBlueVitriolDissolvedInWaterStill.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidBlueVitriolDissolvedInWaterStill.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidBlueVitriolDissolvedInWaterStill.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidBlueVitriolDissolvedInWaterStill.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidBoricAcidFlowing.png b/src/main/java/assets/ihl/textures/blocks/fluidBoricAcidFlowing.png new file mode 100644 index 0000000..f593d53 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidBoricAcidFlowing.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidBoricAcidFlowing.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidBoricAcidFlowing.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidBoricAcidFlowing.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidBoricAcidStill.png b/src/main/java/assets/ihl/textures/blocks/fluidBoricAcidStill.png new file mode 100644 index 0000000..9fd8df8 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidBoricAcidStill.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidBoricAcidStill.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidBoricAcidStill.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidBoricAcidStill.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidCablingColophonyFlowing.png b/src/main/java/assets/ihl/textures/blocks/fluidCablingColophonyFlowing.png new file mode 100644 index 0000000..b3b3880 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidCablingColophonyFlowing.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidCablingColophonyFlowing.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidCablingColophonyFlowing.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidCablingColophonyFlowing.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidCablingColophonyStill.png b/src/main/java/assets/ihl/textures/blocks/fluidCablingColophonyStill.png new file mode 100644 index 0000000..ee4af9a Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidCablingColophonyStill.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidCablingColophonyStill.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidCablingColophonyStill.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidCablingColophonyStill.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidCalciumChlorideDissolvedInWaterFlowing.png b/src/main/java/assets/ihl/textures/blocks/fluidCalciumChlorideDissolvedInWaterFlowing.png new file mode 100644 index 0000000..7146e0c Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidCalciumChlorideDissolvedInWaterFlowing.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidCalciumChlorideDissolvedInWaterStill.png b/src/main/java/assets/ihl/textures/blocks/fluidCalciumChlorideDissolvedInWaterStill.png new file mode 100644 index 0000000..35f4689 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidCalciumChlorideDissolvedInWaterStill.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidChlorineFlowing.png b/src/main/java/assets/ihl/textures/blocks/fluidChlorineFlowing.png new file mode 100644 index 0000000..0aac900 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidChlorineFlowing.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidChlorineFlowing.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidChlorineFlowing.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidChlorineFlowing.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidChlorineStill.png b/src/main/java/assets/ihl/textures/blocks/fluidChlorineStill.png new file mode 100644 index 0000000..ae92667 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidChlorineStill.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidChlorineStill.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidChlorineStill.png.mcmeta new file mode 100644 index 0000000..3606210 --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidChlorineStill.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation":{ + "frametime":2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidFormaldehydeFlowing.png b/src/main/java/assets/ihl/textures/blocks/fluidFormaldehydeFlowing.png new file mode 100644 index 0000000..4252b6f Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidFormaldehydeFlowing.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidFormaldehydeStill.png b/src/main/java/assets/ihl/textures/blocks/fluidFormaldehydeStill.png new file mode 100644 index 0000000..621a940 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidFormaldehydeStill.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidFuelFlowing.png b/src/main/java/assets/ihl/textures/blocks/fluidFuelFlowing.png new file mode 100644 index 0000000..bbc7510 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidFuelFlowing.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidFuelFlowing.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidFuelFlowing.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidFuelFlowing.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidFuelOilFlowing.png b/src/main/java/assets/ihl/textures/blocks/fluidFuelOilFlowing.png new file mode 100644 index 0000000..0332f22 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidFuelOilFlowing.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidFuelOilStill.png b/src/main/java/assets/ihl/textures/blocks/fluidFuelOilStill.png new file mode 100644 index 0000000..0332f22 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidFuelOilStill.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidFuelStill.png b/src/main/java/assets/ihl/textures/blocks/fluidFuelStill.png new file mode 100644 index 0000000..36af254 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidFuelStill.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidFuelStill.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidFuelStill.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidFuelStill.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidGlycerolFlowing.png b/src/main/java/assets/ihl/textures/blocks/fluidGlycerolFlowing.png new file mode 100644 index 0000000..47b9fc0 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidGlycerolFlowing.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidGlycerolFlowing.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidGlycerolFlowing.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidGlycerolFlowing.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidGlycerolStill.png b/src/main/java/assets/ihl/textures/blocks/fluidGlycerolStill.png new file mode 100644 index 0000000..d533b1c Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidGlycerolStill.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidGlycerolStill.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidGlycerolStill.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidGlycerolStill.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidHydrogenChlorideFlowing.png b/src/main/java/assets/ihl/textures/blocks/fluidHydrogenChlorideFlowing.png new file mode 100644 index 0000000..0ebc6ee Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidHydrogenChlorideFlowing.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidHydrogenChlorideFlowing.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidHydrogenChlorideFlowing.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidHydrogenChlorideFlowing.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidHydrogenChlorideStill.png b/src/main/java/assets/ihl/textures/blocks/fluidHydrogenChlorideStill.png new file mode 100644 index 0000000..59032fe Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidHydrogenChlorideStill.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidHydrogenChlorideStill.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidHydrogenChlorideStill.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidHydrogenChlorideStill.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidHydrogenFlowing.png b/src/main/java/assets/ihl/textures/blocks/fluidHydrogenFlowing.png new file mode 100644 index 0000000..0a26500 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidHydrogenFlowing.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidHydrogenFlowing.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidHydrogenFlowing.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidHydrogenFlowing.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidHydrogenStill.png b/src/main/java/assets/ihl/textures/blocks/fluidHydrogenStill.png new file mode 100644 index 0000000..8048dd1 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidHydrogenStill.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidHydrogenStill.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidHydrogenStill.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidHydrogenStill.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidLimemilkFlowing.png b/src/main/java/assets/ihl/textures/blocks/fluidLimemilkFlowing.png new file mode 100644 index 0000000..7368c5b Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidLimemilkFlowing.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidLimemilkFlowing.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidLimemilkFlowing.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidLimemilkFlowing.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidLimemilkStill.png b/src/main/java/assets/ihl/textures/blocks/fluidLimemilkStill.png new file mode 100644 index 0000000..a835d74 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidLimemilkStill.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidLimemilkStill.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidLimemilkStill.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidLimemilkStill.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidLiquidGlassFlowing.png b/src/main/java/assets/ihl/textures/blocks/fluidLiquidGlassFlowing.png new file mode 100644 index 0000000..adc705f Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidLiquidGlassFlowing.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidLiquidGlassFlowing.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidLiquidGlassFlowing.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidLiquidGlassFlowing.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidLiquidGlassStill.png b/src/main/java/assets/ihl/textures/blocks/fluidLiquidGlassStill.png new file mode 100644 index 0000000..dcea374 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidLiquidGlassStill.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidLiquidGlassStill.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidLiquidGlassStill.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidLiquidGlassStill.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidLithiumChlorideDissolvedInWaterFlowing.png b/src/main/java/assets/ihl/textures/blocks/fluidLithiumChlorideDissolvedInWaterFlowing.png new file mode 100644 index 0000000..e1b4ab0 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidLithiumChlorideDissolvedInWaterFlowing.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidLithiumChlorideDissolvedInWaterStill.png b/src/main/java/assets/ihl/textures/blocks/fluidLithiumChlorideDissolvedInWaterStill.png new file mode 100644 index 0000000..ac627b1 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidLithiumChlorideDissolvedInWaterStill.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidMercuryFlowing.png b/src/main/java/assets/ihl/textures/blocks/fluidMercuryFlowing.png new file mode 100644 index 0000000..4cf0e02 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidMercuryFlowing.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidMercuryFlowing.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidMercuryFlowing.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidMercuryFlowing.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidMercuryStill.png b/src/main/java/assets/ihl/textures/blocks/fluidMercuryStill.png new file mode 100644 index 0000000..be7a002 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidMercuryStill.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidMercuryStill.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidMercuryStill.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidMercuryStill.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidMethanolFlowing.png b/src/main/java/assets/ihl/textures/blocks/fluidMethanolFlowing.png new file mode 100644 index 0000000..e1e37bb Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidMethanolFlowing.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidMethanolStill.png b/src/main/java/assets/ihl/textures/blocks/fluidMethanolStill.png new file mode 100644 index 0000000..948e525 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidMethanolStill.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidMineralOilFlowing.png b/src/main/java/assets/ihl/textures/blocks/fluidMineralOilFlowing.png new file mode 100644 index 0000000..965fef1 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidMineralOilFlowing.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidMineralOilStill.png b/src/main/java/assets/ihl/textures/blocks/fluidMineralOilStill.png new file mode 100644 index 0000000..965fef1 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidMineralOilStill.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidMoltenBronzeFlowing.png b/src/main/java/assets/ihl/textures/blocks/fluidMoltenBronzeFlowing.png new file mode 100644 index 0000000..5d2fc4c Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidMoltenBronzeFlowing.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidMoltenBronzeFlowing.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidMoltenBronzeFlowing.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidMoltenBronzeFlowing.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidMoltenBronzeStill.png b/src/main/java/assets/ihl/textures/blocks/fluidMoltenBronzeStill.png new file mode 100644 index 0000000..c6b0f25 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidMoltenBronzeStill.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidMoltenBronzeStill.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidMoltenBronzeStill.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidMoltenBronzeStill.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidMoltenFlowing.png b/src/main/java/assets/ihl/textures/blocks/fluidMoltenFlowing.png new file mode 100644 index 0000000..b03534a Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidMoltenFlowing.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidMoltenFlowing.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidMoltenFlowing.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidMoltenFlowing.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidMoltenGoldFlowing.png b/src/main/java/assets/ihl/textures/blocks/fluidMoltenGoldFlowing.png new file mode 100644 index 0000000..e3a1efe Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidMoltenGoldFlowing.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidMoltenGoldFlowing.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidMoltenGoldFlowing.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidMoltenGoldFlowing.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidMoltenGoldStill.png b/src/main/java/assets/ihl/textures/blocks/fluidMoltenGoldStill.png new file mode 100644 index 0000000..14e87bd Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidMoltenGoldStill.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidMoltenGoldStill.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidMoltenGoldStill.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidMoltenGoldStill.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidMoltenRubberWithSulfurFlowing.png b/src/main/java/assets/ihl/textures/blocks/fluidMoltenRubberWithSulfurFlowing.png new file mode 100644 index 0000000..717020b Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidMoltenRubberWithSulfurFlowing.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidMoltenRubberWithSulfurFlowing.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidMoltenRubberWithSulfurFlowing.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidMoltenRubberWithSulfurFlowing.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidMoltenRubberWithSulfurStill.png b/src/main/java/assets/ihl/textures/blocks/fluidMoltenRubberWithSulfurStill.png new file mode 100644 index 0000000..c98e979 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidMoltenRubberWithSulfurStill.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidMoltenRubberWithSulfurStill.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidMoltenRubberWithSulfurStill.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidMoltenRubberWithSulfurStill.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidMoltenStill.png b/src/main/java/assets/ihl/textures/blocks/fluidMoltenStill.png new file mode 100644 index 0000000..bc8672b Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidMoltenStill.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidMoltenStill.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidMoltenStill.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidMoltenStill.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidNatriumHydroxideDissolvedInWaterFlowing.png b/src/main/java/assets/ihl/textures/blocks/fluidNatriumHydroxideDissolvedInWaterFlowing.png new file mode 100644 index 0000000..7d0ce28 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidNatriumHydroxideDissolvedInWaterFlowing.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidNatriumHydroxideDissolvedInWaterFlowing.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidNatriumHydroxideDissolvedInWaterFlowing.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidNatriumHydroxideDissolvedInWaterFlowing.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidNatriumHydroxideDissolvedInWaterStill.png b/src/main/java/assets/ihl/textures/blocks/fluidNatriumHydroxideDissolvedInWaterStill.png new file mode 100644 index 0000000..78a38e2 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidNatriumHydroxideDissolvedInWaterStill.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidNatriumHydroxideDissolvedInWaterStill.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidNatriumHydroxideDissolvedInWaterStill.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidNatriumHydroxideDissolvedInWaterStill.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidNatriumTungstateDissolvedInWaterFlowing.png b/src/main/java/assets/ihl/textures/blocks/fluidNatriumTungstateDissolvedInWaterFlowing.png new file mode 100644 index 0000000..8878c7c Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidNatriumTungstateDissolvedInWaterFlowing.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidNatriumTungstateDissolvedInWaterFlowing.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidNatriumTungstateDissolvedInWaterFlowing.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidNatriumTungstateDissolvedInWaterFlowing.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidNatriumTungstateDissolvedInWaterStill.png b/src/main/java/assets/ihl/textures/blocks/fluidNatriumTungstateDissolvedInWaterStill.png new file mode 100644 index 0000000..1693152 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidNatriumTungstateDissolvedInWaterStill.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidNatriumTungstateDissolvedInWaterStill.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidNatriumTungstateDissolvedInWaterStill.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidNatriumTungstateDissolvedInWaterStill.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidNickelSulfateDissolvedInWaterFlowing.png b/src/main/java/assets/ihl/textures/blocks/fluidNickelSulfateDissolvedInWaterFlowing.png new file mode 100644 index 0000000..9eff666 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidNickelSulfateDissolvedInWaterFlowing.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidNickelSulfateDissolvedInWaterFlowing.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidNickelSulfateDissolvedInWaterFlowing.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidNickelSulfateDissolvedInWaterFlowing.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidNickelSulfateDissolvedInWaterStill.png b/src/main/java/assets/ihl/textures/blocks/fluidNickelSulfateDissolvedInWaterStill.png new file mode 100644 index 0000000..1803de6 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidNickelSulfateDissolvedInWaterStill.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidNickelSulfateDissolvedInWaterStill.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidNickelSulfateDissolvedInWaterStill.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidNickelSulfateDissolvedInWaterStill.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidNitricAcidFlowing.png b/src/main/java/assets/ihl/textures/blocks/fluidNitricAcidFlowing.png new file mode 100644 index 0000000..11c8d78 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidNitricAcidFlowing.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidNitricAcidFlowing.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidNitricAcidFlowing.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidNitricAcidFlowing.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidNitricAcidStill.png b/src/main/java/assets/ihl/textures/blocks/fluidNitricAcidStill.png new file mode 100644 index 0000000..68a21eb Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidNitricAcidStill.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidNitricAcidStill.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidNitricAcidStill.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidNitricAcidStill.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidNitroGlycerinFlowing.png b/src/main/java/assets/ihl/textures/blocks/fluidNitroGlycerinFlowing.png new file mode 100644 index 0000000..a5870f5 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidNitroGlycerinFlowing.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidNitroGlycerinStill.png b/src/main/java/assets/ihl/textures/blocks/fluidNitroGlycerinStill.png new file mode 100644 index 0000000..faa4fb5 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidNitroGlycerinStill.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidNitrogenFlowing.png b/src/main/java/assets/ihl/textures/blocks/fluidNitrogenFlowing.png new file mode 100644 index 0000000..0b904b0 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidNitrogenFlowing.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidNitrogenFlowing.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidNitrogenFlowing.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidNitrogenFlowing.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidNitrogenStill.png b/src/main/java/assets/ihl/textures/blocks/fluidNitrogenStill.png new file mode 100644 index 0000000..d4cf378 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidNitrogenStill.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidNitrogenStill.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidNitrogenStill.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidNitrogenStill.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidOilFlowing.png b/src/main/java/assets/ihl/textures/blocks/fluidOilFlowing.png new file mode 100644 index 0000000..7d3f12d Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidOilFlowing.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidOilStill.png b/src/main/java/assets/ihl/textures/blocks/fluidOilStill.png new file mode 100644 index 0000000..7d3f12d Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidOilStill.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidOleicAcidFlowing.png b/src/main/java/assets/ihl/textures/blocks/fluidOleicAcidFlowing.png new file mode 100644 index 0000000..a4c263f Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidOleicAcidFlowing.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidOleicAcidFlowing.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidOleicAcidFlowing.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidOleicAcidFlowing.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidOleicAcidStill.png b/src/main/java/assets/ihl/textures/blocks/fluidOleicAcidStill.png new file mode 100644 index 0000000..8dc6138 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidOleicAcidStill.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidOleicAcidStill.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidOleicAcidStill.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidOleicAcidStill.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidOsmiumTetroxideFlowing.png b/src/main/java/assets/ihl/textures/blocks/fluidOsmiumTetroxideFlowing.png new file mode 100644 index 0000000..f2082a3 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidOsmiumTetroxideFlowing.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidOsmiumTetroxideFlowing.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidOsmiumTetroxideFlowing.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidOsmiumTetroxideFlowing.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidOsmiumTetroxideStill.png b/src/main/java/assets/ihl/textures/blocks/fluidOsmiumTetroxideStill.png new file mode 100644 index 0000000..704a9a5 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidOsmiumTetroxideStill.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidOsmiumTetroxideStill.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidOsmiumTetroxideStill.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidOsmiumTetroxideStill.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidOxygenFlowing.png b/src/main/java/assets/ihl/textures/blocks/fluidOxygenFlowing.png new file mode 100644 index 0000000..cebd981 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidOxygenFlowing.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidOxygenFlowing.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidOxygenFlowing.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidOxygenFlowing.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidOxygenStill.png b/src/main/java/assets/ihl/textures/blocks/fluidOxygenStill.png new file mode 100644 index 0000000..bb67b6c Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidOxygenStill.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidOxygenStill.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidOxygenStill.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidOxygenStill.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidPulpCelluloseFlowing.png b/src/main/java/assets/ihl/textures/blocks/fluidPulpCelluloseFlowing.png new file mode 100644 index 0000000..9be08ea Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidPulpCelluloseFlowing.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidPulpCelluloseFlowing.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidPulpCelluloseFlowing.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidPulpCelluloseFlowing.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidPulpCelluloseStill.png b/src/main/java/assets/ihl/textures/blocks/fluidPulpCelluloseStill.png new file mode 100644 index 0000000..8fa750d Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidPulpCelluloseStill.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidPulpCelluloseStill.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidPulpCelluloseStill.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidPulpCelluloseStill.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidPulpMicaFlowing.png b/src/main/java/assets/ihl/textures/blocks/fluidPulpMicaFlowing.png new file mode 100644 index 0000000..388d209 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidPulpMicaFlowing.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidPulpMicaFlowing.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidPulpMicaFlowing.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidPulpMicaFlowing.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidPulpMicaStill.png b/src/main/java/assets/ihl/textures/blocks/fluidPulpMicaStill.png new file mode 100644 index 0000000..228b778 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidPulpMicaStill.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidPulpMicaStill.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidPulpMicaStill.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidPulpMicaStill.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidPulpZeoliteFlowing.png b/src/main/java/assets/ihl/textures/blocks/fluidPulpZeoliteFlowing.png new file mode 100644 index 0000000..3daa463 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidPulpZeoliteFlowing.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidPulpZeoliteFlowing.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidPulpZeoliteFlowing.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidPulpZeoliteFlowing.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidPulpZeoliteStill.png b/src/main/java/assets/ihl/textures/blocks/fluidPulpZeoliteStill.png new file mode 100644 index 0000000..cd504ab Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidPulpZeoliteStill.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidPulpZeoliteStill.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidPulpZeoliteStill.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidPulpZeoliteStill.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidRubberTreeSapFlowing.png b/src/main/java/assets/ihl/textures/blocks/fluidRubberTreeSapFlowing.png new file mode 100644 index 0000000..e0679ea Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidRubberTreeSapFlowing.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidRubberTreeSapFlowing.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidRubberTreeSapFlowing.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidRubberTreeSapFlowing.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidRubberTreeSapStill.png b/src/main/java/assets/ihl/textures/blocks/fluidRubberTreeSapStill.png new file mode 100644 index 0000000..1a1e07b Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidRubberTreeSapStill.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidRubberTreeSapStill.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidRubberTreeSapStill.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidRubberTreeSapStill.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidSaltWaterFlowing.png b/src/main/java/assets/ihl/textures/blocks/fluidSaltWaterFlowing.png new file mode 100644 index 0000000..bef5f88 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidSaltWaterFlowing.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidSaltWaterFlowing.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidSaltWaterFlowing.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidSaltWaterFlowing.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidSaltWaterStill.png b/src/main/java/assets/ihl/textures/blocks/fluidSaltWaterStill.png new file mode 100644 index 0000000..0e46205 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidSaltWaterStill.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidSaltWaterStill.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidSaltWaterStill.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidSaltWaterStill.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidSeedOilFlowing.png b/src/main/java/assets/ihl/textures/blocks/fluidSeedOilFlowing.png new file mode 100644 index 0000000..1fc936f Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidSeedOilFlowing.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidSeedOilFlowing.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidSeedOilFlowing.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidSeedOilFlowing.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidSeedOilStill.png b/src/main/java/assets/ihl/textures/blocks/fluidSeedOilStill.png new file mode 100644 index 0000000..919bbeb Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidSeedOilStill.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidSeedOilStill.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidSeedOilStill.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidSeedOilStill.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidSodiumPeroxideFlowing.png b/src/main/java/assets/ihl/textures/blocks/fluidSodiumPeroxideFlowing.png new file mode 100644 index 0000000..6ab13f7 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidSodiumPeroxideFlowing.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidSodiumPeroxideFlowing.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidSodiumPeroxideFlowing.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidSodiumPeroxideFlowing.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidSodiumPeroxideStill.png b/src/main/java/assets/ihl/textures/blocks/fluidSodiumPeroxideStill.png new file mode 100644 index 0000000..5563123 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidSodiumPeroxideStill.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidSodiumPeroxideStill.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidSodiumPeroxideStill.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidSodiumPeroxideStill.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidSpruceResinFlowing.png b/src/main/java/assets/ihl/textures/blocks/fluidSpruceResinFlowing.png new file mode 100644 index 0000000..c077f2a Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidSpruceResinFlowing.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidSpruceResinFlowing.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidSpruceResinFlowing.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidSpruceResinFlowing.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidSpruceResinStill.png b/src/main/java/assets/ihl/textures/blocks/fluidSpruceResinStill.png new file mode 100644 index 0000000..1776727 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidSpruceResinStill.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidSpruceResinStill.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidSpruceResinStill.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidSpruceResinStill.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidSulfuricAcidFlowing.png b/src/main/java/assets/ihl/textures/blocks/fluidSulfuricAcidFlowing.png new file mode 100644 index 0000000..787d8db Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidSulfuricAcidFlowing.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidSulfuricAcidFlowing.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidSulfuricAcidFlowing.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidSulfuricAcidFlowing.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidSulfuricAcidStill.png b/src/main/java/assets/ihl/textures/blocks/fluidSulfuricAcidStill.png new file mode 100644 index 0000000..8417845 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidSulfuricAcidStill.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidSulfuricAcidStill.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidSulfuricAcidStill.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidSulfuricAcidStill.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidSulfuricAnhydrideFlowing.png b/src/main/java/assets/ihl/textures/blocks/fluidSulfuricAnhydrideFlowing.png new file mode 100644 index 0000000..a674ef1 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidSulfuricAnhydrideFlowing.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidSulfuricAnhydrideFlowing.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidSulfuricAnhydrideFlowing.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidSulfuricAnhydrideFlowing.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidSulfuricAnhydrideStill.png b/src/main/java/assets/ihl/textures/blocks/fluidSulfuricAnhydrideStill.png new file mode 100644 index 0000000..b858ee3 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidSulfuricAnhydrideStill.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidSulfuricAnhydrideStill.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidSulfuricAnhydrideStill.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidSulfuricAnhydrideStill.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidTarWaterFlowing.png b/src/main/java/assets/ihl/textures/blocks/fluidTarWaterFlowing.png new file mode 100644 index 0000000..6a58cbe Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidTarWaterFlowing.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidTarWaterStill.png b/src/main/java/assets/ihl/textures/blocks/fluidTarWaterStill.png new file mode 100644 index 0000000..dd67de2 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidTarWaterStill.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidTurpentineFlowing.png b/src/main/java/assets/ihl/textures/blocks/fluidTurpentineFlowing.png new file mode 100644 index 0000000..09b6c2d Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidTurpentineFlowing.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidTurpentineFlowing.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidTurpentineFlowing.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidTurpentineFlowing.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidTurpentineStill.png b/src/main/java/assets/ihl/textures/blocks/fluidTurpentineStill.png new file mode 100644 index 0000000..471a546 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidTurpentineStill.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidTurpentineStill.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidTurpentineStill.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidTurpentineStill.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidVapourMercuryFlowing.png b/src/main/java/assets/ihl/textures/blocks/fluidVapourMercuryFlowing.png new file mode 100644 index 0000000..dc8ef85 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidVapourMercuryFlowing.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidVapourMercuryFlowing.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidVapourMercuryFlowing.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidVapourMercuryFlowing.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidVapourMercuryStill.png b/src/main/java/assets/ihl/textures/blocks/fluidVapourMercuryStill.png new file mode 100644 index 0000000..e8eaa21 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidVapourMercuryStill.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidVapourMercuryStill.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidVapourMercuryStill.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidVapourMercuryStill.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidVapourSulfuricAcidFlowing.png b/src/main/java/assets/ihl/textures/blocks/fluidVapourSulfuricAcidFlowing.png new file mode 100644 index 0000000..5a2df89 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidVapourSulfuricAcidFlowing.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidVapourSulfuricAcidFlowing.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidVapourSulfuricAcidFlowing.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidVapourSulfuricAcidFlowing.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/fluidVapourSulfuricAcidStill.png b/src/main/java/assets/ihl/textures/blocks/fluidVapourSulfuricAcidStill.png new file mode 100644 index 0000000..e97b7e7 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/fluidVapourSulfuricAcidStill.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/fluidVapourSulfuricAcidStill.png.mcmeta b/src/main/java/assets/ihl/textures/blocks/fluidVapourSulfuricAcidStill.png.mcmeta new file mode 100644 index 0000000..e9b67fc --- /dev/null +++ b/src/main/java/assets/ihl/textures/blocks/fluidVapourSulfuricAcidStill.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/src/main/java/assets/ihl/textures/blocks/frameSteel.png b/src/main/java/assets/ihl/textures/blocks/frameSteel.png new file mode 100644 index 0000000..a651c5b Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/frameSteel.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/gasWeldingStation.png b/src/main/java/assets/ihl/textures/blocks/gasWeldingStation.png new file mode 100644 index 0000000..6fb5d3f Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/gasWeldingStation.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/goldChimneyKnee.png b/src/main/java/assets/ihl/textures/blocks/goldChimneyKnee.png new file mode 100644 index 0000000..4be99f8 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/goldChimneyKnee.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/greenPaint.png b/src/main/java/assets/ihl/textures/blocks/greenPaint.png new file mode 100644 index 0000000..8985394 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/greenPaint.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/injectionMoldSide.png b/src/main/java/assets/ihl/textures/blocks/injectionMoldSide.png new file mode 100644 index 0000000..8dfac02 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/injectionMoldSide.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/injectionMoldTop.png b/src/main/java/assets/ihl/textures/blocks/injectionMoldTop.png new file mode 100644 index 0000000..27df98e Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/injectionMoldTop.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/ironWorkbench.png b/src/main/java/assets/ihl/textures/blocks/ironWorkbench.png new file mode 100644 index 0000000..fc28a56 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/ironWorkbench.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/ironWorkbenchTrumbnail.png b/src/main/java/assets/ihl/textures/blocks/ironWorkbenchTrumbnail.png new file mode 100644 index 0000000..5f5dfbb Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/ironWorkbenchTrumbnail.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/junctionBox.png b/src/main/java/assets/ihl/textures/blocks/junctionBox.png new file mode 100644 index 0000000..48acabb Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/junctionBox.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/leadOvenTop.png b/src/main/java/assets/ihl/textures/blocks/leadOvenTop.png new file mode 100644 index 0000000..de796d6 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/leadOvenTop.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/lightBulb.png b/src/main/java/assets/ihl/textures/blocks/lightBulb.png new file mode 100644 index 0000000..6bbb636 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/lightBulb.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/metalShards.png b/src/main/java/assets/ihl/textures/blocks/metalShards.png new file mode 100644 index 0000000..ac0c489 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/metalShards.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/mirror.png b/src/main/java/assets/ihl/textures/blocks/mirror.png new file mode 100644 index 0000000..53a2368 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/mirror.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/muffleOvenFront.png b/src/main/java/assets/ihl/textures/blocks/muffleOvenFront.png new file mode 100644 index 0000000..cb4e094 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/muffleOvenFront.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/oreApatite.png b/src/main/java/assets/ihl/textures/blocks/oreApatite.png new file mode 100644 index 0000000..dc1c74c Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/oreApatite.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/oreBauxite.png b/src/main/java/assets/ihl/textures/blocks/oreBauxite.png new file mode 100644 index 0000000..585436a Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/oreBauxite.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/oreBischofite.png b/src/main/java/assets/ihl/textures/blocks/oreBischofite.png new file mode 100644 index 0000000..38ce2ca Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/oreBischofite.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/oreChromite.png b/src/main/java/assets/ihl/textures/blocks/oreChromite.png new file mode 100644 index 0000000..be32aba Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/oreChromite.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/oreCinnabar.png b/src/main/java/assets/ihl/textures/blocks/oreCinnabar.png new file mode 100644 index 0000000..3194ec2 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/oreCinnabar.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/oreDatolite.png b/src/main/java/assets/ihl/textures/blocks/oreDatolite.png new file mode 100644 index 0000000..9b34abe Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/oreDatolite.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/oreGypsum.png b/src/main/java/assets/ihl/textures/blocks/oreGypsum.png new file mode 100644 index 0000000..b2ee801 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/oreGypsum.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/oreGyubnera.png b/src/main/java/assets/ihl/textures/blocks/oreGyubnera.png new file mode 100644 index 0000000..7dd528c Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/oreGyubnera.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/oreLimestone.png b/src/main/java/assets/ihl/textures/blocks/oreLimestone.png new file mode 100644 index 0000000..73b7d3c Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/oreLimestone.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/oreMica.png b/src/main/java/assets/ihl/textures/blocks/oreMica.png new file mode 100644 index 0000000..d02e6ae Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/oreMica.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/orePotassiumFeldspar.png b/src/main/java/assets/ihl/textures/blocks/orePotassiumFeldspar.png new file mode 100644 index 0000000..f1d7337 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/orePotassiumFeldspar.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/oreRockSalt.png b/src/main/java/assets/ihl/textures/blocks/oreRockSalt.png new file mode 100644 index 0000000..ffcfa0e Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/oreRockSalt.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/oreSaltpeter.png b/src/main/java/assets/ihl/textures/blocks/oreSaltpeter.png new file mode 100644 index 0000000..f46b58a Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/oreSaltpeter.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/oreStibnite.png b/src/main/java/assets/ihl/textures/blocks/oreStibnite.png new file mode 100644 index 0000000..5c1b8d8 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/oreStibnite.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/oreTrona.png b/src/main/java/assets/ihl/textures/blocks/oreTrona.png new file mode 100644 index 0000000..57dd4dc Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/oreTrona.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/paperMachineFront.png b/src/main/java/assets/ihl/textures/blocks/paperMachineFront.png new file mode 100644 index 0000000..c12162b Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/paperMachineFront.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/pileTextureSpace.png b/src/main/java/assets/ihl/textures/blocks/pileTextureSpace.png new file mode 100644 index 0000000..352c02b Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/pileTextureSpace.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/porcelainBox.png b/src/main/java/assets/ihl/textures/blocks/porcelainBox.png new file mode 100644 index 0000000..360ea11 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/porcelainBox.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/porcelainFurnaceFront.png b/src/main/java/assets/ihl/textures/blocks/porcelainFurnaceFront.png new file mode 100644 index 0000000..1c5e44e Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/porcelainFurnaceFront.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/porcelainFurnaceSide.png b/src/main/java/assets/ihl/textures/blocks/porcelainFurnaceSide.png new file mode 100644 index 0000000..3809fb4 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/porcelainFurnaceSide.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/porcelainFurnaceTop.png b/src/main/java/assets/ihl/textures/blocks/porcelainFurnaceTop.png new file mode 100644 index 0000000..496688a Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/porcelainFurnaceTop.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/powerPort.png b/src/main/java/assets/ihl/textures/blocks/powerPort.png new file mode 100644 index 0000000..fcc2ef3 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/powerPort.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/redPaint.png b/src/main/java/assets/ihl/textures/blocks/redPaint.png new file mode 100644 index 0000000..0ebe5e0 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/redPaint.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/rubberInsulatedCase.png b/src/main/java/assets/ihl/textures/blocks/rubberInsulatedCase.png new file mode 100644 index 0000000..0df4274 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/rubberInsulatedCase.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/sack.png b/src/main/java/assets/ihl/textures/blocks/sack.png new file mode 100644 index 0000000..85a89a5 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/sack.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/sackItem.png b/src/main/java/assets/ihl/textures/blocks/sackItem.png new file mode 100644 index 0000000..1d762d2 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/sackItem.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/solarEvaporatorSide.png b/src/main/java/assets/ihl/textures/blocks/solarEvaporatorSide.png new file mode 100644 index 0000000..32b5e32 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/solarEvaporatorSide.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/solidFuelEvaporatorBottom.png b/src/main/java/assets/ihl/textures/blocks/solidFuelEvaporatorBottom.png new file mode 100644 index 0000000..3c79b85 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/solidFuelEvaporatorBottom.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/solidFuelEvaporatorFront.png b/src/main/java/assets/ihl/textures/blocks/solidFuelEvaporatorFront.png new file mode 100644 index 0000000..1c1ae46 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/solidFuelEvaporatorFront.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/solidFuelEvaporatorFrontActive.png b/src/main/java/assets/ihl/textures/blocks/solidFuelEvaporatorFrontActive.png new file mode 100644 index 0000000..6633353 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/solidFuelEvaporatorFrontActive.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/solidFuelEvaporatorSide.png b/src/main/java/assets/ihl/textures/blocks/solidFuelEvaporatorSide.png new file mode 100644 index 0000000..55d4870 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/solidFuelEvaporatorSide.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/solidFuelEvaporatorTop.png b/src/main/java/assets/ihl/textures/blocks/solidFuelEvaporatorTop.png new file mode 100644 index 0000000..25ec01d Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/solidFuelEvaporatorTop.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/splitInjectionMold.png b/src/main/java/assets/ihl/textures/blocks/splitInjectionMold.png new file mode 100644 index 0000000..b5a9ae3 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/splitInjectionMold.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/spotlight.png b/src/main/java/assets/ihl/textures/blocks/spotlight.png new file mode 100644 index 0000000..e4d8175 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/spotlight.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/steel.png b/src/main/java/assets/ihl/textures/blocks/steel.png new file mode 100644 index 0000000..f1a5e63 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/steel.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/tditBack.png b/src/main/java/assets/ihl/textures/blocks/tditBack.png new file mode 100644 index 0000000..e2723cf Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/tditBack.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/tditBottom.png b/src/main/java/assets/ihl/textures/blocks/tditBottom.png new file mode 100644 index 0000000..444148b Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/tditBottom.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/tditLeft.png b/src/main/java/assets/ihl/textures/blocks/tditLeft.png new file mode 100644 index 0000000..208b609 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/tditLeft.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/tditRight.png b/src/main/java/assets/ihl/textures/blocks/tditRight.png new file mode 100644 index 0000000..32f15a4 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/tditRight.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/tditTop.png b/src/main/java/assets/ihl/textures/blocks/tditTop.png new file mode 100644 index 0000000..cff46b8 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/tditTop.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/tubBronzeSide.png b/src/main/java/assets/ihl/textures/blocks/tubBronzeSide.png new file mode 100644 index 0000000..0e858d2 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/tubBronzeSide.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/tubBronzeTop.png b/src/main/java/assets/ihl/textures/blocks/tubBronzeTop.png new file mode 100644 index 0000000..fe6709f Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/tubBronzeTop.png differ diff --git a/src/main/java/assets/ihl/textures/blocks/woodenRollingMachine.png b/src/main/java/assets/ihl/textures/blocks/woodenRollingMachine.png new file mode 100644 index 0000000..c8d2d99 Binary files /dev/null and b/src/main/java/assets/ihl/textures/blocks/woodenRollingMachine.png differ diff --git a/src/main/java/assets/ihl/textures/gui/GUIAchesonFurnace.png b/src/main/java/assets/ihl/textures/gui/GUIAchesonFurnace.png new file mode 100644 index 0000000..f21421e Binary files /dev/null and b/src/main/java/assets/ihl/textures/gui/GUIAchesonFurnace.png differ diff --git a/src/main/java/assets/ihl/textures/gui/GUICastingNEI.png b/src/main/java/assets/ihl/textures/gui/GUICastingNEI.png new file mode 100644 index 0000000..64fa656 Binary files /dev/null and b/src/main/java/assets/ihl/textures/gui/GUICastingNEI.png differ diff --git a/src/main/java/assets/ihl/textures/gui/GUIChemicalReactor.png b/src/main/java/assets/ihl/textures/gui/GUIChemicalReactor.png new file mode 100644 index 0000000..ed17925 Binary files /dev/null and b/src/main/java/assets/ihl/textures/gui/GUIChemicalReactor.png differ diff --git a/src/main/java/assets/ihl/textures/gui/GUIChimneyKneeNEI.png b/src/main/java/assets/ihl/textures/gui/GUIChimneyKneeNEI.png new file mode 100644 index 0000000..cf6550c Binary files /dev/null and b/src/main/java/assets/ihl/textures/gui/GUIChimneyKneeNEI.png differ diff --git a/src/main/java/assets/ihl/textures/gui/GUICoiler.png b/src/main/java/assets/ihl/textures/gui/GUICoiler.png new file mode 100644 index 0000000..6075239 Binary files /dev/null and b/src/main/java/assets/ihl/textures/gui/GUICoiler.png differ diff --git a/src/main/java/assets/ihl/textures/gui/GUICondenserNEI.png b/src/main/java/assets/ihl/textures/gui/GUICondenserNEI.png new file mode 100644 index 0000000..e90bcb4 Binary files /dev/null and b/src/main/java/assets/ihl/textures/gui/GUICondenserNEI.png differ diff --git a/src/main/java/assets/ihl/textures/gui/GUICrucible.png b/src/main/java/assets/ihl/textures/gui/GUICrucible.png new file mode 100644 index 0000000..059c127 Binary files /dev/null and b/src/main/java/assets/ihl/textures/gui/GUICrucible.png differ diff --git a/src/main/java/assets/ihl/textures/gui/GUICrucibleNEI.png b/src/main/java/assets/ihl/textures/gui/GUICrucibleNEI.png new file mode 100644 index 0000000..07d987b Binary files /dev/null and b/src/main/java/assets/ihl/textures/gui/GUICrucibleNEI.png differ diff --git a/src/main/java/assets/ihl/textures/gui/GUICryogenicDistiller.png b/src/main/java/assets/ihl/textures/gui/GUICryogenicDistiller.png new file mode 100644 index 0000000..448b01d Binary files /dev/null and b/src/main/java/assets/ihl/textures/gui/GUICryogenicDistiller.png differ diff --git a/src/main/java/assets/ihl/textures/gui/GUIDebugScanner.png b/src/main/java/assets/ihl/textures/gui/GUIDebugScanner.png new file mode 100644 index 0000000..da6c4e4 Binary files /dev/null and b/src/main/java/assets/ihl/textures/gui/GUIDebugScanner.png differ diff --git a/src/main/java/assets/ihl/textures/gui/GUIDetonationSprayingMachine.png b/src/main/java/assets/ihl/textures/gui/GUIDetonationSprayingMachine.png new file mode 100644 index 0000000..46d165e Binary files /dev/null and b/src/main/java/assets/ihl/textures/gui/GUIDetonationSprayingMachine.png differ diff --git a/src/main/java/assets/ihl/textures/gui/GUIDosingPump.png b/src/main/java/assets/ihl/textures/gui/GUIDosingPump.png new file mode 100644 index 0000000..5d204d5 Binary files /dev/null and b/src/main/java/assets/ihl/textures/gui/GUIDosingPump.png differ diff --git a/src/main/java/assets/ihl/textures/gui/GUIElectricEvaporator.png b/src/main/java/assets/ihl/textures/gui/GUIElectricEvaporator.png new file mode 100644 index 0000000..e42259d Binary files /dev/null and b/src/main/java/assets/ihl/textures/gui/GUIElectricEvaporator.png differ diff --git a/src/main/java/assets/ihl/textures/gui/GUIElectrolysisBath.png b/src/main/java/assets/ihl/textures/gui/GUIElectrolysisBath.png new file mode 100644 index 0000000..b53a181 Binary files /dev/null and b/src/main/java/assets/ihl/textures/gui/GUIElectrolysisBath.png differ diff --git a/src/main/java/assets/ihl/textures/gui/GUIExtruder.png b/src/main/java/assets/ihl/textures/gui/GUIExtruder.png new file mode 100644 index 0000000..6b4ee9c Binary files /dev/null and b/src/main/java/assets/ihl/textures/gui/GUIExtruder.png differ diff --git a/src/main/java/assets/ihl/textures/gui/GUIFluidizedBedReactor.png b/src/main/java/assets/ihl/textures/gui/GUIFluidizedBedReactor.png new file mode 100644 index 0000000..20ec2fc Binary files /dev/null and b/src/main/java/assets/ihl/textures/gui/GUIFluidizedBedReactor.png differ diff --git a/src/main/java/assets/ihl/textures/gui/GUIFractionationColumn.png b/src/main/java/assets/ihl/textures/gui/GUIFractionationColumn.png new file mode 100644 index 0000000..b9bc42c Binary files /dev/null and b/src/main/java/assets/ihl/textures/gui/GUIFractionationColumn.png differ diff --git a/src/main/java/assets/ihl/textures/gui/GUIGaedesMercuryRotaryPump.png b/src/main/java/assets/ihl/textures/gui/GUIGaedesMercuryRotaryPump.png new file mode 100644 index 0000000..c9d9f63 Binary files /dev/null and b/src/main/java/assets/ihl/textures/gui/GUIGaedesMercuryRotaryPump.png differ diff --git a/src/main/java/assets/ihl/textures/gui/GUIGasWeldingStation.png b/src/main/java/assets/ihl/textures/gui/GUIGasWeldingStation.png new file mode 100644 index 0000000..c02d4b0 Binary files /dev/null and b/src/main/java/assets/ihl/textures/gui/GUIGasWeldingStation.png differ diff --git a/src/main/java/assets/ihl/textures/gui/GUIIronWorkbench.png b/src/main/java/assets/ihl/textures/gui/GUIIronWorkbench.png new file mode 100644 index 0000000..8f036bf Binary files /dev/null and b/src/main/java/assets/ihl/textures/gui/GUIIronWorkbench.png differ diff --git a/src/main/java/assets/ihl/textures/gui/GUILabElectrolyzer.png b/src/main/java/assets/ihl/textures/gui/GUILabElectrolyzer.png new file mode 100644 index 0000000..946d2b1 Binary files /dev/null and b/src/main/java/assets/ihl/textures/gui/GUILabElectrolyzer.png differ diff --git a/src/main/java/assets/ihl/textures/gui/GUILathe.png b/src/main/java/assets/ihl/textures/gui/GUILathe.png new file mode 100644 index 0000000..0cd584a Binary files /dev/null and b/src/main/java/assets/ihl/textures/gui/GUILathe.png differ diff --git a/src/main/java/assets/ihl/textures/gui/GUILeadOven.png b/src/main/java/assets/ihl/textures/gui/GUILeadOven.png new file mode 100644 index 0000000..87c3fd8 Binary files /dev/null and b/src/main/java/assets/ihl/textures/gui/GUILeadOven.png differ diff --git a/src/main/java/assets/ihl/textures/gui/GUILoom.png b/src/main/java/assets/ihl/textures/gui/GUILoom.png new file mode 100644 index 0000000..330e121 Binary files /dev/null and b/src/main/java/assets/ihl/textures/gui/GUILoom.png differ diff --git a/src/main/java/assets/ihl/textures/gui/GUIPaperMachine.png b/src/main/java/assets/ihl/textures/gui/GUIPaperMachine.png new file mode 100644 index 0000000..afc7d6d Binary files /dev/null and b/src/main/java/assets/ihl/textures/gui/GUIPaperMachine.png differ diff --git a/src/main/java/assets/ihl/textures/gui/GUIRollingMachine.png b/src/main/java/assets/ihl/textures/gui/GUIRollingMachine.png new file mode 100644 index 0000000..1d33901 Binary files /dev/null and b/src/main/java/assets/ihl/textures/gui/GUIRollingMachine.png differ diff --git a/src/main/java/assets/ihl/textures/gui/GUISolarEvaporator.png b/src/main/java/assets/ihl/textures/gui/GUISolarEvaporator.png new file mode 100644 index 0000000..4754742 Binary files /dev/null and b/src/main/java/assets/ihl/textures/gui/GUISolarEvaporator.png differ diff --git a/src/main/java/assets/ihl/textures/gui/GUISolidFuelEvaporator.png b/src/main/java/assets/ihl/textures/gui/GUISolidFuelEvaporator.png new file mode 100644 index 0000000..62daf52 Binary files /dev/null and b/src/main/java/assets/ihl/textures/gui/GUISolidFuelEvaporator.png differ diff --git a/src/main/java/assets/ihl/textures/gui/GUITDIT.png b/src/main/java/assets/ihl/textures/gui/GUITDIT.png new file mode 100644 index 0000000..2075c7d Binary files /dev/null and b/src/main/java/assets/ihl/textures/gui/GUITDIT.png differ diff --git a/src/main/java/assets/ihl/textures/gui/GUITubBronze.png b/src/main/java/assets/ihl/textures/gui/GUITubBronze.png new file mode 100644 index 0000000..d013dec Binary files /dev/null and b/src/main/java/assets/ihl/textures/gui/GUITubBronze.png differ diff --git a/src/main/java/assets/ihl/textures/gui/GUIVulcanizationExtrudingMoldNEI.png b/src/main/java/assets/ihl/textures/gui/GUIVulcanizationExtrudingMoldNEI.png new file mode 100644 index 0000000..efbe0b0 Binary files /dev/null and b/src/main/java/assets/ihl/textures/gui/GUIVulcanizationExtrudingMoldNEI.png differ diff --git a/src/main/java/assets/ihl/textures/gui/GUIWireMill.png b/src/main/java/assets/ihl/textures/gui/GUIWireMill.png new file mode 100644 index 0000000..ea55717 Binary files /dev/null and b/src/main/java/assets/ihl/textures/gui/GUIWireMill.png differ diff --git a/src/main/java/assets/ihl/textures/gui/GUIWoodenRollingMachine.png b/src/main/java/assets/ihl/textures/gui/GUIWoodenRollingMachine.png new file mode 100644 index 0000000..8d80d2c Binary files /dev/null and b/src/main/java/assets/ihl/textures/gui/GUIWoodenRollingMachine.png differ diff --git a/src/main/java/assets/ihl/textures/items/EightPinDataCable.png b/src/main/java/assets/ihl/textures/items/EightPinDataCable.png new file mode 100644 index 0000000..0654c4f Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/EightPinDataCable.png differ diff --git a/src/main/java/assets/ihl/textures/items/barD10Gold.png b/src/main/java/assets/ihl/textures/items/barD10Gold.png new file mode 100644 index 0000000..1395dcf Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/barD10Gold.png differ diff --git a/src/main/java/assets/ihl/textures/items/barD10Steel.png b/src/main/java/assets/ihl/textures/items/barD10Steel.png new file mode 100644 index 0000000..6d7dd77 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/barD10Steel.png differ diff --git a/src/main/java/assets/ihl/textures/items/barD10SteelHot.png b/src/main/java/assets/ihl/textures/items/barD10SteelHot.png new file mode 100644 index 0000000..931fb90 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/barD10SteelHot.png differ diff --git a/src/main/java/assets/ihl/textures/items/batteryCellsEbonite.png b/src/main/java/assets/ihl/textures/items/batteryCellsEbonite.png new file mode 100644 index 0000000..a78e084 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/batteryCellsEbonite.png differ diff --git a/src/main/java/assets/ihl/textures/items/batteryCellsRawEbonite.png b/src/main/java/assets/ihl/textures/items/batteryCellsRawEbonite.png new file mode 100644 index 0000000..56b67ed Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/batteryCellsRawEbonite.png differ diff --git a/src/main/java/assets/ihl/textures/items/blankChiselSteel.png b/src/main/java/assets/ihl/textures/items/blankChiselSteel.png new file mode 100644 index 0000000..1655deb Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/blankChiselSteel.png differ diff --git a/src/main/java/assets/ihl/textures/items/blankNeedleFileSteel.png b/src/main/java/assets/ihl/textures/items/blankNeedleFileSteel.png new file mode 100644 index 0000000..3bd238f Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/blankNeedleFileSteel.png differ diff --git a/src/main/java/assets/ihl/textures/items/blankSetOfFilesSteel.png b/src/main/java/assets/ihl/textures/items/blankSetOfFilesSteel.png new file mode 100644 index 0000000..89ae180 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/blankSetOfFilesSteel.png differ diff --git a/src/main/java/assets/ihl/textures/items/boltM10x1Steel.png b/src/main/java/assets/ihl/textures/items/boltM10x1Steel.png new file mode 100644 index 0000000..edd8832 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/boltM10x1Steel.png differ diff --git a/src/main/java/assets/ihl/textures/items/breadWithLard.png b/src/main/java/assets/ihl/textures/items/breadWithLard.png new file mode 100644 index 0000000..8b35bc7 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/breadWithLard.png differ diff --git a/src/main/java/assets/ihl/textures/items/bucket_SpruceResin.png b/src/main/java/assets/ihl/textures/items/bucket_SpruceResin.png new file mode 100644 index 0000000..ef4b8fe Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/bucket_SpruceResin.png differ diff --git a/src/main/java/assets/ihl/textures/items/bucket_fluidRubberTreeSap.png b/src/main/java/assets/ihl/textures/items/bucket_fluidRubberTreeSap.png new file mode 100644 index 0000000..a5ea295 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/bucket_fluidRubberTreeSap.png differ diff --git a/src/main/java/assets/ihl/textures/items/bucket_tarPitch.png b/src/main/java/assets/ihl/textures/items/bucket_tarPitch.png new file mode 100644 index 0000000..d0fdc9f Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/bucket_tarPitch.png differ diff --git a/src/main/java/assets/ihl/textures/items/carvingKnifeBronze.png b/src/main/java/assets/ihl/textures/items/carvingKnifeBronze.png new file mode 100644 index 0000000..680c515 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/carvingKnifeBronze.png differ diff --git a/src/main/java/assets/ihl/textures/items/catalystIron.png b/src/main/java/assets/ihl/textures/items/catalystIron.png new file mode 100644 index 0000000..fcf6ada Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/catalystIron.png differ diff --git a/src/main/java/assets/ihl/textures/items/catalystIronOxide.png b/src/main/java/assets/ihl/textures/items/catalystIronOxide.png new file mode 100644 index 0000000..9df4052 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/catalystIronOxide.png differ diff --git a/src/main/java/assets/ihl/textures/items/catalystRawIronOxide.png b/src/main/java/assets/ihl/textures/items/catalystRawIronOxide.png new file mode 100644 index 0000000..dc0a04f Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/catalystRawIronOxide.png differ diff --git a/src/main/java/assets/ihl/textures/items/chisel.png b/src/main/java/assets/ihl/textures/items/chisel.png new file mode 100644 index 0000000..d11fc73 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/chisel.png differ diff --git a/src/main/java/assets/ihl/textures/items/copperWire.png b/src/main/java/assets/ihl/textures/items/copperWire.png new file mode 100644 index 0000000..341aeb6 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/copperWire.png differ diff --git a/src/main/java/assets/ihl/textures/items/copperWire16x.png b/src/main/java/assets/ihl/textures/items/copperWire16x.png new file mode 100644 index 0000000..01af3d0 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/copperWire16x.png differ diff --git a/src/main/java/assets/ihl/textures/items/crucible.png b/src/main/java/assets/ihl/textures/items/crucible.png new file mode 100644 index 0000000..4a7761a Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/crucible.png differ diff --git a/src/main/java/assets/ihl/textures/items/crucibleHot.png b/src/main/java/assets/ihl/textures/items/crucibleHot.png new file mode 100644 index 0000000..a0160ad Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/crucibleHot.png differ diff --git a/src/main/java/assets/ihl/textures/items/crucibleMixture.png b/src/main/java/assets/ihl/textures/items/crucibleMixture.png new file mode 100644 index 0000000..9a00702 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/crucibleMixture.png differ diff --git a/src/main/java/assets/ihl/textures/items/crushedBauxite.png b/src/main/java/assets/ihl/textures/items/crushedBauxite.png new file mode 100644 index 0000000..d4d98b2 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/crushedBauxite.png differ diff --git a/src/main/java/assets/ihl/textures/items/crushedChromite.png b/src/main/java/assets/ihl/textures/items/crushedChromite.png new file mode 100644 index 0000000..9ef37d6 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/crushedChromite.png differ diff --git a/src/main/java/assets/ihl/textures/items/crushedCinnabar.png b/src/main/java/assets/ihl/textures/items/crushedCinnabar.png new file mode 100644 index 0000000..b688200 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/crushedCinnabar.png differ diff --git a/src/main/java/assets/ihl/textures/items/crushedGyubnera.png b/src/main/java/assets/ihl/textures/items/crushedGyubnera.png new file mode 100644 index 0000000..b97cce2 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/crushedGyubnera.png differ diff --git a/src/main/java/assets/ihl/textures/items/crushedPurifiedBauxite.png b/src/main/java/assets/ihl/textures/items/crushedPurifiedBauxite.png new file mode 100644 index 0000000..7c7c8b9 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/crushedPurifiedBauxite.png differ diff --git a/src/main/java/assets/ihl/textures/items/crushedPurifiedChromite.png b/src/main/java/assets/ihl/textures/items/crushedPurifiedChromite.png new file mode 100644 index 0000000..aa774fa Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/crushedPurifiedChromite.png differ diff --git a/src/main/java/assets/ihl/textures/items/crushedPurifiedCinnabar.png b/src/main/java/assets/ihl/textures/items/crushedPurifiedCinnabar.png new file mode 100644 index 0000000..df61cc2 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/crushedPurifiedCinnabar.png differ diff --git a/src/main/java/assets/ihl/textures/items/crushedPurifiedGyubnera.png b/src/main/java/assets/ihl/textures/items/crushedPurifiedGyubnera.png new file mode 100644 index 0000000..4de5dc0 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/crushedPurifiedGyubnera.png differ diff --git a/src/main/java/assets/ihl/textures/items/crushedPurifiedStibnite.png b/src/main/java/assets/ihl/textures/items/crushedPurifiedStibnite.png new file mode 100644 index 0000000..665dcb1 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/crushedPurifiedStibnite.png differ diff --git a/src/main/java/assets/ihl/textures/items/crushedStibnite.png b/src/main/java/assets/ihl/textures/items/crushedStibnite.png new file mode 100644 index 0000000..93999e0 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/crushedStibnite.png differ diff --git a/src/main/java/assets/ihl/textures/items/detonationSprayingMachineSetOfMoldedPartsBronze.png b/src/main/java/assets/ihl/textures/items/detonationSprayingMachineSetOfMoldedPartsBronze.png new file mode 100644 index 0000000..5623700 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/detonationSprayingMachineSetOfMoldedPartsBronze.png differ diff --git a/src/main/java/assets/ihl/textures/items/detonator.png b/src/main/java/assets/ihl/textures/items/detonator.png new file mode 100644 index 0000000..be569ad Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/detonator.png differ diff --git a/src/main/java/assets/ihl/textures/items/diceM10x1Steel.png b/src/main/java/assets/ihl/textures/items/diceM10x1Steel.png new file mode 100644 index 0000000..9397348 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/diceM10x1Steel.png differ diff --git a/src/main/java/assets/ihl/textures/items/diceM10x1SteelHardened.png b/src/main/java/assets/ihl/textures/items/diceM10x1SteelHardened.png new file mode 100644 index 0000000..1c80756 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/diceM10x1SteelHardened.png differ diff --git a/src/main/java/assets/ihl/textures/items/diceM10x1SteelHot.png b/src/main/java/assets/ihl/textures/items/diceM10x1SteelHot.png new file mode 100644 index 0000000..dc5bf09 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/diceM10x1SteelHot.png differ diff --git a/src/main/java/assets/ihl/textures/items/diceS10x2Steel.png b/src/main/java/assets/ihl/textures/items/diceS10x2Steel.png new file mode 100644 index 0000000..00c6553 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/diceS10x2Steel.png differ diff --git a/src/main/java/assets/ihl/textures/items/drillSteel.png b/src/main/java/assets/ihl/textures/items/drillSteel.png new file mode 100644 index 0000000..22a5fe7 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/drillSteel.png differ diff --git a/src/main/java/assets/ihl/textures/items/drillSteelHardened.png b/src/main/java/assets/ihl/textures/items/drillSteelHardened.png new file mode 100644 index 0000000..274fd52 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/drillSteelHardened.png differ diff --git a/src/main/java/assets/ihl/textures/items/drillSteelHot.png b/src/main/java/assets/ihl/textures/items/drillSteelHot.png new file mode 100644 index 0000000..185265d Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/drillSteelHot.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustAntimony.png b/src/main/java/assets/ihl/textures/items/dustAntimony.png new file mode 100644 index 0000000..1b0a4d6 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustAntimony.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustAntimonyOxide.png b/src/main/java/assets/ihl/textures/items/dustAntimonyOxide.png new file mode 100644 index 0000000..1b6ffa0 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustAntimonyOxide.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustBauxite.png b/src/main/java/assets/ihl/textures/items/dustBauxite.png new file mode 100644 index 0000000..2852751 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustBauxite.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustBischofite.png b/src/main/java/assets/ihl/textures/items/dustBischofite.png new file mode 100644 index 0000000..c6273be Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustBischofite.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustBoricAcid.png b/src/main/java/assets/ihl/textures/items/dustBoricAcid.png new file mode 100644 index 0000000..d745037 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustBoricAcid.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustBoronCarbide.png b/src/main/java/assets/ihl/textures/items/dustBoronCarbide.png new file mode 100644 index 0000000..3a123d6 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustBoronCarbide.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustBrick.png b/src/main/java/assets/ihl/textures/items/dustBrick.png new file mode 100644 index 0000000..3ad3ffc Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustBrick.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustCalcite.png b/src/main/java/assets/ihl/textures/items/dustCalcite.png new file mode 100644 index 0000000..4fcd4cd Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustCalcite.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustCalciumAcetate.png b/src/main/java/assets/ihl/textures/items/dustCalciumAcetate.png new file mode 100644 index 0000000..cca785f Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustCalciumAcetate.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustCalciumCarbide.png b/src/main/java/assets/ihl/textures/items/dustCalciumCarbide.png new file mode 100644 index 0000000..c2a15bc Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustCalciumCarbide.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustCalciumChloride.png b/src/main/java/assets/ihl/textures/items/dustCalciumChloride.png new file mode 100644 index 0000000..d100ded Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustCalciumChloride.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustCalciumTungstate.png b/src/main/java/assets/ihl/textures/items/dustCalciumTungstate.png new file mode 100644 index 0000000..b15a59d Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustCalciumTungstate.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustCarborundum.png b/src/main/java/assets/ihl/textures/items/dustCarborundum.png new file mode 100644 index 0000000..8b56181 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustCarborundum.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustChromite.png b/src/main/java/assets/ihl/textures/items/dustChromite.png new file mode 100644 index 0000000..22c6649 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustChromite.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustCoalElectrodePremix.png b/src/main/java/assets/ihl/textures/items/dustCoalElectrodePremix.png new file mode 100644 index 0000000..727ebf0 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustCoalElectrodePremix.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustDatolite.png b/src/main/java/assets/ihl/textures/items/dustDatolite.png new file mode 100644 index 0000000..58078ee Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustDatolite.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustDehydratedGypsum.png b/src/main/java/assets/ihl/textures/items/dustDehydratedGypsum.png new file mode 100644 index 0000000..85976f3 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustDehydratedGypsum.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustFerrite.png b/src/main/java/assets/ihl/textures/items/dustFerrite.png new file mode 100644 index 0000000..4bbb1e3 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustFerrite.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustFerrochrome.png b/src/main/java/assets/ihl/textures/items/dustFerrochrome.png new file mode 100644 index 0000000..bf9cc15 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustFerrochrome.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustGlass.png b/src/main/java/assets/ihl/textures/items/dustGlass.png new file mode 100644 index 0000000..dc8c9a1 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustGlass.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustGraphite.png b/src/main/java/assets/ihl/textures/items/dustGraphite.png new file mode 100644 index 0000000..c48326d Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustGraphite.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustGypsum.png b/src/main/java/assets/ihl/textures/items/dustGypsum.png new file mode 100644 index 0000000..34646a1 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustGypsum.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustIridium.png b/src/main/java/assets/ihl/textures/items/dustIridium.png new file mode 100644 index 0000000..3af5b2a Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustIridium.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustIridiumAndSodiumOxide.png b/src/main/java/assets/ihl/textures/items/dustIridiumAndSodiumOxide.png new file mode 100644 index 0000000..7962018 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustIridiumAndSodiumOxide.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustIronOxide.png b/src/main/java/assets/ihl/textures/items/dustIronOxide.png new file mode 100644 index 0000000..08a7259 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustIronOxide.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustIronOxideCatalystMix.png b/src/main/java/assets/ihl/textures/items/dustIronOxideCatalystMix.png new file mode 100644 index 0000000..d9266aa Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustIronOxideCatalystMix.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustIrongraphite.png b/src/main/java/assets/ihl/textures/items/dustIrongraphite.png new file mode 100644 index 0000000..388e1f0 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustIrongraphite.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustLeadPlumbate.png b/src/main/java/assets/ihl/textures/items/dustLeadPlumbate.png new file mode 100644 index 0000000..80bfa85 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustLeadPlumbate.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustLithiumChloride.png b/src/main/java/assets/ihl/textures/items/dustLithiumChloride.png new file mode 100644 index 0000000..61d5d90 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustLithiumChloride.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustLithiumOxide.png b/src/main/java/assets/ihl/textures/items/dustLithiumOxide.png new file mode 100644 index 0000000..b114e82 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustLithiumOxide.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustMagnesium.png b/src/main/java/assets/ihl/textures/items/dustMagnesium.png new file mode 100644 index 0000000..3a6df80 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustMagnesium.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustMagnesiumOxide.png b/src/main/java/assets/ihl/textures/items/dustMagnesiumOxide.png new file mode 100644 index 0000000..2e2139a Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustMagnesiumOxide.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustManganeseOxide.png b/src/main/java/assets/ihl/textures/items/dustManganeseOxide.png new file mode 100644 index 0000000..48f138a Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustManganeseOxide.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustMercuryChloride.png b/src/main/java/assets/ihl/textures/items/dustMercuryChloride.png new file mode 100644 index 0000000..e01f549 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustMercuryChloride.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustMercuryFulminate.png b/src/main/java/assets/ihl/textures/items/dustMercuryFulminate.png new file mode 100644 index 0000000..81b572a Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustMercuryFulminate.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustMica.png b/src/main/java/assets/ihl/textures/items/dustMica.png new file mode 100644 index 0000000..1aef3a7 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustMica.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustPentaerythritol.png b/src/main/java/assets/ihl/textures/items/dustPentaerythritol.png new file mode 100644 index 0000000..c9cdce9 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustPentaerythritol.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustPentaerythritolTetranitrate.png b/src/main/java/assets/ihl/textures/items/dustPentaerythritolTetranitrate.png new file mode 100644 index 0000000..ebffb57 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustPentaerythritolTetranitrate.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustPlatinumGroupSludge.png b/src/main/java/assets/ihl/textures/items/dustPlatinumGroupSludge.png new file mode 100644 index 0000000..872dbc4 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustPlatinumGroupSludge.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustPorcelain.png b/src/main/java/assets/ihl/textures/items/dustPorcelain.png new file mode 100644 index 0000000..df17804 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustPorcelain.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustPotassiumFeldspar.png b/src/main/java/assets/ihl/textures/items/dustPotassiumFeldspar.png new file mode 100644 index 0000000..8e2d121 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustPotassiumFeldspar.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustPotassiumOxide.png b/src/main/java/assets/ihl/textures/items/dustPotassiumOxide.png new file mode 100644 index 0000000..2784e55 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustPotassiumOxide.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustPotassiumSulphate.png b/src/main/java/assets/ihl/textures/items/dustPotassiumSulphate.png new file mode 100644 index 0000000..4002832 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustPotassiumSulphate.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustQuicklime.png b/src/main/java/assets/ihl/textures/items/dustQuicklime.png new file mode 100644 index 0000000..3c4200f Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustQuicklime.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustRockSalt.png b/src/main/java/assets/ihl/textures/items/dustRockSalt.png new file mode 100644 index 0000000..3bd22b9 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustRockSalt.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustSalt.png b/src/main/java/assets/ihl/textures/items/dustSalt.png new file mode 100644 index 0000000..84697da Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustSalt.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustSaltpeter.png b/src/main/java/assets/ihl/textures/items/dustSaltpeter.png new file mode 100644 index 0000000..a54054d Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustSaltpeter.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustSilicon.png b/src/main/java/assets/ihl/textures/items/dustSilicon.png new file mode 100644 index 0000000..bf59269 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustSilicon.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustSodiumAluminate.png b/src/main/java/assets/ihl/textures/items/dustSodiumAluminate.png new file mode 100644 index 0000000..0b88f21 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustSodiumAluminate.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustSodiumFormate.png b/src/main/java/assets/ihl/textures/items/dustSodiumFormate.png new file mode 100644 index 0000000..55fd979 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustSodiumFormate.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustSodiumHydrogenSulfate.png b/src/main/java/assets/ihl/textures/items/dustSodiumHydrogenSulfate.png new file mode 100644 index 0000000..a936246 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustSodiumHydrogenSulfate.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustSodiumHydroxide.png b/src/main/java/assets/ihl/textures/items/dustSodiumHydroxide.png new file mode 100644 index 0000000..07a8ee7 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustSodiumHydroxide.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustSodiumPeroxide.png b/src/main/java/assets/ihl/textures/items/dustSodiumPeroxide.png new file mode 100644 index 0000000..990796f Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustSodiumPeroxide.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustSodiumSulfate.png b/src/main/java/assets/ihl/textures/items/dustSodiumSulfate.png new file mode 100644 index 0000000..5adb9b1 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustSodiumSulfate.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustSodiumSulfide.png b/src/main/java/assets/ihl/textures/items/dustSodiumSulfide.png new file mode 100644 index 0000000..fb0c699 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustSodiumSulfide.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustSodiumZeolite.png b/src/main/java/assets/ihl/textures/items/dustSodiumZeolite.png new file mode 100644 index 0000000..e80cdb9 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustSodiumZeolite.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustSodiumZeoliteCoked.png b/src/main/java/assets/ihl/textures/items/dustSodiumZeoliteCoked.png new file mode 100644 index 0000000..6c301f8 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustSodiumZeoliteCoked.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustSolderingAlloy.png b/src/main/java/assets/ihl/textures/items/dustSolderingAlloy.png new file mode 100644 index 0000000..fb8f869 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustSolderingAlloy.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustStibnite.png b/src/main/java/assets/ihl/textures/items/dustStibnite.png new file mode 100644 index 0000000..feb7c3f Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustStibnite.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustTinyAntimony.png b/src/main/java/assets/ihl/textures/items/dustTinyAntimony.png new file mode 100644 index 0000000..08b3401 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustTinyAntimony.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustTinyGypsum.png b/src/main/java/assets/ihl/textures/items/dustTinyGypsum.png new file mode 100644 index 0000000..1a4005d Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustTinyGypsum.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustTinyIronOxide.png b/src/main/java/assets/ihl/textures/items/dustTinyIronOxide.png new file mode 100644 index 0000000..24416f1 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustTinyIronOxide.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustTinyManganeseOxide.png b/src/main/java/assets/ihl/textures/items/dustTinyManganeseOxide.png new file mode 100644 index 0000000..f49e2e1 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustTinyManganeseOxide.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustTinyPlatinumGroupSludge.png b/src/main/java/assets/ihl/textures/items/dustTinyPlatinumGroupSludge.png new file mode 100644 index 0000000..9bc952d Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustTinyPlatinumGroupSludge.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustTinySilicon.png b/src/main/java/assets/ihl/textures/items/dustTinySilicon.png new file mode 100644 index 0000000..73ea7ed Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustTinySilicon.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustTinySiliconDioxide.png b/src/main/java/assets/ihl/textures/items/dustTinySiliconDioxide.png new file mode 100644 index 0000000..c7045c1 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustTinySiliconDioxide.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustTinyTungsten.png b/src/main/java/assets/ihl/textures/items/dustTinyTungsten.png new file mode 100644 index 0000000..24b66b3 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustTinyTungsten.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustTrona.png b/src/main/java/assets/ihl/textures/items/dustTrona.png new file mode 100644 index 0000000..eaf1da7 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustTrona.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustTungsten.png b/src/main/java/assets/ihl/textures/items/dustTungsten.png new file mode 100644 index 0000000..97101b4 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustTungsten.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustTungstenOxide.png b/src/main/java/assets/ihl/textures/items/dustTungstenOxide.png new file mode 100644 index 0000000..62ccdca Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustTungstenOxide.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustTungsticAcid.png b/src/main/java/assets/ihl/textures/items/dustTungsticAcid.png new file mode 100644 index 0000000..5f40ae8 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustTungsticAcid.png differ diff --git a/src/main/java/assets/ihl/textures/items/dustWood.png b/src/main/java/assets/ihl/textures/items/dustWood.png new file mode 100644 index 0000000..de6bd4d Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/dustWood.png differ diff --git a/src/main/java/assets/ihl/textures/items/electricMotorLVLEDC.png b/src/main/java/assets/ihl/textures/items/electricMotorLVLEDC.png new file mode 100644 index 0000000..22494e9 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/electricMotorLVLEDC.png differ diff --git a/src/main/java/assets/ihl/textures/items/electrolysisBathPorcelain.png b/src/main/java/assets/ihl/textures/items/electrolysisBathPorcelain.png new file mode 100644 index 0000000..8e468f9 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/electrolysisBathPorcelain.png differ diff --git a/src/main/java/assets/ihl/textures/items/electrolysisBathRawPorcelain.png b/src/main/java/assets/ihl/textures/items/electrolysisBathRawPorcelain.png new file mode 100644 index 0000000..ff5957d Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/electrolysisBathRawPorcelain.png differ diff --git a/src/main/java/assets/ihl/textures/items/extruderSetOfMoldedPartsSteel.png b/src/main/java/assets/ihl/textures/items/extruderSetOfMoldedPartsSteel.png new file mode 100644 index 0000000..cec77a0 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/extruderSetOfMoldedPartsSteel.png differ diff --git a/src/main/java/assets/ihl/textures/items/fabric.png b/src/main/java/assets/ihl/textures/items/fabric.png new file mode 100644 index 0000000..714b9ed Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/fabric.png differ diff --git a/src/main/java/assets/ihl/textures/items/fiberGlass.png b/src/main/java/assets/ihl/textures/items/fiberGlass.png new file mode 100644 index 0000000..989125f Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/fiberGlass.png differ diff --git a/src/main/java/assets/ihl/textures/items/fiberGlassDieSteel.png b/src/main/java/assets/ihl/textures/items/fiberGlassDieSteel.png new file mode 100644 index 0000000..0f38f01 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/fiberGlassDieSteel.png differ diff --git a/src/main/java/assets/ihl/textures/items/flexibleCableCopperVulcanizedRubber2.png b/src/main/java/assets/ihl/textures/items/flexibleCableCopperVulcanizedRubber2.png new file mode 100644 index 0000000..0b281a0 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/flexibleCableCopperVulcanizedRubber2.png differ diff --git a/src/main/java/assets/ihl/textures/items/flexibleCableSteel2.png b/src/main/java/assets/ihl/textures/items/flexibleCableSteel2.png new file mode 100644 index 0000000..0695d69 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/flexibleCableSteel2.png differ diff --git a/src/main/java/assets/ihl/textures/items/foilCopper.png b/src/main/java/assets/ihl/textures/items/foilCopper.png new file mode 100644 index 0000000..23263cd Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/foilCopper.png differ diff --git a/src/main/java/assets/ihl/textures/items/foilGold.png b/src/main/java/assets/ihl/textures/items/foilGold.png new file mode 100644 index 0000000..a7d2ea6 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/foilGold.png differ diff --git a/src/main/java/assets/ihl/textures/items/foilLead.png b/src/main/java/assets/ihl/textures/items/foilLead.png new file mode 100644 index 0000000..b26ad2e Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/foilLead.png differ diff --git a/src/main/java/assets/ihl/textures/items/foilMica.png b/src/main/java/assets/ihl/textures/items/foilMica.png new file mode 100644 index 0000000..a2acabb Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/foilMica.png differ diff --git a/src/main/java/assets/ihl/textures/items/foilRubber.png b/src/main/java/assets/ihl/textures/items/foilRubber.png new file mode 100644 index 0000000..fae0e12 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/foilRubber.png differ diff --git a/src/main/java/assets/ihl/textures/items/foilRubberWithSulfur.png b/src/main/java/assets/ihl/textures/items/foilRubberWithSulfur.png new file mode 100644 index 0000000..5214a8f Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/foilRubberWithSulfur.png differ diff --git a/src/main/java/assets/ihl/textures/items/foilSteel.png b/src/main/java/assets/ihl/textures/items/foilSteel.png new file mode 100644 index 0000000..8368143 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/foilSteel.png differ diff --git a/src/main/java/assets/ihl/textures/items/foilTungsten.png b/src/main/java/assets/ihl/textures/items/foilTungsten.png new file mode 100644 index 0000000..2ab6deb Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/foilTungsten.png differ diff --git a/src/main/java/assets/ihl/textures/items/gaedesPumpBarrelPorcelain.png b/src/main/java/assets/ihl/textures/items/gaedesPumpBarrelPorcelain.png new file mode 100644 index 0000000..afa215f Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/gaedesPumpBarrelPorcelain.png differ diff --git a/src/main/java/assets/ihl/textures/items/gaedesPumpBarrelRawPorcelain.png b/src/main/java/assets/ihl/textures/items/gaedesPumpBarrelRawPorcelain.png new file mode 100644 index 0000000..abaa25b Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/gaedesPumpBarrelRawPorcelain.png differ diff --git a/src/main/java/assets/ihl/textures/items/gasJetSteel.png b/src/main/java/assets/ihl/textures/items/gasJetSteel.png new file mode 100644 index 0000000..aaee4f8 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/gasJetSteel.png differ diff --git a/src/main/java/assets/ihl/textures/items/gasReducerSteel.png b/src/main/java/assets/ihl/textures/items/gasReducerSteel.png new file mode 100644 index 0000000..f2542c6 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/gasReducerSteel.png differ diff --git a/src/main/java/assets/ihl/textures/items/gemApatite.png b/src/main/java/assets/ihl/textures/items/gemApatite.png new file mode 100644 index 0000000..4a4c356 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/gemApatite.png differ diff --git a/src/main/java/assets/ihl/textures/items/glassBlowingTubeSteel.png b/src/main/java/assets/ihl/textures/items/glassBlowingTubeSteel.png new file mode 100644 index 0000000..13812f4 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/glassBlowingTubeSteel.png differ diff --git a/src/main/java/assets/ihl/textures/items/graverSteel.png b/src/main/java/assets/ihl/textures/items/graverSteel.png new file mode 100644 index 0000000..d4201db Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/graverSteel.png differ diff --git a/src/main/java/assets/ihl/textures/items/graverSteelHardened.png b/src/main/java/assets/ihl/textures/items/graverSteelHardened.png new file mode 100644 index 0000000..b9c7ae5 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/graverSteelHardened.png differ diff --git a/src/main/java/assets/ihl/textures/items/graverSteelHot.png b/src/main/java/assets/ihl/textures/items/graverSteelHot.png new file mode 100644 index 0000000..efd159e Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/graverSteelHot.png differ diff --git a/src/main/java/assets/ihl/textures/items/grindstone.png b/src/main/java/assets/ihl/textures/items/grindstone.png new file mode 100644 index 0000000..3ac7c60 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/grindstone.png differ diff --git a/src/main/java/assets/ihl/textures/items/gu-81m.png b/src/main/java/assets/ihl/textures/items/gu-81m.png new file mode 100644 index 0000000..d481883 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/gu-81m.png differ diff --git a/src/main/java/assets/ihl/textures/items/guidebook.png b/src/main/java/assets/ihl/textures/items/guidebook.png new file mode 100644 index 0000000..1c0be39 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/guidebook.png differ diff --git a/src/main/java/assets/ihl/textures/items/hackSawSteel.png b/src/main/java/assets/ihl/textures/items/hackSawSteel.png new file mode 100644 index 0000000..96523bf Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/hackSawSteel.png differ diff --git a/src/main/java/assets/ihl/textures/items/hallSensor.png b/src/main/java/assets/ihl/textures/items/hallSensor.png new file mode 100644 index 0000000..4711249 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/hallSensor.png differ diff --git a/src/main/java/assets/ihl/textures/items/hammer.png b/src/main/java/assets/ihl/textures/items/hammer.png new file mode 100644 index 0000000..6634e01 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/hammer.png differ diff --git a/src/main/java/assets/ihl/textures/items/hammerBronze.png b/src/main/java/assets/ihl/textures/items/hammerBronze.png new file mode 100644 index 0000000..94387cd Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/hammerBronze.png differ diff --git a/src/main/java/assets/ihl/textures/items/handDrillBronze.png b/src/main/java/assets/ihl/textures/items/handDrillBronze.png new file mode 100644 index 0000000..7d472fa Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/handDrillBronze.png differ diff --git a/src/main/java/assets/ihl/textures/items/handDrillSetOfMoldedPartsBronze.png b/src/main/java/assets/ihl/textures/items/handDrillSetOfMoldedPartsBronze.png new file mode 100644 index 0000000..c1ed6be Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/handDrillSetOfMoldedPartsBronze.png differ diff --git a/src/main/java/assets/ihl/textures/items/highPressureVesselSteel.png b/src/main/java/assets/ihl/textures/items/highPressureVesselSteel.png new file mode 100644 index 0000000..b365917 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/highPressureVesselSteel.png differ diff --git a/src/main/java/assets/ihl/textures/items/highVoltageCapacitor.png b/src/main/java/assets/ihl/textures/items/highVoltageCapacitor.png new file mode 100644 index 0000000..e0dddc0 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/highVoltageCapacitor.png differ diff --git a/src/main/java/assets/ihl/textures/items/ignitron.png b/src/main/java/assets/ihl/textures/items/ignitron.png new file mode 100644 index 0000000..0b0f773 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/ignitron.png differ diff --git a/src/main/java/assets/ihl/textures/items/incisorSteel.png b/src/main/java/assets/ihl/textures/items/incisorSteel.png new file mode 100644 index 0000000..0b1738d Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/incisorSteel.png differ diff --git a/src/main/java/assets/ihl/textures/items/incisorSteelDiamondCoated.png b/src/main/java/assets/ihl/textures/items/incisorSteelDiamondCoated.png new file mode 100644 index 0000000..4c01aaf Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/incisorSteelDiamondCoated.png differ diff --git a/src/main/java/assets/ihl/textures/items/ingotCalciumSoap.png b/src/main/java/assets/ihl/textures/items/ingotCalciumSoap.png new file mode 100644 index 0000000..3b556d9 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/ingotCalciumSoap.png differ diff --git a/src/main/java/assets/ihl/textures/items/ingotHotSteel.png b/src/main/java/assets/ihl/textures/items/ingotHotSteel.png new file mode 100644 index 0000000..a0e9e0d Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/ingotHotSteel.png differ diff --git a/src/main/java/assets/ihl/textures/items/ingotHotTungsten.png b/src/main/java/assets/ihl/textures/items/ingotHotTungsten.png new file mode 100644 index 0000000..9b89b91 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/ingotHotTungsten.png differ diff --git a/src/main/java/assets/ihl/textures/items/ingotLithium.png b/src/main/java/assets/ihl/textures/items/ingotLithium.png new file mode 100644 index 0000000..a2d3c85 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/ingotLithium.png differ diff --git a/src/main/java/assets/ihl/textures/items/ingotMagnesium.png b/src/main/java/assets/ihl/textures/items/ingotMagnesium.png new file mode 100644 index 0000000..f59f146 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/ingotMagnesium.png differ diff --git a/src/main/java/assets/ihl/textures/items/ingotPotassium.png b/src/main/java/assets/ihl/textures/items/ingotPotassium.png new file mode 100644 index 0000000..fba83d4 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/ingotPotassium.png differ diff --git a/src/main/java/assets/ihl/textures/items/ingotStearin.png b/src/main/java/assets/ihl/textures/items/ingotStearin.png new file mode 100644 index 0000000..6d788ea Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/ingotStearin.png differ diff --git a/src/main/java/assets/ihl/textures/items/ingotTarPitch.png b/src/main/java/assets/ihl/textures/items/ingotTarPitch.png new file mode 100644 index 0000000..811770a Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/ingotTarPitch.png differ diff --git a/src/main/java/assets/ihl/textures/items/ingotTungsten.png b/src/main/java/assets/ihl/textures/items/ingotTungsten.png new file mode 100644 index 0000000..ab5f973 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/ingotTungsten.png differ diff --git a/src/main/java/assets/ihl/textures/items/insulatorPorcelain.png b/src/main/java/assets/ihl/textures/items/insulatorPorcelain.png new file mode 100644 index 0000000..e20036a Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/insulatorPorcelain.png differ diff --git a/src/main/java/assets/ihl/textures/items/insulatorRawPorcelain.png b/src/main/java/assets/ihl/textures/items/insulatorRawPorcelain.png new file mode 100644 index 0000000..1a1d8a0 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/insulatorRawPorcelain.png differ diff --git a/src/main/java/assets/ihl/textures/items/itemAdvancedElectricHandpump.png b/src/main/java/assets/ihl/textures/items/itemAdvancedElectricHandpump.png new file mode 100644 index 0000000..fccfaf5 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/itemAdvancedElectricHandpump.png differ diff --git a/src/main/java/assets/ihl/textures/items/itemCellAcetylene.png b/src/main/java/assets/ihl/textures/items/itemCellAcetylene.png new file mode 100644 index 0000000..c5ee21f Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/itemCellAcetylene.png differ diff --git a/src/main/java/assets/ihl/textures/items/itemCellAmmonia.png b/src/main/java/assets/ihl/textures/items/itemCellAmmonia.png new file mode 100644 index 0000000..e72842a Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/itemCellAmmonia.png differ diff --git a/src/main/java/assets/ihl/textures/items/itemCellAquaRegia.png b/src/main/java/assets/ihl/textures/items/itemCellAquaRegia.png new file mode 100644 index 0000000..fce32c9 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/itemCellAquaRegia.png differ diff --git a/src/main/java/assets/ihl/textures/items/itemCellBlueVitriolDissolvedInWater.png b/src/main/java/assets/ihl/textures/items/itemCellBlueVitriolDissolvedInWater.png new file mode 100644 index 0000000..f0718dd Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/itemCellBlueVitriolDissolvedInWater.png differ diff --git a/src/main/java/assets/ihl/textures/items/itemCellCablingColophony.png b/src/main/java/assets/ihl/textures/items/itemCellCablingColophony.png new file mode 100644 index 0000000..0e980fd Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/itemCellCablingColophony.png differ diff --git a/src/main/java/assets/ihl/textures/items/itemCellChlorine.png b/src/main/java/assets/ihl/textures/items/itemCellChlorine.png new file mode 100644 index 0000000..fb6cb27 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/itemCellChlorine.png differ diff --git a/src/main/java/assets/ihl/textures/items/itemCellFuel.png b/src/main/java/assets/ihl/textures/items/itemCellFuel.png new file mode 100644 index 0000000..baa93b1 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/itemCellFuel.png differ diff --git a/src/main/java/assets/ihl/textures/items/itemCellFuelOil.png b/src/main/java/assets/ihl/textures/items/itemCellFuelOil.png new file mode 100644 index 0000000..b069caf Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/itemCellFuelOil.png differ diff --git a/src/main/java/assets/ihl/textures/items/itemCellGlycerol.png b/src/main/java/assets/ihl/textures/items/itemCellGlycerol.png new file mode 100644 index 0000000..b81ede2 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/itemCellGlycerol.png differ diff --git a/src/main/java/assets/ihl/textures/items/itemCellHydrogen.png b/src/main/java/assets/ihl/textures/items/itemCellHydrogen.png new file mode 100644 index 0000000..d18dd33 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/itemCellHydrogen.png differ diff --git a/src/main/java/assets/ihl/textures/items/itemCellHydrogenChloride.png b/src/main/java/assets/ihl/textures/items/itemCellHydrogenChloride.png new file mode 100644 index 0000000..a6b339b Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/itemCellHydrogenChloride.png differ diff --git a/src/main/java/assets/ihl/textures/items/itemCellLimemilk.png b/src/main/java/assets/ihl/textures/items/itemCellLimemilk.png new file mode 100644 index 0000000..0910e3d Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/itemCellLimemilk.png differ diff --git a/src/main/java/assets/ihl/textures/items/itemCellLiquidGlass.png b/src/main/java/assets/ihl/textures/items/itemCellLiquidGlass.png new file mode 100644 index 0000000..3f76416 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/itemCellLiquidGlass.png differ diff --git a/src/main/java/assets/ihl/textures/items/itemCellMercury.png b/src/main/java/assets/ihl/textures/items/itemCellMercury.png new file mode 100644 index 0000000..8e7d907 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/itemCellMercury.png differ diff --git a/src/main/java/assets/ihl/textures/items/itemCellMethanol.png b/src/main/java/assets/ihl/textures/items/itemCellMethanol.png new file mode 100644 index 0000000..c4a65c8 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/itemCellMethanol.png differ diff --git a/src/main/java/assets/ihl/textures/items/itemCellMineralOil.png b/src/main/java/assets/ihl/textures/items/itemCellMineralOil.png new file mode 100644 index 0000000..e6671ff Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/itemCellMineralOil.png differ diff --git a/src/main/java/assets/ihl/textures/items/itemCellMoltenBronze.png b/src/main/java/assets/ihl/textures/items/itemCellMoltenBronze.png new file mode 100644 index 0000000..79e7087 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/itemCellMoltenBronze.png differ diff --git a/src/main/java/assets/ihl/textures/items/itemCellMoltenSteel.png b/src/main/java/assets/ihl/textures/items/itemCellMoltenSteel.png new file mode 100644 index 0000000..b917b92 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/itemCellMoltenSteel.png differ diff --git a/src/main/java/assets/ihl/textures/items/itemCellNatriumHydroxideDissolvedInWater.png b/src/main/java/assets/ihl/textures/items/itemCellNatriumHydroxideDissolvedInWater.png new file mode 100644 index 0000000..01e7110 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/itemCellNatriumHydroxideDissolvedInWater.png differ diff --git a/src/main/java/assets/ihl/textures/items/itemCellNatriumTungstateDissolvedInWater.png b/src/main/java/assets/ihl/textures/items/itemCellNatriumTungstateDissolvedInWater.png new file mode 100644 index 0000000..107efe0 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/itemCellNatriumTungstateDissolvedInWater.png differ diff --git a/src/main/java/assets/ihl/textures/items/itemCellNickelSulfateDissolvedInWater.png b/src/main/java/assets/ihl/textures/items/itemCellNickelSulfateDissolvedInWater.png new file mode 100644 index 0000000..7dc971c Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/itemCellNickelSulfateDissolvedInWater.png differ diff --git a/src/main/java/assets/ihl/textures/items/itemCellNitricAcid.png b/src/main/java/assets/ihl/textures/items/itemCellNitricAcid.png new file mode 100644 index 0000000..52707ef Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/itemCellNitricAcid.png differ diff --git a/src/main/java/assets/ihl/textures/items/itemCellNitroGlycerin.png b/src/main/java/assets/ihl/textures/items/itemCellNitroGlycerin.png new file mode 100644 index 0000000..e631c59 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/itemCellNitroGlycerin.png differ diff --git a/src/main/java/assets/ihl/textures/items/itemCellNitrogen.png b/src/main/java/assets/ihl/textures/items/itemCellNitrogen.png new file mode 100644 index 0000000..95d427c Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/itemCellNitrogen.png differ diff --git a/src/main/java/assets/ihl/textures/items/itemCellOil.png b/src/main/java/assets/ihl/textures/items/itemCellOil.png new file mode 100644 index 0000000..c4c9a96 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/itemCellOil.png differ diff --git a/src/main/java/assets/ihl/textures/items/itemCellOleicAcid.png b/src/main/java/assets/ihl/textures/items/itemCellOleicAcid.png new file mode 100644 index 0000000..6e2b834 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/itemCellOleicAcid.png differ diff --git a/src/main/java/assets/ihl/textures/items/itemCellOsmiumTetroxide.png b/src/main/java/assets/ihl/textures/items/itemCellOsmiumTetroxide.png new file mode 100644 index 0000000..b3647fd Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/itemCellOsmiumTetroxide.png differ diff --git a/src/main/java/assets/ihl/textures/items/itemCellOxygen.png b/src/main/java/assets/ihl/textures/items/itemCellOxygen.png new file mode 100644 index 0000000..75c7068 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/itemCellOxygen.png differ diff --git a/src/main/java/assets/ihl/textures/items/itemCellSaltWater.png b/src/main/java/assets/ihl/textures/items/itemCellSaltWater.png new file mode 100644 index 0000000..9076c38 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/itemCellSaltWater.png differ diff --git a/src/main/java/assets/ihl/textures/items/itemCellSeedOil.png b/src/main/java/assets/ihl/textures/items/itemCellSeedOil.png new file mode 100644 index 0000000..db14ebd Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/itemCellSeedOil.png differ diff --git a/src/main/java/assets/ihl/textures/items/itemCellSiliconTetrachloride.png b/src/main/java/assets/ihl/textures/items/itemCellSiliconTetrachloride.png new file mode 100644 index 0000000..a83aae3 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/itemCellSiliconTetrachloride.png differ diff --git a/src/main/java/assets/ihl/textures/items/itemCellSodiumPeroxide.png b/src/main/java/assets/ihl/textures/items/itemCellSodiumPeroxide.png new file mode 100644 index 0000000..804d86f Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/itemCellSodiumPeroxide.png differ diff --git a/src/main/java/assets/ihl/textures/items/itemCellSpruceResin.png b/src/main/java/assets/ihl/textures/items/itemCellSpruceResin.png new file mode 100644 index 0000000..9dcd62b Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/itemCellSpruceResin.png differ diff --git a/src/main/java/assets/ihl/textures/items/itemCellSulfuricAcid.png b/src/main/java/assets/ihl/textures/items/itemCellSulfuricAcid.png new file mode 100644 index 0000000..b46e69e Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/itemCellSulfuricAcid.png differ diff --git a/src/main/java/assets/ihl/textures/items/itemCellSulfuricAnhydride.png b/src/main/java/assets/ihl/textures/items/itemCellSulfuricAnhydride.png new file mode 100644 index 0000000..9b27ac0 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/itemCellSulfuricAnhydride.png differ diff --git a/src/main/java/assets/ihl/textures/items/itemCellTrichlorosilane.png b/src/main/java/assets/ihl/textures/items/itemCellTrichlorosilane.png new file mode 100644 index 0000000..4d5d965 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/itemCellTrichlorosilane.png differ diff --git a/src/main/java/assets/ihl/textures/items/itemCellTurpentine.png b/src/main/java/assets/ihl/textures/items/itemCellTurpentine.png new file mode 100644 index 0000000..ef3a32f Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/itemCellTurpentine.png differ diff --git a/src/main/java/assets/ihl/textures/items/itemCellVapourSulfuricAcid.png b/src/main/java/assets/ihl/textures/items/itemCellVapourSulfuricAcid.png new file mode 100644 index 0000000..a521cd9 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/itemCellVapourSulfuricAcid.png differ diff --git a/src/main/java/assets/ihl/textures/items/itemCellfluidRubberTreeSap.png b/src/main/java/assets/ihl/textures/items/itemCellfluidRubberTreeSap.png new file mode 100644 index 0000000..2c7394e Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/itemCellfluidRubberTreeSap.png differ diff --git a/src/main/java/assets/ihl/textures/items/itemElectricHandpump.png b/src/main/java/assets/ihl/textures/items/itemElectricHandpump.png new file mode 100644 index 0000000..f48271d Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/itemElectricHandpump.png differ diff --git a/src/main/java/assets/ihl/textures/items/itemTDITFT.png b/src/main/java/assets/ihl/textures/items/itemTDITFT.png new file mode 100644 index 0000000..6694a84 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/itemTDITFT.png differ diff --git a/src/main/java/assets/ihl/textures/items/itemTDITFT_1.png b/src/main/java/assets/ihl/textures/items/itemTDITFT_1.png new file mode 100644 index 0000000..5b9388d Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/itemTDITFT_1.png differ diff --git a/src/main/java/assets/ihl/textures/items/lampHolderPorcelain.png b/src/main/java/assets/ihl/textures/items/lampHolderPorcelain.png new file mode 100644 index 0000000..baadf3b Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/lampHolderPorcelain.png differ diff --git a/src/main/java/assets/ihl/textures/items/lampHolderRawPorcelain.png b/src/main/java/assets/ihl/textures/items/lampHolderRawPorcelain.png new file mode 100644 index 0000000..7fa3bc4 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/lampHolderRawPorcelain.png differ diff --git a/src/main/java/assets/ihl/textures/items/latheSetOfMoldedPartsSteel.png b/src/main/java/assets/ihl/textures/items/latheSetOfMoldedPartsSteel.png new file mode 100644 index 0000000..8316b3d Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/latheSetOfMoldedPartsSteel.png differ diff --git a/src/main/java/assets/ihl/textures/items/leadAcidBattery.png b/src/main/java/assets/ihl/textures/items/leadAcidBattery.png new file mode 100644 index 0000000..7f87b06 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/leadAcidBattery.png differ diff --git a/src/main/java/assets/ihl/textures/items/linerIronGraphite.png b/src/main/java/assets/ihl/textures/items/linerIronGraphite.png new file mode 100644 index 0000000..ca8abb4 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/linerIronGraphite.png differ diff --git a/src/main/java/assets/ihl/textures/items/linerIronGraphiteGreased.png b/src/main/java/assets/ihl/textures/items/linerIronGraphiteGreased.png new file mode 100644 index 0000000..fa0ea9b Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/linerIronGraphiteGreased.png differ diff --git a/src/main/java/assets/ihl/textures/items/linerIronGraphiteHot.png b/src/main/java/assets/ihl/textures/items/linerIronGraphiteHot.png new file mode 100644 index 0000000..7bf3491 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/linerIronGraphiteHot.png differ diff --git a/src/main/java/assets/ihl/textures/items/machineCasingSetOfPartsSteel.png b/src/main/java/assets/ihl/textures/items/machineCasingSetOfPartsSteel.png new file mode 100644 index 0000000..b454e3c Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/machineCasingSetOfPartsSteel.png differ diff --git a/src/main/java/assets/ihl/textures/items/mercuryThermometer.png b/src/main/java/assets/ihl/textures/items/mercuryThermometer.png new file mode 100644 index 0000000..3b23b11 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/mercuryThermometer.png differ diff --git a/src/main/java/assets/ihl/textures/items/meshGlass.png b/src/main/java/assets/ihl/textures/items/meshGlass.png new file mode 100644 index 0000000..8a0bcfd Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/meshGlass.png differ diff --git a/src/main/java/assets/ihl/textures/items/mixerSteel.png b/src/main/java/assets/ihl/textures/items/mixerSteel.png new file mode 100644 index 0000000..a0baf8c Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/mixerSteel.png differ diff --git a/src/main/java/assets/ihl/textures/items/muttonLard.png b/src/main/java/assets/ihl/textures/items/muttonLard.png new file mode 100644 index 0000000..e127b94 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/muttonLard.png differ diff --git a/src/main/java/assets/ihl/textures/items/nailSteel.png b/src/main/java/assets/ihl/textures/items/nailSteel.png new file mode 100644 index 0000000..86f080a Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/nailSteel.png differ diff --git a/src/main/java/assets/ihl/textures/items/needleFile.png b/src/main/java/assets/ihl/textures/items/needleFile.png new file mode 100644 index 0000000..add7eea Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/needleFile.png differ diff --git a/src/main/java/assets/ihl/textures/items/nuggetTarPitch.png b/src/main/java/assets/ihl/textures/items/nuggetTarPitch.png new file mode 100644 index 0000000..15a1764 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/nuggetTarPitch.png differ diff --git a/src/main/java/assets/ihl/textures/items/nutM10x1Steel.png b/src/main/java/assets/ihl/textures/items/nutM10x1Steel.png new file mode 100644 index 0000000..372e7f5 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/nutM10x1Steel.png differ diff --git a/src/main/java/assets/ihl/textures/items/ovenRawPorcelain.png b/src/main/java/assets/ihl/textures/items/ovenRawPorcelain.png new file mode 100644 index 0000000..83c6881 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/ovenRawPorcelain.png differ diff --git a/src/main/java/assets/ihl/textures/items/pencil.png b/src/main/java/assets/ihl/textures/items/pencil.png new file mode 100644 index 0000000..e2e85d3 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/pencil.png differ diff --git a/src/main/java/assets/ihl/textures/items/pipeRubberWithSulfur.png b/src/main/java/assets/ihl/textures/items/pipeRubberWithSulfur.png new file mode 100644 index 0000000..99954af Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/pipeRubberWithSulfur.png differ diff --git a/src/main/java/assets/ihl/textures/items/pipeVulcanizedRubber.png b/src/main/java/assets/ihl/textures/items/pipeVulcanizedRubber.png new file mode 100644 index 0000000..0c801ba Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/pipeVulcanizedRubber.png differ diff --git a/src/main/java/assets/ihl/textures/items/pipelineAccessoriesSteel.png b/src/main/java/assets/ihl/textures/items/pipelineAccessoriesSteel.png new file mode 100644 index 0000000..b872acb Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/pipelineAccessoriesSteel.png differ diff --git a/src/main/java/assets/ihl/textures/items/pistonCylinderSteel.png b/src/main/java/assets/ihl/textures/items/pistonCylinderSteel.png new file mode 100644 index 0000000..f047d6f Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/pistonCylinderSteel.png differ diff --git a/src/main/java/assets/ihl/textures/items/plateCoal.png b/src/main/java/assets/ihl/textures/items/plateCoal.png new file mode 100644 index 0000000..e1a65bf Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/plateCoal.png differ diff --git a/src/main/java/assets/ihl/textures/items/plateGraphite.png b/src/main/java/assets/ihl/textures/items/plateGraphite.png new file mode 100644 index 0000000..ac31496 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/plateGraphite.png differ diff --git a/src/main/java/assets/ihl/textures/items/plateHotSteel.png b/src/main/java/assets/ihl/textures/items/plateHotSteel.png new file mode 100644 index 0000000..47e8972 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/plateHotSteel.png differ diff --git a/src/main/java/assets/ihl/textures/items/plateHotTungsten.png b/src/main/java/assets/ihl/textures/items/plateHotTungsten.png new file mode 100644 index 0000000..3375701 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/plateHotTungsten.png differ diff --git a/src/main/java/assets/ihl/textures/items/plateMica.png b/src/main/java/assets/ihl/textures/items/plateMica.png new file mode 100644 index 0000000..4e7b85f Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/plateMica.png differ diff --git a/src/main/java/assets/ihl/textures/items/plateNonVulcanizedRubber.png b/src/main/java/assets/ihl/textures/items/plateNonVulcanizedRubber.png new file mode 100644 index 0000000..a24cd70 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/plateNonVulcanizedRubber.png differ diff --git a/src/main/java/assets/ihl/textures/items/plateRawCoal.png b/src/main/java/assets/ihl/textures/items/plateRawCoal.png new file mode 100644 index 0000000..0fd2fdc Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/plateRawCoal.png differ diff --git a/src/main/java/assets/ihl/textures/items/plateTungsten.png b/src/main/java/assets/ihl/textures/items/plateTungsten.png new file mode 100644 index 0000000..7191925 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/plateTungsten.png differ diff --git a/src/main/java/assets/ihl/textures/items/polishingPucksSteel.png b/src/main/java/assets/ihl/textures/items/polishingPucksSteel.png new file mode 100644 index 0000000..23c5e79 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/polishingPucksSteel.png differ diff --git a/src/main/java/assets/ihl/textures/items/ringFerrite.png b/src/main/java/assets/ihl/textures/items/ringFerrite.png new file mode 100644 index 0000000..65a5753 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/ringFerrite.png differ diff --git a/src/main/java/assets/ihl/textures/items/ringPorcelain.png b/src/main/java/assets/ihl/textures/items/ringPorcelain.png new file mode 100644 index 0000000..5be8ab2 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/ringPorcelain.png differ diff --git a/src/main/java/assets/ihl/textures/items/ringRawFerrite.png b/src/main/java/assets/ihl/textures/items/ringRawFerrite.png new file mode 100644 index 0000000..894c0eb Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/ringRawFerrite.png differ diff --git a/src/main/java/assets/ihl/textures/items/ringRawPorcelain.png b/src/main/java/assets/ihl/textures/items/ringRawPorcelain.png new file mode 100644 index 0000000..eccb8b2 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/ringRawPorcelain.png differ diff --git a/src/main/java/assets/ihl/textures/items/rollingMachineSetOfMoldedPartsSteel.png b/src/main/java/assets/ihl/textures/items/rollingMachineSetOfMoldedPartsSteel.png new file mode 100644 index 0000000..3e280fc Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/rollingMachineSetOfMoldedPartsSteel.png differ diff --git a/src/main/java/assets/ihl/textures/items/sawBladeSteel.png b/src/main/java/assets/ihl/textures/items/sawBladeSteel.png new file mode 100644 index 0000000..cfdfb22 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/sawBladeSteel.png differ diff --git a/src/main/java/assets/ihl/textures/items/sawBladeSteelHardened.png b/src/main/java/assets/ihl/textures/items/sawBladeSteelHardened.png new file mode 100644 index 0000000..8b8adf6 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/sawBladeSteelHardened.png differ diff --git a/src/main/java/assets/ihl/textures/items/sawBladeSteelHot.png b/src/main/java/assets/ihl/textures/items/sawBladeSteelHot.png new file mode 100644 index 0000000..0d99920 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/sawBladeSteelHot.png differ diff --git a/src/main/java/assets/ihl/textures/items/setOfDies1_5sqmm.png b/src/main/java/assets/ihl/textures/items/setOfDies1_5sqmm.png new file mode 100644 index 0000000..4b18add Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/setOfDies1_5sqmm.png differ diff --git a/src/main/java/assets/ihl/textures/items/setOfDies24sqmm.png b/src/main/java/assets/ihl/textures/items/setOfDies24sqmm.png new file mode 100644 index 0000000..eedad12 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/setOfDies24sqmm.png differ diff --git a/src/main/java/assets/ihl/textures/items/setOfFilesSteel.png b/src/main/java/assets/ihl/textures/items/setOfFilesSteel.png new file mode 100644 index 0000000..4f8bcaf Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/setOfFilesSteel.png differ diff --git a/src/main/java/assets/ihl/textures/items/setOfPartsForLVElemotorSteel.png b/src/main/java/assets/ihl/textures/items/setOfPartsForLVElemotorSteel.png new file mode 100644 index 0000000..47c0bf1 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/setOfPartsForLVElemotorSteel.png differ diff --git a/src/main/java/assets/ihl/textures/items/setOfPartsGasReducerSteel.png b/src/main/java/assets/ihl/textures/items/setOfPartsGasReducerSteel.png new file mode 100644 index 0000000..b020756 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/setOfPartsGasReducerSteel.png differ diff --git a/src/main/java/assets/ihl/textures/items/shaftSteel.png b/src/main/java/assets/ihl/textures/items/shaftSteel.png new file mode 100644 index 0000000..6882408 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/shaftSteel.png differ diff --git a/src/main/java/assets/ihl/textures/items/sharpenedCarvingKnifeBronze.png b/src/main/java/assets/ihl/textures/items/sharpenedCarvingKnifeBronze.png new file mode 100644 index 0000000..628ca32 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/sharpenedCarvingKnifeBronze.png differ diff --git a/src/main/java/assets/ihl/textures/items/skull.png b/src/main/java/assets/ihl/textures/items/skull.png new file mode 100644 index 0000000..811c694 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/skull.png differ diff --git a/src/main/java/assets/ihl/textures/items/smallRoundPolishedSteel.png b/src/main/java/assets/ihl/textures/items/smallRoundPolishedSteel.png new file mode 100644 index 0000000..bd74daa Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/smallRoundPolishedSteel.png differ diff --git a/src/main/java/assets/ihl/textures/items/smallRoundSteel.png b/src/main/java/assets/ihl/textures/items/smallRoundSteel.png new file mode 100644 index 0000000..d07c73d Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/smallRoundSteel.png differ diff --git a/src/main/java/assets/ihl/textures/items/springSteel.png b/src/main/java/assets/ihl/textures/items/springSteel.png new file mode 100644 index 0000000..149ea88 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/springSteel.png differ diff --git a/src/main/java/assets/ihl/textures/items/steelWire.png b/src/main/java/assets/ihl/textures/items/steelWire.png new file mode 100644 index 0000000..de6c997 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/steelWire.png differ diff --git a/src/main/java/assets/ihl/textures/items/steelWire16x.png b/src/main/java/assets/ihl/textures/items/steelWire16x.png new file mode 100644 index 0000000..57ddd6e Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/steelWire16x.png differ diff --git a/src/main/java/assets/ihl/textures/items/stickBoronCarbide.png b/src/main/java/assets/ihl/textures/items/stickBoronCarbide.png new file mode 100644 index 0000000..ea283e9 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/stickBoronCarbide.png differ diff --git a/src/main/java/assets/ihl/textures/items/stickCoal.png b/src/main/java/assets/ihl/textures/items/stickCoal.png new file mode 100644 index 0000000..38ec356 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/stickCoal.png differ diff --git a/src/main/java/assets/ihl/textures/items/stickCoalElectrodePremix.png b/src/main/java/assets/ihl/textures/items/stickCoalElectrodePremix.png new file mode 100644 index 0000000..28801fc Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/stickCoalElectrodePremix.png differ diff --git a/src/main/java/assets/ihl/textures/items/stickGraphite.png b/src/main/java/assets/ihl/textures/items/stickGraphite.png new file mode 100644 index 0000000..22b70eb Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/stickGraphite.png differ diff --git a/src/main/java/assets/ihl/textures/items/stickSteel.png b/src/main/java/assets/ihl/textures/items/stickSteel.png new file mode 100644 index 0000000..372e804 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/stickSteel.png differ diff --git a/src/main/java/assets/ihl/textures/items/tapM10x1Steel.png b/src/main/java/assets/ihl/textures/items/tapM10x1Steel.png new file mode 100644 index 0000000..c1583a3 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/tapM10x1Steel.png differ diff --git a/src/main/java/assets/ihl/textures/items/tapM10x1SteelHardened.png b/src/main/java/assets/ihl/textures/items/tapM10x1SteelHardened.png new file mode 100644 index 0000000..41b0589 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/tapM10x1SteelHardened.png differ diff --git a/src/main/java/assets/ihl/textures/items/tapM10x1SteelHot.png b/src/main/java/assets/ihl/textures/items/tapM10x1SteelHot.png new file mode 100644 index 0000000..f8db0d1 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/tapM10x1SteelHot.png differ diff --git a/src/main/java/assets/ihl/textures/items/tapS10x2Steel.png b/src/main/java/assets/ihl/textures/items/tapS10x2Steel.png new file mode 100644 index 0000000..058c7db Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/tapS10x2Steel.png differ diff --git a/src/main/java/assets/ihl/textures/items/tinSnipsSteel.png b/src/main/java/assets/ihl/textures/items/tinSnipsSteel.png new file mode 100644 index 0000000..742e143 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/tinSnipsSteel.png differ diff --git a/src/main/java/assets/ihl/textures/items/toolHeadHammerSmallSteel.png b/src/main/java/assets/ihl/textures/items/toolHeadHammerSmallSteel.png new file mode 100644 index 0000000..58743a8 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/toolHeadHammerSmallSteel.png differ diff --git a/src/main/java/assets/ihl/textures/items/toolTinSnipsPartsSteel.png b/src/main/java/assets/ihl/textures/items/toolTinSnipsPartsSteel.png new file mode 100644 index 0000000..d80d37f Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/toolTinSnipsPartsSteel.png differ diff --git a/src/main/java/assets/ihl/textures/items/turboCompressorSetOfMoldedPartsBronze.png b/src/main/java/assets/ihl/textures/items/turboCompressorSetOfMoldedPartsBronze.png new file mode 100644 index 0000000..1337198 Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/turboCompressorSetOfMoldedPartsBronze.png differ diff --git a/src/main/java/assets/ihl/textures/items/vacuumSwitch.png b/src/main/java/assets/ihl/textures/items/vacuumSwitch.png new file mode 100644 index 0000000..78486be Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/vacuumSwitch.png differ diff --git a/src/main/java/assets/ihl/textures/items/valveTube1C21P.png b/src/main/java/assets/ihl/textures/items/valveTube1C21P.png new file mode 100644 index 0000000..6418c5e Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/valveTube1C21P.png differ diff --git a/src/main/java/assets/ihl/textures/items/viseSetOfMoldedPartsSteel.png b/src/main/java/assets/ihl/textures/items/viseSetOfMoldedPartsSteel.png new file mode 100644 index 0000000..43cbf3f Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/viseSetOfMoldedPartsSteel.png differ diff --git a/src/main/java/assets/ihl/textures/items/viseSteel.png b/src/main/java/assets/ihl/textures/items/viseSteel.png new file mode 100644 index 0000000..b9f1bdf Binary files /dev/null and b/src/main/java/assets/ihl/textures/items/viseSteel.png differ diff --git a/src/main/java/assets/ihl/textures/particles/blast.png b/src/main/java/assets/ihl/textures/particles/blast.png new file mode 100644 index 0000000..9d20194 Binary files /dev/null and b/src/main/java/assets/ihl/textures/particles/blast.png differ diff --git a/src/main/java/assets/ihl/textures/particles/blob.png b/src/main/java/assets/ihl/textures/particles/blob.png new file mode 100644 index 0000000..765e7e7 Binary files /dev/null and b/src/main/java/assets/ihl/textures/particles/blob.png differ diff --git a/src/main/java/assets/ihl/textures/particles/blobOfResin.png b/src/main/java/assets/ihl/textures/particles/blobOfResin.png new file mode 100644 index 0000000..35f76b7 Binary files /dev/null and b/src/main/java/assets/ihl/textures/particles/blobOfResin.png differ diff --git a/src/main/java/assets/ihl/textures/particles/explosion.png b/src/main/java/assets/ihl/textures/particles/explosion.png new file mode 100644 index 0000000..3e75fab Binary files /dev/null and b/src/main/java/assets/ihl/textures/particles/explosion.png differ diff --git a/src/main/java/assets/ihl/textures/particles/flameTongue.png b/src/main/java/assets/ihl/textures/particles/flameTongue.png new file mode 100644 index 0000000..8c97def Binary files /dev/null and b/src/main/java/assets/ihl/textures/particles/flameTongue.png differ diff --git a/src/main/java/gregtech/api/GregTech_API.java b/src/main/java/gregtech/api/GregTech_API.java new file mode 100644 index 0000000..832f179 --- /dev/null +++ b/src/main/java/gregtech/api/GregTech_API.java @@ -0,0 +1,577 @@ +package gregtech.api; + +import static gregtech.api.enums.GT_Values.B; +import static gregtech.api.enums.GT_Values.F; +import static gregtech.api.enums.GT_Values.L; +import static gregtech.api.enums.GT_Values.M; +import static gregtech.api.enums.GT_Values.MOD_ID_IC2; +import static gregtech.api.enums.GT_Values.T; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.Materials; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.IDamagableItem; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.internal.IGT_RecipeAdder; +import gregtech.api.interfaces.internal.IThaumcraftCompat; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.items.GT_CoolantCellIC_Item; +import gregtech.api.items.GT_CoolantCell_Item; +import gregtech.api.items.GT_Tool_Item; +import gregtech.api.metatileentity.BaseMetaTileEntity; +import gregtech.api.objects.GT_Cover_Default; +import gregtech.api.objects.GT_Cover_None; +import gregtech.api.objects.GT_HashSet; +import gregtech.api.objects.GT_ItemStack; +import gregtech.api.threads.GT_Runnable_MachineBlockUpdate; +import gregtech.api.util.GT_CircuitryBehavior; +import gregtech.api.util.GT_Config; +import gregtech.api.util.GT_CoverBehavior; +import gregtech.api.util.GT_Log; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Utility; +import gregtech.api.world.GT_Worldgen; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.fluids.Fluid; + +/** + * Please do not include this File in your Mod-download as it ruins compatiblity, like with the IC2-API + * You may just copy those Functions into your Code, or better call them via reflection. + * + * The whole API is the basic construct of my Mod. Everything is dependent on it. + * I change things quite often so please don't include any File inside your Mod, even if it is an Interface. + * Since some Authors were stupid enough to break this simple Rule, I added Version checks to enforce it. + * + * In these Folders are many useful Functions. You can use them via reflection if you want. + * I know not everything is compilable due to API's of other Mods, but these are easy to fix in your Setup. + * + * You can use this to learn about Modding, but I would recommend simpler Mods. + * You may even copypaste Code from these API-Files into your Mod, as I have nothing against that, but you should look exactly at what you are copying. + * + * @author Gregorius Techneticies + */ +public class GregTech_API { + /** For the API Version check */ + public static volatile int VERSION = 508; + + @Deprecated + public static IGT_RecipeAdder sRecipeAdder; + + @Deprecated + public static final long MATERIAL_UNIT = M, FLUID_MATERIAL_UNIT = L; + + /** Used to register Aspects to ThaumCraft, this Object might be null if ThaumCraft isn't installed */ + public static IThaumcraftCompat sThaumcraftCompat; + + /** These Lists are getting executed at their respective timings. Useful if you have to do things right before/after I do them, without having to control the load order. Add your "Commands" in the Constructor or in a static Code Block of your Mods Main Class. These are not Threaded, I just use a native Java Interface for their execution. Implement just the Method run() and everything should work */ + public static List sBeforeGTPreload = new ArrayList(), sAfterGTPreload = new ArrayList(), sBeforeGTLoad = new ArrayList(), sAfterGTLoad = new ArrayList(), sBeforeGTPostload = new ArrayList(), sAfterGTPostload = new ArrayList(), sBeforeGTServerstart = new ArrayList(), sAfterGTServerstart = new ArrayList(), sBeforeGTServerstop = new ArrayList(), sAfterGTServerstop = new ArrayList(), sGTBlockIconload = new ArrayList(), sGTItemIconload = new ArrayList(); + + /** Fixes the HashMap Mappings for ItemStacks once the Server started */ + public static final Collection> sItemStackMappings = new ArrayList>(); + public static final Collection> sFluidMappings = new ArrayList>(); + + /** The Icon Registers from Blocks and Items. They will get set right before the corresponding Icon Load Phase as executed in the Runnable List above. */ + @SideOnly(Side.CLIENT) + public static IIconRegister sBlockIcons, sItemIcons; + + /** The Configuration Objects */ + public static GT_Config sRecipeFile = null, sMachineFile = null, sWorldgenFile = null, sMaterialProperties = null, sUnification = null, sSpecialFile = null, sClientDataFile, sOPStuff = null; + + /** The MetaTileEntity-ID-List-Length */ + public static final short MAXIMUM_METATILE_IDS = Short.MAX_VALUE - 1; + + public static int TICKS_FOR_LAG_AVERAGING = 25, MILLISECOND_THRESHOLD_UNTIL_LAG_WARNING = 100; + + /** + * A List of all registered MetaTileEntities + * + * 0 - 1199 are used by GregTech. + * 1200 - 2047 are used for GregTech Cables. + * 2048 - 2559 are reserved for OvermindDL. + * 2560 - 3071 are reserved for Immibis. + * 3072 - 3583 are reserved for LinusPhoenix. + * 3584 - 4095 are reserved for BloodyAsp. + * 4096 - 5095 are used for GregTech Frames. + * 5096 - 6099 are used for GregTech Pipes. + * 6100 - 8191 are used for GregTech Decoration Blocks. + * 8192 - 8703 are reserved for ZL123. + * 8704 - 9215 are reserved for Mr10Movie. + * 9216 - 9727 are used for GregTech Automation Machines. + * 9728 - 10239 are reserved for 28Smiles. + * 10240 - 10751 are reserved for VirMan. + * 10752 - 11263 are reserved for the next one who asks me. + * 9728 - 32766 are currently free. + * + * Contact me if you need a free ID-Range, which doesn't conflict with other Addons. + * You could make an ID-Config, but we all know, what "stupid" customers think about conflicting ID's + */ + public static final IMetaTileEntity[] METATILEENTITIES = new IMetaTileEntity[MAXIMUM_METATILE_IDS]; + + /** Initialized by the Block creation. */ + public static Block sBlockMachines; + public static Block sBlockOres1; + public static Block sBlockGranites, sBlockConcretes; + public static Block sBlockCasings1, sBlockCasings2, sBlockCasings3, sBlockCasings4; + + /** Getting assigned by the Config */ + public static boolean sTimber = F, sDrinksAlwaysDrinkable = F, sMultiThreadedSounds = F, sDoShowAllItemsInCreative = F, sColoredGUI = T, sConstantEnergy = T, sMachineExplosions = T, sMachineFlammable = T, sMachineNonWrenchExplosions = T, sMachineRainExplosions = T, sMachineThunderExplosions = T, sMachineFireExplosions = T, sMachineWireFire = true; + public static boolean mOutputRF =false; + public static boolean mInputRF =false; + public static int mEUtoRF = 360; + public static int mRFtoEU = 20; + public static boolean mRFExplosions = true; + + /** Getting assigned by the Mod loading */ + public static boolean sUnificationEntriesRegistered = F, sPreloadStarted = F, sPreloadFinished = F, sLoadStarted = F, sLoadFinished = F, sPostloadStarted = F, sPostloadFinished = F; + + /** The Icon List for Covers */ + public static final Map sCovers = new HashMap(); + + /** The List of Cover Behaviors for the Covers */ + public static final Map sCoverBehaviors = new HashMap(); + + /** The List of Circuit Behaviors for the Redstone Circuit Block */ + public static final Map sCircuitryBehaviors = new HashMap(); + + /** The List of Blocks, which can conduct Machine Block Updates */ + public static final Map sMachineIDs = new HashMap(); + + /** The Redstone Frequencies */ + public static final Map sWirelessRedstone = new HashMap(); + + /** The IDSU Frequencies */ + public static final Map sIDSUList = new HashMap(); + + /** A List of all Books, which were created using @GT_Utility.getWrittenBook the original Title is the Key Value */ + public static final Map sBookList = new HashMap(); + + /** The List of all Sounds used in GT, indices are in the static Block at the bottom */ + public static final Map sSoundList = new HashMap(); + + /** The List of Tools, which can be used. Accepts regular damageable Items and Electric Items */ + public static final GT_HashSet sToolList = new GT_HashSet(), sCrowbarList = new GT_HashSet(), sScrewdriverList = new GT_HashSet(), sWrenchList = new GT_HashSet(), sSoftHammerList = new GT_HashSet(), sHardHammerList = new GT_HashSet(), sSolderingToolList = new GT_HashSet(), sSolderingMetalList = new GT_HashSet(); + /** The List of Hazmat Armors */ + public static final GT_HashSet sGasHazmatList = new GT_HashSet(), sBioHazmatList = new GT_HashSet(), sFrostHazmatList = new GT_HashSet(), sHeatHazmatList = new GT_HashSet(), sRadioHazmatList = new GT_HashSet(), sElectroHazmatList = new GT_HashSet(); + + /** + * The List of Dimensions, which are Whitelisted for the Teleporter. This list should not contain other Planets. + * Mystcraft Dimensions and other Dimensional Things should be allowed. + * Mystcraft and Twilight Forest are automatically considered a Dimension, without being in this List. + */ + public static final Collection sDimensionalList = new HashSet(); + + /** Lists of all the active World generation Features, these are getting Initialized in Postload! */ + public static final List sWorldgenList = new ArrayList(); + + /** A List containing all the Materials, which are somehow in use by GT and therefor receive a specific Set of Items. */ + public static final Materials[] sGeneratedMaterials = new Materials[1000]; + + /** + * You want OreDict-Unification for YOUR Mod/Addon, when GregTech is installed? This Function is especially for YOU. + * Call this Function after the load-Phase, as I register the the most of the Unification at that Phase (Redpowers Storageblocks are registered at postload). + * A recommended use of this Function is inside your Recipe-System itself (if you have one), as the unification then makes 100% sure, that every added non-unificated Output gets automatically unificated. + * + * I will personally make sure, that only common prefixes of Ores get registered at the Unificator, as of now there are: + * pulp, dust, dustSmall, ingot, nugget, gem, ore and block + * If another Mod-Author messes these up, then it's not my fault and it's especially not your fault. As these are commonly used prefixes. + * + * This Unificator-API-Function uses the same Functions I use, for unificating Items. So if there is something messed up (very unlikely), then everything is messed up. + * + * You shouldn't use this to unificate the Inputs of your Recipes, this is only meant for the Outputs. + * + * @param aOreStack the Stack you want to get unificated. It is stackSize Sensitive. + * @return Either an unificated Stack or the stack you toss in, but it should never be null, unless you throw a Nullpointer into it. + */ + public static ItemStack getUnificatedOreDictStack(ItemStack aOreStack) { + if (!GregTech_API.sPreloadFinished) GT_Log.err.println("GregTech_API ERROR: " + aOreStack.getItem() + "." + aOreStack.getItemDamage() + " - OreDict Unification Entries are not registered now, please call it in the postload phase."); + return GT_OreDictUnificator.get(T, aOreStack); + } + + /** + * Causes a Machineblock Update + * This update will cause surrounding MultiBlock Machines to update their Configuration. + * You should call this Function in @Block.breakBlock and in @Block.onBlockAdded of your Machine. + * @param aWorld is being the World + * @param aX is the X-Coord of the update causing Block + * @param aY is the Y-Coord of the update causing Block + * @param aZ is the Z-Coord of the update causing Block + */ + public static boolean causeMachineUpdate(World aWorld, int aX, int aY, int aZ) { + if (!aWorld.isRemote) new Thread(new GT_Runnable_MachineBlockUpdate(aWorld, aX, aY, aZ), "Machine Block Updating").start(); + return T; + } + + /** + * Adds a Multi-Machine Block, like my Machine Casings for example. + * You should call @causeMachineUpdate in @Block.breakBlock and in @Block.onBlockAdded of your registered Block. + * You don't need to register TileEntities which implement @IMachineBlockUpdateable + * @param aID the ID of your Block + * @param aMeta the Metadata of the Blocks as Bitmask! -1 or ~0 for all Metavalues + */ + public static boolean registerMachineBlock(Block aBlock, int aMeta) { + if (GT_Utility.isBlockInvalid(aBlock)) return F; + if (GregTech_API.sThaumcraftCompat != null) GregTech_API.sThaumcraftCompat.registerPortholeBlacklistedBlock(aBlock); + sMachineIDs.put(aBlock, aMeta); + return T; + } + + /** + * Like above but with boolean Parameters instead of a BitMask + */ + public static boolean registerMachineBlock(Block aBlock, boolean... aMeta) { + if (GT_Utility.isBlockInvalid(aBlock) || aMeta == null || aMeta.length == 0) return F; + if (GregTech_API.sThaumcraftCompat != null) GregTech_API.sThaumcraftCompat.registerPortholeBlacklistedBlock(aBlock); + int rMeta = 0; + for (byte i = 0; i < aMeta.length && i < 16; i++) if (aMeta[i]) rMeta |= B[i]; + sMachineIDs.put(aBlock, rMeta); + return T; + } + + /** + * if this Block is a Machine Update Conducting Block + */ + public static boolean isMachineBlock(Block aBlock, int aMeta) { + if (GT_Utility.isBlockInvalid(aBlock)) return F; + return (sMachineIDs.containsKey(aBlock) && (sMachineIDs.get(aBlock) & B[aMeta]) != 0); + } + + /** + * Creates a new Coolant Cell Item for your Nuclear Reactor + */ + public static Item constructCoolantCellItem(String aUnlocalized, String aEnglish, int aMaxStore) { + try { + return new GT_CoolantCellIC_Item(aUnlocalized, aEnglish, aMaxStore); +// return (Item)Class.forName("gregtech.api.items.GT_CoolantCellIC_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxStore); + } catch(Throwable e) {/*Do nothing*/} + try { + return new GT_CoolantCell_Item(aUnlocalized, aEnglish, aMaxStore); +// return (Item)Class.forName("gregtech.api.items.GT_CoolantCell_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxStore); + } catch(Throwable e) {/*Do nothing*/} + return new gregtech.api.items.GT_Generic_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", F); + } + + /** + * Creates a new Energy Armor Item + */ + public static Item constructElectricArmorItem(String aUnlocalized, String aEnglish, int aCharge, int aTransfer, int aTier, int aDamageEnergyCost, int aSpecials, double aArmorAbsorbtionPercentage, boolean aChargeProvider, int aType, int aArmorIndex) { + try { + return (Item)Class.forName("gregtechmod.api.items.GT_EnergyArmorIC_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aCharge, aTransfer, aTier, aDamageEnergyCost, aSpecials, aArmorAbsorbtionPercentage, aChargeProvider, aType, aArmorIndex); + } catch(Throwable e) {/*Do nothing*/} + try { + return (Item)Class.forName("gregtechmod.api.items.GT_EnergyArmor_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aCharge, aTransfer, aTier, aDamageEnergyCost, aSpecials, aArmorAbsorbtionPercentage, aChargeProvider, aType, aArmorIndex); + } catch(Throwable e) {/*Do nothing*/} + return new gregtech.api.items.GT_Generic_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", F); + } + + /** + * Creates a new Energy Battery Item + */ + public static Item constructElectricEnergyStorageItem(String aUnlocalized, String aEnglish, int aCharge, int aTransfer, int aTier, int aEmptyID, int aFullID) { + try { + return (Item)Class.forName("gregtechmod.api.items.GT_EnergyStoreIC_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aCharge, aTransfer, aTier, aEmptyID, aFullID); + } catch(Throwable e) {/*Do nothing*/} + try { + return (Item)Class.forName("gregtechmod.api.items.GT_EnergyStore_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aCharge, aTransfer, aTier, aEmptyID, aFullID); + } catch(Throwable e) {/*Do nothing*/} + return new gregtech.api.items.GT_Generic_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", F); + } + + /** + * Creates a new Hard Hammer Item + */ + public static GT_Tool_Item constructHardHammerItem(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage) { + try { + return (GT_Tool_Item)Class.forName("gregtechmod.api.items.GT_HardHammer_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage); + } catch(Throwable e) {/*Do nothing*/} + return new gregtech.api.items.GT_Tool_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", aMaxDamage, aEntityDamage, F); + } + + /** + * Creates a new Crowbar Item + */ + public static GT_Tool_Item constructCrowbarItem(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage) { + try { + return (GT_Tool_Item)Class.forName("gregtechmod.api.items.GT_CrowbarRC_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage); + } catch(Throwable e) {/*Do nothing*/} + try { + return (GT_Tool_Item)Class.forName("gregtechmod.api.items.GT_Crowbar_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage); + } catch(Throwable e) {/*Do nothing*/} + return new gregtech.api.items.GT_Tool_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", aMaxDamage, aEntityDamage, F); + } + + /** + * Creates a new Wrench Item + */ + public static GT_Tool_Item constructWrenchItem(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage, int aDisChargedGTID) { + try { + return (GT_Tool_Item)Class.forName("gregtechmod.api.items.GT_Wrench_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage, aDisChargedGTID); + } catch(Throwable e) {/*Do nothing*/} + return new gregtech.api.items.GT_Tool_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", aMaxDamage, aEntityDamage, F); + } + + /** + * Creates a new electric Screwdriver Item + */ + public static GT_Tool_Item constructElectricScrewdriverItem(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage, int aDisChargedGTID) { + try { + return (GT_Tool_Item)Class.forName("gregtechmod.api.items.GT_ScrewdriverIC_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage, aDisChargedGTID); + } catch(Throwable e) {/*Do nothing*/} + return new gregtech.api.items.GT_Tool_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", aMaxDamage, aEntityDamage, F); + } + + /** + * Creates a new electric Wrench Item + */ + public static GT_Tool_Item constructElectricWrenchItem(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage, int aDisChargedGTID) { + try { + return (GT_Tool_Item)Class.forName("gregtechmod.api.items.GT_WrenchIC_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage, aDisChargedGTID); + } catch(Throwable e) {/*Do nothing*/} + return new gregtech.api.items.GT_Tool_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", aMaxDamage, aEntityDamage, F); + } + + /** + * Creates a new electric Saw Item + */ + public static GT_Tool_Item constructElectricSawItem(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage, int aToolQuality, float aToolStrength, int aEnergyConsumptionPerBlockBreak, int aDisChargedGTID) { + try { + return (GT_Tool_Item)Class.forName("gregtechmod.api.items.GT_SawIC_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage, aToolQuality, aToolStrength, aEnergyConsumptionPerBlockBreak, aDisChargedGTID); + } catch(Throwable e) {/*Do nothing*/} + return new gregtech.api.items.GT_Tool_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", aMaxDamage, aEntityDamage, F); + } + + /** + * Creates a new electric Drill Item + */ + public static GT_Tool_Item constructElectricDrillItem(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage, int aToolQuality, float aToolStrength, int aEnergyConsumptionPerBlockBreak, int aDisChargedGTID) { + try { + return (GT_Tool_Item)Class.forName("gregtechmod.api.items.GT_DrillIC_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage, aToolQuality, aToolStrength, aEnergyConsumptionPerBlockBreak, aDisChargedGTID); + } catch(Throwable e) {/*Do nothing*/} + return new gregtech.api.items.GT_Tool_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", aMaxDamage, aEntityDamage, F); + } + + /** + * Creates a new electric Soldering Tool + */ + public static GT_Tool_Item constructElectricSolderingToolItem(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage, int aDisChargedGTID) { + try { + return (GT_Tool_Item)Class.forName("gregtechmod.api.items.GT_SolderingToolIC_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage, aDisChargedGTID); + } catch(Throwable e) {/*Do nothing*/} + return new gregtech.api.items.GT_Tool_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", aMaxDamage, aEntityDamage, F); + } + + /** + * Creates a new empty electric Tool + */ + public static GT_Tool_Item constructEmptyElectricToolItem(String aUnlocalized, String aEnglish, int aMaxDamage, int aChargedGTID) { + try { + return (GT_Tool_Item)Class.forName("gregtechmod.api.items.GT_EmptyToolIC_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aChargedGTID); + } catch(Throwable e) {/*Do nothing*/} + return new gregtech.api.items.GT_Tool_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", aMaxDamage, 0, F); + } + + private static Class sBaseMetaTileEntityClass = null; + + /** + * This gives you a new BaseMetaTileEntity. As some Interfaces are not always loaded (Buildcraft, Univeral Electricity) I have to use Invocation at the Constructor of the BaseMetaTileEntity + */ + public static BaseMetaTileEntity constructBaseMetaTileEntity() { + if (sBaseMetaTileEntityClass == null) { + try { + return (BaseMetaTileEntity)(sBaseMetaTileEntityClass = BaseMetaTileEntity.class).newInstance(); + } catch(Throwable e) {/*Do nothing*/} + } + + try { + return (BaseMetaTileEntity)(sBaseMetaTileEntityClass.newInstance()); + } catch(Throwable e) { + GT_Log.err.println("GT_Mod: Fatal Error ocurred while initializing TileEntities, crashing Minecraft."); + e.printStackTrace(GT_Log.err); + throw new RuntimeException(e); + } + } + + public static void registerCover(ItemStack aStack, ITexture aCover, GT_CoverBehavior aBehavior) { + if (!sCovers.containsKey(new GT_ItemStack(aStack))) sCovers.put(new GT_ItemStack(aStack), aCover==null||!aCover.isValidTexture()?Textures.BlockIcons.ERROR_RENDERING[0]:aCover); + if (aBehavior != null) sCoverBehaviors.put(new GT_ItemStack(aStack), aBehavior); + } + + public static void registerCoverBehavior(ItemStack aStack, GT_CoverBehavior aBehavior) { + sCoverBehaviors.put(new GT_ItemStack(aStack), aBehavior==null?sDefaultBehavior:aBehavior); + } + + /** + * Registers multiple Cover Items. I use that for the OreDict Functionality. + * @param aBehavior can be null + */ + public static void registerCover(Collection aStackList, ITexture aCover, GT_CoverBehavior aBehavior) { + if (aCover.isValidTexture()) for (ItemStack tStack : aStackList) registerCover(tStack, aCover, aBehavior); + } + + /** + * This is the generic Cover behavior. Used for the default Covers, which have no Behavior. + */ + public static final GT_CoverBehavior sDefaultBehavior = new GT_Cover_Default(), sNoBehavior = new GT_Cover_None(); + + /** + * returns a Cover behavior, guaranteed to not return null after preload + */ + public static GT_CoverBehavior getCoverBehavior(ItemStack aStack) { + if (aStack == null || aStack.getItem() == null) return sNoBehavior; + GT_CoverBehavior rCover = sCoverBehaviors.get(new GT_ItemStack(aStack)); + if (rCover == null) return sDefaultBehavior; + return rCover; + } + + /** + * returns a Cover behavior, guaranteed to not return null + */ + public static GT_CoverBehavior getCoverBehavior(int aStack) { + if (aStack == 0) return sNoBehavior; + return getCoverBehavior(GT_Utility.intToStack(aStack)); + } + + /** + * Register a Wrench to be usable on GregTech Machines. + * The Wrench MUST have some kind of Durability unlike certain Buildcraft Wrenches. + * + * You need to register Tools in the Load Phase, because otherwise the Autodetection will assign a Tool Type in certain Cases during postload (When IToolWrench or similar Interfaces are implemented). + * + * ----- + * + * Returning true at isDamagable was a great Idea, KingLemming. Well played. + * Since the OmniWrench is just a Single-Item-Mod, people can choose if they want your infinite durability or not. So that's not really a Problem. + * I even have a new Config to autodisable most infinite BC Wrenches (but that one is turned off). + * + * One last Bug for you to fix: + * My Autoregistration detects Railcrafts Crowbars, Buildcrafts Wrenches and alike, due to their Interfaces. + * Guess what now became a Crowbar by accident. Try registering the Wrench at the load phase to prevent things like that from happening. + * Yes, I know that "You need to register Tools in the Load Phase"-Part wasn't there before this. Sorry about that. + */ + public static boolean registerWrench(ItemStack aTool) { + return registerTool(aTool, sWrenchList); + } + + /** + * Register a Crowbar to extract Covers from Machines + * Crowbars are NOT Wrenches btw. + * + * You need to register Tools in the Load Phase, because otherwise the Autodetection will assign a Tool Type in certain Cases during postload (When IToolWrench or similar Interfaces are implemented). + */ + public static boolean registerCrowbar(ItemStack aTool) { + return registerTool(aTool, sCrowbarList); + } + + /** + * Register a Screwdriver to interact directly with Machines and Covers + * Did I mention, that it is intentionally not possible to make a Multitool, which doesn't switch ItemID (like a Mode) all the time? + * + * You need to register Tools in the Load Phase, because otherwise the Autodetection will assign a Tool Type in certain Cases during postload (When IToolWrench or similar Interfaces are implemented). + */ + public static boolean registerScrewdriver(ItemStack aTool) { + return registerTool(aTool, sScrewdriverList); + } + + /** + * Register a Soft Hammer to interact with Machines + * + * You need to register Tools in the Load Phase, because otherwise the Autodetection will assign a Tool Type in certain Cases during postload (When IToolWrench or similar Interfaces are implemented). + */ + public static boolean registerSoftHammer(ItemStack aTool) { + return registerTool(aTool, sSoftHammerList); + } + + /** + * Register a Hard Hammer to interact with Machines + * + * You need to register Tools in the Load Phase, because otherwise the Autodetection will assign a Tool Type in certain Cases during postload (When IToolWrench or similar Interfaces are implemented). + */ + public static boolean registerHardHammer(ItemStack aTool) { + return registerTool(aTool, sHardHammerList); + } + + /** + * Register a Soldering Tool to interact with Machines + * + * You need to register Tools in the Load Phase, because otherwise the Autodetection will assign a Tool Type in certain Cases during postload (When IToolWrench or similar Interfaces are implemented). + */ + public static boolean registerSolderingTool(ItemStack aTool) { + return registerTool(aTool, sSolderingToolList); + } + + /** + * Register a Soldering Tin to interact with Soldering Tools + * + * You need to register Tools in the Load Phase, because otherwise the Autodetection will assign a Tool Type in certain Cases during postload (When IToolWrench or similar Interfaces are implemented). + */ + public static boolean registerSolderingMetal(ItemStack aTool) { + return registerTool(aTool, sSolderingMetalList); + } + + /** + * Generic Function to add Tools to the Lists. + * Contains all sanity Checks for Tools, like preventing one Tool from being registered for multiple purposes as controls would override each other. + */ + public static boolean registerTool(ItemStack aTool, Collection aToolList) { + if (aTool == null || GT_Utility.isStackInList(aTool, sToolList) || (!aTool.getItem().isDamageable() && !GT_ModHandler.isElectricItem(aTool) && !(aTool.getItem() instanceof IDamagableItem))) return F; + aToolList.add(new GT_ItemStack(GT_Utility.copyAmount(1, aTool))); + sToolList.add(new GT_ItemStack(GT_Utility.copyAmount(1, aTool))); + return T; + } + + /** + * Adds Biomes to the Biome Lists for World Generation + */ + static { + sItemStackMappings.add(sCovers); + sItemStackMappings.add(sCoverBehaviors); + + sDimensionalList.add(-1); + sDimensionalList.add( 0); + sDimensionalList.add( 1); + + sSoundList.put( 0, "random.break"); + sSoundList.put( 1, "random.anvil_use"); + sSoundList.put( 2, "random.anvil_break"); + sSoundList.put( 3, "random.click"); + sSoundList.put( 4, "random.fizz"); + sSoundList.put( 5, "random.explode"); + sSoundList.put( 6, "fire.ignite"); + + sSoundList.put(100, MOD_ID_IC2.toLowerCase() + ":" + "tools.Wrench"); + sSoundList.put(101, MOD_ID_IC2.toLowerCase() + ":" + "tools.RubberTrampoline"); + sSoundList.put(102, MOD_ID_IC2.toLowerCase() + ":" + "tools.Painter"); + sSoundList.put(103, MOD_ID_IC2.toLowerCase() + ":" + "tools.BatteryUse"); + sSoundList.put(104, MOD_ID_IC2.toLowerCase() + ":" + "tools.chainsaw.ChainsawUseOne"); + sSoundList.put(105, MOD_ID_IC2.toLowerCase() + ":" + "tools.chainsaw.ChainsawUseTwo"); + sSoundList.put(106, MOD_ID_IC2.toLowerCase() + ":" + "tools.drill.DrillSoft"); + sSoundList.put(107, MOD_ID_IC2.toLowerCase() + ":" + "tools.drill.DrillHard"); + sSoundList.put(108, MOD_ID_IC2.toLowerCase() + ":" + "tools.ODScanner"); + + sSoundList.put(200, MOD_ID_IC2.toLowerCase() + ":" + "machines.ExtractorOp"); + sSoundList.put(201, MOD_ID_IC2.toLowerCase() + ":" + "machines.MaceratorOp"); + sSoundList.put(202, MOD_ID_IC2.toLowerCase() + ":" + "machines.InductionLoop"); + sSoundList.put(203, MOD_ID_IC2.toLowerCase() + ":" + "machines.CompressorOp"); + sSoundList.put(204, MOD_ID_IC2.toLowerCase() + ":" + "machines.RecyclerOp"); + sSoundList.put(205, MOD_ID_IC2.toLowerCase() + ":" + "machines.MinerOp"); + sSoundList.put(206, MOD_ID_IC2.toLowerCase() + ":" + "machines.PumpOp"); + sSoundList.put(207, MOD_ID_IC2.toLowerCase() + ":" + "machines.ElectroFurnaceLoop"); + sSoundList.put(208, MOD_ID_IC2.toLowerCase() + ":" + "machines.InductionLoop"); + sSoundList.put(209, MOD_ID_IC2.toLowerCase() + ":" + "machines.MachineOverload"); + sSoundList.put(210, MOD_ID_IC2.toLowerCase() + ":" + "machines.InterruptOne"); + sSoundList.put(211, MOD_ID_IC2.toLowerCase() + ":" + "machines.KaChing"); + sSoundList.put(212, MOD_ID_IC2.toLowerCase() + ":" + "machines.MagnetizerLoop"); + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/damagesources/GT_DamageSources.java b/src/main/java/gregtech/api/damagesources/GT_DamageSources.java new file mode 100644 index 0000000..9079fc5 --- /dev/null +++ b/src/main/java/gregtech/api/damagesources/GT_DamageSources.java @@ -0,0 +1,90 @@ +package gregtech.api.damagesources; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EntityDamageSource; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IChatComponent; + +public class GT_DamageSources { + public static DamageSource getElectricDamage() { + return ic2.api.info.Info.DMG_ELECTRIC; + } + + public static DamageSource getRadioactiveDamage() { + return ic2.api.info.Info.DMG_RADIATION; + } + + public static DamageSource getNukeExplosionDamage() { + return ic2.api.info.Info.DMG_NUKE_EXPLOSION; + } + + public static DamageSource getExplodingDamage() { + return new DamageSourceExploding(); + } + + public static DamageSource getCombatDamage(String aType, EntityLivingBase aPlayer, IChatComponent aDeathMessage) { + return new DamageSourceCombat(aType, aPlayer, aDeathMessage); + } + + public static DamageSource getHeatDamage() { + return new DamageSourceHeat(); + } + + public static DamageSource getFrostDamage() { + return new DamageSourceFrost(); + } + + private static class DamageSourceCombat extends EntityDamageSource { + private IChatComponent mDeathMessage; + + public DamageSourceCombat(String aType, EntityLivingBase aPlayer, IChatComponent aDeathMessage) { + super(aType, aPlayer); + mDeathMessage = aDeathMessage; + } + + @Override + public IChatComponent func_151519_b(EntityLivingBase aTarget) { + return mDeathMessage == null ? super.func_151519_b(aTarget) : mDeathMessage; + } + } + + private static class DamageSourceFrost extends DamageSource { + public DamageSourceFrost() { + super("frost"); + setDifficultyScaled(); + } + + @Override + public IChatComponent func_151519_b(EntityLivingBase aTarget) { + return new ChatComponentText(EnumChatFormatting.RED+aTarget.getCommandSenderName()+EnumChatFormatting.WHITE + " got frozen"); + } + } + + private static class DamageSourceHeat extends DamageSource { + public DamageSourceHeat() { + super("steam"); + setDifficultyScaled(); + } + + @Override + public IChatComponent func_151519_b(EntityLivingBase aTarget) { + return new ChatComponentText(EnumChatFormatting.RED+aTarget.getCommandSenderName()+EnumChatFormatting.WHITE + " was boiled alive"); + } + } + + public static class DamageSourceExploding extends DamageSource { + public DamageSourceExploding() { + super("exploded"); + setDamageAllowedInCreativeMode(); + setDamageBypassesArmor(); + setDamageIsAbsolute(); + } + + @Override + public IChatComponent func_151519_b(EntityLivingBase aTarget) { + return new ChatComponentText(EnumChatFormatting.RED+aTarget.getCommandSenderName()+EnumChatFormatting.WHITE + " exploded"); + } + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/enums/ConfigCategories.java b/src/main/java/gregtech/api/enums/ConfigCategories.java new file mode 100644 index 0000000..ba61c75 --- /dev/null +++ b/src/main/java/gregtech/api/enums/ConfigCategories.java @@ -0,0 +1,64 @@ +package gregtech.api.enums; + +public enum ConfigCategories { + news, + general, + machineconfig, + specialunificationtargets; + + public enum IDs { + crops, + enchantments; + } + + public enum Materials { + heatdamage, + oreprocessingoutputmultiplier, + blastfurnacerequirements, + blastinductionsmelter,; + } + + public enum Recipes { + researches, + harderrecipes, + gregtechrecipes, + disabledrecipes, + recipereplacements, + storageblockcrafting, + storageblockdecrafting; + } + + public enum Machines { + smelting, + squeezer, + liquidtransposer, + liquidtransposerfilling, + liquidtransposeremptying, + extractor, + sawmill, + compression, + thermalcentrifuge, + orewashing, + inductionsmelter, + rcblastfurnace, + scrapboxdrops, + massfabamplifier, + maceration, + rockcrushing, + pulverization; + } + + public enum Fuels { + boilerfuels; + } + + public enum Tools { + mortar, + hammerplating, + hammermultiingot, + hammerdoubleplate, + hammertripleplate, + hammerquadrupleplate, + hammerquintupleplate; + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/enums/Dyes.java b/src/main/java/gregtech/api/enums/Dyes.java new file mode 100644 index 0000000..eb1dafb --- /dev/null +++ b/src/main/java/gregtech/api/enums/Dyes.java @@ -0,0 +1,104 @@ +package gregtech.api.enums; + +import java.util.ArrayList; + +import gregtech.api.interfaces.IColorModulationContainer; +import gregtech.api.objects.GT_ArrayList; +import gregtech.api.util.GT_Utility; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; + +public enum Dyes implements IColorModulationContainer { + /** The valid Colors, see VALUES Array below */ + dyeBlack ( 0, 32, 32, 32, "Black"), + dyeRed ( 1, 255, 0, 0, "Red"), + dyeGreen ( 2, 0, 255, 0, "Green"), + dyeBrown ( 3, 96, 64, 0, "Brown"), + dyeBlue ( 4, 0, 0, 255, "Blue"), + dyePurple ( 5, 128, 0, 128, "Purple"), + dyeCyan ( 6, 0, 255, 255, "Cyan"), + dyeLightGray ( 7, 192, 192, 192, "Light Gray"), + dyeGray ( 8, 128, 128, 128, "Gray"), + dyePink ( 9, 255, 192, 192, "Pink"), + dyeLime (10, 128, 255, 128, "Lime"), + dyeYellow (11, 255, 255, 0, "Yellow"), + dyeLightBlue (12, 128, 128, 255, "Light Blue"), + dyeMagenta (13, 255, 0, 255, "Magenta"), + dyeOrange (14, 255, 128, 0, "Orange"), + dyeWhite (15, 255, 255, 255, "White"), + /** The NULL Color */ + _NULL (-1, 255, 255, 255, "INVALID COLOR"), + /** Additional Colors only used for direct Color referencing */ + CABLE_INSULATION (-1, 64, 64, 64, "Cable Insulation"), + CONSTRUCTION_FOAM (-1, 64, 64, 64, "Construction Foam"), + MACHINE_METAL (-1, 220, 220, 255, "Machine Metal"); + + public static final Dyes VALUES[] = {dyeBlack, dyeRed, dyeGreen, dyeBrown, dyeBlue, dyePurple, dyeCyan, dyeLightGray, dyeGray, dyePink, dyeLime, dyeYellow, dyeLightBlue, dyeMagenta, dyeOrange, dyeWhite}; + + public final byte mIndex; + public final String mName; + public final short[] mRGBa; + private final ArrayList mFluidDyes = new GT_ArrayList(false, 1); + + private Dyes(int aIndex, int aR, int aG, int aB, String aName) { + mIndex = (byte)aIndex; + mName = aName; + mRGBa = new short[] {(short)aR, (short)aG, (short)aB, 0}; + } + + public static Dyes get(int aColor) { + if (aColor >= 0 && aColor < 16) return VALUES[aColor]; + return _NULL; + } + + public static short[] getModulation(int aColor, short[] aDefaultModulation) { + if (aColor >= 0 && aColor < 16) return VALUES[aColor].mRGBa; + return aDefaultModulation; + } + + public static Dyes get(String aColor) { + Object tObject = GT_Utility.getFieldContent(Dyes.class, aColor, false, false); + if (tObject != null && tObject instanceof Dyes) return (Dyes)tObject; + return _NULL; + } + + public static boolean isAnyFluidDye(FluidStack aFluid) { + return aFluid != null && isAnyFluidDye(aFluid.getFluid()); + } + + public static boolean isAnyFluidDye(Fluid aFluid) { + if (aFluid != null) for (Dyes tDye : VALUES) if (tDye.isFluidDye(aFluid)) return true; + return false; + } + + public boolean isFluidDye(FluidStack aFluid) { + return aFluid != null && isFluidDye(aFluid.getFluid()); + } + + public boolean isFluidDye(Fluid aFluid) { + return aFluid != null && mFluidDyes.contains(aFluid); + } + + public boolean addFluidDye(Fluid aDye) { + if (aDye == null || mFluidDyes.contains(aDye)) return false; + mFluidDyes.add(aDye); + return true; + } + + public int getSizeOfFluidList() { + return mFluidDyes.size(); + } + + /** + * @param aAmount 1 Fluid Material Unit (144) = 1 Dye Item + */ + public FluidStack getFluidDye(int aIndex, long aAmount) { + if (aIndex >= mFluidDyes.size() || aIndex < 0) return null; + return new FluidStack(mFluidDyes.get(aIndex), (int)aAmount); + } + + @Override + public short[] getRGBA() { + return mRGBa; + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/enums/Element.java b/src/main/java/gregtech/api/enums/Element.java new file mode 100644 index 0000000..e4a0e64 --- /dev/null +++ b/src/main/java/gregtech/api/enums/Element.java @@ -0,0 +1,311 @@ +package gregtech.api.enums; + +import java.util.ArrayList; + +import gregtech.api.util.GT_Utility; + +/** + * This is some kind of Periodic Table, which I use to determine Properties of the Materials. + */ +public enum Element { + _NULL ( 0, 0, 0, -1, null , "" , false), + H ( 1, 0, 0, -1, null , "Hydrogen" , false), + D ( 1, 1, 0, -1, "H" , "Deuterium" , true), + T ( 1, 2, 0, -1, "D" , "Tritium" , true), + He ( 2, 2, 0, -1, null , "Helium" , false), + He_3 ( 2, 1, 0, -1, "H&D" , "Helium-3" , true), + Li ( 3, 4, 0, -1, null , "Lithium" , false), + Be ( 4, 5, 0, -1, null , "Beryllium" , false), + B ( 5, 5, 0, -1, null , "Boron" , false), + C ( 6, 6, 0, -1, null , "Carbon" , false), + N ( 7, 7, 0, -1, null , "Nitrogen" , false), + O ( 8, 8, 0, -1, null , "Oxygen" , false), + F ( 9, 9, 0, -1, null , "Fluorine" , false), + Ne ( 10, 10, 0, -1, null , "Neon" , false), + Na ( 11, 11, 0, -1, null , "Sodium" , false), + Mg ( 12, 12, 0, -1, null , "Magnesium" , false), + Al ( 13, 13, 0, -1, null , "Aluminium" , false), + Si ( 14, 14, 0, -1, null , "Silicon" , false), + P ( 15, 15, 0, -1, null , "Phosphorus" , false), + S ( 16, 16, 0, -1, null , "Sulfur" , false), + Cl ( 17, 18, 0, -1, null , "Chlorine" , false), + Ar ( 18, 22, 0, -1, null , "Argon" , false), + K ( 19, 20, 0, -1, null , "Potassium" , false), + Ca ( 20, 20, 0, -1, null , "Calcium" , false), + Sc ( 21, 24, 0, -1, null , "Scandium" , false), + Ti ( 22, 26, 0, -1, null , "Titanium" , false), + V ( 23, 28, 0, -1, null , "Vanadium" , false), + Cr ( 24, 28, 0, -1, null , "Chrome" , false), + Mn ( 25, 30, 0, -1, null , "Manganese" , false), + Fe ( 26, 30, 0, -1, null , "Iron" , false), + Co ( 27, 32, 0, -1, null , "Cobalt" , false), + Ni ( 28, 30, 0, -1, null , "Nickel" , false), + Cu ( 29, 34, 0, -1, null , "Copper" , false), + Zn ( 30, 35, 0, -1, null , "Zinc" , false), + Ga ( 31, 39, 0, -1, null , "Gallium" , false), + Ge ( 32, 40, 0, -1, null , "Germanium" , false), + As ( 33, 42, 0, -1, null , "Arsenic" , false), + Se ( 34, 45, 0, -1, null , "Selenium" , false), + Br ( 35, 45, 0, -1, null , "Bromine" , false), + Kr ( 36, 48, 0, -1, null , "Krypton" , false), + Rb ( 37, 48, 0, -1, null , "Rubidium" , false), + Sr ( 38, 49, 0, -1, null , "Strontium" , false), + Y ( 39, 50, 0, -1, null , "Yttrium" , false), + Zr ( 40, 51, 0, -1, null , "Zirconium" , false), + Nb ( 41, 53, 0, -1, null , "Niobium" , false), + Mo ( 42, 53, 0, -1, null , "Molybdenum" , false), + Tc ( 43, 55, 0, -1, null , "Technetium" , false), + Ru ( 44, 57, 0, -1, null , "Ruthenium" , false), + Rh ( 45, 58, 0, -1, null , "Rhodium" , false), + Pd ( 46, 60, 0, -1, null , "Palladium" , false), + Ag ( 47, 60, 0, -1, null , "Silver" , false), + Cd ( 48, 64, 0, -1, null , "Cadmium" , false), + In ( 49, 65, 0, -1, null , "Indium" , false), + Sn ( 50, 68, 0, -1, null , "Tin" , false), + Sb ( 51, 70, 0, -1, null , "Antimony" , false), + Te ( 52, 75, 0, -1, null , "Tellurium" , false), + I ( 53, 74, 0, -1, null , "Iodine" , false), + Xe ( 54, 77, 0, -1, null , "Xenon" , false), + Cs ( 55, 77, 0, -1, null , "Caesium" , false), + Ba ( 56, 81, 0, -1, null , "Barium" , false), + La ( 57, 81, 0, -1, null , "Lantanium" , false), + Ce ( 58, 82, 0, -1, null , "Cerium" , false), + Pr ( 59, 81, 0, -1, null , "Praseodymium" , false), + Nd ( 60, 84, 0, -1, null , "Neodymium" , false), + Pm ( 61, 83, 0, -1, null , "Promethium" , false), + Sm ( 62, 88, 0, -1, null , "Samarium" , false), + Eu ( 63, 88, 0, -1, null , "Europium" , false), + Gd ( 64, 93, 0, -1, null , "Gadolinium" , false), + Tb ( 65, 93, 0, -1, null , "Terbium" , false), + Dy ( 66, 96, 0, -1, null , "Dysprosium" , false), + Ho ( 67, 97, 0, -1, null , "Holmium" , false), + Er ( 68, 99, 0, -1, null , "Erbium" , false), + Tm ( 69, 99, 0, -1, null , "Thulium" , false), + Yb ( 70, 103, 0, -1, null , "Ytterbium" , false), + Lu ( 71, 103, 0, -1, null , "Lutetium" , false), + Hf ( 72, 106, 0, -1, null , "Hafnium" , false), + Ta ( 73, 107, 0, -1, null , "Tantalum" , false), + W ( 74, 109, 0, -1, null , "Wolframium" , false), + Re ( 75, 111, 0, -1, null , "Rhenium" , false), + Os ( 76, 114, 0, -1, null , "Osmium" , false), + Ir ( 77, 115, 0, -1, null , "Iridium" , false), + Pt ( 78, 117, 0, -1, null , "Platinum" , false), + Au ( 79, 117, 0, -1, null , "Gold" , false), + Hg ( 80, 120, 0, -1, null , "Mercury" , false), + Tl ( 81, 123, 0, -1, null , "Thallium" , false), + Pb ( 82, 125, 0, -1, null , "Lead" , false), + Bi ( 83, 125, 0, -1, null , "Bismuth" , false), + Po ( 84, 124, 0, -1, null , "Polonium" , false), + At ( 85, 124, 0, -1, null , "Astatine" , false), + Rn ( 86, 134, 0, -1, null , "Radon" , false), + Fr ( 87, 134, 0, -1, null , "Francium" , false), + Ra ( 88, 136, 0, -1, null , "Radium" , false), + Ac ( 89, 136, 0, -1, null , "Actinium" , false), + Th ( 90, 140, 0, -1, null , "Thorium" , false), + Pa ( 91, 138, 0, -1, null , "Protactinium" , false), + U ( 92, 146, 0, -1, null , "Uranium" , false), + U_235 ( 92, 143, 0, -1, null , "Uranium-235" , true), + Np ( 93, 144, 0, -1, null , "Neptunium" , false), + Pu ( 94, 152, 0, -1, null , "Plutonium" , false), + Pu_241 ( 94, 149, 0, -1, null , "Plutonium-241" , true), + Am ( 95, 150, 0, -1, null , "Americium" , false), + Cm ( 96, 153, 0, -1, null , "Curium" , false), + Bk ( 97, 152, 0, -1, null , "Berkelium" , false), + Cf ( 98, 153, 0, -1, null , "Californium" , false), + Es ( 99, 153, 0, -1, null , "Einsteinium" , false), + Fm ( 100, 157, 0, -1, null , "Fermium" , false), + Md ( 101, 157, 0, -1, null , "Mendelevium" , false), + No ( 102, 157, 0, -1, null , "Nobelium" , false), + Lr ( 103, 159, 0, -1, null , "Lawrencium" , false), + Rf ( 104, 161, 0, -1, null , "Rutherfordium" , false), + Db ( 105, 163, 0, -1, null , "Dubnium" , false), + Sg ( 106, 165, 0, -1, null , "Seaborgium" , false), + Bh ( 107, 163, 0, -1, null , "Bohrium" , false), + Hs ( 108, 169, 0, -1, null , "Hassium" , false), + Mt ( 109, 167, 0, -1, null , "Meitnerium" , false), + Ds ( 110, 171, 0, -1, null , "Darmstadtium" , false), + Rg ( 111, 169, 0, -1, null , "Roentgenium" , false), + Cn ( 112, 173, 0, -1, null , "Copernicium" , false), + Uut ( 113, 171, 0, -1, null , "Ununtrium" , false), + Fl ( 114, 175, 0, -1, null , "Flerovium" , false), + Uup ( 115, 173, 0, -1, null , "Ununpentium" , false), + Lv ( 116, 177, 0, -1, null , "Livermorium" , false), + Fa ( 117, 177, 0, -1, null , "Farnsium" , false), // Uus, Ununseptium + Uuo ( 118, 176, 0, -1, null , "Ununoctium" , false), + + Ma ( 0, 0, 100, -1, null , "Magic" , false), + Nt ( 0,100000, 0, -1, null , "Neutronium" , false), + + $H (- 1,- 0, 0, -1, null , "Anti-Hydrogen" , false), + $D (- 1,- 1, 0, -1, "H" , "Anti-Deuterium" , true), + $T (- 1,- 2, 0, -1, "D" , "Anti-Tritium" , true), + $He (- 2,- 2, 0, -1, null , "Anti-Helium" , false), + $He_3 (- 2,- 1, 0, -1, "H&D" , "Anti-Helium-3" , true), + $Li (- 3,- 4, 0, -1, null , "Anti-Lithium" , false), + $Be (- 4,- 5, 0, -1, null , "Anti-Beryllium" , false), + $B (- 5,- 5, 0, -1, null , "Anti-Boron" , false), + $C (- 6,- 6, 0, -1, null , "Anti-Carbon" , false), + $N (- 7,- 7, 0, -1, null , "Anti-Nitrogen" , false), + $O (- 8,- 8, 0, -1, null , "Anti-Oxygen" , false), + $F (- 9,- 9, 0, -1, null , "Anti-Fluorine" , false), + $Ne (- 10,- 10, 0, -1, null , "Anti-Neon" , false), + $Na (- 11,- 11, 0, -1, null , "Anti-Sodium" , false), + $Mg (- 12,- 12, 0, -1, null , "Anti-Magnesium" , false), + $Al (- 13,- 13, 0, -1, null , "Anti-Aluminium" , false), + $Si (- 14,- 14, 0, -1, null , "Anti-Silicon" , false), + $P (- 15,- 15, 0, -1, null , "Anti-Phosphorus" , false), + $S (- 16,- 16, 0, -1, null , "Anti-Sulfur" , false), + $Cl (- 17,- 18, 0, -1, null , "Anti-Chlorine" , false), + $Ar (- 18,- 22, 0, -1, null , "Anti-Argon" , false), + $K (- 19,- 20, 0, -1, null , "Anti-Potassium" , false), + $Ca (- 20,- 20, 0, -1, null , "Anti-Calcium" , false), + $Sc (- 21,- 24, 0, -1, null , "Anti-Scandium" , false), + $Ti (- 22,- 26, 0, -1, null , "Anti-Titanium" , false), + $V (- 23,- 28, 0, -1, null , "Anti-Vanadium" , false), + $Cr (- 24,- 28, 0, -1, null , "Anti-Chrome" , false), + $Mn (- 25,- 30, 0, -1, null , "Anti-Manganese" , false), + $Fe (- 26,- 30, 0, -1, null , "Anti-Iron" , false), + $Co (- 27,- 32, 0, -1, null , "Anti-Cobalt" , false), + $Ni (- 28,- 30, 0, -1, null , "Anti-Nickel" , false), + $Cu (- 29,- 34, 0, -1, null , "Anti-Copper" , false), + $Zn (- 30,- 35, 0, -1, null , "Anti-Zinc" , false), + $Ga (- 31,- 39, 0, -1, null , "Anti-Gallium" , false), + $Ge (- 32,- 40, 0, -1, null , "Anti-Germanium" , false), + $As (- 33,- 42, 0, -1, null , "Anti-Arsenic" , false), + $Se (- 34,- 45, 0, -1, null , "Anti-Selenium" , false), + $Br (- 35,- 45, 0, -1, null , "Anti-Bromine" , false), + $Kr (- 36,- 48, 0, -1, null , "Anti-Krypton" , false), + $Rb (- 37,- 48, 0, -1, null , "Anti-Rubidium" , false), + $Sr (- 38,- 49, 0, -1, null , "Anti-Strontium" , false), + $Y (- 39,- 50, 0, -1, null , "Anti-Yttrium" , false), + $Zr (- 40,- 51, 0, -1, null , "Anti-Zirconium" , false), + $Nb (- 41,- 53, 0, -1, null , "Anti-Niobium" , false), + $Mo (- 42,- 53, 0, -1, null , "Anti-Molybdenum" , false), + $Tc (- 43,- 55, 0, -1, null , "Anti-Technetium" , false), + $Ru (- 44,- 57, 0, -1, null , "Anti-Ruthenium" , false), + $Rh (- 45,- 58, 0, -1, null , "Anti-Rhodium" , false), + $Pd (- 46,- 60, 0, -1, null , "Anti-Palladium" , false), + $Ag (- 47,- 60, 0, -1, null , "Anti-Silver" , false), + $Cd (- 48,- 64, 0, -1, null , "Anti-Cadmium" , false), + $In (- 49,- 65, 0, -1, null , "Anti-Indium" , false), + $Sn (- 50,- 68, 0, -1, null , "Anti-Tin" , false), + $Sb (- 51,- 70, 0, -1, null , "Anti-Antimony" , false), + $Te (- 52,- 75, 0, -1, null , "Anti-Tellurium" , false), + $I (- 53,- 74, 0, -1, null , "Anti-Iodine" , false), + $Xe (- 54,- 77, 0, -1, null , "Anti-Xenon" , false), + $Cs (- 55,- 77, 0, -1, null , "Anti-Caesium" , false), + $Ba (- 56,- 81, 0, -1, null , "Anti-Barium" , false), + $La (- 57,- 81, 0, -1, null , "Anti-Lantanium" , false), + $Ce (- 58,- 82, 0, -1, null , "Anti-Cerium" , false), + $Pr (- 59,- 81, 0, -1, null , "Anti-Praseodymium" , false), + $Nd (- 60,- 84, 0, -1, null , "Anti-Neidymium" , false), + $Pm (- 61,- 83, 0, -1, null , "Anti-Promethium" , false), + $Sm (- 62,- 88, 0, -1, null , "Anti-Samarium" , false), + $Eu (- 63,- 88, 0, -1, null , "Anti-Europium" , false), + $Gd (- 64,- 93, 0, -1, null , "Anti-Gadolinium" , false), + $Tb (- 65,- 93, 0, -1, null , "Anti-Terbium" , false), + $Dy (- 66,- 96, 0, -1, null , "Anti-Dysprosium" , false), + $Ho (- 67,- 97, 0, -1, null , "Anti-Holmium" , false), + $Er (- 68,- 99, 0, -1, null , "Anti-Erbium" , false), + $Tm (- 69,- 99, 0, -1, null , "Anti-Thulium" , false), + $Yb (- 70,-103, 0, -1, null , "Anti-Ytterbium" , false), + $Lu (- 71,-103, 0, -1, null , "Anti-Lutetium" , false), + $Hf (- 72,-106, 0, -1, null , "Anti-Hafnium" , false), + $Ta (- 73,-107, 0, -1, null , "Anti-Tantalum" , false), + $W (- 74,-109, 0, -1, null , "Anti-Wolframium" , false), + $Re (- 75,-111, 0, -1, null , "Anti-Rhenium" , false), + $Os (- 76,-114, 0, -1, null , "Anti-Osmium" , false), + $Ir (- 77,-115, 0, -1, null , "Anti-Iridium" , false), + $Pt (- 78,-117, 0, -1, null , "Anti-Platinum" , false), + $Au (- 79,-117, 0, -1, null , "Anti-Gold" , false), + $Hg (- 80,-120, 0, -1, null , "Anti-Mercury" , false), + $Tl (- 81,-123, 0, -1, null , "Anti-Thallium" , false), + $Pb (- 82,-125, 0, -1, null , "Anti-Lead" , false), + $Bi (- 83,-125, 0, -1, null , "Anti-Bismuth" , false), + $Po (- 84,-124, 0, -1, null , "Anti-Polonium" , false), + $At (- 85,-124, 0, -1, null , "Anti-Astatine" , false), + $Rn (- 86,-134, 0, -1, null , "Anti-Radon" , false), + $Fr (- 87,-134, 0, -1, null , "Anti-Francium" , false), + $Ra (- 88,-136, 0, -1, null , "Anti-Radium" , false), + $Ac (- 89,-136, 0, -1, null , "Anti-Actinium" , false), + $Th (- 90,-140, 0, -1, null , "Anti-Thorium" , false), + $Pa (- 91,-138, 0, -1, null , "Anti-Protactinium" , false), + $U (- 92,-146, 0, -1, null , "Anti-Uranium" , false), + $U_235 (- 92,-143, 0, -1, null , "Anti-Uranium-235" , true), + $Np (- 93,-144, 0, -1, null , "Anti-Neptunium" , false), + $Pu (- 94,-152, 0, -1, null , "Anti-Plutonium" , false), + $Pu_241 (- 94,-149, 0, -1, null , "Anti-Plutonium-241" , true), + $Am (- 95,-150, 0, -1, null , "Anti-Americum" , false), + $Cm (- 96,-153, 0, -1, null , "Anti-Curium" , false), + $Bk (- 97,-152, 0, -1, null , "Anti-Berkelium" , false), + $Cf (- 98,-153, 0, -1, null , "Anti-Californium" , false), + $Es (- 99,-153, 0, -1, null , "Anti-Einsteinium" , false), + $Fm (-100,-157, 0, -1, null , "Anti-Fermium" , false), + $Md (-101,-157, 0, -1, null , "Anti-Mendelevium" , false), + $No (-102,-157, 0, -1, null , "Anti-Nobelium" , false), + $Lr (-103,-159, 0, -1, null , "Anti-Lawrencium" , false), + $Rf (-104,-161, 0, -1, null , "Anti-Rutherfordium" , false), + $Db (-105,-163, 0, -1, null , "Anti-Dubnium" , false), + $Sg (-106,-165, 0, -1, null , "Anti-Seaborgium" , false), + $Bh (-107,-163, 0, -1, null , "Anti-Bohrium" , false), + $Hs (-108,-169, 0, -1, null , "Anti-Hassium" , false), + $Mt (-109,-167, 0, -1, null , "Anti-Meitnerium" , false), + $Ds (-110,-171, 0, -1, null , "Anti-Darmstadtium" , false), + $Rg (-111,-169, 0, -1, null , "Anti-Roentgenium" , false), + $Cn (-112,-173, 0, -1, null , "Anti-Copernicium" , false), + $Uut (-113,-171, 0, -1, null , "Anti-Ununtrium" , false), + $Fl (-114,-175, 0, -1, null , "Anti-Flerovium" , false), + $Uup (-115,-173, 0, -1, null , "Anti-Ununpentium" , false), + $Lv (-116,-177, 0, -1, null , "Anti-Livermorium" , false), + $Uus (-117,-177, 0, -1, null , "Anti-Ununseptium" , false), + $Uuo (-118,-176, 0, -1, null , "Anti-Ununoctium" , false), + + $Ma ( 0, 0,-100, -1, null , "Anti-Magic" , false), + $Nt (0, -10000, 0, -1, null , "Anti-Neutronium" , false); + + public static Element get(String aMaterialName) { + Object tObject = GT_Utility.getFieldContent(Element.class, aMaterialName, false, false); + if (tObject != null && tObject instanceof Element) return (Element)tObject; + return _NULL; + } + + public final long mProtons, mNeutrons, mAdditionalMass, mHalfLifeSeconds; + public final String mName, mDecayTo; + public final boolean mIsIsotope; + + /** + * Links to every pure Material containing just this Element. + */ + public ArrayList mLinkedMaterials = new ArrayList(); + + /** + * @param aProtons Amount of Protons. Antiprotons if negative. + * @param aNeutrons Amount of Neutrons. Antineutrons if negative. (I could have made mistakes with the Neutron amount calculation, please tell me if I did something wrong) + * @param aHalfLifeSeconds Amount of Half Life this Material has in Seconds. -1 for stable Materials. + * @param aDecayTo String representing the Elements it decays to. Separated by an '&' Character. + * @param aName Name of the Element + */ + private Element(long aProtons, long aNeutrons, long aAdditionalMass, long aHalfLifeSeconds, String aDecayTo, String aName, boolean aIsIsotope) { + mProtons = aProtons; + mNeutrons = aNeutrons; + mAdditionalMass = aAdditionalMass; + mHalfLifeSeconds = aHalfLifeSeconds; + mDecayTo = aDecayTo; + mName = aName; + mIsIsotope = aIsIsotope; + } + + public long getProtons() { + return mProtons; + } + + public long getNeutrons() { + return mNeutrons; + } + + public long getMass() { + return mProtons + mNeutrons + mAdditionalMass; + } + + public static volatile int VERSION = 508; +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/enums/GT_Values.java b/src/main/java/gregtech/api/enums/GT_Values.java new file mode 100644 index 0000000..dc8b663 --- /dev/null +++ b/src/main/java/gregtech/api/enums/GT_Values.java @@ -0,0 +1,159 @@ +package gregtech.api.enums; + +import java.util.Arrays; +import java.util.HashSet; + +import gregtech.api.interfaces.internal.IGT_Mod; +import gregtech.api.interfaces.internal.IGT_RecipeAdder; +import gregtech.api.net.IGT_NetworkHandler; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.oredict.OreDictionary; + +/** + * Made for static imports, this Class is just a Helper. + * + * I am doing this to have a better Table alike view on my Code, so I can change things faster using the Block Selection Mode of eclipse. + * + * Go to "Window > Preferences > Java > Editor > Content Assist > Favorites" to set static importable Constant Classes such as this one as AutoCompleteable. + */ +public class GT_Values { + // unused: A, C, D, G, H, I, J, K, N, O, Q, R, S, T + + // TODO: Rename Material Units to 'U' + // TODO: Rename OrePrefixes Class to 'P' + // TODO: Rename Materials Class to 'M' + + /** Because "true" and "false" are too long. Some Programmers might wanna kill me for that, but this looks much better than true and false, and also it is better to have something that is not 4 and 5 Characters long, because of symmetry */ + public static final boolean T = true, F = false; + + /** Empty String for an easier Call Hierarchy */ + public static final String E = ""; + + /** Character Set with all Numbers */ + public static final HashSet CN = new HashSet(Arrays.asList('0', '1', '2', '3', '4', '5', '6', '7', '8', '9')); + /** Character Set with all lowercased Characters */ + public static final HashSet CL = new HashSet(Arrays.asList('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z')); + /** Character Set with all uppercased Characters */ + public static final HashSet CU = new HashSet(Arrays.asList('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z')); + + /** The first 32 Bits */ + public static final int[] B = new int[] {1<<0,1<<1,1<<2,1<<3,1<<4,1<<5,1<<6,1<<7,1<<8,1<<9,1<<10,1<<11,1<<12,1<<13,1<<14,1<<15,1<<16,1<<17,1<<18,1<<19,1<<20,1<<21,1<<22,1<<23,1<<24,1<<25,1<<26,1<<27,1<<28,1<<29,1<<30,1<<31}; + + /** + * Renamed from "MATERIAL_UNIT" to just "M" + * + * This is worth exactly one normal Item. + * This Constant can be divided by many commonly used Numbers such as + * 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 24, ... 64 or 81 + * without loosing precision and is for that reason used as Unit of Amount. + * But it is also small enough to be multiplied with larger Numbers. + * + * This is used to determine the amount of Material contained inside a prefixed Ore. + * For example Nugget = M / 9 as it contains out of 1/9 of an Ingot. + */ + public static final long M = 3628800; + + /** + * Renamed from "FLUID_MATERIAL_UNIT" to just "L" + * + * Fluid per Material Unit (Prime Factors: 3 * 3 * 2 * 2 * 2 * 2) + */ + public static final long L = 144; + + /** The Item WildCard Tag. Even shorter than the "-1" of the past */ + public static final short W = OreDictionary.WILDCARD_VALUE; + + /** The Voltage Tiers. Use this Array instead of the old named Voltage Variables */ + public static final long[] V = new long[] {8, 32, 128, 512, 2048, 8192, 32768, 131072, 524288, Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE}; + + /** The short Names for the Voltages */ + public static final String[] VN = new String[] {"ULV", "LV", "MV", "HV", "EV", "IV", "LuV", "ZPM", "UV", "MAX", "MAX", "MAX", "MAX", "MAX", "MAX", "MAX"}; + + /** The long Names for the Voltages */ + public static final String[] VOLTAGE_NAMES = new String[] {"Ultra Low Voltage", "Low Voltage", "Medium Voltage", "High Voltage", "Extreme Voltage", "Insane Voltage", "Ludicrous Voltage", "ZPM Voltage", "Ultimate Voltage", "Maximum Voltage", "Maximum Voltage", "Maximum Voltage", "Maximum Voltage", "Maximum Voltage", "Maximum Voltage", "Maximum Voltage"}; + + /** The Mod Object itself. That is the GT_Mod-Object. It's needed to open GUI's and similar. */ + public static IGT_Mod GT; + + /** Use this Object to add Recipes. (Recipe Adder) */ + public static IGT_RecipeAdder RA; + + /** For Internal Usage (Network) */ + public static IGT_NetworkHandler NW; + + /** This way it is possible to have a Call Hierarchy of NullPointers in ItemStack based Functions, and also because most of the time I don't know what kind of Data Type the "null" stands for */ + public static final ItemStack NI = null; + + /** This way it is possible to have a Call Hierarchy of NullPointers in FluidStack based Functions, and also because most of the time I don't know what kind of Data Type the "null" stands for */ + public static final FluidStack NF = null; + + /** Not really Constants, but they set using the Config and therefore should be constant (those are for the Debug Mode) */ + public static boolean D1 = false, D2 = false; + + /** If you have to give something a World Parameter but there is no World... (Dummy World) */ + public static World DW; + + /** + * MOD ID Strings, since they are very common Parameters. + */ + public static final String + MOD_ID = "gregtech" + + , MOD_ID_IC2 = "IC2" + , MOD_ID_NC = "IC2NuclearControl" + + , MOD_ID_TC = "Thaumcraft" + + , MOD_ID_TF = "TwilightForest" + + , MOD_ID_RC = "Railcraft" + + , MOD_ID_TE = "ThermalExpansion" + + , MOD_ID_AE = "appliedenergistics2" + + , MOD_ID_TFC = "terrafirmacraft" + + , MOD_ID_PFAA = "PFAAGeologica" + + , MOD_ID_FR = "Forestry" + , MOD_ID_HaC = "harvestcraft" + , MOD_ID_APC = "AppleCore" + , MOD_ID_MaCr = "magicalcrops" + , MOD_ID_GaEn = "ganysend" + , MOD_ID_GaSu = "ganyssurface" + , MOD_ID_GaNe = "ganysnether" + + , MOD_ID_BC_SILICON = "BuildCraft|Silicon" + , MOD_ID_BC_TRANSPORT = "BuildCraft|Transport" + , MOD_ID_BC_FACTORY = "BuildCraft|Factory" + , MOD_ID_BC_ENERGY = "BuildCraft|Energy" + , MOD_ID_BC_BUILDERS = "BuildCraft|Builders" + , MOD_ID_BC_CORE = "BuildCraft|Core" + + , MOD_ID_GC_CORE = "GalacticraftCore" + , MOD_ID_GC_MARS = "GalacticraftMars" + , MOD_ID_GC_PLANETS = "GalacticraftPlanets" + ; + + /** File Paths and Resource Paths */ + public static final String + TEX_DIR = "textures/" + , TEX_DIR_GUI = TEX_DIR + "gui/" + , TEX_DIR_ITEM = TEX_DIR + "items/" + , TEX_DIR_BLOCK = TEX_DIR + "blocks/" + , TEX_DIR_ENTITY = TEX_DIR + "entity/" + , TEX_DIR_ASPECTS = TEX_DIR + "aspects/" + + , RES_PATH = MOD_ID + ":" + TEX_DIR + , RES_PATH_GUI = MOD_ID + ":" + TEX_DIR_GUI + , RES_PATH_ITEM = MOD_ID + ":" + , RES_PATH_BLOCK = MOD_ID + ":" + , RES_PATH_ENTITY = MOD_ID + ":" + TEX_DIR_ENTITY + , RES_PATH_ASPECTS = MOD_ID + ":" + TEX_DIR_ASPECTS + + , RES_PATH_IC2 = MOD_ID_IC2.toLowerCase() + ":" + ; +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/enums/ItemList.java b/src/main/java/gregtech/api/enums/ItemList.java new file mode 100644 index 0000000..03dd44a --- /dev/null +++ b/src/main/java/gregtech/api/enums/ItemList.java @@ -0,0 +1,783 @@ +package gregtech.api.enums; + +import static gregtech.api.enums.GT_Values.W; + +import gregtech.api.interfaces.IItemContainer; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Utility; +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.Fluid; + +/** + * Class containing all non-OreDict Items of GregTech. + */ +public enum ItemList implements IItemContainer { + Display_ITS_FREE, + Display_Fluid, + TE_Slag, + TE_Slag_Rich, + TE_Rockwool, + TE_Hardened_Glass, + FR_Lemon, + FR_Mulch, + FR_Fertilizer, + FR_Compost, + FR_Silk, + FR_Wax, + FR_RefractoryWax, + FR_WaxCapsule, + FR_RefractoryCapsule, + FR_Stick, + FR_Casing_Impregnated, + FR_Casing_Sturdy, + FR_Casing_Hardened, + FR_Bee_Drone, + FR_Bee_Princess, + FR_Bee_Queen, + FR_Tree_Sapling, + FR_Butterfly, + FR_Larvae, + FR_Serum, + FR_Caterpillar, + FR_PollenFertile, + TF_LiveRoot, + TF_Vial_FieryBlood, + TF_Vial_FieryTears, + RC_ShuntingWire, + RC_ShuntingWireFrame, + RC_Rail_Reinforced, + RC_Rail_Electric, + RC_Rail_Standard, + RC_Rail_Wooden, + RC_Rail_Adv, + RC_Rail_HS, + RC_Tie_Wood, + RC_Tie_Stone, + RC_Bed_Wood, + RC_Bed_Stone, + RC_Rebar, + IC2_Item_Casing_Tin, + IC2_Item_Casing_Copper, + IC2_Item_Casing_Iron, + IC2_Item_Casing_Steel, + IC2_Item_Casing_Lead, + IC2_Item_Casing_Bronze, + IC2_Item_Casing_Gold, + IC2_Spray_WeedEx, + IC2_Scrap, + IC2_Scrapbox, + IC2_Fertilizer, + IC2_Mixed_Metal_Ingot, + IC2_Hops, + IC2_Resin, + IC2_Plantball, + IC2_PlantballCompressed, + IC2_CoffeeBeans, + IC2_CoffeePowder, + IC2_Crop_Seeds, + IC2_Grin_Powder, + IC2_Energium_Dust, + IC2_Compressed_Coal_Ball, + IC2_Compressed_Coal_Chunk, + IC2_Fuel_Rod_Empty, + IC2_Fuel_Can_Empty, + IC2_Fuel_Can_Filled, + IC2_Food_Can_Empty, + IC2_Food_Can_Filled, + IC2_Food_Can_Spoiled, + IC2_ShaftIron, + IC2_ShaftSteel, + IC2_Industrial_Diamond, + IC2_ForgeHammer, + IC2_WireCutter, + IC2_SuBattery, + IC2_ReBattery, + IC2_AdvBattery, + IC2_EnergyCrystal, + IC2_LapotronCrystal, + Arrow_Head_Glass_Emtpy, + Arrow_Head_Glass_Poison, + Arrow_Head_Glass_Poison_Long, + Arrow_Head_Glass_Poison_Strong, + Arrow_Head_Glass_Slowness, + Arrow_Head_Glass_Slowness_Long, + Arrow_Head_Glass_Weakness, + Arrow_Head_Glass_Weakness_Long, + Arrow_Head_Glass_Holy_Water, + Arrow_Wooden_Glass_Emtpy, + Arrow_Wooden_Glass_Poison, + Arrow_Wooden_Glass_Poison_Long, + Arrow_Wooden_Glass_Poison_Strong, + Arrow_Wooden_Glass_Slowness, + Arrow_Wooden_Glass_Slowness_Long, + Arrow_Wooden_Glass_Weakness, + Arrow_Wooden_Glass_Weakness_Long, + Arrow_Wooden_Glass_Holy_Water, + Arrow_Plastic_Glass_Emtpy, + Arrow_Plastic_Glass_Poison, + Arrow_Plastic_Glass_Poison_Long, + Arrow_Plastic_Glass_Poison_Strong, + Arrow_Plastic_Glass_Slowness, + Arrow_Plastic_Glass_Slowness_Long, + Arrow_Plastic_Glass_Weakness, + Arrow_Plastic_Glass_Weakness_Long, + Arrow_Plastic_Glass_Holy_Water, + Shape_Empty, + Shape_Mold_Bottle, + Shape_Mold_Plate, + Shape_Mold_Ingot, + Shape_Mold_Casing, + Shape_Mold_Gear, + Shape_Mold_Gear_Small, + Shape_Mold_Credit, + Shape_Mold_Nugget, + Shape_Mold_Block, + Shape_Mold_Ball, + Shape_Mold_Bun, + Shape_Mold_Bread, + Shape_Mold_Baguette, + Shape_Mold_Cylinder, + Shape_Mold_Anvil, + Shape_Mold_Arrow, + Shape_Mold_Name, + Shape_Slicer_Flat, + Shape_Slicer_Stripes, + Shape_Extruder_Bottle, + Shape_Extruder_Plate, + Shape_Extruder_Cell, + Shape_Extruder_Ring, + Shape_Extruder_Rod, + Shape_Extruder_Bolt, + Shape_Extruder_Ingot, + Shape_Extruder_Wire, + Shape_Extruder_Casing, + Shape_Extruder_Pipe_Tiny, + Shape_Extruder_Pipe_Small, + Shape_Extruder_Pipe_Medium, + Shape_Extruder_Pipe_Large, + Shape_Extruder_Pipe_Huge, + Shape_Extruder_Block, + Shape_Extruder_Sword, + Shape_Extruder_Pickaxe, + Shape_Extruder_Shovel, + Shape_Extruder_Axe, + Shape_Extruder_Hoe, + Shape_Extruder_Hammer, + Shape_Extruder_File, + Shape_Extruder_Saw, + Shape_Extruder_Gear, + Crate_Empty, + Credit_Copper, + Credit_Iron, + Credit_Silver, + Credit_Gold, + Credit_Platinum, + Credit_Osmium, + Credit_Greg_Copper, + Credit_Greg_Cupronickel, + Credit_Greg_Silver, + Credit_Greg_Gold, + Credit_Greg_Platinum, + Credit_Greg_Osmium, + Credit_Greg_Naquadah, + Credit_Greg_Neutronium, + Coin_Gold_Ancient, + Coin_Doge, + Coin_Chocolate, + Cell_Universal_Fluid, + Cell_Empty, + Cell_Water, + Cell_Lava, + Cell_Air, + Large_Fluid_Cell_Steel, + Large_Fluid_Cell_TungstenSteel, + ThermosCan_Empty, + ThermosCan_Dark_Coffee, + ThermosCan_Dark_Cafe_au_lait, + ThermosCan_Coffee, + ThermosCan_Cafe_au_lait, + ThermosCan_Lait_au_cafe, + ThermosCan_Dark_Chocolate_Milk, + ThermosCan_Chocolate_Milk, + ThermosCan_Tea, + ThermosCan_Sweet_Tea, + ThermosCan_Ice_Tea, + Bottle_Empty, + Bottle_Milk, + Bottle_Holy_Water, + Bottle_Purple_Drink, + Bottle_Grape_Juice, + Bottle_Wine, + Bottle_Vinegar, + Bottle_Potato_Juice, + Bottle_Vodka, + Bottle_Leninade, + Bottle_Mineral_Water, + Bottle_Salty_Water, + Bottle_Reed_Water, + Bottle_Rum, + Bottle_Pirate_Brew, + Bottle_Hops_Juice, + Bottle_Dark_Beer, + Bottle_Dragon_Blood, + Bottle_Wheaty_Juice, + Bottle_Scotch, + Bottle_Glen_McKenner, + Bottle_Wheaty_Hops_Juice, + Bottle_Beer, + Bottle_Chilly_Sauce, + Bottle_Hot_Sauce, + Bottle_Diabolo_Sauce, + Bottle_Diablo_Sauce, + Bottle_Snitches_Glitch_Sauce, + Bottle_Apple_Juice, + Bottle_Cider, + Bottle_Golden_Apple_Juice, + Bottle_Golden_Cider, + Bottle_Iduns_Apple_Juice, + Bottle_Notches_Brew, + Bottle_Lemon_Juice, + Bottle_Limoncello, + Bottle_Lemonade, + Bottle_Alcopops, + Bottle_Cave_Johnsons_Grenade_Juice, + Food_Potato_On_Stick, + Food_Potato_On_Stick_Roasted, + Food_Fries, + Food_ChiliChips, + Food_PotatoChips, + Food_Baked_Potato, + Food_Poisonous_Potato, + Food_Cheese, + Food_Chum, + Food_Chum_On_Stick, + Food_Dough, + Food_Dough_Sugar, + Food_Dough_Chocolate, + Food_Raw_Cookie, + Food_Flat_Dough, + Food_Burger_Veggie, + Food_Burger_Cheese, + Food_Burger_Meat, + Food_Burger_Chum, + Food_Sandwich_Veggie, + Food_Sandwich_Cheese, + Food_Sandwich_Bacon, + Food_Sandwich_Steak, + Food_Large_Sandwich_Veggie, + Food_Large_Sandwich_Cheese, + Food_Large_Sandwich_Bacon, + Food_Large_Sandwich_Steak, + Food_Sliced_Lemon, + Food_Sliced_Tomato, + Food_Sliced_Onion, + Food_Sliced_Cucumber, + Food_Sliced_Cheese, + Food_Sliced_Bread, + Food_Sliced_Bun, + Food_Sliced_Baguette, + Food_Sliced_Breads, + Food_Sliced_Buns, + Food_Sliced_Baguettes, + Food_Packaged_Fries, + Food_Packaged_PotatoChips, + Food_Packaged_ChiliChips, + Food_Raw_Potato, + Food_Raw_Fries, + Food_Raw_PotatoChips, + Food_Raw_Bread, + Food_Raw_Bun, + Food_Raw_Baguette, + Food_Raw_Cake, + Food_Raw_Pizza_Veggie, + Food_Raw_Pizza_Cheese, + Food_Raw_Pizza_Meat, + Food_Baked_Bread, + Food_Baked_Bun, + Food_Baked_Baguette, + Food_Baked_Cake, + Food_Baked_Pizza_Veggie, + Food_Baked_Pizza_Cheese, + Food_Baked_Pizza_Meat, + Crop_Drop_Argentia, + Crop_Drop_Plumbilia, + Crop_Drop_Indigo, + Crop_Drop_Ferru, + Crop_Drop_Aurelia, + Crop_Drop_OilBerry, + Crop_Drop_MilkWart, + Crop_Drop_BobsYerUncleRanks, + Crop_Drop_Coppon, + Crop_Drop_Tine, + Crop_Drop_Chilly, + Crop_Drop_Lemon, + Crop_Drop_Onion, + Crop_Drop_Tomato, + Crop_Drop_MTomato, + Crop_Drop_Grapes, + Crop_Drop_TeaLeaf, + Crop_Drop_Cucumber, + Schematic, + Schematic_Crafting, + Schematic_1by1, + Schematic_2by2, + Schematic_3by3, + Schematic_Dust, + Circuit_Integrated, + Circuit_Board_Basic, + Circuit_Board_Advanced, + Circuit_Board_Elite, + Circuit_Parts_Advanced, + Circuit_Parts_Wiring_Basic, + Circuit_Parts_Wiring_Advanced, + Circuit_Parts_Wiring_Elite, + Circuit_Parts_Crystal_Chip_Elite, + Circuit_Parts_Crystal_Chip_Master, + Circuit_Primitive, + Circuit_Basic, + Circuit_Good, + Circuit_Advanced, + Circuit_Data, + Circuit_Elite, + Circuit_Master, + Circuit_Ultimate, + Rotor_LV, Rotor_MV, Rotor_HV, Rotor_EV, Rotor_IV, Rotor_LuV, Rotor_ZPM, Rotor_UV, + Electric_Motor_LV, Electric_Motor_MV, Electric_Motor_HV, Electric_Motor_EV, Electric_Motor_IV, Electric_Motor_LuV, Electric_Motor_ZPM, Electric_Motor_UV, + Electric_Pump_LV, Electric_Pump_MV, Electric_Pump_HV, Electric_Pump_EV, Electric_Pump_IV, Electric_Pump_LuV, Electric_Pump_ZPM, Electric_Pump_UV, + Conveyor_Module_LV, Conveyor_Module_MV, Conveyor_Module_HV, Conveyor_Module_EV, Conveyor_Module_IV, Conveyor_Module_LuV, Conveyor_Module_ZPM, Conveyor_Module_UV, + Electric_Piston_LV, Electric_Piston_MV, Electric_Piston_HV, Electric_Piston_EV, Electric_Piston_IV, Electric_Piston_LuV, Electric_Piston_ZPM, Electric_Piston_UV, + Field_Generator_LV, Field_Generator_MV, Field_Generator_HV, Field_Generator_EV, Field_Generator_IV, Field_Generator_LuV, Field_Generator_ZPM, Field_Generator_UV, + Robot_Arm_LV, Robot_Arm_MV, Robot_Arm_HV, Robot_Arm_EV, Robot_Arm_IV, Robot_Arm_LuV, Robot_Arm_ZPM, Robot_Arm_UV, + Emitter_LV, Emitter_MV, Emitter_HV, Emitter_EV, Emitter_IV, Emitter_LuV, Emitter_ZPM, Emitter_UV, + Sensor_LV, Sensor_MV, Sensor_HV, Sensor_EV, Sensor_IV, Sensor_LuV, Sensor_ZPM, Sensor_UV, + Battery_Hull_LV, Battery_Hull_MV, Battery_Hull_HV, + Battery_SU_LV_SulfuricAcid, + Battery_SU_LV_Mercury, + Battery_SU_MV_SulfuricAcid, + Battery_SU_MV_Mercury, + Battery_SU_HV_SulfuricAcid, + Battery_SU_HV_Mercury, + Battery_RE_ULV_Tantalum, + Battery_RE_LV_Cadmium, + Battery_RE_LV_Lithium, + Battery_RE_LV_Sodium, + Battery_RE_MV_Cadmium, + Battery_RE_MV_Lithium, + Battery_RE_MV_Sodium, + Battery_RE_HV_Cadmium, + Battery_RE_HV_Lithium, + Battery_RE_HV_Sodium, + ZPM, + Fuel_Can_Plastic_Empty, + Fuel_Can_Plastic_Filled, + Upgrade_Battery, + Upgrade_Overclocker, + Upgrade_Muffler, + Upgrade_SteamEngine, + Upgrade_Lock, + Cover_Controller, + Cover_ActivityDetector, + Cover_FluidDetector, + Cover_ItemDetector, + Cover_EnergyDetector, + Cover_Drain, + Cover_Shutter, + Cover_Crafting, + Cover_Screen, + Cover_SolarPanel, + Cover_SolarPanel_8V, + Cover_SolarPanel_LV, + Cover_SolarPanel_MV, + Cover_SolarPanel_HV, + Cover_SolarPanel_EV, + Cover_SolarPanel_IV, + Cover_SolarPanel_LuV, + Cover_SolarPanel_ZPM, + Cover_SolarPanel_UV, + Ingot_IridiumAlloy, + Plank_Oak, + Plank_Spruce, + Plank_Birch, + Plank_Jungle, + Plank_Acacia, + Plank_DarkOak, + Plank_Larch, + Plank_Teak, + Plank_Acacia_Green, + Plank_Lime, + Plank_Chestnut, + Plank_Wenge, + Plank_Baobab, + Plank_Sequoia, + Plank_Kapok, + Plank_Ebony, + Plank_Mahagony, + Plank_Balsa, + Plank_Willow, + Plank_Walnut, + Plank_Greenheart, + Plank_Cherry, + Plank_Mahoe, + Plank_Poplar, + Plank_Palm, + Plank_Papaya, + Plank_Pine, + Plank_Plum, + Plank_Maple, + Plank_Citrus, + Dye_Indigo, + Dye_SquidInk, + Dye_Bonemeal, + Dye_Cocoa, + Duct_Tape, + Book_Written_00, + Book_Written_01, + Book_Written_02, + Book_Written_03, + Paper_Printed_Pages, + Paper_Magic_Empty, + Paper_Magic_Page, + Paper_Magic_Pages, + Paper_Punch_Card_Empty, + Paper_Punch_Card_Encoded, + McGuffium_239, + NC_SensorCard, + NC_SensorKit, + Tool_Matches, + Tool_MatchBox_Used, + Tool_MatchBox_Full, + Tool_Lighter_Invar_Empty, + Tool_Lighter_Invar_Used, + Tool_Lighter_Invar_Full, + Tool_Lighter_Platinum_Empty, + Tool_Lighter_Platinum_Used, + Tool_Lighter_Platinum_Full, + Tool_Cheat, + Tool_Scanner, + Tool_DataOrb, + Tool_DataStick, + Tool_Sonictron, + Tool_Sword_Bronze, + Tool_Pickaxe_Bronze, + Tool_Shovel_Bronze, + Tool_Axe_Bronze, + Tool_Hoe_Bronze, + Tool_Sword_Steel, + Tool_Pickaxe_Steel, + Tool_Shovel_Steel, + Tool_Axe_Steel, + Tool_Hoe_Steel, + + Spray_Empty, Spray_Bug, Spray_Ice, Spray_Hardener, Spray_CFoam, Spray_Pepper, Spray_Hydration, + Color_00, Color_01, Color_02, Color_03, Color_04, Color_05, Color_06, Color_07, Color_08, Color_09, Color_10, Color_11, Color_12, Color_13, Color_14, Color_15, + Spray_Color_00, Spray_Color_01, Spray_Color_02, Spray_Color_03, Spray_Color_04, Spray_Color_05, Spray_Color_06, Spray_Color_07, Spray_Color_08, Spray_Color_09, Spray_Color_10, Spray_Color_11, Spray_Color_12, Spray_Color_13, Spray_Color_14, Spray_Color_15, + Spray_Color_Used_00, Spray_Color_Used_01, Spray_Color_Used_02, Spray_Color_Used_03, Spray_Color_Used_04, Spray_Color_Used_05, Spray_Color_Used_06, Spray_Color_Used_07, Spray_Color_Used_08, Spray_Color_Used_09, Spray_Color_Used_10, Spray_Color_Used_11, Spray_Color_Used_12, Spray_Color_Used_13, Spray_Color_Used_14, Spray_Color_Used_15, + + Armor_Cheat, + Armor_Cloaking, + Armor_Lamp, + Armor_LithiumPack, + Armor_LapotronicPack, + Armor_ForceField, + Energy_LapotronicOrb, + Reactor_NeutronReflector, + Component_Turbine_Bronze, + Component_Turbine_Steel, + Component_Turbine_Magnalium, + Component_Turbine_TungstenSteel, + Component_Turbine_Carbon, + Component_LavaFilter, + Component_Sawblade_Diamond, + Component_Grinder_Diamond, + Component_Grinder_Tungsten, + Component_Filter, + Component_Minecart_Wheels_Iron, + Component_Minecart_Wheels_Steel, + + Generator_Diesel_LV, + Generator_Diesel_MV, + Generator_Diesel_HV, + Generator_Gas_Turbine_LV, + Generator_Gas_Turbine_MV, + Generator_Gas_Turbine_HV, + Generator_Steam_Turbine_LV, + Generator_Steam_Turbine_MV, + Generator_Steam_Turbine_HV, + Generator_Naquadah_Mark_I, + Generator_Naquadah_Mark_II, + Generator_Naquadah_Fluid, + + Machine_Bronze_Boiler, + Machine_Bronze_Boiler_Solar, + Machine_Bronze_CraftingTable, + Machine_Bronze_Furnace, + Machine_Bronze_Macerator, + Machine_Bronze_Extractor, + Machine_Bronze_Hammer, + Machine_Bronze_Compressor, + Machine_Bronze_AlloySmelter, + Machine_Bronze_BlastFurnace, + Machine_Steel_Boiler_Lava, + Machine_Steel_Boiler, + Machine_Steel_Furnace, + Machine_Steel_Macerator, + Machine_Steel_Extractor, + Machine_Steel_Hammer, + Machine_Steel_Compressor, + Machine_Steel_AlloySmelter, + + Hull_Bronze, Hull_Steel, Hull_Bronze_Bricks, Hull_Steel_Bricks, + + Transformer_LV_ULV, Transformer_MV_LV, Transformer_HV_MV, Transformer_EV_HV, Transformer_IV_EV, Transformer_LuV_IV, Transformer_ZPM_LuV, Transformer_UV_ZPM, Transformer_MAX_UV, + + Casing_ULV, Casing_LV, Casing_MV, Casing_HV, Casing_EV, Casing_IV, Casing_LuV, Casing_ZPM, Casing_UV, Casing_MAX, Casing_BronzePlatedBricks, Casing_HeatProof, Casing_Coil_Cupronickel, Casing_Coil_Kanthal, Casing_Coil_Nichrome, Casing_Coil_Superconductor, + Casing_SolidSteel, Casing_FrostProof, Casing_Gearbox_Bronze, Casing_Gearbox_Steel, Casing_Gearbox_Titanium, Casing_Gearbox_TungstenSteel, Casing_Processor, Casing_DataDrive, Casing_ContainmentField, Casing_Assembler, Casing_Pump, Casing_Motor, Casing_Pipe_Bronze, Casing_Pipe_Steel, Casing_Pipe_Titanium, Casing_Pipe_TungstenSteel, + Casing_Stripes_A, Casing_Stripes_B, Casing_RadioactiveHazard, Casing_BioHazard, Casing_ExplosionHazard, Casing_FireHazard, Casing_AcidHazard, Casing_MagicHazard, Casing_FrostHazard, Casing_NoiseHazard, Casing_Grate, Casing_Vent, Casing_RadiationProof, Casing_Firebox_Bronze, Casing_Firebox_Steel, Casing_Firebox_TungstenSteel, + Casing_RobustTungstenSteel, Casing_CleanStainlessSteel, Casing_StableTitanium, Casing_Firebox_Titanium, + Hull_ULV, Hull_LV, Hull_MV, Hull_HV, Hull_EV, Hull_IV, Hull_LuV, Hull_ZPM, Hull_UV, Hull_MAX, + + Automation_Filter_ULV, Automation_Filter_LV, Automation_Filter_MV, Automation_Filter_HV, Automation_Filter_EV, Automation_Filter_IV, Automation_Filter_LuV, Automation_Filter_ZPM, Automation_Filter_UV, Automation_Filter_MAX, + Automation_TypeFilter_ULV, Automation_TypeFilter_LV, Automation_TypeFilter_MV, Automation_TypeFilter_HV, Automation_TypeFilter_EV, Automation_TypeFilter_IV, Automation_TypeFilter_LuV, Automation_TypeFilter_ZPM, Automation_TypeFilter_UV, Automation_TypeFilter_MAX, + Automation_ChestBuffer_ULV, Automation_ChestBuffer_LV, Automation_ChestBuffer_MV, Automation_ChestBuffer_HV, Automation_ChestBuffer_EV, Automation_ChestBuffer_IV, Automation_ChestBuffer_LuV, Automation_ChestBuffer_ZPM, Automation_ChestBuffer_UV, Automation_ChestBuffer_MAX, + Automation_SuperBuffer_ULV, Automation_SuperBuffer_LV, Automation_SuperBuffer_MV, Automation_SuperBuffer_HV, Automation_SuperBuffer_EV, Automation_SuperBuffer_IV, Automation_SuperBuffer_LuV, Automation_SuperBuffer_ZPM, Automation_SuperBuffer_UV, Automation_SuperBuffer_MAX, + Automation_Regulator_ULV, Automation_Regulator_LV, Automation_Regulator_MV, Automation_Regulator_HV, Automation_Regulator_EV, Automation_Regulator_IV, Automation_Regulator_LuV, Automation_Regulator_ZPM, Automation_Regulator_UV, Automation_Regulator_MAX, + + Hatch_Dynamo_ULV, Hatch_Dynamo_LV, Hatch_Dynamo_MV, Hatch_Dynamo_HV, Hatch_Dynamo_EV, Hatch_Dynamo_IV, Hatch_Dynamo_LuV, Hatch_Dynamo_ZPM, Hatch_Dynamo_UV, Hatch_Dynamo_MAX, + Hatch_Energy_ULV, Hatch_Energy_LV, Hatch_Energy_MV, Hatch_Energy_HV, Hatch_Energy_EV, Hatch_Energy_IV, Hatch_Energy_LuV, Hatch_Energy_ZPM, Hatch_Energy_UV, Hatch_Energy_MAX, + Hatch_Input_ULV, Hatch_Input_LV, Hatch_Input_MV, Hatch_Input_HV, Hatch_Input_EV, Hatch_Input_IV, Hatch_Input_LuV, Hatch_Input_ZPM, Hatch_Input_UV, Hatch_Input_MAX, + Hatch_Input_Bus_ULV, Hatch_Input_Bus_LV, Hatch_Input_Bus_MV, Hatch_Input_Bus_HV, Hatch_Input_Bus_EV, Hatch_Input_Bus_IV, Hatch_Input_Bus_LuV, Hatch_Input_Bus_ZPM, Hatch_Input_Bus_UV, Hatch_Input_Bus_MAX, + Hatch_Output_ULV, Hatch_Output_LV, Hatch_Output_MV, Hatch_Output_HV, Hatch_Output_EV, Hatch_Output_IV, Hatch_Output_LuV, Hatch_Output_ZPM, Hatch_Output_UV, Hatch_Output_MAX, + Hatch_Output_Bus_ULV, Hatch_Output_Bus_LV, Hatch_Output_Bus_MV, Hatch_Output_Bus_HV, Hatch_Output_Bus_EV, Hatch_Output_Bus_IV, Hatch_Output_Bus_LuV, Hatch_Output_Bus_ZPM, Hatch_Output_Bus_UV, Hatch_Output_Bus_MAX, + Hatch_Muffler_LV, Hatch_Muffler_MV, Hatch_Muffler_HV, Hatch_Muffler_EV, Hatch_Muffler_IV, Hatch_Muffler_LuV, Hatch_Muffler_ZPM, Hatch_Muffler_UV, Hatch_Muffler_MAX, + Hatch_Maintenance, + + Battery_Buffer_1by1_ULV, Battery_Buffer_1by1_LV, Battery_Buffer_1by1_MV, Battery_Buffer_1by1_HV, Battery_Buffer_1by1_EV, Battery_Buffer_1by1_IV, Battery_Buffer_1by1_LuV, Battery_Buffer_1by1_ZPM, Battery_Buffer_1by1_UV, Battery_Buffer_1by1_MAX, + Battery_Buffer_2by2_ULV, Battery_Buffer_2by2_LV, Battery_Buffer_2by2_MV, Battery_Buffer_2by2_HV, Battery_Buffer_2by2_EV, Battery_Buffer_2by2_IV, Battery_Buffer_2by2_LuV, Battery_Buffer_2by2_ZPM, Battery_Buffer_2by2_UV, Battery_Buffer_2by2_MAX, + Battery_Buffer_3by3_ULV, Battery_Buffer_3by3_LV, Battery_Buffer_3by3_MV, Battery_Buffer_3by3_HV, Battery_Buffer_3by3_EV, Battery_Buffer_3by3_IV, Battery_Buffer_3by3_LuV, Battery_Buffer_3by3_ZPM, Battery_Buffer_3by3_UV, Battery_Buffer_3by3_MAX, + Battery_Buffer_4by4_ULV, Battery_Buffer_4by4_LV, Battery_Buffer_4by4_MV, Battery_Buffer_4by4_HV, Battery_Buffer_4by4_EV, Battery_Buffer_4by4_IV, Battery_Buffer_4by4_LuV, Battery_Buffer_4by4_ZPM, Battery_Buffer_4by4_UV, Battery_Buffer_4by4_MAX, + + Locker_ULV, Locker_LV, Locker_MV, Locker_HV, Locker_EV, Locker_IV, Locker_LuV, Locker_ZPM, Locker_UV, Locker_MAX, + + Machine_Multi_LargeBoiler_Bronze, Machine_Multi_LargeBoiler_Steel, Machine_Multi_LargeBoiler_Titanium, Machine_Multi_LargeBoiler_TungstenSteel, Machine_Multi_BlastFurnace, Machine_Multi_ImplosionCompressor, Machine_Multi_VacuumFreezer, Machine_Multi_Furnace, + Machine_LV_AlloySmelter, Machine_MV_AlloySmelter, Machine_HV_AlloySmelter, Machine_EV_AlloySmelter, Machine_IV_AlloySmelter, + Machine_LV_Assembler, Machine_MV_Assembler, Machine_HV_Assembler, Machine_EV_Assembler, Machine_IV_Assembler, + Machine_LV_Bender, Machine_MV_Bender, Machine_HV_Bender, Machine_EV_Bender, Machine_IV_Bender, + Machine_LV_Canner, Machine_MV_Canner, Machine_HV_Canner, Machine_EV_Canner, Machine_IV_Canner, + Machine_LV_Compressor, Machine_MV_Compressor, Machine_HV_Compressor, Machine_EV_Compressor, Machine_IV_Compressor, + Machine_LV_Cutter, Machine_MV_Cutter, Machine_HV_Cutter, Machine_EV_Cutter, Machine_IV_Cutter, + Machine_LV_Slicer, Machine_MV_Slicer, Machine_HV_Slicer, Machine_EV_Slicer, Machine_IV_Slicer, + Machine_LV_Sifter, Machine_MV_Sifter, Machine_HV_Sifter, Machine_EV_Sifter, Machine_IV_Sifter, + Machine_LV_ArcFurnace, Machine_MV_ArcFurnace, Machine_HV_ArcFurnace, Machine_EV_ArcFurnace, Machine_IV_ArcFurnace, + Machine_LV_PlasmaArcFurnace, Machine_MV_PlasmaArcFurnace, Machine_HV_PlasmaArcFurnace, Machine_EV_PlasmaArcFurnace, Machine_IV_PlasmaArcFurnace, + Machine_LV_Oven, Machine_MV_Oven, Machine_HV_Oven, Machine_EV_Oven, Machine_IV_Oven, + Machine_LV_E_Furnace, Machine_MV_E_Furnace, Machine_HV_E_Furnace, Machine_EV_E_Furnace, Machine_IV_E_Furnace, + Machine_LV_Extractor, Machine_MV_Extractor, Machine_HV_Extractor, Machine_EV_Extractor, Machine_IV_Extractor, + Machine_LV_Extruder, Machine_MV_Extruder, Machine_HV_Extruder, Machine_EV_Extruder, Machine_IV_Extruder, + Machine_LV_Lathe, Machine_MV_Lathe, Machine_HV_Lathe, Machine_EV_Lathe, Machine_IV_Lathe, + Machine_LV_Macerator, Machine_MV_Macerator, Machine_HV_Macerator, Machine_EV_Macerator, Machine_IV_Macerator, + Machine_LV_Microwave, Machine_MV_Microwave, Machine_HV_Microwave, Machine_EV_Microwave, Machine_IV_Microwave, + Machine_LV_Printer, Machine_MV_Printer, Machine_HV_Printer, Machine_EV_Printer, Machine_IV_Printer, + Machine_LV_Recycler, Machine_MV_Recycler, Machine_HV_Recycler, Machine_EV_Recycler, Machine_IV_Recycler, + Machine_LV_Scanner, Machine_MV_Scanner, Machine_HV_Scanner, Machine_EV_Scanner, Machine_IV_Scanner, + Machine_LV_Wiremill, Machine_MV_Wiremill, Machine_HV_Wiremill, Machine_EV_Wiremill, Machine_IV_Wiremill, + Machine_LV_Electrolyzer, Machine_MV_Electrolyzer, Machine_HV_Electrolyzer, Machine_EV_Electrolyzer, Machine_IV_Electrolyzer, + Machine_LV_Centrifuge, Machine_MV_Centrifuge, Machine_HV_Centrifuge, Machine_EV_Centrifuge, Machine_IV_Centrifuge, + Machine_LV_ThermalCentrifuge, Machine_MV_ThermalCentrifuge, Machine_HV_ThermalCentrifuge, Machine_EV_ThermalCentrifuge, Machine_IV_ThermalCentrifuge, + Machine_LV_OreWasher, Machine_MV_OreWasher, Machine_HV_OreWasher, Machine_EV_OreWasher, Machine_IV_OreWasher, + Machine_LV_RockBreaker, Machine_MV_RockBreaker, Machine_HV_RockBreaker, Machine_EV_RockBreaker, Machine_IV_RockBreaker, + Machine_LV_Boxinator, Machine_MV_Boxinator, Machine_HV_Boxinator, Machine_EV_Boxinator, Machine_IV_Boxinator, + Machine_LV_Unboxinator, Machine_MV_Unboxinator, Machine_HV_Unboxinator, Machine_EV_Unboxinator, Machine_IV_Unboxinator, + Machine_LV_ChemicalReactor, Machine_MV_ChemicalReactor, Machine_HV_ChemicalReactor, Machine_EV_ChemicalReactor, Machine_IV_ChemicalReactor, + Machine_LV_FluidCanner, Machine_MV_FluidCanner, Machine_HV_FluidCanner, Machine_EV_FluidCanner, Machine_IV_FluidCanner, + Machine_LV_Disassembler, Machine_MV_Disassembler, Machine_HV_Disassembler, Machine_EV_Disassembler, Machine_IV_Disassembler, + Machine_LV_Bundler, Machine_MV_Bundler, Machine_HV_Bundler, Machine_EV_Bundler, Machine_IV_Bundler, + Machine_LV_Massfab, Machine_MV_Massfab, Machine_HV_Massfab, Machine_EV_Massfab, Machine_IV_Massfab, + Machine_LV_Amplifab, Machine_MV_Amplifab, Machine_HV_Amplifab, Machine_EV_Amplifab, Machine_IV_Amplifab, + Machine_LV_Replicator, Machine_MV_Replicator, Machine_HV_Replicator, Machine_EV_Replicator, Machine_IV_Replicator, + Machine_LV_Brewery, Machine_MV_Brewery, Machine_HV_Brewery, Machine_EV_Brewery, Machine_IV_Brewery, + Machine_LV_Fermenter, Machine_MV_Fermenter, Machine_HV_Fermenter, Machine_EV_Fermenter, Machine_IV_Fermenter, + Machine_LV_FluidExtractor, Machine_MV_FluidExtractor, Machine_HV_FluidExtractor, Machine_EV_FluidExtractor, Machine_IV_FluidExtractor, + Machine_LV_FluidSolidifier, Machine_MV_FluidSolidifier, Machine_HV_FluidSolidifier, Machine_EV_FluidSolidifier, Machine_IV_FluidSolidifier, + Machine_LV_Distillery, Machine_MV_Distillery, Machine_HV_Distillery, Machine_EV_Distillery, Machine_IV_Distillery, + Machine_LV_ChemicalBath, Machine_MV_ChemicalBath, Machine_HV_ChemicalBath, Machine_EV_ChemicalBath, Machine_IV_ChemicalBath, + Machine_LV_Polarizer, Machine_MV_Polarizer, Machine_HV_Polarizer, Machine_EV_Polarizer, Machine_IV_Polarizer, + Machine_LV_ElectromagneticSeparator, Machine_MV_ElectromagneticSeparator, Machine_HV_ElectromagneticSeparator, Machine_EV_ElectromagneticSeparator, Machine_IV_ElectromagneticSeparator, + Machine_LV_Autoclave, Machine_MV_Autoclave, Machine_HV_Autoclave, Machine_EV_Autoclave, Machine_IV_Autoclave, + Machine_LV_Mixer, Machine_MV_Mixer, Machine_HV_Mixer, Machine_EV_Mixer, Machine_IV_Mixer, + Machine_LV_LaserEngraver, Machine_MV_LaserEngraver, Machine_HV_LaserEngraver, Machine_EV_LaserEngraver, Machine_IV_LaserEngraver, + Machine_LV_Press, Machine_MV_Press, Machine_HV_Press, Machine_EV_Press, Machine_IV_Press, + Machine_LV_Hammer, Machine_MV_Hammer, Machine_HV_Hammer, Machine_EV_Hammer, Machine_IV_Hammer, + Machine_LV_FluidHeater, Machine_MV_FluidHeater, Machine_HV_FluidHeater, Machine_EV_FluidHeater, Machine_IV_FluidHeater, + + Neutron_Reflector, + Reactor_Coolant_He_1, + Reactor_Coolant_He_3, + Reactor_Coolant_He_6, + Reactor_Coolant_NaK_1, + Reactor_Coolant_NaK_3, + Reactor_Coolant_NaK_6, + ThoriumCell_1, + ThoriumCell_2, + ThoriumCell_4, + FusionComputer_LuV, + FusionComputer_ZPMV, + FusionComputer_UV, + Casing_Fusion_Coil, + Casing_Fusion, + Casing_Fusion2, + Generator_Plasma_IV, + Generator_Plasma_LuV, + Generator_Plasma_ZPMV, + MagicEnergyConverter_LV, + MagicEnergyConverter_MV, + MagicEnergyConverter_HV, + MagicEnergyAbsorber_LV, + MagicEnergyAbsorber_MV, + MagicEnergyAbsorber_HV, + MagicEnergyAbsorber_EV, + Depleted_Thorium_1, + Depleted_Thorium_2, + Depleted_Thorium_4, + Processing_Array, + Distillation_Tower, + Energy_LapotronicOrb2, + ZPM2, Quantum_Tank_LV,Quantum_Tank_MV,Quantum_Tank_HV,Quantum_Tank_EV,Quantum_Tank_IV, Quantum_Chest_LV, Quantum_Chest_MV, Quantum_Chest_HV, Quantum_Chest_EV, Quantum_Chest_IV, + + NULL, Cover_RedstoneTransmitterExternal,Cover_RedstoneTransmitterInternal,Cover_RedstoneReceiverExternal,Cover_RedstoneReceiverInternal, + LargeSteamTurbine, + Ingot_Heavy1,Ingot_Heavy2,Ingot_Heavy3, + Pump_LV, Pump_MV, Pump_HV, Pump_EV, Pump_IV, + Teleporter, + Cover_NeedsMaintainance, + Casing_Turbine, + MobRep_LV,MobRep_MV,MobRep_HV,MobRep_EV,MobRep_IV, LargeGasTurbine, LargeHPSteamTurbine, LargePlasmaTurbine, Cover_PlayerDetector, Machine_Multi_HeatExchanger; + + public static final ItemList[] + DYE_ONLY_ITEMS = {Color_00, Color_01, Color_02, Color_03, Color_04, Color_05, Color_06, Color_07, Color_08, Color_09, Color_10, Color_11, Color_12, Color_13, Color_14, Color_15} + , SPRAY_CAN_DYES = {Spray_Color_00, Spray_Color_01, Spray_Color_02, Spray_Color_03, Spray_Color_04, Spray_Color_05, Spray_Color_06, Spray_Color_07, Spray_Color_08, Spray_Color_09, Spray_Color_10, Spray_Color_11, Spray_Color_12, Spray_Color_13, Spray_Color_14, Spray_Color_15} + , SPRAY_CAN_DYES_USED = {Spray_Color_Used_00, Spray_Color_Used_01, Spray_Color_Used_02, Spray_Color_Used_03, Spray_Color_Used_04, Spray_Color_Used_05, Spray_Color_Used_06, Spray_Color_Used_07, Spray_Color_Used_08, Spray_Color_Used_09, Spray_Color_Used_10, Spray_Color_Used_11, Spray_Color_Used_12, Spray_Color_Used_13, Spray_Color_Used_14, Spray_Color_Used_15} + , TRANSFORMERS = {Transformer_LV_ULV, Transformer_MV_LV, Transformer_HV_MV, Transformer_EV_HV, Transformer_IV_EV, Transformer_LuV_IV, Transformer_ZPM_LuV, Transformer_UV_ZPM, Transformer_MAX_UV} + , MACHINE_HULLS = {Hull_ULV, Hull_LV, Hull_MV, Hull_HV, Hull_EV, Hull_IV, Hull_LuV, Hull_ZPM, Hull_UV, Hull_MAX} + , HATCHES_DYNAMO = {Hatch_Dynamo_ULV, Hatch_Dynamo_LV, Hatch_Dynamo_MV, Hatch_Dynamo_HV, Hatch_Dynamo_EV, Hatch_Dynamo_IV, Hatch_Dynamo_LuV, Hatch_Dynamo_ZPM, Hatch_Dynamo_UV, Hatch_Dynamo_MAX} + , HATCHES_ENERGY = {Hatch_Energy_ULV, Hatch_Energy_LV, Hatch_Energy_MV, Hatch_Energy_HV, Hatch_Energy_EV, Hatch_Energy_IV, Hatch_Energy_LuV, Hatch_Energy_ZPM, Hatch_Energy_UV, Hatch_Energy_MAX} + , HATCHES_INPUT = {Hatch_Input_ULV, Hatch_Input_LV, Hatch_Input_MV, Hatch_Input_HV, Hatch_Input_EV, Hatch_Input_IV, Hatch_Input_LuV, Hatch_Input_ZPM, Hatch_Input_UV, Hatch_Input_MAX} + , HATCHES_INPUT_BUS = {Hatch_Input_Bus_ULV, Hatch_Input_Bus_LV, Hatch_Input_Bus_MV, Hatch_Input_Bus_HV, Hatch_Input_Bus_EV, Hatch_Input_Bus_IV, Hatch_Input_Bus_LuV, Hatch_Input_Bus_ZPM, Hatch_Input_Bus_UV, Hatch_Input_Bus_MAX} + , HATCHES_OUTPUT = {Hatch_Output_ULV, Hatch_Output_LV, Hatch_Output_MV, Hatch_Output_HV, Hatch_Output_EV, Hatch_Output_IV, Hatch_Output_LuV, Hatch_Output_ZPM, Hatch_Output_UV, Hatch_Output_MAX} + , HATCHES_OUTPUT_BUS = {Hatch_Output_Bus_ULV, Hatch_Output_Bus_LV, Hatch_Output_Bus_MV, Hatch_Output_Bus_HV, Hatch_Output_Bus_EV, Hatch_Output_Bus_IV, Hatch_Output_Bus_LuV, Hatch_Output_Bus_ZPM, Hatch_Output_Bus_UV, Hatch_Output_Bus_MAX} + , HATCHES_MUFFLER = {Hatch_Muffler_LV, Hatch_Muffler_LV, Hatch_Muffler_MV, Hatch_Muffler_HV, Hatch_Muffler_EV, Hatch_Muffler_IV, Hatch_Muffler_LuV, Hatch_Muffler_ZPM, Hatch_Muffler_UV, Hatch_Muffler_MAX} + ; + private ItemStack mStack; + private boolean mHasNotBeenSet = true; + + public static Fluid sOilExtraHeavy, sOilHeavy, sOilMedium, sOilLight, sNaturalGas; + + @Override + public IItemContainer set(Item aItem) { + mHasNotBeenSet = false; + if (aItem == null) return this; + ItemStack aStack = new ItemStack(aItem, 1, 0); + mStack = GT_Utility.copyAmount(1, aStack); + return this; + } + + @Override + public IItemContainer set(ItemStack aStack) { + mHasNotBeenSet = false; + mStack = GT_Utility.copyAmount(1, aStack); + return this; + } + + @Override + public Item getItem() { + if (mHasNotBeenSet) throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!"); + if (GT_Utility.isStackInvalid(mStack)) return null; + return mStack.getItem(); + } + + @Override + public Block getBlock() { + if (mHasNotBeenSet) throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!"); + return GT_Utility.getBlockFromStack(getItem()); + } + + @Override + public final boolean hasBeenSet() { + return !mHasNotBeenSet; + } + + @Override + public boolean isStackEqual(Object aStack) { + return isStackEqual(aStack, false, false); + } + + @Override + public boolean isStackEqual(Object aStack, boolean aWildcard, boolean aIgnoreNBT) { + if (GT_Utility.isStackInvalid(aStack)) return false; + return GT_Utility.areUnificationsEqual((ItemStack)aStack, aWildcard?getWildcard(1):get(1), aIgnoreNBT); + } + + @Override + public ItemStack get(long aAmount, Object... aReplacements) { + if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements); + return GT_Utility.copyAmount(aAmount, GT_OreDictUnificator.get(mStack)); + } + + @Override + public ItemStack getWildcard(long aAmount, Object... aReplacements) { + if (mHasNotBeenSet) throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!"); + if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements); + return GT_Utility.copyAmountAndMetaData(aAmount, W, GT_OreDictUnificator.get(mStack)); + } + + @Override + public ItemStack getUndamaged(long aAmount, Object... aReplacements) { + if (mHasNotBeenSet) throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!"); + if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements); + return GT_Utility.copyAmountAndMetaData(aAmount, 0, GT_OreDictUnificator.get(mStack)); + } + + @Override + public ItemStack getAlmostBroken(long aAmount, Object... aReplacements) { + if (mHasNotBeenSet) throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!"); + if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements); + return GT_Utility.copyAmountAndMetaData(aAmount, mStack.getMaxDamage()-1, GT_OreDictUnificator.get(mStack)); + } + + @Override + public ItemStack getWithName(long aAmount, String aDisplayName, Object... aReplacements) { + ItemStack rStack = get(1, aReplacements); + if (GT_Utility.isStackInvalid(rStack)) return null; + rStack.setStackDisplayName(aDisplayName); + return GT_Utility.copyAmount(aAmount, rStack); + } + + @Override + public ItemStack getWithCharge(long aAmount, int aEnergy, Object... aReplacements) { + ItemStack rStack = get(1, aReplacements); + if (GT_Utility.isStackInvalid(rStack)) return null; + GT_ModHandler.chargeElectricItem(rStack, aEnergy, Integer.MAX_VALUE, true, false); + return GT_Utility.copyAmount(aAmount, rStack); + } + + @Override + public ItemStack getWithDamage(long aAmount, long aMetaValue, Object... aReplacements) { + return GT_Utility.copyAmountAndMetaData(aAmount, aMetaValue, GT_OreDictUnificator.get(mStack)); + } + + @Override + public IItemContainer registerOre(Object... aOreNames) { + if (mHasNotBeenSet) throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!"); + for (Object tOreName : aOreNames) GT_OreDictUnificator.registerOre(tOreName, get(1)); + return this; + } + + @Override + public IItemContainer registerWildcardAsOre(Object... aOreNames) { + if (mHasNotBeenSet) throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!"); + for (Object tOreName : aOreNames) GT_OreDictUnificator.registerOre(tOreName, getWildcard(1)); + return this; + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/enums/Materials.java b/src/main/java/gregtech/api/enums/Materials.java new file mode 100644 index 0000000..b59f734 --- /dev/null +++ b/src/main/java/gregtech/api/enums/Materials.java @@ -0,0 +1,1673 @@ +package gregtech.api.enums; + +import static gregtech.api.enums.GT_Values.F; +import static gregtech.api.enums.GT_Values.M; +import static gregtech.api.enums.GT_Values.MOD_ID_TC; +import static gregtech.api.enums.GT_Values.T; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; + +import cpw.mods.fml.common.Loader; +import gregtech.api.GregTech_API; +import gregtech.api.enums.TC_Aspects.TC_AspectStack; +import gregtech.api.interfaces.IColorModulationContainer; +import gregtech.api.interfaces.ISubTagContainer; +import gregtech.api.objects.GT_FluidStack; +import gregtech.api.objects.MaterialStack; +import gregtech.api.util.GT_Config; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Utility; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; + +/** + * This List contains every Material I know about, and is used to determine Recipes for the + */ +public enum Materials implements IColorModulationContainer, ISubTagContainer { + /** + * This is the Default Material returned in case no Material has been found or a NullPointer has been inserted at a location where it shouldn't happen. + * + * Mainly for preventing NullPointer Exceptions and providing Default Values. + */ + _NULL ( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "NULL" , 0, 0, 0, 0, F, F, 1, 1, 1, Dyes._NULL , Element._NULL , Arrays.asList(new TC_AspectStack(TC_Aspects.VACUOS, 1))), + + /** + * Direct Elements + */ + Aluminium ( 19, TextureSet.SET_DULL , 10.0F, 128, 2, 1|2 |8 |32|64|128 , 128, 200, 240, 0, "Aluminium" , 0, 0, 933, 1700, T, F, 3, 1, 1, Dyes.dyeLightBlue , Element.Al , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.VOLATUS, 1))), + Americium ( 103, TextureSet.SET_METALLIC , 1.0F, 0, 3, 1|2 |8 |32 , 200, 200, 200, 0, "Americium" , 0, 0, 1449, 0, F, F, 3, 1, 1, Dyes.dyeLightGray , Element.Am , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.RADIO, 1))), + Antimony ( 58, TextureSet.SET_SHINY , 1.0F, 0, 2, 1|2 |8 |32 , 220, 220, 240, 0, "Antimony" , 0, 0, 903, 0, F, F, 2, 1, 1, Dyes.dyeLightGray , Element.Sb , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.AQUA, 1))), + Argon ( 24, TextureSet.SET_FLUID , 1.0F, 0, 2, 16|32 , 0, 255, 0, 240, "Argon" , 0, 0, 83, 0, F, T, 5, 1, 1, Dyes.dyeGreen , Element.Ar , Arrays.asList(new TC_AspectStack(TC_Aspects.AER, 2))), + Arsenic ( 39, TextureSet.SET_DULL , 1.0F, 0, 2, 1|2 |8|16|32 , 255, 255, 255, 0, "Arsenic" , 0, 0, 1090, 0, F, F, 3, 1, 1, Dyes.dyeOrange , Element.As , Arrays.asList(new TC_AspectStack(TC_Aspects.VENENUM, 3))), + Barium ( 63, TextureSet.SET_METALLIC , 1.0F, 0, 2, 1 |8 |32 , 255, 255, 255, 0, "Barium" , 0, 0, 1000, 0, F, F, 1, 1, 1, Dyes._NULL , Element.Ba , Arrays.asList(new TC_AspectStack(TC_Aspects.VINCULUM, 3))), + Beryllium ( 8, TextureSet.SET_METALLIC , 14.0F, 64, 2, 1|2 |8 |32|64 , 100, 180, 100, 0, "Beryllium" , 0, 0, 1560, 0, F, F, 6, 1, 1, Dyes.dyeGreen , Element.Be , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.LUCRUM, 1))), + Bismuth ( 90, TextureSet.SET_METALLIC , 6.0F, 64, 1, 1|2 |8 |32|64|128 , 100, 160, 160, 0, "Bismuth" , 0, 0, 544, 0, F, F, 2, 1, 1, Dyes.dyeCyan , Element.Bi , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.INSTRUMENTUM, 1))), + Boron ( 9, TextureSet.SET_DULL , 1.0F, 0, 2, 1 |8 |32 , 250, 250, 250, 0, "Boron" , 0, 0, 2349, 0, F, F, 1, 1, 1, Dyes.dyeWhite , Element.B , Arrays.asList(new TC_AspectStack(TC_Aspects.VITREUS, 3))), + Caesium ( 62, TextureSet.SET_METALLIC , 1.0F, 0, 2, 1|2 |8 |32 , 255, 255, 255, 0, "Caesium" , 0, 0, 301, 0, F, F, 4, 1, 1, Dyes._NULL , Element.Cs , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.RADIO, 1))), + Calcium ( 26, TextureSet.SET_METALLIC , 1.0F, 0, 2, 1 |32 , 255, 245, 245, 0, "Calcium" , 0, 0, 1115, 0, F, F, 4, 1, 1, Dyes.dyePink , Element.Ca , Arrays.asList(new TC_AspectStack(TC_Aspects.SANO, 1), new TC_AspectStack(TC_Aspects.TUTAMEN, 1))), + Carbon ( 10, TextureSet.SET_DULL , 1.0F, 64, 2, 1|2 |32|64|128 , 20, 20, 20, 0, "Carbon" , 0, 0, 3800, 0, F, F, 2, 1, 1, Dyes.dyeBlack , Element.C , Arrays.asList(new TC_AspectStack(TC_Aspects.VITREUS, 1), new TC_AspectStack(TC_Aspects.IGNIS, 1))), + Cadmium ( 55, TextureSet.SET_SHINY , 1.0F, 0, 2, 1 |8 |32 , 50, 50, 60, 0, "Cadmium" , 0, 0, 594, 0, F, F, 3, 1, 1, Dyes.dyeGray , Element.Cd , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 1), new TC_AspectStack(TC_Aspects.POTENTIA, 1), new TC_AspectStack(TC_Aspects.VENENUM, 1))), + Cerium ( 65, TextureSet.SET_METALLIC , 1.0F, 0, 2, 1|2 |8 |32 , 255, 255, 255, 0, "Cerium" , 0, 0, 1068, 1068, T, F, 4, 1, 1, Dyes._NULL , Element.Ce , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.RADIO, 1))), + Chlorine ( 23, TextureSet.SET_FLUID , 1.0F, 0, 2, 16|32 , 255, 255, 255, 0, "Chlorine" , 0, 0, 171, 0, F, F, 2, 1, 1, Dyes.dyeCyan , Element.Cl , Arrays.asList(new TC_AspectStack(TC_Aspects.AQUA, 2), new TC_AspectStack(TC_Aspects.PANNUS, 1))), + Chrome ( 30, TextureSet.SET_SHINY , 11.0F, 256, 3, 1|2 |8 |32|64|128 , 255, 230, 230, 0, "Chrome" , 0, 0, 2180, 1700, T, F, 5, 1, 1, Dyes.dyePink , Element.Cr , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.MACHINA, 1))), + Cobalt ( 33, TextureSet.SET_METALLIC , 8.0F, 512, 3, 1|2 |8 |32|64 , 80, 80, 250, 0, "Cobalt" , 0, 0, 1768, 0, F, F, 3, 1, 1, Dyes.dyeBlue , Element.Co , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.INSTRUMENTUM, 1))), + Copper ( 35, TextureSet.SET_SHINY , 1.0F, 0, 1, 1|2 |8 |32 |128 , 255, 100, 0, 0, "Copper" , 0, 0, 1357, 0, F, F, 3, 1, 1, Dyes.dyeOrange , Element.Cu , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.PERMUTATIO, 1))), + Deuterium ( 2, TextureSet.SET_FLUID , 1.0F, 0, 2, 16|32 , 255, 255, 0, 240, "Deuterium" , 0, 0, 14, 0, F, T, 10, 1, 1, Dyes.dyeYellow , Element.D , Arrays.asList(new TC_AspectStack(TC_Aspects.AQUA, 3))), + Dysprosium ( 73, TextureSet.SET_METALLIC , 1.0F, 0, 2, 1|2 |8 |32 , 255, 255, 255, 0, "Dysprosium" , 0, 0, 1680, 1680, T, F, 4, 1, 1, Dyes._NULL , Element.Dy , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 3))), + Empty ( 0, TextureSet.SET_NONE , 1.0F, 0, 2, 256/*Only for Prefixes which need it*/, 255, 255, 255, 255, "Empty" , 0, 0, -1, 0, F, T, 1, 1, 1, Dyes._NULL , Element._NULL , Arrays.asList(new TC_AspectStack(TC_Aspects.VACUOS, 2))), + Erbium ( 75, TextureSet.SET_METALLIC , 1.0F, 0, 2, 1|2 |8 |32 , 255, 255, 255, 0, "Erbium" , 0, 0, 1802, 1802, T, F, 4, 1, 1, Dyes._NULL , Element.Er , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.RADIO, 1))), + Europium ( 70, TextureSet.SET_METALLIC , 1.0F, 0, 2, 1|2 |8 |32 , 255, 255, 255, 0, "Europium" , 0, 0, 1099, 1099, T, F, 4, 1, 1, Dyes._NULL , Element.Eu , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.RADIO, 1))), + Fluorine ( 14, TextureSet.SET_FLUID , 1.0F, 0, 2, 16|32 , 255, 255, 255, 127, "Fluorine" , 0, 0, 53, 0, F, T, 2, 1, 1, Dyes.dyeGreen , Element.F , Arrays.asList(new TC_AspectStack(TC_Aspects.PERDITIO, 2))), + Gadolinium ( 71, TextureSet.SET_METALLIC , 1.0F, 0, 2, 1|2 |8 |32 , 255, 255, 255, 0, "Gadolinium" , 0, 0, 1585, 1585, T, F, 4, 1, 1, Dyes._NULL , Element.Gd , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.RADIO, 1))), + Gallium ( 37, TextureSet.SET_SHINY , 1.0F, 64, 2, 1|2 |8 |32 , 220, 220, 255, 0, "Gallium" , 0, 0, 302, 0, F, F, 5, 1, 1, Dyes.dyeLightGray , Element.Ga , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.ELECTRUM, 1))), + Gold ( 86, TextureSet.SET_SHINY , 12.0F, 64, 2, 1|2 |8 |32|64|128 , 255, 255, 30, 0, "Gold" , 0, 0, 1337, 0, F, F, 4, 1, 1, Dyes.dyeYellow , Element.Au , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.LUCRUM, 2))), + Holmium ( 74, TextureSet.SET_METALLIC , 1.0F, 0, 2, 1|2 |8 |32 , 255, 255, 255, 0, "Holmium" , 0, 0, 1734, 1734, T, F, 4, 1, 1, Dyes._NULL , Element.Ho , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.RADIO, 1))), + Hydrogen ( 1, TextureSet.SET_FLUID , 1.0F, 0, 2, 16|32 , 0, 0, 255, 240, "Hydrogen" , 1, 15, 14, 0, F, T, 2, 1, 1, Dyes.dyeBlue , Element.H , Arrays.asList(new TC_AspectStack(TC_Aspects.AQUA, 1))), + Helium ( 4, TextureSet.SET_FLUID , 1.0F, 0, 2, 16|32 , 255, 255, 0, 240, "Helium" , 0, 0, 1, 0, F, T, 5, 1, 1, Dyes.dyeYellow , Element.He , Arrays.asList(new TC_AspectStack(TC_Aspects.AER, 2))), + Helium_3 ( 5, TextureSet.SET_FLUID , 1.0F, 0, 2, 16|32 , 255, 255, 0, 240, "Helium-3" , 0, 0, 1, 0, F, T, 10, 1, 1, Dyes.dyeYellow , Element.He_3 , Arrays.asList(new TC_AspectStack(TC_Aspects.AER, 3))), + Indium ( 56, TextureSet.SET_METALLIC , 1.0F, 0, 2, 1|2 |8 |32 , 64, 0, 128, 0, "Indium" , 0, 0, 429, 0, F, F, 4, 1, 1, Dyes.dyeGray , Element.In , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.RADIO, 1))), + Iridium ( 84, TextureSet.SET_DULL , 6.0F, 5120, 4, 1|2 |8 |32|64|128 , 240, 240, 245, 0, "Iridium" , 0, 0, 2719, 0, F, F, 10, 1, 1, Dyes.dyeWhite , Element.Ir , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.MACHINA, 1))), + Iron ( 32, TextureSet.SET_METALLIC , 6.0F, 256, 2, 1|2 |8 |32|64|128 , 200, 200, 200, 0, "Iron" , 0, 0, 1811, 0, F, F, 3, 1, 1, Dyes.dyeLightGray , Element.Fe , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 3))), + Lanthanum ( 64, TextureSet.SET_METALLIC , 1.0F, 0, 2, 1|2 |8 |32 , 255, 255, 255, 0, "Lanthanum" , 0, 0, 1193, 1193, T, F, 4, 1, 1, Dyes._NULL , Element.La , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.RADIO, 1))), + Lead ( 89, TextureSet.SET_DULL , 8.0F, 64, 1, 1|2 |8 |32|64|128 , 140, 100, 140, 0, "Lead" , 0, 0, 600, 0, F, F, 3, 1, 1, Dyes.dyePurple , Element.Pb , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.ORDO, 1))), + Lithium ( 6, TextureSet.SET_DULL , 1.0F, 0, 2, 1|2 |8 |32 , 225, 220, 255, 0, "Lithium" , 0, 0, 454, 0, F, F, 4, 1, 1, Dyes.dyeLightBlue , Element.Li , Arrays.asList(new TC_AspectStack(TC_Aspects.VITREUS, 1), new TC_AspectStack(TC_Aspects.POTENTIA, 2))), + Lutetium ( 78, TextureSet.SET_METALLIC , 1.0F, 0, 2, 1|2 |8 |32 , 255, 255, 255, 0, "Lutetium" , 0, 0, 1925, 1925, T, F, 4, 1, 1, Dyes._NULL , Element.Lu , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.RADIO, 1))), + Magic (-128, TextureSet.SET_SHINY , 8.0F, 5120, 5, 1|2|4|8|16|32|64|128 , 100, 0, 200, 0, "Magic" , 5, 32, 5000, 0, F, F, 7, 1, 1, Dyes.dyePurple , Element.Ma , Arrays.asList(new TC_AspectStack(TC_Aspects.PRAECANTIO, 4))), + Magnesium ( 18, TextureSet.SET_METALLIC , 1.0F, 0, 2, 1|2 |8 |32 , 255, 200, 200, 0, "Magnesium" , 0, 0, 923, 0, F, F, 3, 1, 1, Dyes.dyePink , Element.Mg , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.SANO, 1))), + Manganese ( 31, TextureSet.SET_DULL , 7.0F, 512, 2, 1|2 |8 |32|64 , 250, 250, 250, 0, "Manganese" , 0, 0, 1519, 0, F, F, 3, 1, 1, Dyes.dyeWhite , Element.Mn , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 3))), + Mercury ( 87, TextureSet.SET_SHINY , 1.0F, 0, 0, 16|32 , 255, 220, 220, 0, "Mercury" , 5, 32, 234, 0, F, F, 3, 1, 1, Dyes.dyeLightGray , Element.Hg , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 1), new TC_AspectStack(TC_Aspects.AQUA, 1), new TC_AspectStack(TC_Aspects.VENENUM, 1))), + Molybdenum ( 48, TextureSet.SET_SHINY , 7.0F, 512, 2, 1|2 |8 |32|64 , 180, 180, 220, 0, "Molybdenum" , 0, 0, 2896, 0, F, F, 1, 1, 1, Dyes.dyeBlue , Element.Mo , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.INSTRUMENTUM, 1))), + Neodymium ( 67, TextureSet.SET_METALLIC , 7.0F, 512, 2, 1|2 |8 |32|64|128 , 100, 100, 100, 0, "Neodymium" , 0, 0, 1297, 1297, T, F, 4, 1, 1, Dyes._NULL , Element.Nd , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.MAGNETO, 2))), + Neutronium ( 129, TextureSet.SET_DULL , 6.0F, 81920, 6, 1|2 |8 |32|64|128 , 250, 250, 250, 0, "Neutronium" , 0, 0, 10000, 0, F, F, 20, 1, 1, Dyes.dyeWhite , Element.Nt , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 4), new TC_AspectStack(TC_Aspects.VITREUS, 3), new TC_AspectStack(TC_Aspects.ALIENIS, 2))), + Nickel ( 34, TextureSet.SET_METALLIC , 6.0F, 64, 2, 1|2 |8 |32|64|128 , 200, 200, 250, 0, "Nickel" , 0, 0, 1728, 0, F, F, 4, 1, 1, Dyes.dyeLightBlue , Element.Ni , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.IGNIS, 1))), + Niobium ( 47, TextureSet.SET_METALLIC , 1.0F, 0, 2, 1|2 |8 |32 , 190, 180, 200, 0, "Niobium" , 0, 0, 2750, 2750, T, F, 5, 1, 1, Dyes._NULL , Element.Nb , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.ELECTRUM, 1))), + Nitrogen ( 12, TextureSet.SET_FLUID , 1.0F, 0, 2, 16|32 , 0, 150, 200, 240, "Nitrogen" , 0, 0, 63, 0, F, T, 2, 1, 1, Dyes.dyeCyan , Element.N , Arrays.asList(new TC_AspectStack(TC_Aspects.AER, 2))), + Osmium ( 83, TextureSet.SET_METALLIC , 16.0F, 1280, 4, 1|2 |8 |32|64|128 , 50, 50, 255, 0, "Osmium" , 0, 0, 3306, 0, F, F, 10, 1, 1, Dyes.dyeBlue , Element.Os , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.MACHINA, 1), new TC_AspectStack(TC_Aspects.NEBRISUM, 1))), + Oxygen ( 13, TextureSet.SET_FLUID , 1.0F, 0, 2, 16|32 , 0, 100, 200, 240, "Oxygen" , 0, 0, 54, 0, F, T, 1, 1, 1, Dyes.dyeWhite , Element.O , Arrays.asList(new TC_AspectStack(TC_Aspects.AER, 1))), + Palladium ( 52, TextureSet.SET_SHINY , 8.0F, 512, 2, 1|2 |8 |32|64|128 , 128, 128, 128, 0, "Palladium" , 0, 0, 1828, 1828, F, F, 4, 1, 1, Dyes.dyeGray , Element.Pd , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 3))), + Phosphor ( 21, TextureSet.SET_DULL , 1.0F, 0, 2, 1 |8 |32 , 255, 255, 0, 0, "Phosphor" , 0, 0, 317, 0, F, F, 2, 1, 1, Dyes.dyeYellow , Element.P , Arrays.asList(new TC_AspectStack(TC_Aspects.IGNIS, 2), new TC_AspectStack(TC_Aspects.POTENTIA, 1))), + Platinum ( 85, TextureSet.SET_SHINY , 12.0F, 64, 2, 1|2 |8 |32|64|128 , 255, 255, 200, 0, "Platinum" , 0, 0, 2041, 0, F, F, 6, 1, 1, Dyes.dyeOrange , Element.Pt , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.NEBRISUM, 1))), + Plutonium ( 100, TextureSet.SET_METALLIC , 6.0F, 512, 3, 1|2 |8 |32|64 , 240, 50, 50, 0, "Plutonium 244" , 0, 0, 912, 0, F, F, 6, 1, 1, Dyes.dyeLime , Element.Pu , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.RADIO, 2))), + Plutonium241 ( 101, TextureSet.SET_SHINY , 6.0F, 512, 3, 1|2 |8 |32|64 , 250, 70, 70, 0, "Plutonium 241" , 0, 0, 912, 0, F, F, 6, 1, 1, Dyes.dyeLime , Element.Pu_241 , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.RADIO, 3))), + Potassium ( 25, TextureSet.SET_METALLIC , 1.0F, 0, 1, 1|2 |32 , 250, 250, 250, 0, "Potassium" , 0, 0, 336, 0, F, F, 2, 1, 1, Dyes.dyeWhite , Element.K , Arrays.asList(new TC_AspectStack(TC_Aspects.VITREUS, 1), new TC_AspectStack(TC_Aspects.POTENTIA, 1))), + Praseodymium ( 66, TextureSet.SET_METALLIC , 1.0F, 0, 2, 1|2 |8 |32 , 255, 255, 255, 0, "Praseodymium" , 0, 0, 1208, 1208, T, F, 4, 1, 1, Dyes._NULL , Element.Pr , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.RADIO, 1))), + Promethium ( 68, TextureSet.SET_METALLIC , 1.0F, 0, 2, 1|2 |8 |32 , 255, 255, 255, 0, "Promethium" , 0, 0, 1315, 1315, T, F, 4, 1, 1, Dyes._NULL , Element.Pm , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.RADIO, 1))), + Radon ( 93, TextureSet.SET_FLUID , 1.0F, 0, 2, 16|32 , 255, 0, 255, 240, "Radon" , 0, 0, 202, 0, F, T, 5, 1, 1, Dyes.dyePurple , Element.Rn , Arrays.asList(new TC_AspectStack(TC_Aspects.AER, 1), new TC_AspectStack(TC_Aspects.RADIO, 1))), + Rubidium ( 43, TextureSet.SET_METALLIC , 1.0F, 0, 2, 1|2 |8 |32 , 240, 30, 30, 0, "Rubidium" , 0, 0, 312, 0, F, F, 4, 1, 1, Dyes.dyeRed , Element.Rb , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.VITREUS, 1))), + Samarium ( 69, TextureSet.SET_METALLIC , 1.0F, 0, 2, 1|2 |8 |32 , 255, 255, 255, 0, "Samarium" , 0, 0, 1345, 1345, T, F, 4, 1, 1, Dyes._NULL , Element.Sm , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.RADIO, 1))), + Scandium ( 27, TextureSet.SET_METALLIC , 1.0F, 0, 2, 1|2 |8 |32 , 255, 255, 255, 0, "Scandium" , 0, 0, 1814, 1814, T, F, 2, 1, 1, Dyes.dyeYellow , Element.Sc , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.RADIO, 1))), + Silicon ( 20, TextureSet.SET_METALLIC , 1.0F, 0, 2, 1|2 |8 |32 , 60, 60, 80, 0, "Silicon" , 0, 0, 1687, 1687, T, F, 1, 1, 1, Dyes.dyeBlack , Element.Si , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.TENEBRAE, 1))), + Silver ( 54, TextureSet.SET_SHINY , 10.0F, 64, 2, 1|2 |8 |32|64|128 , 220, 220, 255, 0, "Silver" , 0, 0, 1234, 0, F, F, 3, 1, 1, Dyes.dyeLightGray , Element.Ag , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.LUCRUM, 1))), + Sodium ( 17, TextureSet.SET_METALLIC , 1.0F, 0, 2, 1 |32 , 0, 0, 150, 0, "Sodium" , 0, 0, 370, 0, F, F, 1, 1, 1, Dyes.dyeBlue , Element.Na , Arrays.asList(new TC_AspectStack(TC_Aspects.VITREUS, 2), new TC_AspectStack(TC_Aspects.LUX, 1))), + Strontium ( 44, TextureSet.SET_METALLIC , 1.0F, 0, 2, 1 |8 |32 , 200, 200, 200, 0, "Strontium" , 0, 0, 1050, 0, F, F, 1, 1, 1, Dyes.dyeLightGray , Element.Sr , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.STRONTIO, 1))), + Sulfur ( 22, TextureSet.SET_DULL , 1.0F, 0, 2, 1 |8 |32 , 200, 200, 0, 0, "Sulfur" , 0, 0, 388, 0, F, F, 2, 1, 1, Dyes.dyeYellow , Element.S , Arrays.asList(new TC_AspectStack(TC_Aspects.IGNIS, 1))), + Tantalum ( 80, TextureSet.SET_METALLIC , 1.0F, 0, 2, 1|2 |8 |32 , 255, 255, 255, 0, "Tantalum" , 0, 0, 3290, 0, F, F, 4, 1, 1, Dyes._NULL , Element.Ta , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.VINCULUM, 1))), + Tellurium ( 59, TextureSet.SET_METALLIC , 1.0F, 0, 2, 1|2 |8 |32 , 255, 255, 255, 0, "Tellurium" , 0, 0, 722, 0, F, F, 4, 1, 1, Dyes.dyeGray , Element.Te , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.RADIO, 1))), + Terbium ( 72, TextureSet.SET_METALLIC , 1.0F, 0, 2, 1|2 |8 |32 , 255, 255, 255, 0, "Terbium" , 0, 0, 1629, 1629, T, F, 4, 1, 1, Dyes._NULL , Element.Tb , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.RADIO, 1))), + Thorium ( 96, TextureSet.SET_SHINY , 6.0F, 512, 2, 1|2 |8 |32|64 , 0, 30, 0, 0, "Thorium" , 0, 0, 2115, 0, F, F, 4, 1, 1, Dyes.dyeBlack , Element.Th , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.RADIO, 1))), + Thulium ( 76, TextureSet.SET_METALLIC , 1.0F, 0, 2, 1|2 |8 |32 , 255, 255, 255, 0, "Thulium" , 0, 0, 1818, 1818, T, F, 4, 1, 1, Dyes._NULL , Element.Tm , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.RADIO, 1))), + Tin ( 57, TextureSet.SET_DULL , 1.0F, 0, 1, 1|2 |8 |32 |128 , 220, 220, 220, 0, "Tin" , 0, 0, 505, 505, F, F, 3, 1, 1, Dyes.dyeWhite , Element.Sn , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.VITREUS, 1))), + Titanium ( 28, TextureSet.SET_METALLIC , 8.0F, 2560, 3, 1|2 |8 |32|64|128 , 220, 160, 240, 0, "Titanium" , 0, 0, 1941, 1500, T, F, 5, 1, 1, Dyes.dyePurple , Element.Ti , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.TUTAMEN, 1))), + Tritium ( 3, TextureSet.SET_METALLIC , 1.0F, 0, 2, 16|32 , 255, 0, 0, 240, "Tritium" , 0, 0, 14, 0, F, T, 10, 1, 1, Dyes.dyeRed , Element.T , Arrays.asList(new TC_AspectStack(TC_Aspects.AQUA, 4))), + Tungsten ( 81, TextureSet.SET_METALLIC , 8.0F, 5120, 3, 1|2 |8 |32|64|128 , 50, 50, 50, 0, "Tungsten" , 0, 0, 3695, 2500, T, F, 4, 1, 1, Dyes.dyeBlack , Element.W , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 3), new TC_AspectStack(TC_Aspects.TUTAMEN, 1))), + Uranium ( 98, TextureSet.SET_METALLIC , 6.0F, 512, 3, 1|2 |8 |32|64 , 50, 240, 50, 0, "Uranium 238" , 0, 0, 1405, 0, F, F, 4, 1, 1, Dyes.dyeGreen , Element.U , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.RADIO, 1))), + Uranium235 ( 97, TextureSet.SET_SHINY , 6.0F, 512, 3, 1|2 |8 |32|64 , 70, 250, 70, 0, "Uranium 235" , 0, 0, 1405, 0, F, F, 4, 1, 1, Dyes.dyeGreen , Element.U_235 , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.RADIO, 2))), + Vanadium ( 29, TextureSet.SET_METALLIC , 1.0F, 0, 2, 1|2 |8 |32 , 50, 50, 50, 0, "Vanadium" , 0, 0, 2183, 2183, T, F, 2, 1, 1, Dyes.dyeBlack , Element.V , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.RADIO, 1))), + Ytterbium ( 77, TextureSet.SET_METALLIC , 1.0F, 0, 2, 1|2 |8 |32 , 255, 255, 255, 0, "Ytterbium" , 0, 0, 1097, 1097, T, F, 4, 1, 1, Dyes._NULL , Element.Yb , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.RADIO, 1))), + Yttrium ( 45, TextureSet.SET_METALLIC , 1.0F, 0, 2, 1|2 |8 |32 , 220, 250, 220, 0, "Yttrium" , 0, 0, 1799, 1799, T, F, 4, 1, 1, Dyes._NULL , Element.Y , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.RADIO, 1))), + Zinc ( 36, TextureSet.SET_METALLIC , 1.0F, 0, 1, 1|2 |8 |32 , 250, 240, 240, 0, "Zinc" , 0, 0, 692, 0, F, F, 2, 1, 1, Dyes.dyeWhite , Element.Zn , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.SANO, 1))), + + /** + * The "Random Material" ones. + */ + Organic ( -1, TextureSet.SET_LEAF , 1.0F, 0, 1, F), + AnyCopper ( -1, TextureSet.SET_SHINY , 1.0F, 0, 3, F), + AnyBronze ( -1, TextureSet.SET_SHINY , 1.0F, 0, 3, F), + AnyIron ( -1, TextureSet.SET_SHINY , 1.0F, 0, 3, F), + Crystal ( -1, TextureSet.SET_SHINY , 1.0F, 0, 3, F), + Quartz ( -1, TextureSet.SET_QUARTZ , 1.0F, 0, 2, F), + Metal ( -1, TextureSet.SET_METALLIC , 1.0F, 0, 2, F), + Unknown ( -1, TextureSet.SET_DULL , 1.0F, 0, 2, F), + Cobblestone ( -1, TextureSet.SET_DULL , 1.0F, 0, 1, F), + Brick ( -1, TextureSet.SET_DULL , 1.0F, 0, 1, F), + BrickNether ( -1, TextureSet.SET_DULL , 1.0F, 0, 1, F), + + /** + * The "I don't care" Section, everything I don't want to do anything with right now, is right here. Just to make the Material Finder shut up about them. + * But I do see potential uses in some of these Materials. + */ + TarPitch ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1|2 , 255, 255, 255, 0, "Tar Pitch" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + Carborundum ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1 , 255, 255, 255, 0, "Carborundum" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + Satinspar ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1|2 |8 , 255, 255, 255, 0, "Satinspar" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + Selenite ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1|2 |8 , 255, 255, 255, 0, "Selenite" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + PetrifiedWood ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1 |8 , 255, 255, 255, 0, "Petrified Wood" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + Jet ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1 |4|8 , 255, 255, 255, 0, "Jet" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + Microcline ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1|2 |8 , 255, 255, 255, 0, "Microcline" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + Serpentine ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1|2 |8 , 255, 255, 255, 0, "Serpentine" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + Sylvite ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1|2 |8 , 255, 255, 255, 0, "Sylvite" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + Flux ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1 , 255, 255, 255, 0, "Flux" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + Goshen ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1 , 255, 255, 255, 0, "Goshen" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + Joshen ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1 , 255, 255, 255, 0, "Joshen" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + Itarius ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1 , 255, 255, 255, 0, "Itarius" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + Legendary ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1 , 255, 255, 255, 0, "Legendary" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + MutatedIron ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1 , 255, 255, 255, 0, "Mutated Iron" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + Witheria ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1 , 255, 255, 255, 0, "Witheria" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + RedstoneAlloy ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1 , 255, 255, 255, 0, "Redstone Alloy" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + OsmiumTetroxide ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1 , 255, 255, 255, 0, "Osmium Tetroxide" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + NitricAcid ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 0 , 255, 255, 255, 0, "Nitric Acid" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + RubberTreeSap ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 0 , 255, 255, 255, 0, "Rubber Tree Sap" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + AquaRegia ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 0 , 255, 255, 255, 0, "Aqua Regia" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + SolutionBlueVitriol ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 0 , 255, 255, 255, 0, "Blue Vitriol Solution" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + SolutionNickelSulfate( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 0 , 255, 255, 255, 0, "Nickel Sulfate Solution" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + Signalum ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1|2 , 255, 255, 255, 0, "Signalum" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + Lumium ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1|2 , 255, 255, 255, 0, "Lumium" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + PhasedIron ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1|2 , 255, 255, 255, 0, "Phased Iron" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + PhasedGold ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1|2 , 255, 255, 255, 0, "Phased Gold" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + Soularium ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1 , 255, 255, 255, 0, "Soularium" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + Endium ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1 , 255, 255, 255, 0, "Endium" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + Prismarine ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1 |4 , 255, 255, 255, 0, "Prismarine" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + GraveyardDirt ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1 , 255, 255, 255, 0, "Graveyard Dirt" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + DarkSteel ( 364, TextureSet.SET_DULL , 8.0F, 512, 3, 1|2 |8 |64 , 80, 70, 80, 0, "Dark Steel" , 0, 0, 1811, 0, F, F, 5, 1, 1, Dyes.dyePurple ), + Terrasteel ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1|2 , 255, 255, 255, 0, "Terrasteel" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + TerrasteelAlloyRaw ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1|2 , 255, 255, 255, 0, "Raw Terrasteel Alloy" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + TerrasteelAlloyStrengthened ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1|2 , 255, 255, 255, 0, "Strengthened Terrasteel Alloy" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + ConductiveIron ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1|2 , 255, 255, 255, 0, "Conductive Iron" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + ElectricalSteel ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1|2 , 255, 255, 255, 0, "Electrical Steel" , 0, 0, 1811, 1000, T, F, 3, 1, 1, Dyes._NULL ), + EnergeticAlloy ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1|2 , 255, 255, 255, 0, "Energetic Alloy" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + VibrantAlloy ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1|2 , 255, 255, 255, 0, "Vibrant Alloy" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + PulsatingIron ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1|2 , 255, 255, 255, 0, "Pulsating Iron" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + Rutile ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1 , 255, 255, 255, 0, "Rutile" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), // TiO2 + Teslatite ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1 , 60, 180, 200, 0, "Teslatite" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + Fluix ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1 |4 , 255, 255, 255, 0, "Fluix" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + Manasteel ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1|2 , 255, 255, 255, 0, "Manasteel" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + Tennantite ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1 , 255, 255, 255, 0, "Tennantite" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + DarkThaumium ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1|2 , 255, 255, 255, 0, "Dark Thaumium" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + Alfium ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1 , 255, 255, 255, 0, "Alfium" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + Ryu ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1 , 255, 255, 255, 0, "Ryu" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + Mutation ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1 , 255, 255, 255, 0, "Mutation" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + Aquamarine ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1 |4 , 255, 255, 255, 0, "Aquamarine" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + Ender ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1 , 255, 255, 255, 0, "Ender" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + ElvenElementium ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1|2 , 255, 255, 255, 0, "Elven Elementium" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + EnrichedCopper ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1|2 , 255, 255, 255, 0, "Enriched Copper" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + DiamondCopper ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1|2 , 255, 255, 255, 0, "Diamond Copper" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + SodiumPeroxide ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1 , 255, 255, 255, 0, "Sodium Peroxide" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + IridiumSodiumOxide ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1 , 255, 255, 255, 0, "Iridium Sodium Oxide" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + PlatinumGroupSludge ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1 , 255, 255, 255, 0, "Platinum Group Sluge" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + Fairy ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1|2 , 255, 255, 255, 0, "Fairy" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + Ludicrite ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1|2 , 255, 255, 255, 0, "Ludicrite" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + Pokefennium ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1|2 , 255, 255, 255, 0, "Pokefennium" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + Draconium ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1|2 , 255, 255, 255, 0, "Draconium" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + DraconiumAwakened ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1|2 , 255, 255, 255, 0, "Awakened Draconium" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + PurpleAlloy ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 0 , 100, 180, 255, 0, "Purple Alloy" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + InfusedTeslatite ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 0 , 100, 180, 255, 0, "Infused Teslatite" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + + /** + * Unknown Material Components. Dead End Section. + */ + Adamantium ( 319, TextureSet.SET_SHINY , 10.0F, 5120, 5, 1|2 |8 |64|128 , 255, 255, 255, 0, "Adamantium" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeLightGray ), + Adamite ( -1, TextureSet.SET_NONE , 1.0F, 0, 3, 1 |8 , 255, 255, 255, 0, "Adamite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeLightGray ), + Adluorite ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1 |8 , 255, 255, 255, 0, "Adluorite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL ), + Agate ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1 , 255, 255, 255, 0, "Agate" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + Alduorite ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1 |8|16 , 255, 255, 255, 0, "Alduorite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL ), + Amber ( 514, TextureSet.SET_RUBY , 4.0F, 128, 2, 1 |4|8 |64 , 255, 128, 0, 127, "Amber" , 5, 3, -1, 0, F, T, 1, 1, 1, Dyes.dyeOrange , Arrays.asList(new TC_AspectStack(TC_Aspects.VINCULUM, 2), new TC_AspectStack(TC_Aspects.VITREUS, 1))), + Ammonium ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1 , 255, 255, 255, 0, "Ammonium" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL ), + Amordrine ( -1, TextureSet.SET_NONE , 6.0F, 64, 2, 1|2 |8|16 |64 , 255, 255, 255, 0, "Amordrine" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL ), + Andesite ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1 |8 , 255, 255, 255, 0, "Andesite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL ), + Angmallen ( -1, TextureSet.SET_NONE , 6.0F, 64, 2, 1|2 |8|16 |64 , 255, 255, 255, 0, "Angmallen" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL ), + Ardite ( -1, TextureSet.SET_NONE , 6.0F, 64, 2, 1|2 |8 |64 , 255, 0, 0, 0, "Ardite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeYellow ), + Aredrite ( -1, TextureSet.SET_NONE , 6.0F, 64, 2, 1|2 |8 |64 , 255, 0, 0, 0, "Aredrite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeYellow ), + Atlarus ( -1, TextureSet.SET_NONE , 6.0F, 64, 2, 1|2 |8 |64 , 255, 255, 255, 0, "Atlarus" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL ), + Bitumen ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1 |8 , 255, 255, 255, 0, "Bitumen" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL ), + Black ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 0 , 0, 0, 0, 0, "Black" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes.dyeBlack ), + Blizz ( 851, TextureSet.SET_SHINY , 1.0F, 0, 2, 1 , 220, 233, 255, 0, "Blizz" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + Blueschist ( 852, TextureSet.SET_DULL , 1.0F, 0, 2, 1 , 255, 255, 255, 0, "Blueschist" , 0, 0, -1, 0, F, F, 0, 1, 1, Dyes.dyeLightBlue ), + Bluestone ( 813, TextureSet.SET_DULL , 1.0F, 0, 2, 1 , 255, 255, 255, 0, "Bluestone" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeBlue ), + Bloodstone ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1 , 255, 255, 255, 0, "Bloodstone" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes.dyeRed ), + Blutonium ( -1, TextureSet.SET_SHINY , 1.0F, 0, 2, 1|2 |8 , 0, 0, 255, 0, "Blutonium" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes.dyeBlue ), + Carmot ( -1, TextureSet.SET_NONE , 6.0F, 64, 2, 1|2 |8 |64 , 255, 255, 255, 0, "Carmot" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL ), + Celenegil ( -1, TextureSet.SET_NONE , 6.0F, 64, 2, 1|2 |8|16 |64 , 255, 255, 255, 0, "Celenegil" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL ), + CertusQuartz ( 516, TextureSet.SET_QUARTZ , 5.0F, 32, 1, 1 |4|8 |64 , 210, 210, 230, 0, "Certus Quartz" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes.dyeLightGray , Arrays.asList(new TC_AspectStack(TC_Aspects.POTENTIA, 1), new TC_AspectStack(TC_Aspects.VITREUS, 1))), + Ceruclase ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1|2 |8 , 255, 255, 255, 0, "Ceruclase" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL ), + Citrine ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1 , 255, 255, 255, 0, "Citrine" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + ChargedCertusQuartz ( 517, TextureSet.SET_QUARTZ , 5.0F, 32, 1, 1 |4|8 |64 , 210, 210, 230, 0, "Charged Certus Quartz" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes.dyeLightGray , Arrays.asList(new TC_AspectStack(TC_Aspects.POTENTIA, 2), new TC_AspectStack(TC_Aspects.VITREUS, 1))), + CobaltHexahydrate ( 853, TextureSet.SET_METALLIC , 1.0F, 0, 2, 1 |16 , 80, 80, 250, 0, "Cobalt Hexahydrate" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeBlue ), + ConstructionFoam ( 854, TextureSet.SET_DULL , 1.0F, 0, 2, 1 |16 , 128, 128, 128, 0, "Construction Foam" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeGray ), + Chert ( 857, TextureSet.SET_DULL , 1.0F, 0, 2, 1 , 255, 255, 255, 0, "Chert" , 0, 0, -1, 0, F, F, 0, 1, 1, Dyes._NULL ), + Chimerite ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1 , 255, 255, 255, 0, "Chimerite" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + Coral ( -1, TextureSet.SET_NONE , 1.0F, 0, 1, 1 , 255, 128, 255, 0, "Coral" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + CrudeOil ( 858, TextureSet.SET_DULL , 1.0F, 0, 2, 1 , 10, 10, 10, 0, "Crude Oil" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeBlack ), + Chrysocolla ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1 , 255, 255, 255, 0, "Chrysocolla" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + CrystalFlux ( -1, TextureSet.SET_QUARTZ , 1.0F, 0, 3, 1 |4 , 100, 50, 100, 0, "Flux Crystal" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL ), + Cyanite ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1 , 255, 255, 255, 0, "Cyanite" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes.dyeCyan ), + Dacite ( 859, TextureSet.SET_DULL , 1.0F, 0, 2, 1 , 255, 255, 255, 0, "Dacite" , 0, 0, -1, 0, F, F, 0, 1, 1, Dyes.dyeLightGray ), + DarkIron ( 342, TextureSet.SET_DULL , 7.0F, 384, 3, 1|2 |8 |64 , 55, 40, 60, 0, "Dark Iron" , 0, 0, -1, 0, F, F, 5, 1, 1, Dyes.dyePurple ), + DarkStone ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1 , 255, 255, 255, 0, "Dark Stone" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes.dyeBlack ), + Demonite ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1 , 255, 255, 255, 0, "Demonite" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes.dyeRed ), + Desh ( 884, TextureSet.SET_DULL , 1.0F, 1280, 3, 1|2 |8 |64|128 , 40, 40, 40, 0, "Desh" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeBlack ), + Desichalkos ( -1, TextureSet.SET_NONE , 6.0F, 1280, 3, 1|2 |8|16 |64 , 255, 255, 255, 0, "Desichalkos" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL ), + Dilithium ( 515, TextureSet.SET_DIAMOND , 1.0F, 0, 1, 1 |4|8|16 , 255, 250, 250, 127, "Dilithium" , 0, 0, -1, 0, F, T, 1, 1, 1, Dyes.dyeWhite ), + Draconic ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1 , 255, 255, 255, 0, "Draconic" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeRed ), + Drulloy ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1|16 , 255, 255, 255, 0, "Drulloy" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeRed ), + Duranium ( 328, TextureSet.SET_METALLIC , 8.0F, 1280, 4, 1|2 |64 , 255, 255, 255, 0, "Duranium" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeLightGray ), + Eclogite ( 860, TextureSet.SET_DULL , 1.0F, 0, 2, 1 , 255, 255, 255, 0, "Eclogite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL ), + ElectrumFlux ( 320, TextureSet.SET_SHINY , 16.0F, 512, 3, 1|2 |64 , 255, 255, 120, 0, "Fluxed Electrum" , 0, 0, 3000, 3000, T, F, 1, 1, 1, Dyes.dyeYellow ), + Emery ( 861, TextureSet.SET_DULL , 1.0F, 0, 2, 1 |8 , 255, 255, 255, 0, "Emery" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL ), + Enderium ( 321, TextureSet.SET_DULL , 8.0F, 256, 3, 1|2 |64 , 89, 145, 135, 0, "Enderium" , 0, 0, 3000, 3000, T, F, 1, 1, 1, Dyes.dyeGreen , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.ALIENIS, 1))), + EnderiumBase ( -1, TextureSet.SET_DULL , 8.0F, 256, 3, 1|2 |64 , 89, 145, 135, 0, "Enderium Base" , 0, 0, 3000, 3000, T, F, 1, 1, 1, Dyes.dyeGreen , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.ALIENIS, 1))), + Energized ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 0 , 255, 255, 255, 0, "Energized" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL ), + Epidote ( 862, TextureSet.SET_DULL , 1.0F, 0, 2, 1 , 255, 255, 255, 0, "Epidote" , 0, 0, -1, 0, F, F, 0, 1, 1, Dyes._NULL ), + Eximite ( -1, TextureSet.SET_NONE , 6.0F, 64, 2, 1|2 |8 |64 , 255, 255, 255, 0, "Eximite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL ), + FierySteel ( 346, TextureSet.SET_FIERY , 8.0F, 256, 3, 1|2 |16 |64|128 , 64, 0, 0, 0, "Fiery Steel" , 5, 2048, 1811, 1000, T, F, 1, 1, 1, Dyes.dyeRed , Arrays.asList(new TC_AspectStack(TC_Aspects.PRAECANTIO, 3), new TC_AspectStack(TC_Aspects.IGNIS, 3), new TC_AspectStack(TC_Aspects.CORPUS, 3))), + Firestone ( 347, TextureSet.SET_QUARTZ , 6.0F, 1280, 3, 1 |4|8 |64 , 200, 20, 0, 0, "Firestone" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes.dyeRed ), + Fluorite ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1 |8 , 255, 255, 255, 0, "Fluorite" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes.dyeGreen ), + FoolsRuby ( 512, TextureSet.SET_RUBY , 1.0F, 0, 2, 1 |4|8 , 255, 100, 100, 127, "Ruby" , 0, 0, -1, 0, F, T, 3, 1, 1, Dyes.dyeRed , Arrays.asList(new TC_AspectStack(TC_Aspects.LUCRUM, 2), new TC_AspectStack(TC_Aspects.VITREUS, 2))), + Force ( 521, TextureSet.SET_DIAMOND , 10.0F, 128, 3, 1|2|4|8 |64|128 , 255, 255, 0, 0, "Force" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes.dyeYellow , Arrays.asList(new TC_AspectStack(TC_Aspects.POTENTIA, 5))), + Forcicium ( 518, TextureSet.SET_DIAMOND , 1.0F, 0, 1, 1 |4|8|16 , 50, 50, 70, 0, "Forcicium" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes.dyeGreen , Arrays.asList(new TC_AspectStack(TC_Aspects.POTENTIA, 2))), + Forcillium ( 519, TextureSet.SET_DIAMOND , 1.0F, 0, 1, 1 |4|8|16 , 50, 50, 70, 0, "Forcillium" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes.dyeGreen , Arrays.asList(new TC_AspectStack(TC_Aspects.POTENTIA, 2))), + Gabbro ( 863, TextureSet.SET_DULL , 1.0F, 0, 1, 1 , 255, 255, 255, 0, "Gabbro" , 0, 0, -1, 0, F, F, 0, 1, 1, Dyes._NULL ), + Glowstone ( 811, TextureSet.SET_SHINY , 1.0F, 0, 1, 1 |16 , 255, 255, 0, 0, "Glowstone" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeYellow , Arrays.asList(new TC_AspectStack(TC_Aspects.LUX, 2), new TC_AspectStack(TC_Aspects.SENSUS, 1))), + Gneiss ( 864, TextureSet.SET_DULL , 1.0F, 0, 1, 1 , 255, 255, 255, 0, "Gneiss" , 0, 0, -1, 0, F, F, 0, 1, 1, Dyes._NULL ), + Graphite ( 865, TextureSet.SET_DULL , 5.0F, 32, 2, 1 |8|16 |64 , 128, 128, 128, 0, "Graphite" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes.dyeGray , Arrays.asList(new TC_AspectStack(TC_Aspects.VITREUS, 2), new TC_AspectStack(TC_Aspects.IGNIS, 1))), + Graphene ( 819, TextureSet.SET_DULL , 6.0F, 32, 1, 1 |64 , 128, 128, 128, 0, "Graphene" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes.dyeGray , Arrays.asList(new TC_AspectStack(TC_Aspects.VITREUS, 2), new TC_AspectStack(TC_Aspects.ELECTRUM, 1))), + Greenschist ( 866, TextureSet.SET_DULL , 1.0F, 0, 1, 1 , 255, 255, 255, 0, "Green Schist" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeGreen ), + Greenstone ( 867, TextureSet.SET_DULL , 1.0F, 0, 1, 1 , 255, 255, 255, 0, "Greenstone" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeGreen ), + Greywacke ( 868, TextureSet.SET_DULL , 1.0F, 0, 1, 1 , 255, 255, 255, 0, "Greywacke" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeGray ), + Haderoth ( -1, TextureSet.SET_NONE , 6.0F, 64, 2, 1|2 |8|16 |64 , 255, 255, 255, 0, "Haderoth" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL ), + Hematite ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1|2 |8 , 255, 255, 255, 0, "Hematite" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + Hepatizon ( -1, TextureSet.SET_NONE , 6.0F, 64, 2, 1|2 |8|16 |64 , 255, 255, 255, 0, "Hepatizon" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL ), + HSLA ( 322, TextureSet.SET_METALLIC , 6.0F, 500, 2, 1|2 |64|128 , 128, 128, 128, 0, "HSLA Steel" , 0, 0, 1811, 1000, T, F, 3, 1, 1, Dyes._NULL , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 1), new TC_AspectStack(TC_Aspects.ORDO, 1))), + Ignatius ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1 |16 , 255, 255, 255, 0, "Ignatius" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL ), + Infernal ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 0 , 255, 255, 255, 0, "Infernal" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL ), + Infuscolium ( -1, TextureSet.SET_NONE , 6.0F, 64, 2, 1|2 |8 |64 , 255, 255, 255, 0, "Infuscolium" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + InfusedGold ( 323, TextureSet.SET_SHINY , 12.0F, 64, 3, 1|2 |8 |64|128 , 255, 200, 60, 0, "Infused Gold" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes.dyeYellow ), + InfusedAir ( 540, TextureSet.SET_SHARDS , 8.0F, 64, 3, 1 |4|8 |64|128 , 255, 255, 0, 0, "Aer" , 5, 160, -1, 0, F, T, 3, 1, 1, Dyes.dyeYellow , Arrays.asList(new TC_AspectStack(TC_Aspects.PRAECANTIO, 1), new TC_AspectStack(TC_Aspects.AER, 2))), + InfusedFire ( 541, TextureSet.SET_SHARDS , 8.0F, 64, 3, 1 |4|8 |64|128 , 255, 0, 0, 0, "Ignis" , 5, 320, -1, 0, F, T, 3, 1, 1, Dyes.dyeRed , Arrays.asList(new TC_AspectStack(TC_Aspects.PRAECANTIO, 1), new TC_AspectStack(TC_Aspects.IGNIS, 2))), + InfusedEarth ( 542, TextureSet.SET_SHARDS , 8.0F, 256, 3, 1 |4|8 |64|128 , 0, 255, 0, 0, "Terra" , 5, 160, -1, 0, F, T, 3, 1, 1, Dyes.dyeGreen , Arrays.asList(new TC_AspectStack(TC_Aspects.PRAECANTIO, 1), new TC_AspectStack(TC_Aspects.TERRA, 2))), + InfusedWater ( 543, TextureSet.SET_SHARDS , 8.0F, 64, 3, 1 |4|8 |64|128 , 0, 0, 255, 0, "Aqua" , 5, 160, -1, 0, F, T, 3, 1, 1, Dyes.dyeBlue , Arrays.asList(new TC_AspectStack(TC_Aspects.PRAECANTIO, 1), new TC_AspectStack(TC_Aspects.AQUA, 2))), + InfusedEntropy ( 544, TextureSet.SET_SHARDS , 32.0F, 64, 4, 1 |4|8 |64|128 , 62, 62, 62, 0, "Perditio" , 5, 320, -1, 0, F, T, 3, 1, 1, Dyes.dyeBlack , Arrays.asList(new TC_AspectStack(TC_Aspects.PRAECANTIO, 1), new TC_AspectStack(TC_Aspects.PERDITIO, 2))), + InfusedOrder ( 545, TextureSet.SET_SHARDS , 8.0F, 64, 3, 1 |4|8 |64|128 , 252, 252, 252, 0, "Ordo" , 5, 240, -1, 0, F, T, 3, 1, 1, Dyes.dyeWhite , Arrays.asList(new TC_AspectStack(TC_Aspects.PRAECANTIO, 1), new TC_AspectStack(TC_Aspects.ORDO, 2))), + InfusedVis ( -1, TextureSet.SET_SHARDS , 8.0F, 64, 3, 1 |4|8 |64|128 , 255, 0, 255, 0, "Auram" , 5, 240, -1, 0, F, T, 3, 1, 1, Dyes.dyePurple , Arrays.asList(new TC_AspectStack(TC_Aspects.PRAECANTIO, 1), new TC_AspectStack(TC_Aspects.AURAM, 2))), + InfusedDull ( -1, TextureSet.SET_SHARDS , 32.0F, 64, 3, 1 |4|8 |64|128 , 100, 100, 100, 0, "Vacuus" , 5, 160, -1, 0, F, T, 3, 1, 1, Dyes.dyeLightGray , Arrays.asList(new TC_AspectStack(TC_Aspects.PRAECANTIO, 1), new TC_AspectStack(TC_Aspects.VACUOS, 2))), + Inolashite ( -1, TextureSet.SET_NONE , 6.0F, 128, 3, 1|2 |8|16 |64 , 255, 255, 255, 0, "Inolashite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL ), + Invisium ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1 , 255, 255, 255, 0, "Invisium" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + Jade ( 537, TextureSet.SET_SHINY , 1.0F, 0, 2, 1 |8 , 0, 100, 0, 0, "Jade" , 0, 0, -1, 0, F, F, 5, 1, 1, Dyes.dyeGreen , Arrays.asList(new TC_AspectStack(TC_Aspects.LUCRUM, 6), new TC_AspectStack(TC_Aspects.VITREUS, 3))), + Jasper ( 511, TextureSet.SET_EMERALD , 1.0F, 0, 2, 1 |4|8 , 200, 80, 80, 100, "Jasper" , 0, 0, -1, 0, F, T, 3, 1, 1, Dyes.dyeRed , Arrays.asList(new TC_AspectStack(TC_Aspects.LUCRUM, 4), new TC_AspectStack(TC_Aspects.VITREUS, 2))), + Kalendrite ( -1, TextureSet.SET_NONE , 1.0F, 0, 1, 1 |16 , 255, 255, 255, 0, "Kalendrite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL ), + Komatiite ( 869, TextureSet.SET_DULL , 1.0F, 0, 1, 1 , 255, 255, 255, 0, "Komatiite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeYellow ), + Lava ( 700, TextureSet.SET_FLUID , 1.0F, 0, 1, 16 , 255, 64, 0, 0, "Lava" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeOrange ), + Lemurite ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1 |16 , 255, 255, 255, 0, "Lemurite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL ), + Limestone ( -1, TextureSet.SET_NONE , 1.0F, 0, 1, 1 , 255, 255, 255, 0, "Limestone" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL ), + Lodestone ( -1, TextureSet.SET_NONE , 1.0F, 0, 1, 1 |8 , 255, 255, 255, 0, "Lodestone" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL ), + Luminite ( -1, TextureSet.SET_NONE , 1.0F, 0, 1, 1 |8 , 250, 250, 250, 0, "Luminite" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes.dyeWhite ), + Magma ( -1, TextureSet.SET_NONE , 1.0F, 0, 1, 0 , 255, 64, 0, 0, "Magma" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeOrange ), + Mawsitsit ( -1, TextureSet.SET_NONE , 1.0F, 0, 1, 1 , 255, 255, 255, 0, "Mawsitsit" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + Mercassium ( -1, TextureSet.SET_NONE , 6.0F, 64, 1, 1|2 |8 |64 , 255, 255, 255, 0, "Mercassium" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL ), + MeteoricIron ( 340, TextureSet.SET_METALLIC , 6.0F, 384, 2, 1|2 |8 |64 , 100, 50, 80, 0, "Meteoric Iron" , 0, 0, 1811, 0, F, F, 1, 1, 1, Dyes.dyeGray , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.MAGNETO, 1))), + MeteoricSteel ( 341, TextureSet.SET_METALLIC , 6.0F, 768, 2, 1|2 |64 , 50, 25, 40, 0, "Meteoric Steel" , 0, 0, 1811, 1000, T, F, 1, 1, 1, Dyes.dyeGray , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.MAGNETO, 1), new TC_AspectStack(TC_Aspects.ORDO, 1))), + Meteorite ( -1, TextureSet.SET_NONE , 1.0F, 0, 1, 1 |8 , 80, 35, 60, 0, "Meteorite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyePurple ), + Meutoite ( -1, TextureSet.SET_NONE , 1.0F, 0, 1, 1 |8|16 , 255, 255, 255, 0, "Meutoite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL ), + Migmatite ( 872, TextureSet.SET_DULL , 1.0F, 0, 1, 1 , 255, 255, 255, 0, "Migmatite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL ), + Mimichite ( -1, TextureSet.SET_GEM_VERTICAL , 1.0F, 0, 1, 1 |4|8 , 255, 255, 255, 0, "Mimichite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL ), + Moonstone ( -1, TextureSet.SET_NONE , 1.0F, 0, 1, 1 |8 , 255, 255, 255, 0, "Moonstone" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes.dyeWhite , Arrays.asList(new TC_AspectStack(TC_Aspects.VITREUS, 1), new TC_AspectStack(TC_Aspects.ALIENIS, 1))), + Naquadah ( 324, TextureSet.SET_METALLIC , 6.0F, 1280, 4, 1|2 |8|16 |64 , 50, 50, 50, 0, "Naquadah" , 0, 0, 3000, 3000, T, F, 10, 1, 1, Dyes.dyeBlack , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 3), new TC_AspectStack(TC_Aspects.RADIO, 1), new TC_AspectStack(TC_Aspects.NEBRISUM, 1))), + NaquadahAlloy ( 325, TextureSet.SET_METALLIC , 8.0F, 5120, 5, 1|2 |64|128 , 40, 40, 40, 0, "Naquadah Alloy" , 0, 0, 3000, 3000, T, F, 10, 1, 1, Dyes.dyeBlack , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 4), new TC_AspectStack(TC_Aspects.NEBRISUM, 1))), + NaquadahEnriched ( 326, TextureSet.SET_METALLIC , 6.0F, 1280, 4, 1|2 |8|16 |64 , 50, 50, 50, 0, "Enriched Naquadah" , 0, 0, 3000, 3000, T, F, 15, 1, 1, Dyes.dyeBlack , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 3), new TC_AspectStack(TC_Aspects.RADIO, 2), new TC_AspectStack(TC_Aspects.NEBRISUM, 2))), + Naquadria ( 327, TextureSet.SET_SHINY , 1.0F, 512, 4, 1|2 |8 |64 , 30, 30, 30, 0, "Naquadria" , 0, 0, 3000, 3000, T, F, 20, 1, 1, Dyes.dyeBlack , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 4), new TC_AspectStack(TC_Aspects.RADIO, 3), new TC_AspectStack(TC_Aspects.NEBRISUM, 3))), + Nether ( -1, TextureSet.SET_NONE , 1.0F, 0, 1, 0 , 255, 255, 255, 0, "Nether" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + NetherBrick ( 814, TextureSet.SET_DULL , 1.0F, 0, 1, 1 , 100, 0, 0, 0, "Nether Brick" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeRed , Arrays.asList(new TC_AspectStack(TC_Aspects.IGNIS, 1))), + NetherQuartz ( 522, TextureSet.SET_QUARTZ , 1.0F, 32, 1, 1 |4|8 |64 , 230, 210, 210, 0, "Nether Quartz" , 0, 0, -1, 0, F, F, 2, 1, 1, Dyes.dyeWhite , Arrays.asList(new TC_AspectStack(TC_Aspects.POTENTIA, 1), new TC_AspectStack(TC_Aspects.VITREUS, 1))), + NetherStar ( 506, TextureSet.SET_NETHERSTAR , 1.0F, 5120, 4, 1 |4 |64 , 255, 255, 255, 0, "Nether Star" , 5, 50000, -1, 0, F, F, 15, 1, 1, Dyes.dyeWhite ), + Nikolite ( 812, TextureSet.SET_SHINY , 1.0F, 0, 1, 1 |8 , 60, 180, 200, 0, "Nikolite" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes.dyeCyan , Arrays.asList(new TC_AspectStack(TC_Aspects.ELECTRUM, 2))), + ObsidianFlux ( -1, TextureSet.SET_DULL , 1.0F, 0, 1, 1|2 , 80, 50, 100, 0, "Fluxed Obsidian" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyePurple ), + Oilsands ( 878, TextureSet.SET_NONE , 1.0F, 0, 1, 1 |8 , 10, 10, 10, 0, "Oilsands" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL ), + Onyx ( -1, TextureSet.SET_NONE , 1.0F, 0, 1, 1 , 255, 255, 255, 0, "Onyx" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + Orichalcum ( -1, TextureSet.SET_NONE , 6.0F, 64, 3, 1|2 |8 |64 , 255, 255, 255, 0, "Orichalcum" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL ), + Osmonium ( -1, TextureSet.SET_NONE , 6.0F, 64, 1, 1|2 |8 |64 , 255, 255, 255, 0, "Osmonium" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes.dyeBlue ), + Oureclase ( -1, TextureSet.SET_NONE , 6.0F, 64, 1, 1|2 |8 |64 , 255, 255, 255, 0, "Oureclase" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL ), + Painite ( -1, TextureSet.SET_NONE , 1.0F, 0, 1, 0 , 255, 255, 255, 0, "Painite" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + Peanutwood ( -1, TextureSet.SET_NONE , 1.0F, 0, 1, 0 , 255, 255, 255, 0, "Peanut Wood" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + Petroleum ( -1, TextureSet.SET_NONE , 1.0F, 0, 1, 1 |8 , 255, 255, 255, 0, "Petroleum" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL ), + Pewter ( -1, TextureSet.SET_NONE , 1.0F, 0, 1, 0 , 255, 255, 255, 0, "Pewter" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + Phoenixite ( -1, TextureSet.SET_NONE , 6.0F, 64, 1, 1|2 |8 |64 , 255, 255, 255, 0, "Phoenixite" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + Potash ( -1, TextureSet.SET_NONE , 1.0F, 0, 1, 0 , 255, 255, 255, 0, "Potash" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL ), + Prometheum ( -1, TextureSet.SET_NONE , 6.0F, 64, 1, 1|2 |8 |64 , 255, 255, 255, 0, "Prometheum" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL ), + Quartzite ( 523, TextureSet.SET_QUARTZ , 1.0F, 0, 1, 1 |4|8 , 210, 230, 210, 0, "Quartzite" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes.dyeWhite ), + Quicklime ( -1, TextureSet.SET_NONE , 1.0F, 0, 1, 1 , 255, 255, 255, 0, "Quicklime" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL ), + Randomite ( -1, TextureSet.SET_NONE , 1.0F, 0, 1, 1 |8 , 255, 255, 255, 0, "Randomite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL ), + RefinedGlowstone (-326, TextureSet.SET_METALLIC , 1.0F, 0, 1, 1|2 , 255, 255, 0, 0, "Refined Glowstone" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeYellow ), + RefinedObsidian (-327, TextureSet.SET_METALLIC , 1.0F, 0, 1, 1|2 , 80, 50, 100, 0, "Refined Obsidian" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyePurple ), + Rhyolite ( 875, TextureSet.SET_DULL , 1.0F, 0, 1, 1 , 255, 255, 255, 0, "Rhyolite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL ), + Rubracium ( -1, TextureSet.SET_NONE , 1.0F, 0, 1, 1 |8|16 , 255, 255, 255, 0, "Rubracium" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL ), + RyuDragonRyder ( -1, TextureSet.SET_NONE , 1.0F, 0, 1, 0 , 255, 255, 255, 0, "Ryu Dragon Ryder" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL ), + Sand ( -1, TextureSet.SET_NONE , 1.0F, 0, 1, 0 , 255, 255, 255, 0, "Sand" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeYellow ), + Sanguinite ( -1, TextureSet.SET_NONE , 1.0F, 0, 1, 1|2 |8 , 255, 255, 255, 0, "Sanguinite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL ), + Siltstone ( 876, TextureSet.SET_DULL , 1.0F, 0, 1, 1 , 255, 255, 255, 0, "Siltstone" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL ), + Spinel ( -1, TextureSet.SET_NONE , 1.0F, 0, 1, 0 , 255, 255, 255, 0, "Spinel" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + Starconium ( -1, TextureSet.SET_NONE , 1.0F, 0, 1, 1|2 |8 , 255, 255, 255, 0, "Starconium" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + Sugilite ( -1, TextureSet.SET_NONE , 1.0F, 0, 1, 1 , 255, 255, 255, 0, "Sugilite" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + Sunstone ( -1, TextureSet.SET_NONE , 1.0F, 0, 1, 1 |8 , 255, 255, 255, 0, "Sunstone" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes.dyeYellow , Arrays.asList(new TC_AspectStack(TC_Aspects.VITREUS, 1), new TC_AspectStack(TC_Aspects.ALIENIS, 1))), + Tar ( -1, TextureSet.SET_NONE , 1.0F, 0, 1, 0 , 10, 10, 10, 0, "Tar" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeBlack ), + Tartarite ( -1, TextureSet.SET_NONE , 1.0F, 0, 1, 1|2 |8|16 , 255, 255, 255, 0, "Tartarite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL ), + Tapazite ( -1, TextureSet.SET_NONE , 1.0F, 0, 1, 1 , 255, 255, 255, 0, "Tapazite" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes.dyeGreen ), + Thyrium ( -1, TextureSet.SET_NONE , 1.0F, 0, 1, 1|2 |8 , 255, 255, 255, 0, "Thyrium" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + Tourmaline ( -1, TextureSet.SET_RUBY , 1.0F, 0, 1, 1 , 255, 255, 255, 0, "Tourmaline" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + Tritanium ( 329, TextureSet.SET_METALLIC , 6.0F, 2560, 4, 1|2 |64 , 255, 255, 255, 0, "Tritanium" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeWhite , Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.ORDO, 2))), + Turquoise ( -1, TextureSet.SET_NONE , 1.0F, 0, 1, 1 , 255, 255, 255, 0, "Turquoise" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes._NULL ), + UUAmplifier ( 721, TextureSet.SET_FLUID , 1.0F, 0, 1, 16 , 96, 0, 128, 0, "UU-Amplifier" , 0, 0, -1, 0, F, F, 10, 1, 1, Dyes.dyePink ), + UUMatter ( 703, TextureSet.SET_FLUID , 1.0F, 0, 1, 16 , 128, 0, 196, 0, "UU-Matter" , 0, 0, -1, 0, F, F, 10, 1, 1, Dyes.dyePink ), + Void ( -1, TextureSet.SET_NONE , 1.0F, 0, 1, 0 , 255, 255, 255, 200, "Void" , 0, 0, -1, 0, F, T, 1, 1, 1, Dyes._NULL , Arrays.asList(new TC_AspectStack(TC_Aspects.VACUOS, 1))), + Voidstone ( -1, TextureSet.SET_NONE , 1.0F, 0, 1, 0 , 255, 255, 255, 200, "Voidstone" , 0, 0, -1, 0, F, T, 1, 1, 1, Dyes._NULL , Arrays.asList(new TC_AspectStack(TC_Aspects.VITREUS, 1), new TC_AspectStack(TC_Aspects.VACUOS, 1))), + Vulcanite ( -1, TextureSet.SET_NONE , 6.0F, 64, 2, 1|2 |8 |64 , 255, 255, 255, 0, "Vulcanite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL ), + Vyroxeres ( -1, TextureSet.SET_NONE , 6.0F, 64, 2, 1|2 |8 |64 , 255, 255, 255, 0, "Vyroxeres" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL ), + Wimalite ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 8 , 255, 255, 255, 0, "Wimalite" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes.dyeYellow ), + Yellorite ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 8 , 255, 255, 255, 0, "Yellorite" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes.dyeYellow ), + Yellorium ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1|2 , 255, 255, 255, 0, "Yellorium" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes.dyeYellow ), + Zectium ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1|2 |8 , 255, 255, 255, 0, "Zectium" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes.dyeBlack ), + + /** + * Circuitry, Batteries and other Technical things + */ + Primitive ( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Primitive" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeLightGray , Arrays.asList(new TC_AspectStack(TC_Aspects.MACHINA, 1))), + Basic ( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Basic" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeLightGray , Arrays.asList(new TC_AspectStack(TC_Aspects.MACHINA, 2))), + Good ( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Good" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeLightGray , Arrays.asList(new TC_AspectStack(TC_Aspects.MACHINA, 3))), + Advanced ( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Advanced" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeLightGray , Arrays.asList(new TC_AspectStack(TC_Aspects.MACHINA, 4))), + Data ( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Data" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeLightGray , Arrays.asList(new TC_AspectStack(TC_Aspects.MACHINA, 5))), + Elite ( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Elite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeLightGray , Arrays.asList(new TC_AspectStack(TC_Aspects.MACHINA, 6))), + Master ( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Master" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeLightGray , Arrays.asList(new TC_AspectStack(TC_Aspects.MACHINA, 7))), + Ultimate ( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Ultimate" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeLightGray , Arrays.asList(new TC_AspectStack(TC_Aspects.MACHINA, 8))), + Superconductor ( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Superconductor" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeLightGray , Arrays.asList(new TC_AspectStack(TC_Aspects.ELECTRUM, 8))), + Infinite ( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Infinite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeLightGray ), + + /** + * Not possible to determine exact Components + */ + Antimatter ( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Antimatter" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyePink , Arrays.asList(new TC_AspectStack(TC_Aspects.POTENTIA, 9), new TC_AspectStack(TC_Aspects.PERFODIO, 8))), + BioFuel ( 705, TextureSet.SET_FLUID , 1.0F, 0, 0, 16 , 255, 128, 0, 0, "Biofuel" , 0, 6, -1, 0, F, F, 1, 1, 1, Dyes.dyeOrange ), + Biomass ( 704, TextureSet.SET_FLUID , 1.0F, 0, 0, 16 , 0, 255, 0, 0, "Biomass" , 3, 8, -1, 0, F, F, 1, 1, 1, Dyes.dyeGreen ), + Cheese ( 894, TextureSet.SET_FINE , 1.0F, 0, 0, 1 |8 , 255, 255, 0, 0, "Cheese" , 0, 0, 320, 0, F, F, 1, 1, 1, Dyes.dyeYellow ), + Chili ( 895, TextureSet.SET_FINE , 1.0F, 0, 0, 1 , 200, 0, 0, 0, "Chili" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeRed ), + Chocolate ( 886, TextureSet.SET_FINE , 1.0F, 0, 0, 1 , 190, 95, 0, 0, "Chocolate" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeBrown ), + Cluster ( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 127, "Cluster" , 0, 0, -1, 0, F, T, 1, 1, 1, Dyes.dyeWhite ), + CoalFuel ( 710, TextureSet.SET_FLUID , 1.0F, 0, 0, 16 , 50, 50, 70, 0, "Coalfuel" , 0, 16, -1, 0, F, F, 1, 1, 1, Dyes.dyeBlack ), + Cocoa ( 887, TextureSet.SET_FINE , 1.0F, 0, 0, 1 , 190, 95, 0, 0, "Cocoa" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeBrown ), + Coffee ( 888, TextureSet.SET_FINE , 1.0F, 0, 0, 1 , 150, 75, 0, 0, "Coffee" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeBrown ), + Creosote ( 712, TextureSet.SET_FLUID , 1.0F, 0, 0, 16 , 128, 64, 0, 0, "Creosote" , 3, 8, -1, 0, F, F, 1, 1, 1, Dyes.dyeBrown ), + Ethanol ( 706, TextureSet.SET_FLUID , 1.0F, 0, 0, 16 , 255, 128, 0, 0, "Ethanol" , 0, 128, -1, 0, F, F, 1, 1, 1, Dyes.dyePurple ), + FishOil ( 711, TextureSet.SET_FLUID , 1.0F, 0, 0, 16 , 255, 196, 0, 0, "Fish Oil" , 3, 2, -1, 0, F, F, 1, 1, 1, Dyes.dyeYellow , Arrays.asList(new TC_AspectStack(TC_Aspects.CORPUS, 2))), + Fuel ( 708, TextureSet.SET_FLUID , 1.0F, 0, 0, 16 , 255, 255, 0, 0, "Diesel" , 0, 128, -1, 0, F, F, 1, 1, 1, Dyes.dyeYellow ), + Glue ( 726, TextureSet.SET_FLUID , 1.0F, 0, 0, 16 , 200, 196, 0, 0, "Glue" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeOrange , Arrays.asList(new TC_AspectStack(TC_Aspects.LIMUS, 2))), + Gunpowder ( 800, TextureSet.SET_DULL , 1.0F, 0, 0, 1 , 128, 128, 128, 0, "Gunpowder" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeGray , Arrays.asList(new TC_AspectStack(TC_Aspects.PERDITIO, 3), new TC_AspectStack(TC_Aspects.IGNIS, 4))), + FryingOilHot ( 727, TextureSet.SET_FLUID , 1.0F, 0, 0, 16 , 200, 196, 0, 0, "Hot Frying Oil" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeOrange , Arrays.asList(new TC_AspectStack(TC_Aspects.AQUA, 1), new TC_AspectStack(TC_Aspects.IGNIS, 1))), + Honey ( 725, TextureSet.SET_FLUID , 1.0F, 0, 0, 16 , 210, 200, 0, 0, "Honey" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeYellow ), + Leather ( -1, TextureSet.SET_ROUGH , 1.0F, 0, 0, 1 , 150, 150, 80, 127, "Leather" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeOrange ), + LimePure ( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Pure Lime" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeLime ), + Lubricant ( 724, TextureSet.SET_FLUID , 1.0F, 0, 0, 16 , 255, 196, 0, 0, "Lubricant" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeOrange , Arrays.asList(new TC_AspectStack(TC_Aspects.AQUA, 2), new TC_AspectStack(TC_Aspects.MACHINA, 1))), + McGuffium239 ( 999, TextureSet.SET_FLUID , 1.0F, 0, 0, 16 , 200, 50, 150, 0, "Mc Guffium 239" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyePink , Arrays.asList(new TC_AspectStack(TC_Aspects.ALIENIS, 8), new TC_AspectStack(TC_Aspects.PERMUTATIO, 8), new TC_AspectStack(TC_Aspects.SPIRITUS, 8), new TC_AspectStack(TC_Aspects.AURAM, 8), new TC_AspectStack(TC_Aspects.VITIUM, 8), new TC_AspectStack(TC_Aspects.RADIO, 8), new TC_AspectStack(TC_Aspects.MAGNETO, 8), new TC_AspectStack(TC_Aspects.ELECTRUM, 8), new TC_AspectStack(TC_Aspects.NEBRISUM, 8), new TC_AspectStack(TC_Aspects.STRONTIO, 8))), + MeatRaw ( 892, TextureSet.SET_FINE , 1.0F, 0, 0, 1 , 255, 100, 100, 0, "Raw Meat" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyePink ), + MeatCooked ( 893, TextureSet.SET_FINE , 1.0F, 0, 0, 1 , 150, 60, 20, 0, "Cooked Meat" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyePink ), + Milk ( 885, TextureSet.SET_FINE , 1.0F, 0, 0, 1 |16 , 254, 254, 254, 0, "Milk" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeWhite , Arrays.asList(new TC_AspectStack(TC_Aspects.SANO, 2))), + Mud ( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Mud" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeBrown ), + Oil ( 707, TextureSet.SET_FLUID , 1.0F, 0, 0, 16 , 10, 10, 10, 0, "Oil" , 3, 16, -1, 0, F, F, 1, 1, 1, Dyes.dyeBlack ), + Paper ( 879, TextureSet.SET_PAPER , 1.0F, 0, 0, 1 , 250, 250, 250, 0, "Paper" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeWhite , Arrays.asList(new TC_AspectStack(TC_Aspects.COGNITO, 1))), + Peat ( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Peat" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeBrown , Arrays.asList(new TC_AspectStack(TC_Aspects.POTENTIA, 2), new TC_AspectStack(TC_Aspects.IGNIS, 2))), + Quantum ( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Quantum" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeWhite ), + RareEarth ( 891, TextureSet.SET_FINE , 1.0F, 0, 0, 1 , 128, 128, 100, 0, "Rare Earth" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeGray , Arrays.asList(new TC_AspectStack(TC_Aspects.VITREUS, 1), new TC_AspectStack(TC_Aspects.LUCRUM, 1))), + Red ( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 0, 0, 0, "Red" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeRed ), + Reinforced ( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "Reinforced" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeGray ), + SeedOil ( 713, TextureSet.SET_FLUID , 1.0F, 0, 0, 16 , 196, 255, 0, 0, "Seed Oil" , 3, 2, -1, 0, F, F, 1, 1, 1, Dyes.dyeLime , Arrays.asList(new TC_AspectStack(TC_Aspects.GRANUM, 2))), + SeedOilHemp ( 722, TextureSet.SET_FLUID , 1.0F, 0, 0, 16 , 196, 255, 0, 0, "Hemp Seed Oil" , 3, 2, -1, 0, F, F, 1, 1, 1, Dyes.dyeLime , Arrays.asList(new TC_AspectStack(TC_Aspects.GRANUM, 2))), + SeedOilLin ( 723, TextureSet.SET_FLUID , 1.0F, 0, 0, 16 , 196, 255, 0, 0, "Lin Seed Oil" , 3, 2, -1, 0, F, F, 1, 1, 1, Dyes.dyeLime , Arrays.asList(new TC_AspectStack(TC_Aspects.GRANUM, 2))), + Stone ( 299, TextureSet.SET_ROUGH , 4.0F, 32, 1, 1 |64|128 , 205, 205, 205, 0, "Stone" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeLightGray , Arrays.asList(new TC_AspectStack(TC_Aspects.TERRA, 1))), + TNT ( -1, TextureSet.SET_NONE , 1.0F, 0, 0, 0 , 255, 255, 255, 0, "TNT" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeRed , Arrays.asList(new TC_AspectStack(TC_Aspects.PERDITIO, 7), new TC_AspectStack(TC_Aspects.IGNIS, 4))), + Unstable ( -1, TextureSet.SET_NONE , 1.0F, 0, 4, 0 , 255, 255, 255, 127, "Unstable" , 0, 0, -1, 0, F, T, 1, 1, 1, Dyes.dyeWhite , Arrays.asList(new TC_AspectStack(TC_Aspects.PERDITIO, 4))), + Unstableingot ( -1, TextureSet.SET_NONE , 1.0F, 0, 4, 0 , 255, 255, 255, 127, "Unstable" , 0, 0, -1, 0, F, T, 1, 1, 1, Dyes.dyeWhite , Arrays.asList(new TC_AspectStack(TC_Aspects.PERDITIO, 4))), + Wheat ( 881, TextureSet.SET_POWDER , 1.0F, 0, 0, 1 , 255, 255, 196, 0, "Wheat" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeYellow , Arrays.asList(new TC_AspectStack(TC_Aspects.MESSIS, 2))), + + /** + * TODO: This + */ + AluminiumBrass ( -1, TextureSet.SET_METALLIC , 6.0F, 64, 2, 1|2 |64 , 255, 255, 255, 0, "Aluminium Brass" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeYellow ), + Osmiridium ( 317, TextureSet.SET_METALLIC , 8.0F, 3000, 4, 1|2 |64|128 , 100, 100, 255, 0, "Osmiridium" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeLightBlue ), + Sunnarium ( 318, TextureSet.SET_SHINY , 1.0F, 0, 1, 1|2 , 255, 255, 0, 0, "Sunnarium" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeYellow ), + Endstone ( 808, TextureSet.SET_DULL , 1.0F, 0, 1, 1 , 255, 255, 255, 0, "Endstone" , 0, 0, -1, 0, F, F, 0, 1, 1, Dyes.dyeYellow ), + Netherrack ( 807, TextureSet.SET_DULL , 1.0F, 0, 0, 1 , 200, 0, 0, 0, "Netherrack" , 0, 0, -1, 0, F, F, 0, 1, 1, Dyes.dyeRed ), + SoulSand ( -1, TextureSet.SET_DULL , 1.0F, 0, 0, 1 , 255, 255, 255, 0, "Soulsand" , 0, 0, -1, 0, F, F, 0, 1, 1, Dyes.dyeBrown ), + + /** + * First Degree Compounds + */ + Air ( -1, TextureSet.SET_FLUID , 1.0F, 0, 2, 16|32 , 169, 208, 245, 240, "Air" , 0, 0, -1, 0, F, T, 1, 1, 1, Dyes.dyeLightBlue , 0, Arrays.asList(new MaterialStack(Nitrogen, 40), new MaterialStack(Oxygen, 11), new MaterialStack(Argon, 1))), + Almandine ( 820, TextureSet.SET_ROUGH , 1.0F, 0, 1, 1 |8 , 255, 0, 0, 0, "Almandine" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes.dyeRed , 1, Arrays.asList(new MaterialStack(Aluminium, 2), new MaterialStack(Iron, 3), new MaterialStack(Silicon, 3), new MaterialStack(Oxygen, 12))), + Andradite ( 821, TextureSet.SET_ROUGH , 1.0F, 0, 1, 1 |8 , 150, 120, 0, 0, "Andradite" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes.dyeYellow , 1, Arrays.asList(new MaterialStack(Calcium, 3), new MaterialStack(Iron, 2), new MaterialStack(Silicon, 3), new MaterialStack(Oxygen, 12))), + AnnealedCopper ( 345, TextureSet.SET_SHINY , 1.0F, 0, 2, 1|2 |128 , 255, 120, 20, 0, "Annealed Copper" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes.dyeOrange , 2, Arrays.asList(new MaterialStack(Copper, 1))), + Asbestos ( 946, TextureSet.SET_DULL , 1.0F, 0, 1, 1 |8 , 230, 230, 230, 0, "Asbestos" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeWhite , 1, Arrays.asList(new MaterialStack(Magnesium, 3), new MaterialStack(Silicon, 2), new MaterialStack(Hydrogen, 4), new MaterialStack(Oxygen, 9))), // Mg3Si2O5(OH)4 + Ash ( 815, TextureSet.SET_DULL , 1.0F, 0, 1, 1 , 150, 150, 150, 0, "Ashes" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeLightGray , 2, Arrays.asList(new MaterialStack(Carbon, 1)), Arrays.asList(new TC_AspectStack(TC_Aspects.PERDITIO, 1))), + BandedIron ( 917, TextureSet.SET_DULL , 1.0F, 0, 2, 1 |8 , 145, 90, 90, 0, "Banded Iron" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeBrown , 1, Arrays.asList(new MaterialStack(Iron, 2), new MaterialStack(Oxygen, 3))), + BatteryAlloy ( 315, TextureSet.SET_DULL , 1.0F, 0, 1, 1|2 , 156, 124, 160, 0, "Battery Alloy" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyePurple , 2, Arrays.asList(new MaterialStack(Lead, 4), new MaterialStack(Antimony, 1))), + Bauxite ( 822, TextureSet.SET_DULL , 1.0F, 0, 1, 1 |8 , 200, 100, 0, 0, "Bauxite" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes.dyeBrown , 1, Arrays.asList(new MaterialStack(Titanium, 1), new MaterialStack(Aluminium, 16), new MaterialStack(Hydrogen, 10), new MaterialStack(Oxygen, 12))), + BlueTopaz ( 513, TextureSet.SET_GEM_HORIZONTAL , 7.0F, 256, 3, 1 |4|8 |64 , 0, 0, 255, 127, "Blue Topaz" , 0, 0, -1, 0, F, T, 3, 1, 1, Dyes.dyeBlue , 1, Arrays.asList(new MaterialStack(Aluminium, 2), new MaterialStack(Silicon, 1), new MaterialStack(Fluorine, 2), new MaterialStack(Hydrogen, 2), new MaterialStack(Oxygen, 6)), Arrays.asList(new TC_AspectStack(TC_Aspects.LUCRUM, 6), new TC_AspectStack(TC_Aspects.VITREUS, 4))), + Bone ( 806, TextureSet.SET_DULL , 1.0F, 0, 1, 1 , 250, 250, 250, 0, "Bone" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeWhite , 0, Arrays.asList(new MaterialStack(Calcium, 1)), Arrays.asList(new TC_AspectStack(TC_Aspects.MORTUUS, 2), new TC_AspectStack(TC_Aspects.CORPUS, 1))), + Brass ( 301, TextureSet.SET_METALLIC , 7.0F, 96, 1, 1|2 |64|128 , 255, 180, 0, 0, "Brass" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeYellow , 2, Arrays.asList(new MaterialStack(Zinc, 1), new MaterialStack(Copper, 3)), Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.INSTRUMENTUM, 1))), + Bronze ( 300, TextureSet.SET_METALLIC , 6.0F, 192, 2, 1|2 |64|128 , 255, 128, 0, 0, "Bronze" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeOrange , 2, Arrays.asList(new MaterialStack(Tin, 1), new MaterialStack(Copper, 3)), Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.INSTRUMENTUM, 1))), + BrownLimonite ( 930, TextureSet.SET_METALLIC , 1.0F, 0, 1, 1 |8 , 200, 100, 0, 0, "Brown Limonite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeBrown , 2, Arrays.asList(new MaterialStack(Iron, 1), new MaterialStack(Hydrogen, 1), new MaterialStack(Oxygen, 2))), // FeO(OH) + Calcite ( 823, TextureSet.SET_DULL , 1.0F, 0, 1, 1 |8 , 250, 230, 220, 0, "Calcite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeOrange , 1, Arrays.asList(new MaterialStack(Calcium, 1), new MaterialStack(Carbon, 1), new MaterialStack(Oxygen, 3))), + Cassiterite ( 824, TextureSet.SET_METALLIC , 1.0F, 0, 1, 8 , 220, 220, 220, 0, "Cassiterite" , 0, 0, -1, 0, F, F, 4, 3, 1, Dyes.dyeWhite , 1, Arrays.asList(new MaterialStack(Tin, 1), new MaterialStack(Oxygen, 2))), + CassiteriteSand ( 937, TextureSet.SET_SAND , 1.0F, 0, 1, 8 , 220, 220, 220, 0, "Cassiterite Sand" , 0, 0, -1, 0, F, F, 4, 3, 1, Dyes.dyeWhite , 1, Arrays.asList(new MaterialStack(Tin, 1), new MaterialStack(Oxygen, 2))), + Celestine ( 913, TextureSet.SET_DULL , 1.0F, 0, 1, 1 |8 , 200, 205, 240, 0, "Celestine" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeLightGray , 1, Arrays.asList(new MaterialStack(Strontium, 1), new MaterialStack(Sulfur, 1), new MaterialStack(Oxygen, 4))), + Chalcopyrite ( 855, TextureSet.SET_DULL , 1.0F, 0, 1, 1 |8 , 160, 120, 40, 0, "Chalcopyrite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeYellow , 1, Arrays.asList(new MaterialStack(Copper, 1), new MaterialStack(Iron, 1), new MaterialStack(Sulfur, 2))), + Chalk ( 856, TextureSet.SET_FINE , 1.0F, 0, 2, 1 , 250, 250, 250, 0, "Chalk" , 0, 0, -1, 0, F, F, 0, 1, 1, Dyes.dyeWhite , 1, Arrays.asList(new MaterialStack(Calcium, 1), new MaterialStack(Carbon, 1), new MaterialStack(Oxygen, 3))), + Charcoal ( 536, TextureSet.SET_FINE , 1.0F, 0, 1, 1 |4 , 100, 70, 70, 0, "Charcoal" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeBlack , 1, Arrays.asList(new MaterialStack(Carbon, 1)), Arrays.asList(new TC_AspectStack(TC_Aspects.POTENTIA, 2), new TC_AspectStack(TC_Aspects.IGNIS, 2))), + Chromite ( 825, TextureSet.SET_METALLIC , 1.0F, 0, 1, 1 |8 , 35, 20, 15, 0, "Chromite" , 0, 0, 1700, 1700, T, F, 6, 1, 1, Dyes.dyePink , 1, Arrays.asList(new MaterialStack(Iron, 1), new MaterialStack(Chrome, 2), new MaterialStack(Oxygen, 4))), + ChromiumDioxide ( 361, TextureSet.SET_DULL , 11.0F, 256, 3, 1|2 , 230, 200, 200, 0, "Chromium Dioxide" , 0, 0, 650, 650, F, F, 5, 3, 1, Dyes.dyePink , 1, Arrays.asList(new MaterialStack(Chrome, 1), new MaterialStack(Oxygen, 2)), Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.MACHINA, 1))), + Cinnabar ( 826, TextureSet.SET_ROUGH , 1.0F, 0, 1, 1 |8 , 150, 0, 0, 0, "Cinnabar" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes.dyeBrown , 2, Arrays.asList(new MaterialStack(Mercury, 1), new MaterialStack(Sulfur, 1))), + Clay ( 805, TextureSet.SET_ROUGH , 1.0F, 0, 1, 1 , 200, 200, 220, 0, "Clay" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes.dyeLightBlue , 1, Arrays.asList(new MaterialStack(Sodium, 2), new MaterialStack(Lithium, 1), new MaterialStack(Aluminium, 2), new MaterialStack(Silicon, 2))), + Coal ( 535, TextureSet.SET_ROUGH , 1.0F, 0, 1, 1 |4|8 , 70, 70, 70, 0, "Coal" , 0, 0, -1, 0, F, F, 2, 2, 1, Dyes.dyeBlack , 1, Arrays.asList(new MaterialStack(Carbon, 1)), Arrays.asList(new TC_AspectStack(TC_Aspects.POTENTIA, 2), new TC_AspectStack(TC_Aspects.IGNIS, 2))), + Cobaltite ( 827, TextureSet.SET_METALLIC , 1.0F, 0, 1, 1 |8 , 80, 80, 250, 0, "Cobaltite" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes.dyeBlue , 1, Arrays.asList(new MaterialStack(Cobalt, 1), new MaterialStack(Arsenic, 1), new MaterialStack(Sulfur, 1))), + Cooperite ( 828, TextureSet.SET_METALLIC , 1.0F, 0, 1, 1 |8 , 255, 255, 200, 0, "Sheldonite" , 0, 0, -1, 0, F, F, 5, 1, 1, Dyes.dyeYellow , 2, Arrays.asList(new MaterialStack(Platinum, 3), new MaterialStack(Nickel, 1), new MaterialStack(Sulfur, 1), new MaterialStack(Palladium, 1))), + Cupronickel ( 310, TextureSet.SET_METALLIC , 6.0F, 64, 1, 1|2 |64 , 227, 150, 128, 0, "Cupronickel" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeOrange , 2, Arrays.asList(new MaterialStack(Copper, 1), new MaterialStack(Nickel, 1))), + DarkAsh ( 816, TextureSet.SET_DULL , 1.0F, 0, 1, 1 , 50, 50, 50, 0, "Dark Ashes" , 0, 0, -1, 0, F, F, 1, 2, 1, Dyes.dyeGray , 1, Arrays.asList(new MaterialStack(Carbon, 1)), Arrays.asList(new TC_AspectStack(TC_Aspects.IGNIS, 1), new TC_AspectStack(TC_Aspects.PERDITIO, 1))), + DeepIron ( 829, TextureSet.SET_METALLIC , 6.0F, 384, 2, 1|2 |8 |64 , 150, 140, 140, 0, "Deep Iron" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes.dyePink , 2, Arrays.asList(new MaterialStack(Iron, 1)), Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.MAGNETO, 1))), + Diamond ( 500, TextureSet.SET_DIAMOND , 8.0F, 1280, 3, 1 |4|8 |64|128 , 200, 255, 255, 127, "Diamond" , 0, 0, -1, 0, F, T, 5, 64, 1, Dyes.dyeWhite , 1, Arrays.asList(new MaterialStack(Carbon, 1)), Arrays.asList(new TC_AspectStack(TC_Aspects.VITREUS, 3), new TC_AspectStack(TC_Aspects.LUCRUM, 4))), + Electrum ( 303, TextureSet.SET_SHINY , 12.0F, 64, 2, 1|2 |8 |64|128 , 255, 255, 100, 0, "Electrum" , 0, 0, -1, 0, F, F, 4, 1, 1, Dyes.dyeYellow , 2, Arrays.asList(new MaterialStack(Silver, 1), new MaterialStack(Gold, 1))), + Emerald ( 501, TextureSet.SET_EMERALD , 7.0F, 256, 2, 1 |4|8 |64 , 80, 255, 80, 127, "Emerald" , 0, 0, -1, 0, F, T, 5, 1, 1, Dyes.dyeGreen , 1, Arrays.asList(new MaterialStack(Beryllium, 3), new MaterialStack(Aluminium, 2), new MaterialStack(Silicon, 6), new MaterialStack(Oxygen, 18)), Arrays.asList(new TC_AspectStack(TC_Aspects.VITREUS, 3), new TC_AspectStack(TC_Aspects.LUCRUM, 5))), + FreshWater ( -1, TextureSet.SET_FLUID , 1.0F, 0, 0, 16 , 0, 0, 255, 0, "Fresh Water" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeBlue , 0, Arrays.asList(new MaterialStack(Hydrogen, 2), new MaterialStack(Oxygen, 1)), Arrays.asList(new TC_AspectStack(TC_Aspects.AQUA, 2))), + Galena ( 830, TextureSet.SET_DULL , 1.0F, 0, 3, 1 |8 , 100, 60, 100, 0, "Galena" , 0, 0, -1, 0, F, F, 4, 1, 1, Dyes.dyePurple , 1, Arrays.asList(new MaterialStack(Lead, 3), new MaterialStack(Silver, 3), new MaterialStack(Sulfur, 2))), + Garnierite ( 906, TextureSet.SET_METALLIC , 1.0F, 0, 3, 1 |8 , 50, 200, 70, 0, "Garnierite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeLightBlue , 1, Arrays.asList(new MaterialStack(Nickel, 1), new MaterialStack(Oxygen, 1))), + Glyceryl ( 714, TextureSet.SET_FLUID , 1.0F, 0, 1, 16 , 0, 150, 150, 0, "Glyceryl Trinitrate" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeCyan , 1, Arrays.asList(new MaterialStack(Carbon, 3), new MaterialStack(Hydrogen, 5), new MaterialStack(Nitrogen, 3), new MaterialStack(Oxygen, 9))), + GreenSapphire ( 504, TextureSet.SET_GEM_HORIZONTAL , 7.0F, 256, 2, 1 |4|8 |64 , 100, 200, 130, 127, "Green Sapphire" , 0, 0, -1, 0, F, T, 5, 1, 1, Dyes.dyeCyan , 1, Arrays.asList(new MaterialStack(Aluminium, 2), new MaterialStack(Oxygen, 3)), Arrays.asList(new TC_AspectStack(TC_Aspects.LUCRUM, 5), new TC_AspectStack(TC_Aspects.VITREUS, 3))), + Grossular ( 831, TextureSet.SET_ROUGH , 1.0F, 0, 1, 1 |8 , 200, 100, 0, 0, "Grossular" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes.dyeOrange , 1, Arrays.asList(new MaterialStack(Calcium, 3), new MaterialStack(Aluminium, 2), new MaterialStack(Silicon, 3), new MaterialStack(Oxygen, 12))), + HolyWater ( 729, TextureSet.SET_FLUID , 1.0F, 0, 0, 16 , 0, 0, 255, 0, "Holy Water" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeBlue , 0, Arrays.asList(new MaterialStack(Hydrogen, 2), new MaterialStack(Oxygen, 1)), Arrays.asList(new TC_AspectStack(TC_Aspects.AQUA, 2), new TC_AspectStack(TC_Aspects.AURAM, 1))), + Ice ( 702, TextureSet.SET_SHINY , 1.0F, 0, 0, 1| 16 , 200, 200, 255, 0, "Ice" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeBlue , 0, Arrays.asList(new MaterialStack(Hydrogen, 2), new MaterialStack(Oxygen, 1)), Arrays.asList(new TC_AspectStack(TC_Aspects.GELUM, 2))), + Ilmenite ( 918, TextureSet.SET_METALLIC , 1.0F, 0, 3, 1 |8 , 70, 55, 50, 0, "Ilmenite" , 0, 0, -1, 0, F, F, 1, 2, 1, Dyes.dyePurple , 1, Arrays.asList(new MaterialStack(Iron, 1), new MaterialStack(Titanium, 1), new MaterialStack(Oxygen, 3))), + Invar ( 302, TextureSet.SET_METALLIC , 6.0F, 256, 2, 1|2 |64|128 , 180, 180, 120, 0, "Invar" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeBrown , 2, Arrays.asList(new MaterialStack(Iron, 2), new MaterialStack(Nickel, 1)), Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.GELUM, 1))), + IronCompressed ( -1, TextureSet.SET_METALLIC , 7.0F, 96, 1, 1|2 |64|128 , 128, 128, 128, 0, "Compressed Iron" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeGray , 2, Arrays.asList(new MaterialStack(Iron, 1))), + Kanthal ( 312, TextureSet.SET_METALLIC , 6.0F, 64, 2, 1|2 |64 , 194, 210, 223, 0, "Kanthal" , 0, 0, 1800, 1800, T, F, 1, 1, 1, Dyes.dyeYellow , 2, Arrays.asList(new MaterialStack(Iron, 1), new MaterialStack(Aluminium, 1), new MaterialStack(Chrome, 1))), + Lazurite ( 524, TextureSet.SET_LAPIS , 1.0F, 0, 1, 1 |4|8 , 100, 120, 255, 0, "Lazurite" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes.dyeCyan , 1, Arrays.asList(new MaterialStack(Aluminium, 6), new MaterialStack(Silicon, 6), new MaterialStack(Calcium, 8), new MaterialStack(Sodium, 8))), + Magnalium ( 313, TextureSet.SET_DULL , 6.0F, 256, 2, 1|2 |64|128 , 200, 190, 255, 0, "Magnalium" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeLightBlue , 2, Arrays.asList(new MaterialStack(Magnesium, 1), new MaterialStack(Aluminium, 2))), + Magnesite ( 908, TextureSet.SET_METALLIC , 1.0F, 0, 2, 1 |8 , 250, 250, 180, 0, "Magnesite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyePink , 1, Arrays.asList(new MaterialStack(Magnesium, 1), new MaterialStack(Carbon, 1), new MaterialStack(Oxygen, 3))), + Magnetite ( 870, TextureSet.SET_METALLIC , 1.0F, 0, 2, 1 |8 , 30, 30, 30, 0, "Magnetite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeGray , 1, Arrays.asList(new MaterialStack(Iron, 3), new MaterialStack(Oxygen, 4)), Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.MAGNETO, 1))), + Methane ( 715, TextureSet.SET_FLUID , 1.0F, 0, 1, 16 , 255, 255, 255, 0, "Methane" , 1, 45, -1, 0, F, F, 3, 1, 1, Dyes.dyeMagenta , 1, Arrays.asList(new MaterialStack(Carbon, 1), new MaterialStack(Hydrogen, 4))), + Molybdenite ( 942, TextureSet.SET_METALLIC , 1.0F, 0, 2, 1 |8 , 25, 25, 25, 0, "Molybdenite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeBlue , 1, Arrays.asList(new MaterialStack(Molybdenum, 1), new MaterialStack(Sulfur, 2))), // MoS2 (also source of Re) + Nichrome ( 311, TextureSet.SET_METALLIC , 6.0F, 64, 2, 1|2 |64 , 205, 206, 246, 0, "Nichrome" , 0, 0, 2700, 2700, T, F, 1, 1, 1, Dyes.dyeRed , 2, Arrays.asList(new MaterialStack(Nickel, 4), new MaterialStack(Chrome, 1))), + NiobiumNitride ( 359, TextureSet.SET_DULL , 1.0F, 0, 2, 1|2 , 29, 41, 29, 0, "Niobium Nitride" , 0, 0, 2573, 2573, T, F, 1, 1, 1, Dyes.dyeBlack , 1, Arrays.asList(new MaterialStack(Niobium, 1), new MaterialStack(Nitrogen, 1))), // Anti-Reflective Material + NiobiumTitanium ( 360, TextureSet.SET_DULL , 1.0F, 0, 2, 1|2 , 29, 29, 41, 0, "Niobium-Titanium" , 0, 0, 2800, 2800, T, F, 1, 1, 1, Dyes.dyeBlack , 2, Arrays.asList(new MaterialStack(Niobium, 1), new MaterialStack(Titanium, 1))), + NitroCarbon ( 716, TextureSet.SET_FLUID , 1.0F, 0, 1, 16 , 0, 75, 100, 0, "Nitro-Carbon" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeCyan , 1, Arrays.asList(new MaterialStack(Nitrogen, 1), new MaterialStack(Carbon, 1))), + NitrogenDioxide ( 717, TextureSet.SET_FLUID , 1.0F, 0, 1, 16 , 100, 175, 255, 0, "Nitrogen Dioxide" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeCyan , 1, Arrays.asList(new MaterialStack(Nitrogen, 1), new MaterialStack(Oxygen, 2))), + Obsidian ( 804, TextureSet.SET_DULL , 1.0F, 0, 3, 1 , 80, 50, 100, 0, "Obsidian" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeBlack , 1, Arrays.asList(new MaterialStack(Magnesium, 1), new MaterialStack(Iron, 1), new MaterialStack(Silicon, 2), new MaterialStack(Oxygen, 8))), + Phosphate ( 833, TextureSet.SET_DULL , 1.0F, 0, 1, 1 |8|16 , 255, 255, 0, 0, "Phosphate" , 0, 0, -1, 0, F, F, 2, 1, 1, Dyes.dyeYellow , 1, Arrays.asList(new MaterialStack(Phosphor, 1), new MaterialStack(Oxygen, 4))), + PigIron ( 307, TextureSet.SET_METALLIC , 6.0F, 384, 2, 1|2 |8 |64 , 200, 180, 180, 0, "Pig Iron" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes.dyePink , 2, Arrays.asList(new MaterialStack(Iron, 1))), + Plastic ( 874, TextureSet.SET_DULL , 3.0F, 32, 1, 1|2 |64|128 , 200, 200, 200, 0, "Plastic" , 0, 0, 400, 0, F, F, 1, 1, 1, Dyes.dyeWhite , 0, Arrays.asList(new MaterialStack(Carbon, 1), new MaterialStack(Hydrogen, 2)), Arrays.asList(new TC_AspectStack(TC_Aspects.MOTUS, 2))), + Powellite ( 883, TextureSet.SET_DULL , 1.0F, 0, 2, 1 |8 , 255, 255, 0, 0, "Powellite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeYellow , 2, Arrays.asList(new MaterialStack(Calcium, 1), new MaterialStack(Molybdenum, 1), new MaterialStack(Oxygen, 4))), + Pumice ( 926, TextureSet.SET_DULL , 1.0F, 0, 2, 1 |8 , 230, 185, 185, 0, "Pumice" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeGray , 2, Arrays.asList(new MaterialStack(Stone, 1))), + Pyrite ( 834, TextureSet.SET_ROUGH , 1.0F, 0, 1, 1 |8 , 150, 120, 40, 0, "Pyrite" , 0, 0, -1, 0, F, F, 2, 1, 1, Dyes.dyeOrange , 1, Arrays.asList(new MaterialStack(Iron, 1), new MaterialStack(Sulfur, 2))), + Pyrolusite ( 943, TextureSet.SET_DULL , 1.0F, 0, 2, 1 |8 , 150, 150, 170, 0, "Pyrolusite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeLightGray , 1, Arrays.asList(new MaterialStack(Manganese, 1), new MaterialStack(Oxygen, 2))), + Pyrope ( 835, TextureSet.SET_METALLIC , 1.0F, 0, 2, 1 |8 , 120, 50, 100, 0, "Pyrope" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes.dyePurple , 1, Arrays.asList(new MaterialStack(Aluminium, 2), new MaterialStack(Magnesium, 3), new MaterialStack(Silicon, 3), new MaterialStack(Oxygen, 12))), + RockSalt ( 944, TextureSet.SET_FINE , 1.0F, 0, 1, 1 |8 , 240, 200, 200, 0, "Rock Salt" , 0, 0, -1, 0, F, F, 2, 1, 1, Dyes.dyeWhite , 1, Arrays.asList(new MaterialStack(Potassium, 1), new MaterialStack(Chlorine, 1))), + Rubber ( 880, TextureSet.SET_SHINY , 1.5F, 16, 0, 1|2 |64|128 , 0, 0, 0, 0, "Rubber" , 0, 0, 400, 0, F, F, 1, 1, 1, Dyes.dyeBlack , 0, Arrays.asList(new MaterialStack(Carbon, 5), new MaterialStack(Hydrogen, 8)), Arrays.asList(new TC_AspectStack(TC_Aspects.MOTUS, 2))), + Ruby ( 502, TextureSet.SET_RUBY , 7.0F, 256, 2, 1 |4|8 |64 , 255, 100, 100, 127, "Ruby" , 0, 0, -1, 0, F, T, 5, 1, 1, Dyes.dyeRed , 1, Arrays.asList(new MaterialStack(Chrome, 1), new MaterialStack(Aluminium, 2), new MaterialStack(Oxygen, 3)), Arrays.asList(new TC_AspectStack(TC_Aspects.LUCRUM, 6), new TC_AspectStack(TC_Aspects.VITREUS, 4))), + Salt ( 817, TextureSet.SET_FINE , 1.0F, 0, 1, 1 |8 , 250, 250, 250, 0, "Salt" , 0, 0, -1, 0, F, F, 2, 1, 1, Dyes.dyeWhite , 1, Arrays.asList(new MaterialStack(Sodium, 1), new MaterialStack(Chlorine, 1))), + Saltpeter ( 836, TextureSet.SET_FINE , 1.0F, 0, 1, 1 |8 , 230, 230, 230, 0, "Saltpeter" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes.dyeWhite , 1, Arrays.asList(new MaterialStack(Potassium, 1), new MaterialStack(Nitrogen, 1), new MaterialStack(Oxygen, 3))), + SaltWater ( -1, TextureSet.SET_FLUID , 1.0F, 0, 0, 16 , 0, 0, 255, 0, "Salt Water" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeBlue , 0, Arrays.asList(new MaterialStack(Hydrogen, 2), new MaterialStack(Oxygen, 1)), Arrays.asList(new TC_AspectStack(TC_Aspects.AQUA, 2))), + Sapphire ( 503, TextureSet.SET_GEM_VERTICAL , 7.0F, 256, 2, 1 |4|8 |64 , 100, 100, 200, 127, "Sapphire" , 0, 0, -1, 0, F, T, 5, 1, 1, Dyes.dyeBlue , 1, Arrays.asList(new MaterialStack(Aluminium, 2), new MaterialStack(Oxygen, 3)), Arrays.asList(new TC_AspectStack(TC_Aspects.LUCRUM, 5), new TC_AspectStack(TC_Aspects.VITREUS, 3))), + Scheelite ( 910, TextureSet.SET_DULL , 1.0F, 0, 3, 1 |8 , 200, 140, 20, 0, "Scheelite" , 0, 0, 2500, 2500, F, F, 4, 1, 1, Dyes.dyeBlack , 1, Arrays.asList(new MaterialStack(Tungsten, 1), new MaterialStack(Calcium, 2), new MaterialStack(Oxygen, 4))), + SiliconDioxide ( 837, TextureSet.SET_QUARTZ , 1.0F, 0, 1, 1 |16 , 200, 200, 200, 0, "Silicon Dioxide" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeLightGray , 1, Arrays.asList(new MaterialStack(Silicon, 1), new MaterialStack(Oxygen, 2))), + Snow ( 728, TextureSet.SET_FINE , 1.0F, 0, 0, 1| 16 , 250, 250, 250, 0, "Snow" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeWhite , 0, Arrays.asList(new MaterialStack(Hydrogen, 2), new MaterialStack(Oxygen, 1)), Arrays.asList(new TC_AspectStack(TC_Aspects.GELUM, 1))), + Sodalite ( 525, TextureSet.SET_LAPIS , 1.0F, 0, 1, 1 |4|8 , 20, 20, 255, 0, "Sodalite" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes.dyeBlue , 1, Arrays.asList(new MaterialStack(Aluminium, 3), new MaterialStack(Silicon, 3), new MaterialStack(Sodium, 4), new MaterialStack(Chlorine, 1))), + SodiumPersulfate ( 718, TextureSet.SET_FLUID , 1.0F, 0, 2, 16 , 255, 255, 255, 0, "Sodium Persulfate" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeOrange , 1, Arrays.asList(new MaterialStack(Sodium, 1), new MaterialStack(Sulfur, 1), new MaterialStack(Oxygen, 4))), + SodiumSulfide ( 719, TextureSet.SET_FLUID , 1.0F, 0, 2, 16 , 255, 255, 255, 0, "Sodium Sulfide" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeOrange , 1, Arrays.asList(new MaterialStack(Sodium, 1), new MaterialStack(Sulfur, 1))), + SolderingAlloy ( 314, TextureSet.SET_DULL , 1.0F, 0, 1, 1|2 , 220, 220, 230, 0, "Soldering Alloy" , 0, 0, 400, 400, F, F, 1, 1, 1, Dyes.dyeWhite , 2, Arrays.asList(new MaterialStack(Tin, 9), new MaterialStack(Antimony, 1))), + Spessartine ( 838, TextureSet.SET_DULL , 1.0F, 0, 2, 1 |8 , 255, 100, 100, 0, "Spessartine" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes.dyeRed , 1, Arrays.asList(new MaterialStack(Aluminium, 2), new MaterialStack(Manganese, 3), new MaterialStack(Silicon, 3), new MaterialStack(Oxygen, 12))), + Sphalerite ( 839, TextureSet.SET_DULL , 1.0F, 0, 1, 1 |8 , 255, 255, 255, 0, "Sphalerite" , 0, 0, -1, 0, F, F, 2, 1, 1, Dyes.dyeYellow , 1, Arrays.asList(new MaterialStack(Zinc, 1), new MaterialStack(Sulfur, 1))), + StainlessSteel ( 306, TextureSet.SET_SHINY , 7.0F, 480, 2, 1|2 |64|128 , 200, 200, 220, 0, "Stainless Steel" , 0, 0, -1, 1700, T, F, 1, 1, 1, Dyes.dyeWhite , 1, Arrays.asList(new MaterialStack(Iron, 6), new MaterialStack(Chrome, 1), new MaterialStack(Manganese, 1), new MaterialStack(Nickel, 1))), + Steel ( 305, TextureSet.SET_METALLIC , 6.0F, 512, 2, 1|2 |64|128 , 128, 128, 128, 0, "Steel" , 0, 0, 1811, 1000, T, F, 4, 51, 50, Dyes.dyeGray , 1, Arrays.asList(new MaterialStack(Iron, 50), new MaterialStack(Carbon, 1)), Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.ORDO, 1))), + Stibnite ( 945, TextureSet.SET_METALLIC , 1.0F, 0, 2, 1 |8 , 70, 70, 70, 0, "Stibnite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeWhite , 2, Arrays.asList(new MaterialStack(Antimony, 2), new MaterialStack(Sulfur, 3))), + SulfuricAcid ( 720, TextureSet.SET_FLUID , 1.0F, 0, 2, 16 , 255, 128, 0, 0, "Sulfuric Acid" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeOrange , 1, Arrays.asList(new MaterialStack(Hydrogen, 2), new MaterialStack(Sulfur, 1), new MaterialStack(Oxygen, 4))), + Tanzanite ( 508, TextureSet.SET_GEM_VERTICAL , 7.0F, 256, 2, 1 |4|8 |64 , 64, 0, 200, 127, "Tanzanite" , 0, 0, -1, 0, F, T, 5, 1, 1, Dyes.dyePurple , 1, Arrays.asList(new MaterialStack(Calcium, 2), new MaterialStack(Aluminium, 3), new MaterialStack(Silicon, 3), new MaterialStack(Hydrogen, 1), new MaterialStack(Oxygen, 13)), Arrays.asList(new TC_AspectStack(TC_Aspects.LUCRUM, 5), new TC_AspectStack(TC_Aspects.VITREUS, 3))), + Tetrahedrite ( 840, TextureSet.SET_DULL , 1.0F, 0, 2, 1 |8 , 200, 32, 0, 0, "Tetrahedrite" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes.dyeRed , 2, Arrays.asList(new MaterialStack(Copper, 3), new MaterialStack(Antimony, 1), new MaterialStack(Sulfur, 3), new MaterialStack(Iron, 1))), //Cu3SbS3 + x(Fe,Zn)6Sb2S9 + TinAlloy ( 363, TextureSet.SET_METALLIC , 6.5F, 96, 2, 1|2 |64|128 , 200, 200, 200, 0, "Tin Alloy" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeWhite , 2, Arrays.asList(new MaterialStack(Tin, 1), new MaterialStack(Iron, 1)), Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.INSTRUMENTUM, 1))), + Topaz ( 507, TextureSet.SET_GEM_HORIZONTAL , 7.0F, 256, 3, 1 |4|8 |64 , 255, 128, 0, 127, "Topaz" , 0, 0, -1, 0, F, T, 5, 1, 1, Dyes.dyeOrange , 1, Arrays.asList(new MaterialStack(Aluminium, 2), new MaterialStack(Silicon, 1), new MaterialStack(Fluorine, 2), new MaterialStack(Hydrogen, 2), new MaterialStack(Oxygen, 6)), Arrays.asList(new TC_AspectStack(TC_Aspects.LUCRUM, 6), new TC_AspectStack(TC_Aspects.VITREUS, 4))), + Tungstate ( 841, TextureSet.SET_DULL , 1.0F, 0, 3, 1 |8 , 55, 50, 35, 0, "Tungstate" , 0, 0, 2500, 2500, T, F, 4, 1, 1, Dyes.dyeBlack , 1, Arrays.asList(new MaterialStack(Tungsten, 1), new MaterialStack(Lithium, 2), new MaterialStack(Oxygen, 4))), + Ultimet ( 344, TextureSet.SET_SHINY , 6.0F, 512, 3, 1|2 |64|128 , 180, 180, 230, 0, "Ultimet" , 0, 0, 2700, 2700, T, F, 1, 1, 1, Dyes.dyeLightBlue , 1, Arrays.asList(new MaterialStack(Cobalt, 5), new MaterialStack(Chrome, 2), new MaterialStack(Nickel, 1), new MaterialStack(Molybdenum, 1))), // 54% Cobalt, 26% Chromium, 9% Nickel, 5% Molybdenum, 3% Iron, 2% Tungsten, 0.8% Manganese, 0.3% Silicon, 0.08% Nitrogen and 0.06% Carbon + Uraninite ( 922, TextureSet.SET_METALLIC , 1.0F, 0, 3, 1 |8 , 35, 35, 35, 0, "Uraninite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeLime , 2, Arrays.asList(new MaterialStack(Uranium, 1), new MaterialStack(Oxygen, 2))), + Uvarovite ( 842, TextureSet.SET_DIAMOND , 1.0F, 0, 2, 1 |8 , 180, 255, 180, 0, "Uvarovite" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes.dyeGreen , 1, Arrays.asList(new MaterialStack(Calcium, 3), new MaterialStack(Chrome, 2), new MaterialStack(Silicon, 3), new MaterialStack(Oxygen, 12))), + VanadiumGallium ( 357, TextureSet.SET_SHINY , 1.0F, 0, 2, 1|2 , 128, 128, 140, 0, "Vanadium-Gallium" , 0, 0, 3000, 3000, T, F, 1, 1, 1, Dyes.dyeGray , 2, Arrays.asList(new MaterialStack(Vanadium, 3), new MaterialStack(Gallium, 1))), + Water ( 701, TextureSet.SET_FLUID , 1.0F, 0, 0, 16 , 0, 0, 255, 0, "Water" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeBlue , 0, Arrays.asList(new MaterialStack(Hydrogen, 2), new MaterialStack(Oxygen, 1)), Arrays.asList(new TC_AspectStack(TC_Aspects.AQUA, 2))), + Wood ( 809, TextureSet.SET_WOOD , 2.0F, 16, 0, 1|2 |64|128 , 100, 50, 0, 0, "Wood" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeBrown , 0, Arrays.asList(new MaterialStack(Carbon, 1), new MaterialStack(Oxygen, 1), new MaterialStack(Hydrogen, 1)), Arrays.asList(new TC_AspectStack(TC_Aspects.ARBOR, 2))), + WroughtIron ( 304, TextureSet.SET_METALLIC , 6.0F, 384, 2, 1|2 |64|128 , 200, 180, 180, 0, "Wrought Iron" , 0, 0, 1811, 0, F, F, 3, 1, 1, Dyes.dyeLightGray , 2, Arrays.asList(new MaterialStack(Iron, 1))), + Wulfenite ( 882, TextureSet.SET_DULL , 1.0F, 0, 3, 1 |8 , 255, 128, 0, 0, "Wulfenite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeOrange , 2, Arrays.asList(new MaterialStack(Lead, 1), new MaterialStack(Molybdenum, 1), new MaterialStack(Oxygen, 4))), + YellowLimonite ( 931, TextureSet.SET_METALLIC , 1.0F, 0, 2, 1 |8 , 200, 200, 0, 0, "Yellow Limonite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeYellow , 2, Arrays.asList(new MaterialStack(Iron, 1), new MaterialStack(Hydrogen, 1), new MaterialStack(Oxygen, 2))), // FeO(OH) + a bit Ni and Co + YttriumBariumCuprate( 358, TextureSet.SET_METALLIC , 1.0F, 0, 2, 1|2 , 80, 64, 70, 0, "Yttrium Barium Cuprate" , 0, 0, 1200, 1200, T, F, 1, 1, 1, Dyes.dyeGray , 0, Arrays.asList(new MaterialStack(Yttrium, 1), new MaterialStack(Barium, 2), new MaterialStack(Copper, 3), new MaterialStack(Oxygen, 7))), + + /** + * Second Degree Compounds + */ + WoodSealed ( 889, TextureSet.SET_WOOD , 3.0F, 24, 0, 1|2 |64|128 , 80, 40, 0, 0, "Sealed Wood" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeBrown , 0, Arrays.asList(new MaterialStack(Wood, 1)), Arrays.asList(new TC_AspectStack(TC_Aspects.ARBOR, 2), new TC_AspectStack(TC_Aspects.FABRICO, 1))), + LiveRoot ( 832, TextureSet.SET_WOOD , 1.0F, 0, 1, 1 , 220, 200, 0, 0, "Liveroot" , 5, 16, -1, 0, F, F, 2, 4, 3, Dyes.dyeBrown , 2, Arrays.asList(new MaterialStack(Wood, 3), new MaterialStack(Magic, 1)), Arrays.asList(new TC_AspectStack(TC_Aspects.ARBOR, 2), new TC_AspectStack(TC_Aspects.VICTUS, 2), new TC_AspectStack(TC_Aspects.PRAECANTIO, 1))), + IronWood ( 338, TextureSet.SET_WOOD , 6.0F, 384, 2, 1|2 |64|128 , 150, 140, 110, 0, "Ironwood" , 5, 8, -1, 0, F, F, 2, 19, 18, Dyes.dyeBrown , 2, Arrays.asList(new MaterialStack(Iron, 9), new MaterialStack(LiveRoot, 9), new MaterialStack(Gold, 1))), + Glass ( 890, TextureSet.SET_GLASS , 1.0F, 4, 0, 1 |4 , 250, 250, 250, 220, "Glass" , 0, 0, 800, 0, F, T, 1, 1, 1, Dyes.dyeWhite , 2, Arrays.asList(new MaterialStack(SiliconDioxide, 1)), Arrays.asList(new TC_AspectStack(TC_Aspects.VITREUS, 2))), + Perlite ( 925, TextureSet.SET_DULL , 1.0F, 0, 1, 1 |8 , 30, 20, 30, 0, "Perlite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeBlack , 2, Arrays.asList(new MaterialStack(Obsidian, 2), new MaterialStack(Water, 1))), + Borax ( 941, TextureSet.SET_FINE , 1.0F, 0, 1, 1 |8 , 250, 250, 250, 0, "Borax" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeWhite , 1, Arrays.asList(new MaterialStack(Sodium, 2), new MaterialStack(Boron, 4), new MaterialStack(Water, 10), new MaterialStack(Oxygen, 7))), + Lignite ( 538, TextureSet.SET_LIGNITE , 1.0F, 0, 0, 1 |4|8 , 100, 70, 70, 0, "Lignite Coal" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeBlack , 1, Arrays.asList(new MaterialStack(Carbon, 2), new MaterialStack(Water, 4), new MaterialStack(DarkAsh, 1))), + Olivine ( 505, TextureSet.SET_RUBY , 7.0F, 256, 2, 1 |4|8 |64 , 150, 255, 150, 127, "Olivine" , 0, 0, -1, 0, F, T, 5, 1, 1, Dyes.dyeLime , 1, Arrays.asList(new MaterialStack(Magnesium, 2), new MaterialStack(Iron, 1), new MaterialStack(SiliconDioxide, 2)), Arrays.asList(new TC_AspectStack(TC_Aspects.LUCRUM, 4), new TC_AspectStack(TC_Aspects.VITREUS, 2))), + Opal ( 510, TextureSet.SET_OPAL , 7.0F, 256, 2, 1 |4|8 |64 , 0, 0, 255, 0, "Opal" , 0, 0, -1, 0, F, T, 3, 1, 1, Dyes.dyeBlue , 1, Arrays.asList(new MaterialStack(SiliconDioxide, 1)), Arrays.asList(new TC_AspectStack(TC_Aspects.LUCRUM, 5), new TC_AspectStack(TC_Aspects.VITREUS, 3))), + Amethyst ( 509, TextureSet.SET_FLINT , 7.0F, 256, 3, 1 |4|8 |64 , 210, 50, 210, 127, "Amethyst" , 0, 0, -1, 0, F, T, 3, 1, 1, Dyes.dyePink , 1, Arrays.asList(new MaterialStack(SiliconDioxide, 4), new MaterialStack(Iron, 1)), Arrays.asList(new TC_AspectStack(TC_Aspects.LUCRUM, 6), new TC_AspectStack(TC_Aspects.VITREUS, 4))), + Redstone ( 810, TextureSet.SET_ROUGH , 1.0F, 0, 2, 1 |8 , 200, 0, 0, 0, "Redstone" , 0, 0, 500, 0, F, F, 3, 1, 1, Dyes.dyeRed , 2, Arrays.asList(new MaterialStack(Silicon, 1), new MaterialStack(Pyrite, 5), new MaterialStack(Ruby, 1), new MaterialStack(Mercury, 3)), Arrays.asList(new TC_AspectStack(TC_Aspects.MACHINA, 1), new TC_AspectStack(TC_Aspects.POTENTIA, 2))), + Lapis ( 526, TextureSet.SET_LAPIS , 1.0F, 0, 1, 1 |4|8 , 70, 70, 220, 0, "Lapis" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes.dyeBlue , 2, Arrays.asList(new MaterialStack(Lazurite, 12), new MaterialStack(Sodalite, 2), new MaterialStack(Pyrite, 1), new MaterialStack(Calcite, 1)), Arrays.asList(new TC_AspectStack(TC_Aspects.SENSUS, 1))), + Blaze ( 801, TextureSet.SET_POWDER , 2.0F, 16, 1, 1 |64 , 255, 200, 0, 0, "Blaze" , 0, 0, 6400, 0, F, F, 2, 3, 2, Dyes.dyeYellow , 2, Arrays.asList(new MaterialStack(DarkAsh, 1), new MaterialStack(Sulfur, 1), new MaterialStack(Magic, 1)), Arrays.asList(new TC_AspectStack(TC_Aspects.PRAECANTIO, 2), new TC_AspectStack(TC_Aspects.IGNIS, 4))), + EnderPearl ( 532, TextureSet.SET_SHINY , 1.0F, 16, 1, 1 |4 , 108, 220, 200, 0, "Enderpearl" , 0, 0, -1, 0, F, F, 1, 16, 10, Dyes.dyeGreen , 1, Arrays.asList(new MaterialStack(Beryllium, 1), new MaterialStack(Potassium, 4), new MaterialStack(Nitrogen, 5), new MaterialStack(Magic, 6)), Arrays.asList(new TC_AspectStack(TC_Aspects.ALIENIS, 4), new TC_AspectStack(TC_Aspects.ITER, 4), new TC_AspectStack(TC_Aspects.PRAECANTIO, 2))), + EnderEye ( 533, TextureSet.SET_SHINY , 1.0F, 16, 1, 1 |4 , 160, 250, 230, 0, "Endereye" , 5, 10, -1, 0, F, F, 1, 2, 1, Dyes.dyeGreen , 2, Arrays.asList(new MaterialStack(EnderPearl, 1), new MaterialStack(Blaze, 1)), Arrays.asList(new TC_AspectStack(TC_Aspects.SENSUS, 4), new TC_AspectStack(TC_Aspects.ALIENIS, 4), new TC_AspectStack(TC_Aspects.ITER, 4), new TC_AspectStack(TC_Aspects.PRAECANTIO, 3), new TC_AspectStack(TC_Aspects.IGNIS, 2))), + Flint ( 802, TextureSet.SET_FLINT , 2.5F, 64, 1, 1 |64 , 0, 32, 64, 0, "Flint" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeGray , 2, Arrays.asList(new MaterialStack(SiliconDioxide, 1)), Arrays.asList(new TC_AspectStack(TC_Aspects.TERRA, 1), new TC_AspectStack(TC_Aspects.INSTRUMENTUM, 1))), + Diatomite ( 948, TextureSet.SET_DULL , 1.0F, 0, 1, 1 |8 , 225, 225, 225, 0, "Diatomite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeGray , 2, Arrays.asList(new MaterialStack(Flint, 8), new MaterialStack(BandedIron, 1), new MaterialStack(Sapphire, 1))), + VolcanicAsh ( 940, TextureSet.SET_FLINT , 1.0F, 0, 0, 1 , 60, 50, 50, 0, "Volcanic Ashes" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeBlack , 2, Arrays.asList(new MaterialStack(Flint, 6), new MaterialStack(Iron, 1), new MaterialStack(Magnesium, 1))), + Niter ( 531, TextureSet.SET_FLINT , 1.0F, 0, 1, 1 |4|8 , 255, 200, 200, 0, "Niter" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyePink , 2, Arrays.asList(new MaterialStack(Saltpeter, 1))), + Pyrotheum ( 843, TextureSet.SET_FIERY , 1.0F, 0, 1, 1 , 255, 128, 0, 0, "Pyrotheum" , 2, 62, -1, 0, F, F, 2, 3, 1, Dyes.dyeYellow , 2, Arrays.asList(new MaterialStack(Coal, 1), new MaterialStack(Redstone, 1), new MaterialStack(Blaze, 1)), Arrays.asList(new TC_AspectStack(TC_Aspects.PRAECANTIO, 2), new TC_AspectStack(TC_Aspects.IGNIS, 1))), + HydratedCoal ( 818, TextureSet.SET_ROUGH , 1.0F, 0, 1, 1 , 70, 70, 100, 0, "Hydrated Coal" , 0, 0, -1, 0, F, F, 1, 9, 8, Dyes.dyeBlack , 2, Arrays.asList(new MaterialStack(Coal, 8), new MaterialStack(Water, 1))), + Apatite ( 530, TextureSet.SET_DIAMOND , 1.0F, 0, 1, 1 |4|8 , 200, 200, 255, 0, "Apatite" , 0, 0, -1, 0, F, F, 2, 1, 1, Dyes.dyeCyan , 1, Arrays.asList(new MaterialStack(Calcium, 5), new MaterialStack(Phosphate, 3), new MaterialStack(Chlorine, 1)), Arrays.asList(new TC_AspectStack(TC_Aspects.MESSIS, 2))), + Alumite ( -1, TextureSet.SET_METALLIC , 1.5F, 64, 0, 1|2 |64 , 255, 255, 255, 0, "Alumite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyePink , 2, Arrays.asList(new MaterialStack(Aluminium, 5), new MaterialStack(Iron, 2), new MaterialStack(Obsidian, 2)), Arrays.asList(new TC_AspectStack(TC_Aspects.STRONTIO, 2))), + Manyullyn ( -1, TextureSet.SET_METALLIC , 1.5F, 64, 0, 1|2 |64 , 255, 255, 255, 0, "Manyullyn" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyePurple , 2, Arrays.asList(new MaterialStack(Cobalt, 1), new MaterialStack(Aredrite, 1)), Arrays.asList(new TC_AspectStack(TC_Aspects.STRONTIO, 2))), + ShadowIron ( 336, TextureSet.SET_METALLIC , 6.0F, 384, 2, 1|2 |8 |64 , 120, 120, 120, 0, "Shadowiron" , 0, 0, -1, 0, F, F, 3, 4, 3, Dyes.dyeBlack , 2, Arrays.asList(new MaterialStack(Iron, 3), new MaterialStack(Magic, 1))), + ShadowSteel ( 337, TextureSet.SET_METALLIC , 6.0F, 768, 2, 1|2 |64 , 90, 90, 90, 0, "Shadowsteel" , 0, 0, -1, 1700, T, F, 4, 4, 3, Dyes.dyeBlack , 2, Arrays.asList(new MaterialStack(Steel, 3), new MaterialStack(Magic, 1))), + Steeleaf ( 339, TextureSet.SET_LEAF , 8.0F, 768, 3, 1|2 |64|128 , 50, 127, 50, 0, "Steeleaf" , 5, 24, -1, 0, F, F, 4, 1, 1, Dyes.dyeGreen , 2, Arrays.asList(new MaterialStack(Steel, 1), new MaterialStack(Magic, 1)), Arrays.asList(new TC_AspectStack(TC_Aspects.HERBA, 2), new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.PRAECANTIO, 1))), + Knightmetal ( 362, TextureSet.SET_METALLIC , 8.0F, 1024, 3, 1|2 |64|128 , 210, 240, 200, 0, "Knightmetal" , 5, 24, -1, 0, F, F, 4, 1, 1, Dyes.dyeLime , 2, Arrays.asList(new MaterialStack(Steel, 2), new MaterialStack(Magic, 1)), Arrays.asList(new TC_AspectStack(TC_Aspects.LUCRUM, 1), new TC_AspectStack(TC_Aspects.METALLUM, 2))), + SterlingSilver ( 350, TextureSet.SET_SHINY , 13.0F, 128, 2, 1|2 |64|128 , 250, 220, 225, 0, "Sterling Silver" , 0, 0, -1, 1700, T, F, 4, 1, 1, Dyes.dyeWhite , 2, Arrays.asList(new MaterialStack(Copper, 1), new MaterialStack(Silver, 4))), + RoseGold ( 351, TextureSet.SET_SHINY , 14.0F, 128, 2, 1|2 |64|128 , 255, 230, 30, 0, "Rose Gold" , 0, 0, -1, 1600, T, F, 4, 1, 1, Dyes.dyeOrange , 2, Arrays.asList(new MaterialStack(Copper, 1), new MaterialStack(Gold, 4))), + BlackBronze ( 352, TextureSet.SET_DULL , 12.0F, 256, 2, 1|2 |64|128 , 100, 50, 125, 0, "Black Bronze" , 0, 0, -1, 2000, T, F, 4, 1, 1, Dyes.dyePurple , 2, Arrays.asList(new MaterialStack(Gold, 1), new MaterialStack(Silver, 1), new MaterialStack(Copper, 3))), + BismuthBronze ( 353, TextureSet.SET_DULL , 8.0F, 256, 2, 1|2 |64|128 , 100, 125, 125, 0, "Bismuth Bronze" , 0, 0, -1, 1100, T, F, 4, 1, 1, Dyes.dyeCyan , 2, Arrays.asList(new MaterialStack(Bismuth, 1), new MaterialStack(Zinc, 1), new MaterialStack(Copper, 3))), + BlackSteel ( 334, TextureSet.SET_METALLIC , 6.5F, 768, 2, 1|2 |64 , 100, 100, 100, 0, "Black Steel" , 0, 0, -1, 1200, T, F, 4, 1, 1, Dyes.dyeBlack , 2, Arrays.asList(new MaterialStack(Nickel, 1), new MaterialStack(BlackBronze, 1), new MaterialStack(Steel, 3))), + RedSteel ( 348, TextureSet.SET_METALLIC , 7.0F, 896, 2, 1|2 |64 , 140, 100, 100, 0, "Red Steel" , 0, 0, -1, 1300, T, F, 4, 1, 1, Dyes.dyeRed , 2, Arrays.asList(new MaterialStack(SterlingSilver, 1), new MaterialStack(BismuthBronze, 1), new MaterialStack(Steel, 2), new MaterialStack(BlackSteel, 4))), + BlueSteel ( 349, TextureSet.SET_METALLIC , 7.5F, 1024, 2, 1|2 |64 , 100, 100, 140, 0, "Blue Steel" , 0, 0, -1, 1400, T, F, 4, 1, 1, Dyes.dyeBlue , 2, Arrays.asList(new MaterialStack(RoseGold, 1), new MaterialStack(Brass, 1), new MaterialStack(Steel, 2), new MaterialStack(BlackSteel, 4))), + DamascusSteel ( 335, TextureSet.SET_METALLIC , 8.0F, 1280, 2, 1|2 |64 , 110, 110, 110, 0, "Damascus Steel" , 0, 0, 2000, 1500, T, F, 4, 1, 1, Dyes.dyeGray , 2, Arrays.asList(new MaterialStack(Steel, 1))), + TungstenSteel ( 316, TextureSet.SET_METALLIC , 10.0F, 5120, 4, 1|2 |64|128 , 100, 100, 160, 0, "Tungstensteel" , 0, 0, -1, 3000, T, F, 4, 1, 1, Dyes.dyeBlue , 2, Arrays.asList(new MaterialStack(Steel, 1), new MaterialStack(Tungsten, 1))), + NitroCoalFuel ( -1, TextureSet.SET_FLUID , 1.0F, 0, 2, 16 , 50, 70, 50, 0, "Nitro-Coalfuel" , 0, 48, -1, 0, F, F, 1, 1, 1, Dyes.dyeBlack , 0, Arrays.asList(new MaterialStack(Glyceryl, 1), new MaterialStack(CoalFuel, 4))), + NitroFuel ( 709, TextureSet.SET_FLUID , 1.0F, 0, 2, 16 , 200, 255, 0, 0, "Nitro-Diesel" , 0, 384, -1, 0, F, F, 1, 1, 1, Dyes.dyeLime , 0, Arrays.asList(new MaterialStack(Glyceryl, 1), new MaterialStack(Fuel, 4))), + AstralSilver ( 333, TextureSet.SET_SHINY , 10.0F, 64, 2, 1|2 |8 |64 , 230, 230, 255, 0, "Astral Silver" , 0, 0, -1, 0, F, F, 4, 3, 2, Dyes.dyeWhite , 2, Arrays.asList(new MaterialStack(Silver, 2), new MaterialStack(Magic, 1))), + Midasium ( 332, TextureSet.SET_SHINY , 12.0F, 64, 2, 1|2 |8 |64 , 255, 200, 40, 0, "Midasium" , 0, 0, -1, 0, F, F, 4, 3, 2, Dyes.dyeOrange , 2, Arrays.asList(new MaterialStack(Gold, 2), new MaterialStack(Magic, 1))), + Mithril ( 331, TextureSet.SET_SHINY , 14.0F, 64, 3, 1|2 |8 |64 , 255, 255, 210, 0, "Mithril" , 0, 0, -1, 0, F, F, 4, 3, 2, Dyes.dyeLightBlue , 2, Arrays.asList(new MaterialStack(Platinum, 2), new MaterialStack(Magic, 1))), + BlueAlloy ( 309, TextureSet.SET_DULL , 1.0F, 0, 0, 1|2 , 100, 180, 255, 0, "Blue Alloy" , 0, 0, -1, 0, F, F, 3, 5, 1, Dyes.dyeLightBlue , 2, Arrays.asList(new MaterialStack(Silver, 1), new MaterialStack(Nikolite, 4)), Arrays.asList(new TC_AspectStack(TC_Aspects.ELECTRUM, 3))), + RedAlloy ( 308, TextureSet.SET_DULL , 1.0F, 0, 0, 1|2 , 200, 0, 0, 0, "Red Alloy" , 0, 0, -1, 0, F, F, 3, 5, 1, Dyes.dyeRed , 2, Arrays.asList(new MaterialStack(Metal, 1), new MaterialStack(Redstone, 4)), Arrays.asList(new TC_AspectStack(TC_Aspects.MACHINA, 3))), + CobaltBrass ( 343, TextureSet.SET_METALLIC , 8.0F, 256, 2, 1|2 |64|128 , 180, 180, 160, 0, "Cobalt Brass" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes.dyeOrange , 2, Arrays.asList(new MaterialStack(Brass, 7), new MaterialStack(Aluminium, 1), new MaterialStack(Cobalt, 1))), + Phosphorus ( 534, TextureSet.SET_FLINT , 1.0F, 0, 2, 1 |4|8|16 , 255, 255, 0, 0, "Phosphorus" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes.dyeYellow , 2, Arrays.asList(new MaterialStack(Calcium, 3), new MaterialStack(Phosphate, 2))), + Basalt ( 844, TextureSet.SET_ROUGH , 1.0F, 0, 1, 1 , 30, 20, 20, 0, "Basalt" , 0, 0, -1, 0, F, F, 2, 1, 1, Dyes.dyeBlack , 2, Arrays.asList(new MaterialStack(Olivine, 1), new MaterialStack(Calcite, 3), new MaterialStack(Flint, 8), new MaterialStack(DarkAsh, 4)), Arrays.asList(new TC_AspectStack(TC_Aspects.TENEBRAE, 1))), + GarnetRed ( 527, TextureSet.SET_RUBY , 7.0F, 128, 2, 1 |4|8 |64 , 200, 80, 80, 127, "Red Garnet" , 0, 0, -1, 0, F, T, 4, 1, 1, Dyes.dyeRed , 2, Arrays.asList(new MaterialStack(Pyrope, 3), new MaterialStack(Almandine, 5), new MaterialStack(Spessartine, 8)), Arrays.asList(new TC_AspectStack(TC_Aspects.VITREUS, 3))), + GarnetYellow ( 528, TextureSet.SET_RUBY , 7.0F, 128, 2, 1 |4|8 |64 , 200, 200, 80, 127, "Yellow Garnet" , 0, 0, -1, 0, F, T, 4, 1, 1, Dyes.dyeYellow , 2, Arrays.asList(new MaterialStack(Andradite, 5), new MaterialStack(Grossular, 8), new MaterialStack(Uvarovite, 3)), Arrays.asList(new TC_AspectStack(TC_Aspects.VITREUS, 3))), + Marble ( 845, TextureSet.SET_FINE , 1.0F, 0, 1, 1 , 200, 200, 200, 0, "Marble" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeWhite , 2, Arrays.asList(new MaterialStack(Magnesium, 1), new MaterialStack(Calcite, 7)), Arrays.asList(new TC_AspectStack(TC_Aspects.PERFODIO, 1))), + Sugar ( 803, TextureSet.SET_FINE , 1.0F, 0, 1, 1 , 250, 250, 250, 0, "Sugar" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeWhite , 1, Arrays.asList(new MaterialStack(Carbon, 2), new MaterialStack(Water, 5), new MaterialStack(Oxygen, 25)), Arrays.asList(new TC_AspectStack(TC_Aspects.HERBA, 1), new TC_AspectStack(TC_Aspects.AQUA, 1), new TC_AspectStack(TC_Aspects.AER, 1))), + Thaumium ( 330, TextureSet.SET_METALLIC , 12.0F, 256, 3, 1|2 |64|128 , 150, 100, 200, 0, "Thaumium" , 0, 0, -1, 0, F, F, 5, 2, 1, Dyes.dyePurple , 0, Arrays.asList(new MaterialStack(Iron, 1), new MaterialStack(Magic, 1)), Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.PRAECANTIO, 1))), + Vinteum ( 529, TextureSet.SET_EMERALD , 10.0F, 128, 3, 1 |4|8 |64 , 100, 200, 255, 0, "Vinteum" , 5, 32, -1, 0, F, F, 4, 1, 1, Dyes.dyeLightBlue , 2, Arrays.asList(new MaterialStack(Magic, 1)), Arrays.asList(new TC_AspectStack(TC_Aspects.VITREUS, 2), new TC_AspectStack(TC_Aspects.PRAECANTIO, 1))), + Vis ( -1, TextureSet.SET_SHINY , 1.0F, 0, 3, 0 , 128, 0, 255, 0, "Vis" , 5, 32, -1, 0, F, F, 1, 1, 1, Dyes.dyePurple , 2, Arrays.asList(new MaterialStack(Magic, 1)), Arrays.asList(new TC_AspectStack(TC_Aspects.AURAM, 2), new TC_AspectStack(TC_Aspects.PRAECANTIO, 1))), + Redrock ( 846, TextureSet.SET_ROUGH , 1.0F, 0, 1, 1 , 255, 80, 50, 0, "Redrock" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeRed , 2, Arrays.asList(new MaterialStack(Calcite, 2), new MaterialStack(Flint, 1), new MaterialStack(Clay, 1))), + PotassiumFeldspar ( 847, TextureSet.SET_FINE , 1.0F, 0, 1, 1 , 120, 40, 40, 0, "Potassium Feldspar" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyePink , 1, Arrays.asList(new MaterialStack(Potassium, 1), new MaterialStack(Aluminium, 1), new MaterialStack(Silicon, 3), new MaterialStack(Oxygen, 8))), + Biotite ( 848, TextureSet.SET_METALLIC , 1.0F, 0, 1, 1 , 20, 30, 20, 0, "Biotite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeGray , 1, Arrays.asList(new MaterialStack(Potassium, 1), new MaterialStack(Magnesium, 3), new MaterialStack(Aluminium, 3), new MaterialStack(Fluorine, 2), new MaterialStack(Silicon, 3), new MaterialStack(Oxygen, 10))), + GraniteBlack ( 849, TextureSet.SET_ROUGH , 4.0F, 64, 3, 1 |64|128 , 10, 10, 10, 0, "Black Granite" , 0, 0, -1, 0, F, F, 0, 1, 1, Dyes.dyeBlack , 2, Arrays.asList(new MaterialStack(SiliconDioxide, 4), new MaterialStack(Biotite, 1)), Arrays.asList(new TC_AspectStack(TC_Aspects.TUTAMEN, 1))), + GraniteRed ( 850, TextureSet.SET_ROUGH , 4.0F, 64, 3, 1 |64|128 , 255, 0, 128, 0, "Red Granite" , 0, 0, -1, 0, F, F, 0, 1, 1, Dyes.dyeMagenta , 1, Arrays.asList(new MaterialStack(Aluminium, 2), new MaterialStack(PotassiumFeldspar, 1), new MaterialStack(Oxygen, 3)), Arrays.asList(new TC_AspectStack(TC_Aspects.TUTAMEN, 1))), + Chrysotile ( 912, TextureSet.SET_DULL , 1.0F, 0, 2, 1 |8 , 110, 140, 110, 0, "Chrysotile" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeWhite , 2, Arrays.asList(new MaterialStack(Asbestos, 1))), + VanadiumMagnetite ( 923, TextureSet.SET_METALLIC , 1.0F, 0, 2, 1 |8 , 35, 35, 60, 0, "Vanadium Magnetite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeBlack , 2, Arrays.asList(new MaterialStack(Magnetite, 1), new MaterialStack(Vanadium, 1)), Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.MAGNETO, 1))), // Mixture of Fe3O4 and V2O5 + BasalticMineralSand ( 935, TextureSet.SET_SAND , 1.0F, 0, 1, 1 |8 , 40, 50, 40, 0, "Basaltic Mineral Sand" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeBlack , 2, Arrays.asList(new MaterialStack(Magnetite, 1), new MaterialStack(Basalt, 1)), Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.MAGNETO, 1))), + GraniticMineralSand ( 936, TextureSet.SET_SAND , 1.0F, 0, 1, 1 |8 , 40, 60, 60, 0, "Granitic Mineral Sand" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeBlack , 2, Arrays.asList(new MaterialStack(Magnetite, 1), new MaterialStack(GraniteBlack, 1)), Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.MAGNETO, 1))), + GarnetSand ( 938, TextureSet.SET_SAND , 1.0F, 0, 1, 1 |8 , 200, 100, 0, 0, "Garnet Sand" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeOrange , 2, Arrays.asList(new MaterialStack(GarnetRed, 1), new MaterialStack(GarnetYellow, 1))), + QuartzSand ( 939, TextureSet.SET_SAND , 1.0F, 0, 1, 1 |8 , 200, 200, 200, 0, "Quartz Sand" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes.dyeWhite , 2, Arrays.asList(new MaterialStack(CertusQuartz, 1), new MaterialStack(Quartzite, 1))), + Bastnasite ( 905, TextureSet.SET_FINE , 1.0F, 0, 2, 1 |8 , 200, 110, 45, 0, "Bastnasite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL , 1, Arrays.asList(new MaterialStack(Cerium, 1), new MaterialStack(Carbon, 1), new MaterialStack(Fluorine, 1), new MaterialStack(Oxygen, 3))), // (Ce, La, Y)CO3F + Pentlandite ( 909, TextureSet.SET_DULL , 1.0F, 0, 2, 1 |8 , 165, 150, 5, 0, "Pentlandite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL , 1, Arrays.asList(new MaterialStack(Nickel, 9), new MaterialStack(Sulfur, 8))), // (Fe,Ni)9S8 + Spodumene ( 920, TextureSet.SET_DULL , 1.0F, 0, 2, 1 |8 , 190, 170, 170, 0, "Spodumene" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL , 1, Arrays.asList(new MaterialStack(Lithium, 1), new MaterialStack(Aluminium, 1), new MaterialStack(Silicon, 2), new MaterialStack(Oxygen, 6))), // LiAl(SiO3)2 + Pollucite ( 919, TextureSet.SET_DULL , 1.0F, 0, 2, 1 |8 , 240, 210, 210, 0, "Pollucite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL , 1, Arrays.asList(new MaterialStack(Caesium, 2), new MaterialStack(Aluminium, 2), new MaterialStack(Silicon, 4), new MaterialStack(Water, 2), new MaterialStack(Oxygen, 12))), // (Cs,Na)2Al2Si4O12 2H2O (also a source of Rb) + Tantalite ( 921, TextureSet.SET_METALLIC , 1.0F, 0, 3, 1 |8 , 145, 80, 40, 0, "Tantalite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL , 1, Arrays.asList(new MaterialStack(Manganese, 1), new MaterialStack(Tantalum, 2), new MaterialStack(Oxygen, 6))), // (Fe, Mn)Ta2O6 (also source of Nb) + Lepidolite ( 907, TextureSet.SET_FINE , 1.0F, 0, 2, 1 |8 , 240, 50, 140, 0, "Lepidolite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL , 1, Arrays.asList(new MaterialStack(Potassium, 1), new MaterialStack(Lithium, 3), new MaterialStack(Aluminium, 4), new MaterialStack(Fluorine, 2), new MaterialStack(Oxygen, 10))), // K(Li,Al,Rb)3(Al,Si)4O10(F,OH)2 + Glauconite ( 933, TextureSet.SET_DULL , 1.0F, 0, 2, 1 |8 , 130, 180, 60, 0, "Glauconite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL , 1, Arrays.asList(new MaterialStack(Potassium, 1), new MaterialStack(Magnesium, 2), new MaterialStack(Aluminium, 4), new MaterialStack(Hydrogen, 2), new MaterialStack(Oxygen, 12))), // (K,Na)(Fe3+,Al,Mg)2(Si,Al)4O10(OH)2 + GlauconiteSand ( 949, TextureSet.SET_DULL , 1.0F, 0, 2, 1 |8 , 130, 180, 60, 0, "Glauconite Sand" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL , 1, Arrays.asList(new MaterialStack(Potassium, 1), new MaterialStack(Magnesium, 2), new MaterialStack(Aluminium, 4), new MaterialStack(Hydrogen, 2), new MaterialStack(Oxygen, 12))), // (K,Na)(Fe3+,Al,Mg)2(Si,Al)4O10(OH)2 + Vermiculite ( 932, TextureSet.SET_METALLIC , 1.0F, 0, 2, 1 |8 , 200, 180, 15, 0, "Vermiculite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL , 1, Arrays.asList(new MaterialStack(Iron, 3), new MaterialStack(Aluminium, 4), new MaterialStack(Silicon, 4), new MaterialStack(Hydrogen, 2), new MaterialStack(Water, 4), new MaterialStack(Oxygen, 12))), // (Mg+2, Fe+2, Fe+3)3 [(AlSi)4O10] (OH)2 4H2O) + Bentonite ( 927, TextureSet.SET_ROUGH , 1.0F, 0, 2, 1 |8 , 245, 215, 210, 0, "Bentonite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL , 1, Arrays.asList(new MaterialStack(Sodium, 1), new MaterialStack(Magnesium, 6), new MaterialStack(Silicon, 12), new MaterialStack(Hydrogen, 6), new MaterialStack(Water, 5), new MaterialStack(Oxygen, 36))), // (Na,Ca)0.33(Al,Mg)2(Si4O10)(OH)2 nH2O + FullersEarth ( 928, TextureSet.SET_FINE , 1.0F, 0, 2, 1 |8 , 160, 160, 120, 0, "Fullers Earth" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL , 1, Arrays.asList(new MaterialStack(Magnesium, 1), new MaterialStack(Silicon, 4), new MaterialStack(Hydrogen, 1), new MaterialStack(Water, 4), new MaterialStack(Oxygen, 11))), // (Mg,Al)2Si4O10(OH) 4(H2O) + Pitchblende ( 873, TextureSet.SET_DULL , 1.0F, 0, 3, 1 |8 , 200, 210, 0, 0, "Pitchblende" , 0, 0, -1, 0, F, F, 5, 1, 1, Dyes.dyeYellow , 2, Arrays.asList(new MaterialStack(Uraninite, 3), new MaterialStack(Thorium, 1), new MaterialStack(Lead, 1))), + Monazite ( 520, TextureSet.SET_DIAMOND , 1.0F, 0, 1, 1 |4|8 , 50, 70, 50, 0, "Monazite" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes.dyeGreen , 1, Arrays.asList(new MaterialStack(RareEarth, 1), new MaterialStack(Phosphate, 1))), // Wikipedia: (Ce, La, Nd, Th, Sm, Gd)PO4 Monazite also smelt-extract to Helium, it is brown like the rare earth Item Monazite sand deposits are inevitably of the monazite-(Ce) composition. Typically, the lanthanides in such monazites contain about 45�48% cerium, about 24% lanthanum, about 17% neodymium, about 5% praseodymium, and minor quantities of samarium, gadolinium, and yttrium. Europium concentrations tend to be low, about 0.05% Thorium content of monazite is variable and sometimes can be up to 20�30% + Malachite ( 871, TextureSet.SET_DULL , 1.0F, 0, 2, 1 |8 , 5, 95, 5, 0, "Malachite" , 0, 0, -1, 0, F, F, 3, 1, 1, Dyes.dyeGreen , 1, Arrays.asList(new MaterialStack(Copper, 2), new MaterialStack(Carbon, 1), new MaterialStack(Hydrogen, 2), new MaterialStack(Oxygen, 5))), // Cu2CO3(OH)2 + Mirabilite ( 900, TextureSet.SET_DULL , 1.0F, 0, 2, 1 |8 , 240, 250, 210, 0, "Mirabilite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL , 1, Arrays.asList(new MaterialStack(Sodium, 2), new MaterialStack(Sulfur, 1), new MaterialStack(Water, 10), new MaterialStack(Oxygen, 4))), // Na2SO4 10H2O + Mica ( 901, TextureSet.SET_FINE , 1.0F, 0, 1, 1 |8 , 195, 195, 205, 0, "Mica" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL , 1, Arrays.asList(new MaterialStack(Potassium, 1), new MaterialStack(Aluminium, 3), new MaterialStack(Silicon, 3), new MaterialStack(Fluorine, 2), new MaterialStack(Oxygen, 10))), // KAl2(AlSi3O10)(F,OH)2 + Trona ( 903, TextureSet.SET_METALLIC , 1.0F, 0, 1, 1 |8 , 135, 135, 95, 0, "Trona" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL , 1, Arrays.asList(new MaterialStack(Sodium, 3), new MaterialStack(Carbon, 2), new MaterialStack(Hydrogen, 1), new MaterialStack(Water, 2), new MaterialStack(Oxygen, 6))), // Na3(CO3)(HCO3) 2H2O + Barite ( 904, TextureSet.SET_DULL , 1.0F, 0, 2, 1 |8 , 230, 235, 255, 0, "Barite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL , 1, Arrays.asList(new MaterialStack(Barium, 1), new MaterialStack(Sulfur, 1), new MaterialStack(Oxygen, 4))), + Gypsum ( 934, TextureSet.SET_DULL , 1.0F, 0, 1, 1 |8 , 230, 230, 250, 0, "Gypsum" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL , 1, Arrays.asList(new MaterialStack(Calcium, 1), new MaterialStack(Sulfur, 1), new MaterialStack(Water, 2), new MaterialStack(Oxygen, 4))), // CaSO4 2H2O + Alunite ( 911, TextureSet.SET_METALLIC , 1.0F, 0, 2, 1 |8 , 225, 180, 65, 0, "Alunite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL , 1, Arrays.asList(new MaterialStack(Potassium, 1), new MaterialStack(Aluminium, 3), new MaterialStack(Silicon, 2), new MaterialStack(Hydrogen, 6), new MaterialStack(Oxygen, 14))), // KAl3(SO4)2(OH)6 + Dolomite ( 914, TextureSet.SET_FLINT , 1.0F, 0, 1, 1 |8 , 225, 205, 205, 0, "Dolomite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL , 1, Arrays.asList(new MaterialStack(Calcium, 1), new MaterialStack(Magnesium, 1), new MaterialStack(Carbon, 2), new MaterialStack(Oxygen, 6))), // CaMg(CO3)2 + Wollastonite ( 915, TextureSet.SET_DULL , 1.0F, 0, 2, 1 |8 , 240, 240, 240, 0, "Wollastonite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL , 1, Arrays.asList(new MaterialStack(Calcium, 1), new MaterialStack(Silicon, 1), new MaterialStack(Oxygen, 3))), // CaSiO3 + Zeolite ( 916, TextureSet.SET_DULL , 1.0F, 0, 2, 1 |8 , 240, 230, 230, 0, "Zeolite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL , 1, Arrays.asList(new MaterialStack(Sodium, 1), new MaterialStack(Calcium, 4), new MaterialStack(Silicon, 27), new MaterialStack(Aluminium, 9), new MaterialStack(Water, 28), new MaterialStack(Oxygen, 72))), // NaCa4(Si27Al9)O72 28(H2O) + Kyanite ( 924, TextureSet.SET_FLINT , 1.0F, 0, 2, 1 |8 , 110, 110, 250, 0, "Kyanite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL , 1, Arrays.asList(new MaterialStack(Aluminium, 2), new MaterialStack(Silicon, 1), new MaterialStack(Oxygen, 5))), // Al2SiO5 + Kaolinite ( 929, TextureSet.SET_DULL , 1.0F, 0, 2, 1 |8 , 245, 235, 235, 0, "Kaolinite" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL , 1, Arrays.asList(new MaterialStack(Aluminium, 2), new MaterialStack(Silicon, 2), new MaterialStack(Hydrogen, 4), new MaterialStack(Oxygen, 9))), // Al2Si2O5(OH)4 + Talc ( 902, TextureSet.SET_DULL , 1.0F, 0, 2, 1 |8 , 90, 180, 90, 0, "Talc" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL , 1, Arrays.asList(new MaterialStack(Magnesium, 3), new MaterialStack(Silicon, 4), new MaterialStack(Hydrogen, 2), new MaterialStack(Oxygen, 12))), // H2Mg3(SiO3)4 + Soapstone ( 877, TextureSet.SET_DULL , 1.0F, 0, 1, 1 |8 , 95, 145, 95, 0, "Soapstone" , 0, 0, -1, 0, F, F, 1, 1, 1, Dyes._NULL , 1, Arrays.asList(new MaterialStack(Magnesium, 3), new MaterialStack(Silicon, 4), new MaterialStack(Hydrogen, 2), new MaterialStack(Oxygen, 12))), // H2Mg3(SiO3)4 + Concrete ( 947, TextureSet.SET_ROUGH , 1.0F, 0, 1, 1 , 100, 100, 100, 0, "Concrete" , 0, 0, 300, 0, F, F, 0, 1, 1, Dyes.dyeGray , 0, Arrays.asList(new MaterialStack(Stone, 1)), Arrays.asList(new TC_AspectStack(TC_Aspects.TERRA, 1))), + IronMagnetic ( 354, TextureSet.SET_MAGNETIC , 6.0F, 256, 2, 1|2 |64|128 , 200, 200, 200, 0, "Magnetic Iron" , 0, 0, -1, 0, F, F, 4, 51, 50, Dyes.dyeGray , 1, Arrays.asList(new MaterialStack(Iron, 1)), Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.MAGNETO, 1))), + SteelMagnetic ( 355, TextureSet.SET_MAGNETIC , 6.0F, 512, 2, 1|2 |64|128 , 128, 128, 128, 0, "Magnetic Steel" , 0, 0, 1000, 1000, T, F, 4, 51, 50, Dyes.dyeGray , 1, Arrays.asList(new MaterialStack(Steel, 1)), Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 1), new TC_AspectStack(TC_Aspects.ORDO, 1), new TC_AspectStack(TC_Aspects.MAGNETO, 1))), + NeodymiumMagnetic ( 356, TextureSet.SET_MAGNETIC , 7.0F, 512, 2, 1|2 |64|128 , 100, 100, 100, 0, "Magnetic Neodymium" , 0, 0, 1297, 1297, T, F, 4, 51, 50, Dyes.dyeGray , 1, Arrays.asList(new MaterialStack(Neodymium, 1)), Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 1), new TC_AspectStack(TC_Aspects.MAGNETO, 3))), + + /** + * Materials which are renamed automatically + */ + @Deprecated IridiumAndSodiumOxide(IridiumSodiumOxide, F), + @Deprecated Palygorskite (FullersEarth, F), + @Deprecated Adamantine (Adamantium, T), + @Deprecated FzDarkIron (DarkIron, T), + @Deprecated FZDarkIron (DarkIron, T), + @Deprecated Ashes (Ash, F), + @Deprecated DarkAshes (DarkAsh, F), + @Deprecated Abyssal (Basalt, F), + @Deprecated Adamant (Adamantium, T), + @Deprecated AluminumBrass (AluminiumBrass, F), + @Deprecated Aluminum (Aluminium, F), + @Deprecated NaturalAluminum (Aluminium, F), + @Deprecated NaturalAluminium (Aluminium, F), + @Deprecated Americum (Americium, F), + @Deprecated Beryl (Emerald, F), // 30,200,200 + @Deprecated BlackGranite (GraniteBlack, F), + @Deprecated CalciumCarbonate (Calcite, F), + @Deprecated CreosoteOil (Creosote, F), + @Deprecated Chromium (Chrome, F), + @Deprecated Diesel (Fuel, F), + @Deprecated Enderpearl (EnderPearl, F), + @Deprecated Endereye (EnderEye, F), + @Deprecated EyeOfEnder (EnderEye, F), + @Deprecated Eyeofender (EnderEye, F), + @Deprecated RawTerrasteelAlloy (TerrasteelAlloyRaw, F), + @Deprecated StrengthenedTerrasteelAlloy(TerrasteelAlloyStrengthened, F), + @Deprecated Flour (Wheat, F), + @Deprecated Meat (MeatRaw, F), + @Deprecated Garnet (GarnetRed, T), + @Deprecated Granite (GraniteBlack, F), + @Deprecated Goethite (BrownLimonite, F), + @Deprecated Kalium (Potassium, F), + @Deprecated Lapislazuli (Lapis, F), + @Deprecated LapisLazuli (Lapis, F), + @Deprecated Monazit (Monazite, F), + @Deprecated Natrium (Sodium, F), + @Deprecated Mythril (Mithril, F), + @Deprecated NitroDiesel (NitroFuel, F), + @Deprecated Naquadriah (Naquadria, F), + @Deprecated Obby (Obsidian, F), + @Deprecated Peridot (Olivine, T), + @Deprecated Phosphorite (Phosphorus, T), + @Deprecated Quarried (Marble, F), + @Deprecated Quicksilver (Mercury, T), + @Deprecated QuickSilver (Mercury, F), + @Deprecated RedRock (Redrock, F), + @Deprecated RefinedIron (Iron, F), + @Deprecated RedGranite (GraniteRed, F), + @Deprecated Sheldonite (Cooperite, F), + @Deprecated Soulsand (SoulSand, F), + @Deprecated SilverLead (Galena, F), + @Deprecated Titan (Titanium, F), + @Deprecated Uran (Uranium, F), + @Deprecated Wolframite (Tungstate, F), + @Deprecated Wolframium (Tungsten, F), + @Deprecated Wolfram (Tungsten, F), + @Deprecated WrougtIron (WroughtIron, F); + + /** List of all Materials. */ + public static final Collection VALUES = new HashSet(Arrays.asList(values())); + + static { + SubTag.ELECTROMAGNETIC_SEPERATION_NEODYMIUM.addTo(Bastnasite, Monazite, Forcicium, Forcillium); + SubTag.ELECTROMAGNETIC_SEPERATION_GOLD.addTo(Magnetite, VanadiumMagnetite, BasalticMineralSand, GraniticMineralSand); + SubTag.ELECTROMAGNETIC_SEPERATION_IRON.addTo(YellowLimonite, BrownLimonite, Pyrite, BandedIron, Nickel, Vermiculite, Glauconite, GlauconiteSand, Pentlandite, Tin, Antimony, Ilmenite, Manganese, Chrome, Chromite, Andradite); + SubTag.BLASTFURNACE_CALCITE_DOUBLE.addTo(Pyrite, YellowLimonite, BasalticMineralSand, GraniticMineralSand); + SubTag.BLASTFURNACE_CALCITE_TRIPLE.addTo(Iron, PigIron, DeepIron, ShadowIron, WroughtIron, MeteoricIron, BrownLimonite); + SubTag.WASHING_MERCURY.addTo(Gold, Silver, Osmium, Mithril, Platinum, Midasium, Cooperite, AstralSilver); + SubTag.WASHING_SODIUMPERSULFATE.addTo(Zinc, Nickel, Copper, Cobalt, Cobaltite, Tetrahedrite); + SubTag.METAL.addTo(AnyIron, AnyCopper, AnyBronze, Metal, Aluminium, Americium, Antimony, Beryllium, Bismuth, Caesium, Cerium, Chrome, Cobalt, Copper, Dysprosium, Erbium, Europium, Gadolinium, Gallium, Gold, Holmium, Indium, Iridium, Iron, Lanthanum, Lead, Lutetium, Magnesium, Manganese, Mercury, Niobium, Molybdenum, Neodymium, Neutronium, Nickel, Osmium, Palladium, Platinum, Plutonium, Plutonium241, Praseodymium, Promethium, Rubidium, Samarium, Scandium, Silicon, Silver, Tantalum, Tellurium, Terbium, Thorium, Thulium, Tin, Titanium, Tungsten, Uranium, Uranium235, Vanadium, Ytterbium, Yttrium, Zinc, Satinspar, Selenite, Microcline, Serpentine, Sylvite, Signalum, Lumium, PhasedIron, PhasedGold, DarkSteel, Terrasteel, TerrasteelAlloyRaw, TerrasteelAlloyStrengthened, TinAlloy, ConductiveIron, ElectricalSteel, EnergeticAlloy, VibrantAlloy, PulsatingIron, Manasteel, DarkThaumium, ElvenElementium, EnrichedCopper, DiamondCopper, Adamantium, Amordrine, Angmallen, Ardite, Aredrite, Atlarus, Blutonium, Carmot, Celenegil, Ceruclase, DarkIron, Desh, Desichalkos, Duranium, ElectrumFlux, Enderium, EnderiumBase, Eximite, FierySteel, Force, Haderoth, Hematite, Hepatizon, HSLA, Infuscolium, InfusedGold, Inolashite, Mercassium, MeteoricIron, MeteoricSteel, Naquadah, NaquadahAlloy, NaquadahEnriched, Naquadria, ObsidianFlux, Orichalcum, Osmonium, Oureclase, Phoenixite, Prometheum, RefinedGlowstone, RefinedObsidian, Sanguinite, Starconium, Tartarite, Thyrium, Tritanium, Vulcanite, Vyroxeres, Yellorium, Zectium, AluminiumBrass, Osmiridium, Sunnarium, AnnealedCopper, BatteryAlloy, Brass, Bronze, ChromiumDioxide, Cupronickel, DeepIron, Electrum, Invar, IronCompressed, Kanthal, Magnalium, Nichrome, NiobiumNitride, NiobiumTitanium, PigIron, SolderingAlloy, StainlessSteel, Steel, Ultimet, VanadiumGallium, WroughtIron, YttriumBariumCuprate, IronWood, Alumite, Manyullyn, ShadowIron, ShadowSteel, Steeleaf, SterlingSilver, RoseGold, BlackBronze, BismuthBronze, BlackSteel, RedSteel, BlueSteel, DamascusSteel, TungstenSteel, AstralSilver, Midasium, Mithril, BlueAlloy, RedAlloy, CobaltBrass, Thaumium, IronMagnetic, SteelMagnetic, NeodymiumMagnetic, Knightmetal); + + SubTag.FOOD.addTo(MeatRaw, MeatCooked, Ice, Water, Salt, Chili, Cocoa, Cheese, Coffee, Chocolate, Milk, Honey, FryingOilHot, FishOil, SeedOil, SeedOilLin, SeedOilHemp, Wheat, Sugar, FreshWater); + + Wood .add(SubTag.WOOD, SubTag.FLAMMABLE, SubTag.NO_SMELTING, SubTag.NO_SMASHING); + WoodSealed .add(SubTag.WOOD, SubTag.FLAMMABLE, SubTag.NO_SMELTING, SubTag.NO_SMASHING, SubTag.NO_WORKING); + Peanutwood .add(SubTag.WOOD, SubTag.FLAMMABLE, SubTag.NO_SMELTING, SubTag.NO_SMASHING); + LiveRoot .add(SubTag.WOOD, SubTag.FLAMMABLE, SubTag.NO_SMELTING, SubTag.NO_SMASHING, SubTag.MAGICAL, SubTag.MORTAR_GRINDABLE); + IronWood .add(SubTag.WOOD, SubTag.FLAMMABLE, SubTag.MAGICAL, SubTag.MORTAR_GRINDABLE); + Steeleaf .add(SubTag.WOOD, SubTag.FLAMMABLE, SubTag.MAGICAL, SubTag.MORTAR_GRINDABLE, SubTag.NO_SMELTING); + + MeatRaw .add(SubTag.NO_SMASHING); + MeatCooked .add(SubTag.NO_SMASHING, SubTag.NO_SMELTING); + Snow .add(SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.NO_RECYCLING); + Ice .add(SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.NO_RECYCLING); + Water .add(SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.NO_RECYCLING); + Sulfur .add(SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.FLAMMABLE); + Saltpeter .add(SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.FLAMMABLE); + Graphite .add(SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.FLAMMABLE); + + Wheat .add(SubTag.FLAMMABLE, SubTag.MORTAR_GRINDABLE); + Paper .add(SubTag.FLAMMABLE, SubTag.NO_SMELTING, SubTag.NO_SMASHING, SubTag.MORTAR_GRINDABLE, SubTag.PAPER); + Coal .add(SubTag.FLAMMABLE, SubTag.NO_SMELTING, SubTag.NO_SMASHING, SubTag.MORTAR_GRINDABLE); + Charcoal .add(SubTag.FLAMMABLE, SubTag.NO_SMELTING, SubTag.NO_SMASHING, SubTag.MORTAR_GRINDABLE); + Lignite .add(SubTag.FLAMMABLE, SubTag.NO_SMELTING, SubTag.NO_SMASHING, SubTag.MORTAR_GRINDABLE); + + Rubber .add(SubTag.FLAMMABLE, SubTag.NO_SMASHING, SubTag.BOUNCY, SubTag.STRETCHY); + Plastic .add(SubTag.FLAMMABLE, SubTag.NO_SMASHING, SubTag.BOUNCY); + + TNT .add(SubTag.FLAMMABLE, SubTag.EXPLOSIVE, SubTag.NO_SMELTING, SubTag.NO_SMASHING); + Gunpowder .add(SubTag.FLAMMABLE, SubTag.EXPLOSIVE, SubTag.NO_SMELTING, SubTag.NO_SMASHING); + Glyceryl .add(SubTag.FLAMMABLE, SubTag.EXPLOSIVE, SubTag.NO_SMELTING, SubTag.NO_SMASHING); + NitroCoalFuel .add(SubTag.FLAMMABLE, SubTag.EXPLOSIVE, SubTag.NO_SMELTING, SubTag.NO_SMASHING); + NitroFuel .add(SubTag.FLAMMABLE, SubTag.EXPLOSIVE, SubTag.NO_SMELTING, SubTag.NO_SMASHING); + NitroCarbon .add(SubTag.FLAMMABLE, SubTag.EXPLOSIVE, SubTag.NO_SMELTING, SubTag.NO_SMASHING); + + Lead .add(SubTag.MORTAR_GRINDABLE, SubTag.SOLDERING_MATERIAL, SubTag.SOLDERING_MATERIAL_BAD); + Tin .add(SubTag.MORTAR_GRINDABLE, SubTag.SOLDERING_MATERIAL); + SolderingAlloy .add(SubTag.MORTAR_GRINDABLE, SubTag.SOLDERING_MATERIAL, SubTag.SOLDERING_MATERIAL_GOOD); + + Cheese .add(SubTag.SMELTING_TO_FLUID); + Sugar .add(SubTag.SMELTING_TO_FLUID); + + Concrete .add(SubTag.STONE, SubTag.NO_SMASHING, SubTag.SMELTING_TO_FLUID); + ConstructionFoam .add(SubTag.STONE, SubTag.NO_SMASHING, SubTag.EXPLOSIVE, SubTag.NO_SMELTING); + Redstone .add(SubTag.STONE, SubTag.NO_SMASHING, SubTag.UNBURNABLE, SubTag.SMELTING_TO_FLUID, SubTag.PULVERIZING_CINNABAR); + Glowstone .add(SubTag.STONE, SubTag.NO_SMASHING, SubTag.UNBURNABLE, SubTag.SMELTING_TO_FLUID); + Nikolite .add(SubTag.STONE, SubTag.NO_SMASHING, SubTag.UNBURNABLE, SubTag.SMELTING_TO_FLUID); + Teslatite .add(SubTag.STONE, SubTag.NO_SMASHING, SubTag.UNBURNABLE, SubTag.SMELTING_TO_FLUID); + Netherrack .add(SubTag.STONE, SubTag.NO_SMASHING, SubTag.UNBURNABLE, SubTag.FLAMMABLE); + Stone .add(SubTag.STONE, SubTag.NO_SMASHING, SubTag.NO_RECYCLING); + Brick .add(SubTag.STONE, SubTag.NO_SMASHING); + NetherBrick .add(SubTag.STONE, SubTag.NO_SMASHING); + Endstone .add(SubTag.STONE, SubTag.NO_SMASHING); + Marble .add(SubTag.STONE, SubTag.NO_SMASHING); + Basalt .add(SubTag.STONE, SubTag.NO_SMASHING); + Redrock .add(SubTag.STONE, SubTag.NO_SMASHING); + Obsidian .add(SubTag.STONE, SubTag.NO_SMASHING); + Flint .add(SubTag.STONE, SubTag.NO_SMASHING, SubTag.MORTAR_GRINDABLE); + GraniteRed .add(SubTag.STONE, SubTag.NO_SMASHING); + GraniteBlack .add(SubTag.STONE, SubTag.NO_SMASHING); + Salt .add(SubTag.STONE, SubTag.NO_SMASHING); + RockSalt .add(SubTag.STONE, SubTag.NO_SMASHING); + + Sand .add(SubTag.NO_RECYCLING); + + Gold .add(SubTag.MORTAR_GRINDABLE); + Silver .add(SubTag.MORTAR_GRINDABLE); + Iron .add(SubTag.MORTAR_GRINDABLE); + IronMagnetic .add(SubTag.MORTAR_GRINDABLE); + HSLA .add(SubTag.MORTAR_GRINDABLE); + Steel .add(SubTag.MORTAR_GRINDABLE); + SteelMagnetic .add(SubTag.MORTAR_GRINDABLE); + Zinc .add(SubTag.MORTAR_GRINDABLE); + Antimony .add(SubTag.MORTAR_GRINDABLE); + Copper .add(SubTag.MORTAR_GRINDABLE); + AnnealedCopper .add(SubTag.MORTAR_GRINDABLE); + Bronze .add(SubTag.MORTAR_GRINDABLE); + Nickel .add(SubTag.MORTAR_GRINDABLE); + Invar .add(SubTag.MORTAR_GRINDABLE); + Brass .add(SubTag.MORTAR_GRINDABLE); + WroughtIron .add(SubTag.MORTAR_GRINDABLE); + Electrum .add(SubTag.MORTAR_GRINDABLE); + Clay .add(SubTag.MORTAR_GRINDABLE); + + Glass .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_RECYCLING, SubTag.SMELTING_TO_FLUID); + Diamond .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.FLAMMABLE); + Emerald .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING); + Amethyst .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING); + Tanzanite .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING); + Topaz .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING); + BlueTopaz .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING); + Amber .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING); + GreenSapphire .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING); + Sapphire .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING); + Ruby .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING); + FoolsRuby .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING); + Opal .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING); + Olivine .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING); + Jasper .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING); + GarnetRed .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING); + GarnetYellow .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING); + Mimichite .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING); + CrystalFlux .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING); + Crystal .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING); + Niter .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING); + Apatite .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.CRYSTALLISABLE); + Lapis .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.CRYSTALLISABLE); + Sodalite .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.CRYSTALLISABLE); + Lazurite .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.CRYSTALLISABLE); + Monazite .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.CRYSTALLISABLE); + Quartzite .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.CRYSTALLISABLE, SubTag.QUARTZ); + Quartz .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.CRYSTALLISABLE, SubTag.QUARTZ); + SiliconDioxide .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.CRYSTALLISABLE, SubTag.QUARTZ); + Dilithium .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.CRYSTALLISABLE, SubTag.QUARTZ); + NetherQuartz .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.CRYSTALLISABLE, SubTag.QUARTZ); + CertusQuartz .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.CRYSTALLISABLE, SubTag.QUARTZ); + Fluix .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.CRYSTALLISABLE, SubTag.QUARTZ); + ChargedCertusQuartz .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.QUARTZ); + Phosphorus .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.FLAMMABLE, SubTag.EXPLOSIVE); + Phosphate .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.FLAMMABLE, SubTag.EXPLOSIVE); + InfusedAir .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.MAGICAL, SubTag.UNBURNABLE); + InfusedFire .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.MAGICAL, SubTag.UNBURNABLE); + InfusedEarth .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.MAGICAL, SubTag.UNBURNABLE); + InfusedWater .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.MAGICAL, SubTag.UNBURNABLE); + InfusedEntropy .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.MAGICAL, SubTag.UNBURNABLE); + InfusedOrder .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.MAGICAL, SubTag.UNBURNABLE); + InfusedVis .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.MAGICAL, SubTag.UNBURNABLE); + InfusedDull .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.MAGICAL, SubTag.UNBURNABLE); + Vinteum .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.MAGICAL, SubTag.UNBURNABLE); + NetherStar .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.MAGICAL, SubTag.UNBURNABLE); + EnderPearl .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.MAGICAL, SubTag.PEARL); + EnderEye .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.MAGICAL, SubTag.PEARL); + Firestone .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.CRYSTALLISABLE, SubTag.MAGICAL, SubTag.QUARTZ, SubTag.UNBURNABLE, SubTag.BURNING); + Forcicium .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.CRYSTALLISABLE, SubTag.MAGICAL); + Forcillium .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.CRYSTALLISABLE, SubTag.MAGICAL); + Force .add(SubTag.CRYSTAL, SubTag.MAGICAL, SubTag.UNBURNABLE); + Magic .add(SubTag.CRYSTAL, SubTag.MAGICAL, SubTag.UNBURNABLE); + + Primitive .add(SubTag.NO_SMASHING, SubTag.NO_SMELTING); + Basic .add(SubTag.NO_SMASHING, SubTag.NO_SMELTING); + Good .add(SubTag.NO_SMASHING, SubTag.NO_SMELTING); + Advanced .add(SubTag.NO_SMASHING, SubTag.NO_SMELTING); + Data .add(SubTag.NO_SMASHING, SubTag.NO_SMELTING); + Elite .add(SubTag.NO_SMASHING, SubTag.NO_SMELTING); + Master .add(SubTag.NO_SMASHING, SubTag.NO_SMELTING); + Ultimate .add(SubTag.NO_SMASHING, SubTag.NO_SMELTING); + Superconductor .add(SubTag.NO_SMASHING, SubTag.NO_SMELTING); + Infinite .add(SubTag.NO_SMASHING, SubTag.NO_SMELTING); + + Blaze .add(SubTag.MAGICAL, SubTag.NO_SMELTING, SubTag.SMELTING_TO_FLUID, SubTag.MORTAR_GRINDABLE, SubTag.UNBURNABLE, SubTag.BURNING); + FierySteel .add(SubTag.MAGICAL, SubTag.UNBURNABLE, SubTag.BURNING); + ElvenElementium .add(SubTag.MAGICAL); + DarkThaumium .add(SubTag.MAGICAL); + Thaumium .add(SubTag.MAGICAL); + Enderium .add(SubTag.MAGICAL); + AstralSilver .add(SubTag.MAGICAL); + Midasium .add(SubTag.MAGICAL); + Mithril .add(SubTag.MAGICAL); + + Iron .mOreReRegistrations.add(AnyIron ); + PigIron .mOreReRegistrations.add(AnyIron ); + WroughtIron .mOreReRegistrations.add(AnyIron ); + + Copper .mOreReRegistrations.add(AnyCopper ); + AnnealedCopper .mOreReRegistrations.add(AnyCopper ); + + Bronze .mOreReRegistrations.add(AnyBronze ); + + Peanutwood .setMaceratingInto(Wood ); + WoodSealed .setMaceratingInto(Wood ); + NetherBrick .setMaceratingInto(Netherrack ); + + NeodymiumMagnetic .setSmeltingInto(Neodymium ).setMaceratingInto(Neodymium ).setArcSmeltingInto(Neodymium ); + SteelMagnetic .setSmeltingInto(Steel ).setMaceratingInto(Steel ).setArcSmeltingInto(Steel ); + Iron .setSmeltingInto(Iron ).setMaceratingInto(Iron ).setArcSmeltingInto(WroughtIron ); + AnyIron .setSmeltingInto(Iron ).setMaceratingInto(Iron ).setArcSmeltingInto(WroughtIron ); + PigIron .setSmeltingInto(Iron ).setMaceratingInto(Iron ).setArcSmeltingInto(WroughtIron ); + WroughtIron .setSmeltingInto(Iron ).setMaceratingInto(Iron ).setArcSmeltingInto(WroughtIron ); + IronMagnetic .setSmeltingInto(Iron ).setMaceratingInto(Iron ).setArcSmeltingInto(WroughtIron ); + Copper .setSmeltingInto(Copper ).setMaceratingInto(Copper ).setArcSmeltingInto(AnnealedCopper ); + AnyCopper .setSmeltingInto(Copper ).setMaceratingInto(Copper ).setArcSmeltingInto(AnnealedCopper ); + AnnealedCopper .setSmeltingInto(Copper ).setMaceratingInto(Copper ).setArcSmeltingInto(AnnealedCopper ); + Netherrack .setSmeltingInto(NetherBrick ); + MeatRaw .setSmeltingInto(MeatCooked ); + Sand .setSmeltingInto(Glass ); + Ice .setSmeltingInto(Water ); + Snow .setSmeltingInto(Water ); + + Mercury .add(SubTag.SMELTING_TO_GEM); + Cinnabar .setDirectSmelting(Mercury ).add(SubTag.INDUCTIONSMELTING_LOW_OUTPUT).add(SubTag.SMELTING_TO_GEM); + Celestine .setDirectSmelting(Strontium ).add(SubTag.INDUCTIONSMELTING_LOW_OUTPUT); + Tetrahedrite .setDirectSmelting(Copper ).add(SubTag.INDUCTIONSMELTING_LOW_OUTPUT); + Chalcopyrite .setDirectSmelting(Copper ).add(SubTag.INDUCTIONSMELTING_LOW_OUTPUT); + Malachite .setDirectSmelting(Copper ).add(SubTag.INDUCTIONSMELTING_LOW_OUTPUT); + Pentlandite .setDirectSmelting(Nickel ).add(SubTag.INDUCTIONSMELTING_LOW_OUTPUT); + Sphalerite .setDirectSmelting(Zinc ).add(SubTag.INDUCTIONSMELTING_LOW_OUTPUT); + Pyrite .setDirectSmelting(Iron ).add(SubTag.INDUCTIONSMELTING_LOW_OUTPUT); + BasalticMineralSand .setDirectSmelting(Iron ).add(SubTag.INDUCTIONSMELTING_LOW_OUTPUT); + GraniticMineralSand .setDirectSmelting(Iron ).add(SubTag.INDUCTIONSMELTING_LOW_OUTPUT); + YellowLimonite .setDirectSmelting(Iron ).add(SubTag.INDUCTIONSMELTING_LOW_OUTPUT); + BrownLimonite .setDirectSmelting(Iron ); + BandedIron .setDirectSmelting(Iron ); + Cassiterite .setDirectSmelting(Tin ); + CassiteriteSand .setDirectSmelting(Tin ); + Chromite .setDirectSmelting(Chrome ); + Garnierite .setDirectSmelting(Nickel ); + Cobaltite .setDirectSmelting(Cobalt ); + Stibnite .setDirectSmelting(Antimony ); + Cooperite .setDirectSmelting(Platinum ); + Pyrolusite .setDirectSmelting(Manganese ); + Magnesite .setDirectSmelting(Magnesium ); + Molybdenite .setDirectSmelting(Molybdenum ); + + Amber .setOreMultiplier( 2).setSmeltingMultiplier( 2); + InfusedAir .setOreMultiplier( 2).setSmeltingMultiplier( 2); + InfusedFire .setOreMultiplier( 2).setSmeltingMultiplier( 2); + InfusedEarth .setOreMultiplier( 2).setSmeltingMultiplier( 2); + InfusedWater .setOreMultiplier( 2).setSmeltingMultiplier( 2); + InfusedEntropy .setOreMultiplier( 2).setSmeltingMultiplier( 2); + InfusedOrder .setOreMultiplier( 2).setSmeltingMultiplier( 2); + InfusedVis .setOreMultiplier( 2).setSmeltingMultiplier( 2); + InfusedDull .setOreMultiplier( 2).setSmeltingMultiplier( 2); + Salt .setOreMultiplier( 2).setSmeltingMultiplier( 2); + RockSalt .setOreMultiplier( 2).setSmeltingMultiplier( 2); + Scheelite .setOreMultiplier( 2).setSmeltingMultiplier( 2); + Tungstate .setOreMultiplier( 2).setSmeltingMultiplier( 2); + Cassiterite .setOreMultiplier( 2).setSmeltingMultiplier( 2); + CassiteriteSand .setOreMultiplier( 2).setSmeltingMultiplier( 2); + NetherQuartz .setOreMultiplier( 2).setSmeltingMultiplier( 2); + CertusQuartz .setOreMultiplier( 2).setSmeltingMultiplier( 2); + ChargedCertusQuartz .setOreMultiplier( 2).setSmeltingMultiplier( 2); + Phosphorus .setOreMultiplier( 3).setSmeltingMultiplier( 3); + Saltpeter .setOreMultiplier( 4).setSmeltingMultiplier( 4); + Apatite .setOreMultiplier( 4).setSmeltingMultiplier( 4).setByProductMultiplier(2); + Nikolite .setOreMultiplier( 5).setSmeltingMultiplier( 5); + Teslatite .setOreMultiplier( 5).setSmeltingMultiplier( 5); + Redstone .setOreMultiplier( 5).setSmeltingMultiplier( 5); + Glowstone .setOreMultiplier( 5).setSmeltingMultiplier( 5); + Lapis .setOreMultiplier( 6).setSmeltingMultiplier( 6).setByProductMultiplier(4); + Sodalite .setOreMultiplier( 6).setSmeltingMultiplier( 6).setByProductMultiplier(4); + Lazurite .setOreMultiplier( 6).setSmeltingMultiplier( 6).setByProductMultiplier(4); + Monazite .setOreMultiplier( 8).setSmeltingMultiplier( 8).setByProductMultiplier(2); + + Plastic .setEnchantmentForTools(Enchantment.knockback, 1); + Rubber .setEnchantmentForTools(Enchantment.knockback, 2); + InfusedAir .setEnchantmentForTools(Enchantment.knockback, 2); + + IronWood .setEnchantmentForTools(Enchantment.fortune, 1); + Steeleaf .setEnchantmentForTools(Enchantment.fortune, 2); + Midasium .setEnchantmentForTools(Enchantment.fortune, 2); + Mithril .setEnchantmentForTools(Enchantment.fortune, 3); + Vinteum .setEnchantmentForTools(Enchantment.fortune, 1); + Thaumium .setEnchantmentForTools(Enchantment.fortune, 2); + DarkThaumium .setEnchantmentForTools(Enchantment.fortune, 3); + Magic .setEnchantmentForTools(Enchantment.fortune, 3); + InfusedWater .setEnchantmentForTools(Enchantment.fortune, 3); + + Flint .setEnchantmentForTools(Enchantment.fireAspect, 1); + DarkIron .setEnchantmentForTools(Enchantment.fireAspect, 2); + Firestone .setEnchantmentForTools(Enchantment.fireAspect, 3); + FierySteel .setEnchantmentForTools(Enchantment.fireAspect, 3); + Pyrotheum .setEnchantmentForTools(Enchantment.fireAspect, 3); + Blaze .setEnchantmentForTools(Enchantment.fireAspect, 3); + InfusedFire .setEnchantmentForTools(Enchantment.fireAspect, 3); + + Force .setEnchantmentForTools(Enchantment.silkTouch, 1); + Amber .setEnchantmentForTools(Enchantment.silkTouch, 1); + EnderPearl .setEnchantmentForTools(Enchantment.silkTouch, 1); + Enderium .setEnchantmentForTools(Enchantment.silkTouch, 1); + NetherStar .setEnchantmentForTools(Enchantment.silkTouch, 1); + InfusedOrder .setEnchantmentForTools(Enchantment.silkTouch, 1); + + BlackBronze .setEnchantmentForTools(Enchantment.smite, 2); + Gold .setEnchantmentForTools(Enchantment.smite, 3); + RoseGold .setEnchantmentForTools(Enchantment.smite, 4); + Platinum .setEnchantmentForTools(Enchantment.smite, 5); + InfusedVis .setEnchantmentForTools(Enchantment.smite, 5); + + Lead .setEnchantmentForTools(Enchantment.baneOfArthropods, 2); + Nickel .setEnchantmentForTools(Enchantment.baneOfArthropods, 2); + Invar .setEnchantmentForTools(Enchantment.baneOfArthropods, 3); + Antimony .setEnchantmentForTools(Enchantment.baneOfArthropods, 3); + BatteryAlloy .setEnchantmentForTools(Enchantment.baneOfArthropods, 4); + Bismuth .setEnchantmentForTools(Enchantment.baneOfArthropods, 4); + BismuthBronze .setEnchantmentForTools(Enchantment.baneOfArthropods, 5); + InfusedEarth .setEnchantmentForTools(Enchantment.baneOfArthropods, 5); + + Iron .setEnchantmentForTools(Enchantment.sharpness, 1); + Bronze .setEnchantmentForTools(Enchantment.sharpness, 1); + Brass .setEnchantmentForTools(Enchantment.sharpness, 2); + HSLA .setEnchantmentForTools(Enchantment.sharpness, 2); + Steel .setEnchantmentForTools(Enchantment.sharpness, 2); + WroughtIron .setEnchantmentForTools(Enchantment.sharpness, 2); + StainlessSteel .setEnchantmentForTools(Enchantment.sharpness, 3); + Knightmetal .setEnchantmentForTools(Enchantment.sharpness, 3); + ShadowIron .setEnchantmentForTools(Enchantment.sharpness, 3); + ShadowSteel .setEnchantmentForTools(Enchantment.sharpness, 4); + BlackSteel .setEnchantmentForTools(Enchantment.sharpness, 4); + RedSteel .setEnchantmentForTools(Enchantment.sharpness, 4); + BlueSteel .setEnchantmentForTools(Enchantment.sharpness, 5); + DamascusSteel .setEnchantmentForTools(Enchantment.sharpness, 5); + InfusedEntropy .setEnchantmentForTools(Enchantment.sharpness, 5); + + InfusedAir .setEnchantmentForArmors(Enchantment.respiration, 3); + + InfusedFire .setEnchantmentForArmors(Enchantment.featherFalling, 4); + + Steeleaf .setEnchantmentForArmors(Enchantment.protection, 2); + Knightmetal .setEnchantmentForArmors(Enchantment.protection, 1); + InfusedEarth .setEnchantmentForArmors(Enchantment.protection, 4); + + InfusedEntropy .setEnchantmentForArmors(Enchantment.thorns, 3); + + InfusedWater .setEnchantmentForArmors(Enchantment.aquaAffinity, 1); + IronWood .setEnchantmentForArmors(Enchantment.aquaAffinity, 1); + + InfusedOrder .setEnchantmentForArmors(Enchantment.projectileProtection, 4); + + InfusedDull .setEnchantmentForArmors(Enchantment.blastProtection, 4); + + InfusedVis .setEnchantmentForArmors(Enchantment.protection, 4); + + /* + Stone .setSpecialEffect(SpecialToolEffect.Crushing, 1); + GraniteRed .setSpecialEffect(SpecialToolEffect.Crushing, 2); + GraniteBlack .setSpecialEffect(SpecialToolEffect.Crushing, 2); + Adamantium .setSpecialEffect(SpecialToolEffect.Crushing, 3); + + DeepIron .setSpecialEffect(SpecialToolEffect.Magnetic, 1); + MeteoricIron .setSpecialEffect(SpecialToolEffect.Magnetic, 2); + MeteoricSteel .setSpecialEffect(SpecialToolEffect.Magnetic, 3); + IronMagnetic .setSpecialEffect(SpecialToolEffect.Magnetic, 1); + SteelMagnetic .setSpecialEffect(SpecialToolEffect.Magnetic, 2); + NeodymiumMagnetic .setSpecialEffect(SpecialToolEffect.Magnetic, 3); + */ + + FryingOilHot .setHeatDamage(1.0F); + Lava .setHeatDamage(3.0F); + Firestone .setHeatDamage(5.0F); + Pyrotheum .setHeatDamage(5.0F); + + Chalcopyrite .addOreByProducts(Pyrite , Cobalt , Cadmium , Gold ); + Sphalerite .addOreByProducts(GarnetYellow , Cadmium , Gallium , Zinc ); + MeteoricIron .addOreByProducts(Iron , Nickel , Iridium , Platinum ); + GlauconiteSand .addOreByProducts(Sodium , Aluminium , Iron ); + Glauconite .addOreByProducts(Sodium , Aluminium , Iron ); + Vermiculite .addOreByProducts(Iron , Aluminium , Magnesium ); + FullersEarth .addOreByProducts(Aluminium , Silicon , Magnesium ); + Bentonite .addOreByProducts(Aluminium , Calcium , Magnesium ); + Uraninite .addOreByProducts(Uranium , Thorium , Plutonium ); + Pitchblende .addOreByProducts(Thorium , Uranium , Lead ); + Galena .addOreByProducts(Sulfur , Silver , Lead ); + Lapis .addOreByProducts(Lazurite , Sodalite , Pyrite ); + Pyrite .addOreByProducts(Sulfur , Phosphorus , Iron ); + Copper .addOreByProducts(Cobalt , Gold , Nickel ); + Nickel .addOreByProducts(Cobalt , Platinum , Iron ); + GarnetRed .addOreByProducts(Spessartine , Pyrope , Almandine ); + GarnetYellow .addOreByProducts(Andradite , Grossular , Uvarovite ); + Cooperite .addOreByProducts(Palladium , Nickel , Iridium ); + Cinnabar .addOreByProducts(Redstone , Sulfur , Glowstone ); + Tantalite .addOreByProducts(Manganese , Niobium , Tantalum ); + Pollucite .addOreByProducts(Caesium , Aluminium , Rubidium ); + Chrysotile .addOreByProducts(Asbestos , Silicon , Magnesium ); + Asbestos .addOreByProducts(Asbestos , Silicon , Magnesium ); + Pentlandite .addOreByProducts(Iron , Sulfur , Cobalt ); + Uranium .addOreByProducts(Lead , Plutonium , Thorium ); + Scheelite .addOreByProducts(Manganese , Molybdenum , Calcium ); + Tungstate .addOreByProducts(Manganese , Silver , Lithium ); + Bauxite .addOreByProducts(Grossular , Titanium , Gallium ); + QuartzSand .addOreByProducts(CertusQuartz , Quartzite , Barite ); + Quartzite .addOreByProducts(CertusQuartz , Barite , ChargedCertusQuartz ); + CertusQuartz .addOreByProducts(Quartzite , ChargedCertusQuartz , Barite ); + ChargedCertusQuartz .addOreByProducts(CertusQuartz , Quartzite , Barite ); + Redstone .addOreByProducts(Cinnabar , RareEarth , Glowstone ); + Monazite .addOreByProducts(Thorium , Neodymium , RareEarth ); + Forcicium .addOreByProducts(Thorium , Neodymium , RareEarth ); + Forcillium .addOreByProducts(Thorium , Neodymium , RareEarth ); + Malachite .addOreByProducts(Copper , BrownLimonite , Calcite ); + YellowLimonite .addOreByProducts(Nickel , BrownLimonite , Cobalt ); + BrownLimonite .addOreByProducts(Malachite , YellowLimonite ); + Neodymium .addOreByProducts(Monazite , RareEarth ); + Bastnasite .addOreByProducts(Neodymium , RareEarth ); + Glowstone .addOreByProducts(Redstone , Gold ); + Zinc .addOreByProducts(Tin , Gallium ); + Tungsten .addOreByProducts(Manganese , Molybdenum ); + Diatomite .addOreByProducts(BandedIron , Sapphire ); + Iron .addOreByProducts(Nickel , Tin ); + Lepidolite .addOreByProducts(Lithium , Caesium ); + Gold .addOreByProducts(Copper , Nickel ); + Tin .addOreByProducts(Iron , Zinc ); + Antimony .addOreByProducts(Zinc , Iron ); + Silver .addOreByProducts(Lead , Sulfur ); + Lead .addOreByProducts(Silver , Sulfur ); + Thorium .addOreByProducts(Uranium , Lead ); + Plutonium .addOreByProducts(Uranium , Lead ); + Electrum .addOreByProducts(Gold , Silver ); + Bronze .addOreByProducts(Copper , Tin ); + Brass .addOreByProducts(Copper , Zinc ); + Coal .addOreByProducts(Lignite , Thorium ); + Ilmenite .addOreByProducts(Iron , Titanium ); + Manganese .addOreByProducts(Chrome , Iron ); + Sapphire .addOreByProducts(Aluminium , GreenSapphire ); + GreenSapphire .addOreByProducts(Aluminium , Sapphire ); + Platinum .addOreByProducts(Nickel , Iridium ); + Emerald .addOreByProducts(Beryllium , Aluminium ); + Olivine .addOreByProducts(Pyrope , Magnesium ); + Chrome .addOreByProducts(Iron , Magnesium ); + Chromite .addOreByProducts(Iron , Magnesium ); + Tetrahedrite .addOreByProducts(Antimony , Zinc ); + GarnetSand .addOreByProducts(GarnetRed , GarnetYellow ); + Magnetite .addOreByProducts(Iron , Gold ); + GraniticMineralSand .addOreByProducts(GraniteBlack , Magnetite ); + BasalticMineralSand .addOreByProducts(Basalt , Magnetite ); + Basalt .addOreByProducts(Olivine , DarkAsh ); + Celestine .addOreByProducts(Strontium , Sulfur ); + VanadiumMagnetite .addOreByProducts(Magnetite , Vanadium ); + Lazurite .addOreByProducts(Sodalite , Lapis ); + Sodalite .addOreByProducts(Lazurite , Lapis ); + Spodumene .addOreByProducts(Aluminium , Lithium ); + Ruby .addOreByProducts(Chrome , GarnetRed ); + Phosphorus .addOreByProducts(Apatite , Phosphate ); + Iridium .addOreByProducts(Platinum , Osmium ); + Pyrope .addOreByProducts(GarnetRed , Magnesium ); + Almandine .addOreByProducts(GarnetRed , Aluminium ); + Spessartine .addOreByProducts(GarnetRed , Manganese ); + Andradite .addOreByProducts(GarnetYellow , Iron ); + Grossular .addOreByProducts(GarnetYellow , Calcium ); + Uvarovite .addOreByProducts(GarnetYellow , Chrome ); + Calcite .addOreByProducts(Andradite , Malachite ); + NaquadahEnriched .addOreByProducts(Naquadah , Naquadria ); + Naquadah .addOreByProducts(NaquadahEnriched ); + Pyrolusite .addOreByProducts(Manganese ); + Molybdenite .addOreByProducts(Molybdenum ); + Stibnite .addOreByProducts(Antimony ); + Garnierite .addOreByProducts(Nickel ); + Lignite .addOreByProducts(Coal ); + Diamond .addOreByProducts(Graphite ); + Beryllium .addOreByProducts(Emerald ); + Apatite .addOreByProducts(Phosphorus ); + Nikolite .addOreByProducts(Diamond ); + Teslatite .addOreByProducts(Diamond ); + Magnesite .addOreByProducts(Magnesium ); + NetherQuartz .addOreByProducts(Netherrack ); + PigIron .addOreByProducts(Iron ); + DeepIron .addOreByProducts(Iron ); + ShadowIron .addOreByProducts(Iron ); + DarkIron .addOreByProducts(Iron ); + MeteoricIron .addOreByProducts(Iron ); + Steel .addOreByProducts(Iron ); + HSLA .addOreByProducts(Iron ); + Mithril .addOreByProducts(Platinum ); + Midasium .addOreByProducts(Gold ); + AstralSilver .addOreByProducts(Silver ); + Graphite .addOreByProducts(Carbon ); + Netherrack .addOreByProducts(Sulfur ); + Flint .addOreByProducts(Obsidian ); + Cobaltite .addOreByProducts(Cobalt ); + Cobalt .addOreByProducts(Cobaltite ); + Sulfur .addOreByProducts(Sulfur ); + Saltpeter .addOreByProducts(Saltpeter ); + Endstone .addOreByProducts(Helium_3 ); + Osmium .addOreByProducts(Iridium ); + Magnesium .addOreByProducts(Olivine ); + Aluminium .addOreByProducts(Bauxite ); + Titanium .addOreByProducts(Almandine ); + Obsidian .addOreByProducts(Olivine ); + Ash .addOreByProducts(Carbon ); + DarkAsh .addOreByProducts(Carbon ); + Redrock .addOreByProducts(Clay ); + Marble .addOreByProducts(Calcite ); + Clay .addOreByProducts(Clay ); + Cassiterite .addOreByProducts(Tin ); + CassiteriteSand .addOreByProducts(Tin ); + GraniteBlack .addOreByProducts(Biotite ); + GraniteRed .addOreByProducts(PotassiumFeldspar ); + Phosphate .addOreByProducts(Phosphor ); + Phosphor .addOreByProducts(Phosphate ); + Jade .addOreByProducts(Jade ); + Tanzanite .addOreByProducts(Opal ); + Opal .addOreByProducts(Tanzanite ); + Amethyst .addOreByProducts(Amethyst ); + Jasper .addOreByProducts(FoolsRuby ); + FoolsRuby .addOreByProducts(Jasper ); + Amber .addOreByProducts(Amber ); + Topaz .addOreByProducts(BlueTopaz ); + BlueTopaz .addOreByProducts(Topaz ); + Niter .addOreByProducts(Saltpeter ); + Vinteum .addOreByProducts(Vinteum ); + Force .addOreByProducts(Force ); + Dilithium .addOreByProducts(Dilithium ); + Neutronium .addOreByProducts(Neutronium ); + Lithium .addOreByProducts(Lithium ); + Silicon .addOreByProducts(SiliconDioxide ); + Salt .addOreByProducts(RockSalt ); + RockSalt .addOreByProducts(Salt ); + + Glue.mChemicalFormula = "No Horses were harmed for the Production"; + UUAmplifier.mChemicalFormula = "Accelerates the Mass Fabricator"; + LiveRoot.mChemicalFormula = ""; + WoodSealed.mChemicalFormula = ""; + Wood.mChemicalFormula = ""; + FoolsRuby.mChemicalFormula = Ruby.mChemicalFormula; + + // Naquadah is green when molten, so this reflects the Color change approciately + Naquadah.mMoltenRGBa[0] = 0; + Naquadah.mMoltenRGBa[1] = 255; + Naquadah.mMoltenRGBa[2] = 0; + Naquadah.mMoltenRGBa[3] = 0; + NaquadahEnriched.mMoltenRGBa[0] = 64; + NaquadahEnriched.mMoltenRGBa[1] = 255; + NaquadahEnriched.mMoltenRGBa[2] = 64; + NaquadahEnriched.mMoltenRGBa[3] = 0; + Naquadria.mMoltenRGBa[0] = 128; + Naquadria.mMoltenRGBa[1] = 255; + Naquadria.mMoltenRGBa[2] = 128; + Naquadria.mMoltenRGBa[3] = 0; + + NaquadahEnriched.mChemicalFormula = "Nq+"; + Naquadah.mChemicalFormula = "Nq"; + Naquadria.mChemicalFormula = "NqX"; + } + + public static Materials get(String aMaterialName) { + Object tObject = GT_Utility.getFieldContent(Materials.class, aMaterialName, F, F); + if (tObject != null && tObject instanceof Materials) return (Materials)tObject; + return _NULL; + } + + public static Materials getRealMaterial(String aMaterialName) { + return get(aMaterialName).mMaterialInto; + } + + /** + * Called in preInit with the Config to set Values. + * @param aConfiguration + */ + public static void init(GT_Config aConfiguration) { + for (Materials tMaterial : VALUES) { + String tString = tMaterial.toString().toLowerCase(); + tMaterial.mHeatDamage = (float)aConfiguration.get(ConfigCategories.Materials.heatdamage, tString, tMaterial.mHeatDamage); + if (tMaterial.mBlastFurnaceRequired) tMaterial.mBlastFurnaceRequired = aConfiguration.get(ConfigCategories.Materials.blastfurnacerequirements, tString, T); + if (tMaterial.mBlastFurnaceRequired && aConfiguration.get(ConfigCategories.Materials.blastinductionsmelter, tString, tMaterial.mBlastFurnaceTemp < 1500)) GT_ModHandler.ThermalExpansion.addSmelterBlastOre(tMaterial); + tMaterial.mHandleMaterial = (tMaterial==Desh?tMaterial.mHandleMaterial:tMaterial==Diamond||tMaterial==Thaumium?Wood:tMaterial.contains(SubTag.BURNING)?Blaze:tMaterial.contains(SubTag.MAGICAL)&&tMaterial.contains(SubTag.CRYSTAL)&&Loader.isModLoaded(MOD_ID_TC)?Thaumium:tMaterial.getMass()>Element.Tc.getMass()*2?TungstenSteel:tMaterial.getMass()>Element.Tc.getMass()?Steel:Wood); + } + } + + public boolean isRadioactive() { + if (mElement != null) return mElement.mHalfLifeSeconds >= 0; + for (MaterialStack tMaterial : mMaterialList) if (tMaterial.mMaterial.isRadioactive()) return T; + return F; + } + + public long getProtons() { + if (mElement != null) return mElement.getProtons(); + if (mMaterialList.size() <= 0) return Element.Tc.getProtons(); + long rAmount = 0, tAmount = 0; + for (MaterialStack tMaterial : mMaterialList) { + tAmount += tMaterial.mAmount; + rAmount += tMaterial.mAmount * tMaterial.mMaterial.getProtons(); + } + return (getDensity() * rAmount) / (tAmount * M); + } + + public long getNeutrons() { + if (mElement != null) return mElement.getNeutrons(); + if (mMaterialList.size() <= 0) return Element.Tc.getNeutrons(); + long rAmount = 0, tAmount = 0; + for (MaterialStack tMaterial : mMaterialList) { + tAmount += tMaterial.mAmount; + rAmount += tMaterial.mAmount * tMaterial.mMaterial.getNeutrons(); + } + return (getDensity() * rAmount) / (tAmount * M); + } + + public long getMass() { + if (mElement != null) return mElement.getMass(); + if (mMaterialList.size() <= 0) return Element.Tc.getMass(); + long rAmount = 0, tAmount = 0; + for (MaterialStack tMaterial : mMaterialList) { + tAmount += tMaterial.mAmount; + rAmount += tMaterial.mAmount * tMaterial.mMaterial.getMass(); + } + return (getDensity() * rAmount) / (tAmount * M); + } + + public long getDensity() { + return mDensity; + } + + public String getToolTip() { + return getToolTip(1, F); + } + + public String getToolTip(boolean aShowQuestionMarks) { + return getToolTip(1, aShowQuestionMarks); + } + + public String getToolTip(long aMultiplier) { + return getToolTip(aMultiplier, F); + } + + public String getToolTip(long aMultiplier, boolean aShowQuestionMarks) { + if (!aShowQuestionMarks && mChemicalFormula.equals("?")) return ""; + if (aMultiplier >= M * 2 && !mMaterialList.isEmpty()) { + return ((mElement != null || (mMaterialList.size() < 2 && mMaterialList.get(0).mAmount == 1))?mChemicalFormula:"(" + mChemicalFormula + ")") + aMultiplier; + } + return mChemicalFormula; + } + + private final ArrayList mMaterialItems = new ArrayList(); + + /** + * Adds an ItemStack to this Material. + */ + public Materials add(ItemStack aStack) { + if (aStack != null && !contains(aStack)) mMaterialItems.add(aStack); + return this; + } + + /** + * This is used to determine if any of the ItemStacks belongs to this Material. + */ + public boolean contains(ItemStack... aStacks) { + if (aStacks == null || aStacks.length <= 0) return F; + for (ItemStack tStack : mMaterialItems) for (ItemStack aStack : aStacks) if (GT_Utility.areStacksEqual(aStack, tStack, !tStack.hasTagCompound())) return T; + return F; + } + + /** + * This is used to determine if an ItemStack belongs to this Material. + */ + public boolean remove(ItemStack aStack) { + if (aStack == null) return F; + boolean temp = F; + for (int i = 0; i < mMaterialItems.size(); i++) if (GT_Utility.areStacksEqual(aStack, mMaterialItems.get(i))) { + mMaterialItems.remove(i--); + temp = T; + } + return temp; + } + + private final Collection mSubTags = new HashSet(); + + /** + * Adds a SubTag to this Material + */ + @Override + public ISubTagContainer add(SubTag... aTags) { + if (aTags != null) for (SubTag aTag : aTags) if (aTag != null && !contains(aTag)) { + aTag.addContainerToList(this); + mSubTags.add(aTag); + } + return this; + } + + /** + * If this Material has this exact SubTag + */ + @Override + public boolean contains(SubTag aTag) { + return mSubTags.contains(aTag); + } + + /** + * Removes a SubTag from this Material + */ + @Override + public boolean remove(SubTag aTag) { + return mSubTags.remove(aTag); + } + + /** + * Sets the Heat Damage for this Material (negative = frost) + */ + public Materials setHeatDamage(float aHeatDamage) { + mHeatDamage = aHeatDamage; + return this; + } + + /** + * Adds a Material to the List of Byproducts when grinding this Ore. + * Is used for more precise Ore grinding, so that it is possible to choose between certain kinds of Materials. + */ + public Materials addOreByProduct(Materials aMaterial) { + if (!mOreByProducts.contains(aMaterial.mMaterialInto)) mOreByProducts.add(aMaterial.mMaterialInto); + return this; + } + + /** + * Adds multiple Materials to the List of Byproducts when grinding this Ore. + * Is used for more precise Ore grinding, so that it is possible to choose between certain kinds of Materials. + */ + public Materials addOreByProducts(Materials... aMaterials) { + for (Materials tMaterial : aMaterials) if (tMaterial != null) addOreByProduct(tMaterial); + return this; + } + + /** + * If this Ore gives multiple drops of its Main Material. + * Lapis Ore for example gives about 6 drops. + */ + public Materials setOreMultiplier(int aOreMultiplier) { + if (aOreMultiplier > 0) mOreMultiplier = aOreMultiplier; + return this; + } + + /** + * If this Ore gives multiple drops of its Byproduct Material. + */ + public Materials setByProductMultiplier(int aByProductMultiplier) { + if (aByProductMultiplier > 0) mByProductMultiplier = aByProductMultiplier; + return this; + } + + /** + * If this Ore gives multiple drops of its Main Material. + * Lapis Ore for example gives about 6 drops. + */ + public Materials setSmeltingMultiplier(int aSmeltingMultiplier) { + if (aSmeltingMultiplier > 0) mSmeltingMultiplier = aSmeltingMultiplier; + return this; + } + + /** + * This Ore should be smolten directly into an Ingot of this Material instead of an Ingot of itself. + */ + public Materials setDirectSmelting(Materials aMaterial) { + if (aMaterial != null) mDirectSmelting = aMaterial.mMaterialInto.mDirectSmelting; + return this; + } + + /** + * This Material should be the Main Material this Ore gets ground into. + * Example, Chromite giving Chrome or Tungstate giving Tungsten. + */ + public Materials setOreReplacement(Materials aMaterial) { + if (aMaterial != null) mOreReplacement = aMaterial.mMaterialInto.mOreReplacement; + return this; + } + + /** + * This Material smelts always into an instance of aMaterial. Used for Magnets. + */ + public Materials setSmeltingInto(Materials aMaterial) { + if (aMaterial != null) mSmeltInto = aMaterial.mMaterialInto.mSmeltInto; + return this; + } + + /** + * This Material arc smelts always into an instance of aMaterial. Used for Wrought Iron. + */ + public Materials setArcSmeltingInto(Materials aMaterial) { + if (aMaterial != null) mArcSmeltInto = aMaterial.mMaterialInto.mArcSmeltInto; + return this; + } + + /** + * This Material macerates always into an instance of aMaterial. + */ + public Materials setMaceratingInto(Materials aMaterial) { + if (aMaterial != null) mMacerateInto = aMaterial.mMaterialInto.mMacerateInto; + return this; + } + + public Materials setEnchantmentForTools(Enchantment aEnchantment, int aEnchantmentLevel) { + mEnchantmentTools = aEnchantment; + mEnchantmentToolsLevel = (byte)aEnchantmentLevel; + return this; + } + + public Materials setEnchantmentForArmors(Enchantment aEnchantment, int aEnchantmentLevel) { + mEnchantmentArmors = aEnchantment; + mEnchantmentArmorsLevel = (byte)aEnchantmentLevel; + return this; + } + + /** + * This Array can be changed dynamically by a Tick Handler in order to get a glowing Effect on all GT Meta Items out of this Material. + */ + public final short[] mRGBa = new short[] {255, 255, 255, 0}, mMoltenRGBa = new short[] {255, 255, 255, 0}; + + public Enchantment mEnchantmentTools = null, mEnchantmentArmors = null; + public byte mEnchantmentToolsLevel = 0, mEnchantmentArmorsLevel = 0; + public final TextureSet mIconSet; + public boolean mBlastFurnaceRequired = F; + public float mToolSpeed = 1.0F, mHeatDamage = 0.0F; + public String mChemicalFormula = "?", mDefaultLocalName = "null"; + public Dyes mColor = Dyes._NULL; + public short mMeltingPoint = 0, mBlastFurnaceTemp = 0; + public int mTypes = 0, mDurability = 16, mFuelPower = 0, mFuelType = 0, mExtraData = 0, mOreValue = 0, mOreMultiplier = 1, mByProductMultiplier = 1, mSmeltingMultiplier = 1; + public long mDensity = M; + public Element mElement = null; + public Materials mDirectSmelting = this, mOreReplacement = this, mMacerateInto = this, mSmeltInto = this, mArcSmeltInto = this, mHandleMaterial = this; + public byte mToolQuality = 0; + public final int mMetaItemSubID; + public final boolean mUnificatable; + public final Materials mMaterialInto; + public final List mMaterialList = new ArrayList(); + public final List mOreByProducts = new ArrayList(), mOreReRegistrations = new ArrayList(); + public final List mAspects = new ArrayList(); + public Fluid mSolid = null, mFluid = null, mGas = null, mPlasma = null; + /** This Fluid is used as standard Unit for Molten Materials. 1296 is a Molten Block, what means 144 is one Material Unit worth */ + public Fluid mStandardMoltenFluid = null; + + public FluidStack getSolid(long aAmount) { + if (mSolid == null) return null; + return new GT_FluidStack(mSolid, (int)aAmount); + } + + public FluidStack getFluid(long aAmount) { + if (mFluid == null) return null; + return new GT_FluidStack(mFluid, (int)aAmount); + } + + public FluidStack getGas(long aAmount) { + if (mGas == null) return null; + return new GT_FluidStack(mGas, (int)aAmount); + } + + public FluidStack getPlasma(long aAmount) { + if (mPlasma == null) return null; + return new GT_FluidStack(mPlasma, (int)aAmount); + } + + public FluidStack getMolten(long aAmount) { + if (mStandardMoltenFluid == null) return null; + return new GT_FluidStack(mStandardMoltenFluid, (int)aAmount); + } + + private Materials(int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aToolDurability, int aToolQuality, boolean aUnificatable) { + mUnificatable = aUnificatable; + mMaterialInto = this; + mMetaItemSubID = aMetaItemSubID; + mToolQuality = (byte)aToolQuality; + mDurability = aToolDurability; + mToolSpeed = aToolSpeed; + mIconSet = aIconSet; + if (aMetaItemSubID >= 0) { + if (GregTech_API.sGeneratedMaterials[aMetaItemSubID] == null) { + GregTech_API.sGeneratedMaterials[aMetaItemSubID] = this; + } else { + throw new IllegalArgumentException("The Index " + aMetaItemSubID + " is already used!"); + } + } + } + + private Materials(Materials aMaterialInto, boolean aReRegisterIntoThis) { + mUnificatable = F; + mDefaultLocalName = aMaterialInto.mDefaultLocalName; + mMaterialInto = aMaterialInto.mMaterialInto; + if (aReRegisterIntoThis) mMaterialInto.mOreReRegistrations.add(this); + mChemicalFormula = aMaterialInto.mChemicalFormula; + mMetaItemSubID = -1; + mIconSet = TextureSet.SET_NONE; + } + + /** + * @param aMetaItemSubID the Sub-ID used in my own MetaItems. Range 0-1000. -1 for no Material + * @param aTypes which kind of Items should be generated. Bitmask as follows: + * 1 = Dusts of all kinds. + * 2 = Dusts, Ingots, Plates, Rods/Sticks, Machine Components and other Metal specific things. + * 4 = Dusts, Gems, Plates, Lenses (if transparent). + * 8 = Dusts, Impure Dusts, crushed Ores, purified Ores, centrifuged Ores etc. + * 16 = Cells + * 32 = Plasma Cells + * 64 = Tool Heads + * 128 = Gears + * @param aR, aG, aB Color of the Material 0-255 each. + * @param aA transparency of the Material Texture. 0 = fully visible, 255 = Invisible. + * @param aLocalName The Name used as Default for localization. + * @param aFuelType Type of Generator to get Energy from this Material. + * @param aFuelPower EU generated. Will be multiplied by 1000, also additionally multiplied by 2 for Gems. + * @param aAmplificationValue Amount of UUM amplifier gotten from this. + * @param aUUMEnergy Amount of EU needed to shape the UUM into this Material. + * @param aMeltingPoint Used to determine the smelting Costs in Furnii. + * @param aBlastFurnaceTemp Used to determine the needed Heat capactiy Costs in Blast Furnii. + * @param aBlastFurnaceRequired If this requires a Blast Furnace. + * @param aColor Vanilla MC Wool Color which comes the closest to this. + */ + private Materials(int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aToolDurability, int aToolQuality, int aTypes, int aR, int aG, int aB, int aA, String aLocalName, int aFuelType, int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, boolean aTransparent, int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor) { + this(aMetaItemSubID, aIconSet, aToolSpeed, aToolDurability, aToolQuality, T); + mDefaultLocalName = aLocalName; + mMeltingPoint = (short)aMeltingPoint; + mBlastFurnaceTemp = (short)aBlastFurnaceTemp; + mBlastFurnaceRequired = aBlastFurnaceRequired; + if (aTransparent) add(SubTag.TRANSPARENT); + mFuelPower = aFuelPower; + mFuelType = aFuelType; + mOreValue = aOreValue; + mDensity = (M * aDensityMultiplier) / aDensityDivider; + mColor = aColor==null?Dyes._NULL:aColor; + if (mColor != null) add(SubTag.HAS_COLOR); + mRGBa[0] = mMoltenRGBa[0] = (short)aR; + mRGBa[1] = mMoltenRGBa[1] = (short)aG; + mRGBa[2] = mMoltenRGBa[2] = (short)aB; + mRGBa[3] = mMoltenRGBa[3] = (short)aA; + mTypes = aTypes; + if ((mTypes & 2) != 0) add(SubTag.SMELTING_TO_FLUID); + } + + private Materials(int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aToolDurability, int aToolQuality, int aTypes, int aR, int aG, int aB, int aA, String aLocalName, int aFuelType, int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, boolean aTransparent, int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor, List aAspects) { + this(aMetaItemSubID, aIconSet, aToolSpeed, aToolDurability, aToolQuality, aTypes, aR, aG, aB, aA, aLocalName, aFuelType, aFuelPower, aMeltingPoint, aBlastFurnaceTemp, aBlastFurnaceRequired, aTransparent, aOreValue, aDensityMultiplier, aDensityDivider, aColor); + mAspects.addAll(aAspects); + } + + /** + * @param aElement The Element Enum represented by this Material + */ + private Materials(int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aToolDurability, int aToolQuality, int aTypes, int aR, int aG, int aB, int aA, String aLocalName, int aFuelType, int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, boolean aTransparent, int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor, Element aElement, List aAspects) { + this(aMetaItemSubID, aIconSet, aToolSpeed, aToolDurability, aToolQuality, aTypes, aR, aG, aB, aA, aLocalName, aFuelType, aFuelPower, aMeltingPoint, aBlastFurnaceTemp, aBlastFurnaceRequired, aTransparent, aOreValue, aDensityMultiplier, aDensityDivider, aColor); + mElement = aElement; + mElement.mLinkedMaterials.add(this); + if (aElement == Element._NULL) { + mChemicalFormula = "Empty"; + } else { + mChemicalFormula = aElement.toString(); + mChemicalFormula = mChemicalFormula.replaceAll("_", "-"); + } + mAspects.addAll(aAspects); + } + + private Materials(int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aToolDurability, int aToolQuality, int aTypes, int aR, int aG, int aB, int aA, String aLocalName, int aFuelType, int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, boolean aTransparent, int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor, int aExtraData, List aMaterialList) { + this(aMetaItemSubID, aIconSet, aToolSpeed, aToolDurability, aToolQuality, aTypes, aR, aG, aB, aA, aLocalName, aFuelType, aFuelPower, aMeltingPoint, aBlastFurnaceTemp, aBlastFurnaceRequired, aTransparent, aOreValue, aDensityMultiplier, aDensityDivider, aColor, aExtraData, aMaterialList, null); + } + + private Materials(int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aToolDurability, int aToolQuality, int aTypes, int aR, int aG, int aB, int aA, String aLocalName, int aFuelType, int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, boolean aTransparent, int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor, int aExtraData, List aMaterialList, List aAspects) { + this(aMetaItemSubID, aIconSet, aToolSpeed, aToolDurability, aToolQuality, aTypes, aR, aG, aB, aA, aLocalName, aFuelType, aFuelPower, aMeltingPoint, aBlastFurnaceTemp, aBlastFurnaceRequired, aTransparent, aOreValue, aDensityMultiplier, aDensityDivider, aColor); + mExtraData = aExtraData; + mMaterialList.addAll(aMaterialList); + mChemicalFormula = ""; + for (MaterialStack tMaterial : mMaterialList) mChemicalFormula += tMaterial.toString(); + mChemicalFormula = mChemicalFormula.replaceAll("_", "-"); + + int tAmountOfComponents = 0, tMeltingPoint = 0; + for (MaterialStack tMaterial : mMaterialList) { + tAmountOfComponents += tMaterial.mAmount; + if (tMaterial.mMaterial.mMeltingPoint > 0) tMeltingPoint += tMaterial.mMaterial.mMeltingPoint * tMaterial.mAmount; + if (aAspects == null) for (TC_AspectStack tAspect : tMaterial.mMaterial.mAspects) tAspect.addToAspectList(mAspects); + } + + if (mMeltingPoint < 0) mMeltingPoint = (short)(tMeltingPoint / tAmountOfComponents); + + tAmountOfComponents *= aDensityMultiplier; + tAmountOfComponents /= aDensityDivider; + if (aAspects == null) for (TC_AspectStack tAspect : mAspects) tAspect.mAmount = Math.max(1, tAspect.mAmount / Math.max(1, tAmountOfComponents)); else mAspects.addAll(aAspects); + } + + public static volatile int VERSION = 508; + + @Override + public short[] getRGBA() { + return mRGBa; + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/enums/OreDictNames.java b/src/main/java/gregtech/api/enums/OreDictNames.java new file mode 100644 index 0000000..4ba2b7b --- /dev/null +++ b/src/main/java/gregtech/api/enums/OreDictNames.java @@ -0,0 +1,78 @@ +package gregtech.api.enums; + + +public enum OreDictNames { + craftingAnvil, + craftingBook, + craftingCentrifuge, + craftingChest, + craftingCompressor, + craftingConveyor, + craftingDiamondBlade, + craftingDrain, + craftingDuctTape, + craftingElectricFurnace, + craftingElectromagnet, + enderChest, // Vanilla OreDict Name + craftingEnergyCellUpgrade, + craftingEnergyMeter, + craftingExtractor, + craftingFeather, + craftingFurnace, + craftingFilter, + craftingGenerator, + craftingGeothermalGenerator, + craftingGrinder, + craftingInductionFurnace, + craftingIndustrialDiamond, + craftingIronFurnace, + craftingLensBlack, + craftingLensBlue, + craftingLensBrown, + craftingLensCyan, + craftingLensGray, + craftingLensGreen, + craftingLensLightBlue, + craftingLensLightGray, + craftingLensLime, + craftingLensMagenta, + craftingLensOrange, + craftingLensPink, + craftingLensPurple, + craftingLensRed, + craftingLensWhite, + craftingLensYellow, + craftingMacerator, + craftingMetalformer, + craftingPiston, + craftingPump, + craftingQuantumChestUpgrade, + craftingQuartz, + craftingRawMachineTier00, + craftingRawMachineTier01, + craftingRawMachineTier02, + craftingRawMachineTier03, + craftingRawMachineTier04, + craftingRecycler, + craftingRedstoneReceiver, + craftingRedstoneTorch, + craftingRedstoneTranceiver, + craftingRedstoneTransmitter, + craftingSafe, + craftingSteamTank, + craftingSteamUpgrade, + craftingSuperconductor, + craftingTank, + craftingTeleporter, + craftingThermalCentrifuge, + craftingTurbineBladeBronze, + craftingTurbineBladeCarbon, + craftingTurbineBladeMagnalium, + craftingTurbineBladeSteel, + craftingTurbineBladeTungstenSteel, + craftingWireCopper, + craftingWireGold, + craftingWireIron, + craftingWireTin, + craftingWorkBench, +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/enums/OrePrefixes.java b/src/main/java/gregtech/api/enums/OrePrefixes.java new file mode 100644 index 0000000..9609559 --- /dev/null +++ b/src/main/java/gregtech/api/enums/OrePrefixes.java @@ -0,0 +1,801 @@ +package gregtech.api.enums; + +import static gregtech.api.enums.GT_Values.B; +import static gregtech.api.enums.GT_Values.D2; +import static gregtech.api.enums.GT_Values.F; +import static gregtech.api.enums.GT_Values.M; +import static gregtech.api.enums.GT_Values.T; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; + +import gregtech.api.enums.TC_Aspects.TC_AspectStack; +import gregtech.api.interfaces.ICondition; +import gregtech.api.interfaces.IOreRecipeRegistrator; +import gregtech.api.interfaces.ISubTagContainer; +import gregtech.api.objects.ItemData; +import gregtech.api.objects.MaterialStack; +import gregtech.api.util.GT_Log; +import gregtech.api.util.GT_Utility; +import net.minecraft.item.ItemStack; + +public enum OrePrefixes { + @Deprecated pulp ("Pulps" , "" , "" ,F,F,F,F,F,F,F,F,F,F, B[0]|B[1]|B[2]|B[3] , -1, 64, -1), + @Deprecated leaves ("Leaves" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + @Deprecated sapling ("Saplings" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + @Deprecated itemDust ("Dusts" , "" , "" ,F,F,F,F,F,F,F,F,F,F, B[0]|B[1]|B[2]|B[3] , -1, 64, -1), + oreBlackgranite ("Black Granite Ores" , "Granite " , " Ore" ,T,T,F,F,F,T,F,F,F,T, B[3] , -1, 64, -1), // In case of an End-Ores Mod. Ore -> Material is a Oneway Operation! + oreRedgranite ("Red Granite Ores" , "Granite " , " Ore" ,T,T,F,F,F,T,F,F,F,T, B[3] , -1, 64, -1), // In case of an End-Ores Mod. Ore -> Material is a Oneway Operation! + oreNetherrack ("Netherrack Ores" , "Nether " , " Ore" ,T,T,F,F,F,T,F,F,F,T, B[3] , -1, 64, -1), // Prefix of the Nether-Ores Mod. Causes Ores to double. Ore -> Material is a Oneway Operation! + oreNether ("Nether Ores" , "Nether " , " Ore" ,T,T,F,F,F,T,F,F,F,T, B[3] , -1, 64, -1), // Prefix of the Nether-Ores Mod. Causes Ores to double. Ore -> Material is a Oneway Operation! + @Deprecated denseore ("Dense Ores" , "" , "" ,F,F,F,F,F,T,F,F,F,T, B[3] , -1, 64, -1), + oreDense ("Dense Ores" , "Dense " , " Ore" ,T,T,F,F,F,T,F,F,F,T, B[3] , -1, 64, -1), // Prefix of the Dense-Ores Mod. Causes Ores to double. Ore -> Material is a Oneway Operation! + oreRich ("Rich Ores" , "Rich " , " Ore" ,T,T,F,F,F,T,F,F,F,T, B[3] , -1, 64, -1), // Prefix of TFC + oreNormal ("Normal Ores" , "Normal " , " Ore" ,T,T,F,F,F,T,F,F,F,T, B[3] , -1, 64, -1), // Prefix of TFC + oreSmall ("Small Ores" , "Small " , " Ore" ,T,T,F,F,F,T,F,F,F,T, B[3] , -1, 64, 67), // Prefix of Railcraft. + orePoor ("Poor Ores" , "Poor " , " Ore" ,T,T,F,F,F,T,F,F,F,T, B[3] , -1, 64, -1), // Prefix of Railcraft. + oreEndstone ("Endstone Ores" , "End " , " Ore" ,T,T,F,F,F,T,F,F,F,T, B[3] , -1, 64, -1), // In case of an End-Ores Mod. Ore -> Material is a Oneway Operation! + oreEnd ("End Ores" , "End " , " Ore" ,T,T,F,F,F,T,F,F,F,T, B[3] , -1, 64, -1), // In case of an End-Ores Mod. Ore -> Material is a Oneway Operation! + @Deprecated oreGem ("Ores" , "" , "" ,F,F,F,F,F,T,F,F,F,T, B[3] , -1, 64, -1), + ore ("Ores" , "" , " Ore" ,T,T,F,F,F,T,F,F,F,T, B[3] , -1, 64, 68), // Regular Ore Prefix. Ore -> Material is a Oneway Operation! Introduced by Eloraam + crushedCentrifuged ("Centrifuged Ores" , "Centrifuged " , " Ore" ,T,T,F,F,F,F,F,T,F,T, B[3] , -1, 64, 7), + crushedPurified ("Purified Ores" , "Purified " , " Ore" ,T,T,F,F,F,F,F,T,F,T, B[3] , -1, 64, 6), + crushed ("Crushed Ores" , "Crushed " , " Ore" ,T,T,F,F,F,F,F,T,F,T, B[3] , -1, 64, 5), + shard ("Crystallised Shards" , "" , "" ,T,T,F,F,F,F,F,F,F,T, B[3] , -1, 64, -1), // Introduced by Mekanism + clump ("Clumps" , "" , "" ,T,T,F,F,F,F,F,F,F,T, B[3] , -1, 64, -1), + reduced ("Reduced Gravels" , "" , "" ,T,T,F,F,F,F,F,F,F,T, B[3] , -1, 64, -1), + crystalline ("Crystallised Metals" , "" , "" ,T,T,F,F,F,F,F,F,F,T, B[3] , -1, 64, -1), + cleanGravel ("Clean Gravels" , "" , "" ,T,T,F,F,F,F,F,F,F,T, B[3] , -1, 64, -1), + dirtyGravel ("Dirty Gravels" , "" , "" ,T,T,F,F,F,F,F,F,F,T, B[3] , -1, 64, -1), + ingotQuintuple ("5x Ingots" , "Quintuple " , " Ingot" ,T,T,F,F,F,F,T,T,F,F, B[1] , M * 5 , 12, 16), // A quintuple Ingot. + ingotQuadruple ("4x Ingots" , "Quadruple " , " Ingot" ,T,T,F,F,F,F,T,T,F,F, B[1] , M * 4 , 16, 15), // A quadruple Ingot. + @Deprecated ingotQuad ("4x Ingots" , "Quadruple " , " Ingot" ,F,F,F,F,F,F,F,F,F,F, B[1] , -1, 16, 15), + ingotTriple ("3x Ingots" , "Triple " , " Ingot" ,T,T,F,F,F,F,T,F,F,F, B[1] , M * 3 , 21, 14), // A triple Ingot. + ingotDouble ("2x Ingots" , "Double " , " Ingot" ,T,T,F,F,F,F,T,T,F,F, B[1] , M * 2 , 32, 13), // A double Ingot. Introduced by TerraFirmaCraft + ingotHot ("Hot Ingots" , "Hot " , " Ingot" ,T,T,F,F,F,F,F,T,F,F, B[1] , M * 1 , 16, 12), // A hot Ingot, which has to be cooled down by a Vacuum Freezer. + ingot ("Ingots" , "" , " Ingot" ,T,T,F,F,F,F,F,T,F,F, B[1] , M * 1 , 64, 11), // A regular Ingot. Introduced by Eloraam + gemChipped ("Chipped Gemstones" , "Chipped " , "" ,T,T,T,F,F,F,T,T,F,F, B[2] , M / 4 , 64, 59), // A regular Gem worth one small Dust. Introduced by TerraFirmaCraft + gemFlawed ("Flawed Gemstones" , "Flawed " , "" ,T,T,T,F,F,F,T,T,F,F, B[2] , M / 2 , 64, 60), // A regular Gem worth two small Dusts. Introduced by TerraFirmaCraft + gemFlawless ("Flawless Gemstones" , "Flawless " , "" ,T,T,T,F,F,F,T,T,F,F, B[2] , M * 2 , 32, 61), // A regular Gem worth two Dusts. Introduced by TerraFirmaCraft + gemExquisite ("Exquisite Gemstones" , "Exquisite " , "" ,T,T,T,F,F,F,T,T,F,F, B[2] , M * 4 , 16, 62), // A regular Gem worth four Dusts. Introduced by TerraFirmaCraft + gem ("Gemstones" , "" , "" ,T,T,T,F,F,F,T,T,F,F, B[2] , M * 1 , 64, 8), // A regular Gem worth one Dust. Introduced by Eloraam + @Deprecated dustDirty ("Impure Dusts" , "" , "" ,F,F,F,F,F,F,F,F,F,T, B[3] , -1, 64, 3), + dustTiny ("Tiny Dusts" , "Tiny Pile of " , " Dust" ,T,T,F,F,F,F,F,T,F,F, B[0]|B[1]|B[2]|B[3] , M / 9 , 64, 0), // 1/9th of a Dust. + dustSmall ("Small Dusts" , "Small Pile of " , " Dust" ,T,T,F,F,F,F,F,T,F,F, B[0]|B[1]|B[2]|B[3] , M / 4 , 64, 1), // 1/4th of a Dust. + dustImpure ("Impure Dusts" , "Impure Pile of " , " Dust" ,T,T,F,F,F,F,F,T,F,T, B[3] , M * 1 , 64, 3), // Dust with impurities. 1 Unit of Main Material and 1/9 - 1/4 Unit of secondary Material + dustRefined ("Refined Dusts" , "Refined Pile of " , " Dust" ,T,T,F,F,F,F,F,T,F,T, B[3] , M * 1 , 64, 2), + dustPure ("Purified Dusts" , "Purified Pile of " , " Dust" ,T,T,F,F,F,F,F,T,F,T, B[3] , M * 1 , 64, 4), + dust ("Dusts" , "" , " Dust" ,T,T,F,F,F,F,F,T,F,F, B[0]|B[1]|B[2]|B[3] , M * 1 , 64, 2), // Pure Dust worth of one Ingot or Gem. Introduced by Alblaka. + nugget ("Nuggets" , "" , " Nugget" ,T,T,F,F,F,F,F,T,F,F, B[1] , M / 9 , 64, 9), // A Nugget. Introduced by Eloraam + plateAlloy ("Alloy Plates" , "" , "" ,T,F,F,F,F,F,F,F,F,F, B[1] , -1, 64, 17), // Special Alloys have this prefix. + plateSteamcraft ("Steamcraft Plates" , "" , "" ,F,F,F,F,F,F,F,F,F,F, B[1] , -1, 64, 17), + plateDense ("Dense Plates" , "Dense " , " Plate" ,T,T,F,F,F,F,T,T,F,F, B[1] , M * 9 , 8, 22), // 9 Plates combined in one Item. + plateQuintuple ("5x Plates" , "Quintuple " , " Plate" ,T,T,F,F,F,F,T,T,F,F, B[1] , M * 5 , 12, 21), + plateQuadruple ("4x Plates" , "Quadruple " , " Plate" ,T,T,F,F,F,F,T,T,F,F, B[1] , M * 4 , 16, 20), + @Deprecated plateQuad ("4x Plates" , "" , "" ,F,F,F,F,F,F,F,F,F,F, B[1] , -1, 16, 20), + plateTriple ("3x Plates" , "Triple " , " Plate" ,T,T,F,F,F,F,T,T,F,F, B[1] , M * 3 , 21, 19), + plateDouble ("2x Plates" , "Double " , " Plate" ,T,T,F,F,F,F,T,T,F,F, B[1] , M * 2 , 32, 18), + plate ("Plates" , "" , " Plate" ,T,T,F,F,F,F,T,T,F,F, B[1]|B[2] , M * 1 , 64, 17), // Regular Plate made of one Ingot/Dust. Introduced by Calclavia + foil ("Foils" , "" , " Foil" ,T,T,F,F,F,F,T,T,F,F, B[1] , M / 4 , 64, 29), // Foil made of 1/4 Ingot/Dust. + stickLong ("Long Sticks/Rods" , "Long " , " Rod" ,T,T,F,F,F,F,T,T,F,F, B[1]|B[2] , M * 1 , 64, 54), // Stick made of an Ingot. + stick ("Sticks/Rods" , "" , " Rod" ,T,T,F,F,F,F,T,T,F,F, B[1]|B[2] , M / 2 , 64, 23), // Stick made of half an Ingot. Introduced by Eloraam + round ("Rounds" , "" , " Round" ,T,T,F,F,F,F,T,T,F,F, B[1] , M / 9 , 64, 25), // consisting out of one Nugget. + bolt ("Bolts" , "" , " Bolt" ,T,T,F,F,F,F,T,T,F,F, B[1]|B[2] , M / 8 , 64, 26), // consisting out of 1/8 Ingot or 1/4 Stick. + screw ("Screws" , "" , " Screw" ,T,T,F,F,F,F,T,T,F,F, B[1]|B[2] , M / 9 , 64, 27), // consisting out of a Bolt. + ring ("Rings" , "" , " Ring" ,T,T,F,F,F,F,T,T,F,F, B[1] , M / 4 , 64, 28), // consisting out of 1/2 Stick. + springSmall ("Small Springs" , "Small " , " Spring" ,T,T,F,F,F,F,T,T,F,F, B[1] , M / 4 , 64, 55), // consisting out of 1 Fine Wire. + spring ("Springs" , "" , " Spring" ,T,T,F,F,F,F,T,T,F,F, B[1] , M * 1 , 64, 56), // consisting out of 2 Sticks. + wireFine ("Fine Wires" , "Fine " , " Wire" ,T,T,F,F,F,F,T,T,F,F, B[1] , M / 8 , 64, 51), // consisting out of 1/8 Ingot or 1/4 Wire. + rotor ("Rotors" , "" , " Rotor" ,T,T,F,F,F,F,T,T,F,F, B[7] ,M*4+M/4+M/9,16, 53), // consisting out of 4 Plates, 1 Ring and 1 Screw. + gearGtSmall ("Small Gears" , "Small " , " Gear" ,T,T,F,F,F,F,T,T,F,F, B[7] , M * 1 , 64, 52), + gearGt ("Gears" , "" , " Gear" ,T,T,F,F,F,F,T,T,F,F, B[7] , M * 4 , 16, 63), // Introduced by me because BuildCraft has ruined the gear Prefix... + lens ("Lenses" , "" , " Lens" ,T,T,F,F,F,F,T,T,F,F, B[2] ,(M * 3)/ 4, 64, 24), // 3/4 of a Plate or Gem used to shape a Lense. Normally only used on Transparent Materials. + crateGtDust ("Crates of Dust" , "Crate of " , " Dust" ,T,T,F,T,F,F,F,T,F,F, B[0]|B[1]|B[2]|B[3] , -1, 64, 96), // consisting out of 16 Dusts. + crateGtPlate ("Crates of Plates" , "Crate of " , " Plate" ,T,T,F,T,F,F,F,T,F,F, B[1]|B[2] , -1, 64, 99), // consisting out of 16 Plates. + crateGtIngot ("Crates of Ingots" , "Crate of " , " Ingot" ,T,T,F,T,F,F,F,T,F,F, B[1] , -1, 64, 97), // consisting out of 16 Ingots. + crateGtGem ("Crates of Gems" , "Crate of " , " Gem" ,T,T,F,T,F,F,F,T,F,F, B[2] , -1, 64, 98), // consisting out of 16 Gems. + cellPlasma ("Cells of Plasma" , "" , " Plasma Cell" ,T,T,T,T,F,F,F,T,F,F, B[5] , M * 1 , 64, 31), // Hot Cell full of Plasma, which can be used in the Plasma Generator. + cell ("Cells" , "" , " Cell" ,T,T,T,T,F,F,T,T,F,F, B[4]|B[8] , M * 1 , 64, 30), // Regular Gas/Fluid Cell. Introduced by Calclavia + bucket ("Buckets" , "" , " Bucket" ,T,T,T,T,F,F,T,F,F,F, B[4]|B[8] , M * 1 , 16, -1), // A vanilla Iron Bucket filled with the Material. + bottle ("Bottles" , "" , " Bottle" ,T,T,T,T,F,F,F,F,F,F, B[4]|B[8] , -1, 16, -1), // Glass Bottle containing a Fluid. + capsule ("Capsules" , "" , " Capsule" ,F,T,T,T,F,F,F,F,F,F, B[4]|B[8] , M * 1 , 16, -1), + crystal ("Crystals" , "" , " Crystal" ,F,T,F,F,F,F,T,F,F,F, B[2] , M * 1 , 64, -1), + bulletGtSmall ("Small Bullets" , "Small " , " Bullet" ,T,T,F,F,T,F,T,F,T,F, B[6]|B[8] , M / 9 , 64, -1), + bulletGtMedium ("Medium Bullets" , "Medium " , " Bullet" ,T,T,F,F,T,F,T,F,T,F, B[6]|B[8] , M / 6 , 64, -1), + bulletGtLarge ("Large Bullets" , "Large " , " Bullet" ,T,T,F,F,T,F,T,F,T,F, B[6]|B[8] , M / 3 , 64, -1), + arrowGtWood ("Regular Arrows" , "" , " Arrow" ,T,T,F,F,T,F,T,F,T,F, B[6] , M / 4 , 64, 57), // Arrow made of 1/4 Ingot/Dust + Wooden Stick. + arrowGtPlastic ("Light Arrows" , "Light " , " Arrow" ,T,T,F,F,T,F,T,F,T,F, B[6] , M / 4 , 64, 58), // Arrow made of 1/4 Ingot/Dust + Plastic Stick. + arrow ("Arrows" , "" , "" ,F,F,T,F,F,F,F,F,T,F, B[6] , -1, 64, 57), + toolHeadArrow ("Arrow Heads" , "" , " Arrow Head" ,T,T,F,F,F,F,T,T,F,F, B[6] , M / 4 , 64, 46), // consisting out of 1/4 Ingot. + toolHeadSword ("Sword Blades" , "" , " Sword Blade" ,T,T,F,F,F,F,T,T,F,F, B[6] , M * 2 , 16, 32), // consisting out of 2 Ingots. + toolHeadPickaxe ("Pickaxe Heads" , "" , " Pickaxe Head" ,T,T,F,F,F,F,T,T,F,F, B[6] , M * 3 , 16, 33), // consisting out of 3 Ingots. + toolHeadShovel ("Shovel Heads" , "" , " Shovel Head" ,T,T,F,F,F,F,T,T,F,F, B[6] , M * 1 , 16, 34), // consisting out of 1 Ingots. + toolHeadUniversalSpade ("Universal Spade Heads" , "" , " Universal Spade Head" ,T,T,F,F,F,F,T,T,F,F, B[6] , M * 1 , 16, 43), // consisting out of 1 Ingots. + toolHeadAxe ("Axe Heads" , "" , " Axe Head" ,T,T,F,F,F,F,T,T,F,F, B[6] , M * 3 , 16, 35), // consisting out of 3 Ingots. + toolHeadHoe ("Hoe Heads" , "" , " Hoe Head" ,T,T,F,F,F,F,T,T,F,F, B[6] , M * 2 , 16, 36), // consisting out of 2 Ingots. + toolHeadSense ("Sense Blades" , "" , " Sense Blade" ,T,T,F,F,F,F,T,T,F,F, B[6] , M * 3 , 16, 44), // consisting out of 3 Ingots. + toolHeadFile ("File Heads" , "" , " File Head" ,T,T,F,F,F,F,T,T,F,F, B[6] , M * 2 , 16, 38), // consisting out of 2 Ingots. + toolHeadHammer ("Hammer Heads" , "" , " Hammer Head" ,T,T,F,F,F,F,T,T,F,F, B[6] , M * 6 , 16, 37), // consisting out of 6 Ingots. + toolHeadPlow ("Plow Heads" , "" , " Plow Head" ,T,T,F,F,F,F,T,T,F,F, B[6] , M * 4 , 16, 45), // consisting out of 4 Ingots. + toolHeadSaw ("Saw Blades" , "" , " Saw Blade" ,T,T,F,F,F,F,T,T,F,F, B[6] , M * 2 , 16, 39), // consisting out of 2 Ingots. + toolHeadBuzzSaw ("Buzzsaw Blades" , "" , " Buzzsaw Blade" ,T,T,F,F,F,F,T,T,F,F, B[6] , M * 4 , 16, 48), // consisting out of 4 Ingots. + toolHeadScrewdriver ("Screwdriver Tips" , "" , " Screwdriver Tip" ,T,T,F,F,F,F,T,F,F,F, B[6] , M * 1 , 16, 47), // consisting out of 1 Ingots. + toolHeadDrill ("Drill Tips" , "" , " Drill Tip" ,T,T,F,F,F,F,T,T,F,F, B[6] , M * 4 , 16, 40), // consisting out of 4 Ingots. + toolHeadChainsaw ("Chainsaw Tips" , "" , " Chainsaw Tip" ,T,T,F,F,F,F,T,T,F,F, B[6] , M * 2 , 16, 41), // consisting out of 2 Ingots. + toolHeadWrench ("Wrench Tips" , "" , " Wrench Tip" ,T,T,F,F,F,F,T,T,F,F, B[6] , M * 4 , 16, 42), // consisting out of 4 Ingots. + turbineBlade ("Turbine Blades" , "" , " Turbine Blade" ,T,T,F,F,F,F,T,T,F,F, B[6] , M * 6 , 64, 100), // consisting out of 6 Ingots. + toolSword ("Swords" , "" , "" ,F,T,F,F,F,F,T,F,T,F, B[6] , M * 2 , 1, -1), // vanilly Sword + toolPickaxe ("Pickaxes" , "" , "" ,F,T,F,F,F,F,T,F,T,F, B[6] , M * 3 , 1, -1), // vanilly Pickaxe + toolShovel ("Shovels" , "" , "" ,F,T,F,F,F,F,T,F,T,F, B[6] , M * 1 , 1, -1), // vanilly Shovel + toolAxe ("Axes" , "" , "" ,F,T,F,F,F,F,T,F,T,F, B[6] , M * 3 , 1, -1), // vanilly Axe + toolHoe ("Hoes" , "" , "" ,F,T,F,F,F,F,T,F,T,F, B[6] , M * 2 , 1, -1), // vanilly Hoe + toolShears ("Shears" , "" , "" ,F,T,F,F,F,F,T,F,T,F, B[6] , M * 2 , 1, -1), // vanilly Shears + tool ("Tools" , "" , "" ,F,F,F,F,F,F,F,F,T,F, B[6] , -1, 1, -1), // toolPot, toolSkillet, toolSaucepan, toolBakeware, toolCuttingboard, toolMortarandpestle, toolMixingbowl, toolJuicer + compressedCobblestone ("9^X Compressed Cobblestones" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + compressedStone ("9^X Compressed Stones" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + compressedDirt ("9^X Compressed Dirt" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + compressedGravel ("9^X Compressed Gravel" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + compressedSand ("9^X Compressed Sand" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + compressed ("Compressed Materials" , "Compressed " , "" ,T,T,F,F,F,F,T,F,F,F, 0 , M * 2 , 64, -1), // Compressed Material, worth 1 Unit. Introduced by Galacticraft + glass ("Glasses" , "" , "" ,F,F,T,F,T,F,F,F,F,F, 0 , -1, 64, -1), + paneGlass ("Glass Panes" , "" , "" ,F,F,T,F,F,T,F,F,F,F, 0 , -1, 64, -1), + blockGlass ("Glass Blocks" , "" , "" ,F,F,T,F,F,T,F,F,F,F, 0 , -1, 64, -1), + blockWool ("Wool Blocks" , "" , "" ,F,F,T,F,F,T,F,F,F,F, 0 , -1, 64, -1), + block_ ("Random Blocks" , "" , "" ,F,F,F,F,F,T,F,F,F,F, 0 , -1, 64, -1), // IGNORE + block ("Storage Blocks" , "Block of " , "" ,T,T,F,F,F,T,T,F,F,F, 0 , M * 9 , 64, 71), // Storage Block consisting out of 9 Ingots/Gems/Dusts. Introduced by CovertJaguar + craftingTool ("Crafting Tools" , "" , "" ,F,F,F,F,F,F,F,F,T,F, 0 , -1, 64, -1), // Special Prefix used mainly for the Crafting Handler. + crafting ("Crafting Ingredients" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), // Special Prefix used mainly for the Crafting Handler. + craft ("Crafting Stuff?" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), // Special Prefix used mainly for the Crafting Handler. + log ("Logs" , "" , "" ,F,F,F,F,F,T,F,F,F,F, 0 , -1, 64, -1), // Prefix used for Logs. Usually as "logWood". Introduced by Eloraam + slab ("Slabs" , "" , "" ,F,F,F,F,F,T,F,F,F,F, 0 , -1, 64, -1), // Prefix used for Slabs. Usually as "slabWood" or "slabStone". Introduced by SirSengir + stair ("Stairs" , "" , "" ,F,F,F,F,F,T,F,F,F,F, 0 , -1, 64, -1), // Prefix used for Stairs. Usually as "stairWood" or "stairStone". Introduced by SirSengir + fence ("Fences" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), // Prefix used for Fences. Usually as "fenceWood". Introduced by Forge + plank ("Planks" , "" , "" ,F,F,F,F,F,T,F,F,F,F, 0 , -1, 64, -1), // Prefix for Planks. Usually "plankWood". Introduced by Eloraam + treeSapling ("Saplings" , "" , "" ,F,F,T,F,F,T,F,F,F,F, 0 , -1, 64, -1), // Prefix for Saplings. + treeLeaves ("Leaves" , "" , "" ,F,F,T,F,F,T,F,F,F,F, 0 , -1, 64, -1), // Prefix for Leaves. + tree ("Tree Parts" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), // Prefix for Tree Parts. + stoneCobble ("Cobblestones" , "" , "" ,F,F,T,F,F,T,F,F,F,F, 0 , -1, 64, -1), // Cobblestone Prefix for all Cobblestones. + stoneSmooth ("Smoothstones" , "" , "" ,F,F,T,F,F,T,F,F,F,F, 0 , -1, 64, -1), // Smoothstone Prefix. + stoneMossyBricks ("mossy Stone Bricks" , "" , "" ,F,F,T,F,F,T,F,F,F,F, 0 , -1, 64, -1), // Mossy Stone Bricks. + stoneMossy ("Mossy Stones" , "" , "" ,F,F,T,F,F,T,F,F,F,F, 0 , -1, 64, -1), // Mossy Cobble. + @Deprecated stoneBricksMossy("Mossy Stone Bricks" , "" , "" ,F,F,F,F,F,T,F,F,F,F, 0 , -1, 64, -1), + stoneBricks ("Stone Bricks" , "" , "" ,F,F,T,F,F,T,F,F,F,F, 0 , -1, 64, -1), // Stone Bricks. + @Deprecated stoneBrick ("Stone Bricks" , "" , "" ,F,F,F,F,F,T,F,F,F,F, 0 , -1, 64, -1), + stoneCracked ("Cracked Stones" , "" , "" ,F,F,T,F,F,T,F,F,F,F, 0 , -1, 64, -1), // Cracked Bricks. + stoneChiseled ("Chiseled Stones" , "" , "" ,F,F,T,F,F,T,F,F,F,F, 0 , -1, 64, -1), // Chiseled Stone. + stone ("Stones" , "" , "" ,F,T,T,F,T,T,F,F,F,F, 0 , -1, 64, -1), // Prefix to determine which kind of Rock this is. + cobblestone ("Cobblestones" , "" , "" ,F,T,T,F,F,T,F,F,F,F, 0 , -1, 64, -1), + rock ("Rocks" , "" , "" ,F,T,T,F,T,T,F,F,F,F, 0 , -1, 64, -1), // Prefix to determine which kind of Rock this is. + record ("Records" , "" , "" ,F,F,T,F,F,F,F,F,F,F, 0 , -1, 1, -1), + rubble ("Rubbles" , "" , "" ,T,T,T,F,F,F,F,F,F,F, 0 , -1, 64, -1), + scraps ("Scraps" , "" , "" ,T,T,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + scrap ("Scraps" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + item_ ("Items" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), // IGNORE + item ("Items" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), // Random Item. Introduced by Alblaka + book ("Books" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), // Used for Books of any kind. + paper ("Papers" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), // Used for Papers of any kind. + dye ("Dyes" , "" , "" ,F,F,T,F,F,F,F,F,F,F, 0 , -1, 64, -1), // Used for the 16 dyes. Introduced by Eloraam + stainedClay ("Stained Clays" , "" , "" ,F,F,T,F,F,T,F,F,F,F, 0 , -1, 64, -1), // Used for the 16 colors of Stained Clay. Introduced by Forge + armorHelmet ("Helmets" , "" , "" ,F,T,F,F,F,F,T,F,T,F, B[6] , M * 5 , 1, -1), // vanilly Helmet + armorChestplate ("Chestplates" , "" , "" ,F,T,F,F,F,F,T,F,T,F, B[6] , M * 8 , 1, -1), // vanilly Chestplate + armorLeggings ("Leggings" , "" , "" ,F,T,F,F,F,F,T,F,T,F, B[6] , M * 7 , 1, -1), // vanilly Pants + armorBoots ("Boots" , "" , "" ,F,T,F,F,F,F,T,F,T,F, B[6] , M * 4 , 1, -1), // vanilly Boots + armor ("Armor Parts" , "" , "" ,F,F,F,F,F,F,F,F,T,F, B[6] , -1, 1, -1), + frameGt ("Frame Boxes" , "" , "" ,T,T,F,F,T,F,T,F,F,F, 0 , M * 2 , 64, 83), + pipeTiny ("Tiny Pipes" , "Tiny " , " Pipe" ,T,T,F,F,T,F,T,F,F,F, 0 , M / 2 , 64, 78), + pipeSmall ("Small Pipes" , "Small " , " Pipe" ,T,T,F,F,T,F,T,F,F,F, 0 , M * 1 , 64, 79), + pipeMedium ("Medium Pipes" , "Medium " , " Pipe" ,T,T,F,F,T,F,T,F,F,F, 0 , M * 3 , 64, 80), + pipeLarge ("Large pipes" , "Large " , " Pipe" ,T,T,F,F,T,F,T,F,F,F, 0 , M * 6 , 64, 81), + pipeHuge ("Huge Pipes" , "Huge " , " Pipe" ,T,T,F,F,T,F,T,F,F,F, 0 , M *12 , 64, 82), + pipeRestrictiveTiny ("Tiny Restrictive Pipes" , "Tiny Restrictive " , " Pipe" ,T,T,F,F,T,F,T,F,F,F, 0 , M / 2 , 64, 78), + pipeRestrictiveSmall ("Small Restrictive Pipes" , "Small Restrictive " , " Pipe" ,T,T,F,F,T,F,T,F,F,F, 0 , M * 1 , 64, 79), + pipeRestrictiveMedium ("Medium Restrictive Pipes" , "Medium Restrictive " , " Pipe" ,T,T,F,F,T,F,T,F,F,F, 0 , M * 3 , 64, 80), + pipeRestrictiveLarge ("Large Restrictive Pipes" , "Large Restrictive " , " Pipe" ,T,T,F,F,T,F,T,F,F,F, 0 , M * 6 , 64, 81), + pipeRestrictiveHuge ("Huge Restrictive Pipes" , "Huge Restrictive " , " Pipe" ,T,T,F,F,T,F,T,F,F,F, 0 , M *12 , 64, 82), + pipe ("Pipes" , "" , " Pipe" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, 77), + wireGt16 ("16x Wires" , "16x " , " Wire" ,T,T,F,F,F,F,T,F,F,F, 0 , M * 8 , 64, -1), + wireGt12 ("12x Wires" , "12x " , " Wire" ,T,T,F,F,F,F,T,F,F,F, 0 , M * 6 , 64, -1), + wireGt08 ("8x Wires" , "8x " , " Wire" ,T,T,F,F,F,F,T,F,F,F, 0 , M * 4 , 64, -1), + wireGt04 ("4x Wires" , "4x " , " Wire" ,T,T,F,F,F,F,T,F,F,F, 0 , M * 2 , 64, -1), + wireGt02 ("2x Wires" , "2x " , " Wire" ,T,T,F,F,F,F,T,F,F,F, 0 , M * 1 , 64, -1), + wireGt01 ("1x Wires" , "1x " , " Wire" ,T,T,F,F,F,F,T,F,F,F, 0 , M / 2 , 64, -1), + cableGt12 ("12x Cables" , "12x " , " Cable" ,T,T,F,F,F,F,T,F,F,F, 0 , M * 6 , 64, -1), + cableGt08 ("8x Cables" , "8x " , " Cable" ,T,T,F,F,F,F,T,F,F,F, 0 , M * 4 , 64, -1), + cableGt04 ("4x Cables" , "4x " , " Cable" ,T,T,F,F,F,F,T,F,F,F, 0 , M * 2 , 64, -1), + cableGt02 ("2x Cables" , "2x " , " Cable" ,T,T,F,F,F,F,T,F,F,F, 0 , M * 1 , 64, -1), + cableGt01 ("1x Cables" , "1x " , " Cable" ,T,T,F,F,F,F,T,F,F,F, 0 , M / 2 , 64, -1), + + /* Electric Components. + * + * usual Materials for this are: + * Primitive (Tier 1) + * Basic (Tier 2) as used by UE as well : IC2 Circuit and RE-Battery + * Good (Tier 3) + * Advanced (Tier 4) as used by UE as well : Advanced Circuit, Advanced Battery and Lithium Battery + * Data (Tier 5) : Data Storage Circuit + * Elite (Tier 6) as used by UE as well : Energy Crystal and Data Control Circuit + * Master (Tier 7) : Energy Flow Circuit and Lapotron Crystal + * Ultimate (Tier 8) : Data Orb and Lapotronic Energy Orb + * Infinite (Cheaty) + */ + batterySingleuse ("Single Use Batteries" , "" , "" ,F,T,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + battery ("Reusable Batteries" , "" , "" ,F,T,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), // Introduced by Calclavia + circuit ("Circuits" , "" , "" ,T,T,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), // Introduced by Calclavia + computer ("Computers" , "" , "" ,T,T,F,F,T,F,F,F,F,F, 0 , -1, 64, -1), // A whole Computer. "computerMaster" = ComputerCube + + // random known prefixes without special abilities. + skull ("Skulls" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + plating ("Platings" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + dinosaur ("Dinosaurs" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + travelgear ("Travel Gear" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + bauble ("Baubles" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + cluster ("Clusters" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + grafter ("Grafters" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + scoop ("Scoops" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + frame ("Frames" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + tome ("Tomes" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + junk ("Junk" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + bee ("Bees" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + rod ("Rods" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + dirt ("Dirts" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + sand ("Sands" , "" , "" ,F,F,T,F,F,T,F,F,F,F, 0 , -1, 64, -1), + grass ("Grasses" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + gravel ("Gravels" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + mushroom ("Mushrooms" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + wood ("Woods" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), // Introduced by Eloraam + drop ("Drops" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + fuel ("Fuels" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + panel ("Panels" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + brick ("Bricks" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + chunk ("Chunks" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + wire ("Wires" , "" , "" ,F,F,F,F,T,F,F,F,F,F, 0 , -1, 64, -1), + seed ("Seeds" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + reed ("Reeds" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + sheetDouble ("2x Sheets" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + sheet ("Sheets" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + crop ("Crops" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + plant ("Plants" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + coin ("Coins" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + lumar ("Lumars" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + ground ("Grounded Stuff" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + cable ("Cables" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + component ("Components" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + wax ("Waxes" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + wall ("Walls" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + tube ("Tubes" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + list ("Lists" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + food ("Foods" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + gear ("Gears" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), // Introduced by SirSengir + coral ("Corals" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + flower ("Flowers" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + storage ("Storages" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + material ("Materials" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + plasma ("Plasmas" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + element ("Elements" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + molecule ("Molecules" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + wafer ("Wafers" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + orb ("Orbs" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + handle ("Handles" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + blade ("Blades" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + head ("Heads" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + motor ("Motors" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + bit ("Bits" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + shears ("Shears" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + turbine ("Turbines" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + fertilizer ("Fertilizers" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + chest ("Chests" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + raw ("Raw Things" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + stainedGlass ("Stained Glasses" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + mystic ("Mystic Stuff" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + mana ("Mana Stuff" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + rune ("Runes" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + petal ("Petals" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + pearl ("Pearls" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + powder ("Powders" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + soulsand ("Soulsands" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + obsidian ("Obsidians" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + glowstone ("Glowstones" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + beans ("Beans" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + br ("br" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + essence ("Essences" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + alloy ("Alloys" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + cooking ("Cooked Things" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + elven ("Elven Stuff" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + reactor ("Reactors" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + mffs ("MFFS" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + projred ("Project Red" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + ganys ("Ganys Stuff" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + liquid ("Liquids" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + bars ("Bars" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1), + bar ("Bars" , "" , "" ,F,F,F,F,F,F,F,F,F,F, 0 , -1, 64, -1); + + static { + pulp.mPrefixInto = dust; + oreGem.mPrefixInto = ore; + leaves.mPrefixInto = treeLeaves; + sapling.mPrefixInto = treeSapling; + itemDust.mPrefixInto = dust; + dustDirty.mPrefixInto = dustImpure; + denseore.mPrefixInto = oreDense; + ingotQuad.mPrefixInto = ingotQuadruple; + plateQuad.mPrefixInto = plateQuadruple; + stoneBrick.mPrefixInto = stoneBricks; + stoneBricksMossy.mPrefixInto = stoneMossyBricks; + + ingotHot.mHeatDamage = 3.0F; + cellPlasma.mHeatDamage = 6.0F; + + block.ignoreMaterials(Materials.Ice, Materials.Snow, Materials.Concrete, Materials.Glass, Materials.Glowstone, Materials.DarkIron, Materials.Marble, Materials.Quartz, Materials.CertusQuartz, Materials.Limestone); + ingot.ignoreMaterials(Materials.Brick, Materials.NetherBrick); + + dust.addFamiliarPrefix(dustTiny); + dust.addFamiliarPrefix(dustSmall); + dustTiny.addFamiliarPrefix(dust); + dustTiny.addFamiliarPrefix(dustSmall); + dustSmall.addFamiliarPrefix(dust); + dustSmall.addFamiliarPrefix(dustTiny); + + ingot.addFamiliarPrefix(nugget); + nugget.addFamiliarPrefix(ingot); + + for (OrePrefixes tPrefix1 : values()) if (tPrefix1.name().startsWith("ore" )) for (OrePrefixes tPrefix2 : values()) if (tPrefix2.name().startsWith("ore" )) tPrefix1.addFamiliarPrefix(tPrefix2); + for (OrePrefixes tPrefix1 : values()) if (tPrefix1.name().startsWith("pipe" )) for (OrePrefixes tPrefix2 : values()) if (tPrefix2.name().startsWith("pipe" )) tPrefix1.addFamiliarPrefix(tPrefix2); + for (OrePrefixes tPrefix1 : values()) if (tPrefix1.name().startsWith("wireGt" )) for (OrePrefixes tPrefix2 : values()) if (tPrefix2.name().startsWith("wireGt" )) tPrefix1.addFamiliarPrefix(tPrefix2); + for (OrePrefixes tPrefix1 : values()) if (tPrefix1.name().startsWith("cableGt" )) for (OrePrefixes tPrefix2 : values()) if (tPrefix2.name().startsWith("cableGt" )) tPrefix1.addFamiliarPrefix(tPrefix2); + + // These are only the important ones. + gem .mNotGeneratedItems.add(Materials.Coal); + gem .mNotGeneratedItems.add(Materials.Charcoal); + gem .mNotGeneratedItems.add(Materials.NetherStar); + gem .mNotGeneratedItems.add(Materials.Diamond); + gem .mNotGeneratedItems.add(Materials.Emerald); + gem .mNotGeneratedItems.add(Materials.NetherQuartz); + gem .mNotGeneratedItems.add(Materials.EnderPearl); + gem .mNotGeneratedItems.add(Materials.EnderEye); + gem .mNotGeneratedItems.add(Materials.Flint); + gem .mNotGeneratedItems.add(Materials.Lapis); + dust .mNotGeneratedItems.add(Materials.Bone); + dust .mNotGeneratedItems.add(Materials.Redstone); + dust .mNotGeneratedItems.add(Materials.Glowstone); + dust .mNotGeneratedItems.add(Materials.Gunpowder); + dust .mNotGeneratedItems.add(Materials.Sugar); + dust .mNotGeneratedItems.add(Materials.Blaze); + stick .mNotGeneratedItems.add(Materials.Wood); + stick .mNotGeneratedItems.add(Materials.Bone); + stick .mNotGeneratedItems.add(Materials.Blaze); + ingot .mNotGeneratedItems.add(Materials.Iron); + ingot .mNotGeneratedItems.add(Materials.Gold); + ingot .mNotGeneratedItems.add(Materials.Brick); + ingot .mNotGeneratedItems.add(Materials.BrickNether); + ingot .mNotGeneratedItems.add(Materials.WoodSealed); + ingot .mNotGeneratedItems.add(Materials.Wood); + nugget .mNotGeneratedItems.add(Materials.Gold); + plate .mNotGeneratedItems.add(Materials.Paper); + cell .mNotGeneratedItems.add(Materials.Empty); + cell .mNotGeneratedItems.add(Materials.Water); + cell .mNotGeneratedItems.add(Materials.Lava); + cell .mNotGeneratedItems.add(Materials.ConstructionFoam); + cell .mNotGeneratedItems.add(Materials.UUMatter); + cell .mNotGeneratedItems.add(Materials.BioFuel); + cell .mNotGeneratedItems.add(Materials.CoalFuel); + bucket .mNotGeneratedItems.add(Materials.Empty); + bucket .mNotGeneratedItems.add(Materials.Lava); + bucket .mNotGeneratedItems.add(Materials.Milk); + bucket .mNotGeneratedItems.add(Materials.Water); + bottle .mNotGeneratedItems.add(Materials.Empty); + bottle .mNotGeneratedItems.add(Materials.Water); + bottle .mNotGeneratedItems.add(Materials.Milk); + block .mNotGeneratedItems.add(Materials.Iron); + block .mNotGeneratedItems.add(Materials.Gold); + block .mNotGeneratedItems.add(Materials.Lapis); + block .mNotGeneratedItems.add(Materials.Emerald); + block .mNotGeneratedItems.add(Materials.Redstone); + block .mNotGeneratedItems.add(Materials.Diamond); + block .mNotGeneratedItems.add(Materials.Coal); + toolHeadArrow .mNotGeneratedItems.add(Materials.Glass); + + //----- + + dustImpure .mGeneratedItems.add(Materials.GraniteRed); + dustImpure .mGeneratedItems.add(Materials.GraniteBlack); + dustImpure .mGeneratedItems.add(Materials.Quartzite); + dustImpure .mGeneratedItems.add(Materials.Flint); + dustImpure .mGeneratedItems.add(Materials.Redrock); + dustImpure .mGeneratedItems.add(Materials.Basalt); + dustImpure .mGeneratedItems.add(Materials.Marble); + dustImpure .mGeneratedItems.add(Materials.Netherrack); + dustImpure .mGeneratedItems.add(Materials.Endstone); + dustImpure .mGeneratedItems.add(Materials.Stone); + + plate .mGeneratedItems.add(Materials.Redstone); + plate .mGeneratedItems.add(Materials.Concrete); + plate .mGeneratedItems.add(Materials.GraniteRed); + plate .mGeneratedItems.add(Materials.GraniteBlack); + plate .mGeneratedItems.add(Materials.Glowstone); + plate .mGeneratedItems.add(Materials.Nikolite); + plate .mGeneratedItems.add(Materials.Obsidian); + + plate .mGeneratedItems.add(Materials.Paper); + plateDouble .mGeneratedItems.add(Materials.Paper); + plateTriple .mGeneratedItems.add(Materials.Paper); + plateQuadruple .mGeneratedItems.add(Materials.Paper); + plateQuintuple .mGeneratedItems.add(Materials.Paper); + + lens .mGeneratedItems.add(Materials.EnderPearl); + lens .mGeneratedItems.add(Materials.EnderEye); + + stickLong .mGeneratedItems.add(Materials.Blaze); + + //----- + + dust .mGeneratedItems.addAll(dustPure.mGeneratedItems); + dust .mGeneratedItems.addAll(dustImpure.mGeneratedItems); + dust .mGeneratedItems.addAll(dustRefined.mGeneratedItems); + dustTiny .mGeneratedItems.addAll(dust.mGeneratedItems); + dustSmall .mGeneratedItems.addAll(dust.mGeneratedItems); + crateGtDust .mGeneratedItems.addAll(dust.mGeneratedItems); + crateGtIngot .mGeneratedItems.addAll(ingot.mGeneratedItems); + crateGtGem .mGeneratedItems.addAll(gem.mGeneratedItems); + crateGtPlate .mGeneratedItems.addAll(plate.mGeneratedItems); + + //----- + + toolHeadFile .mCondition = new ICondition.And(new ICondition.Not(SubTag.NO_SMASHING), new ICondition.Not(SubTag.BOUNCY)); + toolHeadSaw .mCondition = new ICondition.And(new ICondition.Not(SubTag.NO_SMASHING), new ICondition.Not(SubTag.BOUNCY)); + toolHeadDrill .mCondition = new ICondition.And(new ICondition.Not(SubTag.NO_SMASHING), new ICondition.Not(SubTag.BOUNCY)); + toolHeadChainsaw .mCondition = new ICondition.And(new ICondition.Not(SubTag.NO_SMASHING), new ICondition.Not(SubTag.BOUNCY)); + toolHeadWrench .mCondition = new ICondition.And(new ICondition.Not(SubTag.NO_SMASHING), new ICondition.Not(SubTag.BOUNCY)); + toolHeadBuzzSaw .mCondition = new ICondition.And(new ICondition.Not(SubTag.NO_SMASHING), new ICondition.Not(SubTag.BOUNCY)); + + rotor .mCondition = new ICondition.Nor(SubTag.CRYSTAL, SubTag.STONE, SubTag.BOUNCY); + + spring .mCondition = new ICondition.Or(SubTag.STRETCHY, SubTag.BOUNCY, new ICondition.Not(SubTag.NO_SMASHING)); + springSmall .mCondition = new ICondition.Or(SubTag.STRETCHY, SubTag.BOUNCY, new ICondition.Not(SubTag.NO_SMASHING)); + + gemChipped .mCondition = new ICondition.And(SubTag.TRANSPARENT, SubTag.CRYSTAL, new ICondition.Not(SubTag.QUARTZ), new ICondition.Not(SubTag.PEARL), new ICondition.Not(SubTag.MAGICAL)); + gemFlawed .mCondition = new ICondition.And(SubTag.TRANSPARENT, SubTag.CRYSTAL, new ICondition.Not(SubTag.QUARTZ), new ICondition.Not(SubTag.PEARL), new ICondition.Not(SubTag.MAGICAL)); + gemFlawless .mCondition = new ICondition.And(SubTag.TRANSPARENT, SubTag.CRYSTAL, new ICondition.Not(SubTag.QUARTZ), new ICondition.Not(SubTag.PEARL), new ICondition.Not(SubTag.MAGICAL)); + gemExquisite .mCondition = new ICondition.And(SubTag.TRANSPARENT, SubTag.CRYSTAL, new ICondition.Not(SubTag.QUARTZ), new ICondition.Not(SubTag.PEARL), new ICondition.Not(SubTag.MAGICAL)); + + lens .mCondition = new ICondition.Or(SubTag.MAGICAL, new ICondition.And(SubTag.TRANSPARENT, SubTag.HAS_COLOR)); + + plateDouble .mCondition = new ICondition.Or(SubTag.PAPER, new ICondition.Not(SubTag.NO_SMASHING)); + plateTriple .mCondition = new ICondition.Or(SubTag.PAPER, new ICondition.Not(SubTag.NO_SMASHING)); + plateQuadruple .mCondition = new ICondition.Or(SubTag.PAPER, new ICondition.Not(SubTag.NO_SMASHING)); + plateQuintuple .mCondition = new ICondition.Or(SubTag.PAPER, new ICondition.Not(SubTag.NO_SMASHING)); + + plateDense .mCondition = new ICondition.Not(SubTag.NO_SMASHING); + + ingotDouble .mCondition = new ICondition.Not(SubTag.NO_SMASHING); + ingotTriple .mCondition = new ICondition.Not(SubTag.NO_SMASHING); + ingotQuadruple .mCondition = new ICondition.Not(SubTag.NO_SMASHING); + ingotQuintuple .mCondition = new ICondition.Not(SubTag.NO_SMASHING); + + wireFine .mCondition = SubTag.METAL; + + //----- + + pipeRestrictiveTiny.mSecondaryMaterial = new MaterialStack(Materials.Steel , ring.mMaterialAmount); + pipeRestrictiveSmall.mSecondaryMaterial = new MaterialStack(Materials.Steel , ring.mMaterialAmount * 2); + pipeRestrictiveMedium.mSecondaryMaterial = new MaterialStack(Materials.Steel , ring.mMaterialAmount * 3); + pipeRestrictiveLarge.mSecondaryMaterial = new MaterialStack(Materials.Steel , ring.mMaterialAmount * 4); + pipeRestrictiveHuge.mSecondaryMaterial = new MaterialStack(Materials.Steel , ring.mMaterialAmount * 5); + cableGt12.mSecondaryMaterial = new MaterialStack(Materials.Rubber , plate.mMaterialAmount * 4); + cableGt08.mSecondaryMaterial = new MaterialStack(Materials.Rubber , plate.mMaterialAmount * 3); + cableGt04.mSecondaryMaterial = new MaterialStack(Materials.Rubber , plate.mMaterialAmount * 2); + cableGt02.mSecondaryMaterial = new MaterialStack(Materials.Rubber , plate.mMaterialAmount); + cableGt01.mSecondaryMaterial = new MaterialStack(Materials.Rubber , plate.mMaterialAmount); + bucket.mSecondaryMaterial = new MaterialStack(Materials.Iron , ingot.mMaterialAmount * 3); + cell.mSecondaryMaterial = new MaterialStack(Materials.Tin , plate.mMaterialAmount * 2); + cellPlasma.mSecondaryMaterial = new MaterialStack(Materials.Tin , plate.mMaterialAmount * 2); + oreRedgranite.mSecondaryMaterial = new MaterialStack(Materials.GraniteRed , dust.mMaterialAmount); + oreBlackgranite.mSecondaryMaterial = new MaterialStack(Materials.GraniteBlack , dust.mMaterialAmount); + oreNetherrack.mSecondaryMaterial = new MaterialStack(Materials.Netherrack , dust.mMaterialAmount); + oreNether.mSecondaryMaterial = new MaterialStack(Materials.Netherrack , dust.mMaterialAmount); + oreEndstone.mSecondaryMaterial = new MaterialStack(Materials.Endstone , dust.mMaterialAmount); + oreEnd.mSecondaryMaterial = new MaterialStack(Materials.Endstone , dust.mMaterialAmount); + oreDense.mSecondaryMaterial = new MaterialStack(Materials.Stone , dust.mMaterialAmount); + orePoor.mSecondaryMaterial = new MaterialStack(Materials.Stone , dust.mMaterialAmount * 2); + oreSmall.mSecondaryMaterial = new MaterialStack(Materials.Stone , dust.mMaterialAmount * 2); + oreNormal.mSecondaryMaterial = new MaterialStack(Materials.Stone , dust.mMaterialAmount * 2); + oreRich.mSecondaryMaterial = new MaterialStack(Materials.Stone , dust.mMaterialAmount * 2); + ore.mSecondaryMaterial = new MaterialStack(Materials.Stone , dust.mMaterialAmount); + crushed.mSecondaryMaterial = new MaterialStack(Materials.Stone , dust.mMaterialAmount); + toolHeadDrill.mSecondaryMaterial = new MaterialStack(Materials.Steel , plate.mMaterialAmount * 4); + toolHeadChainsaw.mSecondaryMaterial = new MaterialStack(Materials.Steel , plate.mMaterialAmount * 4 + ring.mMaterialAmount * 2); + toolHeadWrench.mSecondaryMaterial = new MaterialStack(Materials.Steel , ring.mMaterialAmount + screw.mMaterialAmount * 2); + arrowGtWood.mSecondaryMaterial = new MaterialStack(Materials.Wood , stick.mMaterialAmount); + arrowGtPlastic.mSecondaryMaterial = new MaterialStack(Materials.Plastic , stick.mMaterialAmount); + bulletGtSmall.mSecondaryMaterial = new MaterialStack(Materials.Brass , ingot.mMaterialAmount / 9); + bulletGtMedium.mSecondaryMaterial = new MaterialStack(Materials.Brass , ingot.mMaterialAmount / 6); + bulletGtLarge.mSecondaryMaterial = new MaterialStack(Materials.Brass , ingot.mMaterialAmount / 3); + } + + public final ArrayList mPrefixedItems = new ArrayList(); + + public boolean add(ItemStack aStack) { + if (aStack == null) return false; + if (!contains(aStack)) mPrefixedItems.add(aStack); + while (mPrefixedItems.contains(null)) mPrefixedItems.remove(null); + return true; + } + + public boolean contains(ItemStack aStack) { + if (aStack == null) return false; + for (ItemStack tStack : mPrefixedItems) if (GT_Utility.areStacksEqual(aStack, tStack, !tStack.hasTagCompound())) return true; + return false; + } + + public boolean doGenerateItem(Materials aMaterial) { + return aMaterial != null && aMaterial != Materials._NULL && ((aMaterial.mTypes & mMaterialGenerationBits) != 0 || mGeneratedItems.contains(aMaterial)) && !mNotGeneratedItems.contains(aMaterial) && (mCondition == null || mCondition.isTrue(aMaterial)); + } + + public boolean ignoreMaterials(Materials... aMaterials) { + for (Materials tMaterial : aMaterials) if (tMaterial != null) mIgnoredMaterials.add(tMaterial); + return true; + } + + public boolean isIgnored(Materials aMaterial) { + if (aMaterial != null && (!aMaterial.mUnificatable || aMaterial != aMaterial.mMaterialInto)) return true; + return mIgnoredMaterials.contains(aMaterial); + } + + public boolean addFamiliarPrefix(OrePrefixes aPrefix) { + if (aPrefix == null || mFamiliarPrefixes.contains(aPrefix) || aPrefix == this) return false; + return mFamiliarPrefixes.add(aPrefix); + } + + public boolean add(IOreRecipeRegistrator aRegistrator) { + if (aRegistrator == null) return false; + return mOreProcessing.add(aRegistrator); + } + + public void processOre(Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) { + if (aMaterial != null && (aMaterial != Materials._NULL || mIsSelfReferencing || !mIsMaterialBased) && GT_Utility.isStackValid(aStack)) for (IOreRecipeRegistrator tRegistrator : mOreProcessing) { + if (D2) GT_Log.ore.println("Processing '" + aOreDictName + "' with the Prefix '" + name() + "' and the Material '" + aMaterial.name() + "' at " + GT_Utility.getClassName(tRegistrator)); + tRegistrator.registerOre(this, aMaterial, aOreDictName, aModName, GT_Utility.copyAmount(1, aStack)); + } + } + + public ItemStack mContainerItem = null; + public ICondition mCondition = null; + public byte mDefaultStackSize = 64; + public final short mTextureIndex; + public final String mRegularLocalName, mLocalizedMaterialPre, mLocalizedMaterialPost; + public final boolean mIsUsedForOreProcessing, mIsEnchantable, mIsUnificatable, mIsMaterialBased, mIsSelfReferencing, mIsContainer, mDontUnificateActively, mIsUsedForBlocks, mAllowNormalRecycling, mGenerateDefaultItem; + public MaterialStack mSecondaryMaterial = null; + public OrePrefixes mPrefixInto = this; + public final List mAspects = new ArrayList(); + public final Collection mFamiliarPrefixes = new HashSet(); + private final Collection mNotGeneratedItems = new HashSet(), mIgnoredMaterials = new HashSet(), mGeneratedItems = new HashSet(); + private final ArrayList mOreProcessing = new ArrayList(); + public float mHeatDamage = 0.0F; // Negative for Frost Damage + + /** + * Used to determine the amount of Material this Prefix contains. + * Multiply or Divide GregTech_API.MATERIAL_UNIT to get the Amounts in comparision to one Ingot. + * 0 = Null + * Negative = Undefined Amount + */ + public final long mMaterialAmount; + + /** + * Yes this Value can be changed to add Bits for the MetaGenerated-Item-Check. + */ + public int mMaterialGenerationBits = 0; + + private OrePrefixes(String aRegularLocalName, String aLocalizedMaterialPre, String aLocalizedMaterialPost, boolean aIsUnificatable, boolean aIsMaterialBased, boolean aIsSelfReferencing, boolean aIsContainer, boolean aDontUnificateActively, boolean aIsUsedForBlocks, boolean aAllowNormalRecycling, boolean aGenerateDefaultItem, boolean aIsEnchantable, boolean aIsUsedForOreProcessing, int aMaterialGenerationBits, long aMaterialAmount, int aDefaultStackSize, int aTextureindex) { + mIsUnificatable = aIsUnificatable; + mIsMaterialBased = aIsMaterialBased; + mIsSelfReferencing = aIsSelfReferencing; + mIsContainer = aIsContainer; + mDontUnificateActively = aDontUnificateActively; + mIsUsedForBlocks = aIsUsedForBlocks; + mAllowNormalRecycling = aAllowNormalRecycling; + mGenerateDefaultItem = aGenerateDefaultItem; + mIsEnchantable = aIsEnchantable; + mIsUsedForOreProcessing = aIsUsedForOreProcessing; + mMaterialGenerationBits = aMaterialGenerationBits; + mMaterialAmount = aMaterialAmount; + mRegularLocalName = aRegularLocalName; + mLocalizedMaterialPre = aLocalizedMaterialPre; + mLocalizedMaterialPost = aLocalizedMaterialPost; + mDefaultStackSize = (byte)aDefaultStackSize; + mTextureIndex = (short)aTextureindex; + + if (name().startsWith("ore")) { + new TC_AspectStack(TC_Aspects.TERRA, 1).addToAspectList(mAspects); + } else + if (name().startsWith("wire") || name().startsWith("cable")) { + new TC_AspectStack(TC_Aspects.ELECTRUM, 1).addToAspectList(mAspects); + } else + if (name().startsWith("dust")) { + new TC_AspectStack(TC_Aspects.PERDITIO, 1).addToAspectList(mAspects); + } else + if (name().startsWith("crushed")) { + new TC_AspectStack(TC_Aspects.PERFODIO, 1).addToAspectList(mAspects); + } else + if (name().startsWith("ingot") || name().startsWith("nugget")) { + new TC_AspectStack(TC_Aspects.METALLUM, 1).addToAspectList(mAspects); + } else + if (name().startsWith("armor")) { + new TC_AspectStack(TC_Aspects.TUTAMEN, 1).addToAspectList(mAspects); + } else + if (name().startsWith("stone")) { + new TC_AspectStack(TC_Aspects.TERRA, 1).addToAspectList(mAspects); + } else + if (name().startsWith("pipe")) { + new TC_AspectStack(TC_Aspects.ITER, 1).addToAspectList(mAspects); + } else + if (name().startsWith("gear")) { + new TC_AspectStack(TC_Aspects.MOTUS, 1).addToAspectList(mAspects); + new TC_AspectStack(TC_Aspects.MACHINA, 1).addToAspectList(mAspects); + } else + if (name().startsWith("frame") || name().startsWith("plate")) { + new TC_AspectStack(TC_Aspects.FABRICO, 1).addToAspectList(mAspects); + } else + if (name().startsWith("tool")) { + new TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2).addToAspectList(mAspects); + } else + if (name().startsWith("gem") || name().startsWith("crystal") || name().startsWith("lens")) { + new TC_AspectStack(TC_Aspects.VITREUS, 1).addToAspectList(mAspects); + } else + if (name().startsWith("crate")) { + new TC_AspectStack(TC_Aspects.ITER, 2).addToAspectList(mAspects); + } else + if (name().startsWith("circuit")) { + new TC_AspectStack(TC_Aspects.COGNITO, 1).addToAspectList(mAspects); + } else + if (name().startsWith("computer")) { + new TC_AspectStack(TC_Aspects.COGNITO, 4).addToAspectList(mAspects); + } else + if (name().startsWith("battery")) { + new TC_AspectStack(TC_Aspects.ELECTRUM, 1).addToAspectList(mAspects); + } + } + + public static OrePrefixes getOrePrefix(String aOre) { + for (OrePrefixes tPrefix : values()) if (aOre.startsWith(tPrefix.toString())) { + if (tPrefix == oreNether && aOre.equals("oreNetherQuartz")) return ore; + return tPrefix; + } + return null; + } + + public static String stripPrefix(String aOre) { + for (OrePrefixes tPrefix : values()) { + if (aOre.startsWith(tPrefix.toString())) { + return aOre.replaceFirst(tPrefix.toString(), ""); + } + } + return aOre; + } + + public static String replacePrefix(String aOre, OrePrefixes aPrefix) { + for (OrePrefixes tPrefix : values()) { + if (aOre.startsWith(tPrefix.toString())) { + return aOre.replaceFirst(tPrefix.toString(), aPrefix.toString()); + } + } + return ""; + } + + public static OrePrefixes getPrefix(String aPrefixName) { + return getPrefix(aPrefixName, null); + } + + public static OrePrefixes getPrefix(String aPrefixName, OrePrefixes aReplacement) { + Object tObject = GT_Utility.getFieldContent(OrePrefixes.class, aPrefixName, false, false); + if (tObject != null && tObject instanceof OrePrefixes) return (OrePrefixes)tObject; + return aReplacement; + } + + public Object get(Object aMaterial) { + if (aMaterial instanceof Materials) return new ItemData(this, (Materials)aMaterial); + return name() + aMaterial; + } + + public static Materials getMaterial(String aOre) { + return Materials.get(stripPrefix(aOre)); + } + + public static Materials getMaterial(String aOre, OrePrefixes aPrefix) { + return Materials.get(aOre.replaceFirst(aPrefix.toString(), "")); + } + + public static Materials getRealMaterial(String aOre, OrePrefixes aPrefix) { + return Materials.getRealMaterial(aOre.replaceFirst(aPrefix.toString(), "")); + } + + public static boolean isInstanceOf(String aName, OrePrefixes aPrefix) { + return aName == null ? false : aName.startsWith(aPrefix.toString()); + } + + public static volatile int VERSION = 508; + + @SuppressWarnings("incomplete-switch") + public String getDefaultLocalNameForItem(Materials aMaterial) { + // Certain Materials have slightly different Localizations. + switch (this) { + case crateGtDust: return mLocalizedMaterialPre + OrePrefixes.dust.getDefaultLocalNameForItem(aMaterial); + case crateGtIngot: return mLocalizedMaterialPre + OrePrefixes.ingot.getDefaultLocalNameForItem(aMaterial); + case crateGtGem: return mLocalizedMaterialPre + OrePrefixes.gem.getDefaultLocalNameForItem(aMaterial); + case crateGtPlate: return mLocalizedMaterialPre + OrePrefixes.plate.getDefaultLocalNameForItem(aMaterial); + } + switch (aMaterial) { + case Glass: + if (name().startsWith("gem")) return mLocalizedMaterialPre + aMaterial.mDefaultLocalName + " Crystal"; + if (name().startsWith("plate")) return mLocalizedMaterialPre + aMaterial.mDefaultLocalName + " Pane"; + break; + case InfusedAir: case InfusedDull: case InfusedEarth: case InfusedEntropy: case InfusedFire: case InfusedOrder: case InfusedVis: case InfusedWater: + if (name().startsWith("gem")) return mLocalizedMaterialPre + "Shard of " + aMaterial.mDefaultLocalName; + if (name().startsWith("crystal")) return mLocalizedMaterialPre + "Shard of " + aMaterial.mDefaultLocalName; + if (name().startsWith("plate")) return mLocalizedMaterialPre + aMaterial.mDefaultLocalName + " Crystal Plate"; + if (name().startsWith("dust")) return mLocalizedMaterialPre + aMaterial.mDefaultLocalName + " Crystal Powder"; + if (this == OrePrefixes.crushedCentrifuged) return mLocalizedMaterialPre + aMaterial.mDefaultLocalName + " Crystals"; + if (this == OrePrefixes.crushedPurified) return mLocalizedMaterialPre + aMaterial.mDefaultLocalName + " Crystals"; + if (this == OrePrefixes.crushed) return mLocalizedMaterialPre + aMaterial.mDefaultLocalName + " Crystals"; + break; + case Wheat: + if (name().startsWith("dust")) return mLocalizedMaterialPre + "Flour"; + break; + case Ice: + if (name().startsWith("dust")) return mLocalizedMaterialPre + "Crushed Ice"; + break; + case Wood: case WoodSealed: + if (name().startsWith("bolt")) return "Short " + aMaterial.mDefaultLocalName + " Stick"; + if (name().startsWith("stick")) return mLocalizedMaterialPre + aMaterial.mDefaultLocalName + " Stick"; + if (name().startsWith("dust")) return mLocalizedMaterialPre + aMaterial.mDefaultLocalName + " Pulp"; + if (name().startsWith("nugget")) return mLocalizedMaterialPre + aMaterial.mDefaultLocalName + " Chip"; + if (name().startsWith("plate")) return mLocalizedMaterialPre + aMaterial.mDefaultLocalName + " Plank"; + break; + case Plastic: case Rubber: + if (name().startsWith("dust")) return mLocalizedMaterialPre + aMaterial.mDefaultLocalName + " Pulp"; + if (name().startsWith("plate")) return mLocalizedMaterialPre + aMaterial.mDefaultLocalName + " Sheet"; + if (name().startsWith("ingot")) return mLocalizedMaterialPre + aMaterial.mDefaultLocalName + " Bar"; + if (name().startsWith("nugget")) return mLocalizedMaterialPre + aMaterial.mDefaultLocalName + " Chip"; + if (name().startsWith("foil")) return "Thin " + aMaterial.mDefaultLocalName + " Sheet"; + break; + case FierySteel: + if (mIsContainer) return mLocalizedMaterialPre + "Fiery Blood" + mLocalizedMaterialPost; + break; + case Steeleaf: + if (name().startsWith("ingot")) return mLocalizedMaterialPre + aMaterial.mDefaultLocalName; + break; + case Bone: + if (name().startsWith("dust")) return mLocalizedMaterialPre + "Bone Meal"; + break; + case Blaze: case Milk: case Cocoa: case Chocolate: case Coffee: case Chili: case Cheese: case Snow: + if (name().startsWith("dust")) return mLocalizedMaterialPre + aMaterial.mDefaultLocalName + " Powder"; + break; + case Paper: + if (name().startsWith("dust")) return mLocalizedMaterialPre + "Chad"; + if (this == OrePrefixes.plate) return "Sheet of Paper"; + if (this == OrePrefixes.plateDouble) return "Paperboard"; + if (this == OrePrefixes.plateTriple) return "Carton"; + if (this == OrePrefixes.plateQuadruple) return "Cardboard"; + if (this == OrePrefixes.plateQuintuple) return "Thick Cardboard"; + if (this == OrePrefixes.plateDense) return "Strong Cardboard"; + break; + case MeatRaw: + if (name().startsWith("dust")) return mLocalizedMaterialPre + "Mince Meat"; + break; + case MeatCooked: + if (name().startsWith("dust")) return mLocalizedMaterialPre + "Cooked Mince Meat"; + break; + case Ash: case DarkAsh: case Gunpowder: case Sugar: case Salt: case RockSalt: case VolcanicAsh: case RareEarth: + if (name().startsWith("dust")) return mLocalizedMaterialPre + aMaterial.mDefaultLocalName; + break; + case Vermiculite: case Bentonite: case Kaolinite: case Talc: case BasalticMineralSand: case GraniticMineralSand: case GlauconiteSand: case CassiteriteSand: case GarnetSand: case QuartzSand: case Pitchblende: case FullersEarth: + if (name().startsWith("dust")) return mLocalizedMaterialPre + aMaterial.mDefaultLocalName; + if (this == OrePrefixes.crushedCentrifuged) return mLocalizedMaterialPre + aMaterial.mDefaultLocalName; + if (this == OrePrefixes.crushedPurified) return mLocalizedMaterialPre + aMaterial.mDefaultLocalName; + if (this == OrePrefixes.crushed) return "Ground " + aMaterial.mDefaultLocalName; + break; + } + // Use Standard Localization + return mLocalizedMaterialPre + aMaterial.mDefaultLocalName + mLocalizedMaterialPost; + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/enums/SubTag.java b/src/main/java/gregtech/api/enums/SubTag.java new file mode 100644 index 0000000..12411ee --- /dev/null +++ b/src/main/java/gregtech/api/enums/SubTag.java @@ -0,0 +1,306 @@ +package gregtech.api.enums; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; + +import gregtech.api.interfaces.ICondition; +import gregtech.api.interfaces.ISubTagContainer; + +/** + * Just a simple Class to be able to add special Tags for Materials. + * + * The Tags should be added in preload and before I do my own preload to the Materials. + * In order to make yourself a new SubTag, just create one new instance of SubTag using getNewSubTag + * and use that one instance on all Materials you want to add those Tags to. + * + * You should look at this File whenever you update, maybe there are some new Tags you could use. + * + * ------------------------------------------------------------------------------------------------- + * + * Some SubTags are used for other things than Materials too. It is useful when I need an easy way to declare Stuff in Items. + */ +public final class SubTag implements ICondition { + private static long sSubtagID = 0; + + public static final ArrayList sSubTags = new ArrayList(); + + /** + * Add this to your Material if you want to have its Ore Calcite heated in a Blast Furnace for more output. Already listed are: + * Iron, Pyrite, PigIron, DeepIron, ShadowIron, WroughtIron and MeteoricIron. + */ + public static final SubTag BLASTFURNACE_CALCITE_DOUBLE = getNewSubTag("BLASTFURNACE_CALCITE_DOUBLE"), BLASTFURNACE_CALCITE_TRIPLE = getNewSubTag("BLASTFURNACE_CALCITE_TRIPLE"); + + /** + * Materials which are outputting less in an Induction Smelter. Already listed are: + * Pyrite, Tetrahedrite, Sphalerite, Cinnabar + */ + public static final SubTag INDUCTIONSMELTING_LOW_OUTPUT = getNewSubTag("INDUCTIONSMELTING_LOW_OUTPUT"); + + /** + * Add this to your Material if you want to have its Ore Sodium Persulfate washed. Already listed are: + * Zinc, Nickel, Copper, Cobalt, Cobaltite and Tetrahedrite. + */ + public static final SubTag WASHING_SODIUMPERSULFATE = getNewSubTag("WASHING_SODIUMPERSULFATE"); + + /** + * Add this to your Material if you want to have its Ore Mercury washed. Already listed are: + * Gold, Silver, Osmium, Mithril, Platinum, Midasium, Cooperite and AstralSilver. + */ + public static final SubTag WASHING_MERCURY = getNewSubTag("WASHING_MERCURY"); + + /** + * Add this to your Material if you want to have its Ore electromagnetically separated to give Gold. + */ + public static final SubTag ELECTROMAGNETIC_SEPERATION_GOLD = getNewSubTag("ELECTROMAGNETIC_SEPERATION_GOLD"); + + /** + * Add this to your Material if you want to have its Ore electromagnetically separated to give Iron. + */ + public static final SubTag ELECTROMAGNETIC_SEPERATION_IRON = getNewSubTag("ELECTROMAGNETIC_SEPERATION_IRON"); + + /** + * Add this to your Material if you want to have its Ore electromagnetically separated to give Neodymium. + */ + public static final SubTag ELECTROMAGNETIC_SEPERATION_NEODYMIUM = getNewSubTag("ELECTROMAGNETIC_SEPERATION_NEODYMIUM"); + + /** + * Add this to your Material if you want to have its Ore giving Cinnabar Crystals on Pulverization. Already listed are: + * Redstone + */ + public static final SubTag PULVERIZING_CINNABAR = getNewSubTag("PULVERIZING_CINNABAR"); + + /** + * This Material cannot be worked by any other means, than smashing or smelting. This is used for coated Materials. + */ + public static final SubTag NO_WORKING = getNewSubTag("NO_WORKING"); + + /** + * This Material cannot be used for regular Metal working techniques since it is not possible to bend it. Already listed are: + * Rubber, Plastic, Paper, Wood, Stone + */ + public static final SubTag NO_SMASHING = getNewSubTag("NO_SMASHING"); + + /** + * This Material cannot be unificated + */ + public static final SubTag NO_UNIFICATION = getNewSubTag("NO_UNIFICATION"); + + /** + * This Material cannot be used in any Recycler. Already listed are: + * Stone, Glass, Water + */ + public static final SubTag NO_RECYCLING = getNewSubTag("NO_RECYCLING"); + + /** + * This Material cannot be used in any Furnace alike Structure. Already listed are: + * Paper, Wood, Gunpowder, Stone + */ + public static final SubTag NO_SMELTING = getNewSubTag("NO_SMELTING"); + + /** + * This Material can be molten into a Fluid + */ + public static final SubTag SMELTING_TO_FLUID = getNewSubTag("SMELTING_TO_FLUID"); + + /** + * This Ore should be molten directly into a Gem of this Material, if the Ingot is missing. Already listed are: + * Cinnabar + */ + public static final SubTag SMELTING_TO_GEM = getNewSubTag("SMELTING_TO_GEM"); + + /** + * If this Material is some kind of Wood + */ + public static final SubTag WOOD = getNewSubTag("WOOD"); + + /** + * If this Material is some kind of Food (or edible at all) + */ + public static final SubTag FOOD = getNewSubTag("FOOD"); + + /** + * If this Material is some kind of Stone + */ + public static final SubTag STONE = getNewSubTag("STONE"); + + /** + * If this Material is some kind of Pearl + */ + public static final SubTag PEARL = getNewSubTag("PEARL"); + + /** + * If this Material is some kind of Quartz + */ + public static final SubTag QUARTZ = getNewSubTag("QUARTZ"); + + /** + * If this Material is Crystallisable + */ + public static final SubTag CRYSTALLISABLE = getNewSubTag("CRYSTALLISABLE"); + + /** + * If this Material is some kind of Crystal + */ + public static final SubTag CRYSTAL = getNewSubTag("CRYSTAL"); + + /** + * If this Material is some kind of Magical + */ + public static final SubTag MAGICAL = getNewSubTag("MAGICAL"); + + /** + * If this Material is some kind of Metal + */ + public static final SubTag METAL = getNewSubTag("METAL"); + + /** + * If this Material is some kind of Paper + */ + public static final SubTag PAPER = getNewSubTag("PAPER"); + + /** + * If this Material is having a constantly burning Aura + */ + public static final SubTag BURNING = getNewSubTag("BURNING"); + + /** + * If this Material is some kind of flammable + */ + public static final SubTag FLAMMABLE = getNewSubTag("FLAMMABLE"); + + /** + * If this Material is not burnable at all + */ + public static final SubTag UNBURNABLE = getNewSubTag("UNBURNABLE"); + + /** + * If this Material is some kind of explosive + */ + public static final SubTag EXPLOSIVE = getNewSubTag("EXPLOSIVE"); + + /** + * If this Material is bouncy + */ + public static final SubTag BOUNCY = getNewSubTag("BOUNCY"); + + /** + * If this Material is invisible + */ + public static final SubTag INVISIBLE = getNewSubTag("INVISIBLE"); + + /** + * If this Material is transparent + */ + public static final SubTag TRANSPARENT = getNewSubTag("TRANSPARENT"); + + /** + * If this Material has a Color + */ + public static final SubTag HAS_COLOR = getNewSubTag("HAS_COLOR"); + + /** + * If this Material is stretchable + */ + public static final SubTag STRETCHY = getNewSubTag("STRETCHY"); + + /** + * If this Material is grindable with a simple Mortar + */ + public static final SubTag MORTAR_GRINDABLE = getNewSubTag("MORTAR_GRINDABLE"); + + /** + * If this Material is usable for Soldering + */ + public static final SubTag SOLDERING_MATERIAL = getNewSubTag("SOLDERING_MATERIAL"); + + /** + * If this Material is has extra Costs for Soldering, requires the Tag "SOLDERING_MATERIAL" too + */ + public static final SubTag SOLDERING_MATERIAL_BAD = getNewSubTag("SOLDERING_MATERIAL_BAD"); + + /** + * If this Material is has a discount for Soldering, requires the Tag "SOLDERING_MATERIAL" too + */ + public static final SubTag SOLDERING_MATERIAL_GOOD = getNewSubTag("SOLDERING_MATERIAL_GOOD"); + + /** + * Energy Tag for Electricity + * Primary = Voltage + * Secondary = Amperage + */ + public static final SubTag ENERGY_ELECTRICITY = getNewSubTag("ENERGY_ELECTRICITY"); + + /** + * Energy Tag for Rotating Power + * Primary = Speed + * Secondary = Power + */ + public static final SubTag ENERGY_ROTATIONAL = getNewSubTag("ENERGY_ROTATIONAL"); + + /** + * Energy Tag for Steam Power + * Primary = Steam per Tick + * Secondary = unused (always 1) + */ + public static final SubTag ENERGY_STEAM = getNewSubTag("ENERGY_STEAM"); + + /** + * Energy Tag for Air Pressure Power + * Primary = Pressure + * Secondary = unused (always 1) + */ + public static final SubTag ENERGY_AIR = getNewSubTag("ENERGY_AIR"); + + /** + * Energy Tag for Heat + * Primary = Temperature + * Secondary = unused (always 1) + */ + public static final SubTag ENERGY_HEAT = getNewSubTag("ENERGY_HEAT"); + + /** + * Energy Tag for RedstoneFlux + * Primary = unused (always 1) + * Secondary = RF + */ + public static final SubTag ENERGY_REDSTONE_FLUX = getNewSubTag("ENERGY_REDSTONE_FLUX"); + + /** Projectile Tag for Arrows */ + public static final SubTag PROJECTILE_ARROW = getNewSubTag("PROJECTILE_ARROW"); + + public final long mSubtagID; + public final String mName; + public final Collection mRelevantTaggedItems = new HashSet(1); + + private SubTag(String aName) { + mSubtagID = sSubtagID++; + mName = aName; + sSubTags.add(this); + } + + public static SubTag getNewSubTag(String aName) { + for (SubTag tSubTag : sSubTags) if (tSubTag.mName.equals(aName)) return tSubTag; + return new SubTag(aName); + } + + @Override + public String toString() { + return mName; + } + + public SubTag addContainerToList(ISubTagContainer... aContainers) { + if (aContainers != null) for (ISubTagContainer aContainer : aContainers) if (aContainer != null && !mRelevantTaggedItems.contains(aContainer)) mRelevantTaggedItems.add(aContainer); + return this; + } + + public SubTag addTo(ISubTagContainer... aContainers) { + if (aContainers != null) for (ISubTagContainer aContainer : aContainers) if (aContainer != null) aContainer.add(this); + return this; + } + + @Override + public boolean isTrue(ISubTagContainer aObject) { + return aObject.contains(this); + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/enums/TC_Aspects.java b/src/main/java/gregtech/api/enums/TC_Aspects.java new file mode 100644 index 0000000..d3f74ff --- /dev/null +++ b/src/main/java/gregtech/api/enums/TC_Aspects.java @@ -0,0 +1,102 @@ +package gregtech.api.enums; + +import java.util.List; + +public enum TC_Aspects { + AER + , ALIENIS + , AQUA + , ARBOR + , AURAM + , BESTIA + , COGNITO + , CORPUS + , ELECTRUM + , EXAMINIS + , FABRICO + , FAMES + , GELUM + , GRANUM + , HERBA + , HUMANUS + , IGNIS + , INSTRUMENTUM + , ITER + , LIMUS + , LUCRUM + , LUX + , MACHINA + , MAGNETO + , MESSIS + , METALLUM + , METO + , MORTUUS + , MOTUS + , NEBRISUM + , ORDO + , PANNUS + , PERDITIO + , PERFODIO + , PERMUTATIO + , POTENTIA + , PRAECANTIO + , RADIO + , SANO + , SENSUS + , SPIRITUS + , STRONTIO + , TELUM + , TERRA + , TEMPESTAS + , TENEBRAE + , TUTAMEN + , VACUOS + , VENENUM + , VICTUS + , VINCULUM + , VITIUM + , VITREUS + , VOLATUS + ; + + /** + * The Thaumcraft Aspect Object of the Mod itself. + */ + public Object mAspect; + + public static class TC_AspectStack { + public TC_Aspects mAspect; + public long mAmount; + + public TC_AspectStack(TC_Aspects aAspect, long aAmount) { + mAspect = aAspect; + mAmount = aAmount; + } + + public TC_AspectStack copy() { + return new TC_AspectStack(mAspect, mAmount); + } + + public TC_AspectStack copy(long aAmount) { + return new TC_AspectStack(mAspect, aAmount); + } + + public List addToAspectList(List aList) { + if (mAmount == 0) return aList; + for (TC_AspectStack tAspect : aList) if (tAspect.mAspect == mAspect) {tAspect.mAmount += mAmount; return aList;} + aList.add(copy()); + return aList; + } + + public boolean removeFromAspectList(List aList) { + for (TC_AspectStack tAspect : aList) if (tAspect.mAspect == mAspect) { + if (tAspect.mAmount >= mAmount) { + tAspect.mAmount -= mAmount; + if (tAspect.mAmount == 0) aList.remove(tAspect); + return true; + } + } + return false; + } + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/enums/TextureSet.java b/src/main/java/gregtech/api/enums/TextureSet.java new file mode 100644 index 0000000..4a4bf61 --- /dev/null +++ b/src/main/java/gregtech/api/enums/TextureSet.java @@ -0,0 +1,184 @@ +package gregtech.api.enums; + +import gregtech.api.interfaces.IIconContainer; + +public class TextureSet { + public static final TextureSet + SET_NONE = new TextureSet("NONE") + , SET_DULL = new TextureSet("DULL") + , SET_RUBY = new TextureSet("RUBY") + , SET_OPAL = new TextureSet("OPAL") + , SET_LEAF = new TextureSet("LEAF") + , SET_WOOD = new TextureSet("WOOD") + , SET_SAND = new TextureSet("SAND") + , SET_FINE = new TextureSet("FINE") + , SET_FIERY = new TextureSet("FIERY") + , SET_FLUID = new TextureSet("FLUID") + , SET_ROUGH = new TextureSet("ROUGH") + , SET_PAPER = new TextureSet("PAPER") + , SET_GLASS = new TextureSet("GLASS") + , SET_FLINT = new TextureSet("FLINT") + , SET_LAPIS = new TextureSet("LAPIS") + , SET_SHINY = new TextureSet("SHINY") + , SET_SHARDS = new TextureSet("SHARDS") + , SET_POWDER = new TextureSet("POWDER") + , SET_QUARTZ = new TextureSet("QUARTZ") + , SET_EMERALD = new TextureSet("EMERALD") + , SET_DIAMOND = new TextureSet("DIAMOND") + , SET_LIGNITE = new TextureSet("LIGNITE") + , SET_MAGNETIC = new TextureSet("MAGNETIC") + , SET_METALLIC = new TextureSet("METALLIC") + , SET_NETHERSTAR = new TextureSet("NETHERSTAR") + , SET_GEM_VERTICAL = new TextureSet("GEM_VERTICAL") + , SET_GEM_HORIZONTAL = new TextureSet("GEM_HORIZONTAL") + ; + + /** + * For the Indices of OrePrefixes you need to look into the OrePrefix Enum. + */ + public static final short + INDEX_wire = 69 + , INDEX_foil = 70 + , INDEX_block1 = 71 + , INDEX_block2 = 72 + , INDEX_block3 = 73 + , INDEX_block4 = 74 + , INDEX_block5 = 75 + , INDEX_block6 = 76 + ; + + public final IIconContainer[] mTextures = new IIconContainer[128]; + public final String mSetName; + + public TextureSet(String aSetName) { + mSetName = aSetName; + mTextures[ 0] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/dustTiny"); + mTextures[ 1] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/dustSmall"); + mTextures[ 2] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/dust"); + mTextures[ 3] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/dustImpure"); + mTextures[ 4] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/dustPure"); + mTextures[ 5] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/crushed"); + mTextures[ 6] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/crushedPurified"); + mTextures[ 7] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/crushedCentrifuged"); + mTextures[ 8] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/gem"); + mTextures[ 9] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/nugget"); + mTextures[ 10] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/void"); + mTextures[ 11] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/ingot"); + mTextures[ 12] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/ingotHot"); + mTextures[ 13] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/ingotDouble"); + mTextures[ 14] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/ingotTriple"); + mTextures[ 15] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/ingotQuadruple"); + mTextures[ 16] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/ingotQuintuple"); + mTextures[ 17] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/plate"); + mTextures[ 18] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/plateDouble"); + mTextures[ 19] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/plateTriple"); + mTextures[ 20] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/plateQuadruple"); + mTextures[ 21] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/plateQuintuple"); + mTextures[ 22] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/plateDense"); + mTextures[ 23] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/stick"); + mTextures[ 24] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/lens"); + mTextures[ 25] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/round"); + mTextures[ 26] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/bolt"); + mTextures[ 27] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/screw"); + mTextures[ 28] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/ring"); + mTextures[ 29] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/foil"); + mTextures[ 30] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/cell"); + mTextures[ 31] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/cellPlasma"); + mTextures[ 32] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/toolHeadSword"); + mTextures[ 33] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/toolHeadPickaxe"); + mTextures[ 34] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/toolHeadShovel"); + mTextures[ 35] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/toolHeadAxe"); + mTextures[ 36] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/toolHeadHoe"); + mTextures[ 37] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/toolHeadHammer"); + mTextures[ 38] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/toolHeadFile"); + mTextures[ 39] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/toolHeadSaw"); + mTextures[ 40] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/toolHeadDrill"); + mTextures[ 41] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/toolHeadChainsaw"); + mTextures[ 42] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/toolHeadWrench"); + mTextures[ 43] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/toolHeadUniversalSpade"); + mTextures[ 44] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/toolHeadSense"); + mTextures[ 45] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/toolHeadPlow"); + mTextures[ 46] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/toolHeadArrow"); + mTextures[ 47] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/toolHeadScrewdriver"); + mTextures[ 48] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/toolHeadBuzzSaw"); + mTextures[ 49] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/toolHeadSoldering"); + mTextures[ 50] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/void"); + mTextures[ 51] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/wireFine"); + mTextures[ 52] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/gearGtSmall"); + mTextures[ 53] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/rotor"); + mTextures[ 54] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/stickLong"); + mTextures[ 55] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/springSmall"); + mTextures[ 56] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/spring"); + mTextures[ 57] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/arrowGtWood"); + mTextures[ 58] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/arrowGtPlastic"); + mTextures[ 59] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/gemChipped"); + mTextures[ 60] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/gemFlawed"); + mTextures[ 61] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/gemFlawless"); + mTextures[ 62] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/gemExquisite"); + mTextures[ 63] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/gearGt"); + mTextures[ 64] = new Textures.BlockIcons.CustomIcon("materialicons/"+mSetName+"/void"); + mTextures[ 65] = new Textures.BlockIcons.CustomIcon("materialicons/"+mSetName+"/void"); + mTextures[ 66] = new Textures.BlockIcons.CustomIcon("materialicons/"+mSetName+"/void"); + mTextures[ 67] = new Textures.BlockIcons.CustomIcon("materialicons/"+mSetName+"/oreSmall"); + mTextures[ 68] = new Textures.BlockIcons.CustomIcon("materialicons/"+mSetName+"/ore"); + mTextures[ 69] = new Textures.BlockIcons.CustomIcon("materialicons/"+mSetName+"/wire"); + mTextures[ 70] = new Textures.BlockIcons.CustomIcon("materialicons/"+mSetName+"/foil"); + mTextures[ 71] = new Textures.BlockIcons.CustomIcon("materialicons/"+mSetName+"/block1"); + mTextures[ 72] = new Textures.BlockIcons.CustomIcon("materialicons/"+mSetName+"/block2"); + mTextures[ 73] = new Textures.BlockIcons.CustomIcon("materialicons/"+mSetName+"/block3"); + mTextures[ 74] = new Textures.BlockIcons.CustomIcon("materialicons/"+mSetName+"/block4"); + mTextures[ 75] = new Textures.BlockIcons.CustomIcon("materialicons/"+mSetName+"/block5"); + mTextures[ 76] = new Textures.BlockIcons.CustomIcon("materialicons/"+mSetName+"/block6"); + mTextures[ 77] = new Textures.BlockIcons.CustomIcon("materialicons/"+mSetName+"/pipeSide"); + mTextures[ 78] = new Textures.BlockIcons.CustomIcon("materialicons/"+mSetName+"/pipeTiny"); + mTextures[ 79] = new Textures.BlockIcons.CustomIcon("materialicons/"+mSetName+"/pipeSmall"); + mTextures[ 80] = new Textures.BlockIcons.CustomIcon("materialicons/"+mSetName+"/pipeMedium"); + mTextures[ 81] = new Textures.BlockIcons.CustomIcon("materialicons/"+mSetName+"/pipeLarge"); + mTextures[ 82] = new Textures.BlockIcons.CustomIcon("materialicons/"+mSetName+"/pipeHuge"); + mTextures[ 83] = new Textures.BlockIcons.CustomIcon("materialicons/"+mSetName+"/frameGt"); + mTextures[ 84] = new Textures.BlockIcons.CustomIcon("materialicons/"+mSetName+"/void"); + mTextures[ 85] = new Textures.BlockIcons.CustomIcon("materialicons/"+mSetName+"/void"); + mTextures[ 86] = new Textures.BlockIcons.CustomIcon("materialicons/"+mSetName+"/void"); + mTextures[ 87] = new Textures.BlockIcons.CustomIcon("materialicons/"+mSetName+"/void"); + mTextures[ 88] = new Textures.BlockIcons.CustomIcon("materialicons/"+mSetName+"/void"); + mTextures[ 89] = new Textures.BlockIcons.CustomIcon("materialicons/"+mSetName+"/void"); + mTextures[ 90] = new Textures.BlockIcons.CustomIcon("materialicons/"+mSetName+"/void"); + mTextures[ 91] = new Textures.BlockIcons.CustomIcon("materialicons/"+mSetName+"/void"); + mTextures[ 92] = new Textures.BlockIcons.CustomIcon("materialicons/"+mSetName+"/void"); + mTextures[ 93] = new Textures.BlockIcons.CustomIcon("materialicons/"+mSetName+"/void"); + mTextures[ 94] = new Textures.BlockIcons.CustomIcon("materialicons/"+mSetName+"/void"); + mTextures[ 95] = new Textures.BlockIcons.CustomIcon("materialicons/"+mSetName+"/void"); + mTextures[ 96] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/crateGtDust"); + mTextures[ 97] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/crateGtIngot"); + mTextures[ 98] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/crateGtGem"); + mTextures[ 99] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/crateGtPlate"); + mTextures[100] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/turbineBlade"); + mTextures[101] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/void"); + mTextures[102] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/void"); + mTextures[103] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/void"); + mTextures[104] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/void"); + mTextures[105] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/void"); + mTextures[106] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/void"); + mTextures[107] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/void"); + mTextures[108] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/void"); + mTextures[109] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/void"); + mTextures[110] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/void"); + mTextures[111] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/void"); + mTextures[112] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/void"); + mTextures[113] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/void"); + mTextures[114] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/void"); + mTextures[115] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/void"); + mTextures[116] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/void"); + mTextures[117] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/void"); + mTextures[118] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/void"); + mTextures[119] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/void"); + mTextures[120] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/void"); + mTextures[121] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/void"); + mTextures[122] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/void"); + mTextures[123] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/void"); + mTextures[124] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/void"); + mTextures[125] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/void"); + mTextures[126] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/void"); + mTextures[127] = new Textures.ItemIcons .CustomIcon("materialicons/"+mSetName+"/void"); + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/enums/Textures.java b/src/main/java/gregtech/api/enums/Textures.java new file mode 100644 index 0000000..57fc6b9 --- /dev/null +++ b/src/main/java/gregtech/api/enums/Textures.java @@ -0,0 +1,454 @@ +package gregtech.api.enums; + +import static gregtech.api.enums.GT_Values.RES_PATH_BLOCK; +import static gregtech.api.enums.GT_Values.RES_PATH_ITEM; + +import gregtech.api.GregTech_API; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.interfaces.ITexture; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.objects.GT_SidedTexture; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; + +public class Textures { + public enum BlockIcons implements IIconContainer, Runnable { + VOID // The Empty Texture + , RENDERING_ERROR + , PIPE_RESTRICTOR + , INSULATION_FULL, INSULATION_TINY, INSULATION_SMALL, INSULATION_MEDIUM, INSULATION_LARGE, INSULATION_HUGE + , CFOAM_FRESH, CFOAM_HARDENED + , SOLARPANEL, SOLARPANEL_8V, SOLARPANEL_LV, SOLARPANEL_MV, SOLARPANEL_HV, SOLARPANEL_EV, SOLARPANEL_IV, SOLARPANEL_LuV, SOLARPANEL_ZPM, SOLARPANEL_UV + , VENT_NORMAL, VENT_ADVANCED, COVER_WOOD_PLATE + , ARROW_UP, ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT + , AUTOMATION_FILTER, AUTOMATION_TYPEFILTER, AUTOMATION_CHESTBUFFER, AUTOMATION_SUPERBUFFER, AUTOMATION_REGULATOR + , CONCRETE_LIGHT_STONE, CONCRETE_LIGHT_COBBLE, CONCRETE_LIGHT_COBBLE_MOSSY, CONCRETE_LIGHT_BRICKS, CONCRETE_LIGHT_BRICKS_CRACKED, CONCRETE_LIGHT_BRICKS_MOSSY, CONCRETE_LIGHT_BRICKS_CHISELED, CONCRETE_LIGHT_SMOOTH + , CONCRETE_DARK_STONE, CONCRETE_DARK_COBBLE, CONCRETE_DARK_COBBLE_MOSSY, CONCRETE_DARK_BRICKS, CONCRETE_DARK_BRICKS_CRACKED, CONCRETE_DARK_BRICKS_MOSSY, CONCRETE_DARK_BRICKS_CHISELED, CONCRETE_DARK_SMOOTH + , GRANITE_BLACK_STONE, GRANITE_BLACK_COBBLE, GRANITE_BLACK_COBBLE_MOSSY, GRANITE_BLACK_BRICKS, GRANITE_BLACK_BRICKS_CRACKED, GRANITE_BLACK_BRICKS_MOSSY, GRANITE_BLACK_BRICKS_CHISELED, GRANITE_BLACK_SMOOTH + , GRANITE_RED_STONE, GRANITE_RED_COBBLE, GRANITE_RED_COBBLE_MOSSY, GRANITE_RED_BRICKS, GRANITE_RED_BRICKS_CRACKED, GRANITE_RED_BRICKS_MOSSY, GRANITE_RED_BRICKS_CHISELED, GRANITE_RED_SMOOTH + , MACHINE_BRONZEBRICKS_TOP, MACHINE_BRONZEBRICKS_SIDE, MACHINE_BRONZEBRICKS_BOTTOM + , MACHINE_STEELBRICKS_TOP, MACHINE_STEELBRICKS_SIDE, MACHINE_STEELBRICKS_BOTTOM + , MACHINE_BRONZE_TOP, MACHINE_BRONZE_SIDE, MACHINE_BRONZE_BOTTOM + , MACHINE_STEEL_TOP, MACHINE_STEEL_SIDE, MACHINE_STEEL_BOTTOM + , MACHINE_8V_TOP, MACHINE_8V_SIDE, MACHINE_8V_BOTTOM + , MACHINE_LV_TOP, MACHINE_LV_SIDE, MACHINE_LV_BOTTOM + , MACHINE_MV_TOP, MACHINE_MV_SIDE, MACHINE_MV_BOTTOM + , MACHINE_HV_TOP, MACHINE_HV_SIDE, MACHINE_HV_BOTTOM + , MACHINE_EV_TOP, MACHINE_EV_SIDE, MACHINE_EV_BOTTOM + , MACHINE_IV_TOP, MACHINE_IV_SIDE, MACHINE_IV_BOTTOM + , MACHINE_LuV_TOP, MACHINE_LuV_SIDE, MACHINE_LuV_BOTTOM + , MACHINE_ZPM_TOP, MACHINE_ZPM_SIDE, MACHINE_ZPM_BOTTOM + , MACHINE_UV_TOP, MACHINE_UV_SIDE, MACHINE_UV_BOTTOM + , MACHINE_MAX_TOP, MACHINE_MAX_SIDE, MACHINE_MAX_BOTTOM + , MACHINE_BRONZEPLATEDBRICKS, MACHINE_HEATPROOFCASING, MACHINE_BRONZEBLASTFURNACE, MACHINE_BRONZEBLASTFURNACE_ACTIVE + , MACHINE_CASING_ROBUST_TUNGSTENSTEEL, MACHINE_CASING_CLEAN_STAINLESSSTEEL, MACHINE_CASING_STABLE_TITANIUM, MACHINE_CASING_FIREBOX_TITANIUM, MACHINE_CASING_FUSION_COIL, MACHINE_CASING_FUSION, MACHINE_CASING_FUSION_GLASS, MACHINE_CASING_FUSION_GLASS_YELLOW, MACHINE_CASING_FUSION_2,MACHINE_CASING_MAGIC,MACHINE_CASING_MAGIC_ACTIVE,MACHINE_CASING_MAGIC_FRONT,MACHINE_CASING_MAGIC_FRONT_ACTIVE,MACHINE_CASING_DRAGONEGG + , MACHINE_CASING_SOLID_STEEL, MACHINE_CASING_FROST_PROOF, MACHINE_CASING_PUMP, MACHINE_CASING_MOTOR, MACHINE_CASING_PIPE_BRONZE, MACHINE_CASING_PIPE_STEEL, MACHINE_CASING_PIPE_TITANIUM, MACHINE_CASING_PIPE_TUNGSTENSTEEL, MACHINE_CASING_GEARBOX_BRONZE, MACHINE_CASING_GEARBOX_STEEL, MACHINE_CASING_GEARBOX_TITANIUM, MACHINE_CASING_GEARBOX_TUNGSTENSTEEL, MACHINE_CASING_DATA_DRIVE, MACHINE_CASING_CONTAINMENT_FIELD, MACHINE_CASING_ASSEMBLER, MACHINE_CASING_PROCESSOR + , MACHINE_CASING_STRIPES_A, MACHINE_CASING_STRIPES_B, MACHINE_CASING_RADIOACTIVEHAZARD, MACHINE_CASING_BIOHAZARD, MACHINE_CASING_EXPLOSIONHAZARD, MACHINE_CASING_FIREHAZARD, MACHINE_CASING_ACIDHAZARD, MACHINE_CASING_MAGICHAZARD, MACHINE_CASING_FROSTHAZARD, MACHINE_CASING_NOISEHAZARD, MACHINE_CASING_GRATE, MACHINE_CASING_VENT, MACHINE_CASING_RADIATIONPROOF, MACHINE_CASING_FIREBOX_BRONZE, MACHINE_CASING_FIREBOX_STEEL, MACHINE_CASING_FIREBOX_TUNGSTENSTEEL + , BOILER_SOLAR, BOILER_FRONT, BOILER_FRONT_ACTIVE, BOILER_LAVA_FRONT, BOILER_LAVA_FRONT_ACTIVE + , NAQUADAH_REACTOR_SOLID_BACK, NAQUADAH_REACTOR_SOLID_FRONT, NAQUADAH_REACTOR_SOLID_SIDE, NAQUADAH_REACTOR_SOLID_BOTTOM, NAQUADAH_REACTOR_SOLID_TOP, NAQUADAH_REACTOR_SOLID_BACK_ACTIVE, NAQUADAH_REACTOR_SOLID_FRONT_ACTIVE, NAQUADAH_REACTOR_SOLID_SIDE_ACTIVE, NAQUADAH_REACTOR_SOLID_BOTTOM_ACTIVE, NAQUADAH_REACTOR_SOLID_TOP_ACTIVE + , NAQUADAH_REACTOR_FLUID_BACK, NAQUADAH_REACTOR_FLUID_FRONT, NAQUADAH_REACTOR_FLUID_SIDE, NAQUADAH_REACTOR_FLUID_BOTTOM, NAQUADAH_REACTOR_FLUID_TOP, NAQUADAH_REACTOR_FLUID_BACK_ACTIVE, NAQUADAH_REACTOR_FLUID_FRONT_ACTIVE, NAQUADAH_REACTOR_FLUID_SIDE_ACTIVE, NAQUADAH_REACTOR_FLUID_BOTTOM_ACTIVE, NAQUADAH_REACTOR_FLUID_TOP_ACTIVE + , DIESEL_GENERATOR_BACK, DIESEL_GENERATOR_FRONT, DIESEL_GENERATOR_SIDE, DIESEL_GENERATOR_BOTTOM, DIESEL_GENERATOR_TOP, DIESEL_GENERATOR_BACK_ACTIVE, DIESEL_GENERATOR_FRONT_ACTIVE, DIESEL_GENERATOR_SIDE_ACTIVE, DIESEL_GENERATOR_BOTTOM_ACTIVE, DIESEL_GENERATOR_TOP_ACTIVE + , GAS_TURBINE_BACK, GAS_TURBINE_FRONT, GAS_TURBINE_SIDE, GAS_TURBINE_BOTTOM, GAS_TURBINE_TOP, GAS_TURBINE_BACK_ACTIVE, GAS_TURBINE_FRONT_ACTIVE, GAS_TURBINE_SIDE_ACTIVE, GAS_TURBINE_BOTTOM_ACTIVE, GAS_TURBINE_TOP_ACTIVE + , STEAM_TURBINE_BACK, STEAM_TURBINE_FRONT, STEAM_TURBINE_SIDE, STEAM_TURBINE_BOTTOM, STEAM_TURBINE_TOP, STEAM_TURBINE_BACK_ACTIVE, STEAM_TURBINE_FRONT_ACTIVE, STEAM_TURBINE_SIDE_ACTIVE, STEAM_TURBINE_BOTTOM_ACTIVE, STEAM_TURBINE_TOP_ACTIVE + , MACHINE_COIL_CUPRONICKEL, MACHINE_COIL_KANTHAL, MACHINE_COIL_NICHROME, MACHINE_COIL_SUPERCONDUCTOR + , OVERLAY_LOCKER, OVERLAY_LOCKER_000, OVERLAY_LOCKER_001, OVERLAY_LOCKER_002, OVERLAY_LOCKER_003, OVERLAY_LOCKER_004, OVERLAY_LOCKER_005, OVERLAY_LOCKER_006, OVERLAY_LOCKER_007, OVERLAY_LOCKER_008, OVERLAY_LOCKER_009, OVERLAY_LOCKER_010, OVERLAY_LOCKER_011, OVERLAY_LOCKER_012, OVERLAY_LOCKER_013 + , OVERLAY_LENS, OVERLAY_PIPE, OVERLAY_PIPE_IN, OVERLAY_PIPE_OUT, OVERLAY_MUFFLER, OVERLAY_CONTROLLER, OVERLAY_ACTIVITYDETECTOR, OVERLAY_ENERGYDETECTOR, OVERLAY_FLUIDDETECTOR, OVERLAY_ITEMDETECTOR, OVERLAY_SCREEN, OVERLAY_SHUTTER, OVERLAY_CLOSET, OVERLAY_DUCTTAPE, OVERLAY_MAINTENANCE, OVERLAY_CONVEYOR, OVERLAY_PUMP, OVERLAY_ARM, OVERLAY_DRAIN, OVERLAY_CRAFTING + , OVERLAY_ENERGY_IN, OVERLAY_ENERGY_OUT , OVERLAY_ENERGY_IN_MULTI, OVERLAY_ENERGY_OUT_MULTI + , OVERLAY_FRONT_LARGE_BOILER, OVERLAY_FRONT_LARGE_BOILER_ACTIVE, OVERLAY_FRONT_VACUUM_FREEZER, OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE, OVERLAY_FRONT_MULTI_SMELTER, OVERLAY_FRONT_MULTI_SMELTER_ACTIVE, OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE, OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE, OVERLAY_FRONT_IMPLOSION_COMPRESSOR, OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE + , OVERLAY_TOP_POTIONBREWER , OVERLAY_TOP_REPLICATOR , OVERLAY_TOP_MASSFAB , OVERLAY_TOP_STEAM_HAMMER , OVERLAY_TOP_STEAM_FURNACE , OVERLAY_TOP_STEAM_ALLOY_SMELTER , OVERLAY_TOP_STEAM_MACERATOR , OVERLAY_TOP_STEAM_COMPRESSOR , OVERLAY_TOP_STEAM_EXTRACTOR , OVERLAY_TOP_DISASSEMBLER , OVERLAY_TOP_BOXINATOR , OVERLAY_TOP_ROCK_BREAKER , OVERLAY_TOP_SCANNER + , OVERLAY_FRONT_POTIONBREWER , OVERLAY_FRONT_REPLICATOR , OVERLAY_FRONT_MASSFAB , OVERLAY_FRONT_STEAM_HAMMER , OVERLAY_FRONT_STEAM_FURNACE , OVERLAY_FRONT_STEAM_ALLOY_SMELTER , OVERLAY_FRONT_STEAM_MACERATOR , OVERLAY_FRONT_STEAM_COMPRESSOR , OVERLAY_FRONT_STEAM_EXTRACTOR , OVERLAY_FRONT_DISASSEMBLER , OVERLAY_FRONT_BOXINATOR , OVERLAY_FRONT_ROCK_BREAKER , OVERLAY_FRONT_SCANNER + , OVERLAY_BOTTOM_POTIONBREWER , OVERLAY_BOTTOM_REPLICATOR , OVERLAY_BOTTOM_MASSFAB , OVERLAY_BOTTOM_STEAM_HAMMER , OVERLAY_BOTTOM_STEAM_FURNACE , OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER , OVERLAY_BOTTOM_STEAM_MACERATOR , OVERLAY_BOTTOM_STEAM_COMPRESSOR , OVERLAY_BOTTOM_STEAM_EXTRACTOR , OVERLAY_BOTTOM_DISASSEMBLER , OVERLAY_BOTTOM_BOXINATOR , OVERLAY_BOTTOM_ROCK_BREAKER , OVERLAY_BOTTOM_SCANNER + , OVERLAY_SIDE_POTIONBREWER , OVERLAY_SIDE_REPLICATOR , OVERLAY_SIDE_MASSFAB , OVERLAY_SIDE_STEAM_HAMMER , OVERLAY_SIDE_STEAM_FURNACE , OVERLAY_SIDE_STEAM_ALLOY_SMELTER , OVERLAY_SIDE_STEAM_MACERATOR , OVERLAY_SIDE_STEAM_COMPRESSOR , OVERLAY_SIDE_STEAM_EXTRACTOR , OVERLAY_SIDE_DISASSEMBLER , OVERLAY_SIDE_BOXINATOR , OVERLAY_SIDE_ROCK_BREAKER , OVERLAY_SIDE_SCANNER + , OVERLAY_TOP_POTIONBREWER_ACTIVE, OVERLAY_TOP_REPLICATOR_ACTIVE, OVERLAY_TOP_MASSFAB_ACTIVE, OVERLAY_TOP_STEAM_HAMMER_ACTIVE, OVERLAY_TOP_STEAM_FURNACE_ACTIVE, OVERLAY_TOP_STEAM_ALLOY_SMELTER_ACTIVE, OVERLAY_TOP_STEAM_MACERATOR_ACTIVE, OVERLAY_TOP_STEAM_COMPRESSOR_ACTIVE, OVERLAY_TOP_STEAM_EXTRACTOR_ACTIVE, OVERLAY_TOP_DISASSEMBLER_ACTIVE, OVERLAY_TOP_BOXINATOR_ACTIVE, OVERLAY_TOP_ROCK_BREAKER_ACTIVE, OVERLAY_TOP_SCANNER_ACTIVE + , OVERLAY_FRONT_POTIONBREWER_ACTIVE, OVERLAY_FRONT_REPLICATOR_ACTIVE, OVERLAY_FRONT_MASSFAB_ACTIVE, OVERLAY_FRONT_STEAM_HAMMER_ACTIVE, OVERLAY_FRONT_STEAM_FURNACE_ACTIVE, OVERLAY_FRONT_STEAM_ALLOY_SMELTER_ACTIVE, OVERLAY_FRONT_STEAM_MACERATOR_ACTIVE, OVERLAY_FRONT_STEAM_COMPRESSOR_ACTIVE, OVERLAY_FRONT_STEAM_EXTRACTOR_ACTIVE, OVERLAY_FRONT_DISASSEMBLER_ACTIVE, OVERLAY_FRONT_BOXINATOR_ACTIVE, OVERLAY_FRONT_ROCK_BREAKER_ACTIVE, OVERLAY_FRONT_SCANNER_ACTIVE + , OVERLAY_BOTTOM_POTIONBREWER_ACTIVE, OVERLAY_BOTTOM_REPLICATOR_ACTIVE, OVERLAY_BOTTOM_MASSFAB_ACTIVE, OVERLAY_BOTTOM_STEAM_HAMMER_ACTIVE, OVERLAY_BOTTOM_STEAM_FURNACE_ACTIVE, OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER_ACTIVE, OVERLAY_BOTTOM_STEAM_MACERATOR_ACTIVE, OVERLAY_BOTTOM_STEAM_COMPRESSOR_ACTIVE, OVERLAY_BOTTOM_STEAM_EXTRACTOR_ACTIVE, OVERLAY_BOTTOM_DISASSEMBLER_ACTIVE, OVERLAY_BOTTOM_BOXINATOR_ACTIVE, OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE, OVERLAY_BOTTOM_SCANNER_ACTIVE + , OVERLAY_SIDE_POTIONBREWER_ACTIVE, OVERLAY_SIDE_REPLICATOR_ACTIVE, OVERLAY_SIDE_MASSFAB_ACTIVE, OVERLAY_SIDE_STEAM_HAMMER_ACTIVE, OVERLAY_SIDE_STEAM_FURNACE_ACTIVE, OVERLAY_SIDE_STEAM_ALLOY_SMELTER_ACTIVE, OVERLAY_SIDE_STEAM_MACERATOR_ACTIVE, OVERLAY_SIDE_STEAM_COMPRESSOR_ACTIVE, OVERLAY_SIDE_STEAM_EXTRACTOR_ACTIVE, OVERLAY_SIDE_DISASSEMBLER_ACTIVE, OVERLAY_SIDE_BOXINATOR_ACTIVE, OVERLAY_SIDE_ROCK_BREAKER_ACTIVE, OVERLAY_SIDE_SCANNER_ACTIVE, OVERLAY_ADV_PUMP, OVERLAY_TELEPORTER,OVERLAY_TELEPORTER_ACTIVE + ,FUSIONI_1,FUSIONI_2,FUSIONI_3,FUSIONI_4,FUSIONI_5,FUSIONI_6,FUSIONI_7,FUSIONI_8,FUSIONI_9,FUSIONI_10,FUSIONI_11,FUSIONI_12,FUSIONII_1,FUSIONII_2,FUSIONII_3,FUSIONII_4,FUSIONII_5,FUSIONII_6,FUSIONII_7,FUSIONII_8,FUSIONII_9,FUSIONII_10,FUSIONII_11,FUSIONII_12 + ,LARGETURBINE1,LARGETURBINE2,LARGETURBINE3,LARGETURBINE4,LARGETURBINE5,LARGETURBINE6,LARGETURBINE7,LARGETURBINE8,LARGETURBINE9,LARGETURBINE_ACTIVE1,LARGETURBINE_ACTIVE2,LARGETURBINE_ACTIVE3,LARGETURBINE_ACTIVE4,LARGETURBINE_ACTIVE5,LARGETURBINE_ACTIVE6,LARGETURBINE_ACTIVE7,LARGETURBINE_ACTIVE8,LARGETURBINE_ACTIVE9, MACHINE_CASING_TURBINE + + ; + + protected IIcon mIcon; + + @Override public IIcon getIcon() {return mIcon;} + @Override public IIcon getOverlayIcon() {return null;} + + private BlockIcons() { + GregTech_API.sGTBlockIconload.add(this); + } + + @Override + public void run() { + mIcon = GregTech_API.sBlockIcons.registerIcon(RES_PATH_BLOCK + "iconsets/" + this); + } + + @Override + public ResourceLocation getTextureFile() { + return TextureMap.locationBlocksTexture; + } + + /** + * Icon for Fresh CFoam + */ + public static final ITexture[] FRESHFOAM = new ITexture[] {new GT_RenderedTexture(CFOAM_FRESH)}; + + /** + * Icons for Hardened CFoam + * 0 = No Color + * 1 - 16 = Colors + */ + public static final ITexture[][] HARDENEDFOAMS = new ITexture[][] { + new ITexture[] {new GT_RenderedTexture(CFOAM_HARDENED, Dyes.CONSTRUCTION_FOAM.mRGBa)}, + new ITexture[] {new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[ 0].mRGBa)}, + new ITexture[] {new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[ 1].mRGBa)}, + new ITexture[] {new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[ 2].mRGBa)}, + new ITexture[] {new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[ 3].mRGBa)}, + new ITexture[] {new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[ 4].mRGBa)}, + new ITexture[] {new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[ 5].mRGBa)}, + new ITexture[] {new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[ 6].mRGBa)}, + new ITexture[] {new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[ 7].mRGBa)}, + new ITexture[] {new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[ 8].mRGBa)}, + new ITexture[] {new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[ 9].mRGBa)}, + new ITexture[] {new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[10].mRGBa)}, + new ITexture[] {new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[11].mRGBa)}, + new ITexture[] {new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[12].mRGBa)}, + new ITexture[] {new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[13].mRGBa)}, + new ITexture[] {new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[14].mRGBa)}, + new ITexture[] {new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[15].mRGBa)} + }; + + /** + * Machine Casings by Tier + * 0 = 8V, 1 = LV, 2 = MV, 3 = HV, 4 = EV, 5 = IV, 6 = IV, 7 = IV, 8 = IV, 9 = IV + */ + public static final IIconContainer[] + MACHINECASINGS_SIDE = new IIconContainer[] { + MACHINE_8V_SIDE, + MACHINE_LV_SIDE, + MACHINE_MV_SIDE, + MACHINE_HV_SIDE, + MACHINE_EV_SIDE, + MACHINE_IV_SIDE, + MACHINE_LuV_SIDE, + MACHINE_ZPM_SIDE, + MACHINE_UV_SIDE, + MACHINE_MAX_SIDE, + MACHINE_MAX_SIDE, + MACHINE_MAX_SIDE, + MACHINE_MAX_SIDE, + MACHINE_MAX_SIDE, + MACHINE_MAX_SIDE, + MACHINE_MAX_SIDE, + }, + MACHINECASINGS_TOP = new IIconContainer[] { + MACHINE_8V_TOP, + MACHINE_LV_TOP, + MACHINE_MV_TOP, + MACHINE_HV_TOP, + MACHINE_EV_TOP, + MACHINE_IV_TOP, + MACHINE_LuV_TOP, + MACHINE_ZPM_TOP, + MACHINE_UV_TOP, + MACHINE_MAX_TOP, + MACHINE_MAX_TOP, + MACHINE_MAX_TOP, + MACHINE_MAX_TOP, + MACHINE_MAX_TOP, + MACHINE_MAX_TOP, + MACHINE_MAX_TOP, + }, + MACHINECASINGS_BOTTOM = new IIconContainer[] { + MACHINE_8V_BOTTOM, + MACHINE_LV_BOTTOM, + MACHINE_MV_BOTTOM, + MACHINE_HV_BOTTOM, + MACHINE_EV_BOTTOM, + MACHINE_IV_BOTTOM, + MACHINE_LuV_BOTTOM, + MACHINE_ZPM_BOTTOM, + MACHINE_UV_BOTTOM, + MACHINE_MAX_BOTTOM, + MACHINE_MAX_BOTTOM, + MACHINE_MAX_BOTTOM, + MACHINE_MAX_BOTTOM, + MACHINE_MAX_BOTTOM, + MACHINE_MAX_BOTTOM, + MACHINE_MAX_BOTTOM, + }, + GRANITES = new IIconContainer[] { + GRANITE_BLACK_STONE, + GRANITE_BLACK_COBBLE, + GRANITE_BLACK_COBBLE_MOSSY, + GRANITE_BLACK_BRICKS, + GRANITE_BLACK_BRICKS_CRACKED, + GRANITE_BLACK_BRICKS_MOSSY, + GRANITE_BLACK_BRICKS_CHISELED, + GRANITE_BLACK_SMOOTH, + GRANITE_RED_STONE, + GRANITE_RED_COBBLE, + GRANITE_RED_COBBLE_MOSSY, + GRANITE_RED_BRICKS, + GRANITE_RED_BRICKS_CRACKED, + GRANITE_RED_BRICKS_MOSSY, + GRANITE_RED_BRICKS_CHISELED, + GRANITE_RED_SMOOTH, + }, + CONCRETES = new IIconContainer[] { + CONCRETE_DARK_STONE, + CONCRETE_DARK_COBBLE, + CONCRETE_DARK_COBBLE_MOSSY, + CONCRETE_DARK_BRICKS, + CONCRETE_DARK_BRICKS_CRACKED, + CONCRETE_DARK_BRICKS_MOSSY, + CONCRETE_DARK_BRICKS_CHISELED, + CONCRETE_DARK_SMOOTH, + CONCRETE_LIGHT_STONE, + CONCRETE_LIGHT_COBBLE, + CONCRETE_LIGHT_COBBLE_MOSSY, + CONCRETE_LIGHT_BRICKS, + CONCRETE_LIGHT_BRICKS_CRACKED, + CONCRETE_LIGHT_BRICKS_MOSSY, + CONCRETE_LIGHT_BRICKS_CHISELED, + CONCRETE_LIGHT_SMOOTH, + }, + TURBINE = new IIconContainer[] { + LARGETURBINE1, + LARGETURBINE2, + LARGETURBINE3, + LARGETURBINE4, + LARGETURBINE5, + LARGETURBINE6, + LARGETURBINE7, + LARGETURBINE8, + LARGETURBINE9 + }, + TURBINE_ACTIVE = new IIconContainer[] { + LARGETURBINE_ACTIVE1, + LARGETURBINE_ACTIVE2, + LARGETURBINE_ACTIVE3, + LARGETURBINE_ACTIVE4, + LARGETURBINE_ACTIVE5, + LARGETURBINE_ACTIVE6, + LARGETURBINE_ACTIVE7, + LARGETURBINE_ACTIVE8, + LARGETURBINE_ACTIVE9 + }, + CONNECTED_HULLS = new IIconContainer[] { + CONCRETE_DARK_STONE, + FUSIONI_1, + FUSIONI_2, + FUSIONI_3, + FUSIONI_4, + FUSIONI_5, + FUSIONI_6, + FUSIONI_7, + FUSIONI_8, + FUSIONI_9, + FUSIONI_10, + FUSIONI_11, + FUSIONI_12, + FUSIONII_1, + FUSIONII_2, + FUSIONII_3, + FUSIONII_4, + FUSIONII_5, + FUSIONII_6, + FUSIONII_7, + FUSIONII_8, + FUSIONII_9, + FUSIONII_10, + FUSIONII_11, + FUSIONII_12, + }; + + + + public static ITexture[] + ERROR_RENDERING = new ITexture[] { + new GT_RenderedTexture(RENDERING_ERROR) + }, + OVERLAYS_ENERGY_IN = new ITexture[] { + new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[] {220, 220, 220, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[] {220, 220, 220, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[] {255, 100, 0, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[] {255, 255, 30, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[] {128, 128, 128, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[] {240, 240, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[] {240, 240, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[] {240, 240, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[] {240, 240, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[] {240, 240, 245, 0}), + }, + OVERLAYS_ENERGY_OUT = new ITexture[] { + new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[] {220, 220, 220, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[] {220, 220, 220, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[] {255, 100, 0, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[] {255, 255, 30, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[] {128, 128, 128, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[] {240, 240, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[] {240, 240, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[] {240, 240, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[] {240, 240, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[] {240, 240, 245, 0}), + }, + OVERLAYS_ENERGY_IN_MULTI = new ITexture[] { + new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[] {220, 220, 220, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[] {220, 220, 220, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[] {255, 100, 0, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[] {255, 255, 30, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[] {128, 128, 128, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[] {240, 240, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[] {240, 240, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[] {240, 240, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[] {240, 240, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[] {240, 240, 245, 0}), + }, + OVERLAYS_ENERGY_OUT_MULTI = new ITexture[] { + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[] {220, 220, 220, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[] {220, 220, 220, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[] {255, 100, 0, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[] {255, 255, 30, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[] {128, 128, 128, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[] {240, 240, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[] {240, 240, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[] {240, 240, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[] {240, 240, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[] {240, 240, 245, 0}), + }, + LOCKERS = new ITexture[] { + new GT_RenderedTexture(OVERLAY_LOCKER_000), + new GT_RenderedTexture(OVERLAY_LOCKER_001), + new GT_RenderedTexture(OVERLAY_LOCKER_002), + new GT_RenderedTexture(OVERLAY_LOCKER_003), + new GT_RenderedTexture(OVERLAY_LOCKER_004), + new GT_RenderedTexture(OVERLAY_LOCKER_005), + new GT_RenderedTexture(OVERLAY_LOCKER_006), + new GT_RenderedTexture(OVERLAY_LOCKER_007), + new GT_RenderedTexture(OVERLAY_LOCKER_008), + new GT_RenderedTexture(OVERLAY_LOCKER_009), + new GT_RenderedTexture(OVERLAY_LOCKER_010), + new GT_RenderedTexture(OVERLAY_LOCKER_011), + new GT_RenderedTexture(OVERLAY_LOCKER_012), + new GT_RenderedTexture(OVERLAY_LOCKER_013), + }, + CASING_BLOCKS = new ITexture[128], + MACHINE_CASINGS[] = new ITexture[10][17]; + + static { + for (byte i = 0; i < MACHINE_CASINGS.length; i++) for (byte j = 0; j < MACHINE_CASINGS[i].length; j++) MACHINE_CASINGS[i][j] = new GT_SidedTexture(MACHINECASINGS_BOTTOM[i], MACHINECASINGS_TOP[i], MACHINECASINGS_SIDE[i], Dyes.getModulation(j-1, Dyes.MACHINE_METAL.mRGBa)); + } + + public static class CustomIcon implements IIconContainer, Runnable { + protected IIcon mIcon; + protected String mIconName; + + @Override public IIcon getIcon() {return mIcon;} + @Override public IIcon getOverlayIcon() {return null;} + + public CustomIcon(String aIconName) { + mIconName = aIconName; + GregTech_API.sGTBlockIconload.add(this); + } + + @Override + public void run() { + mIcon = GregTech_API.sBlockIcons.registerIcon(RES_PATH_BLOCK + mIconName); + } + + @Override + public ResourceLocation getTextureFile() { + return TextureMap.locationBlocksTexture; + } + } + } + + public enum ItemIcons implements IIconContainer, Runnable { + VOID // The Empty Texture + , RENDERING_ERROR + , WRENCH + , MORTAR + , CROWBAR + , JACKHAMMER + , WIRE_CUTTER + , KNIFE, BUTCHERYKNIFE, SICKLE + , SCOOP, GRAFTER + , PLUNGER, ROLLING_PIN + , HANDLE_SWORD, HANDLE_FILE, HANDLE_SAW, HANDLE_SCREWDRIVER, HANDLE_BUZZSAW, HANDLE_ELECTRIC_SCREWDRIVER, HANDLE_SOLDERING + , POWER_UNIT_LV, POWER_UNIT_MV, POWER_UNIT_HV + , DURABILITY_BAR_0, DURABILITY_BAR_1, DURABILITY_BAR_2, DURABILITY_BAR_3, DURABILITY_BAR_4, DURABILITY_BAR_5, DURABILITY_BAR_6, DURABILITY_BAR_7, DURABILITY_BAR_8 + , ENERGY_BAR_0, ENERGY_BAR_1, ENERGY_BAR_2, ENERGY_BAR_3, ENERGY_BAR_4, ENERGY_BAR_5, ENERGY_BAR_6, ENERGY_BAR_7, ENERGY_BAR_8, TURBINE + ; + + public static final IIconContainer[] + DURABILITY_BAR = new IIconContainer[] { + DURABILITY_BAR_0, + DURABILITY_BAR_1, + DURABILITY_BAR_2, + DURABILITY_BAR_3, + DURABILITY_BAR_4, + DURABILITY_BAR_5, + DURABILITY_BAR_6, + DURABILITY_BAR_7, + DURABILITY_BAR_8, + }, + ENERGY_BAR = new IIconContainer[] { + ENERGY_BAR_0, + ENERGY_BAR_1, + ENERGY_BAR_2, + ENERGY_BAR_3, + ENERGY_BAR_4, + ENERGY_BAR_5, + ENERGY_BAR_6, + ENERGY_BAR_7, + ENERGY_BAR_8, + }; + + public static final ITexture[] ERROR_RENDERING = new ITexture[] {new GT_RenderedTexture(RENDERING_ERROR)}; + + protected IIcon mIcon, mOverlay; + + @Override public IIcon getIcon() {return mIcon;} + @Override public IIcon getOverlayIcon() {return mOverlay;} + + private ItemIcons() { + GregTech_API.sGTItemIconload.add(this); + } + + @Override + public ResourceLocation getTextureFile() { + return TextureMap.locationItemsTexture; + } + + @Override + public void run() { + mIcon = GregTech_API.sItemIcons.registerIcon(RES_PATH_ITEM + "iconsets/" + this); + mOverlay = GregTech_API.sItemIcons.registerIcon(RES_PATH_ITEM + "iconsets/" + this + "_OVERLAY"); + } + + public static class CustomIcon implements IIconContainer, Runnable { + protected IIcon mIcon, mOverlay; + protected String mIconName; + + @Override public IIcon getIcon() {return mIcon;} + @Override public IIcon getOverlayIcon() {return mOverlay;} + + public CustomIcon(String aIconName) { + mIconName = aIconName; + GregTech_API.sGTItemIconload.add(this); + } + + @Override + public void run() { + mIcon = GregTech_API.sItemIcons.registerIcon(RES_PATH_ITEM + mIconName); + mOverlay = GregTech_API.sItemIcons.registerIcon(RES_PATH_ITEM + mIconName + "_OVERLAY"); + } + + @Override + public ResourceLocation getTextureFile() { + return TextureMap.locationItemsTexture; + } + } + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/enums/Tier.java b/src/main/java/gregtech/api/enums/Tier.java new file mode 100644 index 0000000..8ee2bc6 --- /dev/null +++ b/src/main/java/gregtech/api/enums/Tier.java @@ -0,0 +1,91 @@ +package gregtech.api.enums; + +/** + * Experimental Class for later + */ +public class Tier { + public static final Tier[] + ELECTRIC = new Tier[] { + new Tier(SubTag.ENERGY_ELECTRICITY , 0, 8, 1, 1, 1, Materials.WroughtIron , ItemList.Hull_ULV , OrePrefixes.cableGt01 .get(Materials.Lead ), OrePrefixes.cableGt04 .get(Materials.Lead ), OrePrefixes.circuit .get(Materials.Primitive ), OrePrefixes.circuit .get(Materials.Basic )), + new Tier(SubTag.ENERGY_ELECTRICITY , 1, 32, 1, 1, 1, Materials.Steel , ItemList.Hull_LV , OrePrefixes.cableGt01 .get(Materials.Tin ), OrePrefixes.cableGt04 .get(Materials.Tin ), OrePrefixes.circuit .get(Materials.Basic ), OrePrefixes.circuit .get(Materials.Good )), + new Tier(SubTag.ENERGY_ELECTRICITY , 2, 128, 1, 1, 1, Materials.Aluminium , ItemList.Hull_MV , OrePrefixes.cableGt01 .get(Materials.AnyCopper ), OrePrefixes.cableGt04 .get(Materials.AnyCopper ), OrePrefixes.circuit .get(Materials.Good ), OrePrefixes.circuit .get(Materials.Advanced )), + new Tier(SubTag.ENERGY_ELECTRICITY , 3, 512, 1, 1, 1, Materials.StainlessSteel , ItemList.Hull_HV , OrePrefixes.cableGt01 .get(Materials.Gold ), OrePrefixes.cableGt04 .get(Materials.Gold ), OrePrefixes.circuit .get(Materials.Advanced ), OrePrefixes.circuit .get(Materials.Elite )), + new Tier(SubTag.ENERGY_ELECTRICITY , 4, 2048, 1, 1, 1, Materials.Titanium , ItemList.Hull_EV , OrePrefixes.cableGt01 .get(Materials.Aluminium ), OrePrefixes.cableGt04 .get(Materials.Aluminium ), OrePrefixes.circuit .get(Materials.Elite ), OrePrefixes.circuit .get(Materials.Master )), + new Tier(SubTag.ENERGY_ELECTRICITY , 5, 8192, 1, 1, 1, Materials.TungstenSteel , ItemList.Hull_IV , OrePrefixes.cableGt01 .get(Materials.Tungsten ), OrePrefixes.cableGt04 .get(Materials.Tungsten ), OrePrefixes.circuit .get(Materials.Master ), OrePrefixes.circuit .get(Materials.Ultimate )), + new Tier(SubTag.ENERGY_ELECTRICITY , 6, 32768, 1, 1, 1, Materials.Chrome , ItemList.Hull_LuV , OrePrefixes.cableGt01 .get(Materials.Osmium ), OrePrefixes.cableGt04 .get(Materials.Osmium ), OrePrefixes.circuit .get(Materials.Ultimate ), OrePrefixes.circuit .get(Materials.Ultimate )), + new Tier(SubTag.ENERGY_ELECTRICITY , 7, 131072, 1, 1, 1, Materials.Iridium , ItemList.Hull_ZPM , OrePrefixes.cableGt04 .get(Materials.Osmium ), OrePrefixes.wireGt16 .get(Materials.Osmium ), OrePrefixes.circuit .get(Materials.Ultimate ), OrePrefixes.circuit .get(Materials.Ultimate )), + new Tier(SubTag.ENERGY_ELECTRICITY , 8, 524288, 1, 1, 1, Materials.Osmium , ItemList.Hull_UV , OrePrefixes.wireGt16 .get(Materials.Osmium ), OrePrefixes.wireGt01 .get(Materials.Superconductor ), OrePrefixes.circuit .get(Materials.Ultimate ), OrePrefixes.circuit .get(Materials.Ultimate )), + new Tier(SubTag.ENERGY_ELECTRICITY , 9, Integer.MAX_VALUE, 1, 1, 1, Materials.Neutronium , ItemList.Hull_MAX , OrePrefixes.wireGt01 .get(Materials.Superconductor ), OrePrefixes.wireGt04 .get(Materials.Superconductor ), OrePrefixes.circuit .get(Materials.Ultimate ), OrePrefixes.circuit .get(Materials.Ultimate )), + }, ROTATIONAL = new Tier[] { + new Tier(SubTag.ENERGY_ROTATIONAL , 1, 32, 1, 1, 1, Materials.Wood , OrePrefixes.frameGt .get(Materials.Wood ), OrePrefixes.stick .get(Materials.Wood ), OrePrefixes.ingot .get(Materials.Wood ), OrePrefixes.gearGt .get(Materials.Wood ), OrePrefixes.gearGt .get(Materials.Stone )), + new Tier(SubTag.ENERGY_ROTATIONAL , 1, 32, 1, 2, 2, Materials.WoodSealed , OrePrefixes.frameGt .get(Materials.WoodSealed ), OrePrefixes.stick .get(Materials.WoodSealed ), OrePrefixes.ingot .get(Materials.WoodSealed ), OrePrefixes.gearGt .get(Materials.WoodSealed ), OrePrefixes.gearGt .get(Materials.Stone )), + new Tier(SubTag.ENERGY_ROTATIONAL , 2, 128, 1, 1, 1, Materials.Stone , OrePrefixes.frameGt .get(Materials.Stone ), OrePrefixes.stick .get(Materials.Stone ), OrePrefixes.ingot .get(Materials.Stone ), OrePrefixes.gearGt .get(Materials.Stone ), OrePrefixes.gearGt .get(Materials.Bronze )), + new Tier(SubTag.ENERGY_ROTATIONAL , 2, 128, 1, 2, 2, Materials.IronWood , OrePrefixes.frameGt .get(Materials.IronWood ), OrePrefixes.stick .get(Materials.IronWood ), OrePrefixes.ingot .get(Materials.IronWood ), OrePrefixes.gearGt .get(Materials.IronWood ), OrePrefixes.gearGt .get(Materials.Bronze )), + new Tier(SubTag.ENERGY_ROTATIONAL , 3, 512, 1, 1, 1, Materials.Bronze , OrePrefixes.frameGt .get(Materials.Bronze ), OrePrefixes.stick .get(Materials.Bronze ), OrePrefixes.ingot .get(Materials.Bronze ), OrePrefixes.gearGt .get(Materials.Bronze ), OrePrefixes.gearGt .get(Materials.Steel )), + new Tier(SubTag.ENERGY_ROTATIONAL , 3, 512, 1, 2, 2, Materials.Brass , OrePrefixes.frameGt .get(Materials.Brass ), OrePrefixes.stick .get(Materials.Brass ), OrePrefixes.ingot .get(Materials.Brass ), OrePrefixes.gearGt .get(Materials.Brass ), OrePrefixes.gearGt .get(Materials.Steel )), + new Tier(SubTag.ENERGY_ROTATIONAL , 4, 2048, 1, 1, 1, Materials.Steel , OrePrefixes.frameGt .get(Materials.Steel ), OrePrefixes.stick .get(Materials.Steel ), OrePrefixes.ingot .get(Materials.Steel ), OrePrefixes.gearGt .get(Materials.Steel ), OrePrefixes.gearGt .get(Materials.TungstenSteel )), + new Tier(SubTag.ENERGY_ROTATIONAL , 4, 2048, 1, 2, 2, Materials.Titanium , OrePrefixes.frameGt .get(Materials.Titanium ), OrePrefixes.stick .get(Materials.Titanium ), OrePrefixes.ingot .get(Materials.Titanium ), OrePrefixes.gearGt .get(Materials.Titanium ), OrePrefixes.gearGt .get(Materials.TungstenSteel )), + new Tier(SubTag.ENERGY_ROTATIONAL , 5, 8192, 1, 1, 1, Materials.TungstenSteel , OrePrefixes.frameGt .get(Materials.TungstenSteel ), OrePrefixes.stick .get(Materials.TungstenSteel ), OrePrefixes.ingot .get(Materials.TungstenSteel ), OrePrefixes.gearGt .get(Materials.TungstenSteel ), OrePrefixes.gearGt .get(Materials.Iridium )), + new Tier(SubTag.ENERGY_ROTATIONAL , 6, 32768, 1, 1, 1, Materials.Iridium , OrePrefixes.frameGt .get(Materials.Iridium ), OrePrefixes.stick .get(Materials.Iridium ), OrePrefixes.ingot .get(Materials.Iridium ), OrePrefixes.gearGt .get(Materials.Iridium ), OrePrefixes.gearGt .get(Materials.Neutronium )), + new Tier(SubTag.ENERGY_ROTATIONAL , 9, Integer.MAX_VALUE, 1, 1, 1, Materials.Neutronium , OrePrefixes.frameGt .get(Materials.Neutronium ), OrePrefixes.stick .get(Materials.Neutronium ), OrePrefixes.ingot .get(Materials.Neutronium ), OrePrefixes.gearGt .get(Materials.Neutronium ), OrePrefixes.gearGt .get(Materials.Neutronium )), + }, STEAM = new Tier[] { + new Tier(SubTag.ENERGY_STEAM , 1, 32, 1, 1, 1, Materials.Bronze , OrePrefixes.frameGt .get(Materials.Bronze ), OrePrefixes.pipeMedium .get(Materials.Bronze ), OrePrefixes.pipeHuge .get(Materials.Bronze ), OrePrefixes.pipeMedium .get(Materials.Bronze ), OrePrefixes.pipeLarge .get(Materials.Bronze )), + new Tier(SubTag.ENERGY_STEAM , 2, 128, 1, 1, 1, Materials.Steel , OrePrefixes.frameGt .get(Materials.Steel ), OrePrefixes.pipeMedium .get(Materials.Steel ), OrePrefixes.pipeHuge .get(Materials.Steel ), OrePrefixes.pipeMedium .get(Materials.Steel ), OrePrefixes.pipeLarge .get(Materials.Steel )), + new Tier(SubTag.ENERGY_STEAM , 3, 512, 1, 1, 1, Materials.Titanium , OrePrefixes.frameGt .get(Materials.Titanium ), OrePrefixes.pipeMedium .get(Materials.Titanium ), OrePrefixes.pipeHuge .get(Materials.Titanium ), OrePrefixes.pipeMedium .get(Materials.Titanium ), OrePrefixes.pipeLarge .get(Materials.Titanium )), + new Tier(SubTag.ENERGY_STEAM , 4, 2048, 1, 1, 1, Materials.TungstenSteel , OrePrefixes.frameGt .get(Materials.TungstenSteel ), OrePrefixes.pipeMedium .get(Materials.TungstenSteel ), OrePrefixes.pipeHuge .get(Materials.TungstenSteel ), OrePrefixes.pipeMedium .get(Materials.TungstenSteel ), OrePrefixes.pipeLarge .get(Materials.TungstenSteel )), + new Tier(SubTag.ENERGY_STEAM , 5, 8192, 1, 1, 1, Materials.Iridium , OrePrefixes.frameGt .get(Materials.Iridium ), OrePrefixes.pipeMedium .get(Materials.Iridium ), OrePrefixes.pipeHuge .get(Materials.Iridium ), OrePrefixes.pipeMedium .get(Materials.Iridium ), OrePrefixes.pipeLarge .get(Materials.Iridium )), + new Tier(SubTag.ENERGY_STEAM , 9, Integer.MAX_VALUE, 1, 1, 1, Materials.Neutronium , OrePrefixes.frameGt .get(Materials.Neutronium ), OrePrefixes.pipeMedium .get(Materials.Neutronium ), OrePrefixes.pipeHuge .get(Materials.Neutronium ), OrePrefixes.pipeMedium .get(Materials.Neutronium ), OrePrefixes.pipeLarge .get(Materials.Neutronium )), + }; + + private final SubTag mType; + private final byte mRank; + private final long mPrimaryValue, mSecondaryValue, mSpeedMultiplier, mEnergyCostMultiplier; + private final Materials mMaterial; + + /** Used for Crafting Recipes */ + public final Object mHullObject, mConductingObject, mLargerConductingObject, mManagingObject, mBetterManagingObject; + + public Tier(SubTag aType, int aRank, long aPrimaryValue, long aSecondaryValue, long aSpeedMultiplier, long aEnergyCostMultiplier, Materials aMaterial, Object aHullObject, Object aConductingObject, Object aLargerConductingObject, Object aManagingObject, Object aBetterManagingObject) { + mType = aType; + mRank = (byte)aRank; + mPrimaryValue = aPrimaryValue; + mSecondaryValue = aSecondaryValue; + mSpeedMultiplier = aSpeedMultiplier; + mEnergyCostMultiplier = Math.max(mSpeedMultiplier, aEnergyCostMultiplier); + mMaterial = aMaterial; + + mHullObject = aHullObject; + mConductingObject = aConductingObject; + mManagingObject = aManagingObject; + mBetterManagingObject = aBetterManagingObject; + mLargerConductingObject = aLargerConductingObject; + } + + public byte getRank() { + return mRank; + } + + public SubTag getEnergyType() { + return mType; + } + + public long getEnergyPrimary() { + return mPrimaryValue; + } + + public long getEnergySecondary() { + return mSecondaryValue; + } + + public long getSpeedMultiplier() { + return mSpeedMultiplier; + } + + public long getEnergyCostMultiplier() { + return mEnergyCostMultiplier; + } + + public Materials getMaterial() { + return mMaterial; + } +} diff --git a/src/main/java/gregtech/api/enums/ToolDictNames.java b/src/main/java/gregtech/api/enums/ToolDictNames.java new file mode 100644 index 0000000..dfa4486 --- /dev/null +++ b/src/main/java/gregtech/api/enums/ToolDictNames.java @@ -0,0 +1,32 @@ +package gregtech.api.enums; + +public enum ToolDictNames { + craftingToolSaw, + craftingToolHoe, + craftingToolAxe, + craftingToolFile, + craftingToolPlow, + craftingToolDrill, + craftingToolSword, + craftingToolScoop, + craftingToolKnife, + craftingToolBlade, + craftingToolMortar, + craftingToolShovel, + craftingToolWrench, + craftingToolPlunger, + craftingToolCrowbar, + craftingToolPickaxe, + craftingToolDrawplate, + craftingToolRollingPin, + craftingToolWireCutter, + craftingToolBranchCutter, + craftingToolHardHammer, + craftingToolSoftHammer, + craftingToolJackHammer, + craftingToolMiningDrill, + craftingToolForgeHammer, + craftingToolScrewdriver, + craftingToolSolderingIron, + craftingToolSolderingMetal; +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/events/BlockScanningEvent.java b/src/main/java/gregtech/api/events/BlockScanningEvent.java new file mode 100644 index 0000000..927919f --- /dev/null +++ b/src/main/java/gregtech/api/events/BlockScanningEvent.java @@ -0,0 +1,41 @@ +package gregtech.api.events; + +import java.util.ArrayList; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + +@cpw.mods.fml.common.eventhandler.Cancelable +public class BlockScanningEvent extends net.minecraftforge.event.world.WorldEvent { + + public final EntityPlayer mPlayer; + public final int mX, mY, mZ, mScanLevel; + public final ArrayList mList; + public final byte mSide; + public final float mClickX, mClickY, mClickZ; + public final TileEntity mTileEntity; + public final Block mBlock; + + /** + * used to determine the amount of Energy this Scan is costing. + */ + public int mEUCost = 0; + + public BlockScanningEvent(World aWorld, EntityPlayer aPlayer, int aX, int aY, int aZ, byte aSide, int aScanLevel, Block aBlock, TileEntity aTileEntity, ArrayList aList, float aClickX, float aClickY, float aClickZ) { + super(aWorld); + mPlayer = aPlayer; + mScanLevel = aScanLevel; + mTileEntity = aTileEntity; + mBlock = aBlock; + mList = aList; + mSide = aSide; + mX = aX; + mY = aY; + mZ = aZ; + mClickX = aClickX; + mClickY = aClickY; + mClickZ = aClickZ; + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/gui/GT_Container.java b/src/main/java/gregtech/api/gui/GT_Container.java new file mode 100644 index 0000000..626f70c --- /dev/null +++ b/src/main/java/gregtech/api/gui/GT_Container.java @@ -0,0 +1,562 @@ +package gregtech.api.gui; + +import java.util.List; + +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.util.GT_Log; +import gregtech.api.util.GT_Utility; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; + +/** + * NEVER INCLUDE THIS FILE IN YOUR MOD!!! + * + * Main Container-Class, used for all my GUIs + */ +public class GT_Container extends Container { + public IGregTechTileEntity mTileEntity; + public InventoryPlayer mPlayerInventory; + + public GT_Container (InventoryPlayer aPlayerInventory, IGregTechTileEntity aTileEntityInventory) { + + mTileEntity = aTileEntityInventory; + mPlayerInventory = aPlayerInventory; + } + + /** + * To add the Slots to your GUI + */ + public void addSlots(InventoryPlayer aPlayerInventory) { + // + } + + /** + * Amount of regular Slots in the GUI (so, non-HoloSlots) + */ + public int getSlotCount() { + return 0; + } + + /** + * Amount of ALL Slots in the GUI including HoloSlots and ArmorSlots, but excluding regular Player Slots + */ + protected final int getAllSlotCount() { + if (inventorySlots != null) { + if (doesBindPlayerInventory()) return inventorySlots.size()-36; + return inventorySlots.size(); + } + return getSlotCount(); + } + + /** + * Start-Index of the usable Slots (the first non-HoloSlot) + */ + public int getSlotStartIndex() { + return 0; + } + + public int getShiftClickStartIndex() { + return getSlotStartIndex(); + } + + /** + * Amount of Slots in the GUI the player can Shift-Click into. Uses also getSlotStartIndex + */ + public int getShiftClickSlotCount() { + return 0; + } + + /** + * Is Player-Inventory visible? + */ + public boolean doesBindPlayerInventory() { + return true; + } + + /** + * Override this Function with something like "return mTileEntity.isUseableByPlayer(aPlayer);" + */ + @Override + public boolean canInteractWith(EntityPlayer aPlayer) { + return false; + } + + protected void bindPlayerInventory(InventoryPlayer aInventoryPlayer) { + for (int i = 0; i < 3; i++) { + for (int j = 0; j < 9; j++) { + addSlotToContainer(new Slot(aInventoryPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } + + for (int i = 0; i < 9; i++) { + addSlotToContainer(new Slot(aInventoryPlayer, i, 8 + i * 18, 142)); + } + } + + @Override + public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) { + mTileEntity.markDirty(); + + if (aSlotIndex >= 0) { + if (inventorySlots.get(aSlotIndex) == null || inventorySlots.get(aSlotIndex) instanceof GT_Slot_Holo) return null; + if (!(inventorySlots.get(aSlotIndex) instanceof GT_Slot_Armor)) if (aSlotIndex < getAllSlotCount()) if (aSlotIndex < getSlotStartIndex() || aSlotIndex >= getSlotStartIndex() + getSlotCount()) return null; + } + + try {return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);} catch (Throwable e) {e.printStackTrace(GT_Log.err);} + + ItemStack rStack = null; + InventoryPlayer aPlayerInventory = aPlayer.inventory; + Slot aSlot; + ItemStack tTempStack; + int tTempStackSize; + ItemStack aHoldStack; + + if ((aShifthold == 0 || aShifthold == 1) && (aMouseclick == 0 || aMouseclick == 1)) { + if (aSlotIndex == -999) { + if (aPlayerInventory.getItemStack() != null && aSlotIndex == -999) { + if (aMouseclick == 0) { + aPlayer.dropPlayerItemWithRandomChoice(aPlayerInventory.getItemStack(), true); + aPlayerInventory.setItemStack(null); + } + if (aMouseclick == 1) { + aPlayer.dropPlayerItemWithRandomChoice(aPlayerInventory.getItemStack().splitStack(1), true); + if (aPlayerInventory.getItemStack().stackSize == 0) { + aPlayerInventory.setItemStack(null); + } + } + } + } else if (aShifthold == 1) { + aSlot = (Slot)this.inventorySlots.get(aSlotIndex); + if (aSlot != null && aSlot.canTakeStack(aPlayer)) { + tTempStack = this.transferStackInSlot(aPlayer, aSlotIndex); + if (tTempStack != null) { + rStack = GT_Utility.copy(tTempStack); + if (aSlot.getStack() != null && aSlot.getStack().getItem() == tTempStack.getItem()) { + slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); + } + } + } + } else { + if (aSlotIndex < 0) { + return null; + } + aSlot = (Slot)this.inventorySlots.get(aSlotIndex); + if (aSlot != null) { + tTempStack = aSlot.getStack(); + ItemStack var13 = aPlayerInventory.getItemStack(); + if (tTempStack != null) { + rStack = GT_Utility.copy(tTempStack); + } + if (tTempStack == null) { + if (var13 != null && aSlot.isItemValid(var13)) { + tTempStackSize = aMouseclick == 0 ? var13.stackSize : 1; + if (tTempStackSize > aSlot.getSlotStackLimit()) { + tTempStackSize = aSlot.getSlotStackLimit(); + } + aSlot.putStack(var13.splitStack(tTempStackSize)); + + if (var13.stackSize == 0) { + aPlayerInventory.setItemStack((ItemStack)null); + } + } + } else if (aSlot.canTakeStack(aPlayer)) { + if (var13 == null) { + tTempStackSize = aMouseclick == 0 ? tTempStack.stackSize : (tTempStack.stackSize + 1) / 2; + aHoldStack = aSlot.decrStackSize(tTempStackSize); + aPlayerInventory.setItemStack(aHoldStack); + if (tTempStack.stackSize == 0) { + aSlot.putStack((ItemStack)null); + } + aSlot.onPickupFromSlot(aPlayer, aPlayerInventory.getItemStack()); + } else if (aSlot.isItemValid(var13)) { + if (tTempStack.getItem() == var13.getItem() && tTempStack.getItemDamage() == var13.getItemDamage() && ItemStack.areItemStackTagsEqual(tTempStack, var13)) { + tTempStackSize = aMouseclick == 0 ? var13.stackSize : 1; + if (tTempStackSize > aSlot.getSlotStackLimit() - tTempStack.stackSize) { + tTempStackSize = aSlot.getSlotStackLimit() - tTempStack.stackSize; + } + if (tTempStackSize > var13.getMaxStackSize() - tTempStack.stackSize) { + tTempStackSize = var13.getMaxStackSize() - tTempStack.stackSize; + } + var13.splitStack(tTempStackSize); + if (var13.stackSize == 0) { + aPlayerInventory.setItemStack((ItemStack)null); + } + tTempStack.stackSize += tTempStackSize; + } else if (var13.stackSize <= aSlot.getSlotStackLimit()) { + aSlot.putStack(var13); + aPlayerInventory.setItemStack(tTempStack); + } + } else if (tTempStack.getItem() == var13.getItem() && var13.getMaxStackSize() > 1 && (!tTempStack.getHasSubtypes() || tTempStack.getItemDamage() == var13.getItemDamage()) && ItemStack.areItemStackTagsEqual(tTempStack, var13)) { + tTempStackSize = tTempStack.stackSize; + + if (tTempStackSize > 0 && tTempStackSize + var13.stackSize <= var13.getMaxStackSize()) { + var13.stackSize += tTempStackSize; + tTempStack = aSlot.decrStackSize(tTempStackSize); + + if (tTempStack.stackSize == 0) { + aSlot.putStack((ItemStack)null); + } + + aSlot.onPickupFromSlot(aPlayer, aPlayerInventory.getItemStack()); + } + } + } + aSlot.onSlotChanged(); + } + } + } else if (aShifthold == 2 && aMouseclick >= 0 && aMouseclick < 9) { + aSlot = (Slot)this.inventorySlots.get(aSlotIndex); + + if (aSlot.canTakeStack(aPlayer)) { + tTempStack = aPlayerInventory.getStackInSlot(aMouseclick); + boolean var9 = tTempStack == null || aSlot.inventory == aPlayerInventory && aSlot.isItemValid(tTempStack); + tTempStackSize = -1; + + if (!var9) { + tTempStackSize = aPlayerInventory.getFirstEmptyStack(); + var9 |= tTempStackSize > -1; + } + + if (aSlot.getHasStack() && var9) { + aHoldStack = aSlot.getStack(); + aPlayerInventory.setInventorySlotContents(aMouseclick, aHoldStack); + + if ((aSlot.inventory != aPlayerInventory || !aSlot.isItemValid(tTempStack)) && tTempStack != null) { + if (tTempStackSize > -1) { + aPlayerInventory.addItemStackToInventory(tTempStack); + aSlot.decrStackSize(aHoldStack.stackSize); + aSlot.putStack((ItemStack)null); + aSlot.onPickupFromSlot(aPlayer, aHoldStack); + } + } else { + aSlot.decrStackSize(aHoldStack.stackSize); + aSlot.putStack(tTempStack); + aSlot.onPickupFromSlot(aPlayer, aHoldStack); + } + } else if (!aSlot.getHasStack() && tTempStack != null && aSlot.isItemValid(tTempStack)) { + aPlayerInventory.setInventorySlotContents(aMouseclick, (ItemStack)null); + aSlot.putStack(tTempStack); + } + } + } else if (aShifthold == 3 && aPlayer.capabilities.isCreativeMode && aPlayerInventory.getItemStack() == null && aSlotIndex >= 0) { + aSlot = (Slot)this.inventorySlots.get(aSlotIndex); + if (aSlot != null && aSlot.getHasStack()) { + tTempStack = GT_Utility.copy(aSlot.getStack()); + tTempStack.stackSize = tTempStack.getMaxStackSize(); + aPlayerInventory.setItemStack(tTempStack); + } + } + return rStack; + } + + @Override + public ItemStack transferStackInSlot(EntityPlayer aPlayer, int aSlotIndex) { + ItemStack stack = null; + Slot slotObject = (Slot)inventorySlots.get(aSlotIndex); + + mTileEntity.markDirty(); + + //null checks and checks if the item can be stacked (maxStackSize > 1) + if (getSlotCount() > 0 && slotObject != null && slotObject.getHasStack() && !(slotObject instanceof GT_Slot_Holo)) { + ItemStack stackInSlot = slotObject.getStack(); + stack = GT_Utility.copy(stackInSlot); + + //TileEntity -> Player + if (aSlotIndex < getAllSlotCount()) { + if (doesBindPlayerInventory()) + if (!mergeItemStack(stackInSlot, getAllSlotCount(), getAllSlotCount()+36, true)) { + return null; + } + //Player -> TileEntity + } else if (!mergeItemStack(stackInSlot, getShiftClickStartIndex(), getShiftClickStartIndex()+getShiftClickSlotCount(), false)) { + return null; + } + + if (stackInSlot.stackSize == 0) { + slotObject.putStack(null); + } else { + slotObject.onSlotChanged(); + } + } + return stack; + } + + /** + * merges provided ItemStack with the first avaliable one in the container/player inventory + */ + @Override + protected boolean mergeItemStack(ItemStack aStack, int aStartIndex, int aSlotCount, boolean par4) { + boolean var5 = false; + int var6 = aStartIndex; + + mTileEntity.markDirty(); + + if (par4) { + var6 = aSlotCount - 1; + } + + Slot var7; + ItemStack var8; + + if (aStack.isStackable()) { + while (aStack.stackSize > 0 && (!par4 && var6 < aSlotCount || par4 && var6 >= aStartIndex)) { + var7 = (Slot)this.inventorySlots.get(var6); + var8 = var7.getStack(); + + if (!(var7 instanceof GT_Slot_Holo) && !(var7 instanceof GT_Slot_Output) && var8 != null && var8.getItem() == aStack.getItem() && (!aStack.getHasSubtypes() || aStack.getItemDamage() == var8.getItemDamage()) && ItemStack.areItemStackTagsEqual(aStack, var8)) { + int var9 = var8.stackSize + aStack.stackSize; + + if (var9 <= aStack.getMaxStackSize()) { + aStack.stackSize = 0; + var8.stackSize = var9; + var7.onSlotChanged(); + var5 = true; + } else if (var8.stackSize < aStack.getMaxStackSize()) { + aStack.stackSize -= aStack.getMaxStackSize() - var8.stackSize; + var8.stackSize = aStack.getMaxStackSize(); + var7.onSlotChanged(); + var5 = true; + } + } + + if (par4) { + --var6; + } else { + ++var6; + } + } + } + + if (aStack.stackSize > 0) + { + if (par4) + { + var6 = aSlotCount - 1; + } + else + { + var6 = aStartIndex; + } + + while (!par4 && var6 < aSlotCount || par4 && var6 >= aStartIndex) + { + var7 = (Slot)this.inventorySlots.get(var6); + var8 = var7.getStack(); + + if (var8 == null) + { + var7.putStack(GT_Utility.copy(aStack)); + var7.onSlotChanged(); + aStack.stackSize = 0; + var5 = true; + break; + } + + if (par4) + { + --var6; + } + else + { + ++var6; + } + } + } + + return var5; + } + + @Override + protected Slot addSlotToContainer(Slot par1Slot) { + try { + return super.addSlotToContainer(par1Slot); + } catch(Throwable e) { + e.printStackTrace(GT_Log.err); + } + return par1Slot; + } + + @Override + public void addCraftingToCrafters(ICrafting par1ICrafting) { + try { + super.addCraftingToCrafters(par1ICrafting); + } catch(Throwable e) { + e.printStackTrace(GT_Log.err); + } + } + + @Override + public List getInventory() { + try { + return super.getInventory(); + } catch(Throwable e) { + e.printStackTrace(GT_Log.err); + } + return null; + } + + @Override + public void removeCraftingFromCrafters(ICrafting par1ICrafting) { + try { + super.removeCraftingFromCrafters(par1ICrafting); + } catch(Throwable e) { + e.printStackTrace(GT_Log.err); + } + } + + @Override + public void detectAndSendChanges() { + try { + super.detectAndSendChanges(); + } catch(Throwable e) { + e.printStackTrace(GT_Log.err); + } + } + + @Override + public boolean enchantItem(EntityPlayer par1EntityPlayer, int par2) { + try { + return super.enchantItem(par1EntityPlayer, par2); + } catch(Throwable e) { + e.printStackTrace(GT_Log.err); + } + return false; + } + + @Override + public Slot getSlotFromInventory(IInventory par1IInventory, int par2) { + try { + return super.getSlotFromInventory(par1IInventory, par2); + } catch(Throwable e) { + e.printStackTrace(GT_Log.err); + } + return null; + } + + @Override + public Slot getSlot(int par1) { + try { + if (this.inventorySlots.size() > par1) return super.getSlot(par1); + } catch(Throwable e) { + e.printStackTrace(GT_Log.err); + } + return null; + } + + @Override + public boolean func_94530_a(ItemStack par1ItemStack, Slot par2Slot) { + try { + return super.func_94530_a(par1ItemStack, par2Slot); + } catch(Throwable e) { + e.printStackTrace(GT_Log.err); + } + return true; + } + + @Override + protected void retrySlotClick(int par1, int par2, boolean par3, EntityPlayer par4EntityPlayer) { + try { + super.retrySlotClick(par1, par2, par3, par4EntityPlayer); + } catch(Throwable e) { + e.printStackTrace(GT_Log.err); + } + } + + @Override + public void onContainerClosed(EntityPlayer par1EntityPlayer) { + try { + super.onContainerClosed(par1EntityPlayer); + } catch(Throwable e) { + e.printStackTrace(GT_Log.err); + } + } + + @Override + public void onCraftMatrixChanged(IInventory par1IInventory) { + try { + super.onCraftMatrixChanged(par1IInventory); + } catch(Throwable e) { + e.printStackTrace(GT_Log.err); + } + } + + @Override + public void putStackInSlot(int par1, ItemStack par2ItemStack) { + try { + super.putStackInSlot(par1, par2ItemStack); + } catch(Throwable e) { + e.printStackTrace(GT_Log.err); + } + } + + @Override + public void putStacksInSlots(ItemStack[] par1ArrayOfItemStack) { + try { + super.putStacksInSlots(par1ArrayOfItemStack); + } catch(Throwable e) { + e.printStackTrace(GT_Log.err); + } + } + + @Override + public void updateProgressBar(int par1, int par2) { + try { + super.updateProgressBar(par1, par2); + } catch(Throwable e) { + e.printStackTrace(GT_Log.err); + } + } + + @Override + public short getNextTransactionID(InventoryPlayer par1InventoryPlayer) { + try { + return super.getNextTransactionID(par1InventoryPlayer); + } catch(Throwable e) { + e.printStackTrace(GT_Log.err); + } + return 0; + } + + @Override + public boolean isPlayerNotUsingContainer(EntityPlayer par1EntityPlayer) { + try { + return super.isPlayerNotUsingContainer(par1EntityPlayer); + } catch(Throwable e) { + e.printStackTrace(GT_Log.err); + } + return true; + } + + @Override + public void setPlayerIsPresent(EntityPlayer par1EntityPlayer, boolean par2) { + try { + super.setPlayerIsPresent(par1EntityPlayer, par2); + } catch(Throwable e) { + e.printStackTrace(GT_Log.err); + } + } + + @Override + protected void func_94533_d() { + try { + super.func_94533_d(); + } catch(Throwable e) { + e.printStackTrace(GT_Log.err); + } + } + + @Override + public boolean canDragIntoSlot(Slot par1Slot) { + try { + return super.canDragIntoSlot(par1Slot); + } catch(Throwable e) { + e.printStackTrace(GT_Log.err); + } + return true; + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/gui/GT_ContainerMetaTile_Machine.java b/src/main/java/gregtech/api/gui/GT_ContainerMetaTile_Machine.java new file mode 100644 index 0000000..4b84f9f --- /dev/null +++ b/src/main/java/gregtech/api/gui/GT_ContainerMetaTile_Machine.java @@ -0,0 +1,151 @@ +package gregtech.api.gui; + +import java.util.Iterator; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ICrafting; + +/** + * NEVER INCLUDE THIS FILE IN YOUR MOD!!! + * + * The Container I use for all my MetaTileEntities + */ +public class GT_ContainerMetaTile_Machine extends GT_Container { + + public GT_ContainerMetaTile_Machine(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { + super(aInventoryPlayer, aTileEntity); + + mTileEntity = aTileEntity; + + if (mTileEntity != null && mTileEntity.getMetaTileEntity() != null) { + addSlots(aInventoryPlayer); + if (doesBindPlayerInventory()) bindPlayerInventory(aInventoryPlayer); + detectAndSendChanges(); + } else { + aInventoryPlayer.player.openContainer = aInventoryPlayer.player.inventoryContainer; + } + } + public GT_ContainerMetaTile_Machine(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, boolean doesBindInventory){ + super(aInventoryPlayer, aTileEntity); + mTileEntity = aTileEntity; + + if (mTileEntity != null && mTileEntity.getMetaTileEntity() != null) { + addSlots(aInventoryPlayer); + if (doesBindPlayerInventory()&&doesBindInventory) bindPlayerInventory(aInventoryPlayer); + detectAndSendChanges(); + } else { + aInventoryPlayer.player.openContainer = aInventoryPlayer.player.inventoryContainer; + } + } + + + public int mActive = 0, mMaxProgressTime = 0, mProgressTime = 0, mEnergy = 0, mSteam = 0, mSteamStorage = 0, mStorage = 0, mOutput = 0, mInput = 0, mID = 0, mDisplayErrorCode = 0; + private int oActive = 0, oMaxProgressTime = 0, oProgressTime = 0, oEnergy = 0, oSteam = 0, oSteamStorage = 0, oStorage = 0, oOutput = 0, oInput = 0, oID = 0, oDisplayErrorCode = 0, mTimer = 0; + + @Override + public void detectAndSendChanges() { + super.detectAndSendChanges(); + if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) return; + mStorage = (int)Math.min(Integer.MAX_VALUE, mTileEntity.getEUCapacity()); + mEnergy = (int)Math.min(Integer.MAX_VALUE, mTileEntity.getStoredEU()); + mSteamStorage = (int)Math.min(Integer.MAX_VALUE, mTileEntity.getSteamCapacity()); + mSteam = (int)Math.min(Integer.MAX_VALUE, mTileEntity.getStoredSteam()); + mOutput = (int)Math.min(Integer.MAX_VALUE, mTileEntity.getOutputVoltage()); + mInput = (int)Math.min(Integer.MAX_VALUE, mTileEntity.getInputVoltage()); + mDisplayErrorCode = mTileEntity.getErrorDisplayID(); + mProgressTime = mTileEntity.getProgress(); + mMaxProgressTime = mTileEntity.getMaxProgress(); + mActive = mTileEntity.isActive()?1:0; + mTimer++; + + Iterator var2 = this.crafters.iterator(); + while (var2.hasNext()) { + ICrafting var1 = (ICrafting)var2.next(); + if (mTimer % 500 == 10 || oEnergy != mEnergy) { + var1.sendProgressBarUpdate(this, 0, mEnergy & 65535); + var1.sendProgressBarUpdate(this, 1, mEnergy >>> 16); + } + if (mTimer % 500 == 10 || oStorage != mStorage) { + var1.sendProgressBarUpdate(this, 2, mStorage & 65535); + var1.sendProgressBarUpdate(this, 3, mStorage >>> 16); + } + if (mTimer % 500 == 10 || oOutput != mOutput) { + var1.sendProgressBarUpdate(this, 4, mOutput); + } + if (mTimer % 500 == 10 || oInput != mInput) { + var1.sendProgressBarUpdate(this, 5, mInput); + } + if (mTimer % 500 == 10 || oDisplayErrorCode != mDisplayErrorCode) { + var1.sendProgressBarUpdate(this, 6, mDisplayErrorCode); + } + if (mTimer % 500 == 10 || oProgressTime != mProgressTime) { + var1.sendProgressBarUpdate(this, 11, mProgressTime & 65535); + var1.sendProgressBarUpdate(this, 12, mProgressTime >>> 16); + } + if (mTimer % 500 == 10 || oMaxProgressTime != mMaxProgressTime) { + var1.sendProgressBarUpdate(this, 13, mMaxProgressTime & 65535); + var1.sendProgressBarUpdate(this, 14, mMaxProgressTime >>> 16); + } + if (mTimer % 500 == 10 || oID != mID) { + var1.sendProgressBarUpdate(this, 15, mID); + } + if (mTimer % 500 == 10 || oActive != mActive) { + var1.sendProgressBarUpdate(this, 16, mActive); + } + if (mTimer % 500 == 10 || oSteam != mSteam) { + var1.sendProgressBarUpdate(this, 17, mSteam & 65535); + var1.sendProgressBarUpdate(this, 18, mSteam >>> 16); + } + if (mTimer % 500 == 10 || oSteamStorage != mSteamStorage) { + var1.sendProgressBarUpdate(this, 19, mSteamStorage & 65535); + var1.sendProgressBarUpdate(this, 20, mSteamStorage >>> 16); + } + } + + oID = mID; + oSteam = mSteam; + oInput = mInput; + oActive = mActive; + oOutput = mOutput; + oEnergy = mEnergy; + oStorage = mStorage; + oSteamStorage = mSteamStorage; + oProgressTime = mProgressTime; + oMaxProgressTime = mMaxProgressTime; + oDisplayErrorCode = mDisplayErrorCode; + } + + @SideOnly(Side.CLIENT) + @Override + public void updateProgressBar(int par1, int par2) { + super.updateProgressBar(par1, par2); + switch (par1) { + case 0: mEnergy = mEnergy & -65536 | par2; break; + case 1: mEnergy = mEnergy & 65535 | par2 << 16; break; + case 2: mStorage = mStorage & -65536 | par2; break; + case 3: mStorage = mStorage & 65535 | par2 << 16; break; + case 4: mOutput = par2; break; + case 5: mInput = par2; break; + case 6: mDisplayErrorCode = par2; break; + case 11: mProgressTime = mProgressTime & -65536 | par2; break; + case 12: mProgressTime = mProgressTime & 65535 | par2 << 16; break; + case 13: mMaxProgressTime = mMaxProgressTime & -65536 | par2; break; + case 14: mMaxProgressTime = mMaxProgressTime & 65535 | par2 << 16; break; + case 15: mID = par2; break; + case 16: mActive = par2; break; + case 17: mSteam = mSteam & -65536 | par2; break; + case 18: mSteam = mSteam & 65535 | par2 << 16; break; + case 19: mSteamStorage = mSteamStorage & -65536 | par2; break; + case 20: mSteamStorage = mSteamStorage & 65535 | par2 << 16; break; + } + } + + @Override + public boolean canInteractWith(EntityPlayer player) { + return mTileEntity.isUseableByPlayer(player); + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/gui/GT_Container_1by1.java b/src/main/java/gregtech/api/gui/GT_Container_1by1.java new file mode 100644 index 0000000..3607d81 --- /dev/null +++ b/src/main/java/gregtech/api/gui/GT_Container_1by1.java @@ -0,0 +1,27 @@ +package gregtech.api.gui; + +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Slot; + +public class GT_Container_1by1 extends GT_ContainerMetaTile_Machine { + + public GT_Container_1by1(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { + super(aInventoryPlayer, aTileEntity); + } + + @Override + public void addSlots(InventoryPlayer aInventoryPlayer) { + addSlotToContainer(new Slot(mTileEntity, 0, 80, 35)); + } + + @Override + public int getSlotCount() { + return 1; + } + + @Override + public int getShiftClickSlotCount() { + return 1; + } +} diff --git a/src/main/java/gregtech/api/gui/GT_Container_2by2.java b/src/main/java/gregtech/api/gui/GT_Container_2by2.java new file mode 100644 index 0000000..2d4bdcd --- /dev/null +++ b/src/main/java/gregtech/api/gui/GT_Container_2by2.java @@ -0,0 +1,30 @@ +package gregtech.api.gui; + +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Slot; + +public class GT_Container_2by2 extends GT_ContainerMetaTile_Machine { + + public GT_Container_2by2(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { + super(aInventoryPlayer, aTileEntity); + } + + @Override + public void addSlots(InventoryPlayer aInventoryPlayer) { + addSlotToContainer(new Slot(mTileEntity, 0, 71, 26)); + addSlotToContainer(new Slot(mTileEntity, 1, 89, 26)); + addSlotToContainer(new Slot(mTileEntity, 2, 71, 44)); + addSlotToContainer(new Slot(mTileEntity, 3, 89, 44)); + } + + @Override + public int getSlotCount() { + return 4; + } + + @Override + public int getShiftClickSlotCount() { + return 4; + } +} diff --git a/src/main/java/gregtech/api/gui/GT_Container_3by3.java b/src/main/java/gregtech/api/gui/GT_Container_3by3.java new file mode 100644 index 0000000..9206116 --- /dev/null +++ b/src/main/java/gregtech/api/gui/GT_Container_3by3.java @@ -0,0 +1,35 @@ +package gregtech.api.gui; + +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Slot; + +public class GT_Container_3by3 extends GT_ContainerMetaTile_Machine { + + public GT_Container_3by3(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { + super(aInventoryPlayer, aTileEntity); + } + + @Override + public void addSlots(InventoryPlayer aInventoryPlayer) { + addSlotToContainer(new Slot(mTileEntity, 0, 62, 17)); + addSlotToContainer(new Slot(mTileEntity, 1, 80, 17)); + addSlotToContainer(new Slot(mTileEntity, 2, 98, 17)); + addSlotToContainer(new Slot(mTileEntity, 3, 62, 35)); + addSlotToContainer(new Slot(mTileEntity, 4, 80, 35)); + addSlotToContainer(new Slot(mTileEntity, 5, 98, 35)); + addSlotToContainer(new Slot(mTileEntity, 6, 62, 53)); + addSlotToContainer(new Slot(mTileEntity, 7, 80, 53)); + addSlotToContainer(new Slot(mTileEntity, 8, 98, 53)); + } + + @Override + public int getSlotCount() { + return 9; + } + + @Override + public int getShiftClickSlotCount() { + return 9; + } +} diff --git a/src/main/java/gregtech/api/gui/GT_Container_4by4.java b/src/main/java/gregtech/api/gui/GT_Container_4by4.java new file mode 100644 index 0000000..eb6039c --- /dev/null +++ b/src/main/java/gregtech/api/gui/GT_Container_4by4.java @@ -0,0 +1,42 @@ +package gregtech.api.gui; + +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Slot; + +public class GT_Container_4by4 extends GT_ContainerMetaTile_Machine { + + public GT_Container_4by4(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { + super(aInventoryPlayer, aTileEntity); + } + + @Override + public void addSlots(InventoryPlayer aInventoryPlayer) { + addSlotToContainer(new Slot(mTileEntity, 0, 53, 8)); + addSlotToContainer(new Slot(mTileEntity, 1, 71, 8)); + addSlotToContainer(new Slot(mTileEntity, 2, 89, 8)); + addSlotToContainer(new Slot(mTileEntity, 3, 107, 8)); + addSlotToContainer(new Slot(mTileEntity, 4, 53, 26)); + addSlotToContainer(new Slot(mTileEntity, 5, 71, 26)); + addSlotToContainer(new Slot(mTileEntity, 6, 89, 26)); + addSlotToContainer(new Slot(mTileEntity, 7, 107, 26)); + addSlotToContainer(new Slot(mTileEntity, 8, 53, 44)); + addSlotToContainer(new Slot(mTileEntity, 9, 71, 44)); + addSlotToContainer(new Slot(mTileEntity,10, 89, 44)); + addSlotToContainer(new Slot(mTileEntity,11, 107, 44)); + addSlotToContainer(new Slot(mTileEntity,12, 53, 62)); + addSlotToContainer(new Slot(mTileEntity,13, 71, 62)); + addSlotToContainer(new Slot(mTileEntity,14, 89, 62)); + addSlotToContainer(new Slot(mTileEntity,15, 107, 62)); + } + + @Override + public int getSlotCount() { + return 16; + } + + @Override + public int getShiftClickSlotCount() { + return 16; + } +} diff --git a/src/main/java/gregtech/api/gui/GT_Container_BasicMachine.java b/src/main/java/gregtech/api/gui/GT_Container_BasicMachine.java new file mode 100644 index 0000000..2f4f983 --- /dev/null +++ b/src/main/java/gregtech/api/gui/GT_Container_BasicMachine.java @@ -0,0 +1,248 @@ +package gregtech.api.gui; + +import java.util.Iterator; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; + +/** + * NEVER INCLUDE THIS FILE IN YOUR MOD!!! + * + * The Container I use for all my Basic Machines + */ +public class GT_Container_BasicMachine extends GT_Container_BasicTank { + + public GT_Container_BasicMachine(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { + super(aInventoryPlayer, aTileEntity); + } + + @Override + public void addSlots(InventoryPlayer aInventoryPlayer) { + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 0, 8, 63, false, true, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 0, 26, 63, false, true, 1)); + addSlotToContainer(new GT_Slot_Render(mTileEntity, 2, 107, 63)); + + int tStartIndex = ((GT_MetaTileEntity_BasicMachine)mTileEntity.getMetaTileEntity()).getInputSlot(); + + switch (((GT_MetaTileEntity_BasicMachine)mTileEntity.getMetaTileEntity()).mInputSlotCount) { + case 0: + break; + case 1: + addSlotToContainer(new Slot(mTileEntity, tStartIndex++, 53, 25)); + break; + case 2: + addSlotToContainer(new Slot(mTileEntity, tStartIndex++, 35, 25)); + addSlotToContainer(new Slot(mTileEntity, tStartIndex++, 53, 25)); + break; + case 3: + addSlotToContainer(new Slot(mTileEntity, tStartIndex++, 17, 25)); + addSlotToContainer(new Slot(mTileEntity, tStartIndex++, 35, 25)); + addSlotToContainer(new Slot(mTileEntity, tStartIndex++, 53, 25)); + break; + case 4: + addSlotToContainer(new Slot(mTileEntity, tStartIndex++, 35, 16)); + addSlotToContainer(new Slot(mTileEntity, tStartIndex++, 53, 16)); + addSlotToContainer(new Slot(mTileEntity, tStartIndex++, 35, 34)); + addSlotToContainer(new Slot(mTileEntity, tStartIndex++, 53, 34)); + break; + case 5: + addSlotToContainer(new Slot(mTileEntity, tStartIndex++, 17, 16)); + addSlotToContainer(new Slot(mTileEntity, tStartIndex++, 35, 16)); + addSlotToContainer(new Slot(mTileEntity, tStartIndex++, 53, 16)); + addSlotToContainer(new Slot(mTileEntity, tStartIndex++, 35, 34)); + addSlotToContainer(new Slot(mTileEntity, tStartIndex++, 53, 34)); + break; + case 6: + addSlotToContainer(new Slot(mTileEntity, tStartIndex++, 17, 16)); + addSlotToContainer(new Slot(mTileEntity, tStartIndex++, 35, 16)); + addSlotToContainer(new Slot(mTileEntity, tStartIndex++, 53, 16)); + addSlotToContainer(new Slot(mTileEntity, tStartIndex++, 17, 34)); + addSlotToContainer(new Slot(mTileEntity, tStartIndex++, 35, 34)); + addSlotToContainer(new Slot(mTileEntity, tStartIndex++, 53, 34)); + break; + case 7: + addSlotToContainer(new Slot(mTileEntity, tStartIndex++, 17, 7)); + addSlotToContainer(new Slot(mTileEntity, tStartIndex++, 35, 7)); + addSlotToContainer(new Slot(mTileEntity, tStartIndex++, 53, 7)); + addSlotToContainer(new Slot(mTileEntity, tStartIndex++, 17, 25)); + addSlotToContainer(new Slot(mTileEntity, tStartIndex++, 35, 25)); + addSlotToContainer(new Slot(mTileEntity, tStartIndex++, 53, 25)); + addSlotToContainer(new Slot(mTileEntity, tStartIndex++, 17, 43)); + break; + case 8: + addSlotToContainer(new Slot(mTileEntity, tStartIndex++, 17, 7)); + addSlotToContainer(new Slot(mTileEntity, tStartIndex++, 35, 7)); + addSlotToContainer(new Slot(mTileEntity, tStartIndex++, 53, 7)); + addSlotToContainer(new Slot(mTileEntity, tStartIndex++, 17, 25)); + addSlotToContainer(new Slot(mTileEntity, tStartIndex++, 35, 25)); + addSlotToContainer(new Slot(mTileEntity, tStartIndex++, 53, 25)); + addSlotToContainer(new Slot(mTileEntity, tStartIndex++, 17, 43)); + addSlotToContainer(new Slot(mTileEntity, tStartIndex++, 35, 43)); + break; + default: + addSlotToContainer(new Slot(mTileEntity, tStartIndex++, 17, 7)); + addSlotToContainer(new Slot(mTileEntity, tStartIndex++, 35, 7)); + addSlotToContainer(new Slot(mTileEntity, tStartIndex++, 53, 7)); + addSlotToContainer(new Slot(mTileEntity, tStartIndex++, 17, 25)); + addSlotToContainer(new Slot(mTileEntity, tStartIndex++, 35, 25)); + addSlotToContainer(new Slot(mTileEntity, tStartIndex++, 53, 25)); + addSlotToContainer(new Slot(mTileEntity, tStartIndex++, 17, 43)); + addSlotToContainer(new Slot(mTileEntity, tStartIndex++, 35, 43)); + addSlotToContainer(new Slot(mTileEntity, tStartIndex++, 53, 43)); + break; + } + + tStartIndex = ((GT_MetaTileEntity_BasicMachine)mTileEntity.getMetaTileEntity()).getOutputSlot(); + + switch (((GT_MetaTileEntity_BasicMachine)mTileEntity.getMetaTileEntity()).mOutputItems.length) { + case 0: + break; + case 1: + addSlotToContainer(new GT_Slot_Output(mTileEntity, tStartIndex++, 107, 25)); + break; + case 2: + addSlotToContainer(new GT_Slot_Output(mTileEntity, tStartIndex++, 107, 25)); + addSlotToContainer(new GT_Slot_Output(mTileEntity, tStartIndex++, 125, 25)); + break; + case 3: + addSlotToContainer(new GT_Slot_Output(mTileEntity, tStartIndex++, 107, 25)); + addSlotToContainer(new GT_Slot_Output(mTileEntity, tStartIndex++, 125, 25)); + addSlotToContainer(new GT_Slot_Output(mTileEntity, tStartIndex++, 143, 25)); + break; + case 4: + addSlotToContainer(new GT_Slot_Output(mTileEntity, tStartIndex++, 107, 16)); + addSlotToContainer(new GT_Slot_Output(mTileEntity, tStartIndex++, 125, 16)); + addSlotToContainer(new GT_Slot_Output(mTileEntity, tStartIndex++, 107, 34)); + addSlotToContainer(new GT_Slot_Output(mTileEntity, tStartIndex++, 125, 34)); + break; + case 5: + addSlotToContainer(new GT_Slot_Output(mTileEntity, tStartIndex++, 107, 16)); + addSlotToContainer(new GT_Slot_Output(mTileEntity, tStartIndex++, 125, 16)); + addSlotToContainer(new GT_Slot_Output(mTileEntity, tStartIndex++, 143, 16)); + addSlotToContainer(new GT_Slot_Output(mTileEntity, tStartIndex++, 107, 34)); + addSlotToContainer(new GT_Slot_Output(mTileEntity, tStartIndex++, 125, 34)); + break; + case 6: + addSlotToContainer(new GT_Slot_Output(mTileEntity, tStartIndex++, 107, 16)); + addSlotToContainer(new GT_Slot_Output(mTileEntity, tStartIndex++, 125, 16)); + addSlotToContainer(new GT_Slot_Output(mTileEntity, tStartIndex++, 143, 16)); + addSlotToContainer(new GT_Slot_Output(mTileEntity, tStartIndex++, 107, 34)); + addSlotToContainer(new GT_Slot_Output(mTileEntity, tStartIndex++, 125, 34)); + addSlotToContainer(new GT_Slot_Output(mTileEntity, tStartIndex++, 143, 34)); + break; + case 7: + addSlotToContainer(new GT_Slot_Output(mTileEntity, tStartIndex++, 107, 7)); + addSlotToContainer(new GT_Slot_Output(mTileEntity, tStartIndex++, 125, 7)); + addSlotToContainer(new GT_Slot_Output(mTileEntity, tStartIndex++, 143, 7)); + addSlotToContainer(new GT_Slot_Output(mTileEntity, tStartIndex++, 107, 25)); + addSlotToContainer(new GT_Slot_Output(mTileEntity, tStartIndex++, 125, 25)); + addSlotToContainer(new GT_Slot_Output(mTileEntity, tStartIndex++, 143, 25)); + addSlotToContainer(new GT_Slot_Output(mTileEntity, tStartIndex++, 107, 43)); + break; + case 8: + addSlotToContainer(new GT_Slot_Output(mTileEntity, tStartIndex++, 107, 7)); + addSlotToContainer(new GT_Slot_Output(mTileEntity, tStartIndex++, 125, 7)); + addSlotToContainer(new GT_Slot_Output(mTileEntity, tStartIndex++, 143, 7)); + addSlotToContainer(new GT_Slot_Output(mTileEntity, tStartIndex++, 107, 25)); + addSlotToContainer(new GT_Slot_Output(mTileEntity, tStartIndex++, 125, 25)); + addSlotToContainer(new GT_Slot_Output(mTileEntity, tStartIndex++, 143, 25)); + addSlotToContainer(new GT_Slot_Output(mTileEntity, tStartIndex++, 107, 43)); + addSlotToContainer(new GT_Slot_Output(mTileEntity, tStartIndex++, 125, 43)); + break; + default: + addSlotToContainer(new GT_Slot_Output(mTileEntity, tStartIndex++, 107, 7)); + addSlotToContainer(new GT_Slot_Output(mTileEntity, tStartIndex++, 125, 7)); + addSlotToContainer(new GT_Slot_Output(mTileEntity, tStartIndex++, 143, 7)); + addSlotToContainer(new GT_Slot_Output(mTileEntity, tStartIndex++, 107, 25)); + addSlotToContainer(new GT_Slot_Output(mTileEntity, tStartIndex++, 125, 25)); + addSlotToContainer(new GT_Slot_Output(mTileEntity, tStartIndex++, 143, 25)); + addSlotToContainer(new GT_Slot_Output(mTileEntity, tStartIndex++, 107, 43)); + addSlotToContainer(new GT_Slot_Output(mTileEntity, tStartIndex++, 125, 43)); + addSlotToContainer(new GT_Slot_Output(mTileEntity, tStartIndex++, 143, 43)); + break; + } + + addSlotToContainer(new Slot(mTileEntity, 1, 80, 63)); + addSlotToContainer(new Slot(mTileEntity, 3, 125, 63)); + addSlotToContainer(new GT_Slot_Render(mTileEntity, tStartIndex++, 53, 63)); + } + + public boolean mFluidTransfer = false, mItemTransfer = false, mStuttering = false; + + @Override + public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) { + switch(aSlotIndex) { + case 0: + if (mTileEntity.getMetaTileEntity() == null) return null; + ((GT_MetaTileEntity_BasicMachine)mTileEntity.getMetaTileEntity()).mFluidTransfer = !((GT_MetaTileEntity_BasicMachine)mTileEntity.getMetaTileEntity()).mFluidTransfer; + return null; + case 1: + if (mTileEntity.getMetaTileEntity() == null) return null; + ((GT_MetaTileEntity_BasicMachine)mTileEntity.getMetaTileEntity()).mItemTransfer = !((GT_MetaTileEntity_BasicMachine)mTileEntity.getMetaTileEntity()).mItemTransfer; + return null; + default: + return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); + } + } + + @Override + public void detectAndSendChanges() { + super.detectAndSendChanges(); + if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) return; + + mFluidTransfer = ((GT_MetaTileEntity_BasicMachine)mTileEntity.getMetaTileEntity()).mFluidTransfer; + mItemTransfer = ((GT_MetaTileEntity_BasicMachine)mTileEntity.getMetaTileEntity()).mItemTransfer; + mStuttering = ((GT_MetaTileEntity_BasicMachine)mTileEntity.getMetaTileEntity()).mStuttering; + + Iterator var2 = this.crafters.iterator(); + while (var2.hasNext()) { + ICrafting var1 = (ICrafting)var2.next(); + var1.sendProgressBarUpdate(this, 102, mFluidTransfer?1:0); + var1.sendProgressBarUpdate(this, 103, mItemTransfer?1:0); + var1.sendProgressBarUpdate(this, 104, mStuttering?1:0); + } + } + + @Override + public void addCraftingToCrafters(ICrafting par1ICrafting) { + super.addCraftingToCrafters(par1ICrafting); + } + + @Override + @SideOnly(Side.CLIENT) + public void updateProgressBar(int par1, int par2) { + super.updateProgressBar(par1, par2); + switch (par1) { + case 102: mFluidTransfer = (par2 != 0); break; + case 103: mItemTransfer = (par2 != 0); break; + case 104: mStuttering = (par2 != 0); break; + } + } + + @Override + public int getSlotStartIndex() { + return 3; + } + + @Override + public int getShiftClickStartIndex() { + return 3; + } + + @Override + public int getSlotCount() { + return getShiftClickSlotCount() + ((GT_MetaTileEntity_BasicMachine)mTileEntity.getMetaTileEntity()).mOutputItems.length + 2; + } + + @Override + public int getShiftClickSlotCount() { + return ((GT_MetaTileEntity_BasicMachine)mTileEntity.getMetaTileEntity()).mInputSlotCount; + } +} diff --git a/src/main/java/gregtech/api/gui/GT_Container_BasicTank.java b/src/main/java/gregtech/api/gui/GT_Container_BasicTank.java new file mode 100644 index 0000000..0cc390a --- /dev/null +++ b/src/main/java/gregtech/api/gui/GT_Container_BasicTank.java @@ -0,0 +1,68 @@ +package gregtech.api.gui; + +import java.util.Iterator; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.Slot; + +/** + * NEVER INCLUDE THIS FILE IN YOUR MOD!!! + * + * The Container I use for all my Basic Tanks + */ +public class GT_Container_BasicTank extends GT_ContainerMetaTile_Machine { + + public GT_Container_BasicTank(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { + super(aInventoryPlayer, aTileEntity); + } + + @Override + public void addSlots(InventoryPlayer aInventoryPlayer) { + addSlotToContainer(new Slot(mTileEntity, 0, 80, 17)); + addSlotToContainer(new GT_Slot_Output(mTileEntity, 1, 80, 53)); + addSlotToContainer(new GT_Slot_Render(mTileEntity, 2, 59, 42)); + } + + public int mContent = 0; + + @Override + public void detectAndSendChanges() { + super.detectAndSendChanges(); + if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) return; + if (((GT_MetaTileEntity_BasicTank)mTileEntity.getMetaTileEntity()).mFluid != null) + mContent = ((GT_MetaTileEntity_BasicTank)mTileEntity.getMetaTileEntity()).mFluid.amount; + else + mContent = 0; + Iterator var2 = this.crafters.iterator(); + while (var2.hasNext()) { + ICrafting var1 = (ICrafting)var2.next(); + var1.sendProgressBarUpdate(this, 100, mContent & 65535); + var1.sendProgressBarUpdate(this, 101, mContent >>> 16); + } + } + + @Override + @SideOnly(Side.CLIENT) + public void updateProgressBar(int par1, int par2) { + super.updateProgressBar(par1, par2); + switch (par1) { + case 100: mContent = mContent & -65536 | par2; break; + case 101: mContent = mContent & 65535 | par2 << 16; break; + } + } + + @Override + public int getSlotCount() { + return 2; + } + + @Override + public int getShiftClickSlotCount() { + return 1; + } +} diff --git a/src/main/java/gregtech/api/gui/GT_Container_MaintenanceHatch.java b/src/main/java/gregtech/api/gui/GT_Container_MaintenanceHatch.java new file mode 100644 index 0000000..3f9846b --- /dev/null +++ b/src/main/java/gregtech/api/gui/GT_Container_MaintenanceHatch.java @@ -0,0 +1,30 @@ +package gregtech.api.gui; + +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maintenance; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; + +public class GT_Container_MaintenanceHatch extends GT_ContainerMetaTile_Machine { + + public GT_Container_MaintenanceHatch(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { + super(aInventoryPlayer, aTileEntity); + } + + @Override + public void addSlots(InventoryPlayer aInventoryPlayer) { + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 0, 80, 35, false, false, 1)); + } + + @Override + public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) { + if (aSlotIndex != 0) return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); + ItemStack tStack = aPlayer.inventory.getItemStack(); + if (tStack != null) { + ((GT_MetaTileEntity_Hatch_Maintenance)mTileEntity.getMetaTileEntity()).onToolClick(tStack, aPlayer); + if (tStack.stackSize <= 0) aPlayer.inventory.setItemStack(null); + } + return null; + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/gui/GT_Container_MultiMachine.java b/src/main/java/gregtech/api/gui/GT_Container_MultiMachine.java new file mode 100644 index 0000000..289b783 --- /dev/null +++ b/src/main/java/gregtech/api/gui/GT_Container_MultiMachine.java @@ -0,0 +1,35 @@ +package gregtech.api.gui; + +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Slot; + +/** + * NEVER INCLUDE THIS FILE IN YOUR MOD!!! + * + * The Container I use for all my Basic Machines + */ +public class GT_Container_MultiMachine extends GT_ContainerMetaTile_Machine { + public GT_Container_MultiMachine(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { + super(aInventoryPlayer, aTileEntity); + } + + public GT_Container_MultiMachine(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, boolean bindInventory) { + super(aInventoryPlayer, aTileEntity, bindInventory); + } + + @Override + public void addSlots(InventoryPlayer aInventoryPlayer) { + addSlotToContainer(new Slot(mTileEntity, 1, 152, 5)); + } + + @Override + public int getSlotCount() { + return 1; + } + + @Override + public int getShiftClickSlotCount() { + return 1; + } +} diff --git a/src/main/java/gregtech/api/gui/GT_GUIContainer.java b/src/main/java/gregtech/api/gui/GT_GUIContainer.java new file mode 100644 index 0000000..a92ca35 --- /dev/null +++ b/src/main/java/gregtech/api/gui/GT_GUIContainer.java @@ -0,0 +1,67 @@ +package gregtech.api.gui; + +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.inventory.Container; +import net.minecraft.util.ResourceLocation; + +/** + * NEVER INCLUDE THIS FILE IN YOUR MOD!!! + * + * Main GUI-Container-Class which basically contains the Code needed to prevent crashes from improperly Coded Items. + */ +public class GT_GUIContainer extends GuiContainer { + + public boolean mCrashed = false; + + public ResourceLocation mGUIbackground; + + public String mGUIbackgroundPath; + + public int getLeft() {return guiLeft;} + public int getTop() {return guiTop;} + + public GT_GUIContainer(Container aContainer, String aGUIbackground) { + super(aContainer); + mGUIbackground = new ResourceLocation(mGUIbackgroundPath = aGUIbackground); + } + + @Override + protected void drawGuiContainerForegroundLayer(int par1, int par2) { + // + } + + @Override + protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { + mc.renderEngine.bindTexture(mGUIbackground); + } + + @Override + public void drawScreen(int par1, int par2, float par3) { + try { + super.drawScreen(par1, par2, par3); + } catch(Throwable e) { + try { + Tessellator.instance.draw(); + } catch(Throwable f) { + // + } + } + } + /* + @Override + protected void drawSlotInventory(Slot par1Slot) { + try { + super.drawSlotInventory(par1Slot); + } catch(Throwable e) { + try { + Tessellator.instance.draw(); + } catch(Throwable f) {} + if (!mCrashed) { + GT_Log.out.println("Clientside Slot drawing Crash prevented. Seems one Itemstack causes Problems with negative Damage Values or the Wildcard Damage Value. This is absolutely NOT a Bug of the GregTech-Addon, so don't even think about reporting it to me, it's a Bug of the Mod, which belongs to the almost-crash-causing Item, so bug that Mods Author and not me! Did you hear it? NOT ME!!!"); + e.printStackTrace(); + mCrashed = true; + } + } + }*/ +} diff --git a/src/main/java/gregtech/api/gui/GT_GUIContainerMetaTile_Machine.java b/src/main/java/gregtech/api/gui/GT_GUIContainerMetaTile_Machine.java new file mode 100644 index 0000000..cad4cf4 --- /dev/null +++ b/src/main/java/gregtech/api/gui/GT_GUIContainerMetaTile_Machine.java @@ -0,0 +1,39 @@ +package gregtech.api.gui; + +import org.lwjgl.opengl.GL11; + +import gregtech.api.GregTech_API; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemDye; + +/** + * NEVER INCLUDE THIS FILE IN YOUR MOD!!! + * + * The GUI-Container I use for all my MetaTileEntities + */ +public class GT_GUIContainerMetaTile_Machine extends GT_GUIContainer { + + public final GT_ContainerMetaTile_Machine mContainer; + + public GT_GUIContainerMetaTile_Machine(GT_ContainerMetaTile_Machine aContainer, String aGUIbackground) { + super(aContainer, aGUIbackground); + mContainer = aContainer; + } + + public GT_GUIContainerMetaTile_Machine(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aGUIbackground) { + this(new GT_ContainerMetaTile_Machine(aInventoryPlayer, aTileEntity), aGUIbackground); + } + + @Override + protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { + super.drawGuiContainerBackgroundLayer(par1, par2, par3); + if (GregTech_API.sColoredGUI && mContainer != null && mContainer.mTileEntity != null) { + int tColor = mContainer.mTileEntity.getColorization() & 15; + if (tColor >= 0 && tColor < ItemDye.field_150922_c.length) { + tColor = ItemDye.field_150922_c[tColor]; + GL11.glColor4f(((tColor >> 16) & 255) / 255.0F, ((tColor >> 8) & 255) / 255.0F, (tColor & 255) / 255.0F, 1.0F); + } else GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + } else GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/gui/GT_GUIContainer_1by1.java b/src/main/java/gregtech/api/gui/GT_GUIContainer_1by1.java new file mode 100644 index 0000000..6528a12 --- /dev/null +++ b/src/main/java/gregtech/api/gui/GT_GUIContainer_1by1.java @@ -0,0 +1,29 @@ +package gregtech.api.gui; + +import static gregtech.api.enums.GT_Values.RES_PATH_GUI; + +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import net.minecraft.entity.player.InventoryPlayer; + +public class GT_GUIContainer_1by1 extends GT_GUIContainerMetaTile_Machine { + + private final String mName; + + public GT_GUIContainer_1by1(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) { + super(new GT_Container_1by1(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "1by1.png"); + mName = aName; + } + + @Override + protected void drawGuiContainerForegroundLayer(int par1, int par2) { + fontRendererObj.drawString(mName, 8, 4, 4210752); + } + + @Override + protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { + super.drawGuiContainerBackgroundLayer(par1, par2, par3); + int x = (width - xSize) / 2; + int y = (height - ySize) / 2; + drawTexturedModalRect(x, y, 0, 0, xSize, ySize); + } +} diff --git a/src/main/java/gregtech/api/gui/GT_GUIContainer_2by2.java b/src/main/java/gregtech/api/gui/GT_GUIContainer_2by2.java new file mode 100644 index 0000000..e5d7612 --- /dev/null +++ b/src/main/java/gregtech/api/gui/GT_GUIContainer_2by2.java @@ -0,0 +1,29 @@ +package gregtech.api.gui; + +import static gregtech.api.enums.GT_Values.RES_PATH_GUI; + +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import net.minecraft.entity.player.InventoryPlayer; + +public class GT_GUIContainer_2by2 extends GT_GUIContainerMetaTile_Machine { + + private final String mName; + + public GT_GUIContainer_2by2(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) { + super(new GT_Container_2by2(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "2by2.png"); + mName = aName; + } + + @Override + protected void drawGuiContainerForegroundLayer(int par1, int par2) { + fontRendererObj.drawString(mName, 8, 4, 4210752); + } + + @Override + protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { + super.drawGuiContainerBackgroundLayer(par1, par2, par3); + int x = (width - xSize) / 2; + int y = (height - ySize) / 2; + drawTexturedModalRect(x, y, 0, 0, xSize, ySize); + } +} diff --git a/src/main/java/gregtech/api/gui/GT_GUIContainer_3by3.java b/src/main/java/gregtech/api/gui/GT_GUIContainer_3by3.java new file mode 100644 index 0000000..6432819 --- /dev/null +++ b/src/main/java/gregtech/api/gui/GT_GUIContainer_3by3.java @@ -0,0 +1,29 @@ +package gregtech.api.gui; + +import static gregtech.api.enums.GT_Values.RES_PATH_GUI; + +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import net.minecraft.entity.player.InventoryPlayer; + +public class GT_GUIContainer_3by3 extends GT_GUIContainerMetaTile_Machine { + + private final String mName; + + public GT_GUIContainer_3by3(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) { + super(new GT_Container_3by3(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "3by3.png"); + mName = aName; + } + + @Override + protected void drawGuiContainerForegroundLayer(int par1, int par2) { + fontRendererObj.drawString(mName, 8, 4, 4210752); + } + + @Override + protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { + super.drawGuiContainerBackgroundLayer(par1, par2, par3); + int x = (width - xSize) / 2; + int y = (height - ySize) / 2; + drawTexturedModalRect(x, y, 0, 0, xSize, ySize); + } +} diff --git a/src/main/java/gregtech/api/gui/GT_GUIContainer_4by4.java b/src/main/java/gregtech/api/gui/GT_GUIContainer_4by4.java new file mode 100644 index 0000000..df19fae --- /dev/null +++ b/src/main/java/gregtech/api/gui/GT_GUIContainer_4by4.java @@ -0,0 +1,29 @@ +package gregtech.api.gui; + +import static gregtech.api.enums.GT_Values.RES_PATH_GUI; + +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import net.minecraft.entity.player.InventoryPlayer; + +public class GT_GUIContainer_4by4 extends GT_GUIContainerMetaTile_Machine { + + private final String mName; + + public GT_GUIContainer_4by4(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) { + super(new GT_Container_4by4(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "4by4.png"); + mName = aName; + } + + @Override + protected void drawGuiContainerForegroundLayer(int par1, int par2) { + fontRendererObj.drawString(mName, 8, 4, 4210752); + } + + @Override + protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { + super.drawGuiContainerBackgroundLayer(par1, par2, par3); + int x = (width - xSize) / 2; + int y = (height - ySize) / 2; + drawTexturedModalRect(x, y, 0, 0, xSize, ySize); + } +} diff --git a/src/main/java/gregtech/api/gui/GT_GUIContainer_BasicMachine.java b/src/main/java/gregtech/api/gui/GT_GUIContainer_BasicMachine.java new file mode 100644 index 0000000..87a9a46 --- /dev/null +++ b/src/main/java/gregtech/api/gui/GT_GUIContainer_BasicMachine.java @@ -0,0 +1,64 @@ +package gregtech.api.gui; + +import static gregtech.api.enums.GT_Values.RES_PATH_GUI; + +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import net.minecraft.entity.player.InventoryPlayer; + +/** + * NEVER INCLUDE THIS FILE IN YOUR MOD!!! + * + * The GUI-Container I use for all my Basic Machines + * + * As the NEI-RecipeTransferRect Handler can't handle one GUI-Class for all GUIs I needed to produce some dummy-classes which extend this class + */ +public class GT_GUIContainer_BasicMachine extends GT_GUIContainerMetaTile_Machine { + + public final String mName, mNEI; + public final byte mProgressBarDirection, mProgressBarAmount; + + public GT_GUIContainer_BasicMachine(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aTextureFile, String aNEI) { + this(aInventoryPlayer, aTileEntity, aName, aTextureFile, aNEI, (byte)0, (byte)1); + } + + public GT_GUIContainer_BasicMachine(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aTextureFile, String aNEI, byte aProgressBarDirection, byte aProgressBarAmount) { + super(new GT_Container_BasicMachine(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "basicmachines/" + aTextureFile); + mProgressBarDirection = aProgressBarDirection; + mProgressBarAmount = (byte)Math.max(1, aProgressBarAmount); + mName = aName; + mNEI = aNEI; + } + + @Override + protected void drawGuiContainerForegroundLayer(int par1, int par2) { + fontRendererObj.drawString(mName, 8, 4, 4210752); + } + + @Override + protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { + super.drawGuiContainerBackgroundLayer(par1, par2, par3); + int x = (width - xSize) / 2; + int y = (height - ySize) / 2; + drawTexturedModalRect(x, y, 0, 0, xSize, ySize); + if (mContainer != null) { + if (((GT_Container_BasicMachine)mContainer).mFluidTransfer) drawTexturedModalRect(x + 7, y + 62, 176, 18, 18, 18); + if (((GT_Container_BasicMachine)mContainer).mItemTransfer) drawTexturedModalRect(x + 25, y + 62, 176, 36, 18, 18); + if (((GT_Container_BasicMachine)mContainer).mStuttering) drawTexturedModalRect(x + 79, y + 44, 176, 54, 18, 18); + + if (mContainer.mMaxProgressTime > 0) { + int tSize = (mProgressBarDirection < 2 ? 20 : 18), tProgress = Math.max(1, Math.min(tSize * mProgressBarAmount, (mContainer.mProgressTime>0?1:0) + (mContainer.mProgressTime * tSize * mProgressBarAmount) / mContainer.mMaxProgressTime)) % (tSize+1); + + switch (mProgressBarDirection) { // yes, my OCD was mad at me before I did the Tabs. + case 0: drawTexturedModalRect(x + 78 , y + 24 , 176 , 0 , tProgress , 18 ); break; + case 1: drawTexturedModalRect(x + 78 + 20 - tProgress , y + 24 , 176 + 20 - tProgress , 0 , tProgress , 18 ); break; + case 2: drawTexturedModalRect(x + 78 , y + 24 , 176 , 0 , 20 , tProgress ); break; + case 3: drawTexturedModalRect(x + 78 , y + 24 + 18 - tProgress , 176 , 18 - tProgress , 20 , tProgress ); break; + case 4: tProgress = 20 - tProgress; drawTexturedModalRect(x + 78 , y + 24 , 176 , 0 , tProgress , 18 ); break; + case 5: tProgress = 20 - tProgress; drawTexturedModalRect(x + 78 + 20 - tProgress , y + 24 , 176 + 20 - tProgress , 0 , tProgress , 18 ); break; + case 6: tProgress = 18 - tProgress; drawTexturedModalRect(x + 78 , y + 24 , 176 , 0 , 20 , tProgress ); break; + case 7: tProgress = 18 - tProgress; drawTexturedModalRect(x + 78 , y + 24 + 18 - tProgress , 176 , 18 - tProgress , 20 , tProgress ); break; + } + } + } + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/gui/GT_GUIContainer_BasicTank.java b/src/main/java/gregtech/api/gui/GT_GUIContainer_BasicTank.java new file mode 100644 index 0000000..da99cda --- /dev/null +++ b/src/main/java/gregtech/api/gui/GT_GUIContainer_BasicTank.java @@ -0,0 +1,36 @@ +package gregtech.api.gui; + +import static gregtech.api.enums.GT_Values.RES_PATH_GUI; + +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.util.GT_Utility; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.util.StatCollector; + +public class GT_GUIContainer_BasicTank extends GT_GUIContainerMetaTile_Machine { + + private final String mName; + + public GT_GUIContainer_BasicTank(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) { + super(new GT_Container_BasicTank(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "BasicTank.png"); + mName = aName; + } + + @Override + protected void drawGuiContainerForegroundLayer(int par1, int par2) { + fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 8, ySize - 96 + 2, 4210752); + fontRendererObj.drawString(mName, 8, 6, 4210752); + if (mContainer != null) { + fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255); + fontRendererObj.drawString(GT_Utility.parseNumberToString(((GT_Container_BasicTank)mContainer).mContent), 10, 30, 16448255); + } + } + + @Override + protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { + super.drawGuiContainerBackgroundLayer(par1, par2, par3); + int x = (width - xSize) / 2; + int y = (height - ySize) / 2; + drawTexturedModalRect(x, y, 0, 0, xSize, ySize); + } +} diff --git a/src/main/java/gregtech/api/gui/GT_GUIContainer_MaintenanceHatch.java b/src/main/java/gregtech/api/gui/GT_GUIContainer_MaintenanceHatch.java new file mode 100644 index 0000000..199affa --- /dev/null +++ b/src/main/java/gregtech/api/gui/GT_GUIContainer_MaintenanceHatch.java @@ -0,0 +1,27 @@ +package gregtech.api.gui; + +import static gregtech.api.enums.GT_Values.RES_PATH_GUI; + +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import net.minecraft.entity.player.InventoryPlayer; + +public class GT_GUIContainer_MaintenanceHatch extends GT_GUIContainerMetaTile_Machine { + + public GT_GUIContainer_MaintenanceHatch(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { + super(new GT_Container_MaintenanceHatch(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "Maintenance.png"); + } + + @Override + protected void drawGuiContainerForegroundLayer(int par1, int par2) { + fontRendererObj.drawString("Maintenance Hatch", 8, 4, 4210752); + fontRendererObj.drawString("Click with Tool to repair.", 8, 12, 4210752); + } + + @Override + protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { + super.drawGuiContainerBackgroundLayer(par1, par2, par3); + int x = (width - xSize) / 2; + int y = (height - ySize) / 2; + drawTexturedModalRect(x, y, 0, 0, xSize, ySize); + } +} diff --git a/src/main/java/gregtech/api/gui/GT_GUIContainer_MultiMachine.java b/src/main/java/gregtech/api/gui/GT_GUIContainer_MultiMachine.java new file mode 100644 index 0000000..5a4c8cf --- /dev/null +++ b/src/main/java/gregtech/api/gui/GT_GUIContainer_MultiMachine.java @@ -0,0 +1,56 @@ +package gregtech.api.gui; + +import static gregtech.api.enums.GT_Values.RES_PATH_GUI; + +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import net.minecraft.entity.player.InventoryPlayer; + +/** + * NEVER INCLUDE THIS FILE IN YOUR MOD!!! + * + * The GUI-Container I use for all my Basic Machines + * + * As the NEI-RecipeTransferRect Handler can't handle one GUI-Class for all GUIs I needed to produce some dummy-classes which extend this class + */ +public class GT_GUIContainer_MultiMachine extends GT_GUIContainerMetaTile_Machine { + + String mName = ""; + + public GT_GUIContainer_MultiMachine(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aTextureFile) { + super(new GT_Container_MultiMachine(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "multimachines/" + (aTextureFile==null?"MultiblockDisplay":aTextureFile)); + mName = aName; + } + + @Override + protected void drawGuiContainerForegroundLayer(int par1, int par2) { + fontRendererObj.drawString(mName, 10, 8, 16448255); + + if (mContainer != null) { + if ((((GT_Container_MultiMachine)mContainer).mDisplayErrorCode & 1) != 0) fontRendererObj.drawString("Pipe is loose.", 10, 16, 16448255); + if ((((GT_Container_MultiMachine)mContainer).mDisplayErrorCode & 2) != 0) fontRendererObj.drawString("Screws are missing.", 10, 24, 16448255); + if ((((GT_Container_MultiMachine)mContainer).mDisplayErrorCode & 4) != 0) fontRendererObj.drawString("Something is stuck.", 10, 32, 16448255); + if ((((GT_Container_MultiMachine)mContainer).mDisplayErrorCode & 8) != 0) fontRendererObj.drawString("Platings are dented.", 10, 40, 16448255); + if ((((GT_Container_MultiMachine)mContainer).mDisplayErrorCode & 16) != 0) fontRendererObj.drawString("Circuitry burned out.", 10, 48, 16448255); + if ((((GT_Container_MultiMachine)mContainer).mDisplayErrorCode & 32) != 0) fontRendererObj.drawString("That doesn't belong there.", 10, 56, 16448255); + if ((((GT_Container_MultiMachine)mContainer).mDisplayErrorCode & 64) != 0) fontRendererObj.drawString("Incomplete Structure.", 10, 64, 16448255); + + if (((GT_Container_MultiMachine)mContainer).mDisplayErrorCode == 0) { + if (((GT_Container_MultiMachine)mContainer).mActive == 0) { + fontRendererObj.drawString("Hit with Soft Hammer", 10, 16, 16448255); + fontRendererObj.drawString("to (re-)start the Machine", 10, 24, 16448255); + fontRendererObj.drawString("if it doesn't start.", 10, 32, 16448255); + } else { + fontRendererObj.drawString("Running perfectly.", 10, 16, 16448255); + } + } + } + } + + @Override + protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { + super.drawGuiContainerBackgroundLayer(par1, par2, par3); + int x = (width - xSize) / 2; + int y = (height - ySize) / 2; + drawTexturedModalRect(x, y, 0, 0, xSize, ySize); + } +} diff --git a/src/main/java/gregtech/api/gui/GT_Slot_Armor.java b/src/main/java/gregtech/api/gui/GT_Slot_Armor.java new file mode 100644 index 0000000..fdd89bc --- /dev/null +++ b/src/main/java/gregtech/api/gui/GT_Slot_Armor.java @@ -0,0 +1,27 @@ +package gregtech.api.gui; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; + +public class GT_Slot_Armor extends Slot { + final int mArmorType; + final EntityPlayer mPlayer; + + public GT_Slot_Armor(IInventory par2IInventory, int par3, int par4, int par5, int par6, EntityPlayer aPlayer) { + super(par2IInventory, par3, par4, par5); + mArmorType = par6; + mPlayer = aPlayer; + } + + @Override + public int getSlotStackLimit() { + return 1; + } + + @Override + public boolean isItemValid(ItemStack aStack) { + return aStack != null && aStack.getItem() != null && aStack.getItem().isValidArmor(aStack, mArmorType, mPlayer); + } +} diff --git a/src/main/java/gregtech/api/gui/GT_Slot_DataOrb.java b/src/main/java/gregtech/api/gui/GT_Slot_DataOrb.java new file mode 100644 index 0000000..bd24714 --- /dev/null +++ b/src/main/java/gregtech/api/gui/GT_Slot_DataOrb.java @@ -0,0 +1,17 @@ +package gregtech.api.gui; + +import gregtech.api.enums.ItemList; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; + +public class GT_Slot_DataOrb extends Slot { + public GT_Slot_DataOrb(IInventory par1iInventory, int par2, int par3, int par4) { + super(par1iInventory, par2, par3, par4); + } + + @Override + public boolean isItemValid(ItemStack aStack) { + return ItemList.Tool_DataOrb.isStackEqual(aStack, false, true); + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/gui/GT_Slot_Holo.java b/src/main/java/gregtech/api/gui/GT_Slot_Holo.java new file mode 100644 index 0000000..87bb9c5 --- /dev/null +++ b/src/main/java/gregtech/api/gui/GT_Slot_Holo.java @@ -0,0 +1,46 @@ +package gregtech.api.gui; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; + +public class GT_Slot_Holo extends Slot { + public final int mSlotIndex; + public boolean mCanInsertItem, mCanStackItem; + public int mMaxStacksize = 127; + + public GT_Slot_Holo(IInventory par1iInventory, int par2, int par3, int par4, boolean aCanInsertItem, boolean aCanStackItem, int aMaxStacksize) { + super(par1iInventory, par2, par3, par4); + mCanInsertItem = aCanInsertItem; + mCanStackItem = aCanStackItem; + mMaxStacksize = aMaxStacksize; + mSlotIndex = par2; + } + + @Override + public boolean isItemValid(ItemStack par1ItemStack) { + return mCanInsertItem; + } + + @Override + public int getSlotStackLimit() { + return mMaxStacksize; + } + + @Override + public boolean getHasStack() { + return false; + } + + @Override + public ItemStack decrStackSize(int par1) { + if (!mCanStackItem) return null; + return super.decrStackSize(par1); + } + + @Override + public boolean canTakeStack(EntityPlayer par1EntityPlayer) { + return false; + } +} diff --git a/src/main/java/gregtech/api/gui/GT_Slot_Output.java b/src/main/java/gregtech/api/gui/GT_Slot_Output.java new file mode 100644 index 0000000..3c91380 --- /dev/null +++ b/src/main/java/gregtech/api/gui/GT_Slot_Output.java @@ -0,0 +1,16 @@ +package gregtech.api.gui; + +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; + +public class GT_Slot_Output extends Slot { + public GT_Slot_Output(IInventory par1iInventory, int par2, int par3, int par4) { + super(par1iInventory, par2, par3, par4); + } + + @Override + public boolean isItemValid(ItemStack par1ItemStack) { + return false; + } +} diff --git a/src/main/java/gregtech/api/gui/GT_Slot_Render.java b/src/main/java/gregtech/api/gui/GT_Slot_Render.java new file mode 100644 index 0000000..15f4c33 --- /dev/null +++ b/src/main/java/gregtech/api/gui/GT_Slot_Render.java @@ -0,0 +1,22 @@ +package gregtech.api.gui; + +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; + +public class GT_Slot_Render extends GT_Slot_Holo { + public GT_Slot_Render(IInventory par1iInventory, int par2, int par3, int par4) { + super(par1iInventory, par2, par3, par4, false, false, 0); + } + + /** + * NEI has a nice and "useful" Delete-All Function, which would delete the Content of this Slot. This is here to prevent that. + */ + @Override + public void putStack(ItemStack aStack) { + if (inventory instanceof TileEntity && ((TileEntity)inventory).getWorldObj().isRemote) { + inventory.setInventorySlotContents(getSlotIndex(), aStack); + } + onSlotChanged(); + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/IColorModulationContainer.java b/src/main/java/gregtech/api/interfaces/IColorModulationContainer.java new file mode 100644 index 0000000..b1151cf --- /dev/null +++ b/src/main/java/gregtech/api/interfaces/IColorModulationContainer.java @@ -0,0 +1,5 @@ +package gregtech.api.interfaces; + +public interface IColorModulationContainer { + public short[] getRGBA(); +} diff --git a/src/main/java/gregtech/api/interfaces/ICondition.java b/src/main/java/gregtech/api/interfaces/ICondition.java new file mode 100644 index 0000000..507315e --- /dev/null +++ b/src/main/java/gregtech/api/interfaces/ICondition.java @@ -0,0 +1,104 @@ +package gregtech.api.interfaces; + +public interface ICondition { + public boolean isTrue(O aObject); + + // Utility Classes for adding relations between Conditions. + + public static class Not implements ICondition { + private final ICondition mCondition; + + public Not(ICondition aCondition) { + mCondition = aCondition; + } + + @Override + public boolean isTrue(O aObject) { + return !mCondition.isTrue(aObject); + } + } + + public static class Or implements ICondition { + private final ICondition[] mConditions; + + public Or(ICondition... aConditions) { + mConditions = aConditions; + } + + @Override + public boolean isTrue(O aObject) { + for (ICondition tCondition : mConditions) if (tCondition.isTrue(aObject)) return true; + return false; + } + } + + public static class Nor implements ICondition { + private final ICondition[] mConditions; + + public Nor(ICondition... aConditions) { + mConditions = aConditions; + } + + @Override + public boolean isTrue(O aObject) { + for (ICondition tCondition : mConditions) if (tCondition.isTrue(aObject)) return false; + return true; + } + } + + public static class And implements ICondition { + private final ICondition[] mConditions; + + public And(ICondition... aConditions) { + mConditions = aConditions; + } + + @Override + public boolean isTrue(O aObject) { + for (ICondition tCondition : mConditions) if (!tCondition.isTrue(aObject)) return false; + return true; + } + } + + public static class Nand implements ICondition { + private final ICondition[] mConditions; + + public Nand(ICondition... aConditions) { + mConditions = aConditions; + } + + @Override + public boolean isTrue(O aObject) { + for (ICondition tCondition : mConditions) if (!tCondition.isTrue(aObject)) return true; + return false; + } + } + + public static class Xor implements ICondition { + private final ICondition mCondition1, mCondition2; + + public Xor(ICondition aCondition1, ICondition aCondition2) { + mCondition1 = aCondition1; + mCondition2 = aCondition2; + } + + @Override + public boolean isTrue(O aObject) { + return mCondition1.isTrue(aObject) != mCondition2.isTrue(aObject); + } + } + + public static class Equal implements ICondition { + private final ICondition mCondition1, mCondition2; + + public Equal(ICondition aCondition1, ICondition aCondition2) { + mCondition1 = aCondition1; + mCondition2 = aCondition2; + } + + @Override + public boolean isTrue(O aObject) { + return mCondition1.isTrue(aObject) == mCondition2.isTrue(aObject); + } + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/IDamagableItem.java b/src/main/java/gregtech/api/interfaces/IDamagableItem.java new file mode 100644 index 0000000..f47c65f --- /dev/null +++ b/src/main/java/gregtech/api/interfaces/IDamagableItem.java @@ -0,0 +1,7 @@ +package gregtech.api.interfaces; + +import net.minecraft.item.ItemStack; + +public interface IDamagableItem { + public boolean doDamageToItem(ItemStack aStack, int aVanillaDamage); +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/IDebugableBlock.java b/src/main/java/gregtech/api/interfaces/IDebugableBlock.java new file mode 100644 index 0000000..ce95982 --- /dev/null +++ b/src/main/java/gregtech/api/interfaces/IDebugableBlock.java @@ -0,0 +1,26 @@ +package gregtech.api.interfaces; + +import java.util.ArrayList; + +import net.minecraft.entity.player.EntityPlayer; + +/** + * You are allowed to include this File in your Download, as i will not change it. + */ +public interface IDebugableBlock { + /** + * Returns a Debug Message, for a generic DebugItem + * Blocks have to implement this interface NOT TileEntities! + * @param aPlayer the Player, who rightclicked with his Debug Item + * @param aX Block-Coordinate + * @param aY Block-Coordinate + * @param aZ Block-Coordinate + * @param aLogLevel the Log Level of the Debug Item. + * 0 = Obvious + * 1 = Visible for the regular Scanner + * 2 = Only visible to more advanced Scanners + * 3 = Debug ONLY + * @return a String-Array containing the DebugInfo, every Index is a separate line (0 = first Line) + */ + public ArrayList getDebugInfo(EntityPlayer aPlayer, int aX, int aY, int aZ, int aLogLevel); +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/IDescribable.java b/src/main/java/gregtech/api/interfaces/IDescribable.java new file mode 100644 index 0000000..7ccf1a6 --- /dev/null +++ b/src/main/java/gregtech/api/interfaces/IDescribable.java @@ -0,0 +1,11 @@ +package gregtech.api.interfaces; + +/** + * To get simple things like a ToolTip Description + */ +public interface IDescribable { + /** + * The Tooltip Text + */ + public String[] getDescription(); +} diff --git a/src/main/java/gregtech/api/interfaces/IFoodStat.java b/src/main/java/gregtech/api/interfaces/IFoodStat.java new file mode 100644 index 0000000..cb01e10 --- /dev/null +++ b/src/main/java/gregtech/api/interfaces/IFoodStat.java @@ -0,0 +1,21 @@ +package gregtech.api.interfaces; + +import gregtech.api.items.GT_MetaBase_Item; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumAction; +import net.minecraft.item.ItemStack; + +public interface IFoodStat { + /** Warning the "aPlayer" Parameter may be null! */ + public int getFoodLevel(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer); + /** Warning the "aPlayer" Parameter may be null! */ + public float getSaturation(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer); + /** Warning the "aPlayer" Parameter may be null! */ + public boolean alwaysEdible(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer); + /** Warning the "aPlayer" Parameter may be null! */ + public boolean isRotten(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer); + /** Warning the "aPlayer" Parameter may be null! */ + public EnumAction getFoodAction(GT_MetaBase_Item aItem, ItemStack aStack); + + public void onEaten(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer); +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/IIconContainer.java b/src/main/java/gregtech/api/interfaces/IIconContainer.java new file mode 100644 index 0000000..dc9a845 --- /dev/null +++ b/src/main/java/gregtech/api/interfaces/IIconContainer.java @@ -0,0 +1,21 @@ +package gregtech.api.interfaces; + +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; + +public interface IIconContainer { + /** + * @return A regular Icon. + */ + public IIcon getIcon(); + + /** + * @return Icon of the Overlay (or null if there is no Icon) + */ + public IIcon getOverlayIcon(); + + /** + * @return the Default Texture File for this Icon. + */ + public ResourceLocation getTextureFile(); +} diff --git a/src/main/java/gregtech/api/interfaces/IItemBehaviour.java b/src/main/java/gregtech/api/interfaces/IItemBehaviour.java new file mode 100644 index 0000000..7adc551 --- /dev/null +++ b/src/main/java/gregtech/api/interfaces/IItemBehaviour.java @@ -0,0 +1,29 @@ +package gregtech.api.interfaces; + +import java.util.List; + +import gregtech.api.enums.SubTag; +import gregtech.api.items.GT_MetaBase_Item; +import net.minecraft.dispenser.IBlockSource; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public interface IItemBehaviour { + public boolean onLeftClickEntity(E aItem, ItemStack aStack, EntityPlayer aPlayer, Entity aEntity); + public boolean onItemUse(E aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ); + public boolean onItemUseFirst(E aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ); + public ItemStack onItemRightClick(E aItem, ItemStack aStack, World aWorld, EntityPlayer aPlayer); + public List getAdditionalToolTips(E aItem, List aList, ItemStack aStack); + public void onUpdate(E aItem, ItemStack aStack, World aWorld, Entity aPlayer, int aTimer, boolean aIsInHand); + public boolean isItemStackUsable(E aItem, ItemStack aStack); + public boolean canDispense(E aItem, IBlockSource aSource, ItemStack aStack); + public ItemStack onDispense(E aItem, IBlockSource aSource, ItemStack aStack); + public boolean hasProjectile(GT_MetaBase_Item aItem, SubTag aProjectileType, ItemStack aStack); + public EntityArrow getProjectile(E aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, double aX, double aY, double aZ); + public EntityArrow getProjectile(E aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, EntityLivingBase aEntity, float aSpeed); +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/IItemContainer.java b/src/main/java/gregtech/api/interfaces/IItemContainer.java new file mode 100644 index 0000000..e61553c --- /dev/null +++ b/src/main/java/gregtech/api/interfaces/IItemContainer.java @@ -0,0 +1,24 @@ +package gregtech.api.interfaces; + +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +public interface IItemContainer { + public Item getItem(); + public Block getBlock(); + public boolean isStackEqual(Object aStack); + public boolean isStackEqual(Object aStack, boolean aWildcard, boolean aIgnoreNBT); + public ItemStack get(long aAmount, Object... aReplacements); + public ItemStack getWildcard(long aAmount, Object... aReplacements); + public ItemStack getUndamaged(long aAmount, Object... aReplacements); + public ItemStack getAlmostBroken(long aAmount, Object... aReplacements); + public ItemStack getWithDamage(long aAmount, long aMetaValue, Object... aReplacements); + public IItemContainer set(Item aItem); + public IItemContainer set(ItemStack aStack); + public IItemContainer registerOre(Object... aOreNames); + public IItemContainer registerWildcardAsOre(Object... aOreNames); + public ItemStack getWithCharge(long aAmount, int aEnergy, Object... aReplacements); + public ItemStack getWithName(long aAmount, String aDisplayName, Object... aReplacements); + public boolean hasBeenSet(); +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/IOreRecipeRegistrator.java b/src/main/java/gregtech/api/interfaces/IOreRecipeRegistrator.java new file mode 100644 index 0000000..4535c4d --- /dev/null +++ b/src/main/java/gregtech/api/interfaces/IOreRecipeRegistrator.java @@ -0,0 +1,15 @@ +package gregtech.api.interfaces; + +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import net.minecraft.item.ItemStack; + +public interface IOreRecipeRegistrator { + /** + * Contains a Code Fragment, used in the OrePrefix to register Recipes. Better than using a switch/case, like I did before. + * @param aPrefix always != null + * @param aMaterial always != null, and can be == _NULL if the Prefix is Self Referencing or not Material based! + * @param aStack always != null + */ + public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack); +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/IProjectileItem.java b/src/main/java/gregtech/api/interfaces/IProjectileItem.java new file mode 100644 index 0000000..0b06a65 --- /dev/null +++ b/src/main/java/gregtech/api/interfaces/IProjectileItem.java @@ -0,0 +1,16 @@ +package gregtech.api.interfaces; + +import gregtech.api.enums.SubTag; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public interface IProjectileItem { + /** @return if this Item has an Arrow Entity */ + public boolean hasProjectile(SubTag aProjectileType, ItemStack aStack); + /** @return an Arrow Entity to be spawned. If null then this is not an Arrow. Note: Other Projectiles still extend EntityArrow */ + public EntityArrow getProjectile(SubTag aProjectileType, ItemStack aStack, World aWorld, double aX, double aY, double aZ); + /** @return an Arrow Entity to be spawned. If null then this is not an Arrow. Note: Other Projectiles still extend EntityArrow */ + public EntityArrow getProjectile(SubTag aProjectileType, ItemStack aStack, World aWorld, EntityLivingBase aEntity, float aSpeed); +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/IRedstoneCircuitBlock.java b/src/main/java/gregtech/api/interfaces/IRedstoneCircuitBlock.java new file mode 100644 index 0000000..13c63b7 --- /dev/null +++ b/src/main/java/gregtech/api/interfaces/IRedstoneCircuitBlock.java @@ -0,0 +1,66 @@ +package gregtech.api.interfaces; + +import gregtech.api.interfaces.tileentity.ICoverable; +import gregtech.api.util.GT_CoverBehavior; +import net.minecraft.block.Block; +import net.minecraft.tileentity.TileEntity; + +/** + * Implemented by the MetaTileEntity of the Redstone Circuit Block + */ +public interface IRedstoneCircuitBlock { + /** + * The Output Direction the Circuit Block is Facing + */ + public byte getOutputFacing(); + + /** + * sets Output Redstone State at Side + */ + public boolean setRedstone(byte aStrength, byte aSide); + + /** + * returns Output Redstone State at Side + * Note that setRedstone checks if there is a Difference between the old and the new Setting before consuming any Energy + */ + public byte getOutputRedstone(byte aSide); + + /** + * returns Input Redstone Signal at Side + */ + public byte getInputRedstone(byte aSide); + + /** + * If this Side is Covered up and therefor not doing any Redstone + */ + public GT_CoverBehavior getCover(byte aSide); + + public int getCoverID(byte aSide); + + public int getCoverVariable(byte aSide); + + /** + * returns whatever Block-ID is adjacent to the Redstone Circuit Block + */ + public Block getBlockAtSide(byte aSide); + + /** + * returns whatever Meta-Value is adjacent to the Redstone Circuit Block + */ + public byte getMetaIDAtSide(byte aSide); + + /** + * returns whatever TileEntity is adjacent to the Redstone Circuit Block + */ + public TileEntity getTileEntityAtSide(byte aSide); + + /** + * returns whatever TileEntity is used by the Redstone Circuit Block + */ + public ICoverable getOwnTileEntity(); + + /** + * returns worldObj.rand.nextInt(aRange) + */ + public int getRandom(int aRange); +} diff --git a/src/main/java/gregtech/api/interfaces/ISubTagContainer.java b/src/main/java/gregtech/api/interfaces/ISubTagContainer.java new file mode 100644 index 0000000..ae7d59e --- /dev/null +++ b/src/main/java/gregtech/api/interfaces/ISubTagContainer.java @@ -0,0 +1,20 @@ +package gregtech.api.interfaces; + +import gregtech.api.enums.SubTag; + +public interface ISubTagContainer { + /** + * @return if the Tag is inside the List. + */ + public boolean contains(SubTag aTag); + + /** + * @return The ISubTagContainer you called this Function on, for convenience. + */ + public ISubTagContainer add(SubTag... aTags); + + /** + * @return if the Tag was there before it has been removed. + */ + public boolean remove(SubTag aTag); +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/ITexture.java b/src/main/java/gregtech/api/interfaces/ITexture.java new file mode 100644 index 0000000..534a738 --- /dev/null +++ b/src/main/java/gregtech/api/interfaces/ITexture.java @@ -0,0 +1,15 @@ +package gregtech.api.interfaces; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; + +public interface ITexture { + public void renderXPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ); + public void renderXNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ); + public void renderYPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ); + public void renderYNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ); + public void renderZPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ); + public void renderZNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ); + + public boolean isValidTexture(); +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/IToolStats.java b/src/main/java/gregtech/api/interfaces/IToolStats.java new file mode 100644 index 0000000..6cf5e3a --- /dev/null +++ b/src/main/java/gregtech/api/interfaces/IToolStats.java @@ -0,0 +1,146 @@ +package gregtech.api.interfaces; + +import java.util.List; + +import gregtech.api.items.GT_MetaGenerated_Tool; +import net.minecraft.block.Block; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.DamageSource; +import net.minecraftforge.event.world.BlockEvent; + +/** + * The Stats for GT Tools. Not including any Material Modifiers. + * + * And this is supposed to not have any ItemStack Parameters as these are generic Stats. + */ +public interface IToolStats { + /** + * Called when aPlayer crafts this Tool + */ + public void onToolCrafted(ItemStack aStack, EntityPlayer aPlayer); + + /** + * Called when this gets added to a Tool Item + */ + public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID); + + /** + * @return Damage the Tool receives when breaking a Block. 100 is one Damage Point (or 100 EU). + */ + public int getToolDamagePerBlockBreak(); + + /** + * @return Damage the Tool receives when converting the drops of a Block. 100 is one Damage Point (or 100 EU). + */ + public int getToolDamagePerDropConversion(); + + /** + * @return Damage the Tool receives when being used as Container Item. 100 is one use, however it is usually 8 times more than normal. + */ + public int getToolDamagePerContainerCraft(); + + /** + * @return Damage the Tool receives when being used as Weapon, 200 is the normal Value, 100 for actual Weapons. + */ + public int getToolDamagePerEntityAttack(); + + /** + * @return Basic Quality of the Tool, 0 is normal. If increased, it will increase the general quality of all Tools of this Type. Decreasing is also possible. + */ + public int getBaseQuality(); + + /** + * @return The Damage Bonus for this Type of Tool against Mobs. 1.0F is normal punch. + */ + public float getBaseDamage(); + + /** + * @return This gets the Hurt Resistance time for Entities getting hit. (always does 1 as minimum) + */ + public int getHurtResistanceTime(int aOriginalHurtResistance, Entity aEntity); + + /** + * @return This is a multiplier for the Tool Speed. 1.0F = no special Speed. + */ + public float getSpeedMultiplier(); + + /** + * @return This is a multiplier for the Tool Speed. 1.0F = no special Durability. + */ + public float getMaxDurabilityMultiplier(); + + public DamageSource getDamageSource(EntityLivingBase aPlayer, Entity aEntity); + + public String getMiningSound(); + public String getCraftingSound(); + public String getEntityHitSound(); + public String getBreakingSound(); + + public Enchantment[] getEnchantments(ItemStack aStack); + public int[] getEnchantmentLevels(ItemStack aStack); + + /** + * @return If this Tool can be used for blocking Damage like a Sword. + */ + public boolean canBlock(); + + /** + * @return If this Tool can be used as an RC Crowbar. + */ + public boolean isCrowbar(); + + /** + * @return If this Tool can be used as an RC Crowbar. + */ + public boolean isGrafter(); + + /** + * @return If this Tool can be used as Weapon i.e. if that is the main purpose. + */ + public boolean isWeapon(); + + /** + * @return If this Tool is a Ranged Weapon. Return false at isWeapon unless you have a Blade attached to your Bow/Gun or something + */ + public boolean isRangedWeapon(); + + /** + * @return If this Tool can be used as Weapon i.e. if that is the main purpose. + */ + public boolean isMiningTool(); + + /** + * aBlock.getHarvestTool(aMetaData) can return the following Values for example. + * "axe", "pickaxe", "sword", "shovel", "hoe", "grafter", "saw", "wrench", "crowbar", "file", "hammer", "plow", "plunger", "scoop", "screwdriver", "sense", "scythe", "softhammer", "cutter", "plasmatorch" + * @return If this is a minable Block. Tool Quality checks (like Diamond Tier or something) are separate from this check. + */ + public boolean isMinableBlock(Block aBlock, byte aMetaData); + + /** + * This lets you modify the Drop List, when this type of Tool has been used. + * @return the Amount of modified Items. + */ + public int convertBlockDrops(List aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent); + + /** + * @return Returns a broken Version of the Item. + */ + public ItemStack getBrokenItem(ItemStack aStack); + + /** + * @return the Damage actually done to the Mob. + */ + public float getNormalDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer); + + /** + * @return the Damage actually done to the Mob. + */ + public float getMagicDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer); + + public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack); + public short[] getRGBa(boolean aIsToolHead, ItemStack aStack); +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/internal/IBCTileEntity.java b/src/main/java/gregtech/api/interfaces/internal/IBCTileEntity.java new file mode 100644 index 0000000..3d47173 --- /dev/null +++ b/src/main/java/gregtech/api/interfaces/internal/IBCTileEntity.java @@ -0,0 +1,8 @@ +package gregtech.api.interfaces.internal; + +/** + * A simple compound Interface for generic BuildCraft Code. + */ +public interface IBCTileEntity /*extends IPowerReceptor*/ { + // +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/internal/IGT_CraftingRecipe.java b/src/main/java/gregtech/api/interfaces/internal/IGT_CraftingRecipe.java new file mode 100644 index 0000000..a886cf6 --- /dev/null +++ b/src/main/java/gregtech/api/interfaces/internal/IGT_CraftingRecipe.java @@ -0,0 +1,7 @@ +package gregtech.api.interfaces.internal; + +import net.minecraft.item.crafting.IRecipe; + +public interface IGT_CraftingRecipe extends IRecipe { + public boolean isRemovable(); +} diff --git a/src/main/java/gregtech/api/interfaces/internal/IGT_Mod.java b/src/main/java/gregtech/api/interfaces/internal/IGT_Mod.java new file mode 100644 index 0000000..f64d120 --- /dev/null +++ b/src/main/java/gregtech/api/interfaces/internal/IGT_Mod.java @@ -0,0 +1,34 @@ +package gregtech.api.interfaces.internal; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +/** + * Interface used by the Mods Main Class to reference to internals. + * + * Don't even think about including this File in your Mod. + */ +public interface IGT_Mod { + /** This means that Server specific Basefiles are definitely existing! Not if the World is actually server side or not! */ + public boolean isServerSide(); + /** This means that Client specific Basefiles are definitely existing! Not if the World is actually client side or not! */ + public boolean isClientSide(); + /** This means that Bukkit specific Basefiles are definitely existing! Not if the World is actually bukkit server or not! */ + public boolean isBukkitSide(); + /** works only ClientSide otherwise returns null */ + public EntityPlayer getThePlayer(); + + //---------- Internal Usage Only ---------- + + /** + * works only ClientSide otherwise returns 0 + * @return the Index of the added Armor + */ + public int addArmor(String aArmorPrefix); + + /** + * Plays the Sonictron Sound for the ItemStack on the Client Side + */ + public void doSonictronSound(ItemStack aStack, World aWorld, double aX, double aY, double aZ); +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/internal/IGT_RecipeAdder.java b/src/main/java/gregtech/api/interfaces/internal/IGT_RecipeAdder.java new file mode 100644 index 0000000..7c6e719 --- /dev/null +++ b/src/main/java/gregtech/api/interfaces/internal/IGT_RecipeAdder.java @@ -0,0 +1,411 @@ +package gregtech.api.interfaces.internal; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; + +public interface IGT_RecipeAdder { + /** + * Adds a FusionreactorRecipe + * Does not work anymore! + */ + @Deprecated + public boolean addFusionReactorRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aFusionDurationInTicks, int aFusionEnergyPerTick, int aEnergyNeededForStartingFusion); + + /** + * Adds a FusionreactorRecipe + * @param aInput1 = first Input (not null, and respects StackSize) + * @param aInput2 = second Input (not null, and respects StackSize) + * @param aOutput = Output of the Fusion (can be null, and respects StackSize) + * @param aFusionDurationInTicks = How many ticks the Fusion lasts (must be > 0) + * @param aFusionEnergyPerTick = The EU generated per Tick (can even be negative!) + * @param aEnergyNeededForStartingFusion = EU needed for heating the Reactor up (must be >= 0) + * @return true if the Recipe got added, otherwise false. + */ + public boolean addFusionReactorRecipe(FluidStack aInput1, FluidStack aInput2, FluidStack aOutput1, int aFusionDurationInTicks, int aFusionEnergyPerTick, int aEnergyNeededForStartingFusion); + + /** + * Adds a Centrifuge Recipe + * @param aInput1 must be != null + * @param aCellInput this is for the needed Cells, > 0 for Tincellcount, < 0 for negative Fuelcancount, == 0 for nothing + * @param aOutput1 must be != null + * @param aOutput2 can be null + * @param aOutput3 can be null + * @param aOutput4 can be null + * @param aDuration must be > 0 + */ + public boolean addCentrifugeRecipe(ItemStack aInput1, int aInput2, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, ItemStack aOutput6, int aDuration); + + /** + * Adds a Centrifuge Recipe + * @param aInput1 must be != null + * @param aOutput1 must be != null + * @param aOutput2 can be null + * @param aOutput3 can be null + * @param aOutput4 can be null + * @param aDuration must be > 0 + */ + public boolean addCentrifugeRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, ItemStack aOutput6, int[] aChances, int aDuration, int aEUt); + + /** + * Adds a Electrolyzer Recipe + * @param aInput1 must be != null + * @param aCellInput this is for the needed Cells, > 0 for Tincellcount, < 0 for negative Fuelcancount, == 0 for nothing + * @param aOutput1 must be != null + * @param aOutput2 can be null + * @param aOutput3 can be null + * @param aOutput4 can be null + * @param aDuration must be > 0 + * @param aEUt should be > 0 + */ + public boolean addElectrolyzerRecipe(ItemStack aInput1, int aInput2, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, ItemStack aOutput6, int aDuration, int aEUt); + + /** + * Adds a Electrolyzer Recipe + * @param aInput1 must be != null + * @param aCellInput this is for the needed Cells, > 0 for Tincellcount, < 0 for negative Fuelcancount, == 0 for nothing + * @param aOutput1 must be != null + * @param aOutput2 can be null + * @param aOutput3 can be null + * @param aOutput4 can be null + * @param aDuration must be > 0 + * @param aEUt should be > 0 + */ + public boolean addElectrolyzerRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, ItemStack aOutput6, int[] aChances, int aDuration, int aEUt); + + /** + * Adds a Chemical Recipe + * @param aInput1 must be != null + * @param aInput2 must be != null + * @param aOutput1 must be != null + * @param aDuration must be > 0 + */ + public boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput, int aDuration); + + /** + * Adds a Chemical Recipe + * @param aInput1 must be != null + * @param aInput2 must be != null + * @param aOutput1 must be != null + * @param aDuration must be > 0 + */ + public boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration); + + /** + * Adds a Blast Furnace Recipe + * @param aInput1 must be != null + * @param aInput2 can be null + * @param aOutput1 must be != null + * @param aOutput2 can be null + * @param aDuration must be > 0 + * @param aEUt should be > 0 + * @param aLevel should be > 0 is the minimum Heat Level needed for this Recipe + */ + @Deprecated + public boolean addBlastRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt, int aLevel); + + /** + * Adds a Blast Furnace Recipe + * @param aInput1 must be != null + * @param aInput2 can be null + * @param aOutput1 must be != null + * @param aOutput2 can be null + * @param aDuration must be > 0 + * @param aEUt should be > 0 + * @param aLevel should be > 0 is the minimum Heat Level needed for this Recipe + */ + public boolean addBlastRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt, int aLevel); + + /** + * Adds a Canning Machine Recipe + * @param aInput1 must be != null + * @param aOutput1 must be != null + * @param aDuration must be > 0, 100 ticks is standard. + * @param aEUt should be > 0, 1 EU/t is standard. + */ + public boolean addCannerRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt); + + /** + * Adds an Alloy Smelter Recipe + * @param aInput1 must be != null + * @param aInput2 can be null + * @param aOutput1 must be != null + * @param aOutput2 can be null + * @param aDuration must be > 0 + * @param aEUt should be > 0 + */ + public boolean addAlloySmelterRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, int aEUt); + + /** + * Adds a CNC-Machine Recipe + * @param aInput1 must be != null + * @param aOutput1 must be != null + * @param aDuration must be > 0 + * @param aEUt should be > 0 + */ + public boolean addCNCRecipe(ItemStack aInput1, ItemStack aOutput1, int aDuration, int aEUt); + + /** + * Adds a Circuit Assembler Recipe + * @param aInput1 must be != null + * @param aOutput1 must be != null + * @param aDuration must be > 0 + * @param aEUt should be > 0 + */ + public boolean addAssemblerRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, int aEUt); + + /** + * Adds a Circuit Assembler Recipe + * @param aInput1 must be != null + * @param aOutput1 must be != null + * @param aDuration must be > 0 + * @param aEUt should be > 0 + */ + public boolean addAssemblerRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt); + + /** + * Adds a Forge Hammer Recipe + * @param aInput1 must be != null + * @param aOutput1 must be != null + * @param aDuration must be > 0 + * @param aEUt should be > 0 + */ + public boolean addForgeHammerRecipe(ItemStack aInput1, ItemStack aOutput1, int aDuration, int aEUt); + + /** + * Adds a Wiremill Recipe + * @param aInput1 must be != null + * @param aOutput1 must be != null + * @param aDuration must be > 0 + * @param aEUt should be > 0 + */ + public boolean addWiremillRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEUt); + + /** + * Adds a Polariser Recipe + * @param aInput1 must be != null + * @param aOutput1 must be != null + * @param aDuration must be > 0 + * @param aEUt should be > 0 + */ + public boolean addPolarizerRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEUt); + + /** + * Adds a Plate Bending Machine Recipe + * @param aInput1 must be != null + * @param aOutput1 must be != null + * @param aDuration must be > 0 + * @param aEUt should be > 0 + */ + public boolean addBenderRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEUt); + + /** + * Adds a Extruder Machine Recipe + * @param aInput1 must be != null + * @param aShape must be != null, Set the stackSize to 0 if you don't want to let it consume this Item. + * @param aOutput1 must be != null + * @param aDuration must be > 0 + * @param aEUt should be > 0 + */ + public boolean addExtruderRecipe(ItemStack aInput, ItemStack aShape, ItemStack aOutput, int aDuration, int aEUt); + + /** + * Adds a Slicer Machine Recipe + * @param aInput1 must be != null + * @param aShape must be != null, Set the stackSize to 0 if you don't want to let it consume this Item. + * @param aOutput1 must be != null + * @param aDuration must be > 0 + * @param aEUt should be > 0 + */ + public boolean addSlicerRecipe(ItemStack aInput, ItemStack aShape, ItemStack aOutput, int aDuration, int aEUt); + + /** + * Adds an Implosion Compressor Recipe + * @param aInput1 must be != null + * @param aInput2 amount of ITNT, should be > 0 + * @param aOutput1 must be != null + * @param aOutput2 can be null + */ + public boolean addImplosionRecipe(ItemStack aInput1, int aInput2, ItemStack aOutput1, ItemStack aOutput2); + + /** + * Adds a Grinder Recipe + * @param aInput1 must be != null + * @param aInput2 id for the Cell needed for this Recipe + * @param aOutput1 must be != null + * @param aOutput2 can be null + * @param aOutput3 can be null + * @param aOutput4 can be null + */ + public boolean addGrinderRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4); + + /** + * Adds a Distillation Tower Recipe + * @param aInput1 must be != null + * @param aOutputs must be != null 1-5 Fluids + * @param aOutput2 can be null + */ + public boolean addDistillationTowerRecipe(FluidStack aInput, FluidStack[] aOutputs, ItemStack aOutput2, int aDuration, int aEUt); + + + public boolean addSimpleArcFurnaceRecipe(ItemStack aInput, FluidStack aFluidInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt); + + public boolean addPlasmaArcFurnaceRecipe(ItemStack aInput, FluidStack aFluidInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt); + + + + + + + + /** + * Adds a Distillation Tower Recipe + */ + public boolean addDistillationRecipe(ItemStack aInput1, int aInput2, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, int aDuration, int aEUt); + + /** + * Adds a Lathe Machine Recipe + */ + public boolean addLatheRecipe(ItemStack aInput1, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt); + + /** + * Adds a Cutter Recipe + */ + public boolean addCutterRecipe(ItemStack aInput, FluidStack aLubricant, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt); + + /** + * Adds Cutter Recipes with default Lubricants + */ + public boolean addCutterRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt); + + /** + * Adds a Boxing Recipe + */ + public boolean addBoxingRecipe(ItemStack aContainedItem, ItemStack aEmptyBox, ItemStack aFullBox, int aDuration, int aEUt); + + /** + * Adds an Unboxing Recipe + */ + public boolean addUnboxingRecipe(ItemStack aFullBox, ItemStack aContainedItem, ItemStack aEmptyBox, int aDuration, int aEUt); + + /** + * Adds a Vacuum Freezer Recipe + * @param aInput1 must be != null + * @param aOutput1 must be != null + * @param aDuration must be > 0 + */ + public boolean addVacuumFreezerRecipe(ItemStack aInput1, ItemStack aOutput1, int aDuration); + + /** + * Adds a Fuel for My Generators + * @param aInput1 must be != null + * @param aOutput1 can be null + * @param aEU EU per MilliBucket. If no Liquid Form of this Container is available, then it will give you EU*1000 per Item. + * @param aType 0 = Diesel; 1 = Gas Turbine; 2 = Thermal; 3 = Dense Fluid; 4 = Plasma; 5 = Magic; And if something is unclear or missing, then look at the GT_Recipe-Class + */ + public boolean addFuel(ItemStack aInput1, ItemStack aOutput1, int aEU, int aType); + + /** + * Adds an Amplifier Recipe for the Amplifabricator + */ + public boolean addAmplifier(ItemStack aAmplifierItem, int aDuration, int aAmplifierAmountOutputted); + + /** + * Adds a Recipe for the Brewing Machine (intentionally limited to Fluid IDs) + */ + public boolean addBrewingRecipe(ItemStack aIngredient, Fluid aInput, Fluid aOutput, boolean aHidden); + + /** + * Adds a Recipe for the Fermenter + */ + public boolean addFermentingRecipe(FluidStack aInput, FluidStack aOutput, int aDuration, boolean aHidden); + + /** + * Adds a Recipe for the Fluid Heater + */ + public boolean addFluidHeaterRecipe(ItemStack aCircuit, FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt); + + /** + * Adds a Recipe for the Distillery + */ + public boolean addDistilleryRecipe(ItemStack aCircuit, FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt, boolean aHidden); + + /** + * Adds a Recipe for the Fluid Solidifier + */ + public boolean addFluidSolidifierRecipe(ItemStack aMold, FluidStack aInput, ItemStack aOutput, int aDuration, int aEUt); + + /** + * Adds a Recipe for Fluid Smelting + */ + public boolean addFluidSmelterRecipe(ItemStack aInput, ItemStack aRemains, FluidStack aOutput, int aChance, int aDuration, int aEUt); + + /** + * Adds a Recipe for Fluid Extraction + */ + public boolean addFluidExtractionRecipe(ItemStack aInput, ItemStack aRemains, FluidStack aOutput, int aChance, int aDuration, int aEUt); + + /** + * Adds a Recipe for the Fluid Canner + */ + public boolean addFluidCannerRecipe(ItemStack aInput, ItemStack aOutput, FluidStack aFluidInput, FluidStack aFluidOutput); + + /** + * Adds a Recipe for the Chemical Bath + */ + public boolean addChemicalBathRecipe(ItemStack aInput, FluidStack aBathingFluid, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, int[] aChances, int aDuration, int aEUt); + + /** + * Adds a Recipe for the Electromagnetic Separator + */ + public boolean addElectromagneticSeparatorRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, int[] aChances, int aDuration, int aEUt); + + /** + * Adds a Recipe for the Printer + */ + public boolean addPrinterRecipe(ItemStack aInput, FluidStack aFluid, ItemStack aSpecialSlot, ItemStack aOutput, int aDuration, int aEUt); + + /** + * Adds a Recipe for the Autoclave + */ + public boolean addAutoclaveRecipe(ItemStack aInput, FluidStack aFluid, ItemStack aOutput, int aChance, int aDuration, int aEUt); + + /** + * Adds a Recipe for the Mixer + */ + public boolean addMixerRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aInput3, ItemStack aInput4, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt); + + /** + * Adds a Recipe for the Laser Engraver + */ + public boolean addLaserEngraverRecipe(ItemStack aItemToEngrave, ItemStack aLens, ItemStack aEngravedItem, int aDuration, int aEUt); + + /** + * Adds a Recipe for the Forming Press + */ + public boolean addFormingPressRecipe(ItemStack aItemToImprint, ItemStack aForm, ItemStack aImprintedItem, int aDuration, int aEUt); + + /** + * Adds a Recipe for the Sifter. (up to 9 Outputs) + */ + public boolean addSifterRecipe(ItemStack aItemToSift, ItemStack[] aSiftedItems, int[] aChances, int aDuration, int aEUt); + + /** + * Adds a Recipe for the Arc Furnace. (up to 4 Outputs) + */ + public boolean addArcFurnaceRecipe(ItemStack aInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt); + + /** + * Adds a Recipe for the GT Pulveriser. (up to 4 Outputs) + */ + public boolean addPulveriserRecipe(ItemStack aInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt); + + /** + * Adds a Sound to the Sonictron9001 + * you should NOT call this in the preInit-Phase! + * @param aItemStack = The Item you want to display for this Sound + * @param aSoundName = The Name of the Sound in the resources/newsound-folder like Vanillasounds + * @return true if the Sound got added, otherwise false. + */ + public boolean addSonictronSound(ItemStack aItemStack, String aSoundName); +} diff --git a/src/main/java/gregtech/api/interfaces/internal/IIC2TileEntity.java b/src/main/java/gregtech/api/interfaces/internal/IIC2TileEntity.java new file mode 100644 index 0000000..736cbf6 --- /dev/null +++ b/src/main/java/gregtech/api/interfaces/internal/IIC2TileEntity.java @@ -0,0 +1,13 @@ +package gregtech.api.interfaces.internal; + +import gregtech.api.interfaces.tileentity.IHasWorldObjectAndCoords; +import ic2.api.energy.tile.IEnergySink; +import ic2.api.energy.tile.IEnergySource; +import ic2.api.tile.IEnergyStorage; + +/** + * A simple compound Interface for generic EnergyTileEntities. I don't want to have imports of the IC2-API in my main-code + */ +public interface IIC2TileEntity extends IEnergyStorage, IEnergySink, IEnergySource, IHasWorldObjectAndCoords { + // +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/internal/IThaumcraftCompat.java b/src/main/java/gregtech/api/interfaces/internal/IThaumcraftCompat.java new file mode 100644 index 0000000..1921de7 --- /dev/null +++ b/src/main/java/gregtech/api/interfaces/internal/IThaumcraftCompat.java @@ -0,0 +1,40 @@ +package gregtech.api.interfaces.internal; + +import java.util.List; + +import gregtech.api.enums.TC_Aspects.TC_AspectStack; +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; + +public interface IThaumcraftCompat { + public static final int RESEARCH_TYPE_NORMAL = 0, RESEARCH_TYPE_SECONDARY = 1, RESEARCH_TYPE_FREE = 2, RESEARCH_TYPE_HIDDEN = 4, RESEARCH_TYPE_VIRTUAL = 8, RESEARCH_TYPE_ROUND = 16, RESEARCH_TYPE_SPECIAL = 32, RESEARCH_TYPE_AUTOUNLOCK = 64; + + /** The Research Keys of GT */ + public static final String + IRON_TO_STEEL = "GT_IRON_TO_STEEL" + , FILL_WATER_BUCKET = "GT_FILL_WATER_BUCKET" + , WOOD_TO_CHARCOAL = "GT_WOOD_TO_CHARCOAL" + , TRANSZINC = "GT_TRANSZINC" + , TRANSNICKEL = "GT_TRANSNICKEL" + , TRANSCOBALT = "GT_TRANSCOBALT" + , TRANSBISMUTH = "GT_TRANSBISMUTH" + , TRANSANTIMONY = "GT_TRANSANTIMONY" + , TRANSCUPRONICKEL = "GT_TRANSCUPRONICKEL" + , TRANSBATTERYALLOY = "GT_TRANSBATTERYALLOY" + , TRANSSOLDERINGALLOY = "GT_TRANSSOLDERINGALLOY" + , TRANSBRASS = "GT_TRANSBRASS" + , TRANSBRONZE = "GT_TRANSBRONZE" + , TRANSINVAR = "GT_TRANSINVAR" + , TRANSELECTRUM = "GT_TRANSELECTRUM" + , TRANSALUMINIUM = "GT_TRANSALUMINIUM" + , CRYSTALLISATION = "GT_CRYSTALLISATION" + , ADVANCEDENTROPICPROCESSING = "GT_ADVANCEDENTROPICPROCESSING" + , ADVANCEDMETALLURGY = "GT_ADVANCEDMETALLURGY" + ; + + public boolean registerPortholeBlacklistedBlock(Block aBlock); + public boolean registerThaumcraftAspectsToItem(ItemStack aStack, List aAspects, boolean aAdditive); + public boolean registerThaumcraftAspectsToItem(ItemStack aStack, List aAspects, String aOreDict); + public Object addCrucibleRecipe(String aResearch, Object aInput, ItemStack aOutput, List aAspects); + public Object addResearch(String aResearch, String aName, String aText, String[] aParentResearches, String aCategory, ItemStack aIcon, int aComplexity, int aType, int aX, int aY, List aAspects, ItemStack[] aResearchTriggers, Object[] aPages); +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/internal/IUETileEntity.java b/src/main/java/gregtech/api/interfaces/internal/IUETileEntity.java new file mode 100644 index 0000000..945c679 --- /dev/null +++ b/src/main/java/gregtech/api/interfaces/internal/IUETileEntity.java @@ -0,0 +1,6 @@ +package gregtech.api.interfaces.internal; + + +public interface IUETileEntity /*extends IElectrical*/ { + // +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java b/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java new file mode 100644 index 0000000..94e41b8 --- /dev/null +++ b/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java @@ -0,0 +1,382 @@ +package gregtech.api.interfaces.metatileentity; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGearEnergyTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.objects.GT_ItemStack; +import gregtech.api.util.GT_Config; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.fluids.IFluidHandler; +import net.minecraftforge.fluids.IFluidTank; + +/** + * Warning, this Interface has just been made to be able to add multiple kinds of MetaTileEntities (Cables, Pipes, Transformers, but not the regular Blocks) + * + * Don't implement this yourself and expect it to work. Extend @MetaTileEntity itself. + */ +public interface IMetaTileEntity extends ISidedInventory, IFluidTank, IFluidHandler, IGearEnergyTileEntity { + /** + * This determines the BaseMetaTileEntity belonging to this MetaTileEntity by using the Meta ID of the Block itself. + * + * 0 = BaseMetaTileEntity, Wrench lvl 0 to dismantle + * 1 = BaseMetaTileEntity, Wrench lvl 1 to dismantle + * 2 = BaseMetaTileEntity, Wrench lvl 2 to dismantle + * 3 = BaseMetaTileEntity, Wrench lvl 3 to dismantle + * 4 = BaseMetaPipeEntity, Wrench lvl 0 to dismantle + * 5 = BaseMetaPipeEntity, Wrench lvl 1 to dismantle + * 6 = BaseMetaPipeEntity, Wrench lvl 2 to dismantle + * 7 = BaseMetaPipeEntity, Wrench lvl 3 to dismantle + * 8 = BaseMetaPipeEntity, Cutter lvl 0 to dismantle + * 9 = BaseMetaPipeEntity, Cutter lvl 1 to dismantle + * 10 = BaseMetaPipeEntity, Cutter lvl 2 to dismantle + * 11 = BaseMetaPipeEntity, Cutter lvl 3 to dismantle + * 12 = BaseMetaPipeEntity, Axe lvl 0 to dismantle + * 13 = BaseMetaPipeEntity, Axe lvl 1 to dismantle + * 14 = BaseMetaPipeEntity, Axe lvl 2 to dismantle + * 15 = BaseMetaPipeEntity, Axe lvl 3 to dismantle + */ + public byte getTileEntityBaseType(); + + /** + * @param aTileEntity is just because the internal Variable "mBaseMetaTileEntity" is set after this Call. + * @return a newly created and ready MetaTileEntity + */ + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity); + + /** + * @return an ItemStack representing this MetaTileEntity. + */ + public ItemStack getStackForm(long aAmount); + + /** + * Sets the BaseMetaTileEntity of this + */ + public void setBaseMetaTileEntity(IGregTechTileEntity aBaseMetaTileEntity); + + /** + * new getter for the BaseMetaTileEntity, which restricts usage to certain Functions. + */ + public IGregTechTileEntity getBaseMetaTileEntity(); + + /** + * when placing a Machine in World, to initialize default Modes. aNBT can be null! + */ + public void initDefaultModes(NBTTagCompound aNBT); + + /** + * ^= writeToNBT + */ + public void saveNBTData(NBTTagCompound aNBT); + + /** + * ^= readFromNBT + */ + public void loadNBTData(NBTTagCompound aNBT); + + /** + * Adds the NBT-Information to the ItemStack, when being dismanteled properly + * Used to store Machine specific Upgrade Data. + */ + public void setItemNBT(NBTTagCompound aNBT); + + /** + * Called in the registered MetaTileEntity when the Server starts, to reset static variables + */ + public void onServerStart(); + + /** + * Called in the registered MetaTileEntity when the Server ticks a World the first time, to load things from the World Save + */ + public void onWorldLoad(File aSaveDirectory); + + /** + * Called in the registered MetaTileEntity when the Server stops, to save the Game. + */ + public void onWorldSave(File aSaveDirectory); + + /** + * Called to set Configuration values for this MetaTileEntity. + * Use aConfig.get(ConfigCategories.machineconfig, "MetaTileEntityName.Ability", DEFAULT_VALUE); to set the Values. + */ + public void onConfigLoad(GT_Config aConfig); + + /** + * If a Cover of that Type can be placed on this Side. + * Also Called when the Facing of the Block Changes and a Cover is on said Side. + */ + public boolean allowCoverOnSide(byte aSide, GT_ItemStack aStack); + + /** + * When a Player rightclicks the Facing with a Screwdriver. + */ + public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ); + + /** + * When a Player rightclicks the Facing with a Wrench. + */ + public boolean onWrenchRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ); + + /** + * Called right before this Machine explodes + */ + public void onExplosion(); + + /** + * The First processed Tick which was passed to this MetaTileEntity + */ + public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity); + + /** + * The Tick before all the generic handling happens, what gives a slightly faster reaction speed. + * Don't use this if you really don't need to. @onPostTick is better suited for ticks. + * This happens still after the Cover handling. + */ + public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick); + + /** + * The Tick after all the generic handling happened. + * Recommended to use this like updateEntity. + */ + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick); + + /** + * Called when this MetaTileEntity gets (intentionally) disconnected from the BaseMetaTileEntity. + * Doesn't get called when this thing is moved by Frames or similar hacks. + */ + public void inValidate(); + + /** + * Called when the BaseMetaTileEntity gets invalidated, what happens right before the @inValidate above gets called + */ + public void onRemoval(); + + /** + * @param aFacing + * @return if aFacing would be a valid Facing for this Device. Used for wrenching. + */ + public boolean isFacingValid(byte aFacing); + + /** + * @return the Server Side Container + */ + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity); + + /** + * @return the Client Side GUI Container + */ + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity); + + /** + * From new ISidedInventory + */ + public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack); + + /** + * From new ISidedInventory + */ + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack); + + /** + * @return if aIndex is a valid Slot. false for things like HoloSlots. Is used for determining if an Item is dropped upon Block destruction and for Inventory Access Management + */ + public boolean isValidSlot(int aIndex); + + /** + * @return if aIndex can be set to Zero stackSize, when being removed. + */ + public boolean setStackToZeroInsteadOfNull(int aIndex); + + /** + * If this Side can connect to inputting pipes + */ + public boolean isLiquidInput(byte aSide); + + /** + * If this Side can connect to outputting pipes + */ + public boolean isLiquidOutput(byte aSide); + + /** + * Just an Accessor for the Name variable. + */ + public String getMetaName(); + + /** + * @return true if the Machine can be accessed + */ + public boolean isAccessAllowed(EntityPlayer aPlayer); + + /** + * When a Machine Update occurs + */ + public void onMachineBlockUpdate(); + + /** + * a Player rightclicks the Machine + * Sneaky rightclicks are not getting passed to this! + * @return + */ + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ); + + /** + * a Player leftclicks the Machine + * Sneaky leftclicks are getting passed to this unlike with the rightclicks. + */ + public void onLeftclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer); + + /** + * Called Clientside with the Data got from @getUpdateData + */ + public void onValueUpdate(byte aValue); + + /** + * return a small bit of Data, like a secondary Facing for example with this Function, for the Client. + * The BaseMetaTileEntity detects changes to this Value and will then send an Update. + * This is only for Information, which is visible as Texture to the outside. + * + * If you just want to have an Active/Redstone State then set the Active State inside the BaseMetaTileEntity instead. + */ + public byte getUpdateData(); + + /** + * For the rare case you need this Function + */ + public void receiveClientEvent(byte aEventID, byte aValue); + + /** + * Called to actually play the Sound. + * Do not insert Client/Server checks. That is already done for you. + * Do not use @playSoundEffect, Minecraft doesn't like that at all. Use @playSound instead. + */ + public void doSound(byte aIndex, double aX, double aY, double aZ); + public void startSoundLoop(byte aIndex, double aX, double aY, double aZ); + public void stopSoundLoop(byte aValue, double aX, double aY, double aZ); + + /** + * Sends the Event for the Sound Triggers, only usable Server Side! + */ + public void sendSound(byte aIndex); + + /** + * Sends the Event for the Sound Triggers, only usable Server Side! + */ + public void sendLoopStart(byte aIndex); + + /** + * Sends the Event for the Sound Triggers, only usable Server Side! + */ + public void sendLoopEnd(byte aIndex); + + /** + * Called when the Machine explodes, override Explosion Code here. + * @param aExplosionPower + */ + public void doExplosion(long aExplosionPower); + + /** + * If this is just a simple Machine, which can be wrenched at 100% + */ + public boolean isSimpleMachine(); + + /** + * If there should be a Lag Warning if something laggy happens during this Tick. + * + * The Advanced Pump uses this to not cause the Lag Message, while it scans for all close Fluids. + * The Item Pipes and Retrievers neither send this Message, when scanning for Pipes. + */ + public boolean doTickProfilingMessageDuringThisTick(); + + /** + * returns the DebugLog + */ + public ArrayList getSpecialDebugInfo(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, int aLogLevel, ArrayList aList); + + /** + * get a small Description + */ + public String[] getDescription(); + + /** + * In case the Output Voltage varies. + */ + public String getSpecialVoltageToolTip(); + + /** + * Icon of the Texture. If this returns null then it falls back to getTextureIndex. + * + * @param aSide is the Side of the Block + * @param aFacing is the direction the Block is facing (or a Bitmask of all Connections in case of Pipes) + * @param aColorIndex The Minecraft Color the Block is having + * @param aActive if the Machine is currently active (use this instead of calling mBaseMetaTileEntity.mActive!!!). Note: In case of Pipes this means if this Side is connected to something or not. + * @param aRedstone if the Machine is currently outputting a RedstoneSignal (use this instead of calling mBaseMetaTileEntity.mRedstone!!!) + */ + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone); + + /** + * The Textures used for the Item rendering. Return null if you want the regular 3D Block Rendering. + */ + //public ITexture[] getItemTexture(ItemStack aStack); + + /** + * Register Icons here. This gets called when the Icons get initialized by the Base Block + * Best is you put your Icons in a static Array for quick and easy access without relying on the MetaTileList. + * @param aBlockIconRegister The Block Icon Register + */ + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister aBlockIconRegister); + + /** + * @return true if you override the Rendering. + */ + @SideOnly(Side.CLIENT) + public boolean renderInInventory(Block aBlock, int aMeta, RenderBlocks aRenderer); + + /** + * @return true if you override the Rendering. + */ + @SideOnly(Side.CLIENT) + public boolean renderInWorld(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, RenderBlocks aRenderer); + + /** + * Gets the Output for the comparator on the given Side + */ + public byte getComparatorValue(byte aSide); + + public float getExplosionResistance(byte aSide); + + public String[] getInfoData(); + public boolean isGivingInformation(); + + public ItemStack[] getRealInventory(); + + public boolean connectsToItemPipe(byte aSide); + + public void onColorChangeServer(byte aColor); + public void onColorChangeClient(byte aColor); + + public int getLightOpacity(); + + public void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, List outputAABB, Entity collider); + public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ); + public void onEntityCollidedWithBlock(World aWorld, int aX, int aY, int aZ, Entity collider); + + /** The onCreated Function of the Item Class redirects here */ + public void onCreated(ItemStack aStack, World aWorld, EntityPlayer aPlayer); +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntityCable.java b/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntityCable.java new file mode 100644 index 0000000..6cdb15c --- /dev/null +++ b/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntityCable.java @@ -0,0 +1,9 @@ +package gregtech.api.interfaces.metatileentity; + +import java.util.ArrayList; + +import net.minecraft.tileentity.TileEntity; + +public interface IMetaTileEntityCable extends IMetaTileEntity { + public long transferElectricity(byte aSide, long aVoltage, long aAmperage, ArrayList aAlreadyPassedTileEntityList); +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntityItemPipe.java b/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntityItemPipe.java new file mode 100644 index 0000000..f3fc802 --- /dev/null +++ b/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntityItemPipe.java @@ -0,0 +1,96 @@ +package gregtech.api.interfaces.metatileentity; + +import java.util.Map; + +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.BaseMetaPipeEntity; +import gregtech.api.util.GT_Utility; + +public interface IMetaTileEntityItemPipe extends IMetaTileEntity { + /** + * @return if this Pipe can still be used. + */ + public boolean pipeCapacityCheck(); + + /** + * @return if this Pipe can still be used. + */ + public boolean incrementTransferCounter(int aIncrement); + + /** + * Sends an ItemStack from aSender to the adjacent Blocks. + * @param aSender the BaseMetaTileEntity sending the Stack. + * @return if it was able to send something + */ + public boolean sendItemStack(Object aSender); + + /** + * Executes the Sending Code for inserting Stacks into the TileEntities. + * @param aSender the BaseMetaTileEntity sending the Stack. + * @param aSide the Side of the PIPE facing the TileEntity. + * @return if this Side was allowed to Output into the Block. + */ + public boolean insertItemStackIntoTileEntity(Object aSender, byte aSide); + + /** + * Can be used to make flow control Pipes, like Redpowers Restriction Tubes. + * Every normal Pipe returns a Value of 32768, so you can easily insert lower Numbers to set Routing priorities. + * Negative Numbers to "suck" Items into a certain direction are also possible. + */ + public int getStepSize(); + + /** + * Utility for the Item Network + */ + public static class Util { + /** + * @return a List of connected Item Pipes + */ + public static Map scanPipes(IMetaTileEntityItemPipe aMetaTileEntity, Map aMap, long aStep, boolean aSuckItems, boolean aIgnoreCapacity) { + aStep+=aMetaTileEntity.getStepSize(); + if (aIgnoreCapacity || aMetaTileEntity.pipeCapacityCheck()) if (aMap.get(aMetaTileEntity) == null || aMap.get(aMetaTileEntity) > aStep) { + IGregTechTileEntity aBaseMetaTileEntity = aMetaTileEntity.getBaseMetaTileEntity(); + aMap.put(aMetaTileEntity, aStep); + for (byte i = 0, j = 0; i < 6; i++) { + j = GT_Utility.getOppositeSide(i); + if (aSuckItems) { + if (aBaseMetaTileEntity.getCoverBehaviorAtSide(i).letsItemsIn(i, aBaseMetaTileEntity.getCoverIDAtSide(i), aBaseMetaTileEntity.getCoverDataAtSide(i), -2, aBaseMetaTileEntity)) { + IGregTechTileEntity tItemPipe = aBaseMetaTileEntity.getIGregTechTileEntityAtSide(i); + if (aBaseMetaTileEntity.getColorization() >= 0) { + byte tColor = tItemPipe.getColorization(); + if (tColor >= 0 && tColor != aBaseMetaTileEntity.getColorization()) { + continue; + } + } + if (tItemPipe != null && tItemPipe instanceof BaseMetaPipeEntity) { + IMetaTileEntity tMetaTileEntity = tItemPipe.getMetaTileEntity(); + if (tMetaTileEntity != null && tMetaTileEntity instanceof IMetaTileEntityItemPipe && tItemPipe.getCoverBehaviorAtSide(j).letsItemsOut(j, tItemPipe.getCoverIDAtSide(j), tItemPipe.getCoverDataAtSide(j), -2, tItemPipe)) { + scanPipes((IMetaTileEntityItemPipe)tMetaTileEntity, aMap, aStep, aSuckItems, aIgnoreCapacity); + } + } + } + } else { + if (aBaseMetaTileEntity.getCoverBehaviorAtSide(i).letsItemsOut(i, aBaseMetaTileEntity.getCoverIDAtSide(i), aBaseMetaTileEntity.getCoverDataAtSide(i), -2, aBaseMetaTileEntity)) { + IGregTechTileEntity tItemPipe = aBaseMetaTileEntity.getIGregTechTileEntityAtSide(i); + if (tItemPipe != null) { + if (aBaseMetaTileEntity.getColorization() >= 0) { + byte tColor = tItemPipe.getColorization(); + if (tColor >= 0 && tColor != aBaseMetaTileEntity.getColorization()) { + continue; + } + } + if (tItemPipe instanceof BaseMetaPipeEntity) { + IMetaTileEntity tMetaTileEntity = tItemPipe.getMetaTileEntity(); + if (tMetaTileEntity != null && tMetaTileEntity instanceof IMetaTileEntityItemPipe && tItemPipe.getCoverBehaviorAtSide(j).letsItemsIn(j, tItemPipe.getCoverIDAtSide(j), tItemPipe.getCoverDataAtSide(j), -2, tItemPipe)) { + scanPipes((IMetaTileEntityItemPipe)tMetaTileEntity, aMap, aStep, aSuckItems, aIgnoreCapacity); + } + } + } + } + } + } + } + return aMap; + } + } +} diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IBasicEnergyContainer.java b/src/main/java/gregtech/api/interfaces/tileentity/IBasicEnergyContainer.java new file mode 100644 index 0000000..6b39391 --- /dev/null +++ b/src/main/java/gregtech/api/interfaces/tileentity/IBasicEnergyContainer.java @@ -0,0 +1,99 @@ +package gregtech.api.interfaces.tileentity; + +/** + * Interface for internal Code, which is mainly used for independent Energy conversion. + */ +public interface IBasicEnergyContainer extends IEnergyConnected { + /** + * Gets if that Amount of Energy is stored inside the Machine. + * It is used for checking the contained Energy before consuming it. + * If this returns false, it will also give a Message inside the Scanner, that this Machine doesn't have enough Energy. + */ + public boolean isUniversalEnergyStored(long aEnergyAmount); + + /** + * Gets the stored electric, kinetic or steam Energy (with EU as reference Value) + * Always returns the largest one. + */ + public long getUniversalEnergyStored(); + + /** + * Gets the largest electric, kinetic or steam Energy Capacity (with EU as reference Value) + */ + public long getUniversalEnergyCapacity(); + + /** + * Gets the amount of Energy Packets per tick. + */ + public long getOutputAmperage(); + + /** + * Gets the Output in EU/p. + */ + public long getOutputVoltage(); + + /** + * Gets the amount of Energy Packets per tick. + */ + public long getInputAmperage(); + + /** + * Gets the maximum Input in EU/p. + */ + public long getInputVoltage(); + + /** + * Decreases the Amount of stored universal Energy. If ignoring too less Energy, then it just sets the Energy to 0 and returns false. + */ + public boolean decreaseStoredEnergyUnits(long aEnergy, boolean aIgnoreTooLessEnergy); + + /** + * Increases the Amount of stored electric Energy. If ignoring too much Energy, then the Energy Limit is just being ignored. + */ + public boolean increaseStoredEnergyUnits(long aEnergy, boolean aIgnoreTooMuchEnergy); + + /** + * Drain Energy Call for Electricity. + */ + public boolean drainEnergyUnits(byte aSide, long aVoltage, long aAmperage); + + /** + * returns the amount of Electricity, accepted by this Block the last 5 ticks as Average. + */ + public long getAverageElectricInput(); + + /** + * returns the amount of Electricity, outputted by this Block the last 5 ticks as Average. + */ + public long getAverageElectricOutput(); + + /** + * returns the amount of electricity contained in this Block, in EU units! + */ + public long getStoredEU(); + + /** + * returns the amount of electricity containable in this Block, in EU units! + */ + public long getEUCapacity(); + + /** + * returns the amount of Steam contained in this Block, in EU units! + */ + public long getStoredSteam(); + + /** + * returns the amount of Steam containable in this Block, in EU units! + */ + public long getSteamCapacity(); + + /** + * Increases stored Energy. Energy Base Value is in EU, even though it's Steam! + * @param aEnergy The Energy to add to the Machine. + * @param aIgnoreTooMuchEnergy if it shall ignore if it has too much Energy. + * @return if it was successful + * + * And yes, you can't directly decrease the Steam of a Machine. That is done by decreaseStoredEnergyUnits + */ + public boolean increaseStoredSteam(long aEnergy, boolean aIgnoreTooMuchEnergy); +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IColoredTileEntity.java b/src/main/java/gregtech/api/interfaces/tileentity/IColoredTileEntity.java new file mode 100644 index 0000000..dc511f3 --- /dev/null +++ b/src/main/java/gregtech/api/interfaces/tileentity/IColoredTileEntity.java @@ -0,0 +1,14 @@ +package gregtech.api.interfaces.tileentity; + +public interface IColoredTileEntity { + /** + * @return 0 - 15 are Colors, while -1 means uncolored + */ + public byte getColorization(); + + /** + * Sets the Color Modulation of the Block + * @param aColor the Color you want to set it to. -1 for reset. + */ + public byte setColorization(byte aColor); +} diff --git a/src/main/java/gregtech/api/interfaces/tileentity/ICoverable.java b/src/main/java/gregtech/api/interfaces/tileentity/ICoverable.java new file mode 100644 index 0000000..546b8d8 --- /dev/null +++ b/src/main/java/gregtech/api/interfaces/tileentity/ICoverable.java @@ -0,0 +1,35 @@ +package gregtech.api.interfaces.tileentity; + +import gregtech.api.util.GT_CoverBehavior; +import net.minecraft.item.ItemStack; + +public interface ICoverable extends IRedstoneTileEntity, IHasInventory, IBasicEnergyContainer { + public boolean canPlaceCoverIDAtSide (byte aSide, int aID); + public boolean canPlaceCoverItemAtSide (byte aSide, ItemStack aCover); + public boolean dropCover (byte aSide, byte aDroppedSide, boolean aForced); + public void setCoverDataAtSide (byte aSide, int aData); + public void setCoverIDAtSide (byte aSide, int aID); + public void setCoverItemAtSide (byte aSide, ItemStack aCover); + public int getCoverDataAtSide (byte aSide); + public int getCoverIDAtSide (byte aSide); + public ItemStack getCoverItemAtSide (byte aSide); + public GT_CoverBehavior getCoverBehaviorAtSide (byte aSide); + + /** + * For use by the regular MetaTileEntities. Returns the Cover Manipulated input Redstone. + * Don't use this if you are a Cover Behavior. Only for MetaTileEntities. + */ + public byte getInternalInputRedstoneSignal(byte aSide); + + /** + * For use by the regular MetaTileEntities. This makes it not conflict with Cover based Redstone Signals. + * Don't use this if you are a Cover Behavior. Only for MetaTileEntities. + */ + public void setInternalOutputRedstoneSignal(byte aSide, byte aStrength); + + /** + * Causes a general Cover Texture update. + * Sends 6 Integers to Client + causes @issueTextureUpdate() + */ + public void issueCoverUpdate(byte aSide); +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IDigitalChest.java b/src/main/java/gregtech/api/interfaces/tileentity/IDigitalChest.java new file mode 100644 index 0000000..d017a1d --- /dev/null +++ b/src/main/java/gregtech/api/interfaces/tileentity/IDigitalChest.java @@ -0,0 +1,29 @@ +package gregtech.api.interfaces.tileentity; + +import net.minecraft.item.ItemStack; + +/** + * You are allowed to include this File in your Download, as i will not change it. + */ +public interface IDigitalChest extends IHasWorldObjectAndCoords { + /** + * Is this even a TileEntity of a Digital Chest? + * I need things like this Function for MetaTileEntities, you MUST check this!!! + * Do not assume that it's a Digital Chest or similar Device, when it just implements this Interface. + */ + public boolean isDigitalChest(); + /** + * Gives an Array of Stacks with Size (of all the Data-stored Items) of the correspondent Item kinds (regular QChests have only one) + * Does NOT include the 64 "ready" Items inside the Slots, and neither the 128 Items in the overflow Buffer. + */ + public ItemStack[] getStoredItemData(); + /** + * A generic Interface for just setting the amount of contained Items + */ + public void setItemCount(int aCount); + + /** + * Gets the maximum Item count for this QChest alike Storage. This applies to the Data-Storage, not for the up to 192 buffered Items! + */ + public int getMaxItemCount(); +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConductor.java b/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConductor.java new file mode 100644 index 0000000..96684de --- /dev/null +++ b/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConductor.java @@ -0,0 +1,40 @@ +package gregtech.api.interfaces.tileentity; + +import gregtech.api.enums.Materials; + +/** + * Informative Class for Cables. Not used for now. + * + * Not all Data might be reliable. This is just for Information sake. + */ +public interface IEnergyConductor extends IEnergyConnected { + /** + * @return if this is actually a Cable. (you must check this) + */ + public boolean isConductor(); + + /** + * @return the maximum Voltage of the Cable. + */ + public long getMaxVoltage(); + + /** + * @return the maximum Amperage of the Cable, per Wire. + */ + public long getMaxAmperage(); + + /** + * @return the Loss of the Cable, per Meter. + */ + public long getLossPerMeter(); + + /** + * @return the Material the Cable consists of. (may return Materials._NULL) + */ + public Materials getCableMaterial(); + + /** + * @return the Material the Cable Insulation consists of. (may return Materials._NULL) + */ + public Materials getInsulationMaterial(); +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java b/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java new file mode 100644 index 0000000..7233b64 --- /dev/null +++ b/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java @@ -0,0 +1,69 @@ +package gregtech.api.interfaces.tileentity; + +import gregtech.api.util.GT_Utility; +import ic2.api.energy.tile.IEnergySink; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + +/** + * Interface for getting Connected to the GregTech Energy Network. + * + * This is all you need to connect to the GT Network. + * IColoredTileEntity is needed for not connecting differently coloured Blocks to each other. + * IHasWorldObjectAndCoords is needed for the InWorld related Stuff. @BaseTileEntity does implement most of that Interface. + */ +public interface IEnergyConnected extends IColoredTileEntity, IHasWorldObjectAndCoords { + /** + * Inject Energy Call for Electricity. Gets called by EnergyEmitters to inject Energy into your Block + * + * Note: you have to check for @inputEnergyFrom because the Network won't check for that by itself. + * + * @param aSide 0 - 5 = Vanilla Directions of YOUR Block the Energy gets inserted to. 6 = No specific Side (don't do Side checks for this Side) + * @return amount of used Amperes. 0 if not accepted anything. + */ + public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage); + + /** + * Sided Energy Input + */ + public boolean inputEnergyFrom(byte aSide); + + /** + * Sided Energy Output + */ + public boolean outputsEnergyTo(byte aSide); + + /** + * Utility for the Network + */ + public static class Util { + /** + * Emits Energy to the E-net. Also compatible with adjacent IC2 TileEntities. + * @return the used Amperage. + */ + public static final long emitEnergyToNetwork(long aVoltage, long aAmperage, IEnergyConnected aEmitter) { + long rUsedAmperes = 0; + for (byte i = 0, j = 0; i < 6 && aAmperage > rUsedAmperes; i++) if (aEmitter.outputsEnergyTo(i)) { + j = GT_Utility.getOppositeSide(i); + TileEntity tTileEntity = aEmitter.getTileEntityAtSide(i); + if (tTileEntity instanceof IEnergyConnected) { + if (aEmitter.getColorization() >= 0) { + byte tColor = ((IEnergyConnected)tTileEntity).getColorization(); + if (tColor >= 0 && tColor != aEmitter.getColorization()) continue; + } + rUsedAmperes+=((IEnergyConnected)tTileEntity).injectEnergyUnits(j, aVoltage, aAmperage-rUsedAmperes); +// } else if (tTileEntity instanceof IEnergySink) { +// if (((IEnergySink)tTileEntity).acceptsEnergyFrom((TileEntity)aEmitter, ForgeDirection.getOrientation(j))) { +// while (aAmperage > rUsedAmperes && ((IEnergySink)tTileEntity).demandedEnergyUnits() > 0 && ((IEnergySink)tTileEntity).injectEnergyUnits(ForgeDirection.getOrientation(j), aVoltage) < aVoltage) rUsedAmperes++; +// } + } else if (tTileEntity instanceof IEnergySink) { + if (((IEnergySink)tTileEntity).acceptsEnergyFrom((TileEntity)aEmitter, ForgeDirection.getOrientation(j))) { + while (aAmperage > rUsedAmperes && ((IEnergySink)tTileEntity).getDemandedEnergy() > 0 && ((IEnergySink)tTileEntity).injectEnergy(ForgeDirection.getOrientation(j), aVoltage, aVoltage) < aVoltage) rUsedAmperes++; + } + } + + } + return rUsedAmperes; + } + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IExperimentalEnergyTileEntity.java b/src/main/java/gregtech/api/interfaces/tileentity/IExperimentalEnergyTileEntity.java new file mode 100644 index 0000000..5bbd72c --- /dev/null +++ b/src/main/java/gregtech/api/interfaces/tileentity/IExperimentalEnergyTileEntity.java @@ -0,0 +1,79 @@ +package gregtech.api.interfaces.tileentity; + +import static gregtech.api.enums.GT_Values.F; +import static gregtech.api.enums.GT_Values.T; + +import gregtech.api.enums.SubTag; +import gregtech.api.util.GT_Utility; +import ic2.api.energy.tile.IEnergySink; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + +/** + * THIS IS GOING TO BE USED IN 1.8 + * + * Interface for getting Connected to the GregTech Energy Network. + * + * This is all you need to connect to the GT Network. + * IColoredTileEntity is needed for not connecting differently coloured Blocks to each other. + * IHasWorldObjectAndCoords is needed for the InWorld related Stuff. @BaseTileEntity does implement most of that Interface. + */ +public interface IExperimentalEnergyTileEntity extends IColoredTileEntity, IHasWorldObjectAndCoords { + /** + * Inject Energy Call for Electricity. Gets called by EnergyEmitters to inject Energy into your Block + * + * Note: you have to check for @inputEnergyFrom because the Network won't check for that by itself. + * + * @param aSide 0 - 5 = Vanilla Directions of YOUR Block the Energy gets inserted to. 6 = No specific Side (don't do Side checks for this Side) + * @return amount of used Amperes. 0 if not accepted anything. + */ + public long injectEnergy(SubTag aEnergyType, byte aSide, long aPrimary, long aSecondary); + + /** Sided Energy Input */ + public boolean inputEnergyFrom(SubTag aEnergyType, byte aSide); + + /** Sided Energy Output */ + public boolean outputsEnergyTo(SubTag aEnergyType, byte aSide); + + /** Utility for the Network */ + public static class Util { + private static boolean RF_ENERGY = F, IC_ENERGY = F, CHECK_ALL = T; + public static int RF_PER_EU = 4; + + private static void checkAvailabilities() { + if (CHECK_ALL) { + try { + Class tClass = ic2.api.energy.tile.IEnergySink.class; + tClass.getCanonicalName(); + IC_ENERGY = T; + } catch(Throwable e) {/**/} + CHECK_ALL = F; + } + } + + /** + * Emits Energy to the adjacent Blocks. Also compatible with adjacent IC2 TileEntities when electric and RF TileEntities when RedstoneFlux. + * @return the amount of used secondary value. + */ + public static final long emitEnergyToNetwork(SubTag aEnergyType, long aPrimary, long aSecondary, IExperimentalEnergyTileEntity aEmitter) { + long rUsedSecondary = 0; + checkAvailabilities(); + for (byte i = 0, j = 0; i < 6 && aSecondary > rUsedSecondary; i++) if (aEmitter.outputsEnergyTo(aEnergyType, i)) { + j = GT_Utility.getOppositeSide(i); + TileEntity tTileEntity = aEmitter.getTileEntityAtSide(i); + if (tTileEntity instanceof IExperimentalEnergyTileEntity) { + if (aEmitter.getColorization() >= 0) { + byte tColor = ((IExperimentalEnergyTileEntity)tTileEntity).getColorization(); + if (tColor >= 0 && tColor != aEmitter.getColorization()) continue; + } + rUsedSecondary+=((IExperimentalEnergyTileEntity)tTileEntity).injectEnergy(aEnergyType, j, aPrimary, aSecondary-rUsedSecondary); + } else if (IC_ENERGY && aEnergyType == SubTag.ENERGY_ELECTRICITY && tTileEntity instanceof IEnergySink) { + if (((IEnergySink)tTileEntity).acceptsEnergyFrom((TileEntity)aEmitter, ForgeDirection.getOrientation(j))) { + while (aSecondary > rUsedSecondary && ((IEnergySink)tTileEntity).getDemandedEnergy() > 0 && ((IEnergySink)tTileEntity).injectEnergy(ForgeDirection.getOrientation(j), aPrimary, aPrimary) < aPrimary) rUsedSecondary++; + } + } + } + return rUsedSecondary; + } + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IFibreConnected.java b/src/main/java/gregtech/api/interfaces/tileentity/IFibreConnected.java new file mode 100644 index 0000000..7694b3d --- /dev/null +++ b/src/main/java/gregtech/api/interfaces/tileentity/IFibreConnected.java @@ -0,0 +1,31 @@ +package gregtech.api.interfaces.tileentity; + +/** + * This File has just internal Information about the Fibre Redstone State of a TileEntity + */ +public interface IFibreConnected extends IColoredTileEntity, IHasWorldObjectAndCoords { + /** + * If this Blocks accepts Fibre from this Side + */ + public void inputFibreFrom(byte aSide); + + /** + * If this Blocks emits Fibre to this Side + */ + public void outputsFibreTo(byte aSide); + + /** + * Sets the Signal this Blocks outputs to this Fibre Color + */ + public void setFibreOutput(byte aSide, byte aColor, byte aRedstoneStrength); + + /** + * Gets the Signal this Blocks outputs to this Fibre Color + */ + public byte getFibreOutput(byte aSide, byte aColor); + + /** + * Gets the Signal this Blocks receives from this Fibre Color + */ + public byte getFibreInput(byte aSide, byte aColor); +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IGearEnergyTileEntity.java b/src/main/java/gregtech/api/interfaces/tileentity/IGearEnergyTileEntity.java new file mode 100644 index 0000000..6ae032b --- /dev/null +++ b/src/main/java/gregtech/api/interfaces/tileentity/IGearEnergyTileEntity.java @@ -0,0 +1,16 @@ +package gregtech.api.interfaces.tileentity; + +public interface IGearEnergyTileEntity { + /** + * If Rotation Energy can be accepted on this Side. + * This means that the Gear/Axle will connect to this Side, and can cause the Gear/Axle to stop if the Energy isn't accepted. + */ + public boolean acceptsRotationalEnergy(byte aSide); + + /** + * Inject Energy Call for Rotational Energy. + * Rotation Energy can't be stored, this is just for things like internal Dynamos, which convert it into Energy, or into Progress. + * @param aSpeed Positive = Clockwise, Negative = Counterclockwise + */ + public boolean injectRotationalEnergy(byte aSide, long aSpeed, long aEnergy); +} diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IGregTechDeviceInformation.java b/src/main/java/gregtech/api/interfaces/tileentity/IGregTechDeviceInformation.java new file mode 100644 index 0000000..f6393f5 --- /dev/null +++ b/src/main/java/gregtech/api/interfaces/tileentity/IGregTechDeviceInformation.java @@ -0,0 +1,20 @@ +package gregtech.api.interfaces.tileentity; + +/** + * You are allowed to include this File in your Download, as i will not change it. + */ +public interface IGregTechDeviceInformation { + /** + * Is this even a TileEntity which allows GregTech Sensor Kits? + * I need things like this Function for MetaTileEntities, you MUST check this!!! + * Do not assume that it's a Information returning Device, when it just implements this Interface. + */ + public boolean isGivingInformation(); + + /** + * Up to 8 Strings can be returned. + * Note: If you insert "\\\\" in the String it tries to translate seperate Parts of the String instead of the String as a whole. + * @return an Array of Information Strings. Don't return null! + */ + public String[] getInfoData(); +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IGregTechTileEntity.java b/src/main/java/gregtech/api/interfaces/tileentity/IGregTechTileEntity.java new file mode 100644 index 0000000..5842cbd --- /dev/null +++ b/src/main/java/gregtech/api/interfaces/tileentity/IGregTechTileEntity.java @@ -0,0 +1,123 @@ +package gregtech.api.interfaces.tileentity; + +import java.util.ArrayList; +import java.util.List; + +import gregtech.api.interfaces.IDescribable; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; +import net.minecraftforge.fluids.IFluidHandler; + +/** + * A simple compound Interface for all my TileEntities. + * + * Also delivers most of the Informations about my TileEntities. + * + * It can cause Problems to include this Interface! + */ +public interface IGregTechTileEntity extends ITexturedTileEntity, IGearEnergyTileEntity, ICoverable, IFluidHandler, ITurnable, IGregTechDeviceInformation, IUpgradableMachine, IDigitalChest, IDescribable, IMachineBlockUpdateable { + /** + * gets the Error displayed on the GUI + */ + public int getErrorDisplayID(); + + /** + * sets the Error displayed on the GUI + */ + public void setErrorDisplayID(int aErrorID); + + /** + * @return the MetaID of the Block or the MetaTileEntity ID. + */ + public int getMetaTileID(); + + /** + * Internal Usage only! + */ + public int setMetaTileID(short aID); + + /** + * @return the MetaTileEntity which is belonging to this, or null if it doesnt has one. + */ + public IMetaTileEntity getMetaTileEntity(); + + /** + * Sets the MetaTileEntity. + * Even though this uses the Universal Interface, certain BaseMetaTileEntities only accept one kind of MetaTileEntity + * so only use this if you are sure its the correct one or you will get a Class cast Error. + * @param aMetaTileEntity + */ + public void setMetaTileEntity(IMetaTileEntity aMetaTileEntity); + + /** + * Causes a general Texture update. + * + * Only used Client Side to mark Blocks dirty. + */ + public void issueTextureUpdate(); + + /** + * Causes the Machine to send its initial Data, like Covers and its ID. + */ + public void issueClientUpdate(); + + /** + * causes Explosion. Strength in Overload-EU + */ + public void doExplosion(long aExplosionEU); + + /** + * Sets the Block on Fire in all 6 Directions + */ + public void setOnFire(); + + /** + * Sets the Block to Fire + */ + public void setToFire(); + + /** + * Sets the Owner of the Machine. Returns the set Name. + */ + public String setOwnerName(String aName); + + /** + * gets the Name of the Machines Owner or "Player" if not set. + */ + public String getOwnerName(); + + /** + * Sets initial Values from NBT + * @param tNBT is the NBTTag of readFromNBT + * @param aID is the MetaTileEntityID + */ + public void setInitialValuesAsNBT(NBTTagCompound aNBT, short aID); + + /** + * Called when leftclicking the TileEntity + */ + public void onLeftclick(EntityPlayer aPlayer); + + /** + * Called when rightclicking the TileEntity + */ + public boolean onRightclick(EntityPlayer aPlayer, byte aSide, float par1, float par2, float par3); + + public float getBlastResistance(byte aSide); + + public ArrayList getDrops(); + + /** + * 255 = 100% + */ + public int getLightOpacity(); + + public void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, List outputAABB, Entity collider); + public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ); + public void onEntityCollidedWithBlock(World aWorld, int aX, int aY, int aZ, Entity collider); +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IHasInventory.java b/src/main/java/gregtech/api/interfaces/tileentity/IHasInventory.java new file mode 100644 index 0000000..3b3d4ee --- /dev/null +++ b/src/main/java/gregtech/api/interfaces/tileentity/IHasInventory.java @@ -0,0 +1,33 @@ +package gregtech.api.interfaces.tileentity; + +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.item.ItemStack; + +public interface IHasInventory extends ISidedInventory, IHasWorldObjectAndCoords { + + /** + * if the Inventory of this TileEntity got modified this tick + */ + public boolean hasInventoryBeenModified(); + + /** + * if this is just a Holoslot + */ + public boolean isValidSlot(int aIndex); + + /** + * Tries to add a Stack to the Slot. + * It doesn't matter if the Slot is valid or invalid as described at the Function above. + * + * @return true if aStack == null, then false if aIndex is out of bounds, then false if aStack cannot be added, and then true if aStack has been added + */ + public boolean addStackToSlot(int aIndex, ItemStack aStack); + + /** + * Tries to add X Items of a Stack to the Slot. + * It doesn't matter if the Slot is valid or invalid as described at the Function above. + * + * @return true if aStack == null, then false if aIndex is out of bounds, then false if aStack cannot be added, and then true if aStack has been added + */ + public boolean addStackToSlot(int aIndex, ItemStack aStack, int aAmount); +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IHasWorldObjectAndCoords.java b/src/main/java/gregtech/api/interfaces/tileentity/IHasWorldObjectAndCoords.java new file mode 100644 index 0000000..c6ebb56 --- /dev/null +++ b/src/main/java/gregtech/api/interfaces/tileentity/IHasWorldObjectAndCoords.java @@ -0,0 +1,132 @@ +package gregtech.api.interfaces.tileentity; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraftforge.fluids.IFluidHandler; + +/** + * This is a bunch of Functions my TileEntities provide, to make life much easier, and to get rid of internal TileEntity stuff. + * + * This also makes access to adjacent TileEntities more Efficient. + * + * Note: It doesn't have to be a TileEntity in certain cases! And only certain cases, such as the Recipe checking of the findRecipe Function. + */ +public interface IHasWorldObjectAndCoords { + public World getWorld(); + public int getXCoord(); + public short getYCoord(); + public int getZCoord(); + + public boolean isServerSide(); + public boolean isClientSide(); + + public int getRandomNumber(int aRange); + + public TileEntity getTileEntity(int aX, int aY, int aZ); + public TileEntity getTileEntityOffset(int aX, int aY, int aZ); + public TileEntity getTileEntityAtSide(byte aSide); + public TileEntity getTileEntityAtSideAndDistance(byte aSide, int aDistance); + + public IInventory getIInventory(int aX, int aY, int aZ); + public IInventory getIInventoryOffset(int aX, int aY, int aZ); + public IInventory getIInventoryAtSide(byte aSide); + public IInventory getIInventoryAtSideAndDistance(byte aSide, int aDistance); + + public IFluidHandler getITankContainer(int aX, int aY, int aZ); + public IFluidHandler getITankContainerOffset(int aX, int aY, int aZ); + public IFluidHandler getITankContainerAtSide(byte aSide); + public IFluidHandler getITankContainerAtSideAndDistance(byte aSide, int aDistance); + + public IGregTechTileEntity getIGregTechTileEntity(int aX, int aY, int aZ); + public IGregTechTileEntity getIGregTechTileEntityOffset(int aX, int aY, int aZ); + public IGregTechTileEntity getIGregTechTileEntityAtSide(byte aSide); + public IGregTechTileEntity getIGregTechTileEntityAtSideAndDistance(byte aSide, int aDistance); + + public Block getBlock(int aX, int aY, int aZ); + public Block getBlockOffset(int aX, int aY, int aZ); + public Block getBlockAtSide(byte aSide); + public Block getBlockAtSideAndDistance(byte aSide, int aDistance); + + public byte getMetaID(int aX, int aY, int aZ); + public byte getMetaIDOffset(int aX, int aY, int aZ); + public byte getMetaIDAtSide(byte aSide); + public byte getMetaIDAtSideAndDistance(byte aSide, int aDistance); + + public byte getLightLevel(int aX, int aY, int aZ); + public byte getLightLevelOffset(int aX, int aY, int aZ); + public byte getLightLevelAtSide(byte aSide); + public byte getLightLevelAtSideAndDistance(byte aSide, int aDistance); + + public boolean getOpacity(int aX, int aY, int aZ); + public boolean getOpacityOffset(int aX, int aY, int aZ); + public boolean getOpacityAtSide(byte aSide); + public boolean getOpacityAtSideAndDistance(byte aSide, int aDistance); + + public boolean getSky(int aX, int aY, int aZ); + public boolean getSkyOffset(int aX, int aY, int aZ); + public boolean getSkyAtSide(byte aSide); + public boolean getSkyAtSideAndDistance(byte aSide, int aDistance); + + public boolean getAir(int aX, int aY, int aZ); + public boolean getAirOffset(int aX, int aY, int aZ); + public boolean getAirAtSide(byte aSide); + public boolean getAirAtSideAndDistance(byte aSide, int aDistance); + + public BiomeGenBase getBiome(); + public BiomeGenBase getBiome(int aX, int aZ); + + public int getOffsetX(byte aSide, int aMultiplier); + public short getOffsetY(byte aSide, int aMultiplier); + public int getOffsetZ(byte aSide, int aMultiplier); + + /** + * Checks if the TileEntity is Invalid or Unloaded. Stupid Minecraft cannot do that btw. + */ + public boolean isDead(); + + /** + * Sends a Block Event to the Client TileEntity, the byte Parameters are only for validation as Minecraft doesn't properly write Packet Data. + */ + public void sendBlockEvent(byte aID, byte aValue); + + /** + * @return the Time this TileEntity has been loaded. + */ + public long getTimer(); + + /** + * Sets the Light Level of this Block on a Scale of 0 - 15 + * It could be that it doesn't work. This is just for convenience. + */ + public void setLightValue(byte aLightValue); + + /** + * Function of the regular TileEntity + */ + public void writeToNBT(NBTTagCompound aNBT); + + /** + * Function of the regular TileEntity + */ + public void readFromNBT(NBTTagCompound aNBT); + + /** + * Function of the regular TileEntity + */ + public boolean isInvalidTileEntity(); + + /** + * Opens the GUI with this ID of this MetaTileEntity + */ + public boolean openGUI(EntityPlayer aPlayer, int aID); + + /** + * Opens the GUI with the ID = 0 of this TileEntity + */ + public boolean openGUI(EntityPlayer aPlayer); +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IMachineBlockUpdateable.java b/src/main/java/gregtech/api/interfaces/tileentity/IMachineBlockUpdateable.java new file mode 100644 index 0000000..ba8650f --- /dev/null +++ b/src/main/java/gregtech/api/interfaces/tileentity/IMachineBlockUpdateable.java @@ -0,0 +1,16 @@ +package gregtech.api.interfaces.tileentity; + +/** + * You are allowed to include this File in your Download, as i will not change it. + * Simple Interface for Machines, which need my Machine Blocks for MultiBlockStructures. + * + * Every Machine implementing this Interface will conduct Machine updates. + */ +public interface IMachineBlockUpdateable { + /** + * The Machine Update, which is called when the Machine needs an Update of its Parts. + * I suggest to wait 1-5 seconds before actually checking the Machine Parts. + * RP-Frames could for example cause Problems when you instacheck the Machine Parts. + */ + public void onMachineBlockUpdate(); +} diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IMachineProgress.java b/src/main/java/gregtech/api/interfaces/tileentity/IMachineProgress.java new file mode 100644 index 0000000..78f238a --- /dev/null +++ b/src/main/java/gregtech/api/interfaces/tileentity/IMachineProgress.java @@ -0,0 +1,69 @@ +package gregtech.api.interfaces.tileentity; + +/** + * For Machines which have Progress + */ +public interface IMachineProgress extends IHasWorldObjectAndCoords { + /** + * returns the Progress this Machine has made. Warning, this can also be negative! + */ + public int getProgress(); + + /** + * returns the Progress the Machine needs to complete its task. + */ + public int getMaxProgress(); + + /** + * increases the Progress of the Machine + */ + public boolean increaseProgress(int aProgressAmountInTicks); + + /** + * returns if the Machine currently does something. + */ + public boolean hasThingsToDo(); + + /** + * returns if the Machine just got enableWorking called after being disabled. + * Used for Translocators, which need to check if they need to transfer immediately. + */ + public boolean hasWorkJustBeenEnabled(); + + /** + * allows Machine to work + */ + public void enableWorking(); + + /** + * disallows Machine to work + */ + public void disableWorking(); + + /** + * if the Machine is allowed to Work + */ + public boolean isAllowedToWork(); + + /** + * used to control Machines via Redstone Signal Strength by special Covers + * only Values between 0 and 15! + */ + public void setWorkDataValue(byte aValue); + + /** + * used to control Machines via Redstone Signal Strength by special Covers + * In case of 0 the Machine is very likely doing nothing, or is just not being controlled at all. + */ + public byte getWorkDataValue(); + + /** + * gives you the Active Status of the Machine + */ + public boolean isActive(); + + /** + * sets the visible Active Status of the Machine + */ + public void setActive(boolean aActive); +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IPipeRenderedTileEntity.java b/src/main/java/gregtech/api/interfaces/tileentity/IPipeRenderedTileEntity.java new file mode 100644 index 0000000..0ddc76a --- /dev/null +++ b/src/main/java/gregtech/api/interfaces/tileentity/IPipeRenderedTileEntity.java @@ -0,0 +1,9 @@ +package gregtech.api.interfaces.tileentity; + +import gregtech.api.interfaces.ITexture; + +public interface IPipeRenderedTileEntity extends ICoverable, ITexturedTileEntity { + public float getThickNess(); + public byte getConnections(); + public ITexture[] getTextureUncovered(byte aSide); +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IRedstoneEmitter.java b/src/main/java/gregtech/api/interfaces/tileentity/IRedstoneEmitter.java new file mode 100644 index 0000000..720f7e9 --- /dev/null +++ b/src/main/java/gregtech/api/interfaces/tileentity/IRedstoneEmitter.java @@ -0,0 +1,37 @@ +package gregtech.api.interfaces.tileentity; + +/** + * This File has just internal Information about the Redstone State of a TileEntity + */ +public interface IRedstoneEmitter extends IHasWorldObjectAndCoords { + /** + * gets the Redstone Level the TileEntity should emit to the given Output Side + */ + byte getOutputRedstoneSignal(byte aSide); + + /** + * sets the Redstone Level the TileEntity should emit to the given Output Side + * + * Do not use this if ICoverable is implemented. ICoverable has @getInternalOutputRedstoneSignal for Machine internal Output Redstone, so that it doesnt conflict with Cover Redstone. + * This sets the true Redstone Output Signal. Only Cover Behaviors should use it, not MetaTileEntities. + */ + void setOutputRedstoneSignal(byte aSide, byte aStrength); + + /** + * gets the Redstone Level the TileEntity should emit to the given Output Side + */ + byte getStrongOutputRedstoneSignal(byte aSide); + + /** + * sets the Redstone Level the TileEntity should emit to the given Output Side + * + * Do not use this if ICoverable is implemented. ICoverable has @getInternalOutputRedstoneSignal for Machine internal Output Redstone, so that it doesnt conflict with Cover Redstone. + * This sets the true Redstone Output Signal. Only Cover Behaviors should use it, not MetaTileEntities. + */ + void setStrongOutputRedstoneSignal(byte aSide, byte aStrength); + + /** + * Gets the Output for the comparator on the given Side + */ + byte getComparatorValue(byte aSide); +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IRedstoneReceiver.java b/src/main/java/gregtech/api/interfaces/tileentity/IRedstoneReceiver.java new file mode 100644 index 0000000..f4c63c8 --- /dev/null +++ b/src/main/java/gregtech/api/interfaces/tileentity/IRedstoneReceiver.java @@ -0,0 +1,29 @@ +package gregtech.api.interfaces.tileentity; + +/** + * This File has just internal Information about the Redstone State of a TileEntity + */ +public interface IRedstoneReceiver extends IHasWorldObjectAndCoords { + /** + * gets the Redstone Level of the TileEntity to the given Input Side + * + * Do not use this if ICoverable is implemented. ICoverable has @getInternalInputRedstoneSignal for Machine internal Input Redstone + * This returns the true incoming Redstone Signal. Only Cover Behaviors should check it, not MetaTileEntities. + */ + public byte getInputRedstoneSignal(byte aSide); + + /** + * gets the strongest Redstone Level the TileEntity receives + */ + public byte getStrongestRedstone(); + + /** + * gets if the TileEntity receives Redstone + */ + public boolean getRedstone(); + + /** + * gets if the TileEntity receives Redstone at this Side + */ + public boolean getRedstone(byte aSide); +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IRedstoneTileEntity.java b/src/main/java/gregtech/api/interfaces/tileentity/IRedstoneTileEntity.java new file mode 100644 index 0000000..a1d2b53 --- /dev/null +++ b/src/main/java/gregtech/api/interfaces/tileentity/IRedstoneTileEntity.java @@ -0,0 +1,17 @@ +package gregtech.api.interfaces.tileentity; + +/** + * This File has just internal Information about the Redstone State of a TileEntity + */ +public interface IRedstoneTileEntity extends IRedstoneEmitter, IRedstoneReceiver { + /** + * enables/disables Redstone Output in general. + */ + void setGenericRedstoneOutput(boolean aOnOff); + + /** + * Causes a general Block update. + * Sends nothing to Client, just causes a Block Update. + */ + public void issueBlockUpdate(); +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/tileentity/ITexturedTileEntity.java b/src/main/java/gregtech/api/interfaces/tileentity/ITexturedTileEntity.java new file mode 100644 index 0000000..3c0782b --- /dev/null +++ b/src/main/java/gregtech/api/interfaces/tileentity/ITexturedTileEntity.java @@ -0,0 +1,10 @@ +package gregtech.api.interfaces.tileentity; + +import gregtech.api.interfaces.ITexture; + +public interface ITexturedTileEntity { + /** + * @return the Textures rendered by the GT Rendering + */ + public ITexture[] getTexture(byte aSide); +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/tileentity/ITurnable.java b/src/main/java/gregtech/api/interfaces/tileentity/ITurnable.java new file mode 100644 index 0000000..1605bd6 --- /dev/null +++ b/src/main/java/gregtech/api/interfaces/tileentity/ITurnable.java @@ -0,0 +1,33 @@ +package gregtech.api.interfaces.tileentity; + + +/** + * Implemented by all my Machines. However without any security checks, if the Players are even allowed to rotate it. + */ +public interface ITurnable { + /** + * Get the block's facing. + * + * @return front Block facing + */ + byte getFrontFacing(); + + /** + * Get the block's back facing. + * + * @return opposite Block facing + */ + byte getBackFacing(); + + /** + * Determine if the wrench can be used to set the block's facing. + */ + boolean isValidFacing(byte aSide); + + /** + * Set the block's facing + * + * @param facing facing to set the block to + */ + void setFrontFacing(byte aSide); +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IUpgradableMachine.java b/src/main/java/gregtech/api/interfaces/tileentity/IUpgradableMachine.java new file mode 100644 index 0000000..97360fd --- /dev/null +++ b/src/main/java/gregtech/api/interfaces/tileentity/IUpgradableMachine.java @@ -0,0 +1,42 @@ +package gregtech.api.interfaces.tileentity; + + +/** + * To access my Machines a bit easier + */ +public interface IUpgradableMachine extends IMachineProgress { + /** + * Accepts Upgrades. Some Machines have an Upgrade Limit. + */ + boolean isUpgradable(); + + /** + * Accepts Muffler Upgrades + */ + boolean isMufflerUpgradable(); + + /** + * Accepts Steam-Converter Upgrades + */ + boolean isSteamEngineUpgradable(); + + /** + * Adds Muffler Upgrade + */ + boolean addMufflerUpgrade(); + + /** + * Adds MJ-Converter Upgrade + */ + boolean addSteamEngineUpgrade(); + + /** + * Does this Machine have an Muffler + */ + boolean hasMufflerUpgrade(); + + /** + * Does this Machine have a Steam-Converter + */ + boolean hasSteamEngineUpgrade(); +} diff --git a/src/main/java/gregtech/api/items/GT_CoolantCellIC_Item.java b/src/main/java/gregtech/api/items/GT_CoolantCellIC_Item.java new file mode 100644 index 0000000..17324fc --- /dev/null +++ b/src/main/java/gregtech/api/items/GT_CoolantCellIC_Item.java @@ -0,0 +1,75 @@ +package gregtech.api.items; + + +import ic2.api.reactor.IReactor; +import ic2.api.reactor.IReactorComponent; +import net.minecraft.item.ItemStack; + +public class GT_CoolantCellIC_Item + extends GT_CoolantCell_Item + implements IReactorComponent +{ + public GT_CoolantCellIC_Item(String aUnlocalized, String aEnglish, int aMaxStore) + { + super(aUnlocalized, aEnglish, aMaxStore); + } + + @Override +public void processChamber(IReactor aReactor, ItemStack aStack, int x, int y, boolean aHeatRun) {} + + @Override +public boolean acceptUraniumPulse(IReactor aReactor, ItemStack aStack, ItemStack pulsingStack, int youX, int youY, int pulseX, int pulseY, boolean aHeatRun) + { + return false; + } + + @Override +public boolean canStoreHeat(IReactor aReactor, ItemStack aStack, int x, int y) + { + return true; + } + + @Override +public int getMaxHeat(IReactor aReactor, ItemStack aStack, int x, int y) + { + return this.heatStorage; + } + + @Override +public int getCurrentHeat(IReactor aReactor, ItemStack aStack, int x, int y) + { + return getHeatOfStack(aStack); + } + + @Override +public float influenceExplosion(IReactor aReactor, ItemStack aStack) + { + return 1.0F + this.heatStorage / 30000.0F; + } + + @Override +public int alterHeat(IReactor aReactor, ItemStack aStack, int x, int y, int aHeat) + { + int tHeat = getHeatOfStack(aStack); + tHeat += aHeat; + if (tHeat > this.heatStorage) + { + aReactor.setItemAt(x, y, (ItemStack)null); + aHeat = this.heatStorage - tHeat + 1; + } + else + { + if (tHeat < 0) + { + aHeat = tHeat; + tHeat = 0; + } + else + { + aHeat = 0; + } + setHeatForStack(aStack, tHeat); + } + return aHeat; + } +} diff --git a/src/main/java/gregtech/api/items/GT_CoolantCell_Item.java b/src/main/java/gregtech/api/items/GT_CoolantCell_Item.java new file mode 100644 index 0000000..d4fe0d8 --- /dev/null +++ b/src/main/java/gregtech/api/items/GT_CoolantCell_Item.java @@ -0,0 +1,59 @@ +package gregtech.api.items; + +import java.util.List; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +public class GT_CoolantCell_Item + extends GT_Generic_Item +{ + protected int heatStorage; + + public GT_CoolantCell_Item(String aUnlocalized, String aEnglish, int aMaxStore) + { + super(aUnlocalized, aEnglish, null); + this.setMaxStackSize(1); + this.setMaxDamage(100); + setNoRepair(); + this.heatStorage = aMaxStore; + } + + protected void setHeatForStack(ItemStack aStack, int aHeat) + { + NBTTagCompound tNBT = aStack.getTagCompound(); + if (tNBT == null) + { + tNBT = new NBTTagCompound(); + aStack.setTagCompound(tNBT); + } + tNBT.setInteger("heat", aHeat); + if (this.heatStorage > 0) + { + double var4 = (double)aHeat / (double)this.heatStorage; + int var6 = (int)(aStack.getMaxDamage() * var4); + if (var6 >= aStack.getMaxDamage()) { + var6 = aStack.getMaxDamage() - 1; + } + aStack.setItemDamage(var6); + } + } + + @Override +public void addAdditionalToolTips(List aList, ItemStack aStack) + { + super.addAdditionalToolTips(aList, aStack); + aList.add("Stored Heat: " + getHeatOfStack(aStack)); + } + + protected static int getHeatOfStack(ItemStack aStack) + { + NBTTagCompound tNBT = aStack.getTagCompound(); + if (tNBT == null) + { + tNBT = new NBTTagCompound(); + aStack.setTagCompound(tNBT); + } + return tNBT.getInteger("heat"); + } +} diff --git a/src/main/java/gregtech/api/items/GT_EnergyArmor_Item.java b/src/main/java/gregtech/api/items/GT_EnergyArmor_Item.java new file mode 100644 index 0000000..36b2358 --- /dev/null +++ b/src/main/java/gregtech/api/items/GT_EnergyArmor_Item.java @@ -0,0 +1,323 @@ +package gregtech.api.items; + +import static gregtech.api.enums.GT_Values.RES_PATH_ITEM; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Utility; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraftforge.common.ISpecialArmor; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.entity.living.LivingFallEvent; + +public class GT_EnergyArmor_Item extends ItemArmor implements ISpecialArmor { + public int mCharge, mTransfer, mTier, mDamageEnergyCost, mSpecials; + public boolean mChargeProvider; + public double mArmorAbsorbtionPercentage; + + public static Map jumpChargeMap = new HashMap(); + + public GT_EnergyArmor_Item(int aID, String aUnlocalized, String aEnglish, int aCharge, int aTransfer, int aTier, int aDamageEnergyCost, int aSpecials, double aArmorAbsorbtionPercentage, boolean aChargeProvider, int aType, int aArmorIndex) { + super(ArmorMaterial.DIAMOND, aArmorIndex, aType); + setMaxStackSize(1); + setMaxDamage(100); + setNoRepair(); + setUnlocalizedName(aUnlocalized); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".name", aEnglish); + mCharge = Math.max(1, aCharge); + mTransfer = Math.max(1, aTransfer); + mTier = Math.max(1, aTier); + mSpecials = aSpecials; + mChargeProvider = aChargeProvider; + mDamageEnergyCost = Math.max(0, aDamageEnergyCost); + mArmorAbsorbtionPercentage = aArmorAbsorbtionPercentage; + MinecraftForge.EVENT_BUS.register(this); + } + + @Override + public ItemStack onItemRightClick(ItemStack aStack, World aWorld, EntityPlayer aPlayer) { + ItemStack tStack = aPlayer.inventory.armorInventory[3-armorType]; + if (tStack != null) { + for (int i = 0; i < 9; i++) { + if (aPlayer.inventory.mainInventory[i] == aStack) { + aPlayer.inventory.armorInventory[3-armorType] = aPlayer.inventory.mainInventory[i]; + aPlayer.inventory.mainInventory[i] = tStack; + return tStack; + } + } + } + return super.onItemRightClick(aStack, aWorld, aPlayer); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister aIconRegister) { + this.itemIcon = aIconRegister.registerIcon(RES_PATH_ITEM + getUnlocalizedName()); + } + + @Override + public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { + aList.add("Tier: " + mTier); + if ((mSpecials & 1) != 0) aList.add("Rebreather"); + if ((mSpecials & 2) != 0) aList.add("Inertia Damper"); + if ((mSpecials & 4) != 0) aList.add("Food Replicator"); + if ((mSpecials & 8) != 0) aList.add("Medicine Module"); + if ((mSpecials & 16) != 0) aList.add("Lamp"); + if ((mSpecials & 32) != 0) aList.add("Solarpanel"); + if ((mSpecials & 64) != 0) aList.add("Extinguisher Module"); + if ((mSpecials & 128) != 0) aList.add("Jump Booster"); + if ((mSpecials & 256) != 0) aList.add("Speed Booster"); + if ((mSpecials & 512) != 0) aList.add("Invisibility Field"); + if ((mSpecials & 1024) != 0) aList.add("Infinite Charge"); + } + + private static void setCharge(ItemStack aStack) { + NBTTagCompound tNBT = aStack.getTagCompound(); + if (tNBT == null) tNBT = new NBTTagCompound(); + tNBT.setInteger("charge", 1000000000); + aStack.setTagCompound(tNBT); + } + + @Override + public void onArmorTick(World aWorld, EntityPlayer aPlayer, ItemStack aStack) { + if (mSpecials == 0) return; + + if (!aPlayer.worldObj.isRemote && (mSpecials & 1) != 0) { + int var4 = aPlayer.getAir(); + if (GT_ModHandler.canUseElectricItem(aStack, 1000) && var4 < 50) { + aPlayer.setAir(var4 + 250); + GT_ModHandler.useElectricItem(aStack, 1000, aPlayer); + } + } + + if (!aPlayer.worldObj.isRemote && (mSpecials & 4) != 0) { + if (GT_ModHandler.canUseElectricItem(aStack, 50000) && aPlayer.getFoodStats().needFood()) { + aPlayer.getFoodStats().addStats(1, 0.0F); + GT_ModHandler.useElectricItem(aStack, 50000, aPlayer); + } + } + + if ((mSpecials & 8) != 0) { + if (GT_ModHandler.canUseElectricItem(aStack, 10000) && aPlayer.isPotionActive(Potion.poison)) { + GT_Utility.removePotion(aPlayer, Potion.poison.id); + GT_ModHandler.useElectricItem(aStack, 10000, aPlayer); + } + if (GT_ModHandler.canUseElectricItem(aStack, 100000) && aPlayer.isPotionActive(Potion.wither)) { + GT_Utility.removePotion(aPlayer, Potion.wither.id); + GT_ModHandler.useElectricItem(aStack, 100000, aPlayer); + } + } + + if ((mSpecials & 64) != 0) { + aPlayer.setFire(0); + } + + if (!aPlayer.worldObj.isRemote && (mSpecials & 128) != 0) { + float var6 = jumpChargeMap.containsKey(aPlayer) ? ((Float)jumpChargeMap.get(aPlayer)).floatValue() : 1.0F; + + if (GT_ModHandler.canUseElectricItem(aStack, 1000) && aPlayer.onGround && var6 < 1.0F) { + var6 = 1.0F; + GT_ModHandler.useElectricItem(aStack, 1000, aPlayer); + } + + if (aPlayer.motionY >= 0.0D && var6 > 0.0F && !aPlayer.isInWater()) { + if (GT_ModHandler.getJumpKeyDown(aPlayer) && GT_ModHandler.getBoostKeyDown(aPlayer)) { + if (var6 == 1.0F) { + aPlayer.motionX *= 3.5D; + aPlayer.motionZ *= 3.5D; + } + + aPlayer.motionY += (var6 * 0.3F); + var6 = (float)(var6 * 0.75D); + } else if (var6 < 1.0F) { + var6 = 0.0F; + } + } + + jumpChargeMap.put(aPlayer, Float.valueOf(var6)); + } + + if ((mSpecials & 256) != 0) { + if (GT_ModHandler.canUseElectricItem(aStack, 100) && aPlayer.isSprinting() && (aPlayer.onGround && Math.abs(aPlayer.motionX) + Math.abs(aPlayer.motionZ) > 0.10000000149011612D || aPlayer.isInWater())) { + GT_ModHandler.useElectricItem(aStack, 100, aPlayer); + float var7 = 0.22F; + + if (aPlayer.isInWater()) { + GT_ModHandler.useElectricItem(aStack, 100, aPlayer); + var7 = 0.1F; + + + if (aPlayer.motionY > 0) { + aPlayer.motionY += 0.10000000149011612D; + } + } + + if (var7 > 0.0F) { + aPlayer.moveFlying(0.0F, 1.0F, var7); + } + } + } + + if ((mSpecials & 512) != 0) { + if (GT_ModHandler.canUseElectricItem(aStack, 10000)) { + GT_ModHandler.useElectricItem(aStack, 10000, aPlayer); + aPlayer.addPotionEffect(new PotionEffect(Potion.invisibility.getId(), 25, 1, true)); + } + } + + if (!aPlayer.worldObj.isRemote && (mSpecials & (16|32)) != 0) { + //if (GregTech_API.sWorldTickCounter%20==0) { + ItemStack tTargetChargeItem = aStack, tTargetDechargeItem = aStack; + + if (GT_ModHandler.chargeElectricItem(tTargetChargeItem, 1, Integer.MAX_VALUE, true, true) < 1) { + tTargetChargeItem = aPlayer.inventory.armorInventory[2]; + } + if (GT_ModHandler.dischargeElectricItem(tTargetDechargeItem, 10, Integer.MAX_VALUE, true, true, true) < 10) { + tTargetDechargeItem = aPlayer.inventory.armorInventory[2]; + } + + if (tTargetChargeItem == null || !GT_ModHandler.isElectricItem(tTargetChargeItem)) { + tTargetChargeItem = null; + } + if (tTargetDechargeItem == null || !GT_ModHandler.isElectricItem(tTargetChargeItem) || !(aStack == tTargetDechargeItem || GT_ModHandler.isChargerItem(tTargetDechargeItem))) { + tTargetDechargeItem = null; + } + + if (aPlayer.worldObj.isDaytime() && aPlayer.worldObj.canBlockSeeTheSky(MathHelper.floor_double(aPlayer.posX), MathHelper.floor_double(aPlayer.posY+1), MathHelper.floor_double(aPlayer.posZ))) { + if ((mSpecials & 32) != 0 && tTargetChargeItem != null) { + GT_ModHandler.chargeElectricItem(tTargetChargeItem, 20, Integer.MAX_VALUE, true, false); + } + } else { + /* TODO: + if ((mSpecials & 16) != 0 && tTargetDechargeItem != null && GT_ModHandler.canUseElectricItem(tTargetDechargeItem, 10)) { + if (aPlayer.worldObj.getBlock ((int)aPlayer.posX, (int)aPlayer.posY+1, (int)aPlayer.posZ) == Blocks.air) + aPlayer.worldObj.setBlock ((int)aPlayer.posX, (int)aPlayer.posY+1, (int)aPlayer.posZ, GregTech_API.sBlockList[3]); + GT_ModHandler.useElectricItem(tTargetDechargeItem, 10, aPlayer); + }*/ + //} + } + } + } + + @Override + public boolean getShareTag() { + return true; + } + + @Override + @SideOnly(Side.CLIENT) + public void getSubItems(Item aItem, CreativeTabs var2, List var3) { + ItemStack tCharged = new ItemStack(this, 1), tUncharged = new ItemStack(this, 1, getMaxDamage()); + GT_ModHandler.chargeElectricItem(tCharged, Integer.MAX_VALUE, Integer.MAX_VALUE, true, false); + var3.add(tCharged); + var3.add(tUncharged); + } + + public boolean canProvideEnergy(ItemStack aStack) { + if ((mSpecials & 1024) != 0) setCharge(aStack); + return mChargeProvider; + } + + public Item getChargedItem(ItemStack aStack) { + if ((mSpecials & 1024) != 0) setCharge(aStack); + return this; + } + + public Item getEmptyItem(ItemStack aStack) { + if ((mSpecials & 1024) != 0) setCharge(aStack); + return this; + } + + public int getMaxCharge(ItemStack aStack) { + if ((mSpecials & 1024) != 0) setCharge(aStack); + return mCharge; + } + + public int getTier(ItemStack aStack) { + if ((mSpecials & 1024) != 0) setCharge(aStack); + return mTier; + } + + public int getTransferLimit(ItemStack aStack) { + if ((mSpecials & 1024) != 0) setCharge(aStack); + return mTransfer; + } + + @Override + public int getItemEnchantability() { + return 0; + } + + @Override + public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) { + return false; + } + + @Override + public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) { + return false; + } + + // TODO: @ForgeSubscribe + public void onEntityLivingFallEvent(LivingFallEvent var1) { + if (!var1.entity.worldObj.isRemote && var1.entity instanceof EntityPlayer) { + EntityPlayer var2 = (EntityPlayer)var1.entity; + for (int i = 0; i < 4; i++) { + ItemStack var3 = var2.inventory.armorInventory[i]; + if (var3 != null && var3.getItem() == this && (mSpecials & 2) != 0) { + int var4 = (int)var1.distance - 3; + int var5 = (this.mDamageEnergyCost * var4) / 4; + if (var5 <= GT_ModHandler.dischargeElectricItem(var3, Integer.MAX_VALUE, Integer.MAX_VALUE, true, true, true)) { + GT_ModHandler.dischargeElectricItem(var3, var5, Integer.MAX_VALUE, true, false, true); + var1.setCanceled(true); + break; + } + } + } + } + } + + @Override + public ISpecialArmor.ArmorProperties getProperties(EntityLivingBase var1, ItemStack var2, DamageSource var3, double var4, int var6) { + return new ISpecialArmor.ArmorProperties((var3 == DamageSource.fall && (mSpecials & 2) != 0)?10:0, getBaseAbsorptionRatio() * mArmorAbsorbtionPercentage, mDamageEnergyCost > 0 ? 25 * GT_ModHandler.dischargeElectricItem(var2, Integer.MAX_VALUE, Integer.MAX_VALUE, true, true, true) / mDamageEnergyCost : 0); + } + + @Override + public int getArmorDisplay(EntityPlayer var1, ItemStack var2, int var3) { + return (int)Math.round(20.0D * getBaseAbsorptionRatio() * mArmorAbsorbtionPercentage); + } + + @Override + public void damageArmor(EntityLivingBase var1, ItemStack var2, DamageSource var3, int var4, int var5) { + GT_ModHandler.dischargeElectricItem(var2, var4 * mDamageEnergyCost, Integer.MAX_VALUE, true, false, true); + } + + private double getBaseAbsorptionRatio() { + if (mArmorAbsorbtionPercentage <= 0) return 0.00; + switch (this.armorType) { + case 0: return 0.15; + case 1: return 0.40; + case 2: return 0.30; + case 3: return 0.15; + default: return 0.00; + } + } +} diff --git a/src/main/java/gregtech/api/items/GT_Generic_Block.java b/src/main/java/gregtech/api/items/GT_Generic_Block.java new file mode 100644 index 0000000..dc2a16c --- /dev/null +++ b/src/main/java/gregtech/api/items/GT_Generic_Block.java @@ -0,0 +1,20 @@ +package gregtech.api.items; + +import static gregtech.api.enums.GT_Values.W; + +import cpw.mods.fml.common.registry.GameRegistry; +import gregtech.api.util.GT_LanguageManager; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.item.ItemBlock; + +public class GT_Generic_Block extends Block { + protected final String mUnlocalizedName; + + protected GT_Generic_Block(Class aItemClass, String aName, Material aMaterial) { + super(aMaterial); + setBlockName(mUnlocalizedName = aName); + GameRegistry.registerBlock(this, aItemClass, getUnlocalizedName()); + GT_LanguageManager.addStringLocalization(getUnlocalizedName()+"." + W + ".name", "Any Sub Block of this one"); + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/items/GT_Generic_Item.java b/src/main/java/gregtech/api/items/GT_Generic_Item.java new file mode 100644 index 0000000..5a9d497 --- /dev/null +++ b/src/main/java/gregtech/api/items/GT_Generic_Item.java @@ -0,0 +1,142 @@ +package gregtech.api.items; + +import static gregtech.api.enums.GT_Values.MOD_ID; +import static gregtech.api.enums.GT_Values.RES_PATH_ITEM; + +import java.util.List; + +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.SubTag; +import gregtech.api.interfaces.IProjectileItem; +import gregtech.api.util.GT_Config; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Utility; +import net.minecraft.block.BlockDispenser; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.dispenser.BehaviorDefaultDispenseItem; +import net.minecraft.dispenser.BehaviorProjectileDispense; +import net.minecraft.dispenser.IBlockSource; +import net.minecraft.dispenser.IPosition; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IProjectile; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +/** + * Extended by most Items, also used as a fallback Item, to prevent the accidental deletion when Errors occur. + */ +public class GT_Generic_Item extends Item implements IProjectileItem { + protected IIcon mIcon; + private final String mName, mTooltip; + + public GT_Generic_Item(String aUnlocalized, String aEnglish, String aEnglishTooltip) { + this(aUnlocalized, aEnglish, aEnglishTooltip, true); + } + + public GT_Generic_Item(String aUnlocalized, String aEnglish, String aEnglishTooltip, boolean aWriteToolTipIntoLangFile) { + super(); + mName = "gt." + aUnlocalized; + GT_LanguageManager.addStringLocalization(mName + ".name", aEnglish); + if (GT_Utility.isStringValid(aEnglishTooltip)) GT_LanguageManager.addStringLocalization(mTooltip = mName + ".tooltip_main", aEnglishTooltip, aWriteToolTipIntoLangFile); else mTooltip = null; + GameRegistry.registerItem(this, mName, MOD_ID); + BlockDispenser.dispenseBehaviorRegistry.putObject(this, new GT_Item_Dispense()); + } + + @Override public final Item setUnlocalizedName(String aName) {return this;} + @Override public final String getUnlocalizedName() {return mName;} + @Override public String getUnlocalizedName(ItemStack aStack) {return getHasSubtypes()?mName+"."+getDamage(aStack):mName;} + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister aIconRegister) { + mIcon = aIconRegister.registerIcon(RES_PATH_ITEM + (GT_Config.troll?"troll":mName)); + } + + @Override + public boolean doesSneakBypassUse(World aWorld, int aX, int aY, int aZ, EntityPlayer aPlayer) { + return true; + } + + @Override + public IIcon getIconFromDamage(int par1) { + return mIcon; + } + + public int getTier(ItemStack aStack) { + return 0; + } + + @Override + public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { + if (getMaxDamage() > 0 && !getHasSubtypes()) aList.add((aStack.getMaxDamage() - getDamage(aStack)) + " / " + aStack.getMaxDamage()); + if (mTooltip != null) aList.add(GT_LanguageManager.getTranslation(mTooltip)); + if (GT_ModHandler.isElectricItem(aStack)) aList.add("Tier: " + getTier(aStack)); + addAdditionalToolTips(aList, aStack); + } + + protected void addAdditionalToolTips(List aList, ItemStack aStack) { + // + } + + @Override + public void onCreated(ItemStack aStack, World aWorld, EntityPlayer aPlayer) { + isItemStackUsable(aStack); + } + + public boolean isItemStackUsable(ItemStack aStack) { + return true; + } + + public ItemStack onDispense(IBlockSource aSource, ItemStack aStack) { + EnumFacing enumfacing = BlockDispenser.func_149937_b(aSource.getBlockMetadata()); + IPosition iposition = BlockDispenser.func_149939_a(aSource); + ItemStack itemstack1 = aStack.splitStack(1); + BehaviorDefaultDispenseItem.doDispense(aSource.getWorld(), itemstack1, 6, enumfacing, iposition); + return aStack; + } + + public static class GT_Item_Dispense extends BehaviorProjectileDispense { + @Override + public ItemStack dispenseStack(IBlockSource aSource, ItemStack aStack) { + return ((GT_Generic_Item)aStack.getItem()).onDispense(aSource, aStack); + } + + @Override + protected IProjectile getProjectileEntity(World aWorld, IPosition aPosition) { + return null; + } + } + + @Override + public EntityArrow getProjectile(SubTag aProjectileType, ItemStack aStack, World aWorld, double aX, double aY, double aZ) { + return null; + } + + @Override + public EntityArrow getProjectile(SubTag aProjectileType, ItemStack aStack, World aWorld, EntityLivingBase aEntity, float aSpeed) { + return null; + } + + @Override + public boolean hasProjectile(SubTag aProjectileType, ItemStack aStack) { + return false; + } + + @Override + public ItemStack getContainerItem(ItemStack aStack) { + return null; + } + + @Override + public final boolean hasContainerItem(ItemStack aStack) { + return getContainerItem(aStack) != null; + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/items/GT_MetaBase_Item.java b/src/main/java/gregtech/api/items/GT_MetaBase_Item.java new file mode 100644 index 0000000..174a6af --- /dev/null +++ b/src/main/java/gregtech/api/items/GT_MetaBase_Item.java @@ -0,0 +1,555 @@ +package gregtech.api.items; + +import static gregtech.api.enums.GT_Values.D1; +import static gregtech.api.enums.GT_Values.V; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +import gregtech.api.enums.SubTag; +import gregtech.api.interfaces.IItemBehaviour; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_Log; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Utility; +import ic2.api.item.ElectricItem; +import ic2.api.item.IElectricItem; +import ic2.api.item.IElectricItemManager; +import ic2.api.item.ISpecialElectricItem; +import net.minecraft.dispenser.IBlockSource; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.inventory.Container; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.World; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.IFluidContainerItem; + +public abstract class GT_MetaBase_Item extends GT_Generic_Item implements ISpecialElectricItem, IElectricItemManager, IFluidContainerItem { + /* ---------- CONSTRUCTOR AND MEMBER VARIABLES ---------- */ + private final HashMap>> mItemBehaviors = new HashMap>>(); + + /** + * Creates the Item using these Parameters. + * @param aUnlocalized The Unlocalized Name of this Item. + * @param aGeneratedPrefixList The OreDict Prefixes you want to have generated. + */ + public GT_MetaBase_Item(String aUnlocalized) { + super(aUnlocalized, "Generated Item", null, false); + setHasSubtypes(true); + setMaxDamage(0); + } + + /** + * Adds a special Item Behaviour to the Item. + * + * Note: the boolean Behaviours sometimes won't be executed if another boolean Behaviour returned true before. + * + * @param aMetaValue the Meta Value of the Item you want to add it to. [0 - 32765] + * @param aBehavior the Click Behavior you want to add. + * @return the Item itself for convenience in constructing. + */ + public final GT_MetaBase_Item addItemBehavior(int aMetaValue, IItemBehaviour aBehavior) { + if (aMetaValue < 0 || aMetaValue >= 32766 || aBehavior == null) return this; + ArrayList> tList = mItemBehaviors.get((short)aMetaValue); + if (tList == null) { + tList = new ArrayList>(1); + mItemBehaviors.put((short)aMetaValue, tList); + } + tList.add(aBehavior); + return this; + } + + public abstract Long[] getElectricStats(ItemStack aStack); + public abstract Long[] getFluidContainerStats(ItemStack aStack); + + @Override + public boolean hasProjectile(SubTag aProjectileType, ItemStack aStack) { + ArrayList> tList = mItemBehaviors.get((short)getDamage(aStack)); + if (tList != null) for (IItemBehaviour tBehavior : tList) if (tBehavior.hasProjectile(this, aProjectileType, aStack)) return true; + return super.hasProjectile(aProjectileType, aStack); + } + + @Override + public EntityArrow getProjectile(SubTag aProjectileType, ItemStack aStack, World aWorld, double aX, double aY, double aZ) { + ArrayList> tList = mItemBehaviors.get((short)getDamage(aStack)); + if (tList != null) for (IItemBehaviour tBehavior : tList) { + EntityArrow rArrow = tBehavior.getProjectile(this, aProjectileType, aStack, aWorld, aX, aY, aZ); + if (rArrow != null) return rArrow; + } + return super.getProjectile(aProjectileType, aStack, aWorld, aX, aY, aZ); + } + + @Override + public EntityArrow getProjectile(SubTag aProjectileType, ItemStack aStack, World aWorld, EntityLivingBase aEntity, float aSpeed) { + ArrayList> tList = mItemBehaviors.get((short)getDamage(aStack)); + if (tList != null) for (IItemBehaviour tBehavior : tList) { + EntityArrow rArrow = tBehavior.getProjectile(this, aProjectileType, aStack, aWorld, aEntity, aSpeed); + if (rArrow != null) return rArrow; + } + return super.getProjectile(aProjectileType, aStack, aWorld, aEntity, aSpeed); + } + + @Override + public ItemStack onDispense(IBlockSource aSource, ItemStack aStack) { + ArrayList> tList = mItemBehaviors.get((short)getDamage(aStack)); + if (tList != null) for (IItemBehaviour tBehavior : tList) if (tBehavior.canDispense(this, aSource, aStack)) return tBehavior.onDispense(this, aSource, aStack); + return super.onDispense(aSource, aStack); + } + + @Override + public boolean isItemStackUsable(ItemStack aStack) { + ArrayList> tList = mItemBehaviors.get((short)getDamage(aStack)); + if (tList != null) for (IItemBehaviour tBehavior : tList) if (!tBehavior.isItemStackUsable(this, aStack)) return false; + return super.isItemStackUsable(aStack); + } + + @Override + public boolean onLeftClickEntity(ItemStack aStack, EntityPlayer aPlayer, Entity aEntity) { + use(aStack, 0, aPlayer); + isItemStackUsable(aStack); + ArrayList> tList = mItemBehaviors.get((short)getDamage(aStack)); + if (tList != null) for (IItemBehaviour tBehavior : tList) try { + if (tBehavior.onLeftClickEntity(this, aStack, aPlayer, aEntity)) { + if (aStack.stackSize <= 0) aPlayer.destroyCurrentEquippedItem(); + return true; + } + if (aStack.stackSize <= 0) { + aPlayer.destroyCurrentEquippedItem(); + return false; + } + } catch(Throwable e) { + if (D1) e.printStackTrace(GT_Log.err); + } + return false; + } + + @Override + public boolean onItemUse(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { + use(aStack, 0, aPlayer); + isItemStackUsable(aStack); + ArrayList> tList = mItemBehaviors.get((short)getDamage(aStack)); + if (tList != null) for (IItemBehaviour tBehavior : tList) try { + if (tBehavior.onItemUse(this, aStack, aPlayer, aWorld, aX, aY, aZ, aSide, hitX, hitY, hitZ)) { + if (aStack.stackSize <= 0) aPlayer.destroyCurrentEquippedItem(); + return true; + } + if (aStack.stackSize <= 0) { + aPlayer.destroyCurrentEquippedItem(); + return false; + } + } catch(Throwable e) { + if (D1) e.printStackTrace(GT_Log.err); + } + return false; + } + + @Override + public boolean onItemUseFirst(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { + use(aStack, 0, aPlayer); + isItemStackUsable(aStack); + ArrayList> tList = mItemBehaviors.get((short)getDamage(aStack)); + if (tList != null) for (IItemBehaviour tBehavior : tList) try { + if (tBehavior.onItemUseFirst(this, aStack, aPlayer, aWorld, aX, aY, aZ, aSide, hitX, hitY, hitZ)) { + if (aStack.stackSize <= 0) aPlayer.destroyCurrentEquippedItem(); + return true; + } + if (aStack.stackSize <= 0) { + aPlayer.destroyCurrentEquippedItem(); + return false; + } + } catch(Throwable e) { + if (D1) e.printStackTrace(GT_Log.err); + } + return false; + } + + @Override + public ItemStack onItemRightClick(ItemStack aStack, World aWorld, EntityPlayer aPlayer) { + use(aStack, 0, aPlayer); + isItemStackUsable(aStack); + ArrayList> tList = mItemBehaviors.get((short)getDamage(aStack)); + if (tList != null) for (IItemBehaviour tBehavior : tList) try { + aStack = tBehavior.onItemRightClick(this, aStack, aWorld, aPlayer); + } catch(Throwable e) { + if (D1) e.printStackTrace(GT_Log.err); + } + return aStack; + } + + @Override + public final void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { + String tKey = getUnlocalizedName(aStack) + ".tooltip", tString = GT_LanguageManager.getTranslation(tKey); + if (GT_Utility.isStringValid(tString) && !tKey.equals(tString)) aList.add(tString); + + Long[] + tStats = getElectricStats(aStack); + if (tStats != null) { + if (tStats[3] > 0) { + aList.add(EnumChatFormatting.AQUA + "Contains " + GT_Utility.formatNumbers(tStats[3]) + " EU Tier: " + (tStats[2]>=0?tStats[2]:0) + EnumChatFormatting.GRAY); + } else { + long tCharge = getRealCharge(aStack); + if (tStats[3] == -2 && tCharge <= 0) { + aList.add(EnumChatFormatting.AQUA + "Empty. You should recycle it properly." + EnumChatFormatting.GRAY); + } else { + aList.add(EnumChatFormatting.AQUA + "" + GT_Utility.formatNumbers(tCharge) + " / " + GT_Utility.formatNumbers(Math.abs(tStats[0])) + " EU - Voltage: " + V[(int)(tStats[2]>=0?tStats[2] 0) { + FluidStack tFluid = getFluidContent(aStack); + aList.add(EnumChatFormatting.BLUE + ((tFluid==null?"No Fluids Contained":GT_Utility.getFluidName(tFluid, true))) + EnumChatFormatting.GRAY); + aList.add(EnumChatFormatting.BLUE + ((tFluid==null?0:tFluid.amount) + "L / " + tStats[0] + "L") + EnumChatFormatting.GRAY); + } + + ArrayList> tList = mItemBehaviors.get((short)getDamage(aStack)); + if (tList != null) for (IItemBehaviour tBehavior : tList) aList = tBehavior.getAdditionalToolTips(this, aList, aStack); + + addAdditionalToolTips(aList, aStack); + } + + @Override + public void onUpdate(ItemStack aStack, World aWorld, Entity aPlayer, int aTimer, boolean aIsInHand) { + ArrayList> tList = mItemBehaviors.get((short)getDamage(aStack)); + if (tList != null) for (IItemBehaviour tBehavior : tList) tBehavior.onUpdate(this, aStack, aWorld, aPlayer, aTimer, aIsInHand); + } + + @Override + public final boolean canProvideEnergy(ItemStack aStack) { + Long[] tStats = getElectricStats(aStack); + if (tStats == null) return false; + return tStats[3] > 0 || (aStack.stackSize == 1 && (tStats[3] == -2 || tStats[3] == -3)); + } + + @Override + public final double getMaxCharge(ItemStack aStack) { + Long[] tStats = getElectricStats(aStack); + if (tStats == null) return 0; + return Math.abs(tStats[0]); + } + + @Override + public final double getTransferLimit(ItemStack aStack) { + Long[] tStats = getElectricStats(aStack); + if (tStats == null) return 0; + return Math.max(tStats[1], tStats[3]); + } + + @Override + public final double charge(ItemStack aStack, double aCharge, int aTier, boolean aIgnoreTransferLimit, boolean aSimulate) { + Long[] tStats = getElectricStats(aStack); + if (tStats == null || tStats[2] > aTier || !(tStats[3] == -1 || tStats[3] == -3 || (tStats[3] < 0 && aCharge == Integer.MAX_VALUE)) || aStack.stackSize != 1) return 0; + long tChargeBefore = getRealCharge(aStack), tNewCharge = aCharge==Integer.MAX_VALUE?Long.MAX_VALUE:Math.min(Math.abs(tStats[0]), tChargeBefore + (aIgnoreTransferLimit?(long)aCharge:Math.min(tStats[1], (long)aCharge))); + if (!aSimulate) setCharge(aStack, tNewCharge); + return tNewCharge-tChargeBefore; + } + + @Override + public final double discharge(ItemStack aStack, double aCharge, int aTier, boolean aIgnoreTransferLimit, boolean aBatteryAlike, boolean aSimulate) { + Long[] tStats = getElectricStats(aStack); + if (tStats == null || tStats[2] > aTier) return 0; + if (aBatteryAlike && !canProvideEnergy(aStack)) return 0; + if (tStats[3] > 0) { + if (aCharge < tStats[3] || aStack.stackSize < 1) return 0; + if (!aSimulate) aStack.stackSize--; + return tStats[3]; + } + long tChargeBefore = getRealCharge(aStack), tNewCharge = Math.max(0, tChargeBefore - (aIgnoreTransferLimit?(long)aCharge:Math.min(tStats[1], (long)aCharge))); + if (!aSimulate) setCharge(aStack, tNewCharge); + return tChargeBefore-tNewCharge; + } + + @Override + public final double getCharge(ItemStack aStack) { + return getRealCharge(aStack); + } + + @Override + public final boolean canUse(ItemStack aStack, double aAmount) { + return getRealCharge(aStack) >= aAmount; + } + + @Override + public final boolean use(ItemStack aStack, double aAmount, EntityLivingBase aPlayer) { + chargeFromArmor(aStack, aPlayer); + if (aPlayer instanceof EntityPlayer && ((EntityPlayer)aPlayer).capabilities.isCreativeMode) return true; + double tTransfer = discharge(aStack, aAmount, Integer.MAX_VALUE, true, false, true); + if (tTransfer == aAmount) { + discharge(aStack, aAmount, Integer.MAX_VALUE, true, false, false); + chargeFromArmor(aStack, aPlayer); + return true; + } + discharge(aStack, aAmount, Integer.MAX_VALUE, true, false, false); + chargeFromArmor(aStack, aPlayer); + return false; + } + + @Override + public final void chargeFromArmor(ItemStack aStack, EntityLivingBase aPlayer) { + if (aPlayer == null || aPlayer.worldObj.isRemote) return; + for (int i = 1; i < 5; i++) { + ItemStack tArmor = aPlayer.getEquipmentInSlot(i); + if (GT_ModHandler.isElectricItem(tArmor)) { + IElectricItem tArmorItem = (IElectricItem)tArmor.getItem(); + if (tArmorItem.canProvideEnergy(tArmor) && tArmorItem.getTier(tArmor) >= getTier(aStack)) { + double tCharge = ElectricItem.manager.discharge(tArmor, charge(aStack, Integer.MAX_VALUE-1, Integer.MAX_VALUE, true, true), Integer.MAX_VALUE, true, true, false); + if (tCharge > 0) { + charge(aStack, tCharge, Integer.MAX_VALUE, true, false); + if (aPlayer instanceof EntityPlayer) { + Container tContainer = ((EntityPlayer)aPlayer).openContainer; + if (tContainer != null) tContainer.detectAndSendChanges(); + } + } + } + } + } + } + /* + + @Override + public final int getMaxCharge(ItemStack aStack) { + Long[] tStats = getElectricStats(aStack); + if (tStats == null) return 0; + return (int)Math.abs(tStats[0]); + } + + @Override + public final int getTransferLimit(ItemStack aStack) { + Long[] tStats = getElectricStats(aStack); + if (tStats == null) return 0; + return (int)Math.max(tStats[1], tStats[3]); + } + + @Override + public final int charge(ItemStack aStack, int aCharge, int aTier, boolean aIgnoreTransferLimit, boolean aSimulate) { + Long[] tStats = getElectricStats(aStack); + if (tStats == null || tStats[2] > aTier || !(tStats[3] == -1 || tStats[3] == -3 || (tStats[3] < 0 && aCharge == Integer.MAX_VALUE)) || aStack.stackSize != 1) return 0; + long tChargeBefore = getRealCharge(aStack), tNewCharge = aCharge==Integer.MAX_VALUE?Long.MAX_VALUE:Math.min(Math.abs(tStats[0]), tChargeBefore + (aIgnoreTransferLimit?aCharge:Math.min(tStats[1], aCharge))); + if (!aSimulate) setCharge(aStack, tNewCharge); + return (int)(tNewCharge-tChargeBefore); + } + + @Override + public final int discharge(ItemStack aStack, int aCharge, int aTier, boolean aIgnoreTransferLimit, boolean aSimulate) { + Long[] tStats = getElectricStats(aStack); + if (tStats == null || tStats[2] > aTier) return 0; + if (tStats[3] > 0) { + if (aCharge < tStats[3] || aStack.stackSize < 1) return 0; + if (!aSimulate) aStack.stackSize--; + return (int)(long)tStats[3]; + } + long tChargeBefore = getRealCharge(aStack), tNewCharge = Math.max(0, tChargeBefore - (aIgnoreTransferLimit?aCharge:Math.min(tStats[1], aCharge))); + if (!aSimulate) setCharge(aStack, tNewCharge); + return (int)(tChargeBefore-tNewCharge); + } + + @Override + public final int getCharge(ItemStack aStack) { + return (int)Math.min(Integer.MAX_VALUE, getRealCharge(aStack)); + } + + @Override + public final boolean canUse(ItemStack aStack, int aAmount) { + return getRealCharge(aStack) >= aAmount; + } + + @Override + public final boolean use(ItemStack aStack, int aAmount, EntityLivingBase aPlayer) { + chargeFromArmor(aStack, aPlayer); + if (aPlayer instanceof EntityPlayer && ((EntityPlayer)aPlayer).capabilities.isCreativeMode) return true; + int tTransfer = discharge(aStack, aAmount, Integer.MAX_VALUE, true, true); + if (tTransfer == aAmount) { + discharge(aStack, aAmount, Integer.MAX_VALUE, true, false); + chargeFromArmor(aStack, aPlayer); + return true; + } + discharge(aStack, aAmount, Integer.MAX_VALUE, true, false); + chargeFromArmor(aStack, aPlayer); + return false; + } + + @Override + public final void chargeFromArmor(ItemStack aStack, EntityLivingBase aPlayer) { + if (aPlayer == null || aPlayer.worldObj.isRemote) return; + for (int i = 1; i < 5; i++) { + ItemStack tArmor = aPlayer.getEquipmentInSlot(i); + if (GT_ModHandler.isElectricItem(tArmor)) { + IElectricItem tArmorItem = (IElectricItem)tArmor.getItem(); + if (tArmorItem.canProvideEnergy(tArmor) && tArmorItem.getTier(tArmor) >= getTier(aStack)) { + int tCharge = ElectricItem.manager.discharge(tArmor, charge(aStack, Integer.MAX_VALUE-1, Integer.MAX_VALUE, true, true), Integer.MAX_VALUE, true, false); + if (tCharge > 0) { + charge(aStack, tCharge, Integer.MAX_VALUE, true, false); + if (aPlayer instanceof EntityPlayer) { + Container tContainer = ((EntityPlayer)aPlayer).openContainer; + if (tContainer != null) tContainer.detectAndSendChanges(); + } + } + } + } + } + } + */ + public final long getRealCharge(ItemStack aStack) { + Long[] tStats = getElectricStats(aStack); + if (tStats == null) return 0; + if (tStats[3] > 0) return (int)(long)tStats[3]; + NBTTagCompound tNBT = aStack.getTagCompound(); + return tNBT==null?0:tNBT.getLong("GT.ItemCharge"); + } + + public final boolean setCharge(ItemStack aStack, long aCharge) { + Long[] tStats = getElectricStats(aStack); + if (tStats == null || tStats[3] > 0) return false; + NBTTagCompound tNBT = aStack.getTagCompound(); + if (tNBT == null) tNBT = new NBTTagCompound(); + tNBT.removeTag("GT.ItemCharge"); + aCharge = Math.min(tStats[0]<0?Math.abs(tStats[0] / 2):aCharge, Math.abs(tStats[0])); + if (aCharge > 0) { + aStack.setItemDamage(getChargedMetaData(aStack)); + tNBT.setLong("GT.ItemCharge", aCharge); + } else { + aStack.setItemDamage(getEmptyMetaData(aStack)); + } + if (tNBT.hasNoTags()) aStack.setTagCompound(null); else aStack.setTagCompound(tNBT); + isItemStackUsable(aStack); + return true; + } + + public short getChargedMetaData(ItemStack aStack) {return (short)aStack.getItemDamage();} + public short getEmptyMetaData(ItemStack aStack) {return (short)aStack.getItemDamage();} + + @Override + public FluidStack getFluid(ItemStack aStack) { + return getFluidContent(aStack); + } + + @Override + public int getCapacity(ItemStack aStack) { + Long[] tStats = getFluidContainerStats(aStack); + return tStats==null?0:(int)Math.max(0, tStats[0]); + } + + @Override + public int fill(ItemStack aStack, FluidStack aFluid, boolean doFill) { + if (aStack == null || aStack.stackSize != 1) return 0; + + ItemStack tStack = GT_Utility.fillFluidContainer(aFluid, aStack, false, false); + if (tStack != null) { + aStack.setItemDamage(tStack.getItemDamage()); + aStack.func_150996_a(tStack.getItem()); + return GT_Utility.getFluidForFilledItem(tStack, false).amount; + } + + Long[] tStats = getFluidContainerStats(aStack); + if (tStats == null || tStats[0] <= 0 || aFluid == null || aFluid.getFluid().getID() <= 0 || aFluid.amount <= 0) return 0; + + FluidStack tFluid = getFluidContent(aStack); + + if (tFluid == null || tFluid.getFluid().getID() <= 0) { + if (aFluid.amount <= tStats[0]) { + if (doFill) { + setFluidContent(aStack, aFluid); + } + return aFluid.amount; + } + if (doFill) { + tFluid = aFluid.copy(); + tFluid.amount = (int)(long)tStats[0]; + setFluidContent(aStack, tFluid); + } + return (int)(long)tStats[0]; + } + + if (!tFluid.isFluidEqual(aFluid)) return 0; + + int space = (int)(long)tStats[0] - tFluid.amount; + if (aFluid.amount <= space) { + if (doFill) { + tFluid.amount += aFluid.amount; + setFluidContent(aStack, tFluid); + } + return aFluid.amount; + } + if (doFill) { + tFluid.amount = (int)(long)tStats[0]; + setFluidContent(aStack, tFluid); + } + return space; + } + + @Override + public FluidStack drain(ItemStack aStack, int maxDrain, boolean doDrain) { + if (aStack == null || aStack.stackSize != 1) return null; + + FluidStack tFluid = GT_Utility.getFluidForFilledItem(aStack, false); + if (tFluid != null && maxDrain >= tFluid.amount) { + ItemStack tStack = GT_Utility.getContainerItem(aStack, false); + if (tStack == null) { + aStack.stackSize = 0; + return tFluid; + } + aStack.setItemDamage(tStack.getItemDamage()); + aStack.func_150996_a(tStack.getItem()); + return tFluid; + } + + Long[] tStats = getFluidContainerStats(aStack); + if (tStats == null || tStats[0] <= 0) return null; + + tFluid = getFluidContent(aStack); + if (tFluid == null) return null; + + int used = maxDrain; + if (tFluid.amount < used) used = tFluid.amount; + if (doDrain) { + tFluid.amount -= used; + setFluidContent(aStack, tFluid); + } + + FluidStack drained = tFluid.copy(); + drained.amount = used; + return drained; + } + + public FluidStack getFluidContent(ItemStack aStack) { + Long[] tStats = getFluidContainerStats(aStack); + if (tStats == null || tStats[0] <= 0) return GT_Utility.getFluidForFilledItem(aStack, false); + NBTTagCompound tNBT = aStack.getTagCompound(); + return tNBT==null?null:FluidStack.loadFluidStackFromNBT(tNBT.getCompoundTag("GT.FluidContent")); + } + + public void setFluidContent(ItemStack aStack, FluidStack aFluid) { + NBTTagCompound tNBT = aStack.getTagCompound(); + if (tNBT == null) tNBT = new NBTTagCompound(); else tNBT.removeTag("GT.FluidContent"); + if (aFluid != null && aFluid.amount > 0) tNBT.setTag("GT.FluidContent", aFluid.writeToNBT(new NBTTagCompound())); + if (tNBT.hasNoTags()) aStack.setTagCompound(null); else aStack.setTagCompound(tNBT); + isItemStackUsable(aStack); + } + + @Override + public int getItemStackLimit(ItemStack aStack) { + Long[] tStats = getElectricStats(aStack); + if (tStats != null && (tStats[3] == -1 || tStats[3] == -3) && getRealCharge(aStack) > 0) return 1; + tStats = getFluidContainerStats(aStack); + if (tStats != null) return (int)(long)tStats[1]; + return 64; + } + + @Override public final Item getChargedItem(ItemStack itemStack) {return this;} + @Override public final Item getEmptyItem(ItemStack itemStack) {return this;} + @Override public final int getTier(ItemStack aStack) {Long[] tStats = getElectricStats(aStack); return (int)(tStats==null?Integer.MAX_VALUE:tStats[2]);} + @Override public final String getToolTip(ItemStack aStack) {return null;} // This has its own ToolTip Handler, no need to let the IC2 Handler screw us up at this Point + @Override public final IElectricItemManager getManager(ItemStack aStack) {return this;} // We are our own Manager + @Override public final boolean getShareTag() {return true;} // just to be sure. + @Override public int getItemEnchantability() {return 0;} + @Override public boolean isBookEnchantable(ItemStack aStack, ItemStack aBook) {return false;} + @Override public boolean getIsRepairable(ItemStack aStack, ItemStack aMaterial) {return false;} +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/items/GT_MetaGenerated_Item.java b/src/main/java/gregtech/api/items/GT_MetaGenerated_Item.java new file mode 100644 index 0000000..409b3e4 --- /dev/null +++ b/src/main/java/gregtech/api/items/GT_MetaGenerated_Item.java @@ -0,0 +1,326 @@ +package gregtech.api.items; + +import static gregtech.api.enums.GT_Values.D1; +import static gregtech.api.enums.GT_Values.MOD_ID_APC; +import static gregtech.api.enums.GT_Values.RA; +import static gregtech.api.enums.GT_Values.RES_PATH_ITEM; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.BitSet; +import java.util.HashMap; +import java.util.List; + +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.Optional; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.GregTech_API; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.SubTag; +import gregtech.api.enums.TC_Aspects.TC_AspectStack; +import gregtech.api.interfaces.IFoodStat; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.interfaces.IItemBehaviour; +import gregtech.api.interfaces.IItemContainer; +import gregtech.api.objects.ItemData; +import gregtech.api.util.GT_Config; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Utility; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumAction; +import net.minecraft.item.Item; +import net.minecraft.item.ItemFood; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +/** + * @author Gregorius Techneticies + * + * One Item for everything! + * + * This brilliant Item Class is used for automatically generating all possible variations of Material Items, like Dusts, Ingots, Gems, Plates and similar. + * It saves me a ton of work, when adding Items, because I always have to make a new Item SubType for each OreDict Prefix, when adding a new Material. + * + * As you can see, up to 32766 Items can be generated using this Class. And the last 766 Items can be custom defined, just to save space and MetaData. + * + * These Items can also have special RightClick abilities, electric Charge or even be set to become a Food alike Item. + */ +@Optional.Interface(iface = "squeek.applecore.api.food.IEdible", modid = MOD_ID_APC) +public abstract class GT_MetaGenerated_Item extends GT_MetaBase_Item { + /** + * All instances of this Item Class are listed here. + * This gets used to register the Renderer to all Items of this Type, if useStandardMetaItemRenderer() returns true. + * + * You can also use the unlocalized Name gotten from getUnlocalizedName() as Key if you want to get a specific Item. + */ + public static final HashMap sInstances = new HashMap(); + + /* ---------- CONSTRUCTOR AND MEMBER VARIABLES ---------- */ + + public final short mOffset, mItemAmount; + public final BitSet mEnabledItems; + public final BitSet mVisibleItems; + public final IIcon[][] mIconList; + + public final HashMap mFoodStats = new HashMap(); + public final HashMap mElectricStats = new HashMap(); + public final HashMap mFluidContainerStats = new HashMap(); + public final HashMap mBurnValues = new HashMap(); + + /** + * Creates the Item using these Parameters. + * @param aUnlocalized The Unlocalized Name of this Item. + */ + public GT_MetaGenerated_Item(String aUnlocalized, short aOffset, short aItemAmount) { + super(aUnlocalized); + setHasSubtypes(true); + setMaxDamage(0); + mEnabledItems = new BitSet(aItemAmount); + mVisibleItems = new BitSet(aItemAmount); + + mOffset = (short)Math.min(32766, aOffset); + mItemAmount = (short)Math.min(aItemAmount, 32766-mOffset); + mIconList = new IIcon[aItemAmount][1]; + + sInstances.put(getUnlocalizedName(), this); + } + + /** + * This adds a Custom Item to the ending Range. + * @param aID The Id of the assigned Item [0 - mItemAmount] (The MetaData gets auto-shifted by +mOffset) + * @param aEnglish The Default Localized Name of the created Item + * @param aToolTip The Default ToolTip of the created Item, you can also insert null for having no ToolTip + * @param aFoodBehavior The Food Value of this Item. Can be null aswell. Just a convenience thing. + * @param aRandomData The OreDict Names you want to give the Item. Also used for TC Aspects and some other things. + * @return An ItemStack containing the newly created Item. + */ + public final ItemStack addItem(int aID, String aEnglish, String aToolTip, Object... aRandomData) { + if (aToolTip == null) aToolTip = ""; + if (aID >= 0 && aID < mItemAmount) { + ItemStack rStack = new ItemStack(this, 1, mOffset+aID); + mEnabledItems.set(aID); + mVisibleItems.set(aID); + GT_LanguageManager.addStringLocalization(getUnlocalizedName(rStack) + ".name", aEnglish); + GT_LanguageManager.addStringLocalization(getUnlocalizedName(rStack) + ".tooltip", aToolTip); + List tAspects = new ArrayList(); + // Important Stuff to do first + for (Object tRandomData : aRandomData) if (tRandomData instanceof SubTag) { + if (tRandomData == SubTag.INVISIBLE) { + mVisibleItems.set(aID, false); + continue; + } + if (tRandomData == SubTag.NO_UNIFICATION) { + GT_OreDictUnificator.addToBlacklist(rStack); + continue; + } + } + // now check for the rest + for (Object tRandomData : aRandomData) if (tRandomData != null) { + boolean tUseOreDict = true; + if (tRandomData instanceof IFoodStat) { + setFoodBehavior(mOffset+aID, (IFoodStat)tRandomData); + if (((IFoodStat)tRandomData).getFoodAction(this, rStack) == EnumAction.eat) { + int tFoodValue = ((IFoodStat)tRandomData).getFoodLevel(this, rStack, null); + if (tFoodValue > 0) RA.addCannerRecipe(rStack, ItemList.IC2_Food_Can_Empty.get(tFoodValue), ((IFoodStat)tRandomData).isRotten(this, rStack, null)?ItemList.IC2_Food_Can_Spoiled.get(tFoodValue):ItemList.IC2_Food_Can_Filled.get(tFoodValue), null, tFoodValue*100, 1); + } + tUseOreDict = false; + } + if (tRandomData instanceof IItemBehaviour) { + addItemBehavior(mOffset+aID, (IItemBehaviour)tRandomData); + tUseOreDict = false; + } + if (tRandomData instanceof IItemContainer) { + ((IItemContainer)tRandomData).set(rStack); + tUseOreDict = false; + } + if (tRandomData instanceof SubTag) { + continue; + } + if (tRandomData instanceof TC_AspectStack) { + ((TC_AspectStack)tRandomData).addToAspectList(tAspects); + continue; + } + if (tRandomData instanceof ItemData) { + if (GT_Utility.isStringValid(tRandomData)) GT_OreDictUnificator.registerOre(tRandomData, rStack); else GT_OreDictUnificator.addItemData(rStack, (ItemData)tRandomData); + continue; + } + if (tUseOreDict) { + GT_OreDictUnificator.registerOre(tRandomData, rStack); + continue; + } + } + if (GregTech_API.sThaumcraftCompat != null) GregTech_API.sThaumcraftCompat.registerThaumcraftAspectsToItem(rStack, tAspects, false); + return rStack; + } + return null; + } + + /** + * Sets a Food Behavior for the Item. + * + * @param aMetaValue the Meta Value of the Item you want to set it to. [0 - 32765] + * @param aFoodBehavior the Food Behavior you want to add. + * @return the Item itself for convenience in constructing. + */ + public final GT_MetaGenerated_Item setFoodBehavior(int aMetaValue, IFoodStat aFoodBehavior) { + if (aMetaValue < 0 || aMetaValue >= mOffset + mEnabledItems.length()) return this; + if (aFoodBehavior == null) mFoodStats.remove((short)aMetaValue); else mFoodStats.put((short)aMetaValue, aFoodBehavior); + return this; + } + + /** + * Sets the Furnace Burn Value for the Item. + * + * @param aMetaValue the Meta Value of the Item you want to set it to. [0 - 32765] + * @param aValue 200 = 1 Burn Process = 500 EU, max = 32767 (that is 81917.5 EU) + * @return the Item itself for convenience in constructing. + */ + public final GT_MetaGenerated_Item setBurnValue(int aMetaValue, int aValue) { + if (aMetaValue < 0 || aMetaValue >= mOffset + mEnabledItems.length() || aValue < 0) return this; + if (aValue == 0) mBurnValues.remove((short)aMetaValue); else mBurnValues.put((short)aMetaValue, aValue>Short.MAX_VALUE?Short.MAX_VALUE:(short)aValue); + return this; + } + + /** + * @param aMetaValue the Meta Value of the Item you want to set it to. [0 - 32765] + * @param aMaxCharge Maximum Charge. (if this is == 0 it will remove the Electric Behavior) + * @param aTransferLimit Transfer Limit. + * @param aTier The electric Tier. + * @param aSpecialData If this Item has a Fixed Charge, like a SingleUse Battery (if > 0). + * Use -1 if you want to make this Battery chargeable (the use and canUse Functions will still discharge if you just use this) + * Use -2 if you want to make this Battery dischargeable. + * Use -3 if you want to make this Battery charge/discharge-able. + * @return the Item itself for convenience in constructing. + */ + public final GT_MetaGenerated_Item setElectricStats(int aMetaValue, long aMaxCharge, long aTransferLimit, long aTier, long aSpecialData, boolean aUseAnimations) { + if (aMetaValue < 0 || aMetaValue >= mOffset + mEnabledItems.length()) return this; + if (aMaxCharge == 0) mElectricStats.remove((short)aMetaValue); else { + mElectricStats.put((short)aMetaValue, new Long[] {aMaxCharge, Math.max(0, aTransferLimit), Math.max(-1, aTier), aSpecialData}); + if (aMetaValue >= mOffset && aUseAnimations) mIconList[aMetaValue-mOffset] = Arrays.copyOf(mIconList[aMetaValue-mOffset], Math.max(9, mIconList[aMetaValue-mOffset].length)); + } + return this; + } + + /** + * @param aMetaValue the Meta Value of the Item you want to set it to. [0 - 32765] + * @param aMaxCharge Maximum Charge. (if this is == 0 it will remove the Electric Behavior) + * @param aTransferLimit Transfer Limit. + * @param aTier The electric Tier. + * @param aSpecialData If this Item has a Fixed Charge, like a SingleUse Battery (if > 0). + * Use -1 if you want to make this Battery chargeable (the use and canUse Functions will still discharge if you just use this) + * Use -2 if you want to make this Battery dischargeable. + * Use -3 if you want to make this Battery charge/discharge-able. + * @return the Item itself for convenience in constructing. + */ + public final GT_MetaGenerated_Item setFluidContainerStats(int aMetaValue, long aCapacity, long aStacksize) { + if (aMetaValue < 0 || aMetaValue >= mOffset + mEnabledItems.length()) return this; + if (aCapacity < 0) mElectricStats.remove((short)aMetaValue); else mFluidContainerStats.put((short)aMetaValue, new Long[] {aCapacity, Math.max(1, aStacksize)}); + return this; + } + + /** + * @return if this MetaGenerated Item should use my Default Renderer System. + */ + public boolean useStandardMetaItemRenderer() { + return true; + } + + /** + * @return the Color Modulation the Material is going to be rendered with. + */ + public short[] getRGBa(ItemStack aStack) { + return Materials._NULL.getRGBA(); + } + + /** + * @return the Icon the Material is going to be rendered with. + */ + public IIconContainer getIconContainer(int aMetaData) { + return null; + } + + /* ---------- INTERNAL OVERRIDES ---------- */ + + @Override + public ItemStack onItemRightClick(ItemStack aStack, World aWorld, EntityPlayer aPlayer) { + IFoodStat tStat = mFoodStats.get((short)getDamage(aStack)); + if (tStat != null && aPlayer.canEat(tStat.alwaysEdible(this, aStack, aPlayer))) aPlayer.setItemInUse(aStack, 32); + return super.onItemRightClick(aStack, aWorld, aPlayer); + } + + @Override + public int getMaxItemUseDuration(ItemStack aStack) { + return mFoodStats.get((short)getDamage(aStack)) == null ? 0 : 32; + } + + @Override + public EnumAction getItemUseAction(ItemStack aStack) { + IFoodStat tStat = mFoodStats.get((short)getDamage(aStack)); + return tStat == null ? EnumAction.none : tStat.getFoodAction(this, aStack); + } + + @Override + public final ItemStack onEaten(ItemStack aStack, World aWorld, EntityPlayer aPlayer) { + IFoodStat tStat = mFoodStats.get((short)getDamage(aStack)); + if (tStat != null) { + if (Loader.isModLoaded(MOD_ID_APC)) { + aPlayer.getFoodStats().func_151686_a((ItemFood)GT_Utility.callConstructor("squeek.applecore.api.food.ItemFoodProxy.ItemFoodProxy", 0, null, true, this), aStack); + } else { + aPlayer.getFoodStats().addStats(tStat.getFoodLevel(this, aStack, aPlayer), tStat.getSaturation(this, aStack, aPlayer)); + } + tStat.onEaten(this, aStack, aPlayer); + } + return aStack; + } + + + @Override + @SideOnly(Side.CLIENT) + public void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) { + for (int i = 0, j = mEnabledItems.length(); i < j; i++) if (mVisibleItems.get(i) || (D1 && mEnabledItems.get(i))) { + Long[] tStats = mElectricStats.get((short)(mOffset+i)); + if (tStats != null && tStats[3] < 0) { + ItemStack tStack = new ItemStack(this, 1, mOffset+i); + setCharge(tStack, Math.abs(tStats[0])); + isItemStackUsable(tStack); + aList.add(tStack); + } + if (tStats == null || tStats[3] != -2) { + ItemStack tStack = new ItemStack(this, 1, mOffset+i); + isItemStackUsable(tStack); + aList.add(tStack); + } + } + } + + @Override + @SideOnly(Side.CLIENT) + public final void registerIcons(IIconRegister aIconRegister) { + for (short i = 0, j = (short)mEnabledItems.length(); i < j; i++) if (mEnabledItems.get(i)) { + for (byte k = 1; k < mIconList[i].length; k++) { + mIconList[i][k] = aIconRegister.registerIcon(RES_PATH_ITEM + (GT_Config.troll?"troll":getUnlocalizedName() + "/" + i + "/" + k)); + } + mIconList[i][0] = aIconRegister.registerIcon(RES_PATH_ITEM + (GT_Config.troll?"troll":getUnlocalizedName() + "/" + i)); + } + } + + @Override + public final Long[] getElectricStats(ItemStack aStack) { + return mElectricStats.get((short)aStack.getItemDamage()); + } + + @Override + public final Long[] getFluidContainerStats(ItemStack aStack) { + return mFluidContainerStats.get((short)aStack.getItemDamage()); + } + + @Override public int getItemEnchantability() {return 0;} + @Override public boolean isBookEnchantable(ItemStack aStack, ItemStack aBook) {return false;} + @Override public boolean getIsRepairable(ItemStack aStack, ItemStack aMaterial) {return false;} +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/items/GT_MetaGenerated_Item_X01.java b/src/main/java/gregtech/api/items/GT_MetaGenerated_Item_X01.java new file mode 100644 index 0000000..942c329 --- /dev/null +++ b/src/main/java/gregtech/api/items/GT_MetaGenerated_Item_X01.java @@ -0,0 +1,159 @@ +package gregtech.api.items; + +import static gregtech.api.enums.GT_Values.M; + +import java.util.List; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.GregTech_API; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Utility; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + +/** + * @author Gregorius Techneticies + * + * One Item for everything! + * + * This brilliant Item Class is used for automatically generating all possible variations of Material Items, like Dusts, Ingots, Gems, Plates and similar. + * It saves me a ton of work, when adding Items, because I always have to make a new Item SubType for each OreDict Prefix, when adding a new Material. + * + * As you can see, up to 32766 Items can be generated using this Class. And the last 766 Items can be custom defined, just to save space and MetaData. + * + * These Items can also have special RightClick abilities, electric Charge or even be set to become a Food alike Item. + */ +public abstract class GT_MetaGenerated_Item_X01 extends GT_MetaGenerated_Item { + + protected final OrePrefixes mPrefix; + protected final int mIconSetIndex; + + /** + * Creates the Item using these Parameters. This is for the new 1 Item = 1 Prefix System. + * @param aUnlocalized The Unlocalized Name of this Item. + * @param aGeneratedPrefix The OreDict Prefix you want to have generated. + * @param aIconSetIndex The TextureSet Index to be used. -1 for Defaulting to the Data contained in the Prefix. (this is only to be used for selecting the Icon in getIconContainer, nothing else) + */ + public GT_MetaGenerated_Item_X01(String aUnlocalized, OrePrefixes aGeneratedPrefix, int aIconSetIndex) { + super(aUnlocalized, (short)32000, (short)766); + mPrefix = aGeneratedPrefix; + mIconSetIndex = aIconSetIndex>=0?aIconSetIndex:aGeneratedPrefix.mTextureIndex>=0?aGeneratedPrefix.mTextureIndex:0; + + for (int i = 0; i < GregTech_API.sGeneratedMaterials.length; i++) { + OrePrefixes tPrefix = mPrefix; + if (tPrefix == null) continue; + Materials tMaterial = GregTech_API.sGeneratedMaterials[i]; + if (tMaterial == null) continue; + if (mPrefix.doGenerateItem(tMaterial)) { + ItemStack tStack = new ItemStack(this, 1, i); + GT_LanguageManager.addStringLocalization(getUnlocalizedName(tStack) + ".name", getDefaultLocalization(tPrefix, tMaterial, i)); + GT_LanguageManager.addStringLocalization(getUnlocalizedName(tStack) + ".tooltip", tMaterial.getToolTip(tPrefix.mMaterialAmount / M)); + String tOreName = getOreDictString(tPrefix, tMaterial); + tPrefix = OrePrefixes.getOrePrefix(tOreName); + if (tPrefix != null && tPrefix.mIsUnificatable) { + GT_OreDictUnificator.set(tPrefix, OrePrefixes.getMaterial(tOreName, tPrefix), tStack); + } else { + GT_OreDictUnificator.registerOre(tOreName, tStack); + } + } + } + } + + /* ---------- OVERRIDEABLE FUNCTIONS ---------- */ + + /** + * @param aPrefix the OreDict Prefix + * @param aMaterial the Material + * @param aMetaData a Index from [0 - 31999] + * @return the Localized Name when default LangFiles are used. + */ + public String getDefaultLocalization(OrePrefixes aPrefix, Materials aMaterial, int aMetaData) { + return aPrefix.getDefaultLocalNameForItem(aMaterial); + } + + /** + * @param aPrefix always != null + * @param aMaterial always != null + * @param aDoShowAllItems this is the Configuration Setting of the User, if he wants to see all the Stuff like Tiny Dusts or Crushed Ores as well. + * @return if this Item should be visible in NEI or Creative + */ + public boolean doesShowInCreative(OrePrefixes aPrefix, Materials aMaterial, boolean aDoShowAllItems) { + return true; + } + + /** + * @return the name of the Item to be registered at the OreDict. + */ + public String getOreDictString(OrePrefixes aPrefix, Materials aMaterial) { + return aPrefix.get(aMaterial).toString(); + } + + public IIconContainer getIconContainer(int aMetaData, Materials aMaterial) { + return aMaterial.mIconSet.mTextures[mIconSetIndex]; + } + + /* ---------- INTERNAL OVERRIDES ---------- */ + + @Override + public ItemStack getContainerItem(ItemStack aStack) { + int aMetaData = aStack.getItemDamage(); + if (aMetaData < GregTech_API.sGeneratedMaterials.length && aMetaData >= 0) { + Materials aMaterial = GregTech_API.sGeneratedMaterials[aMetaData]; + if (aMaterial != null && aMaterial != Materials.Empty && aMaterial != Materials._NULL) { + return GT_Utility.copyAmount(1, mPrefix.mContainerItem); + } + } + return null; + } + + @Override + public short[] getRGBa(ItemStack aStack) { + int aMetaData = getDamage(aStack); + return aMetaData < GregTech_API.sGeneratedMaterials.length && GregTech_API.sGeneratedMaterials[aMetaData] != null ? GregTech_API.sGeneratedMaterials[aMetaData].mRGBa : Materials._NULL.mRGBa; + } + + @Override + public final IIconContainer getIconContainer(int aMetaData) { + return aMetaData < GregTech_API.sGeneratedMaterials.length && GregTech_API.sGeneratedMaterials[aMetaData] != null ? getIconContainer(aMetaData, GregTech_API.sGeneratedMaterials[aMetaData]) : null; + } + + @Override + @SideOnly(Side.CLIENT) + public final void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) { + for (int i = 0; i < GregTech_API.sGeneratedMaterials.length; i++) if (mPrefix.doGenerateItem(GregTech_API.sGeneratedMaterials[i]) && doesShowInCreative(mPrefix, GregTech_API.sGeneratedMaterials[i], GregTech_API.sDoShowAllItemsInCreative)) { + ItemStack tStack = new ItemStack(this, 1, i); + isItemStackUsable(tStack); + aList.add(tStack); + } + super.getSubItems(var1, aCreativeTab, aList); + } + + @Override + public final IIcon getIconFromDamage(int aMetaData) { + if (aMetaData < 0) return null; + if (aMetaData < GregTech_API.sGeneratedMaterials.length) { + Materials tMaterial = GregTech_API.sGeneratedMaterials[aMetaData]; + if (tMaterial == null) return null; + IIconContainer tIcon = getIconContainer(aMetaData, tMaterial); + if (tIcon != null) return tIcon.getIcon(); + return null; + } + return aMetaData>=mOffset&&aMetaData-mOffset= 0 ? aMaterial.mIconSet.mTextures[mGeneratedPrefixList[aMetaData / 1000].mTextureIndex] : null; + } + + /** + * @param aPrefix always != null + * @param aMaterial always != null + * @param aDoShowAllItems this is the Configuration Setting of the User, if he wants to see all the Stuff like Tiny Dusts or Crushed Ores as well. + * @return if this Item should be visible in NEI or Creative + */ + public boolean doesShowInCreative(OrePrefixes aPrefix, Materials aMaterial, boolean aDoShowAllItems) { + return true; + } + + /* ---------- INTERNAL OVERRIDES ---------- */ + + @Override + public ItemStack getContainerItem(ItemStack aStack) { + int aDamage = aStack.getItemDamage(); + if (aDamage < 32000 && aDamage >= 0) { + Materials aMaterial = GregTech_API.sGeneratedMaterials[aDamage % 1000]; + if (aMaterial != null && aMaterial != Materials.Empty && aMaterial != Materials._NULL) { + OrePrefixes aPrefix = mGeneratedPrefixList[aDamage / 1000]; + if (aPrefix != null) return GT_Utility.copyAmount(1, aPrefix.mContainerItem); + } + } + return null; + } + + @Override + public final IIconContainer getIconContainer(int aMetaData) { + return GregTech_API.sGeneratedMaterials[aMetaData % 1000] == null ? null : getIconContainer(aMetaData, GregTech_API.sGeneratedMaterials[aMetaData % 1000]); + } + + @Override + @SideOnly(Side.CLIENT) + public final void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) { + for (int i = 0; i < 32000; i++) if (doesMaterialAllowGeneration(mGeneratedPrefixList[i / 1000], GregTech_API.sGeneratedMaterials[i % 1000]) && doesShowInCreative(mGeneratedPrefixList[i / 1000], GregTech_API.sGeneratedMaterials[i % 1000], GregTech_API.sDoShowAllItemsInCreative)) { + ItemStack tStack = new ItemStack(this, 1, i); + isItemStackUsable(tStack); + aList.add(tStack); + } + super.getSubItems(var1, aCreativeTab, aList); + } + + @Override + public final IIcon getIconFromDamage(int aMetaData) { + if (aMetaData < 0) return null; + if (aMetaData < 32000) { + Materials tMaterial = GregTech_API.sGeneratedMaterials[aMetaData % 1000]; + if (tMaterial == null) return null; + IIconContainer tIcon = getIconContainer(aMetaData, tMaterial); + if (tIcon != null) return tIcon.getIcon(); + return null; + } + return aMetaData-32000 sInstances = new HashMap(); + + /* ---------- CONSTRUCTOR AND MEMBER VARIABLES ---------- */ + + public final HashMap mToolStats = new HashMap(); + + /** + * Creates the Item using these Parameters. + * @param aUnlocalized The Unlocalized Name of this Item. + */ + public GT_MetaGenerated_Tool(String aUnlocalized) { + super(aUnlocalized); + GT_ModHandler.registerBoxableItemToToolBox(this); + setMaxStackSize(1); + sInstances.put(getUnlocalizedName(), this); + } + + /* ---------- FOR ADDING CUSTOM ITEMS INTO THE REMAINING 766 RANGE ---------- */ + + /** + * This adds a Custom Item to the ending Range. + * @param aID The Id of the assigned Tool Class [0 - 32765] (only even Numbers allowed! Uneven ID's are empty electric Items) + * @param aEnglish The Default Localized Name of the created Item + * @param aToolTip The Default ToolTip of the created Item, you can also insert null for having no ToolTip + * @param aToolStats The Food Value of this Item. Can be null as well. + * @param aOreDictNamesAndAspects The OreDict Names you want to give the Item. Also used to assign Thaumcraft Aspects. + * @return An ItemStack containing the newly created Item, but without specific Stats. + */ + public final ItemStack addTool(int aID, String aEnglish, String aToolTip, IToolStats aToolStats, Object... aOreDictNamesAndAspects) { + if (aToolTip == null) aToolTip = ""; + if (aID >= 0 && aID < 32766 && aID % 2 == 0) { + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + aID + ".name" , aEnglish); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + aID + ".tooltip" , aToolTip); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (aID+1) + ".name" , aEnglish + " (Empty)"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (aID+1) + ".tooltip" , "You need to recharge it"); + mToolStats.put((short) aID , aToolStats); + mToolStats.put((short)(aID+1), aToolStats); + aToolStats.onStatsAddedToTool(this, aID); + ItemStack rStack = new ItemStack(this, 1, aID); + List tAspects = new ArrayList(); + for (Object tOreDictNameOrAspect : aOreDictNamesAndAspects) { + if (tOreDictNameOrAspect instanceof TC_AspectStack) + ((TC_AspectStack)tOreDictNameOrAspect).addToAspectList(tAspects); + else + GT_OreDictUnificator.registerOre(tOreDictNameOrAspect, rStack); + } + if (GregTech_API.sThaumcraftCompat != null) GregTech_API.sThaumcraftCompat.registerThaumcraftAspectsToItem(rStack, tAspects, false); + return rStack; + } + return null; + } + + /** + * This Function gets an ItemStack Version of this Tool + * @param aToolID the ID of the Tool Class + * @param aAmount Amount of Items (well normally you only need 1) + * @param aPrimaryMaterial Primary Material of this Tool + * @param aSecondaryMaterial Secondary (Rod/Handle) Material of this Tool + * @param aElectricArray The Electric Stats of this Tool (or null if not electric) + */ + public final ItemStack getToolWithStats(int aToolID, int aAmount, Materials aPrimaryMaterial, Materials aSecondaryMaterial, long[] aElectricArray) { + ItemStack rStack = new ItemStack(this, aAmount, aToolID); + IToolStats tToolStats = getToolStats(rStack); + if (tToolStats != null) { + NBTTagCompound tMainNBT = new NBTTagCompound(), tToolNBT = new NBTTagCompound(); + if (aPrimaryMaterial != null) { + tToolNBT.setString("PrimaryMaterial", aPrimaryMaterial.toString()); + tToolNBT.setLong("MaxDamage", 100L*(long)(aPrimaryMaterial.mDurability * tToolStats.getMaxDurabilityMultiplier())); + } + if (aSecondaryMaterial != null) tToolNBT.setString("SecondaryMaterial", aSecondaryMaterial.toString()); + + if (aElectricArray != null) { + tToolNBT.setBoolean("Electric", true); + tToolNBT.setLong("MaxCharge", aElectricArray[0]); + tToolNBT.setLong("Voltage", aElectricArray[1]); + tToolNBT.setLong("Tier", aElectricArray[2]); + tToolNBT.setLong("SpecialData", aElectricArray[3]); + } + + tMainNBT.setTag("GT.ToolStats", tToolNBT); + rStack.setTagCompound(tMainNBT); + } + isItemStackUsable(rStack); + return rStack; + } + + /* ---------- INTERNAL OVERRIDES ---------- */ + + /** + * Called by the Block Harvesting Event within the GT_Proxy + */ + public void onHarvestBlockEvent(ArrayList aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent) { + IToolStats tStats = getToolStats(aStack); + if (isItemStackUsable(aStack) && getDigSpeed(aStack, aBlock, aMetaData) > 0.0F) doDamage(aStack, tStats.convertBlockDrops(aDrops, aStack, aPlayer, aBlock, aX, aY, aZ, aMetaData, aFortune, aSilkTouch, aEvent) * tStats.getToolDamagePerDropConversion()); + } + + @Override + public boolean onLeftClickEntity(ItemStack aStack, EntityPlayer aPlayer, Entity aEntity) { + IToolStats tStats = getToolStats(aStack); + if (tStats == null || !isItemStackUsable(aStack)) return true; + GT_Utility.doSoundAtClient(tStats.getEntityHitSound(), 1, 1.0F); + if (super.onLeftClickEntity(aStack, aPlayer, aEntity)) return true; + if (aEntity.canAttackWithItem() && !aEntity.hitByEntity(aPlayer)) { + float tMagicDamage = tStats.getMagicDamageAgainstEntity(aEntity instanceof EntityLivingBase?EnchantmentHelper.getEnchantmentModifierLiving(aPlayer, (EntityLivingBase)aEntity):0.0F, aEntity, aStack, aPlayer), tDamage = tStats.getNormalDamageAgainstEntity((float)aPlayer.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue() + getToolCombatDamage(aStack), aEntity, aStack, aPlayer); + if (tDamage + tMagicDamage > 0.0F) { + boolean tCriticalHit = aPlayer.fallDistance > 0.0F && !aPlayer.onGround && !aPlayer.isOnLadder() && !aPlayer.isInWater() && !aPlayer.isPotionActive(Potion.blindness) && aPlayer.ridingEntity == null && aEntity instanceof EntityLivingBase; + if (tCriticalHit && tDamage > 0.0F) tDamage *= 1.5F; + tDamage += tMagicDamage; + if (aEntity.attackEntityFrom(tStats.getDamageSource(aPlayer, aEntity), tDamage)) { + if (aEntity instanceof EntityLivingBase) aEntity.setFire(EnchantmentHelper.getFireAspectModifier(aPlayer) * 4); + int tKnockcack = (aPlayer.isSprinting()?1:0) + (aEntity instanceof EntityLivingBase?EnchantmentHelper.getKnockbackModifier(aPlayer, (EntityLivingBase)aEntity):0); + if (tKnockcack > 0) { + aEntity.addVelocity(-MathHelper.sin(aPlayer.rotationYaw * (float)Math.PI / 180.0F) * tKnockcack * 0.5F, 0.1D, MathHelper.cos(aPlayer.rotationYaw * (float)Math.PI / 180.0F) * tKnockcack * 0.5F); + aPlayer.motionX *= 0.6D; + aPlayer.motionZ *= 0.6D; + aPlayer.setSprinting(false); + } + if (tCriticalHit) aPlayer.onCriticalHit(aEntity); + if (tMagicDamage > 0.0F) aPlayer.onEnchantmentCritical(aEntity); + if (tDamage >= 18.0F) aPlayer.triggerAchievement(AchievementList.overkill); + aPlayer.setLastAttacker(aEntity); + if (aEntity instanceof EntityLivingBase) EnchantmentHelper.func_151384_a((EntityLivingBase)aEntity, aPlayer); + EnchantmentHelper.func_151385_b(aPlayer, aEntity); + if (aEntity instanceof EntityLivingBase) aPlayer.addStat(StatList.damageDealtStat, Math.round(tDamage * 10.0F)); + aEntity.hurtResistantTime = Math.max(1, tStats.getHurtResistanceTime(aEntity.hurtResistantTime, aEntity)); + aPlayer.addExhaustion(0.3F); + doDamage(aStack, tStats.getToolDamagePerEntityAttack()); + } + } + } + if (aStack.stackSize <= 0) aPlayer.destroyCurrentEquippedItem(); + return true; + } + + @Override + public ItemStack onItemRightClick(ItemStack aStack, World aWorld, EntityPlayer aPlayer) { + IToolStats tStats = getToolStats(aStack); + if (tStats != null && tStats.canBlock()) aPlayer.setItemInUse(aStack, 72000); + return super.onItemRightClick(aStack, aWorld, aPlayer); + } + + @Override + public final int getMaxItemUseDuration(ItemStack aStack) { + return 72000; + } + + @Override + public final EnumAction getItemUseAction(ItemStack aStack) { + IToolStats tStats = getToolStats(aStack); + if (tStats != null && tStats.canBlock()) return EnumAction.block; + return EnumAction.none; + } + + @Override + @SideOnly(Side.CLIENT) + public final void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) { + for (int i = 0; i < 32766; i+=2) if (getToolStats(new ItemStack(this, 1, i)) != null) { + ItemStack tStack = new ItemStack(this, 1, i); + isItemStackUsable(tStack); + aList.add(tStack); + } + } + + @Override + @SideOnly(Side.CLIENT) + public final void registerIcons(IIconRegister aIconRegister) { + // + } + + @Override + public final IIcon getIconFromDamage(int aMetaData) { + return null; + } + + @Override + public void addAdditionalToolTips(List aList, ItemStack aStack) { + long tMaxDamage = getToolMaxDamage(aStack); + Materials tMaterial = getPrimaryMaterial(aStack); + IToolStats tStats = getToolStats(aStack); + int tOffset = getElectricStats(aStack) != null ? 2 : 1; + if (tStats != null) { + String name = aStack.getUnlocalizedName(); + if(name.equals("gt.metatool.01.170")||name.equals("gt.metatool.01.172")||name.equals("gt.metatool.01.174")||name.equals("gt.metatool.01.176")){ + aList.add(tOffset + 0, EnumChatFormatting.WHITE + "Durability: " + EnumChatFormatting.GREEN + (tMaxDamage - getToolDamage(aStack)) + " / " + tMaxDamage + EnumChatFormatting.GRAY); + aList.add(tOffset + 1, EnumChatFormatting.WHITE + tMaterial.mDefaultLocalName + EnumChatFormatting.YELLOW + " lvl " + getHarvestLevel(aStack, "") + EnumChatFormatting.GRAY); + aList.add(tOffset + 2, EnumChatFormatting.WHITE + "Turbine Efficency: " + EnumChatFormatting.BLUE + (50.0F+(10.0F*getToolCombatDamage(aStack))) + EnumChatFormatting.GRAY); + aList.add(tOffset + 3, EnumChatFormatting.WHITE + "Optimal Steam flow: " + EnumChatFormatting.LIGHT_PURPLE + Math.max(Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed*1000) + EnumChatFormatting.GRAY+ "L/sec"); + + }else{ + aList.add(tOffset + 0, EnumChatFormatting.WHITE + "Durability: " + EnumChatFormatting.GREEN + (tMaxDamage - getToolDamage(aStack)) + " / " + tMaxDamage + EnumChatFormatting.GRAY); + aList.add(tOffset + 1, EnumChatFormatting.WHITE + tMaterial.mDefaultLocalName + EnumChatFormatting.YELLOW + " lvl " + getHarvestLevel(aStack, "") + EnumChatFormatting.GRAY); + aList.add(tOffset + 2, EnumChatFormatting.WHITE + "Attack Damage: " + EnumChatFormatting.BLUE + getToolCombatDamage(aStack) + EnumChatFormatting.GRAY); + aList.add(tOffset + 3, EnumChatFormatting.WHITE + "Mining Speed: " + EnumChatFormatting.LIGHT_PURPLE + Math.max(Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed) + EnumChatFormatting.GRAY); + }} + } + + public static final Materials getPrimaryMaterial(ItemStack aStack) { + NBTTagCompound aNBT = aStack.getTagCompound(); + if (aNBT != null) { + aNBT = aNBT.getCompoundTag("GT.ToolStats"); + if (aNBT != null) return Materials.getRealMaterial(aNBT.getString("PrimaryMaterial")); + } + return Materials._NULL; + } + + public static final Materials getSecondaryMaterial(ItemStack aStack) { + NBTTagCompound aNBT = aStack.getTagCompound(); + if (aNBT != null) { + aNBT = aNBT.getCompoundTag("GT.ToolStats"); + if (aNBT != null) return Materials.getRealMaterial(aNBT.getString("SecondaryMaterial")); + } + return Materials._NULL; + } + + @Override + public Long[] getFluidContainerStats(ItemStack aStack) { + return null; + } + + @Override + public Long[] getElectricStats(ItemStack aStack) { + NBTTagCompound aNBT = aStack.getTagCompound(); + if (aNBT != null) { + aNBT = aNBT.getCompoundTag("GT.ToolStats"); + if (aNBT != null && aNBT.getBoolean("Electric")) return new Long[] {aNBT.getLong("MaxCharge"), aNBT.getLong("Voltage"), aNBT.getLong("Tier"), aNBT.getLong("SpecialData")}; + } + return null; + } + + public float getToolCombatDamage(ItemStack aStack) { + IToolStats tStats = getToolStats(aStack); + if (tStats == null) return 0; + return tStats.getBaseDamage() + getPrimaryMaterial(aStack).mToolQuality; + } + + public static final long getToolMaxDamage(ItemStack aStack) { + NBTTagCompound aNBT = aStack.getTagCompound(); + if (aNBT != null) { + aNBT = aNBT.getCompoundTag("GT.ToolStats"); + if (aNBT != null) return aNBT.getLong("MaxDamage"); + } + return 0; + } + + public static final long getToolDamage(ItemStack aStack) { + NBTTagCompound aNBT = aStack.getTagCompound(); + if (aNBT != null) { + aNBT = aNBT.getCompoundTag("GT.ToolStats"); + if (aNBT != null) return aNBT.getLong("Damage"); + } + return 0; + } + + public static final boolean setToolDamage(ItemStack aStack, long aDamage) { + NBTTagCompound aNBT = aStack.getTagCompound(); + if (aNBT != null) { + aNBT = aNBT.getCompoundTag("GT.ToolStats"); + if (aNBT != null) { + aNBT.setLong("Damage", aDamage); + return true; + } + } + return false; + } + + @Override + public final boolean doDamageToItem(ItemStack aStack, int aVanillaDamage) { + return doDamage(aStack, aVanillaDamage * 100); + } + + public final boolean doDamage(ItemStack aStack, long aAmount) { + if (!isItemStackUsable(aStack)) return false; + Long[] tElectric = getElectricStats(aStack); + if (tElectric == null) { + long tNewDamage = getToolDamage(aStack) + aAmount; + setToolDamage(aStack, tNewDamage); + if (tNewDamage >= getToolMaxDamage(aStack)) { + IToolStats tStats = getToolStats(aStack); + if (tStats == null || GT_Utility.setStack(aStack, tStats.getBrokenItem(aStack)) == null) { + if (tStats != null) GT_Utility.doSoundAtClient(tStats.getBreakingSound(), 1, 1.0F); + if (aStack.stackSize > 0) aStack.stackSize--; + } + } + return true; + } + if (use(aStack, (int)aAmount, null)) { + if (new Random().nextInt(25) == 0) { + long tNewDamage = getToolDamage(aStack) + aAmount; + setToolDamage(aStack, tNewDamage); + if (tNewDamage >= getToolMaxDamage(aStack)) { + IToolStats tStats = getToolStats(aStack); + if (tStats == null || GT_Utility.setStack(aStack, tStats.getBrokenItem(aStack)) == null) { + if (tStats != null) GT_Utility.doSoundAtClient(tStats.getBreakingSound(), 1, 1.0F); + if (aStack.stackSize > 0) aStack.stackSize--; + } + } + } + return true; + } + return false; + } + + @Override + public float getDigSpeed(ItemStack aStack, Block aBlock, int aMetaData) { + if (!isItemStackUsable(aStack)) return 0.0F; + IToolStats tStats = getToolStats(aStack); + if (tStats == null || Math.max(0, getHarvestLevel(aStack, "")) < aBlock.getHarvestLevel(aMetaData)) return 0.0F; + return tStats.isMinableBlock(aBlock, (byte)aMetaData)?Math.max(Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed):0.0F; + } + + @Override + public final boolean canHarvestBlock(Block aBlock, ItemStack aStack) { + return getDigSpeed(aStack, aBlock, (byte)0) > 0.0F; + } + + @Override + public final int getHarvestLevel(ItemStack aStack, String aToolClass) { + IToolStats tStats = getToolStats(aStack); + return tStats == null ? -1 : tStats.getBaseQuality() + getPrimaryMaterial(aStack).mToolQuality; + } + + @Override + public boolean onBlockDestroyed(ItemStack aStack, World aWorld, Block aBlock, int aX, int aY, int aZ, EntityLivingBase aPlayer) { + if (!isItemStackUsable(aStack)) return false; + IToolStats tStats = getToolStats(aStack); + if (tStats == null) return false; + GT_Utility.doSoundAtClient(tStats.getMiningSound(), 1, 1.0F); + doDamage(aStack, (int)Math.max(1, aBlock.getBlockHardness(aWorld, aX, aY, aZ) * tStats.getToolDamagePerBlockBreak())); + return getDigSpeed(aStack, aBlock, aWorld.getBlockMetadata(aX, aY, aZ)) > 0.0F; + } + + @Override + public final ItemStack getContainerItem(ItemStack aStack) { + if (!isItemStackUsable(aStack)) return null; + aStack = GT_Utility.copyAmount(1, aStack); + IToolStats tStats = getToolStats(aStack); + if (tStats == null) return null; + doDamage(aStack, tStats.getToolDamagePerContainerCraft()); + aStack = aStack.stackSize > 0 ? aStack : null; + if (aStack == null) GT_Utility.doSoundAtClient(tStats.getBreakingSound(), 1, 1.0F); else GT_Utility.doSoundAtClient(tStats.getCraftingSound(), 1, 1.0F); + return aStack; + } + + public IToolStats getToolStats(ItemStack aStack) { + isItemStackUsable(aStack); + return getToolStatsInternal(aStack); + } + + private IToolStats getToolStatsInternal(ItemStack aStack) { + return aStack == null ? null : mToolStats.get((short)aStack.getItemDamage()); + } + + @Override + public void onCreated(ItemStack aStack, World aWorld, EntityPlayer aPlayer) { + IToolStats tStats = getToolStats(aStack); + if (tStats != null && aPlayer != null) tStats.onToolCrafted(aStack, aPlayer); + super.onCreated(aStack, aWorld, aPlayer); + } + + @Override + public final boolean doesContainerItemLeaveCraftingGrid(ItemStack aStack) { + return false; + } + + @Override + public final int getItemStackLimit(ItemStack aStack) { + return 1; + } + + @Override + public boolean isFull3D() { + return true; + } + + @Override + public boolean isItemStackUsable(ItemStack aStack) { + IToolStats tStats = getToolStatsInternal(aStack); + if (aStack.getItemDamage() % 2 == 1 || tStats == null) { + NBTTagCompound aNBT = aStack.getTagCompound(); + if (aNBT != null) aNBT.removeTag("ench"); + return false; + } + Materials aMaterial = getPrimaryMaterial(aStack); + HashMap tMap = new HashMap(), tResult = new HashMap(); + if (aMaterial.mEnchantmentTools != null) { + tMap.put(aMaterial.mEnchantmentTools.effectId, (int)aMaterial.mEnchantmentToolsLevel); + if (aMaterial.mEnchantmentTools == Enchantment.fortune) + tMap.put(Enchantment.looting.effectId, (int)aMaterial.mEnchantmentToolsLevel); + if (aMaterial.mEnchantmentTools == Enchantment.knockback) + tMap.put(Enchantment.power.effectId, (int)aMaterial.mEnchantmentToolsLevel); + if (aMaterial.mEnchantmentTools == Enchantment.fireAspect) + tMap.put(Enchantment.flame.effectId, (int)aMaterial.mEnchantmentToolsLevel); + } + Enchantment[] tEnchants = tStats.getEnchantments(aStack); + int[] tLevels = tStats.getEnchantmentLevels(aStack); + for (int i = 0; i < tEnchants.length; i++) if (tLevels[i] > 0) { + Integer tLevel = tMap.get(tEnchants[i].effectId); + tMap.put(tEnchants[i].effectId, tLevel == null ? tLevels[i] : tLevel == tLevels[i] ? tLevel+1 : Math.max(tLevel, tLevels[i])); + } + for (Entry tEntry : tMap.entrySet()) { + if (tEntry.getKey() == 33 || (tEntry.getKey() == 20 && tEntry.getValue() > 2)) tResult.put(tEntry.getKey(), tEntry.getValue()); else + switch(Enchantment.enchantmentsList[tEntry.getKey()].type) { + case weapon: + if (tStats.isWeapon()) tResult.put(tEntry.getKey(), tEntry.getValue()); + break; + case all: + tResult.put(tEntry.getKey(), tEntry.getValue()); + break; + case armor: case armor_feet: case armor_head: case armor_legs: case armor_torso: + break; + case bow: + if (tStats.isRangedWeapon()) tResult.put(tEntry.getKey(), tEntry.getValue()); + break; + case breakable: + break; + case fishing_rod: + break; + case digger: + if (tStats.isMiningTool()) tResult.put(tEntry.getKey(), tEntry.getValue()); + break; + } + } + EnchantmentHelper.setEnchantments(tResult, aStack); + return true; + } + + @Override + public short getChargedMetaData(ItemStack aStack) { + return (short)(aStack.getItemDamage() - (aStack.getItemDamage() % 2)); + } + + @Override + public short getEmptyMetaData(ItemStack aStack) { + NBTTagCompound aNBT = aStack.getTagCompound(); + if (aNBT != null) aNBT.removeTag("ench"); + return (short)(aStack.getItemDamage()+1-(aStack.getItemDamage() % 2)); + } + + @Override public int getItemEnchantability() {return 0;} + @Override public boolean isBookEnchantable(ItemStack aStack, ItemStack aBook) {return false;} + @Override public boolean getIsRepairable(ItemStack aStack, ItemStack aMaterial) {return false;} +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/items/GT_RadioactiveCellIC_Item.java b/src/main/java/gregtech/api/items/GT_RadioactiveCellIC_Item.java new file mode 100644 index 0000000..f6bffe3 --- /dev/null +++ b/src/main/java/gregtech/api/items/GT_RadioactiveCellIC_Item.java @@ -0,0 +1,177 @@ +package gregtech.api.items; + + + import java.util.ArrayList; + +import gregtech.api.enums.ItemList; +import ic2.api.reactor.IReactor; +import ic2.api.reactor.IReactorComponent; +import ic2.core.IC2Potion; +import ic2.core.item.armor.ItemArmorHazmat; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + + + public class GT_RadioactiveCellIC_Item extends GT_RadioactiveCell_Item implements IReactorComponent + { + public final int numberOfCells; + public final double sEnergy; + public final int sRadiation; + + public GT_RadioactiveCellIC_Item( String aUnlocalized, String aEnglish, int aCellcount, int maxDamage, double aEnergy, int aRadiation) + { + super(aUnlocalized, aEnglish, aCellcount); + setMaxStackSize(64); + this.maxDmg=maxDamage; + this.numberOfCells = aCellcount; + this.sEnergy = aEnergy; + this.sRadiation = aRadiation; + + } + + + private class ItemStackCoord + { + public ItemStack stack; + public int x; + public int y; + + public ItemStackCoord(ItemStack stack1, int x1, int y1) + { + this.stack = stack1; + this.x = x1; + this.y = y1; + } + } + + @Override + public void processChamber(IReactor reactor, ItemStack yourStack, int x, int y, boolean heatrun) + { + if (!reactor.produceEnergy()) { + return; + } + for (int iteration = 0; iteration < this.numberOfCells; iteration++) + { + int pulses = 1 + this.numberOfCells / 2; + if (!heatrun) + { + for (int i = 0; i < pulses; i++) { + acceptUraniumPulse(reactor, yourStack, yourStack, x, y, x, y, heatrun); + } + pulses += checkPulseable(reactor, x - 1, y, yourStack, x, y, heatrun) + checkPulseable(reactor, x + 1, y, yourStack, x, y, heatrun) + checkPulseable(reactor, x, y - 1, yourStack, x, y, heatrun) + checkPulseable(reactor, x, y + 1, yourStack, x, y, heatrun); + } + else + { + pulses += checkPulseable(reactor, x - 1, y, yourStack, x, y, heatrun) + checkPulseable(reactor, x + 1, y, yourStack, x, y, heatrun) + checkPulseable(reactor, x, y - 1, yourStack, x, y, heatrun) + checkPulseable(reactor, x, y + 1, yourStack, x, y, heatrun); + + int heat = sumUp(pulses) * 4; + + ArrayList heatAcceptors = new ArrayList(); + checkHeatAcceptor(reactor, x - 1, y, heatAcceptors); + checkHeatAcceptor(reactor, x + 1, y, heatAcceptors); + checkHeatAcceptor(reactor, x, y - 1, heatAcceptors); + checkHeatAcceptor(reactor, x, y + 1, heatAcceptors); + while ((heatAcceptors.size() > 0) && (heat > 0)) + { + heat *=sEnergy; + int dheat = heat / heatAcceptors.size(); + heat -= dheat; + dheat = ((IReactorComponent)heatAcceptors.get(0).stack.getItem()).alterHeat(reactor, heatAcceptors.get(0).stack, heatAcceptors.get(0).x, heatAcceptors.get(0).y, dheat); + heat += dheat; + heatAcceptors.remove(0); + } + if (heat > 0) { + reactor.addHeat(heat); + } + } + } + if (getDamageOfStack(yourStack) >= getMaxDamageEx() - 1) { + switch (this.numberOfCells) + { + case 1: + reactor.setItemAt(x, y, ItemList.Depleted_Thorium_1.get(1, new Object[0])); + break; + case 2: + reactor.setItemAt(x, y, ItemList.Depleted_Thorium_2.get(1, new Object[0])); + break; + case 4: + reactor.setItemAt(x, y, ItemList.Depleted_Thorium_4.get(1, new Object[0])); + } + } else if (heatrun) { + damageItemStack(yourStack, 1); + } + } + + + private static int checkPulseable(IReactor reactor, int x, int y, ItemStack me, int mex, int mey, boolean heatrun) + { + ItemStack other = reactor.getItemAt(x, y); + if ((other != null) && ((other.getItem() instanceof IReactorComponent)) && + (((IReactorComponent)other.getItem()).acceptUraniumPulse(reactor, other, me, x, y, mex, mey, heatrun))) { + return 1; + } + return 0; + } + + private void checkHeatAcceptor(IReactor reactor, int x, int y, ArrayList heatAcceptors) + { + ItemStack thing = reactor.getItemAt(x, y); + if ((thing != null) && ((thing.getItem() instanceof IReactorComponent)) && + (((IReactorComponent)thing.getItem()).canStoreHeat(reactor, thing, x, y))) { + heatAcceptors.add(new ItemStackCoord(thing, x, y)); + } + } + + @Override + public boolean acceptUraniumPulse(IReactor reactor, ItemStack yourStack, ItemStack pulsingStack, int youX, int youY, int pulseX, int pulseY, boolean heatrun) + { + if (!heatrun) { + reactor.addOutput((float) (1.0F*this.sEnergy)); + } + return true; + } + + @Override + public boolean canStoreHeat(IReactor reactor, ItemStack yourStack, int x, int y) + { + return false; + } + + @Override + public int getMaxHeat(IReactor reactor, ItemStack yourStack, int x, int y) + { + return 0; + } + + @Override + public int getCurrentHeat(IReactor reactor, ItemStack yourStack, int x, int y) + { + return 0; + } + + @Override + public int alterHeat(IReactor reactor, ItemStack yourStack, int x, int y, int heat) + { + return heat; + } + + @Override + public float influenceExplosion(IReactor reactor, ItemStack yourStack) + { + return 2 * this.numberOfCells; + } + + @Override + public void onUpdate(ItemStack stack, World world, Entity entity, int slotIndex, boolean isCurrentItem) + { + if (this.sRadiation>0&&(entity instanceof EntityLivingBase)) + { + EntityLivingBase entityLiving = (EntityLivingBase)entity; + if (!ItemArmorHazmat.hasCompleteHazmat(entityLiving)) { + IC2Potion.radiation.applyTo(entityLiving, sRadiation*20, sRadiation*10); + } + } + } + } diff --git a/src/main/java/gregtech/api/items/GT_RadioactiveCell_Item.java b/src/main/java/gregtech/api/items/GT_RadioactiveCell_Item.java new file mode 100644 index 0000000..1c1d0d5 --- /dev/null +++ b/src/main/java/gregtech/api/items/GT_RadioactiveCell_Item.java @@ -0,0 +1,162 @@ +package gregtech.api.items; + +import java.util.List; + +import ic2.core.util.StackUtil; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +public class GT_RadioactiveCell_Item + extends GT_Generic_Item +{ + protected int cellCount; + protected int maxDmg; + protected int dura; + + public GT_RadioactiveCell_Item(String aUnlocalized, String aEnglish, int aCellcount) + { + super(aUnlocalized, aEnglish, null); + this.setMaxStackSize(64); + this.setMaxDamage(100); + setNoRepair(); + this.cellCount = Math.max(1, aCellcount); + } + + protected boolean outputPulseForStack(ItemStack aStack) + { + NBTTagCompound tNBT = aStack.getTagCompound(); + if (tNBT == null) + { + tNBT = new NBTTagCompound(); + aStack.setTagCompound(tNBT); + } + tNBT.setInteger("output", tNBT.getInteger("output") + 1); + return false;//(this.pulserate > 0) || (tNBT.getInteger("output") % -this.pulserate == 0); + } + + protected boolean incrementPulseForStack(ItemStack aStack) + { + NBTTagCompound tNBT = aStack.getTagCompound(); + if (tNBT == null) + { + tNBT = new NBTTagCompound(); + aStack.setTagCompound(tNBT); + } + tNBT.setInteger("pulse", tNBT.getInteger("pulse") + 1); + return false;//(this.pulserate > 0) || (tNBT.getInteger("pulse") % -this.pulserate == 0); + } + + protected void setDurabilityForStack(ItemStack aStack, int aDurability) + { + NBTTagCompound tNBT = aStack.getTagCompound(); + if (tNBT == null) + { + tNBT = new NBTTagCompound(); + aStack.setTagCompound(tNBT); + } + tNBT.setInteger("durability", aDurability); +// if (this.maxDelay > 0) +// { +// double var4 = (this.maxDelay - aDurability) / this.maxDelay; +// int var6 = (int)(aStack.getMaxDamage() * var4); +// if (var6 >= aStack.getMaxDamage()) { +// var6 = aStack.getMaxDamage() - 1; +// } +// aStack.setItemDamage(aStack.getMaxDamage() - var6); +// } + } + + public static int getDurabilityOfStack(ItemStack aStack) + { + NBTTagCompound tNBT = aStack.getTagCompound(); + if (tNBT == null) + { + tNBT = new NBTTagCompound(); + aStack.setTagCompound(tNBT); + } + return tNBT.getInteger("advDmg"); + } + + public int getMaxNuclearDurability() + { + return 0;//return this.maxDelay; + } + + public int func_77619_b() + { + return 0; + } + + @Override +public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) + { + return false; + } + + public boolean func_82789_a(ItemStack par1ItemStack, ItemStack par2ItemStack) + { + return false; + } + + protected static int sumUp(int a) + { + int b = 0; + for (int c = 1; c <= a; c++) { + b += c; + } + return b; + } + + public void setDamageForStack(ItemStack stack, int advDmg) + { + NBTTagCompound nbtData = StackUtil.getOrCreateNbtData(stack); + nbtData.setInteger("advDmg", advDmg); + if (this.maxDmg > 0) + { + double p = (double)advDmg / (double)this.maxDmg; + int newDmg = (int)(stack.getMaxDamage() * p); + if (newDmg >= stack.getMaxDamage()) { + newDmg = stack.getMaxDamage() - 1; + } + stack.setItemDamage(newDmg); + this.dura = newDmg; + } + } + + public int getDamageOfStack(ItemStack stack) + { + NBTTagCompound nbtData = StackUtil.getOrCreateNbtData(stack); + this.dura = nbtData.getInteger("advDmg"); + return this.dura; + } + + public int getControlTagOfStack(ItemStack stack) + { + NBTTagCompound nbtData = StackUtil.getOrCreateNbtData(stack); + return nbtData.getInteger("tag"); + } + + public void setControlTagOfStack(ItemStack stack, int tag) + { + NBTTagCompound nbtData = StackUtil.getOrCreateNbtData(stack); + nbtData.setInteger("tag", tag); + } + + public int getMaxDamageEx() + { + return this.maxDmg; + } + + public void damageItemStack(ItemStack stack, int Dmg) + { + setDamageForStack(stack, getDamageOfStack(stack) + Dmg); + } + + @Override +public void addAdditionalToolTips(List aList, ItemStack aStack) + { + super.addAdditionalToolTips(aList, aStack); + //aList.add("Time left: " + (this.maxDelay - getDurabilityOfStack(aStack)) + " secs"); + aList.add("Durability: "+(this.maxDmg - getDurabilityOfStack(aStack))+"/"+this.maxDmg); + } +} diff --git a/src/main/java/gregtech/api/items/GT_SolderingTool_Item.java b/src/main/java/gregtech/api/items/GT_SolderingTool_Item.java new file mode 100644 index 0000000..51d0385 --- /dev/null +++ b/src/main/java/gregtech/api/items/GT_SolderingTool_Item.java @@ -0,0 +1,40 @@ +package gregtech.api.items; + +import static gregtech.api.enums.GT_Values.W; + +import java.util.List; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.ToolDictNames; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_OreDictUnificator; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class GT_SolderingTool_Item extends GT_Tool_Item { + public GT_SolderingTool_Item(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage, int aDischargedGTID) { + super(aUnlocalized, aEnglish, "To repair and construct Circuitry", aMaxDamage, aEntityDamage, true, -1, aDischargedGTID); + GT_OreDictUnificator.registerOre(ToolDictNames.craftingToolSolderingIron, new ItemStack(this, 1, W)); + GregTech_API.registerSolderingTool(new ItemStack(this, 1, W)); +// setCraftingSound(GregTech_API.sSoundList.get(103)); +// setBreakingSound(GregTech_API.sSoundList.get(103)); +// setEntityHitSound(GregTech_API.sSoundList.get(103)); +// setUsageAmounts(1, 1, 1); + } + + @Override + public void addAdditionalToolTips(List aList, ItemStack aStack) { + aList.add(GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".tooltip_1", "Sets the Strength of outputted Redstone")); + aList.add(GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".tooltip_2", "Needs Soldering Metal in Inventory!")); + } + + @Override + public boolean onItemUseFirst(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { + super.onItemUseFirst(aStack, aPlayer, aWorld, aX, aY, aZ, aSide, hitX, hitY, hitZ); + if (aWorld.isRemote) { + return false; + } + return false; + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/items/GT_Spray_Bug_Item.java b/src/main/java/gregtech/api/items/GT_Spray_Bug_Item.java new file mode 100644 index 0000000..d39d3d6 --- /dev/null +++ b/src/main/java/gregtech/api/items/GT_Spray_Bug_Item.java @@ -0,0 +1,66 @@ +package gregtech.api.items; + +import gregtech.api.GregTech_API; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Utility; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + +public class GT_Spray_Bug_Item extends GT_Tool_Item { + public GT_Spray_Bug_Item(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage) { + super(aUnlocalized, aEnglish, "A very 'buggy' Spray", aMaxDamage, aEntityDamage, true);/* + addToEffectiveList(EntityCaveSpider.class.getName()); + addToEffectiveList(EntitySpider.class.getName()); + addToEffectiveList("EntityTFHedgeSpider"); + addToEffectiveList("EntityTFKingSpider"); + addToEffectiveList("EntityTFSwarmSpider"); + addToEffectiveList("EntityTFTowerBroodling"); + addToEffectiveList("EntityTFFireBeetle"); + addToEffectiveList("EntityTFSlimeBeetle"); + setCraftingSound(GregTech_API.sSoundList.get(102)); + setBreakingSound(GregTech_API.sSoundList.get(102)); + setEntityHitSound(GregTech_API.sSoundList.get(102)); + setUsageAmounts(8, 4, 1);*/ + } + /* + @Override + public void onHitEntity(Entity aEntity) { + if (aEntity instanceof EntityLiving) { + ((EntityLiving)aEntity).addPotionEffect(new PotionEffect(Potion.poison.getId(), 60, 1, false)); + ((EntityLiving)aEntity).addPotionEffect(new PotionEffect(Potion.confusion.getId(), 600, 1, false)); + } + } + + @Override + public ItemStack getEmptiedItem(ItemStack aStack) { + return ItemList.Spray_Empty.get(1); + } + */ + @Override + public boolean onItemUseFirst(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { + super.onItemUseFirst(aStack, aPlayer, aWorld, aX, aY, aZ, aSide, hitX, hitY, hitZ); + if (aWorld.isRemote) { + return false; + } + Block aBlock = aWorld.getBlock(aX, aY, aZ); + if (aBlock == null) return false; +// byte aMeta = (byte)aWorld.getBlockMetadata(aX, aY, aZ); + TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ); + + try { + if (aTileEntity instanceof ic2.api.crops.ICropTile) { + int tCropBefore = ((ic2.api.crops.ICropTile)aTileEntity).getWeedExStorage(); + if (tCropBefore <= 100 && GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) { + ((ic2.api.crops.ICropTile)aTileEntity).setWeedExStorage(tCropBefore+100); + GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(102), 1.0F, -1, aX, aY, aZ); + return true; + } + } + } catch (Throwable e) {/*Do nothing*/} + + return false; + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/items/GT_Spray_Foam_Item.java b/src/main/java/gregtech/api/items/GT_Spray_Foam_Item.java new file mode 100644 index 0000000..412a125 --- /dev/null +++ b/src/main/java/gregtech/api/items/GT_Spray_Foam_Item.java @@ -0,0 +1,161 @@ +package gregtech.api.items; + +import static gregtech.api.enums.GT_Values.D1; + +import gregtech.api.GregTech_API; +import gregtech.api.metatileentity.BaseMetaPipeEntity; +import gregtech.api.util.GT_Log; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Utility; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +public class GT_Spray_Foam_Item extends GT_Tool_Item { + public GT_Spray_Foam_Item(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage) { + super(aUnlocalized, aEnglish, "Precision Spray", aMaxDamage, aEntityDamage, true);/* + setCraftingSound(GregTech_API.sSoundList.get(102)); + setBreakingSound(GregTech_API.sSoundList.get(102)); + setEntityHitSound(GregTech_API.sSoundList.get(102)); + setUsageAmounts(25, 3, 1);*/ + } + /* + @Override + public ItemStack getEmptiedItem(ItemStack aStack) { + return ItemList.Spray_Empty.get(1); + } + + public void switchMode(ItemStack aStack, EntityPlayer aPlayer) { + setMode(aStack, (getMode(aStack) + 1) % 3); + switch (getMode(aStack)) { + case 0: GT_Utility.sendChatToPlayer(aPlayer, "Single Block Mode"); break; + case 1: GT_Utility.sendChatToPlayer(aPlayer, "4m Line Mode"); break; + case 2: GT_Utility.sendChatToPlayer(aPlayer, "3mx3m Area Mode"); break; + } + } + + @Override + public void addAdditionalToolTips(List aList, ItemStack aStack) { + super.addAdditionalToolTips(aList, aStack); + switch (getMode(aStack)) { + case 0: aList.add("Single Block Mode"); break; + case 1: aList.add("4m Line Mode"); break; + case 2: aList.add("3mx3m Area Mode"); break; + } + } + + @Override + public ItemStack onItemRightClick(ItemStack aStack, World aWorld, EntityPlayer aPlayer) { + if (aPlayer.isSneaking()) switchMode(aStack, aPlayer); + return super.onItemRightClick(aStack, aWorld, aPlayer); + } + */ + @Override + public boolean onItemUseFirst(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { + super.onItemUseFirst(aStack, aPlayer, aWorld, aX, aY, aZ, aSide, hitX, hitY, hitZ); + if (aPlayer.isSneaking()) return false; + if (aWorld.isRemote) { + return false; + } + Block aBlock = aWorld.getBlock(aX, aY, aZ); + if (aBlock == null) return false; +// byte aMeta = (byte)aWorld.getBlockMetadata(aX, aY, aZ); + TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ); + + try { + if (GT_Utility.getClassName(aTileEntity).startsWith("TileEntityCable")) { + if (GT_Utility.getPublicField(aTileEntity, "foamed").getByte(aTileEntity) == 0) { + if (GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) { + GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(102), 1.0F, -1, aX, aY, aZ); + GT_Utility.callPublicMethod(aTileEntity, "changeFoam", (byte)1); + return true; + } + } + return false; + } + } catch(Throwable e) { + if (D1) e.printStackTrace(GT_Log.err); + } + + if (aTileEntity instanceof BaseMetaPipeEntity && (((BaseMetaPipeEntity)aTileEntity).mConnections & -64) == 0) { + if (GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) { + GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(102), 1.0F, -1, aX, aY, aZ); + ((BaseMetaPipeEntity)aTileEntity).mConnections |= 64; + } + return true; + } + + aX += ForgeDirection.getOrientation(aSide).offsetX; + aY += ForgeDirection.getOrientation(aSide).offsetY; + aZ += ForgeDirection.getOrientation(aSide).offsetZ; + + ItemStack tStack = GT_ModHandler.getIC2Item("constructionFoam", 1); + if (tStack != null && tStack.getItem() instanceof ItemBlock) { + int tRotationPitch = Math.round(aPlayer.rotationPitch); + byte tSide = 0; + if (tRotationPitch >= 65) { + tSide = 1; + } else if (tRotationPitch <= -65) { + tSide = 0; + } else { + switch (MathHelper.floor_double((aPlayer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) { + case 0: tSide = 2; break; + case 1: tSide = 5; break; + case 2: tSide = 3; break; + case 3: tSide = 4; break; + } + } + switch (0) { + case 0: + if (GT_Utility.isAirBlock(aWorld, aX, aY, aZ) && GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) { + GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(102), 1.0F, -1, aX, aY, aZ); + aWorld.setBlock(aX, aY, aZ, GT_Utility.getBlockFromStack(tStack), tStack.getItemDamage(), 3); + return true; + } + break; + case 1: + for (byte i = 0; i < 4; i++) { + if (GT_Utility.isAirBlock(aWorld, aX, aY, aZ) && GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) { + GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(102), 1.0F, -1, aX, aY, aZ); + aWorld.setBlock(aX, aY, aZ, GT_Utility.getBlockFromStack(tStack), tStack.getItemDamage(), 3); + } else { + if (i == 0) return false; + break; + } + aX -= ForgeDirection.getOrientation(tSide).offsetX; + aY -= ForgeDirection.getOrientation(tSide).offsetY; + aZ -= ForgeDirection.getOrientation(tSide).offsetZ; + } + return true; + case 2: + boolean temp = false, + tXFactor = (ForgeDirection.getOrientation(tSide).offsetX == 0), + tYFactor = (ForgeDirection.getOrientation(tSide).offsetY == 0), + tZFactor = (ForgeDirection.getOrientation(tSide).offsetZ == 0); + + aX -= (tXFactor ? 1 : 0); + aY -= (tYFactor ? 1 : 0); + aZ -= (tZFactor ? 1 : 0); + + for (byte i = 0; i < 3; i++) for (byte j = 0; j < 3; j++) { + if (GT_Utility.isAirBlock(aWorld, aX + (tXFactor?i:0), aY + (!tXFactor&&tYFactor?i:0) + (!tZFactor&&tYFactor?j:0), aZ + (tZFactor?j:0))) { + if (GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) { + GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(102), 1.0F, -1, aX, aY, aZ); + aWorld.setBlock(aX + (tXFactor?i:0), aY + (!tXFactor&&tYFactor?i:0) + (!tZFactor&&tYFactor?j:0), aZ + (tZFactor?j:0), GT_Utility.getBlockFromStack(tStack), tStack.getItemDamage(), 3); + temp = true; + } else { + break; + } + } + } + return temp; + } + } + return false; + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/items/GT_Spray_Hardener_Item.java b/src/main/java/gregtech/api/items/GT_Spray_Hardener_Item.java new file mode 100644 index 0000000..ca05ba4 --- /dev/null +++ b/src/main/java/gregtech/api/items/GT_Spray_Hardener_Item.java @@ -0,0 +1,71 @@ +package gregtech.api.items; + +import static gregtech.api.enums.GT_Values.D1; + +import gregtech.api.GregTech_API; +import gregtech.api.metatileentity.BaseMetaPipeEntity; +import gregtech.api.util.GT_Log; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Utility; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + +public class GT_Spray_Hardener_Item extends GT_Tool_Item { + public GT_Spray_Hardener_Item(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage) { + super(aUnlocalized, aEnglish, "Construction Foam Hardener", aMaxDamage, aEntityDamage, true);/* + setCraftingSound(GregTech_API.sSoundList.get(102)); + setBreakingSound(GregTech_API.sSoundList.get(102)); + setEntityHitSound(GregTech_API.sSoundList.get(102)); + setUsageAmounts(16, 3, 1);*/ + } + + @Override + public boolean onItemUseFirst(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { + super.onItemUseFirst(aStack, aPlayer, aWorld, aX, aY, aZ, aSide, hitX, hitY, hitZ); + if (aWorld.isRemote) { + return false; + } + Block aBlock = aWorld.getBlock(aX, aY, aZ); + if (aBlock == null) return false; +// byte aMeta = (byte)aWorld.getBlockMetadata(aX, aY, aZ); + TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ); + + try { + if (GT_Utility.getClassName(aTileEntity).startsWith("TileEntityCable")) { + if (GT_Utility.getPublicField(aTileEntity, "foamed").getByte(aTileEntity) == 1) { + if (GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) { + GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(102), 1.0F, -1, aX, aY, aZ); + GT_Utility.callPublicMethod(aTileEntity, "changeFoam", (byte)2); + return true; + } + } + return false; + } + } catch(Throwable e) { + if (D1) e.printStackTrace(GT_Log.err); + } + + ItemStack tStack1 = GT_ModHandler.getIC2Item("constructionFoam", 1), tStack2 = GT_ModHandler.getIC2Item("constructionFoamWall", 1); + if (tStack1 != null && tStack1.isItemEqual(new ItemStack(aBlock)) && tStack2 != null && tStack2.getItem() != null && tStack2.getItem() instanceof ItemBlock) { + if (GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) { + GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(102), 1.0F, -1, aX, aY, aZ); + aWorld.setBlock(aX, aY, aZ, GT_Utility.getBlockFromStack(tStack2), 7, 3); + } + return true; + } + + if (aTileEntity instanceof BaseMetaPipeEntity && (((BaseMetaPipeEntity)aTileEntity).mConnections & -64) == 64) { + if (GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) { + GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(102), 1.0F, -1, aX, aY, aZ); + ((BaseMetaPipeEntity)aTileEntity).mConnections = (byte)((((BaseMetaPipeEntity)aTileEntity).mConnections & ~64) | -128); + } + return true; + } + + return false; + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/items/GT_Spray_Hydration_Item.java b/src/main/java/gregtech/api/items/GT_Spray_Hydration_Item.java new file mode 100644 index 0000000..2fbc1f3 --- /dev/null +++ b/src/main/java/gregtech/api/items/GT_Spray_Hydration_Item.java @@ -0,0 +1,53 @@ +package gregtech.api.items; + +import gregtech.api.GregTech_API; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Utility; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + +public class GT_Spray_Hydration_Item extends GT_Tool_Item { + public GT_Spray_Hydration_Item(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage) { + super(aUnlocalized, aEnglish, "To hydrate Crops and similar", aMaxDamage, aEntityDamage, true);/* + setCraftingSound(GregTech_API.sSoundList.get(102)); + setBreakingSound(GregTech_API.sSoundList.get(102)); + setEntityHitSound(GregTech_API.sSoundList.get(102)); + setUsageAmounts(20, 3, 1);*/ + } + + @Override + public boolean onItemUseFirst(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { + super.onItemUseFirst(aStack, aPlayer, aWorld, aX, aY, aZ, aSide, hitX, hitY, hitZ); + if (aWorld.isRemote) { + return false; + } + Block aBlock = aWorld.getBlock(aX, aY, aZ); + if (aBlock == null) return false; +// byte aMeta = (byte)aWorld.getBlockMetadata(aX, aY, aZ); + TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ); + + try { + if (aTileEntity instanceof ic2.api.crops.ICropTile) { + int tCropBefore = ((ic2.api.crops.ICropTile)aTileEntity).getHydrationStorage(); + if (tCropBefore <= 100 && GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) { + ((ic2.api.crops.ICropTile)aTileEntity).setHydrationStorage(tCropBefore+100); + GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(102), 1.0F, -1, aX, aY, aZ); + } + return true; + } + } catch (Throwable e) {/*Do nothing*/} + + if (aTileEntity instanceof IGregTechTileEntity) { + if (((IGregTechTileEntity)aTileEntity).getColorization() >= 0 && GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) { + ((IGregTechTileEntity)aTileEntity).setColorization((byte)-1); + GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(102), 1.0F, -1, aX, aY, aZ); + } + } + + return false; + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/items/GT_Spray_Ice_Item.java b/src/main/java/gregtech/api/items/GT_Spray_Ice_Item.java new file mode 100644 index 0000000..423e34b --- /dev/null +++ b/src/main/java/gregtech/api/items/GT_Spray_Ice_Item.java @@ -0,0 +1,81 @@ +package gregtech.api.items; + +import static gregtech.api.enums.GT_Values.W; + +import java.util.Arrays; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Utility; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +public class GT_Spray_Ice_Item extends GT_Tool_Item { + public GT_Spray_Ice_Item(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage) { + super(aUnlocalized, aEnglish, "Very effective against Slimes", aMaxDamage, aEntityDamage, true);/* + addToEffectiveList(EntitySlime.class.getName()); + addToEffectiveList("BlueSlime"); + addToEffectiveList("SlimeClone"); + addToEffectiveList("MetalSlime"); + addToEffectiveList("EntityTFFireBeetle"); + addToEffectiveList("EntityTFMazeSlime"); + addToEffectiveList("EntityTFSlimeBeetle"); + setCraftingSound(GregTech_API.sSoundList.get(102)); + setBreakingSound(GregTech_API.sSoundList.get(102)); + setEntityHitSound(GregTech_API.sSoundList.get(102)); + setUsageAmounts(4, 16, 1);*/ + + for (Object tName : Arrays.asList(OrePrefixes.bucket.get(Materials.Water), OrePrefixes.cell.get(Materials.Water), OrePrefixes.capsule.get(Materials.Water))) { + GT_ModHandler.addShapelessCraftingRecipe(new ItemStack(Blocks.ice, 1, 0), new Object[] {new ItemStack(this, 1, W), tName}); + } + } + /* + @Override + public void onHitEntity(Entity aEntity) { + if (aEntity instanceof EntityLiving) { + ((EntityLiving)aEntity).addPotionEffect(new PotionEffect(Potion.weakness.getId(), 400, 2, false)); + ((EntityLiving)aEntity).addPotionEffect(new PotionEffect(Potion.moveSlowdown.getId(), 400, 2, false)); + } + } + */ + + @Override + public boolean onItemUseFirst(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { + super.onItemUseFirst(aStack, aPlayer, aWorld, aX, aY, aZ, aSide, hitX, hitY, hitZ); + if (aWorld.isRemote) { + return false; + } + aX += ForgeDirection.getOrientation(aSide).offsetX; + aY += ForgeDirection.getOrientation(aSide).offsetY; + aZ += ForgeDirection.getOrientation(aSide).offsetZ; + Block aBlock = aWorld.getBlock(aX, aY, aZ); + if (aBlock == null) return false; + byte aMeta = (byte)aWorld.getBlockMetadata(aX, aY, aZ); +// TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ); + + if (aBlock == Blocks.water || aBlock == Blocks.flowing_water) { + if (aMeta == 0 && GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) { + GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(102), 1.0F, -1, aX, aY, aZ); + aWorld.setBlock(aX, aY, aZ, Blocks.ice, 0, 3); + return true; + } + return false; + } + + if (aBlock == Blocks.lava || aBlock == Blocks.flowing_lava) { + if (aMeta == 0 && GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) { + GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(102), 1.0F, -1, aX, aY, aZ); + aWorld.setBlock(aX, aY, aZ, Blocks.obsidian, 0, 3); + return true; + } + return false; + } + return false; + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/items/GT_Spray_Pepper_Item.java b/src/main/java/gregtech/api/items/GT_Spray_Pepper_Item.java new file mode 100644 index 0000000..3d7e24f --- /dev/null +++ b/src/main/java/gregtech/api/items/GT_Spray_Pepper_Item.java @@ -0,0 +1,51 @@ +package gregtech.api.items; + +import java.util.List; + +import gregtech.api.util.GT_LanguageManager; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class GT_Spray_Pepper_Item extends GT_Tool_Item { + public GT_Spray_Pepper_Item(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage) { + super(aUnlocalized, aEnglish, "To defend yourself against Bears", aMaxDamage, aEntityDamage, true);/* + setCraftingSound(GregTech_API.sSoundList.get(102)); + setBreakingSound(GregTech_API.sSoundList.get(102)); + setEntityHitSound(GregTech_API.sSoundList.get(102)); + setUsageAmounts(1, 8, 1);*/ + } + + @Override + public void addAdditionalToolTips(List aList, ItemStack aStack) { + aList.add(GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".tooltip_1", "especially Pedobears, Care Bears,")); + aList.add(GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".tooltip_2", "Confession Bears, Bear Grylls")); + aList.add(GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".tooltip_3", "And ofcourse Man-Bear-Pig")); + } + /* + @Override + public void onHitEntity(Entity aEntity) { + if (aEntity instanceof EntityLiving) { + ((EntityLiving)aEntity).addPotionEffect(new PotionEffect(Potion.blindness.getId(), 1200, 2, false)); + ((EntityLiving)aEntity).addPotionEffect(new PotionEffect(Potion.poison.getId(), 120, 2, false)); + ((EntityLiving)aEntity).addPotionEffect(new PotionEffect(Potion.weakness.getId(), 200, 2, false)); + ((EntityLiving)aEntity).addPotionEffect(new PotionEffect(Potion.confusion.getId(), 600, 2, false)); + } + } + */ + + @Override + public boolean onItemUseFirst(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { + super.onItemUseFirst(aStack, aPlayer, aWorld, aX, aY, aZ, aSide, hitX, hitY, hitZ); + if (aWorld.isRemote) { + return false; + } + Block aBlock = aWorld.getBlock(aX, aY, aZ); + if (aBlock == null) return false; +// byte aMeta = (byte)aWorld.getBlockMetadata(aX, aY, aZ); +// TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ); + + return false; + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/items/GT_Tool_Item.java b/src/main/java/gregtech/api/items/GT_Tool_Item.java new file mode 100644 index 0000000..6c61d59 --- /dev/null +++ b/src/main/java/gregtech/api/items/GT_Tool_Item.java @@ -0,0 +1,25 @@ +package gregtech.api.items; + +import gregtech.api.util.GT_ModHandler; + +/** + * This is just a basic Tool, which has normal durability and could break Blocks. + */ +public class GT_Tool_Item extends GT_Generic_Item { + public GT_Tool_Item(String aUnlocalized, String aEnglish, String aTooltip, int aMaxDamage, int aEntityDamage, boolean aSwingIfUsed) { + this(aUnlocalized, aEnglish, aTooltip, aMaxDamage, aEntityDamage, aSwingIfUsed, -1, -1); + } + + public GT_Tool_Item(String aUnlocalized, String aEnglish, String aTooltip, int aMaxDamage, int aEntityDamage, boolean aSwingIfUsed, int aChargedGTID, int aDisChargedGTID) { + this(aUnlocalized, aEnglish, aTooltip, aMaxDamage, aEntityDamage, aSwingIfUsed, aChargedGTID, aDisChargedGTID, 0, 0.0F); + } + + public GT_Tool_Item(String aUnlocalized, String aEnglish, String aTooltip, int aMaxDamage, int aEntityDamage, boolean aSwingIfUsed, int aChargedGTID, int aDisChargedGTID, int aToolQuality, float aToolStrength) { + super(aUnlocalized, aEnglish, aTooltip, aTooltip != null && !aTooltip.equals("Doesn't work as intended, this is a Bug")); + setMaxDamage(aMaxDamage); + setMaxStackSize(1); + setNoRepair(); + setFull3D(); + GT_ModHandler.registerBoxableItemToToolBox(this); + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java new file mode 100644 index 0000000..52dfc89 --- /dev/null +++ b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java @@ -0,0 +1,1020 @@ +package gregtech.api.metatileentity; + +import static gregtech.api.enums.GT_Values.NW; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.interfaces.tileentity.IPipeRenderedTileEntity; +import gregtech.api.net.GT_Packet_TileEntity; +import gregtech.api.objects.GT_ItemStack; +import gregtech.api.util.GT_CoverBehavior; +import gregtech.api.util.GT_Log; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Utility; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.network.Packet; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTankInfo; + +/** + * NEVER INCLUDE THIS FILE IN YOUR MOD!!! + * + * This is the main TileEntity for EVERYTHING. + */ +public class BaseMetaPipeEntity extends BaseTileEntity implements IGregTechTileEntity, IPipeRenderedTileEntity { + public byte mConnections = 0; + + protected MetaPipeEntity mMetaTileEntity; + + private byte[] mSidedRedstone = new byte[] {0,0,0,0,0,0}; + private int[] mCoverSides = new int[] {0,0,0,0,0,0}, mCoverData = new int[] {0,0,0,0,0,0}, mTimeStatistics = new int[GregTech_API.TICKS_FOR_LAG_AVERAGING]; + private boolean mInventoryChanged = false, mWorkUpdate = false, mWorks = true, mNeedsUpdate = true, mNeedsBlockUpdate = true, mSendClientData = false; + private byte mColor = 0, oColor = 0, mStrongRedstone = 0, oRedstoneData = 63, oTextureData = 0, oUpdateData = 0, mLagWarningCount = 0; + private int oX = 0, oY = 0, oZ = 0, mTimeStatisticsIndex = 0; + private short mID = 0; + private long mTickTimer = 0; + + public BaseMetaPipeEntity() {} + + @Override + public void writeToNBT(NBTTagCompound aNBT) { + try { + super.writeToNBT(aNBT); + } catch(Throwable e) { + GT_Log.err.println("Encountered CRITICAL ERROR while saving MetaTileEntity, the Chunk whould've been corrupted by now, but I prevented that. Please report immidietly to GregTech Intergalactical!!!"); + e.printStackTrace(GT_Log.err); + } + try { + aNBT.setInteger ("mID" , mID); + aNBT.setIntArray ("mCoverData" , mCoverData); + aNBT.setIntArray ("mCoverSides" , mCoverSides); + aNBT.setByteArray ("mRedstoneSided" , mSidedRedstone); + aNBT.setByte ("mConnections" , mConnections); + aNBT.setByte ("mColor" , mColor); + aNBT.setByte ("mStrongRedstone" , mStrongRedstone); + aNBT.setBoolean ("mWorks" , !mWorks); + } catch(Throwable e) { + GT_Log.err.println("Encountered CRITICAL ERROR while saving MetaTileEntity, the Chunk whould've been corrupted by now, but I prevented that. Please report immidietly to GregTech Intergalactical!!!"); + e.printStackTrace(GT_Log.err); + } + try { + if (hasValidMetaTileEntity()) { + NBTTagList tItemList = new NBTTagList(); + for (int i = 0; i < mMetaTileEntity.getRealInventory().length; i++) { + ItemStack tStack = mMetaTileEntity.getRealInventory()[i]; + if (tStack != null) { + NBTTagCompound tTag = new NBTTagCompound(); + tTag.setInteger("IntSlot", i); + tStack.writeToNBT(tTag); + tItemList.appendTag(tTag); + } + } + aNBT.setTag("Inventory", tItemList); + + try { + mMetaTileEntity.saveNBTData(aNBT); + } catch(Throwable e) { + GT_Log.err.println("Encountered CRITICAL ERROR while saving MetaTileEntity, the Chunk whould've been corrupted by now, but I prevented that. Please report immidietly to GregTech Intergalactical!!!"); + e.printStackTrace(GT_Log.err); + } + } + } catch(Throwable e) { + GT_Log.err.println("Encountered CRITICAL ERROR while saving MetaTileEntity, the Chunk whould've been corrupted by now, but I prevented that. Please report immidietly to GregTech Intergalactical!!!"); + e.printStackTrace(GT_Log.err); + } + } + + @Override + public void readFromNBT(NBTTagCompound aNBT) { + super.readFromNBT(aNBT); + setInitialValuesAsNBT(aNBT, (short)0); + } + + @Override + public void setInitialValuesAsNBT(NBTTagCompound aNBT, short aID) { + if (aNBT == null) { + if (aID>0) mID=aID; else mID=mID>0?mID:0; + if (mID!=0) createNewMetatileEntity(mID); + } else { + if (aID<=0) mID = (short)aNBT.getInteger ("mID"); else mID = aID; + mCoverSides = aNBT.getIntArray ("mCoverSides"); + mCoverData = aNBT.getIntArray ("mCoverData"); + mSidedRedstone = aNBT.getByteArray ("mRedstoneSided"); + mConnections = aNBT.getByte ("mConnections"); + mColor = aNBT.getByte ("mColor"); + mStrongRedstone = aNBT.getByte ("mStrongRedstone"); + mWorks =!aNBT.getBoolean ("mWorks"); + + if (mCoverData.length != 6) mCoverData = new int[] { 0, 0, 0, 0, 0, 0}; + if (mCoverSides.length != 6) mCoverSides = new int[] { 0, 0, 0, 0, 0, 0}; + if (mSidedRedstone.length != 6) mSidedRedstone = new byte[] { 0, 0, 0, 0, 0, 0}; + + for (byte i = 0; i < 6; i++) mCoverBehaviors[i] = GregTech_API.getCoverBehavior(mCoverSides[i]); + + if (mID!=0 && createNewMetatileEntity(mID)) { + NBTTagList tItemList = aNBT.getTagList("Inventory", 10); + for (int i = 0; i < tItemList.tagCount(); i++) { + NBTTagCompound tTag = tItemList.getCompoundTagAt(i); + int tSlot = tTag.getInteger("IntSlot"); + if (tSlot >= 0 && tSlot < mMetaTileEntity.getRealInventory().length) { + mMetaTileEntity.getRealInventory()[tSlot] = GT_Utility.loadItem(tTag); + } + } + + try { + mMetaTileEntity.loadNBTData(aNBT); + } catch(Throwable e) { + GT_Log.err.println("Encountered Exception while loading MetaTileEntity, the Server should've crashed now, but I prevented that. Please report immidietly to GregTech Intergalactical!!!"); + e.printStackTrace(GT_Log.err); + } + } + } + + if (mCoverData.length != 6) mCoverData = new int[] { 0, 0, 0, 0, 0, 0}; + if (mCoverSides.length != 6) mCoverSides = new int[] { 0, 0, 0, 0, 0, 0}; + if (mSidedRedstone.length != 6) mSidedRedstone = new byte[] { 0, 0, 0, 0, 0, 0}; + + for (byte i = 0; i < 6; i++) mCoverBehaviors[i] = GregTech_API.getCoverBehavior(mCoverSides[i]); + } + + private boolean createNewMetatileEntity(short aID) { + if (aID <= 0 || aID >= GregTech_API.METATILEENTITIES.length || GregTech_API.METATILEENTITIES[aID] == null) { + GT_Log.err.println("MetaID " + aID + " not loadable => locking TileEntity!"); + } else { + if (aID != 0) { + if (hasValidMetaTileEntity()) mMetaTileEntity.setBaseMetaTileEntity(null); + GregTech_API.METATILEENTITIES[aID].newMetaEntity(this).setBaseMetaTileEntity(this); + mTickTimer = 0; + mID = aID; + return true; + } + } + return false; + } + + @Override + public void updateEntity() { + super.updateEntity(); + + if (!hasValidMetaTileEntity()) { + if (mMetaTileEntity == null) return; + mMetaTileEntity.setBaseMetaTileEntity(this); + } + + long tTime = System.currentTimeMillis(); + + for (int tCode = 0; hasValidMetaTileEntity() && tCode >= 0;) {try {switch (tCode) { + case 0: + tCode++; + if (mTickTimer++==0) { + oX = xCoord; + oY = yCoord; + oZ = zCoord; + if (isServerSide()) for (byte i = 0; i < 6; i++) if (getCoverIDAtSide(i)!=0) if (!mMetaTileEntity.allowCoverOnSide(i, new GT_ItemStack(getCoverIDAtSide(i)))) dropCover(i, i, true); + worldObj.markTileEntityChunkModified(xCoord, yCoord, zCoord, this); + mMetaTileEntity.onFirstTick(this); + if (!hasValidMetaTileEntity()) return; + } + case 1: + tCode++; + if (isClientSide()) { + if (mColor != oColor) { + mMetaTileEntity.onColorChangeClient(oColor = mColor); + issueTextureUpdate(); + } + + if (mNeedsUpdate) { + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + //worldObj.func_147479_m(xCoord, yCoord, zCoord); + mNeedsUpdate = false; + } + } + case 2: case 3: case 4: case 5: case 6: case 7: + if (isServerSide() && mTickTimer > 10) { + for (byte i = (byte)(tCode-2); i < 6; i++) if (getCoverIDAtSide(i) != 0) { + tCode++; + GT_CoverBehavior tCover = getCoverBehaviorAtSide(i); + int tCoverTickRate = tCover.getTickRate(i, getCoverIDAtSide(i), mCoverData[i], this); + if (tCoverTickRate > 0 && mTickTimer % tCoverTickRate == 0) { + mCoverData[i] = tCover.doCoverThings(i, getInputRedstoneSignal(i), getCoverIDAtSide(i), mCoverData[i], this, mTickTimer); + if (!hasValidMetaTileEntity()) return; + } + } + mConnections = (byte)(mMetaTileEntity.mConnections | (mConnections & ~63)); + if ((mConnections & -64) == 64 && getRandomNumber(1000) == 0) { + mConnections = (byte)((mConnections & ~64) | -128); + } + } + case 8: + tCode=9; + mMetaTileEntity.onPreTick(this, mTickTimer); + if (!hasValidMetaTileEntity()) return; + case 9: + tCode++; + if (isServerSide()) { + if (mTickTimer == 10) { + for (byte i = 0; i < 6; i++) mCoverBehaviors[i] = GregTech_API.getCoverBehavior(mCoverSides[i]); + issueBlockUpdate(); + } + + if (xCoord != oX || yCoord != oY || zCoord != oZ) { + oX = xCoord; + oY = yCoord; + oZ = zCoord; + issueClientUpdate(); + clearTileEntityBuffer(); + } + } + case 10: + tCode++; + mMetaTileEntity.onPostTick(this, mTickTimer); + if (!hasValidMetaTileEntity()) return; + case 11: + tCode++; + if (isServerSide()) { + if (mTickTimer % 10 == 0) { + if (mSendClientData) { + NW.sendPacketToAllPlayersInRange(worldObj, new GT_Packet_TileEntity(xCoord, (short)yCoord, zCoord, mID, mCoverSides[0], mCoverSides[1], mCoverSides[2], mCoverSides[3], mCoverSides[4], mCoverSides[5], oTextureData = mConnections, oUpdateData = hasValidMetaTileEntity()?mMetaTileEntity.getUpdateData():0, oRedstoneData = (byte)(((mSidedRedstone[0]>0)?1:0)|((mSidedRedstone[1]>0)?2:0)|((mSidedRedstone[2]>0)?4:0)|((mSidedRedstone[3]>0)?8:0)|((mSidedRedstone[4]>0)?16:0)|((mSidedRedstone[5]>0)?32:0)), oColor = mColor), xCoord, zCoord); + mSendClientData = false; + } + } + + if (mTickTimer > 10) { + if (mConnections != oTextureData) sendBlockEvent((byte)0, oTextureData = mConnections); + byte tData = mMetaTileEntity.getUpdateData(); + if (tData != oUpdateData) sendBlockEvent((byte)1, oUpdateData = tData); + if (mColor != oColor) sendBlockEvent((byte)2, oColor = mColor); + tData = (byte)(((mSidedRedstone[0]>0)?1:0)|((mSidedRedstone[1]>0)?2:0)|((mSidedRedstone[2]>0)?4:0)|((mSidedRedstone[3]>0)?8:0)|((mSidedRedstone[4]>0)?16:0)|((mSidedRedstone[5]>0)?32:0)); + if (tData != oRedstoneData) sendBlockEvent((byte)3, oRedstoneData = tData); + } + + if (mNeedsBlockUpdate) { + worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, getBlockOffset(0, 0, 0)); + mNeedsBlockUpdate = false; + } + } + default: + tCode = -1; + break; + }} catch (Throwable e) { + GT_Log.err.println("Encountered Exception while ticking MetaTileEntity in Step "+(tCode-1)+". The Game should've crashed now, but I prevented that. Please report immidietly to GregTech Intergalactical!!!"); + e.printStackTrace(GT_Log.err); + }} + + if (isServerSide() && hasValidMetaTileEntity()) { + tTime = System.currentTimeMillis() - tTime; + if (mTimeStatistics.length > 0) mTimeStatistics[mTimeStatisticsIndex = (mTimeStatisticsIndex + 1) % mTimeStatistics.length] = (int)tTime; + if (tTime > 0 && tTime > GregTech_API.MILLISECOND_THRESHOLD_UNTIL_LAG_WARNING && mTickTimer > 1000 && getMetaTileEntity().doTickProfilingMessageDuringThisTick() && mLagWarningCount++<10) System.out.println("WARNING: Possible Lag Source at [" + xCoord + ", " + yCoord + ", " + zCoord + "] in Dimension " + worldObj.provider.dimensionId + " with " + tTime + "ms caused by an instance of " + getMetaTileEntity().getClass()); + } + + mWorkUpdate = mInventoryChanged = false; + } + + @Override + public Packet getDescriptionPacket() { + issueClientUpdate(); + return null; + } + + public final void receiveMetaTileEntityData(short aID, int aCover0, int aCover1, int aCover2, int aCover3, int aCover4, int aCover5, byte aTextureData, byte aUpdateData, byte aRedstoneData, byte aColorData) { + issueTextureUpdate(); + if (mID != aID && aID > 0) { + mID = aID; + createNewMetatileEntity(mID); + } + + mCoverSides[0] = aCover0; + mCoverSides[1] = aCover1; + mCoverSides[2] = aCover2; + mCoverSides[3] = aCover3; + mCoverSides[4] = aCover4; + mCoverSides[5] = aCover5; + + for (byte i = 0; i < 6; i++) mCoverBehaviors[i] = GregTech_API.getCoverBehavior(mCoverSides[i]); + + receiveClientEvent(0, aTextureData); + receiveClientEvent(1, aUpdateData); + receiveClientEvent(2, aColorData); + receiveClientEvent(3, aRedstoneData); + } + + @Override + public boolean receiveClientEvent(int aEventID, int aValue) { + super.receiveClientEvent(aEventID, aValue); + + if (hasValidMetaTileEntity()) { + try { + mMetaTileEntity.receiveClientEvent((byte)aEventID, (byte)aValue); + } catch(Throwable e) { + GT_Log.err.println("Encountered Exception while receiving Data from the Server, the Client should've been crashed by now, but I prevented that. Please report immidietly to GregTech Intergalactical!!!"); + e.printStackTrace(GT_Log.err); + } + } + + if (isClientSide()) { + issueTextureUpdate(); + switch(aEventID) { + case 0: + mConnections = (byte)aValue; + break; + case 1: + if (hasValidMetaTileEntity()) mMetaTileEntity.onValueUpdate((byte)aValue); + break; + case 2: + if (aValue > 16 || aValue < 0) aValue = 0; + mColor = (byte)aValue; + break; + case 3: + mSidedRedstone[0] = (byte)((aValue& 1)>0?15:0); + mSidedRedstone[1] = (byte)((aValue& 2)>0?15:0); + mSidedRedstone[2] = (byte)((aValue& 4)>0?15:0); + mSidedRedstone[3] = (byte)((aValue& 8)>0?15:0); + mSidedRedstone[4] = (byte)((aValue&16)>0?15:0); + mSidedRedstone[5] = (byte)((aValue&32)>0?15:0); + break; + case 4: + if (hasValidMetaTileEntity() && mTickTimer > 20) mMetaTileEntity.doSound((byte)aValue, xCoord+0.5, yCoord+0.5, zCoord+0.5); + break; + case 5: + if (hasValidMetaTileEntity() && mTickTimer > 20) mMetaTileEntity.startSoundLoop((byte)aValue, xCoord+0.5, yCoord+0.5, zCoord+0.5); + break; + case 6: + if (hasValidMetaTileEntity() && mTickTimer > 20) mMetaTileEntity.stopSoundLoop((byte)aValue, xCoord+0.5, yCoord+0.5, zCoord+0.5); + break; + } + } + return true; + } + + public ArrayList getDebugInfo(EntityPlayer aPlayer, int aLogLevel) { + ArrayList tList = new ArrayList(); + if (aLogLevel > 2) { + tList.add("Meta-ID: " + mID + (hasValidMetaTileEntity()?" valid":" invalid") + (mMetaTileEntity==null?" MetaTileEntity == null!":" ")); + } + if (aLogLevel > 1) { + if (mTimeStatistics.length > 0) { + double tAverageTime = 0; for (int tTime : mTimeStatistics) tAverageTime += tTime; + tList.add("This particular TileEntity has caused an average CPU-load of ~" + (tAverageTime/mTimeStatistics.length) + "ms over the last " + mTimeStatistics.length + " ticks."); + } + if (mLagWarningCount > 0) { + tList.add("This TileEntity has also caused " + (mLagWarningCount>=10?"more than 10":mLagWarningCount) + " Lag Spike Warnings (anything taking longer than " + GregTech_API.MILLISECOND_THRESHOLD_UNTIL_LAG_WARNING + "ms) on the Server."); + } + tList.add("Is" + (mMetaTileEntity.isAccessAllowed(aPlayer)?" ":" not ") + "accessible for you"); + } + return mMetaTileEntity.getSpecialDebugInfo(this, aPlayer, aLogLevel, tList); + } + + @Override public void issueTextureUpdate() {mNeedsUpdate = true;} + @Override public void issueBlockUpdate() {mNeedsBlockUpdate = true;} + @Override public void issueClientUpdate() {mSendClientData = true;} + @Override public void issueCoverUpdate(byte aSide) {issueClientUpdate();} + + @Override public byte getStrongestRedstone() {return (byte)Math.max(getInternalInputRedstoneSignal((byte)0), Math.max(getInternalInputRedstoneSignal((byte)1), Math.max(getInternalInputRedstoneSignal((byte)2), Math.max(getInternalInputRedstoneSignal((byte)3), Math.max(getInternalInputRedstoneSignal((byte)4), getInternalInputRedstoneSignal((byte)5))))));} + + @Override public boolean getRedstone() {return getRedstone((byte)0)||getRedstone((byte)1)||getRedstone((byte)2)||getRedstone((byte)3)||getRedstone((byte)4)||getRedstone((byte)5);} + @Override public boolean getRedstone(byte aSide) {return getInternalInputRedstoneSignal(aSide) > 0;} + + public ITexture getCoverTexture(byte aSide) {return GregTech_API.sCovers.get(new GT_ItemStack(getCoverIDAtSide(aSide)));} + + @Override public boolean isGivingInformation() {if (canAccessData()) return mMetaTileEntity.isGivingInformation(); return false;} + @Override public boolean isValidFacing(byte aSide) {if (canAccessData()) return mMetaTileEntity.isFacingValid(aSide); return false;} + @Override public byte getBackFacing() {return GT_Utility.getOppositeSide(getFrontFacing());} + @Override public byte getFrontFacing() {return 6;} + @Override public void setFrontFacing(byte aFacing) {/*Do nothing*/} + @Override public int getSizeInventory() {if (canAccessData()) return mMetaTileEntity.getSizeInventory(); return 0;} + @Override public ItemStack getStackInSlot(int aIndex) {if (canAccessData()) return mMetaTileEntity.getStackInSlot(aIndex); return null;} + @Override public void setInventorySlotContents(int aIndex, ItemStack aStack) {mInventoryChanged = true; if (canAccessData()) mMetaTileEntity.setInventorySlotContents(aIndex, worldObj.isRemote?aStack:GT_OreDictUnificator.setStack(true, aStack));} + @Override public String getInventoryName() {if (canAccessData()) return mMetaTileEntity.getInventoryName(); if (GregTech_API.METATILEENTITIES[mID] != null) return GregTech_API.METATILEENTITIES[mID].getInventoryName(); return "";} + @Override public int getInventoryStackLimit() {if (canAccessData()) return mMetaTileEntity.getInventoryStackLimit(); return 64;} + @Override public void openInventory() {/*Do nothing*/} + @Override public void closeInventory() {/*Do nothing*/} + @Override public boolean isUseableByPlayer(EntityPlayer aPlayer) {return hasValidMetaTileEntity() && mTickTimer>40 && getTileEntityOffset(0, 0, 0) == this && aPlayer.getDistanceSq(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5) < 64 && mMetaTileEntity.isAccessAllowed(aPlayer);} + @Override public void validate() {super.validate(); mTickTimer = 0;} + @Override public void invalidate() {tileEntityInvalid = false; if (hasValidMetaTileEntity()) {mMetaTileEntity.onRemoval(); mMetaTileEntity.setBaseMetaTileEntity(null);} super.invalidate();} + @Override public void onChunkUnload() {super.onChunkUnload();} + @Override public boolean hasCustomInventoryName() {return false;} + @Override public ItemStack getStackInSlotOnClosing(int slot) {ItemStack stack = getStackInSlot(slot); if (stack != null) setInventorySlotContents(slot, null); return stack;} + @Override public void onMachineBlockUpdate() {if (canAccessData()) mMetaTileEntity.onMachineBlockUpdate();} + @Override public int getProgress() {return canAccessData()?mMetaTileEntity.getProgresstime():0;} + @Override public int getMaxProgress() {return canAccessData()?mMetaTileEntity.maxProgresstime():0;} + @Override public boolean increaseProgress(int aProgressAmountInTicks) {return canAccessData()?mMetaTileEntity.increaseProgress(aProgressAmountInTicks)!=aProgressAmountInTicks:false;} + @Override public boolean hasThingsToDo() {return getMaxProgress()>0;} + @Override public void enableWorking() {if (!mWorks) mWorkUpdate = true; mWorks = true;} + @Override public void disableWorking() {mWorks = false;} + @Override public boolean isAllowedToWork() {return mWorks;} + @Override public boolean hasWorkJustBeenEnabled() {return mWorkUpdate;} + @Override public void setWorkDataValue(byte aValue) {/*Do nothing*/} + @Override public byte getWorkDataValue() {return 0;} + @Override public int getMetaTileID() {return mID;} + @Override public int setMetaTileID(short aID) {return mID = aID;} + @Override public boolean isActive() {return false;} + @Override public void setActive(boolean aActive) {/*Do nothing*/} + @Override public long getTimer() {return mTickTimer;} + @Override public boolean decreaseStoredEnergyUnits(long aEnergy, boolean aIgnoreTooLessEnergy) {return false;} + @Override public boolean increaseStoredEnergyUnits(long aEnergy, boolean aIgnoreTooMuchEnergy) {return false;} + @Override public boolean inputEnergyFrom(byte aSide) {return false;} + @Override public boolean outputsEnergyTo(byte aSide) {return false;} + @Override public long getOutputAmperage() {return 0;} + @Override public long getOutputVoltage() {return 0;} + @Override public long getInputAmperage() {return 0;} + @Override public long getInputVoltage() {return 0;} + @Override public boolean increaseStoredSteam(long aEnergy, boolean aIgnoreTooMuchEnergy) {return false;} + @Override public String[] getDescription() {if (canAccessData()) return mMetaTileEntity.getDescription(); return new String[0];} + @Override public boolean isValidSlot(int aIndex) {if (canAccessData()) return mMetaTileEntity.isValidSlot(aIndex); return false;} + @Override public long getUniversalEnergyStored() {return Math.max(getStoredEU(), getStoredSteam());} + @Override public long getUniversalEnergyCapacity() {return Math.max(getEUCapacity(), getSteamCapacity());} + @Override public long getStoredEU() {return 0;} + @Override public long getEUCapacity() {return 0;} + @Override public long getStoredSteam() {return 0;} + @Override public long getSteamCapacity() {return 0;} + @Override public ITexture[] getTexture(byte aSide) {ITexture rIcon = getCoverTexture(aSide); if (rIcon != null) return new ITexture[] {rIcon}; return getTextureUncovered(aSide);} + @Override public ITexture[] getTextureUncovered(byte aSide) {if ((mConnections & 64) != 0) return Textures.BlockIcons.FRESHFOAM; if ((mConnections & -128) != 0) return Textures.BlockIcons.HARDENEDFOAMS[mColor]; if ((mConnections & -64) != 0) return Textures.BlockIcons.ERROR_RENDERING; byte tConnections = mConnections; if (tConnections == 1 || tConnections == 2) tConnections = 3; else if (tConnections == 4 || tConnections == 8) tConnections = 12; else if (tConnections == 16 || tConnections == 32) tConnections = 48; if (hasValidMetaTileEntity()) return mMetaTileEntity.getTexture(this, aSide, tConnections, (byte)(mColor-1), tConnections == 0 || (tConnections & (1<0); return Textures.BlockIcons.ERROR_RENDERING;} + + protected boolean hasValidMetaTileEntity() {return mMetaTileEntity != null && mMetaTileEntity.getBaseMetaTileEntity() == this;} + protected boolean canAccessData() {return !isDead && hasValidMetaTileEntity();} + + @Override + public void doExplosion(long aAmount) { + if (canAccessData()) { + mMetaTileEntity.onExplosion(); + mMetaTileEntity.doExplosion(aAmount); + } + } + + @Override + public ArrayList getDrops() { + ItemStack rStack = new ItemStack(GregTech_API.sBlockMachines, 1, mID); + NBTTagCompound tNBT = new NBTTagCompound(); + if (mStrongRedstone > 0) tNBT.setByte ("mStrongRedstone" , mStrongRedstone); + for (byte i = 0; i < mCoverSides.length; i++) { + if (mCoverSides[i] != 0) { + tNBT.setIntArray("mCoverData" , mCoverData); + tNBT.setIntArray("mCoverSides" , mCoverSides); + break; + } + } + if (hasValidMetaTileEntity()) mMetaTileEntity.setItemNBT(tNBT); + if (!tNBT.hasNoTags()) rStack.setTagCompound(tNBT); + return new ArrayList(Arrays.asList(rStack)); + } + + @Override + public boolean onRightclick(EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) { + if (isClientSide()) { + if (getCoverBehaviorAtSide(aSide).onCoverRightclickClient(aSide, this, aPlayer, aX, aY, aZ)) return true; + } + if (isServerSide()) { + ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem(); + if (tCurrentItem != null) { + if (getColorization() >= 0 && GT_Utility.areStacksEqual(new ItemStack(Items.water_bucket, 1), tCurrentItem)) { + tCurrentItem.func_150996_a(Items.bucket); + setColorization((byte)-1); + return true; + } + byte tSide = GT_Utility.determineWrenchingSide(aSide, aX, aY, aZ); + if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sWrenchList)) { + if (mMetaTileEntity.onWrenchRightClick(aSide, tSide, aPlayer, aX, aY, aZ)) { + GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer); + GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(100), 1.0F, -1, xCoord, yCoord, zCoord); + } + return true; + } + if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sScrewdriverList)) { + if (getCoverIDAtSide(aSide) == 0 && getCoverIDAtSide(tSide) != 0) { + if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 200, aPlayer)) { + setCoverDataAtSide(tSide, getCoverBehaviorAtSide(tSide).onCoverScrewdriverclick(tSide, getCoverIDAtSide(tSide), getCoverDataAtSide(tSide), this, aPlayer, 0.5F, 0.5F, 0.5F)); + mMetaTileEntity.onScrewdriverRightClick(tSide, aPlayer, aX, aY, aZ); + GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(100), 1.0F, -1, xCoord, yCoord, zCoord); + } + } else { + if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) { + setCoverDataAtSide(aSide, getCoverBehaviorAtSide(aSide).onCoverScrewdriverclick(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this, aPlayer, aX, aY, aZ)); + mMetaTileEntity.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ); + GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(100), 1.0F, -1, xCoord, yCoord, zCoord); + } + } + return true; + } + + if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sHardHammerList)) { + //if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) { + // GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(1), 1.0F, -1, xCoord, yCoord, zCoord); + //} + return true; + } + + if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sSoftHammerList)) { + if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) { + if (mWorks) disableWorking(); else enableWorking(); + GT_Utility.sendChatToPlayer(aPlayer, "Machine Processing: " + (isAllowedToWork()?"Enabled":"Disabled")); + GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(101), 1.0F, -1, xCoord, yCoord, zCoord); + } + return true; + } + + if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sSolderingToolList)) { + if (GT_ModHandler.useSolderingIron(tCurrentItem, aPlayer)) { + mStrongRedstone ^= (1 << tSide); + GT_Utility.sendChatToPlayer(aPlayer, "Redstone Output at Side " + tSide + " set to: " + ((mStrongRedstone & (1 << tSide))!=0?"Strong":"Weak")); + GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(103), 3.0F, -1, xCoord, yCoord, zCoord); + } + return true; + } + + byte cSide = tSide; + if (getCoverIDAtSide(aSide) != 0) cSide = aSide; + + if (getCoverIDAtSide(cSide) == 0) { + if (GregTech_API.sCovers.containsKey(new GT_ItemStack(tCurrentItem))) { + if (GregTech_API.getCoverBehavior(tCurrentItem).isCoverPlaceable(cSide, new GT_ItemStack(tCurrentItem), this) && mMetaTileEntity.allowCoverOnSide(cSide, new GT_ItemStack(tCurrentItem))) { + setCoverItemAtSide(cSide, tCurrentItem); + if (!aPlayer.capabilities.isCreativeMode) tCurrentItem.stackSize--; + GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(100), 1.0F, -1, xCoord, yCoord, zCoord); + } + return true; + } + } else { + if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sCrowbarList)) { + if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) { + GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(0), 1.0F, -1, xCoord, yCoord, zCoord); + dropCover(cSide, aSide, false); + } + return true; + } + } + } + + if (getCoverBehaviorAtSide(aSide).onCoverRightclick(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this, aPlayer, aX, aY, aZ)) return true; + } + + if (!getCoverBehaviorAtSide(aSide).isGUIClickable(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this)) return false; + + try { + if (hasValidMetaTileEntity()) return mMetaTileEntity.onRightclick(this, aPlayer, aSide, aX, aY, aZ); + } catch(Throwable e) { + GT_Log.err.println("Encountered Exception while rightclicking TileEntity, the Game should've crashed now, but I prevented that. Please report immidietly to GregTech Intergalactical!!!"); + e.printStackTrace(GT_Log.err); + } + + return false; + } + + @Override + public void onLeftclick(EntityPlayer aPlayer) { + try { + if (aPlayer != null && hasValidMetaTileEntity()) mMetaTileEntity.onLeftclick(this, aPlayer); + } catch(Throwable e) { + GT_Log.err.println("Encountered Exception while leftclicking TileEntity, the Game should've crashed now, but I prevented that. Please report immidietly to GregTech Intergalactical!!!"); + e.printStackTrace(GT_Log.err); + } + } + + @Override + public boolean isDigitalChest() { + return false; + } + + @Override + public ItemStack[] getStoredItemData() { + return null; + } + + @Override + public void setItemCount(int aCount) { + // + } + + @Override + public int getMaxItemCount() { + return 0; + } + + /** + * Can put aStack into Slot + */ + @Override + public boolean isItemValidForSlot(int aIndex, ItemStack aStack) { + return canAccessData() && mMetaTileEntity.isItemValidForSlot(aIndex, aStack); + } + + /** + * returns all valid Inventory Slots, no matter which Side (Unless it's covered). + * The Side Stuff is done in the following two Functions. + */ + @Override + public int[] getAccessibleSlotsFromSide(int aSide) { + if (canAccessData() && (getCoverBehaviorAtSide((byte)aSide).letsItemsOut((byte)aSide, getCoverIDAtSide((byte)aSide), getCoverDataAtSide((byte)aSide), -1, this) || getCoverBehaviorAtSide((byte)aSide).letsItemsIn((byte)aSide, getCoverIDAtSide((byte)aSide), getCoverDataAtSide((byte)aSide), -1, this))) return mMetaTileEntity.getAccessibleSlotsFromSide(aSide); + return new int[0]; + } + + /** + * Can put aStack into Slot at Side + */ + @Override + public boolean canInsertItem(int aIndex, ItemStack aStack, int aSide) { + return canAccessData() && getCoverBehaviorAtSide((byte)aSide).letsItemsIn ((byte)aSide, getCoverIDAtSide((byte)aSide), getCoverDataAtSide((byte)aSide), aIndex, this) && mMetaTileEntity.canInsertItem(aIndex, aStack, aSide); + } + + /** + * Can pull aStack out of Slot from Side + */ + @Override + public boolean canExtractItem(int aIndex, ItemStack aStack, int aSide) { + return canAccessData() && getCoverBehaviorAtSide((byte)aSide).letsItemsOut((byte)aSide, getCoverIDAtSide((byte)aSide), getCoverDataAtSide((byte)aSide), aIndex, this) && mMetaTileEntity.canExtractItem(aIndex, aStack, aSide); + } + + @Override + public boolean isUpgradable() { + return false; + } + + @Override + public byte getInternalInputRedstoneSignal(byte aSide) { + return (byte)(getCoverBehaviorAtSide(aSide).getRedstoneInput(aSide, getInputRedstoneSignal(aSide), getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this)&15); + } + + @Override + public byte getInputRedstoneSignal(byte aSide) { + return (byte)(worldObj.getIndirectPowerLevelTo(getOffsetX(aSide, 1), getOffsetY(aSide, 1), getOffsetZ(aSide, 1), aSide)&15); + } + + @Override + public byte getOutputRedstoneSignal(byte aSide) { + return (byte)(getCoverBehaviorAtSide(aSide).manipulatesSidedRedstoneOutput(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this) || (getCoverBehaviorAtSide(aSide).letsRedstoneGoOut(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this))?mSidedRedstone[aSide]&15:0); + } + + @Override + public void setInternalOutputRedstoneSignal(byte aSide, byte aStrength) { + if (!getCoverBehaviorAtSide(aSide).manipulatesSidedRedstoneOutput(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this)) setOutputRedstoneSignal(aSide, aStrength); + } + + @Override + public void setOutputRedstoneSignal(byte aSide, byte aStrength) { + aStrength = (byte)Math.min(Math.max(0, aStrength), 15); + if (aSide >= 0 && aSide < 6 && mSidedRedstone[aSide] != aStrength) { + mSidedRedstone[aSide] = aStrength; + issueBlockUpdate(); + } + } + + @Override + public boolean isSteamEngineUpgradable() { + return isUpgradable()&&!hasSteamEngineUpgrade()&&getSteamCapacity()>0; + } + + @Override + public boolean addSteamEngineUpgrade() { + if (isSteamEngineUpgradable()) { + issueBlockUpdate(); + return true; + } + return false; + } + + @Override + public boolean hasSteamEngineUpgrade() { + return false; + } + + @Override + public boolean hasInventoryBeenModified() { + return mInventoryChanged; + } + + @Override + public void setGenericRedstoneOutput(boolean aOnOff) { + // + } + + @Override + public int getErrorDisplayID() { + return 0; + } + + @Override + public void setErrorDisplayID(int aErrorID) { + // + } + + @Override + public IMetaTileEntity getMetaTileEntity() { + return hasValidMetaTileEntity()?mMetaTileEntity:null; + } + + private final GT_CoverBehavior[] mCoverBehaviors = new GT_CoverBehavior[] {GregTech_API.sNoBehavior, GregTech_API.sNoBehavior, GregTech_API.sNoBehavior, GregTech_API.sNoBehavior, GregTech_API.sNoBehavior, GregTech_API.sNoBehavior}; + + @Override + public GT_CoverBehavior getCoverBehaviorAtSide(byte aSide) { + return aSide >= 0 && aSide < mCoverBehaviors.length ? mCoverBehaviors[aSide] : GregTech_API.sNoBehavior; + } + + @Override + public void setCoverIDAtSide(byte aSide, int aID) { + if (aSide >= 0 && aSide < 6) { + mCoverSides[aSide] = aID; + mCoverData[aSide] = 0; + mCoverBehaviors[aSide] = GregTech_API.getCoverBehavior(aID); + issueCoverUpdate(aSide); + issueBlockUpdate(); + } + } + + @Override + public void setCoverItemAtSide(byte aSide, ItemStack aCover) { + GregTech_API.getCoverBehavior(aCover).placeCover(aSide, aCover, this); + } + + @Override + public int getCoverIDAtSide(byte aSide) { + if (aSide >= 0 && aSide < 6) return mCoverSides[aSide]; return 0; + } + + @Override + public ItemStack getCoverItemAtSide(byte aSide) { + return GT_Utility.intToStack(getCoverIDAtSide(aSide)); + } + + @Override + public boolean canPlaceCoverIDAtSide(byte aSide, int aID) { + return getCoverIDAtSide(aSide) == 0; + } + + @Override + public boolean canPlaceCoverItemAtSide(byte aSide, ItemStack aCover) { + return getCoverIDAtSide(aSide) == 0; + } + + @Override + public void setCoverDataAtSide(byte aSide, int aData) { + if (aSide >= 0 && aSide < 6) mCoverData[aSide] = aData; + } + + @Override + public int getCoverDataAtSide(byte aSide) { + if (aSide >= 0 && aSide < 6) return mCoverData[aSide]; + return 0; + } + + @Override + public void setLightValue(byte aLightValue) { + // + } + + @Override + public long getAverageElectricInput() { + return 0; + } + + @Override + public long getAverageElectricOutput() { + return 0; + } + + @Override + public boolean dropCover(byte aSide, byte aDroppedSide, boolean aForced) { + if (getCoverBehaviorAtSide(aSide).onCoverRemoval(aSide, getCoverIDAtSide(aSide), mCoverData[aSide], this, aForced) || aForced) { + ItemStack tStack = getCoverBehaviorAtSide(aSide).getDrop(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this); + if (tStack != null) { + tStack.setTagCompound(null); + EntityItem tEntity = new EntityItem(worldObj, getOffsetX(aDroppedSide, 1) + 0.5, getOffsetY(aDroppedSide, 1) + 0.5, getOffsetZ(aDroppedSide, 1) + 0.5, tStack); + tEntity.motionX = 0; + tEntity.motionY = 0; + tEntity.motionZ = 0; + worldObj.spawnEntityInWorld(tEntity); + } + + setCoverIDAtSide(aSide, 0); + setOutputRedstoneSignal(aSide, (byte) 0); + return true; + } + return false; + } + + @Override + public String getOwnerName() { + return "Player"; + } + + @Override + public String setOwnerName(String aName) { + return "Player"; + } + + @Override + public byte getComparatorValue(byte aSide) { + return canAccessData()?mMetaTileEntity.getComparatorValue(aSide):0; + } + + @Override + public byte getStrongOutputRedstoneSignal(byte aSide) { + return aSide>=0&&aSide<6&&(mStrongRedstone & (1 << aSide))!=0?(byte)(mSidedRedstone[aSide]&15):0; + } + + @Override + public void setStrongOutputRedstoneSignal(byte aSide, byte aStrength) { + mStrongRedstone |= (1 << aSide); + setOutputRedstoneSignal(aSide, aStrength); + } + + @Override + public ItemStack decrStackSize(int aIndex, int aAmount) { + if (canAccessData()) { + mInventoryChanged = true; + return mMetaTileEntity.decrStackSize(aIndex, aAmount); + } + return null; + } + + @Override + public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage) { + if (canAccessData()) return mMetaTileEntity.injectEnergyUnits(aSide, aVoltage, aAmperage); + return 0; + } + + @Override + public boolean drainEnergyUnits(byte aSide, long aVoltage, long aAmperage) { + return false; + } + + @Override + public boolean acceptsRotationalEnergy(byte aSide) { + if (!canAccessData() || getCoverIDAtSide(aSide) != 0) return false; + return mMetaTileEntity.acceptsRotationalEnergy(aSide); + } + + @Override + public boolean injectRotationalEnergy(byte aSide, long aSpeed, long aEnergy) { + if (!canAccessData() || getCoverIDAtSide(aSide) != 0) return false; + return mMetaTileEntity.injectRotationalEnergy(aSide, aSpeed, aEnergy); + } + + @Override + public int fill(ForgeDirection aSide, FluidStack aFluid, boolean doFill) { + if (mTickTimer > 5 && canAccessData() && (aSide == ForgeDirection.UNKNOWN || (mMetaTileEntity.isLiquidInput ((byte)aSide.ordinal()) && getCoverBehaviorAtSide((byte)aSide.ordinal()).letsFluidIn ((byte)aSide.ordinal(), getCoverIDAtSide((byte)aSide.ordinal()), getCoverDataAtSide((byte)aSide.ordinal()), aFluid==null?null:aFluid.getFluid(), this)))) return mMetaTileEntity.fill(aSide, aFluid, doFill); + return 0; + } + + @Override + public FluidStack drain(ForgeDirection aSide, int maxDrain, boolean doDrain) { + if (mTickTimer > 5 && canAccessData() && (aSide == ForgeDirection.UNKNOWN || (mMetaTileEntity.isLiquidOutput((byte)aSide.ordinal()) && getCoverBehaviorAtSide((byte)aSide.ordinal()).letsFluidOut((byte)aSide.ordinal(), getCoverIDAtSide((byte)aSide.ordinal()), getCoverDataAtSide((byte)aSide.ordinal()), mMetaTileEntity.getFluid()==null?null:mMetaTileEntity.getFluid().getFluid(), this)))) return mMetaTileEntity.drain(aSide, maxDrain, doDrain); + return null; + } + + @Override + public FluidStack drain(ForgeDirection aSide, FluidStack aFluid, boolean doDrain) { + if (mTickTimer > 5 && canAccessData() && (aSide == ForgeDirection.UNKNOWN || (mMetaTileEntity.isLiquidOutput((byte)aSide.ordinal()) && getCoverBehaviorAtSide((byte)aSide.ordinal()).letsFluidOut((byte)aSide.ordinal(), getCoverIDAtSide((byte)aSide.ordinal()), getCoverDataAtSide((byte)aSide.ordinal()), aFluid==null?null:aFluid.getFluid(), this)))) return mMetaTileEntity.drain(aSide, aFluid, doDrain); + return null; + } + + @Override + public boolean canFill(ForgeDirection aSide, Fluid aFluid) { + if (mTickTimer > 5 && canAccessData() && (aSide == ForgeDirection.UNKNOWN || (mMetaTileEntity.isLiquidInput ((byte)aSide.ordinal()) && getCoverBehaviorAtSide((byte)aSide.ordinal()).letsFluidIn ((byte)aSide.ordinal(), getCoverIDAtSide((byte)aSide.ordinal()), getCoverDataAtSide((byte)aSide.ordinal()), aFluid, this)))) return mMetaTileEntity.canFill(aSide, aFluid); + return false; + } + + @Override + public boolean canDrain(ForgeDirection aSide, Fluid aFluid) { + if (mTickTimer > 5 && canAccessData() && (aSide == ForgeDirection.UNKNOWN || (mMetaTileEntity.isLiquidOutput((byte)aSide.ordinal()) && getCoverBehaviorAtSide((byte)aSide.ordinal()).letsFluidOut((byte)aSide.ordinal(), getCoverIDAtSide((byte)aSide.ordinal()), getCoverDataAtSide((byte)aSide.ordinal()), aFluid, this)))) return mMetaTileEntity.canDrain(aSide, aFluid); + return false; + } + + @Override + public FluidTankInfo[] getTankInfo(ForgeDirection aSide) { + if (canAccessData() && (aSide == ForgeDirection.UNKNOWN || (mMetaTileEntity.isLiquidInput((byte)aSide.ordinal()) && getCoverBehaviorAtSide((byte)aSide.ordinal()).letsFluidIn ((byte)aSide.ordinal(), getCoverIDAtSide((byte)aSide.ordinal()), getCoverDataAtSide((byte)aSide.ordinal()), null, this)) || (mMetaTileEntity.isLiquidOutput((byte)aSide.ordinal()) && getCoverBehaviorAtSide((byte)aSide.ordinal()).letsFluidOut((byte)aSide.ordinal(), getCoverIDAtSide((byte)aSide.ordinal()), getCoverDataAtSide((byte)aSide.ordinal()), null, this)))) return mMetaTileEntity.getTankInfo(aSide); + return new FluidTankInfo[] {}; + } + + @Override + public boolean isInvalidTileEntity() { + return isInvalid(); + } + + @Override + public boolean addStackToSlot(int aIndex, ItemStack aStack) { + if (GT_Utility.isStackInvalid(aStack)) return true; + if (aIndex < 0 || aIndex >= getSizeInventory()) return false; + ItemStack tStack = getStackInSlot(aIndex); + if (GT_Utility.isStackInvalid(tStack)) { + setInventorySlotContents(aIndex, aStack); + return true; + } + aStack = GT_OreDictUnificator.get(aStack); + if (GT_Utility.areStacksEqual(tStack, aStack) && tStack.stackSize + aStack.stackSize <= Math.min(aStack.getMaxStackSize(), getInventoryStackLimit())) { + tStack.stackSize+=aStack.stackSize; + return true; + } + return false; + } + + @Override + public boolean addStackToSlot(int aIndex, ItemStack aStack, int aAmount) { + return addStackToSlot(aIndex, GT_Utility.copyAmount(aAmount, aStack)); + } + + @Override + public void setMetaTileEntity(IMetaTileEntity aMetaTileEntity) { + mMetaTileEntity = (MetaPipeEntity)aMetaTileEntity; + } + + @Override + public byte getColorization() { + return (byte)(mColor-1); + } + + @Override + public byte setColorization(byte aColor) { + if (aColor > 15 || aColor < -1) aColor = -1; + if (canAccessData()) mMetaTileEntity.onColorChangeServer(aColor); + return mColor = (byte)(aColor+1); + } + + @Override + public float getThickNess() { + if (canAccessData()) return mMetaTileEntity.getThickNess(); + return 1.0F; + } + + public boolean renderInside(byte aSide) { + if (canAccessData()) return mMetaTileEntity.renderInside(aSide); + return false; + } + + @Override + public float getBlastResistance(byte aSide) { + return (mConnections & 192) != 0 ? 50.0F : 5.0F; + } + + @Override + public boolean isMufflerUpgradable() { + return false; + } + + @Override + public boolean addMufflerUpgrade() { + return false; + } + + @Override + public boolean hasMufflerUpgrade() { + return false; + } + + @Override + public boolean isUniversalEnergyStored(long aEnergyAmount) { + return getUniversalEnergyStored() >= aEnergyAmount; + } + + @Override + public String[] getInfoData() { + {if (canAccessData()) return getMetaTileEntity().getInfoData(); return new String[]{};} + } + + @Override + public byte getConnections() { + return mConnections; + } + + @Override + public void markDirty() { + super.markDirty(); + mInventoryChanged = true; + } + + @Override + public int getLightOpacity() { + return mMetaTileEntity == null ? 0 : mMetaTileEntity.getLightOpacity(); + } + + @Override + public void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, List outputAABB, Entity collider) { + mMetaTileEntity.addCollisionBoxesToList(aWorld, aX, aY, aZ, inputAABB, outputAABB, collider); + } + + @Override + public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) { + return mMetaTileEntity.getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ); + } + + @Override + public void onEntityCollidedWithBlock(World aWorld, int aX, int aY, int aZ, Entity collider) { + mMetaTileEntity.onEntityCollidedWithBlock(aWorld, aX, aY, aZ, collider); + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java new file mode 100644 index 0000000..0d50cb0 --- /dev/null +++ b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java @@ -0,0 +1,1352 @@ +package gregtech.api.metatileentity; + +import static gregtech.api.enums.GT_Values.NW; +import static gregtech.api.enums.GT_Values.V; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IEnergyConnected; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.net.GT_Packet_TileEntity; +import gregtech.api.objects.GT_ItemStack; +import gregtech.api.util.GT_CoverBehavior; +import gregtech.api.util.GT_Log; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Utility; +import ic2.api.Direction; +import net.minecraft.block.Block; +import net.minecraft.block.BlockFire; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.network.Packet; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.EnumSkyBlock; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTankInfo; + +/** + * NEVER INCLUDE THIS FILE IN YOUR MOD!!! + * + * This is the main TileEntity for EVERYTHING. + */ +public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileEntity { + protected MetaTileEntity mMetaTileEntity; + protected long mStoredEnergy = 0, mStoredSteam = 0; + protected int mAverageEUInputIndex = 0, mAverageEUOutputIndex = 0; + protected boolean mReleaseEnergy = false; + protected int[] mAverageEUInput = new int[] {0,0,0,0,0}, mAverageEUOutput = new int[] {0,0,0,0,0}; + + private boolean[] mActiveEUInputs = new boolean[] {false, false, false, false, false, false}, mActiveEUOutputs = new boolean[] {false, false, false, false, false, false}; + private byte[] mSidedRedstone = new byte[] {15,15,15,15,15,15}; + private int[] mCoverSides = new int[] {0,0,0,0,0,0}, mCoverData = new int[] {0,0,0,0,0,0}, mTimeStatistics = new int[GregTech_API.TICKS_FOR_LAG_AVERAGING]; + private boolean mHasEnoughEnergy = true, mRunningThroughTick = false, mInputDisabled = false, mOutputDisabled = false, mMuffler = false, mLockUpgrade = false, mActive = false, mRedstone = false, mWorkUpdate = false, mSteamConverter = false, mInventoryChanged = false, mWorks = true, mNeedsUpdate = true, mNeedsBlockUpdate = true, mSendClientData = false, oRedstone = false; + private byte mColor = 0, oColor = 0, mStrongRedstone = 0, oRedstoneData = 63, oTextureData = 0, oUpdateData = 0, oLightValueClient = -1, oLightValue = -1, mLightValue = 0, mOtherUpgrades = 0, mFacing = 0, oFacing = 0, mWorkData = 0; + private int mDisplayErrorCode = 0, oX = 0, oY = 0, oZ = 0, mTimeStatisticsIndex = 0, mLagWarningCount = 0; + private short mID = 0; + private long mTickTimer = 0, oOutput = 0, mAcceptedAmperes = Long.MAX_VALUE; + private String mOwnerName = ""; + private NBTTagCompound mRecipeStuff = new NBTTagCompound(); + + public BaseMetaTileEntity() {} + + @Override + public void writeToNBT(NBTTagCompound aNBT) { + try { + super.writeToNBT(aNBT); + } catch(Throwable e) { + GT_Log.err.println("Encountered CRITICAL ERROR while saving MetaTileEntity, the Chunk whould've been corrupted by now, but I prevented that. Please report immidietly to GregTech Intergalactical!!!"); + e.printStackTrace(GT_Log.err); + } + try { + aNBT.setInteger ("mID" , mID); + aNBT.setLong ("mStoredSteam" , mStoredSteam); + aNBT.setLong ("mStoredEnergy" , mStoredEnergy); + aNBT.setIntArray ("mCoverData" , mCoverData); + aNBT.setIntArray ("mCoverSides" , mCoverSides); + aNBT.setByteArray ("mRedstoneSided" , mSidedRedstone); + aNBT.setByte ("mColor" , mColor); + aNBT.setByte ("mLightValue" , mLightValue); + aNBT.setByte ("mOtherUpgrades" , mOtherUpgrades); + aNBT.setByte ("mWorkData" , mWorkData); + aNBT.setByte ("mStrongRedstone" , mStrongRedstone); + aNBT.setShort ("mFacing" , mFacing); + aNBT.setString ("mOwnerName" , mOwnerName); + aNBT.setBoolean ("mLockUpgrade" , mLockUpgrade); + aNBT.setBoolean ("mMuffler" , mMuffler); + aNBT.setBoolean ("mSteamConverter" , mSteamConverter); + aNBT.setBoolean ("mActive" , mActive); + aNBT.setBoolean ("mRedstone" , mRedstone); + aNBT.setBoolean ("mWorks" , !mWorks); + aNBT.setBoolean ("mInputDisabled" , mInputDisabled); + aNBT.setBoolean ("mOutputDisabled" , mOutputDisabled); + aNBT.setTag ("GT.CraftingComponents", mRecipeStuff); + } catch(Throwable e) { + GT_Log.err.println("Encountered CRITICAL ERROR while saving MetaTileEntity, the Chunk whould've been corrupted by now, but I prevented that. Please report immidietly to GregTech Intergalactical!!!"); + e.printStackTrace(GT_Log.err); + } + try { + if (hasValidMetaTileEntity()) { + NBTTagList tItemList = new NBTTagList(); + for (int i = 0; i < mMetaTileEntity.getRealInventory().length; i++) { + ItemStack tStack = mMetaTileEntity.getRealInventory()[i]; + if (tStack != null) { + NBTTagCompound tTag = new NBTTagCompound(); + tTag.setInteger("IntSlot", i); + tStack.writeToNBT(tTag); + tItemList.appendTag(tTag); + } + } + aNBT.setTag("Inventory", tItemList); + + try { + mMetaTileEntity.saveNBTData(aNBT); + } catch(Throwable e) { + GT_Log.err.println("Encountered CRITICAL ERROR while saving MetaTileEntity, the Chunk whould've been corrupted by now, but I prevented that. Please report immidietly to GregTech Intergalactical!!!"); + e.printStackTrace(GT_Log.err); + } + } + } catch(Throwable e) { + GT_Log.err.println("Encountered CRITICAL ERROR while saving MetaTileEntity, the Chunk whould've been corrupted by now, but I prevented that. Please report immidietly to GregTech Intergalactical!!!"); + e.printStackTrace(GT_Log.err); + } + } + + @Override + public void readFromNBT(NBTTagCompound aNBT) { + super.readFromNBT(aNBT); + setInitialValuesAsNBT(aNBT, (short)0); + } + + @Override + public void setInitialValuesAsNBT(NBTTagCompound aNBT, short aID) { + if (aNBT == null) { + if (aID>0) mID=aID; else mID=mID>0?mID:0; + if (mID!=0) createNewMetatileEntity(mID); + mSidedRedstone = (hasValidMetaTileEntity()&&mMetaTileEntity.hasSidedRedstoneOutputBehavior()?new byte[] {0,0,0,0,0,0}:new byte[] {15,15,15,15,15,15}); + } else { + if (aID<=0) mID = (short)aNBT.getInteger ("mID"); else mID = aID; + mStoredSteam = aNBT.getInteger ("mStoredSteam"); + mStoredEnergy = aNBT.getInteger ("mStoredEnergy"); + mColor = aNBT.getByte ("mColor"); + mLightValue = aNBT.getByte ("mLightValue"); + mWorkData = aNBT.getByte ("mWorkData"); + mStrongRedstone = aNBT.getByte ("mStrongRedstone"); + mFacing = oFacing = (byte)aNBT.getShort("mFacing"); + mOwnerName = aNBT.getString ("mOwnerName"); + mLockUpgrade = aNBT.getBoolean ("mLockUpgrade"); + mMuffler = aNBT.getBoolean ("mMuffler"); + mSteamConverter = aNBT.getBoolean ("mSteamConverter"); + mActive = aNBT.getBoolean ("mActive"); + mRedstone = aNBT.getBoolean ("mRedstone"); + mWorks =!aNBT.getBoolean ("mWorks"); + mInputDisabled = aNBT.getBoolean ("mInputDisabled"); + mOutputDisabled = aNBT.getBoolean ("mOutputDisabled"); + mOtherUpgrades = (byte)(aNBT.getByte("mOtherUpgrades")+aNBT.getByte("mBatteries")+aNBT.getByte("mLiBatteries")); + mCoverSides = aNBT.getIntArray ("mCoverSides"); + mCoverData = aNBT.getIntArray ("mCoverData"); + mSidedRedstone = aNBT.getByteArray ("mRedstoneSided"); + mRecipeStuff = aNBT.getCompoundTag("GT.CraftingComponents"); + + if (mCoverData.length != 6) mCoverData = new int[] { 0, 0, 0, 0, 0, 0}; + if (mCoverSides.length != 6) mCoverSides = new int[] { 0, 0, 0, 0, 0, 0}; + if (mSidedRedstone.length != 6) if (hasValidMetaTileEntity() && mMetaTileEntity.hasSidedRedstoneOutputBehavior()) mSidedRedstone = new byte[] {0,0,0,0,0,0}; else mSidedRedstone = new byte[] {15,15,15,15,15,15}; + + for (byte i = 0; i < 6; i++) mCoverBehaviors[i] = GregTech_API.getCoverBehavior(mCoverSides[i]); + + if (mID!=0 && createNewMetatileEntity(mID)) { + NBTTagList tItemList = aNBT.getTagList("Inventory", 10); + for (int i = 0; i < tItemList.tagCount(); i++) { + NBTTagCompound tTag = tItemList.getCompoundTagAt(i); + int tSlot = tTag.getInteger("IntSlot"); + if (tSlot >= 0 && tSlot < mMetaTileEntity.getRealInventory().length) { + mMetaTileEntity.getRealInventory()[tSlot] = GT_Utility.loadItem(tTag); + } + } + + try { + mMetaTileEntity.loadNBTData(aNBT); + } catch(Throwable e) { + GT_Log.err.println("Encountered Exception while loading MetaTileEntity, the Server should've crashed now, but I prevented that. Please report immidietly to GregTech Intergalactical!!!"); + e.printStackTrace(GT_Log.err); + } + } + } + + if (mCoverData.length != 6) mCoverData = new int[] { 0, 0, 0, 0, 0, 0}; + if (mCoverSides.length != 6) mCoverSides = new int[] { 0, 0, 0, 0, 0, 0}; + if (mSidedRedstone.length != 6) if (hasValidMetaTileEntity() && mMetaTileEntity.hasSidedRedstoneOutputBehavior()) mSidedRedstone = new byte[] {0,0,0,0,0,0}; else mSidedRedstone = new byte[] {15,15,15,15,15,15}; + + for (byte i = 0; i < 6; i++) mCoverBehaviors[i] = GregTech_API.getCoverBehavior(mCoverSides[i]); + } + + private boolean createNewMetatileEntity(short aID) { + if (aID <= 0 || aID >= GregTech_API.METATILEENTITIES.length || GregTech_API.METATILEENTITIES[aID] == null) { + GT_Log.err.println("MetaID " + aID + " not loadable => locking TileEntity!"); + } else { + if (aID != 0) { + if (hasValidMetaTileEntity()) mMetaTileEntity.setBaseMetaTileEntity(null); + GregTech_API.METATILEENTITIES[aID].newMetaEntity(this).setBaseMetaTileEntity(this); + mTickTimer = 0; + mID = aID; + return true; + } + } + return false; + } + + /** + * Used for ticking special BaseMetaTileEntities, which need that for Energy Conversion + * It's called right before onPostTick() + */ + public void updateStatus() { + // + } + + /** + * Called when trying to charge Items + */ + public void chargeItem(ItemStack aStack) { + decreaseStoredEU(GT_ModHandler.chargeElectricItem(aStack, (int)Math.min(Integer.MAX_VALUE, getStoredEU()), (int)Math.min(Integer.MAX_VALUE, mMetaTileEntity.getOutputTier()), false, false), true); + } + + /** + * Called when trying to discharge Items + */ + public void dischargeItem(ItemStack aStack) { + increaseStoredEnergyUnits(GT_ModHandler.dischargeElectricItem(aStack, (int)Math.min(Integer.MAX_VALUE, getEUCapacity() - getStoredEU()), (int)Math.min(Integer.MAX_VALUE, mMetaTileEntity.getInputTier()), false, false, false), true); + } + + @Override + public void updateEntity() { + super.updateEntity(); + + if (!hasValidMetaTileEntity()) { + if (mMetaTileEntity == null) return; + mMetaTileEntity.setBaseMetaTileEntity(this); + } + + mRunningThroughTick = true; + long tTime = System.currentTimeMillis(); + + for (int tCode = 0; hasValidMetaTileEntity() && tCode >= 0;) {try {switch (tCode) { + case 0: + tCode++; + if (mTickTimer++==0) { + oX = xCoord; + oY = yCoord; + oZ = zCoord; + if (isServerSide()) for (byte i = 0; i < 6; i++) if (getCoverIDAtSide(i)!=0) if (!mMetaTileEntity.allowCoverOnSide(i, new GT_ItemStack(getCoverIDAtSide(i)))) dropCover(i, i, true); + + worldObj.markTileEntityChunkModified(xCoord, yCoord, zCoord, this); + + mMetaTileEntity.onFirstTick(this); + if (!hasValidMetaTileEntity()) { + mRunningThroughTick = false; + return; + } + } + case 1: + tCode++; + if (isClientSide()) { + if (mColor != oColor) { + mMetaTileEntity.onColorChangeClient(oColor = mColor); + issueTextureUpdate(); + } + + if (mLightValue != oLightValueClient) { + worldObj.setLightValue (EnumSkyBlock.Block, xCoord , yCoord , zCoord , mLightValue); + worldObj.updateLightByType(EnumSkyBlock.Block, xCoord , yCoord , zCoord ); + worldObj.updateLightByType(EnumSkyBlock.Block, xCoord+1, yCoord , zCoord ); + worldObj.updateLightByType(EnumSkyBlock.Block, xCoord-1, yCoord , zCoord ); + worldObj.updateLightByType(EnumSkyBlock.Block, xCoord , yCoord+1, zCoord ); + worldObj.updateLightByType(EnumSkyBlock.Block, xCoord , yCoord-1, zCoord ); + worldObj.updateLightByType(EnumSkyBlock.Block, xCoord , yCoord , zCoord+1); + worldObj.updateLightByType(EnumSkyBlock.Block, xCoord , yCoord , zCoord-1); + oLightValueClient = mLightValue; + issueTextureUpdate(); + } + + if (mNeedsUpdate) { + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + //worldObj.func_147479_m(xCoord, yCoord, zCoord); + mNeedsUpdate = false; + } + } + case 2: case 3: case 4: case 5: case 6: case 7: + if (isServerSide() && mTickTimer > 10) { + for (byte i = (byte)(tCode-2); i < 6; i++) if (getCoverIDAtSide(i) != 0) { + tCode++; + GT_CoverBehavior tCover = getCoverBehaviorAtSide(i); + int tCoverTickRate = tCover.getTickRate(i, getCoverIDAtSide(i), mCoverData[i], this); + if (tCoverTickRate > 0 && mTickTimer % tCoverTickRate == 0) { + mCoverData[i] = tCover.doCoverThings(i, getInputRedstoneSignal(i), getCoverIDAtSide(i), mCoverData[i], this, mTickTimer); + if (!hasValidMetaTileEntity()) { + mRunningThroughTick = false; + return; + } + } + } + + } + case 8: + tCode=9; + if (isServerSide()) { + if (++mAverageEUInputIndex >= mAverageEUInput.length ) mAverageEUInputIndex = 0; + if (++mAverageEUOutputIndex >= mAverageEUOutput.length) mAverageEUOutputIndex = 0; + + mAverageEUInput [mAverageEUInputIndex ] = 0; + mAverageEUOutput[mAverageEUOutputIndex] = 0; + } + case 9: + tCode++; + mMetaTileEntity.onPreTick(this, mTickTimer); + if (!hasValidMetaTileEntity()) { + mRunningThroughTick = false; + return; + } + case 10: + tCode++; + if (isServerSide()) { + if (mRedstone != oRedstone || mTickTimer == 10) { + for (byte i = 0; i < 6; i++) mCoverBehaviors[i] = GregTech_API.getCoverBehavior(mCoverSides[i]); + oRedstone = mRedstone; + issueBlockUpdate(); + } + + if (xCoord != oX || yCoord != oY || zCoord != oZ) { + oX = xCoord; + oY = yCoord; + oZ = zCoord; + issueClientUpdate(); + clearTileEntityBuffer(); + } + + if (mFacing != oFacing) { + oFacing = mFacing; + for (byte i = 0; i < 6; i++) if (getCoverIDAtSide(i)!=0) if (!mMetaTileEntity.allowCoverOnSide(i, new GT_ItemStack(getCoverIDAtSide(i)))) dropCover(i, i, true); + issueBlockUpdate(); + } + + if (mTickTimer > 20 && mMetaTileEntity.isElectric()) { + mAcceptedAmperes = 0; + + if (getOutputVoltage() != oOutput) { + oOutput = getOutputVoltage(); + } + + if (mMetaTileEntity.isEnetOutput() || mMetaTileEntity.isEnetInput()) { + for (byte i = 0; i < 6; i++) { + boolean + temp = isEnergyInputSide(i); + if (temp != mActiveEUInputs[i]) { + mActiveEUInputs[i] = temp; + } + temp = isEnergyOutputSide(i); + if (temp != mActiveEUOutputs[i]) { + mActiveEUOutputs[i] = temp; + } + } + } + + if (mMetaTileEntity.isEnetOutput() && oOutput > 0) { + long tOutputVoltage = Math.max(oOutput, oOutput + (1 << GT_Utility.getTier(oOutput))), tUsableAmperage = Math.min(getOutputAmperage(), (getStoredEU() - mMetaTileEntity.getMinimumStoredEU()) / tOutputVoltage); + if (tUsableAmperage > 0) { + long tEU = tOutputVoltage * IEnergyConnected.Util.emitEnergyToNetwork(oOutput, tUsableAmperage, this); + mAverageEUOutput[mAverageEUOutputIndex] += tEU; + decreaseStoredEU(tEU, true); + } + } + if (getEUCapacity() > 0) { + if (GregTech_API.sMachineFireExplosions && getRandomNumber(1000) == 0) { + Block tBlock = getBlockAtSide((byte)getRandomNumber(6)); + if (tBlock != null && tBlock instanceof BlockFire) doEnergyExplosion(); + } + + if (!hasValidMetaTileEntity()) { + mRunningThroughTick = false; + return; + } + + if (getRandomNumber(1000) == 0) { + if((getCoverIDAtSide((byte)1) == 0 && worldObj.getPrecipitationHeight(xCoord , zCoord ) - 2 < yCoord) + || (getCoverIDAtSide((byte)2) == 0 && worldObj.getPrecipitationHeight(xCoord , zCoord-1) - 1 < yCoord) + || (getCoverIDAtSide((byte)3) == 0 && worldObj.getPrecipitationHeight(xCoord , zCoord+1) - 1 < yCoord) + || (getCoverIDAtSide((byte)4) == 0 && worldObj.getPrecipitationHeight(xCoord-1, zCoord ) - 1 < yCoord) + || (getCoverIDAtSide((byte)5) == 0 && worldObj.getPrecipitationHeight(xCoord+1, zCoord ) - 1 < yCoord)) { + if (GregTech_API.sMachineRainExplosions && worldObj.isRaining() && getBiome().rainfall > 0) { + if (getRandomNumber(10)==0) {doEnergyExplosion(); + }else setOnFire(); + } + if (!hasValidMetaTileEntity()) { + mRunningThroughTick = false; + return; + } + if (GregTech_API.sMachineThunderExplosions && worldObj.isThundering() && getBiome().rainfall > 0 && getRandomNumber(3) == 0) { + doEnergyExplosion(); + } + } + } + } + } + + if (!hasValidMetaTileEntity()) { + mRunningThroughTick = false; + return; + } + } + case 11: + tCode++; + if (isServerSide()) { + if (mMetaTileEntity.dechargerSlotCount() > 0 && getStoredEU() < getEUCapacity()) { + for (int i = mMetaTileEntity.dechargerSlotStartIndex(), k = mMetaTileEntity.dechargerSlotCount()+i; i < k; i++) { + if (mMetaTileEntity.mInventory[i] != null && getStoredEU() < getEUCapacity()) { + dischargeItem(mMetaTileEntity.mInventory[i]); + if (mMetaTileEntity.mInventory[i].stackSize <= 0) mMetaTileEntity.mInventory[i] = null; + mInventoryChanged = true; + } + } + } + } + case 12: + tCode++; + if (isServerSide()) { + if (mMetaTileEntity.rechargerSlotCount() > 0 && getStoredEU() > 0) { + for (int i = mMetaTileEntity.rechargerSlotStartIndex(), k = mMetaTileEntity.rechargerSlotCount()+i; i < k; i++) { + if (getStoredEU() > 0 && mMetaTileEntity.mInventory[i] != null) { + chargeItem(mMetaTileEntity.mInventory[i]); + if (mMetaTileEntity.mInventory[i].stackSize <= 0) mMetaTileEntity.mInventory[i] = null; + mInventoryChanged = true; + } + } + } + } + case 13: + tCode++; + updateStatus(); + if (!hasValidMetaTileEntity()) { + mRunningThroughTick = false; + return; + } + case 14: + tCode++; + mMetaTileEntity.onPostTick(this, mTickTimer); + if (!hasValidMetaTileEntity()) { + mRunningThroughTick = false; + return; + } + case 15: + tCode++; + if (isServerSide()) { + if (mTickTimer % 10 == 0) { + if (mSendClientData) { + NW.sendPacketToAllPlayersInRange(worldObj, new GT_Packet_TileEntity(xCoord, (short)yCoord, zCoord, mID, mCoverSides[0], mCoverSides[1], mCoverSides[2], mCoverSides[3], mCoverSides[4], mCoverSides[5], oTextureData = (byte)((mFacing&7) | (mActive?8:0) | (mRedstone?16:0) | (mLockUpgrade?32:0)), oUpdateData = hasValidMetaTileEntity()?mMetaTileEntity.getUpdateData():0, oRedstoneData = (byte)(((mSidedRedstone[0]>0)?1:0)|((mSidedRedstone[1]>0)?2:0)|((mSidedRedstone[2]>0)?4:0)|((mSidedRedstone[3]>0)?8:0)|((mSidedRedstone[4]>0)?16:0)|((mSidedRedstone[5]>0)?32:0)), oColor = mColor), xCoord, zCoord); + mSendClientData = false; + } + } + + if (mTickTimer > 10) { + byte tData = (byte)((mFacing&7)|(mActive?8:0)|(mRedstone?16:0)|(mLockUpgrade?32:0)); + if (tData != oTextureData) sendBlockEvent((byte)0, oTextureData = tData); + tData = mMetaTileEntity.getUpdateData(); + if (tData != oUpdateData) sendBlockEvent((byte)1, oUpdateData = tData); + if (mColor != oColor) sendBlockEvent((byte)2, oColor = mColor); + tData = (byte)(((mSidedRedstone[0]>0)?1:0)|((mSidedRedstone[1]>0)?2:0)|((mSidedRedstone[2]>0)?4:0)|((mSidedRedstone[3]>0)?8:0)|((mSidedRedstone[4]>0)?16:0)|((mSidedRedstone[5]>0)?32:0)); + if (tData != oRedstoneData) sendBlockEvent((byte)3, oRedstoneData = tData); + if (mLightValue != oLightValue) { + worldObj.setLightValue (EnumSkyBlock.Block, xCoord , yCoord , zCoord , mLightValue); + worldObj.updateLightByType(EnumSkyBlock.Block, xCoord , yCoord , zCoord ); + worldObj.updateLightByType(EnumSkyBlock.Block, xCoord+1, yCoord , zCoord ); + worldObj.updateLightByType(EnumSkyBlock.Block, xCoord-1, yCoord , zCoord ); + worldObj.updateLightByType(EnumSkyBlock.Block, xCoord , yCoord+1, zCoord ); + worldObj.updateLightByType(EnumSkyBlock.Block, xCoord , yCoord-1, zCoord ); + worldObj.updateLightByType(EnumSkyBlock.Block, xCoord , yCoord , zCoord+1); + worldObj.updateLightByType(EnumSkyBlock.Block, xCoord , yCoord , zCoord-1); + issueTextureUpdate(); + sendBlockEvent((byte)7, oLightValue = mLightValue); + } + } + + if (mNeedsBlockUpdate) { + worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, getBlockOffset(0, 0, 0)); + mNeedsBlockUpdate = false; + } + } + default: + tCode = -1; + break; + }} catch (Throwable e) { + GT_Log.err.println("Encountered Exception while ticking MetaTileEntity in Step "+(tCode-1)+". The Game should've crashed now, but I prevented that. Please report immidietly to GregTech Intergalactical!!!"); + e.printStackTrace(GT_Log.err); + }} + + if (isServerSide() && hasValidMetaTileEntity()) { + tTime = System.currentTimeMillis() - tTime; + if (mTimeStatistics.length > 0) mTimeStatistics[mTimeStatisticsIndex = (mTimeStatisticsIndex + 1) % mTimeStatistics.length] = (int)tTime; + if (tTime > 0 && tTime > GregTech_API.MILLISECOND_THRESHOLD_UNTIL_LAG_WARNING && mTickTimer > 1000 && getMetaTileEntity().doTickProfilingMessageDuringThisTick() && mLagWarningCount++<10) System.out.println("WARNING: Possible Lag Source at [" + xCoord + ", " + yCoord + ", " + zCoord + "] in Dimension " + worldObj.provider.dimensionId + " with " + tTime + "ms caused by an instance of " + getMetaTileEntity().getClass()); + } + + mWorkUpdate = mInventoryChanged = mRunningThroughTick = false; + } + + @Override + public Packet getDescriptionPacket() { + issueClientUpdate(); + return null; + } + + public final void receiveMetaTileEntityData(short aID, int aCover0, int aCover1, int aCover2, int aCover3, int aCover4, int aCover5, byte aTextureData, byte aUpdateData, byte aRedstoneData, byte aColorData) { + issueTextureUpdate(); + if (mID != aID && aID > 0) { + mID = aID; + createNewMetatileEntity(mID); + } + + mCoverSides[0] = aCover0; + mCoverSides[1] = aCover1; + mCoverSides[2] = aCover2; + mCoverSides[3] = aCover3; + mCoverSides[4] = aCover4; + mCoverSides[5] = aCover5; + + for (byte i = 0; i < 6; i++) mCoverBehaviors[i] = GregTech_API.getCoverBehavior(mCoverSides[i]); + + receiveClientEvent(0, aTextureData); + receiveClientEvent(1, aUpdateData); + receiveClientEvent(2, aColorData); + receiveClientEvent(3, aRedstoneData); + } + + @Override + public boolean receiveClientEvent(int aEventID, int aValue) { + super.receiveClientEvent(aEventID, aValue); + + if (hasValidMetaTileEntity()) { + try { + mMetaTileEntity.receiveClientEvent((byte)aEventID, (byte)aValue); + } catch(Throwable e) { + GT_Log.err.println("Encountered Exception while receiving Data from the Server, the Client should've been crashed by now, but I prevented that. Please report immidietly to GregTech Intergalactical!!!"); + e.printStackTrace(GT_Log.err); + } + } + + if (isClientSide()) { + issueTextureUpdate(); + switch(aEventID) { + case 0: + mFacing = (byte)(aValue& 7); + mActive = ((aValue& 8) != 0); + mRedstone = ((aValue&16) != 0); + mLockUpgrade = ((aValue&32) != 0); + break; + case 1: + if (hasValidMetaTileEntity()) mMetaTileEntity.onValueUpdate((byte)aValue); + break; + case 2: + if (aValue > 16 || aValue < 0) aValue = 0; + mColor = (byte)aValue; + break; + case 3: + mSidedRedstone[0] = (byte)((aValue& 1)>0?15:0); + mSidedRedstone[1] = (byte)((aValue& 2)>0?15:0); + mSidedRedstone[2] = (byte)((aValue& 4)>0?15:0); + mSidedRedstone[3] = (byte)((aValue& 8)>0?15:0); + mSidedRedstone[4] = (byte)((aValue&16)>0?15:0); + mSidedRedstone[5] = (byte)((aValue&32)>0?15:0); + break; + case 4: + if (hasValidMetaTileEntity() && mTickTimer > 20) mMetaTileEntity.doSound((byte)aValue, xCoord+0.5, yCoord+0.5, zCoord+0.5); + break; + case 5: + if (hasValidMetaTileEntity() && mTickTimer > 20) mMetaTileEntity.startSoundLoop((byte)aValue, xCoord+0.5, yCoord+0.5, zCoord+0.5); + break; + case 6: + if (hasValidMetaTileEntity() && mTickTimer > 20) mMetaTileEntity.stopSoundLoop((byte)aValue, xCoord+0.5, yCoord+0.5, zCoord+0.5); + break; + case 7: + mLightValue = (byte)aValue; + break; + } + } + return true; + } + + public ArrayList getDebugInfo(EntityPlayer aPlayer, int aLogLevel) { + ArrayList tList = new ArrayList(); + if (aLogLevel > 2) { + tList.add("Meta-ID: " + mID + (canAccessData()?" valid":" invalid") + (mMetaTileEntity==null?" MetaTileEntity == null!":" ")); + } + if (aLogLevel > 1) { + if (mTimeStatistics.length > 0) { + double tAverageTime = 0; for (int tTime : mTimeStatistics) tAverageTime += tTime; + tList.add("This particular TileEntity has caused an average CPU-load of ~" + (tAverageTime/mTimeStatistics.length) + "ms over the last " + mTimeStatistics.length + " ticks."); + } + if (mLagWarningCount > 0) { + tList.add("This TileEntity has also caused " + (mLagWarningCount>=10?"more than 10":mLagWarningCount) + " Lag Spike Warnings (anything taking longer than " + GregTech_API.MILLISECOND_THRESHOLD_UNTIL_LAG_WARNING + "ms) on the Server."); + } + tList.add("Is" + (mMetaTileEntity.isAccessAllowed(aPlayer)?" ":" not ") + "accessible for you"); + } + if (aLogLevel > 0) { + if (getSteamCapacity() > 0 && hasSteamEngineUpgrade()) tList.add(getStoredSteam() + " of " + getSteamCapacity() + " Steam"); + tList.add("Machine is " + (mActive?"active":"inactive")); + if (!mHasEnoughEnergy) tList.add("ATTENTION: This Device consumes Energy at a higher Rate than you input. You could insert more to speed up the process."); + } + return mMetaTileEntity.getSpecialDebugInfo(this, aPlayer, aLogLevel, tList); + } + + @Override public void issueTextureUpdate() {mNeedsUpdate = true;} + @Override public void issueBlockUpdate() {mNeedsBlockUpdate = true;} + @Override public void issueClientUpdate() {mSendClientData = true;} + @Override public void issueCoverUpdate(byte aSide) {issueClientUpdate();} + + @Override public byte getStrongestRedstone() {return (byte)Math.max(getInternalInputRedstoneSignal((byte)0), Math.max(getInternalInputRedstoneSignal((byte)1), Math.max(getInternalInputRedstoneSignal((byte)2), Math.max(getInternalInputRedstoneSignal((byte)3), Math.max(getInternalInputRedstoneSignal((byte)4), getInternalInputRedstoneSignal((byte)5))))));} + + @Override public boolean getRedstone() {return getRedstone((byte)0)||getRedstone((byte)1)||getRedstone((byte)2)||getRedstone((byte)3)||getRedstone((byte)4)||getRedstone((byte)5);} + @Override public boolean getRedstone(byte aSide) {return getInternalInputRedstoneSignal(aSide) > 0;} + + public ITexture getCoverTexture(byte aSide) {return GregTech_API.sCovers.get(new GT_ItemStack(getCoverIDAtSide(aSide)));} + + @Override public boolean isGivingInformation() {if (canAccessData()) return mMetaTileEntity.isGivingInformation(); return false;} + @Override public boolean isValidFacing(byte aSide) {if (canAccessData()) return mMetaTileEntity.isFacingValid(aSide); return false;} + @Override public byte getBackFacing() {return GT_Utility.getOppositeSide(mFacing);} + @Override public byte getFrontFacing() {return mFacing;} + @Override public void setFrontFacing(byte aFacing) {if (isValidFacing(aFacing)) {mFacing = aFacing; mMetaTileEntity.onFacingChange(); onMachineBlockUpdate();}} + @Override public int getSizeInventory() {if (canAccessData()) return mMetaTileEntity.getSizeInventory(); return 0;} + @Override public ItemStack getStackInSlot(int aIndex) {if (canAccessData()) return mMetaTileEntity.getStackInSlot(aIndex); return null;} + @Override public void setInventorySlotContents(int aIndex, ItemStack aStack) {mInventoryChanged = true; if (canAccessData()) mMetaTileEntity.setInventorySlotContents(aIndex, worldObj.isRemote?aStack:GT_OreDictUnificator.setStack(true, aStack));} + @Override public String getInventoryName() {if (canAccessData()) return mMetaTileEntity.getInventoryName(); if (GregTech_API.METATILEENTITIES[mID] != null) return GregTech_API.METATILEENTITIES[mID].getInventoryName(); return "";} + @Override public int getInventoryStackLimit() {if (canAccessData()) return mMetaTileEntity.getInventoryStackLimit(); return 64;} + @Override public void openInventory() {if (canAccessData()) mMetaTileEntity.onOpenGUI();} + @Override public void closeInventory() {if (canAccessData()) mMetaTileEntity.onCloseGUI();} + @Override public boolean isUseableByPlayer(EntityPlayer aPlayer) {return canAccessData() && playerOwnsThis(aPlayer, false) && mTickTimer>40 && getTileEntityOffset(0, 0, 0) == this && aPlayer.getDistanceSq(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5) < 64 && mMetaTileEntity.isAccessAllowed(aPlayer);} + @Override public void validate() {super.validate(); mTickTimer = 0;} + @Override public void invalidate() {tileEntityInvalid = false; if (canAccessData()) {mMetaTileEntity.onRemoval(); mMetaTileEntity.setBaseMetaTileEntity(null);} super.invalidate();} + @Override public void onChunkUnload() {super.onChunkUnload();} + @Override public boolean hasCustomInventoryName() {return false;} + @Override public ItemStack getStackInSlotOnClosing(int slot) {ItemStack stack = getStackInSlot(slot); if (stack != null) setInventorySlotContents(slot, null); return stack;} + @Override public void onMachineBlockUpdate() {if (canAccessData()) mMetaTileEntity.onMachineBlockUpdate();} + @Override public int getProgress() {return canAccessData()?mMetaTileEntity.getProgresstime():0;} + @Override public int getMaxProgress() {return canAccessData()?mMetaTileEntity.maxProgresstime():0;} + @Override public boolean increaseProgress(int aProgressAmountInTicks) {return canAccessData()?mMetaTileEntity.increaseProgress(aProgressAmountInTicks)!=aProgressAmountInTicks:false;} + @Override public boolean hasThingsToDo() {return getMaxProgress()>0;} + @Override public void enableWorking() {if (!mWorks) mWorkUpdate = true; mWorks = true;} + @Override public void disableWorking() {mWorks = false;} + @Override public boolean isAllowedToWork() {return mWorks;} + @Override public boolean hasWorkJustBeenEnabled() {return mWorkUpdate;} + @Override public void setWorkDataValue(byte aValue) {mWorkData = aValue;} + @Override public byte getWorkDataValue() {return mWorkData;} + @Override public int getMetaTileID() {return mID;} + @Override public int setMetaTileID(short aID) {return mID = aID;} + @Override public boolean isActive() {return mActive;} + @Override public void setActive(boolean aActive) {mActive = aActive;} + @Override public long getTimer() {return mTickTimer;} + @Override public boolean decreaseStoredEnergyUnits(long aEnergy, boolean aIgnoreTooLessEnergy) {if (!canAccessData()) return false; return mHasEnoughEnergy = decreaseStoredEU(aEnergy, aIgnoreTooLessEnergy) || decreaseStoredSteam(aEnergy, false) || (aIgnoreTooLessEnergy && (decreaseStoredSteam(aEnergy, true)));} + @Override public boolean increaseStoredEnergyUnits(long aEnergy, boolean aIgnoreTooMuchEnergy) {if (!canAccessData()) return false; if (getStoredEU() < getEUCapacity() || aIgnoreTooMuchEnergy) {setStoredEU(mMetaTileEntity.getEUVar() + aEnergy); return true;} return false;} + @Override public boolean inputEnergyFrom(byte aSide) {if (aSide == 6) return true; if (isServerSide()) return (aSide>=0&&aSide<6?mActiveEUInputs [aSide]:false)&&!mReleaseEnergy; return isEnergyInputSide (aSide);} + @Override public boolean outputsEnergyTo(byte aSide) {if (aSide == 6) return true; if (isServerSide()) return (aSide>=0&&aSide<6?mActiveEUOutputs[aSide]:false)|| mReleaseEnergy; return isEnergyOutputSide(aSide);} + @Override public long getOutputAmperage() {if (canAccessData() && mMetaTileEntity.isElectric()) return mMetaTileEntity.maxAmperesOut(); return 0;} + @Override public long getOutputVoltage() {if (canAccessData() && mMetaTileEntity.isElectric() && mMetaTileEntity.isEnetOutput()) return mMetaTileEntity.maxEUOutput(); return 0;} + @Override public long getInputAmperage() {if (canAccessData() && mMetaTileEntity.isElectric()) return mMetaTileEntity.maxAmperesIn(); return 0;} + @Override public long getInputVoltage() {if (canAccessData() && mMetaTileEntity.isElectric()) return mMetaTileEntity.maxEUInput(); return Integer.MAX_VALUE;} + @Override public boolean increaseStoredSteam(long aEnergy, boolean aIgnoreTooMuchEnergy) {if (!canAccessData()) return false; if (mMetaTileEntity.getSteamVar() < getSteamCapacity() || aIgnoreTooMuchEnergy) {setStoredSteam(mMetaTileEntity.getSteamVar() + aEnergy); return true;} return false;} + @Override public String[] getDescription() {if (canAccessData()) return mMetaTileEntity.getDescription(); return new String[0];} + @Override public boolean isValidSlot(int aIndex) {if (canAccessData()) return mMetaTileEntity.isValidSlot(aIndex); return false;} + @Override public long getUniversalEnergyStored() {return Math.max(getStoredEU(), getStoredSteam());} + @Override public long getUniversalEnergyCapacity() {return Math.max(getEUCapacity(), getSteamCapacity());} + @Override public long getStoredEU() {if (canAccessData()) return Math.min(mMetaTileEntity.getEUVar(), getEUCapacity()); return 0;} + @Override public long getEUCapacity() {if (canAccessData()) return mMetaTileEntity.maxEUStore(); return 0;} + @Override public long getStoredSteam() {if (canAccessData()) return Math.min(mMetaTileEntity.getSteamVar(), getSteamCapacity()); return 0;} + @Override public long getSteamCapacity() {if (canAccessData()) return mMetaTileEntity.maxSteamStore(); return 0;} + @Override public ITexture[] getTexture(byte aSide) {ITexture rIcon = getCoverTexture(aSide); if (rIcon != null) return new ITexture[] {rIcon}; if (hasValidMetaTileEntity()) return mMetaTileEntity.getTexture(this, aSide, mFacing, (byte)(mColor-1), mActive, getOutputRedstoneSignal(aSide)>0); return Textures.BlockIcons.ERROR_RENDERING;} + + private boolean isEnergyInputSide(byte aSide) {if (aSide >= 0 && aSide < 6) {if (!getCoverBehaviorAtSide(aSide).letsEnergyIn (aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this)) return false; if (isInvalid()||mReleaseEnergy) return false; if (canAccessData() && mMetaTileEntity.isElectric() && mMetaTileEntity.isEnetInput ()) return mMetaTileEntity.isInputFacing (aSide);} return false;} + private boolean isEnergyOutputSide(byte aSide) {if (aSide >= 0 && aSide < 6) {if (!getCoverBehaviorAtSide(aSide).letsEnergyOut(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this)) return false; if (isInvalid()||mReleaseEnergy) return mReleaseEnergy; if (canAccessData() && mMetaTileEntity.isElectric() && mMetaTileEntity.isEnetOutput()) return mMetaTileEntity.isOutputFacing(aSide);} return false;} + + protected boolean hasValidMetaTileEntity() {return mMetaTileEntity != null && mMetaTileEntity.getBaseMetaTileEntity() == this;} + protected boolean canAccessData() {return !isDead && hasValidMetaTileEntity();} + + public boolean setStoredEU (long aEnergy) {if (!canAccessData()) return false; if (aEnergy < 0) aEnergy = 0; mMetaTileEntity.setEUVar (aEnergy); return true;} + public boolean setStoredSteam (long aEnergy) {if (!canAccessData()) return false; if (aEnergy < 0) aEnergy = 0; mMetaTileEntity.setSteamVar (aEnergy); return true;} + public boolean decreaseStoredEU (long aEnergy, boolean aIgnoreTooLessEnergy) {if (!canAccessData()) {return false;} if (mMetaTileEntity.getEUVar() - aEnergy >= 0 || aIgnoreTooLessEnergy) {setStoredEU(mMetaTileEntity.getEUVar() - aEnergy); if (mMetaTileEntity.getEUVar() < 0) {setStoredEU (0); return false;} return true;} return false;} + public boolean decreaseStoredSteam (long aEnergy, boolean aIgnoreTooLessEnergy) {if (!canAccessData()) return false; if (mMetaTileEntity.getSteamVar() - aEnergy >= 0 || aIgnoreTooLessEnergy) {setStoredSteam(mMetaTileEntity.getSteamVar() - aEnergy); if (mMetaTileEntity.getSteamVar() < 0) {setStoredSteam(0); return false;} return true;} return false;} + + public boolean playerOwnsThis(EntityPlayer aPlayer, boolean aCheckPrecicely) {if (!canAccessData()) return false; if (aCheckPrecicely || privateAccess() || mOwnerName.equals("")) if (mOwnerName.equals("")&&isServerSide()) setOwnerName(aPlayer.getDisplayName()); else if (privateAccess() && !aPlayer.getDisplayName().equals("Player") && !mOwnerName.equals("Player") && !mOwnerName.equals(aPlayer.getDisplayName())) return false; return true;} + public boolean privateAccess() {if (!canAccessData()) return mLockUpgrade; return mLockUpgrade || mMetaTileEntity.ownerControl();} + public void doEnergyExplosion() {if (getUniversalEnergyCapacity() > 0 && getUniversalEnergyStored() >= getUniversalEnergyCapacity()/5) {doExplosion(oOutput*(getUniversalEnergyStored() >= getUniversalEnergyCapacity()?4:getUniversalEnergyStored() >= getUniversalEnergyCapacity()/2?2:1));}} + + @Override + public void doExplosion(long aAmount) { + if (canAccessData()) { + // This is only for Electric Machines + if (GregTech_API.sMachineWireFire && mMetaTileEntity.isElectric()) { + try { + mReleaseEnergy = true; + IEnergyConnected.Util.emitEnergyToNetwork(V[5], Math.max(1, getStoredEU() / V[5]), this); + } catch(Exception e) {/* Fun Fact: all these "do nothing" Comments you see in my Code, are just there to let Eclipse shut up about the intended empty Brackets, but I need eclipse to yell at me in some of the regular Cases where I forget to add Code */} + } + mReleaseEnergy = false; + // Normal Explosion Code + mMetaTileEntity.onExplosion(); + mMetaTileEntity.doExplosion(aAmount); + } + } + + @Override + public ArrayList getDrops() { + ItemStack rStack = new ItemStack(GregTech_API.sBlockMachines, 1, mID); + NBTTagCompound tNBT = new NBTTagCompound(); + if (mRecipeStuff != null && !mRecipeStuff.hasNoTags()) tNBT.setTag("GT.CraftingComponents", mRecipeStuff); + if (mMuffler ) tNBT.setBoolean ("mMuffler" , mMuffler); + if (mLockUpgrade ) tNBT.setBoolean ("mLockUpgrade" , mLockUpgrade); + if (mSteamConverter ) tNBT.setBoolean ("mSteamConverter" , mSteamConverter); + if (mColor > 0) tNBT.setByte ("mColor" , mColor); + if (mOtherUpgrades > 0) tNBT.setByte ("mOtherUpgrades" , mOtherUpgrades); + if (mStrongRedstone > 0) tNBT.setByte ("mStrongRedstone" , mStrongRedstone); + for (byte i = 0; i < mCoverSides.length; i++) { + if (mCoverSides[i] != 0) { + tNBT.setIntArray("mCoverData" , mCoverData); + tNBT.setIntArray("mCoverSides" , mCoverSides); + break; + } + } + if (hasValidMetaTileEntity()) mMetaTileEntity.setItemNBT(tNBT); + if (!tNBT.hasNoTags()) rStack.setTagCompound(tNBT); + return new ArrayList(Arrays.asList(rStack)); + } + + public int getUpgradeCount() { + return (mMuffler?1:0)+(mLockUpgrade?1:0)+(mSteamConverter?1:0)+mOtherUpgrades; + } + + @Override + public boolean onRightclick(EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) { + if (isClientSide()) { + if (getCoverBehaviorAtSide(aSide).onCoverRightclickClient(aSide, this, aPlayer, aX, aY, aZ)) return true; + if (!getCoverBehaviorAtSide(aSide).isGUIClickable(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this)) return false; + } + if (isServerSide()) { + if (!privateAccess() || aPlayer.getDisplayName().equalsIgnoreCase(getOwnerName())) { + ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem(); + if (tCurrentItem != null) { + if (getColorization() >= 0 && GT_Utility.areStacksEqual(new ItemStack(Items.water_bucket, 1), tCurrentItem)) { + tCurrentItem.func_150996_a(Items.bucket); + setColorization((byte)(getColorization() >= 16 ? -2 : -1)); + return true; + } + if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sWrenchList)) { + if (mMetaTileEntity.onWrenchRightClick(aSide, GT_Utility.determineWrenchingSide(aSide, aX, aY, aZ), aPlayer, aX, aY, aZ)) { + GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer); + GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(100), 1.0F, -1, xCoord, yCoord, zCoord); + } + return true; + } + + if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sScrewdriverList)) { + if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 200, aPlayer)) { + setCoverDataAtSide(aSide, getCoverBehaviorAtSide(aSide).onCoverScrewdriverclick(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this, aPlayer, aX, aY, aZ)); + mMetaTileEntity.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ); + GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(100), 1.0F, -1, xCoord, yCoord, zCoord); + } + return true; + } + + if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sHardHammerList)) { + if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) { + mInputDisabled = !mInputDisabled; + if (mInputDisabled) mOutputDisabled = !mOutputDisabled; + GT_Utility.sendChatToPlayer(aPlayer, "Auto-Input: " + (mInputDisabled?"Disabled":"Enabled") + " Auto-Output: " + (mOutputDisabled?"Disabled":"Enabled")); + GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(1), 1.0F, -1, xCoord, yCoord, zCoord); + } + return true; + } + + if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sSoftHammerList)) { + if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) { + if (mWorks) disableWorking(); else enableWorking(); + GT_Utility.sendChatToPlayer(aPlayer, "Machine Processing: " + (isAllowedToWork()?"Enabled":"Disabled")); + GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(101), 1.0F, -1, xCoord, yCoord, zCoord); + } + return true; + } + + if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sSolderingToolList)) { + byte tSide = GT_Utility.determineWrenchingSide(aSide, aX, aY, aZ); + if (GT_ModHandler.useSolderingIron(tCurrentItem, aPlayer)) { + mStrongRedstone ^= (1 << tSide); + GT_Utility.sendChatToPlayer(aPlayer, "Redstone Output at Side " + tSide + " set to: " + ((mStrongRedstone & (1 << tSide))!=0?"Strong":"Weak")); + GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(103), 3.0F, -1, xCoord, yCoord, zCoord); + } + return true; + } + + if (getCoverIDAtSide(aSide) == 0) { + if (GregTech_API.sCovers.containsKey(new GT_ItemStack(tCurrentItem))) { + if (GregTech_API.getCoverBehavior(tCurrentItem).isCoverPlaceable(aSide, new GT_ItemStack(tCurrentItem), this) && mMetaTileEntity.allowCoverOnSide(aSide, new GT_ItemStack(tCurrentItem))) { + setCoverItemAtSide(aSide, tCurrentItem); + if (!aPlayer.capabilities.isCreativeMode) tCurrentItem.stackSize--; + GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(100), 1.0F, -1, xCoord, yCoord, zCoord); + } + return true; + } + } else { + if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sCrowbarList)) { + if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) { + GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(0), 1.0F, -1, xCoord, yCoord, zCoord); + dropCover(aSide, aSide, false); + } + return true; + } + } + } + + if (getCoverBehaviorAtSide(aSide).onCoverRightclick(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this, aPlayer, aX, aY, aZ)) return true; + + if (!getCoverBehaviorAtSide(aSide).isGUIClickable(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this)) return false; + + if (isUpgradable() && aPlayer.inventory.getCurrentItem() != null) {/* + if (ItemList.Upgrade_SteamEngine.isStackEqual(aPlayer.inventory.getCurrentItem())) { + if (addSteamEngineUpgrade()) { + GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(3), 1.0F, -1, xCoord, yCoord, zCoord); + if (!aPlayer.capabilities.isCreativeMode) aPlayer.inventory.getCurrentItem().stackSize--; + } + return true; + }*/ + if (ItemList.Upgrade_Muffler.isStackEqual(aPlayer.inventory.getCurrentItem())) { + if (addMufflerUpgrade()) { + GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(3), 1.0F, -1, xCoord, yCoord, zCoord); + if (!aPlayer.capabilities.isCreativeMode) aPlayer.inventory.getCurrentItem().stackSize--; + } + return true; + } + if (ItemList.Upgrade_Lock.isStackEqual(aPlayer.inventory.getCurrentItem())) { + if (isUpgradable() && !mLockUpgrade) { + mLockUpgrade = true; + setOwnerName(aPlayer.getDisplayName()); + GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(3), 1.0F, -1, xCoord, yCoord, zCoord); + if (!aPlayer.capabilities.isCreativeMode) aPlayer.inventory.getCurrentItem().stackSize--; + } + return true; + } + } + } + } + + try { + if (hasValidMetaTileEntity()) return mMetaTileEntity.onRightclick(this, aPlayer, aSide, aX, aY, aZ); + } catch(Throwable e) { + GT_Log.err.println("Encountered Exception while rightclicking TileEntity, the Game should've crashed now, but I prevented that. Please report immidietly to GregTech Intergalactical!!!"); + e.printStackTrace(GT_Log.err); + } + + return true; + } + + @Override + public void onLeftclick(EntityPlayer aPlayer) { + try { + if (aPlayer != null && hasValidMetaTileEntity()) mMetaTileEntity.onLeftclick(this, aPlayer); + } catch(Throwable e) { + GT_Log.err.println("Encountered Exception while leftclicking TileEntity, the Game should've crashed now, but I prevented that. Please report immidietly to GregTech Intergalactical!!!"); + e.printStackTrace(GT_Log.err); + } + } + + @Override + public boolean isDigitalChest() { + if (canAccessData()) return mMetaTileEntity.isDigitalChest(); + return false; + } + + @Override + public ItemStack[] getStoredItemData() { + if (canAccessData()) return mMetaTileEntity.getStoredItemData(); + return null; + } + + @Override + public void setItemCount(int aCount) { + if (canAccessData()) mMetaTileEntity.setItemCount(aCount); + } + + @Override + public int getMaxItemCount() { + if (canAccessData()) return mMetaTileEntity.getMaxItemCount(); + return 0; + } + + /** + * Can put aStack into Slot + */ + @Override + public boolean isItemValidForSlot(int aIndex, ItemStack aStack) { + return canAccessData() && mMetaTileEntity.isItemValidForSlot(aIndex, aStack); + } + + /** + * returns all valid Inventory Slots, no matter which Side (Unless it's covered). + * The Side Stuff is done in the following two Functions. + */ + @Override + public int[] getAccessibleSlotsFromSide(int aSide) { + if (canAccessData() && (getCoverBehaviorAtSide((byte)aSide).letsItemsOut((byte)aSide, getCoverIDAtSide((byte)aSide), getCoverDataAtSide((byte)aSide), -1, this) || getCoverBehaviorAtSide((byte)aSide).letsItemsIn((byte)aSide, getCoverIDAtSide((byte)aSide), getCoverDataAtSide((byte)aSide), -1, this))) return mMetaTileEntity.getAccessibleSlotsFromSide(aSide); + return new int[0]; + } + + /** + * Can put aStack into Slot at Side + */ + @Override + public boolean canInsertItem(int aIndex, ItemStack aStack, int aSide) { + return canAccessData() && (mRunningThroughTick || !mInputDisabled ) && getCoverBehaviorAtSide((byte)aSide).letsItemsIn ((byte)aSide, getCoverIDAtSide((byte)aSide), getCoverDataAtSide((byte)aSide), aIndex, this) && mMetaTileEntity.canInsertItem(aIndex, aStack, aSide); + } + + /** + * Can pull aStack out of Slot from Side + */ + @Override + public boolean canExtractItem(int aIndex, ItemStack aStack, int aSide) { + return canAccessData() && (mRunningThroughTick || !mOutputDisabled) && getCoverBehaviorAtSide((byte)aSide).letsItemsOut((byte)aSide, getCoverIDAtSide((byte)aSide), getCoverDataAtSide((byte)aSide), aIndex, this) && mMetaTileEntity.canExtractItem(aIndex, aStack, aSide); + } + + @Override + public boolean isUpgradable() { + return canAccessData() && getUpgradeCount() < 8; + } + + @Override + public byte getInternalInputRedstoneSignal(byte aSide) { + return (byte)(getCoverBehaviorAtSide(aSide).getRedstoneInput(aSide, getInputRedstoneSignal(aSide), getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this)&15); + } + + @Override + public byte getInputRedstoneSignal(byte aSide) { + return (byte)(worldObj.getIndirectPowerLevelTo(getOffsetX(aSide, 1), getOffsetY(aSide, 1), getOffsetZ(aSide, 1), aSide)&15); + } + + @Override + public byte getOutputRedstoneSignal(byte aSide) { + return (byte)(getCoverBehaviorAtSide(aSide).manipulatesSidedRedstoneOutput(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this) || (mRedstone && getCoverBehaviorAtSide(aSide).letsRedstoneGoOut(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this))?mSidedRedstone[aSide]&15:0); + } + + @Override + public void setInternalOutputRedstoneSignal(byte aSide, byte aStrength) { + if (!getCoverBehaviorAtSide(aSide).manipulatesSidedRedstoneOutput(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this)) setOutputRedstoneSignal(aSide, aStrength); + } + + @Override + public void setOutputRedstoneSignal(byte aSide, byte aStrength) { + aStrength = (byte)Math.min(Math.max(0, aStrength), 15); + if (aSide >= 0 && aSide < 6 && mSidedRedstone[aSide] != aStrength) { + mSidedRedstone[aSide] = aStrength; + issueBlockUpdate(); + } + } + + @Override + public boolean isSteamEngineUpgradable() { + return isUpgradable()&&!hasSteamEngineUpgrade()&&getSteamCapacity()>0; + } + + @Override + public boolean addSteamEngineUpgrade() { + if (isSteamEngineUpgradable()) { + issueBlockUpdate(); + mSteamConverter = true; + return true; + } + return false; + } + + @Override + public boolean hasSteamEngineUpgrade() { + if (canAccessData() && mMetaTileEntity.isSteampowered()) return true; + return mSteamConverter; + } + + @Override + public boolean hasMufflerUpgrade() { + return mMuffler; + } + + @Override + public boolean isMufflerUpgradable() { + return isUpgradable()&&!hasMufflerUpgrade(); + } + + @Override + public boolean addMufflerUpgrade() { + if (isMufflerUpgradable()) return mMuffler = true; + return false; + } + + @Override + public boolean hasInventoryBeenModified() { + return mInventoryChanged; + } + + @Override + public void setGenericRedstoneOutput(boolean aOnOff) { + mRedstone = aOnOff; + } + + @Override + public int getErrorDisplayID() { + return mDisplayErrorCode; + } + + @Override + public void setErrorDisplayID(int aErrorID) { + mDisplayErrorCode = aErrorID; + } + + @Override + public IMetaTileEntity getMetaTileEntity() { + return hasValidMetaTileEntity()?mMetaTileEntity:null; + } + + private final GT_CoverBehavior[] mCoverBehaviors = new GT_CoverBehavior[] {GregTech_API.sNoBehavior, GregTech_API.sNoBehavior, GregTech_API.sNoBehavior, GregTech_API.sNoBehavior, GregTech_API.sNoBehavior, GregTech_API.sNoBehavior}; + + @Override + public GT_CoverBehavior getCoverBehaviorAtSide(byte aSide) { + return aSide >= 0 && aSide < mCoverBehaviors.length ? mCoverBehaviors[aSide] : GregTech_API.sNoBehavior; + } + + @Override + public void setCoverIDAtSide(byte aSide, int aID) { + if (aSide >= 0 && aSide < 6) { + mCoverSides[aSide] = aID; + mCoverData[aSide] = 0; + mCoverBehaviors[aSide] = GregTech_API.getCoverBehavior(aID); + issueCoverUpdate(aSide); + issueBlockUpdate(); + } + } + + @Override + public void setCoverItemAtSide(byte aSide, ItemStack aCover) { + GregTech_API.getCoverBehavior(aCover).placeCover(aSide, aCover, this); + } + + @Override + public int getCoverIDAtSide(byte aSide) { + if (aSide >= 0 && aSide < 6) return mCoverSides[aSide]; return 0; + } + + @Override + public ItemStack getCoverItemAtSide(byte aSide) { + return GT_Utility.intToStack(getCoverIDAtSide(aSide)); + } + + @Override + public boolean canPlaceCoverIDAtSide(byte aSide, int aID) { + return getCoverIDAtSide(aSide) == 0; + } + + @Override + public boolean canPlaceCoverItemAtSide(byte aSide, ItemStack aCover) { + return getCoverIDAtSide(aSide) == 0; + } + + @Override + public void setCoverDataAtSide(byte aSide, int aData) { + if (aSide >= 0 && aSide < 6) mCoverData[aSide] = aData; + } + + @Override + public int getCoverDataAtSide(byte aSide) { + if (aSide >= 0 && aSide < 6) return mCoverData[aSide]; + return 0; + } + + @Override + public void setLightValue(byte aLightValue) { + mLightValue = (byte)(aLightValue & 15); + } + + public byte getLightValue() { + return mLightValue; + } + + + @Override + public long getAverageElectricInput() { + int rEU = 0; + for (int tEU : mAverageEUInput) rEU += tEU; + return rEU / mAverageEUInput.length; + } + + @Override + public long getAverageElectricOutput() { + int rEU = 0; + for (int tEU : mAverageEUOutput) rEU += tEU; + return rEU / mAverageEUOutput.length; + } + + @Override + public boolean dropCover(byte aSide, byte aDroppedSide, boolean aForced) { + if (getCoverBehaviorAtSide(aSide).onCoverRemoval(aSide, getCoverIDAtSide(aSide), mCoverData[aSide], this, aForced) || aForced) { + ItemStack tStack = getCoverBehaviorAtSide(aSide).getDrop(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this); + if (tStack != null) { + tStack.setTagCompound(null); + EntityItem tEntity = new EntityItem(worldObj, getOffsetX(aDroppedSide, 1) + 0.5, getOffsetY(aDroppedSide, 1) + 0.5, getOffsetZ(aDroppedSide, 1) + 0.5, tStack); + tEntity.motionX = 0; + tEntity.motionY = 0; + tEntity.motionZ = 0; + worldObj.spawnEntityInWorld(tEntity); + } + setCoverIDAtSide(aSide, 0); + if (mMetaTileEntity.hasSidedRedstoneOutputBehavior()) { + setOutputRedstoneSignal(aSide, (byte) 0); + } else { + setOutputRedstoneSignal(aSide, (byte)15); + } + return true; + } + return false; + } + + @Override + public String getOwnerName() { + if (GT_Utility.isStringInvalid(mOwnerName)) return "Player"; + return mOwnerName; + } + + @Override + public String setOwnerName(String aName) { + if (GT_Utility.isStringInvalid(aName)) return mOwnerName = "Player"; + return mOwnerName = aName; + } + + @Override + public byte getComparatorValue(byte aSide) { + return canAccessData()?mMetaTileEntity.getComparatorValue(aSide):0; + } + + @Override + public byte getStrongOutputRedstoneSignal(byte aSide) { + return aSide>=0&&aSide<6&&(mStrongRedstone & (1 << aSide))!=0?(byte)(mSidedRedstone[aSide]&15):0; + } + + @Override + public void setStrongOutputRedstoneSignal(byte aSide, byte aStrength) { + mStrongRedstone |= (1 << aSide); + setOutputRedstoneSignal(aSide, aStrength); + } + + @Override + public ItemStack decrStackSize(int aIndex, int aAmount) { + if (canAccessData()) { + mInventoryChanged = true; + return mMetaTileEntity.decrStackSize(aIndex, aAmount); + } + return null; + } + + @Override + public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage) { + if (!canAccessData() || !mMetaTileEntity.isElectric() || !inputEnergyFrom(aSide) || aAmperage <= 0 || aVoltage <= 0 || getStoredEU() >= getEUCapacity() || mMetaTileEntity.maxAmperesIn() <= mAcceptedAmperes) return 0; + if (aVoltage > getInputVoltage()) { + doExplosion(aVoltage); + return 0; + } + if (increaseStoredEnergyUnits(aVoltage*(aAmperage=Math.min(aAmperage, Math.min(mMetaTileEntity.maxAmperesIn()-mAcceptedAmperes, 1+((getEUCapacity()-getStoredEU()) / aVoltage)))), true)) { + mAverageEUInput[mAverageEUInputIndex] += aVoltage*aAmperage; + mAcceptedAmperes += aAmperage; + return aAmperage; + } + return 0; + } + + @Override + public boolean drainEnergyUnits(byte aSide, long aVoltage, long aAmperage) { + if (!canAccessData() || !mMetaTileEntity.isElectric() || !outputsEnergyTo(aSide) || getStoredEU() - (aVoltage*aAmperage) < mMetaTileEntity.getMinimumStoredEU()) return false; + if (decreaseStoredEU(aVoltage*aAmperage, false)) { + mAverageEUOutput[mAverageEUOutputIndex] += aVoltage*aAmperage; + return true; + } + return false; + } + + @Override + public boolean acceptsRotationalEnergy(byte aSide) { + if (!canAccessData() || getCoverIDAtSide(aSide) != 0) return false; + return mMetaTileEntity.acceptsRotationalEnergy(aSide); + } + + @Override + public boolean injectRotationalEnergy(byte aSide, long aSpeed, long aEnergy) { + if (!canAccessData() || getCoverIDAtSide(aSide) != 0) return false; + return mMetaTileEntity.injectRotationalEnergy(aSide, aSpeed, aEnergy); + } + + @Override + public int fill(ForgeDirection aSide, FluidStack aFluid, boolean doFill) { + if (mTickTimer > 5 && canAccessData() && (mRunningThroughTick || !mInputDisabled ) && (aSide == ForgeDirection.UNKNOWN || (mMetaTileEntity.isLiquidInput ((byte)aSide.ordinal()) && getCoverBehaviorAtSide((byte)aSide.ordinal()).letsFluidIn ((byte)aSide.ordinal(), getCoverIDAtSide((byte)aSide.ordinal()), getCoverDataAtSide((byte)aSide.ordinal()), aFluid==null?null:aFluid.getFluid(), this)))) return mMetaTileEntity.fill(aSide, aFluid, doFill); + return 0; + } + + @Override + public FluidStack drain(ForgeDirection aSide, int maxDrain, boolean doDrain) { + if (mTickTimer > 5 && canAccessData() && (mRunningThroughTick || !mOutputDisabled) && (aSide == ForgeDirection.UNKNOWN || (mMetaTileEntity.isLiquidOutput((byte)aSide.ordinal()) && getCoverBehaviorAtSide((byte)aSide.ordinal()).letsFluidOut((byte)aSide.ordinal(), getCoverIDAtSide((byte)aSide.ordinal()), getCoverDataAtSide((byte)aSide.ordinal()), mMetaTileEntity.getFluid()==null?null:mMetaTileEntity.getFluid().getFluid(), this)))) return mMetaTileEntity.drain(aSide, maxDrain, doDrain); + return null; + } + + @Override + public FluidStack drain(ForgeDirection aSide, FluidStack aFluid, boolean doDrain) { + if (mTickTimer > 5 && canAccessData() && (mRunningThroughTick || !mOutputDisabled) && (aSide == ForgeDirection.UNKNOWN || (mMetaTileEntity.isLiquidOutput((byte)aSide.ordinal()) && getCoverBehaviorAtSide((byte)aSide.ordinal()).letsFluidOut((byte)aSide.ordinal(), getCoverIDAtSide((byte)aSide.ordinal()), getCoverDataAtSide((byte)aSide.ordinal()), aFluid==null?null:aFluid.getFluid(), this)))) return mMetaTileEntity.drain(aSide, aFluid, doDrain); + return null; + } + + @Override + public boolean canFill(ForgeDirection aSide, Fluid aFluid) { + if (mTickTimer > 5 && canAccessData() && (mRunningThroughTick || !mInputDisabled ) && (aSide == ForgeDirection.UNKNOWN || (mMetaTileEntity.isLiquidInput ((byte)aSide.ordinal()) && getCoverBehaviorAtSide((byte)aSide.ordinal()).letsFluidIn ((byte)aSide.ordinal(), getCoverIDAtSide((byte)aSide.ordinal()), getCoverDataAtSide((byte)aSide.ordinal()), aFluid, this)))) return mMetaTileEntity.canFill(aSide, aFluid); + return false; + } + + @Override + public boolean canDrain(ForgeDirection aSide, Fluid aFluid) { + if (mTickTimer > 5 && canAccessData() && (mRunningThroughTick || !mOutputDisabled) && (aSide == ForgeDirection.UNKNOWN || (mMetaTileEntity.isLiquidOutput((byte)aSide.ordinal()) && getCoverBehaviorAtSide((byte)aSide.ordinal()).letsFluidOut((byte)aSide.ordinal(), getCoverIDAtSide((byte)aSide.ordinal()), getCoverDataAtSide((byte)aSide.ordinal()), aFluid, this)))) return mMetaTileEntity.canDrain(aSide, aFluid); + return false; + } + + @Override + public FluidTankInfo[] getTankInfo(ForgeDirection aSide) { + if (canAccessData() && (aSide == ForgeDirection.UNKNOWN || (mMetaTileEntity.isLiquidInput((byte)aSide.ordinal()) && getCoverBehaviorAtSide((byte)aSide.ordinal()).letsFluidIn ((byte)aSide.ordinal(), getCoverIDAtSide((byte)aSide.ordinal()), getCoverDataAtSide((byte)aSide.ordinal()), null, this)) || (mMetaTileEntity.isLiquidOutput((byte)aSide.ordinal()) && getCoverBehaviorAtSide((byte)aSide.ordinal()).letsFluidOut((byte)aSide.ordinal(), getCoverIDAtSide((byte)aSide.ordinal()), getCoverDataAtSide((byte)aSide.ordinal()), null, this)))) return mMetaTileEntity.getTankInfo(aSide); + return new FluidTankInfo[] {}; + } + + public double getOutputEnergyUnitsPerTick() { return oOutput;} + public boolean isTeleporterCompatible(ForgeDirection aSide) {return canAccessData() && mMetaTileEntity.isTeleporterCompatible();} + public double demandedEnergyUnits() {if (mReleaseEnergy || !canAccessData() || !mMetaTileEntity.isEnetInput()) return 0; return getEUCapacity() - getStoredEU();} + public double injectEnergyUnits(ForgeDirection aDirection, double aAmount) {return injectEnergyUnits((byte)aDirection.ordinal(), (int)aAmount, 1)>0?0:aAmount;} + public boolean acceptsEnergyFrom(TileEntity aEmitter, ForgeDirection aDirection) {return inputEnergyFrom((byte)aDirection.ordinal());} + public boolean emitsEnergyTo(TileEntity aReceiver, ForgeDirection aDirection) {return outputsEnergyTo((byte)aDirection.ordinal());} + public double getOfferedEnergy() {return (canAccessData() && getStoredEU() - mMetaTileEntity.getMinimumStoredEU() >= oOutput)?Math.max(0, oOutput):0;} + public void drawEnergy(double amount) {mAverageEUOutput[mAverageEUOutputIndex] += amount; decreaseStoredEU((int)amount, true);} + public int injectEnergy(ForgeDirection aForgeDirection, int aAmount) {return injectEnergyUnits((byte)aForgeDirection.ordinal(), aAmount, 1)>0?0:aAmount;} + + public int addEnergy(int aEnergy) { + if (!canAccessData()) return 0; + if (aEnergy > 0) + increaseStoredEnergyUnits( aEnergy, true); + else + decreaseStoredEU(-aEnergy, true); + return (int)Math.min(Integer.MAX_VALUE, mMetaTileEntity.getEUVar()); + } + + public boolean isAddedToEnergyNet() {return false;} + public void setStored(int aEU) {if (canAccessData()) setStoredEU(aEU);} + public int demandsEnergy() {if (mReleaseEnergy || !canAccessData() || !mMetaTileEntity.isEnetInput()) return 0; return getCapacity() - getStored();} + public int getCapacity() {return (int)Math.min(Integer.MAX_VALUE, getEUCapacity());} + public int getStored() {return (int)Math.min(Integer.MAX_VALUE, Math.min(getStoredEU(), getCapacity()));} + public int getMaxSafeInput() {return (int)Math.min(Integer.MAX_VALUE, getInputVoltage());} + public int getMaxEnergyOutput() {if (mReleaseEnergy) return Integer.MAX_VALUE; return getOutput();} + public int getOutput() {return (int)Math.min(Integer.MAX_VALUE, oOutput);} + public int injectEnergy(Direction aDirection, int aAmount) {return injectEnergyUnits((byte)aDirection.toSideValue(), aAmount, 1)>0?0:aAmount;} + public boolean isTeleporterCompatible(Direction aSide) {return canAccessData() && mMetaTileEntity.isTeleporterCompatible();} + public boolean acceptsEnergyFrom(TileEntity aReceiver, Direction aDirection) {return inputEnergyFrom((byte)aDirection.toSideValue());} + public boolean emitsEnergyTo(TileEntity aReceiver, Direction aDirection) {return outputsEnergyTo((byte)aDirection.toSideValue());} + + @Override + public boolean isInvalidTileEntity() { + return isInvalid(); + } + + @Override + public boolean addStackToSlot(int aIndex, ItemStack aStack) { + if (GT_Utility.isStackInvalid(aStack)) return true; + if (aIndex < 0 || aIndex >= getSizeInventory()) return false; + ItemStack tStack = getStackInSlot(aIndex); + if (GT_Utility.isStackInvalid(tStack)) { + setInventorySlotContents(aIndex, aStack); + return true; + } + aStack = GT_OreDictUnificator.get(aStack); + if (GT_Utility.areStacksEqual(tStack, aStack) && tStack.stackSize + aStack.stackSize <= Math.min(aStack.getMaxStackSize(), getInventoryStackLimit())) { + tStack.stackSize+=aStack.stackSize; + return true; + } + return false; + } + + @Override + public boolean addStackToSlot(int aIndex, ItemStack aStack, int aAmount) { + return addStackToSlot(aIndex, GT_Utility.copyAmount(aAmount, aStack)); + } + + @Override + public void setMetaTileEntity(IMetaTileEntity aMetaTileEntity) { + mMetaTileEntity = (MetaTileEntity)aMetaTileEntity; + } + + @Override + public byte getColorization() { + return (byte)(mColor-1); + } + + @Override + public byte setColorization(byte aColor) { + if (aColor > 15 || aColor < -1) aColor = -1; + if (canAccessData()) mMetaTileEntity.onColorChangeServer(aColor); + return mColor = (byte)(aColor+1); + } + + @Override + public float getBlastResistance(byte aSide) { + return canAccessData()?Math.max(0, getMetaTileEntity().getExplosionResistance(aSide)):10.0F; + } + + @Override + public boolean isUniversalEnergyStored(long aEnergyAmount) { + if (getUniversalEnergyStored() >= aEnergyAmount) return true; + mHasEnoughEnergy = false; + return false; + } + + @Override + public String[] getInfoData() { + {if (canAccessData()) return getMetaTileEntity().getInfoData(); return new String[]{};} + } + + @Override + public void markDirty() { + super.markDirty(); + mInventoryChanged = true; + } + + @Override + public int getLightOpacity() { + return mMetaTileEntity == null ? getLightValue() > 0 ? 0 : 255 : mMetaTileEntity.getLightOpacity(); + } + + @Override + public void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, List outputAABB, Entity collider) { + mMetaTileEntity.addCollisionBoxesToList(aWorld, aX, aY, aZ, inputAABB, outputAABB, collider); + } + + @Override + public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) { + return mMetaTileEntity.getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ); + } + + @Override + public void onEntityCollidedWithBlock(World aWorld, int aX, int aY, int aZ, Entity collider) { + mMetaTileEntity.onEntityCollidedWithBlock(aWorld, aX, aY, aZ, collider); + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntityUE.java b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntityUE.java new file mode 100644 index 0000000..d18ddeb --- /dev/null +++ b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntityUE.java @@ -0,0 +1,98 @@ +package gregtech.api.metatileentity; + + +/** + * NEVER INCLUDE THIS FILE IN YOUR MOD!!! + * + * This file contains all the needed 'implements' of the Interfaces for the Universal Electricity Stuff. + * + * I am using the BC3 Ratio, since that is a constant in comparison to IC² Energy (1 MJ is always 2,5 EU). + */ +public class BaseMetaTileEntityUE extends BaseMetaTileEntity /*implements IUETileEntity*/ { + public BaseMetaTileEntityUE() { + super(); + } + /* + @Override + public void updateStatus() { + super.updateStatus(); + } + + @Override + public void chargeItem(ItemStack aStack) { + super.chargeItem(aStack); + float tEnergy = ElectricItemHelper.chargeItem(aStack, (float)(getOfferedEnergy() * (Compatibility.BC3_RATIO * 0.4F))); + if (tEnergy > 0) decreaseStoredEU((int)(tEnergy / (Compatibility.BC3_RATIO * 0.4F)) + 1, true); + } + + @Override + public void dischargeItem(ItemStack aStack) { + super.dischargeItem(aStack); + float tEnergy = ElectricItemHelper.dischargeItem(aStack, (float)(demandedEnergyUnits() * (Compatibility.BC3_RATIO * 0.4F))); + if (tEnergy > 0) increaseStoredEnergyUnits((int)(tEnergy / (Compatibility.BC3_RATIO * 0.4F)), true); + } + + @Override + public float receiveElectricity(ForgeDirection aSide, ElectricityPack aPacket, boolean doReceive) { + if (!getUEConsumingSides().contains(aSide)) return 0; + int aInserted = (int)(aPacket.getWatts()/(Compatibility.BC3_RATIO * 0.4F)); + if (doReceive) return injectEnergyUnits((byte)aSide.ordinal(), aInserted, 1) ? aInserted : 0; + return getEUCapacity() - getStoredEU() >= aInserted ? aInserted : 0; + } + + @Override + public ElectricityPack provideElectricity(ForgeDirection aSide, ElectricityPack aRequested, boolean doProvide) { + if (!getUEProducingSides().contains(aSide)) return null; + int aExtracted = (int)getOfferedEnergy(); + if (doProvide) return aRequested.getWatts()/(Compatibility.BC3_RATIO * 0.4F) >= getOfferedEnergy() ? decreaseStoredEU(aExtracted, false) ? new ElectricityPack(aExtracted * (Compatibility.BC3_RATIO * 0.4F), 1) : null : decreaseStoredEU((int)(aRequested.getWatts()/(Compatibility.BC3_RATIO * 0.4F)), false) ? new ElectricityPack((int)(aRequested.getWatts()/(Compatibility.BC3_RATIO * 0.4F)) * (Compatibility.BC3_RATIO * 0.4F), 1) : null; + return aRequested.getWatts()/(Compatibility.BC3_RATIO * 0.4F) >= getOfferedEnergy() ? new ElectricityPack(aExtracted * (Compatibility.BC3_RATIO * 0.4F), 1) : new ElectricityPack((int)(aRequested.getWatts()/(Compatibility.BC3_RATIO * 0.4F)) * (Compatibility.BC3_RATIO * 0.4F), 1); + } + + @Override + public float getRequest(ForgeDirection aSide) { + if (!getUEConsumingSides().contains(aSide)) return 0; + return (float)(demandedEnergyUnits() * (Compatibility.BC3_RATIO * 0.4F)); + } + + @Override + public float getProvide(ForgeDirection aSide) { + if (!getUEProducingSides().contains(aSide)) return 0; + return (float)(getOfferedEnergy() * (Compatibility.BC3_RATIO * 0.4F)); + } + + @Override + public float getVoltage() { + return (float)(getOfferedEnergy() * (Compatibility.BC3_RATIO * 0.4F)); + } + + @Override + public boolean canConnect(ForgeDirection aSide) { + return getUEProducingSides().contains(aSide) || getUEConsumingSides().contains(aSide); + } + + private EnumSet getUEConsumingSides() { + EnumSet rSides = EnumSet.noneOf(ForgeDirection.class); + for (byte i = 0; i < 6; i++) { + if (inputEnergyFrom(i)) { + Object tTileEntity = getTileEntityAtSide(i); + if (tTileEntity != null && tTileEntity instanceof IConductor) { + rSides.add(ForgeDirection.getOrientation(i)); + } + } + } + return rSides; + } + + private EnumSet getUEProducingSides() { + EnumSet rSides = EnumSet.noneOf(ForgeDirection.class); + for (byte i = 0; i < 6; i++) { + if (outputsEnergyTo(i)) { + Object tTileEntity = getTileEntityAtSide(i); + if (tTileEntity != null && tTileEntity instanceof IConductor) { + rSides.add(ForgeDirection.getOrientation(i)); + } + } + } + return rSides; + }*/ +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/metatileentity/BaseTileEntity.java b/src/main/java/gregtech/api/metatileentity/BaseTileEntity.java new file mode 100644 index 0000000..3bf4607 --- /dev/null +++ b/src/main/java/gregtech/api/metatileentity/BaseTileEntity.java @@ -0,0 +1,228 @@ +package gregtech.api.metatileentity; + +import static gregtech.api.enums.GT_Values.GT; +import static gregtech.api.enums.GT_Values.NW; + +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.interfaces.tileentity.IHasWorldObjectAndCoords; +import gregtech.api.net.GT_Packet_Block_Event; +import gregtech.api.util.GT_Utility; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.IInventory; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.IFluidHandler; + +/** + * The Functions my old TileEntities and my BaseMetaTileEntities have in common. + * + * Basically everything a TileEntity should have. + */ +public abstract class BaseTileEntity extends TileEntity implements IHasWorldObjectAndCoords { + /** + * If this TileEntity checks for the Chunk to be loaded before returning World based values. + * The AdvPump hacks this to false to ensure everything runs properly even when far Chunks are not actively loaded. + * But anything else should not cause worfin' Chunks, uhh I mean orphan Chunks. + */ + public boolean ignoreUnloadedChunks = true; + + /** + * This Variable checks if this TileEntity is dead, because Minecraft is too stupid to have proper TileEntity unloading. + */ + public boolean isDead = false; + + /** + * Buffers adjacent TileEntities for faster access + * + * "this" means that there is no TileEntity, while "null" means that it doesn't know if there is even a TileEntity and still needs to check that if needed. + */ + private final TileEntity[] mBufferedTileEntities = new TileEntity[6]; + + private final void clearNullMarkersFromTileEntityBuffer() { + for (int i = 0; i < mBufferedTileEntities.length; i++) if (mBufferedTileEntities[i] == this) mBufferedTileEntities[i] = null; + } + + /** + * Called automatically when the Coordinates of this TileEntity have been changed + */ + protected final void clearTileEntityBuffer() { + for (int i = 0; i < mBufferedTileEntities.length; i++) mBufferedTileEntities[i] = null; + } + + @Override public final World getWorld () {return worldObj;} + @Override public final int getXCoord() {return xCoord;} + @Override public final short getYCoord() {return (short)yCoord;} + @Override public final int getZCoord() {return zCoord;} + @Override public final int getOffsetX(byte aSide, int aMultiplier) {return xCoord + ForgeDirection.getOrientation(aSide).offsetX * aMultiplier ;} + @Override public final short getOffsetY(byte aSide, int aMultiplier) {return (short)(yCoord + ForgeDirection.getOrientation(aSide).offsetY * aMultiplier);} + @Override public final int getOffsetZ(byte aSide, int aMultiplier) {return zCoord + ForgeDirection.getOrientation(aSide).offsetZ * aMultiplier ;} + @Override public final boolean isServerSide() {return !worldObj.isRemote;} + @Override public final boolean isClientSide() {return worldObj.isRemote;} + @Override public final boolean openGUI(EntityPlayer aPlayer) {return openGUI(aPlayer, 0);} + @Override public final boolean openGUI(EntityPlayer aPlayer, int aID) {if (aPlayer == null) return false; aPlayer.openGui(GT, aID, worldObj, xCoord, yCoord, zCoord); return true;} + @Override public final int getRandomNumber(int aRange) {return worldObj.rand.nextInt(aRange);} + @Override public final BiomeGenBase getBiome(int aX, int aZ) {return worldObj.getBiomeGenForCoords(aX, aZ);} + @Override public final BiomeGenBase getBiome() {return getBiome(xCoord, zCoord);} + @Override public final Block getBlockOffset(int aX, int aY, int aZ) {return getBlock(xCoord+aX, yCoord+aY, zCoord+aZ);} + @Override public final Block getBlockAtSide(byte aSide) {return getBlockAtSideAndDistance(aSide, 1);} + @Override public final Block getBlockAtSideAndDistance(byte aSide, int aDistance) {return getBlock(getOffsetX(aSide, aDistance), getOffsetY(aSide, aDistance), getOffsetZ(aSide, aDistance));} + @Override public final byte getMetaIDOffset(int aX, int aY, int aZ) {return getMetaID(xCoord+aX, yCoord+aY, zCoord+aZ);} + @Override public final byte getMetaIDAtSide(byte aSide) {return getMetaIDAtSideAndDistance(aSide, 1);} + @Override public final byte getMetaIDAtSideAndDistance(byte aSide, int aDistance) {return getMetaID(getOffsetX(aSide, aDistance), getOffsetY(aSide, aDistance), getOffsetZ(aSide, aDistance));} + @Override public final byte getLightLevelOffset(int aX, int aY, int aZ) {return getLightLevel(xCoord+aX, yCoord+aY, zCoord+aZ);} + @Override public final byte getLightLevelAtSide(byte aSide) {return getLightLevelAtSideAndDistance(aSide, 1);} + @Override public final byte getLightLevelAtSideAndDistance(byte aSide, int aDistance) {return getLightLevel(getOffsetX(aSide, aDistance), getOffsetY(aSide, aDistance), getOffsetZ(aSide, aDistance));} + @Override public final boolean getOpacityOffset(int aX, int aY, int aZ) {return getOpacity(xCoord+aX, yCoord+aY, zCoord+aZ);} + @Override public final boolean getOpacityAtSide(byte aSide) {return getOpacityAtSideAndDistance(aSide, 1);} + @Override public final boolean getOpacityAtSideAndDistance(byte aSide, int aDistance) {return getOpacity(getOffsetX(aSide, aDistance), getOffsetY(aSide, aDistance), getOffsetZ(aSide, aDistance));} + @Override public final boolean getSkyOffset(int aX, int aY, int aZ) {return getSky(xCoord+aX, yCoord+aY, zCoord+aZ);} + @Override public final boolean getSkyAtSide(byte aSide) {return getSkyAtSideAndDistance(aSide, 1);} + @Override public final boolean getSkyAtSideAndDistance(byte aSide, int aDistance) {return getSky(getOffsetX(aSide, aDistance), getOffsetY(aSide, aDistance), getOffsetZ(aSide, aDistance));} + @Override public final boolean getAirOffset(int aX, int aY, int aZ) {return getAir(xCoord+aX, yCoord+aY, zCoord+aZ);} + @Override public final boolean getAirAtSide(byte aSide) {return getAirAtSideAndDistance(aSide, 1);} + @Override public final boolean getAirAtSideAndDistance(byte aSide, int aDistance) {return getAir(getOffsetX(aSide, aDistance), getOffsetY(aSide, aDistance), getOffsetZ(aSide, aDistance));} + @Override public final TileEntity getTileEntityOffset(int aX, int aY, int aZ) {return getTileEntity(xCoord+aX, yCoord+aY, zCoord+aZ);} + @Override public final TileEntity getTileEntityAtSideAndDistance(byte aSide, int aDistance) {if (aDistance == 1) return getTileEntityAtSide(aSide); return getTileEntity(getOffsetX(aSide, aDistance), getOffsetY(aSide, aDistance), getOffsetZ(aSide, aDistance));} + @Override public final IInventory getIInventory(int aX, int aY, int aZ) {TileEntity tTileEntity = getTileEntity(aX, aY, aZ); if (tTileEntity instanceof IInventory) return (IInventory)tTileEntity; return null;} + @Override public final IInventory getIInventoryOffset(int aX, int aY, int aZ) {TileEntity tTileEntity = getTileEntityOffset(aX, aY, aZ); if (tTileEntity instanceof IInventory) return (IInventory)tTileEntity; return null;} + @Override public final IInventory getIInventoryAtSide(byte aSide) {TileEntity tTileEntity = getTileEntityAtSide(aSide); if (tTileEntity instanceof IInventory) return (IInventory)tTileEntity; return null;} + @Override public final IInventory getIInventoryAtSideAndDistance(byte aSide, int aDistance) {TileEntity tTileEntity = getTileEntityAtSideAndDistance(aSide, aDistance); if (tTileEntity instanceof IInventory) return (IInventory)tTileEntity; return null;} + @Override public final IFluidHandler getITankContainer(int aX, int aY, int aZ) {TileEntity tTileEntity = getTileEntity(aX, aY, aZ); if (tTileEntity instanceof IFluidHandler) return (IFluidHandler)tTileEntity; return null;} + @Override public final IFluidHandler getITankContainerOffset(int aX, int aY, int aZ) {TileEntity tTileEntity = getTileEntityOffset(aX, aY, aZ); if (tTileEntity instanceof IFluidHandler) return (IFluidHandler)tTileEntity; return null;} + @Override public final IFluidHandler getITankContainerAtSide(byte aSide) {TileEntity tTileEntity = getTileEntityAtSide(aSide); if (tTileEntity instanceof IFluidHandler) return (IFluidHandler)tTileEntity; return null;} + @Override public final IFluidHandler getITankContainerAtSideAndDistance(byte aSide, int aDistance) {TileEntity tTileEntity = getTileEntityAtSideAndDistance(aSide, aDistance); if (tTileEntity instanceof IFluidHandler) return (IFluidHandler)tTileEntity; return null;} + @Override public final IGregTechTileEntity getIGregTechTileEntity(int aX, int aY, int aZ) {TileEntity tTileEntity = getTileEntity(aX, aY, aZ); if (tTileEntity instanceof IGregTechTileEntity) return (IGregTechTileEntity)tTileEntity; return null;} + @Override public final IGregTechTileEntity getIGregTechTileEntityOffset(int aX, int aY, int aZ) {TileEntity tTileEntity = getTileEntityOffset(aX, aY, aZ); if (tTileEntity instanceof IGregTechTileEntity) return (IGregTechTileEntity)tTileEntity; return null;} + @Override public final IGregTechTileEntity getIGregTechTileEntityAtSide(byte aSide) {TileEntity tTileEntity = getTileEntityAtSide(aSide); if (tTileEntity instanceof IGregTechTileEntity) return (IGregTechTileEntity)tTileEntity; return null;} + @Override public final IGregTechTileEntity getIGregTechTileEntityAtSideAndDistance(byte aSide, int aDistance) {TileEntity tTileEntity = getTileEntityAtSideAndDistance(aSide, aDistance); if (tTileEntity instanceof IGregTechTileEntity) return (IGregTechTileEntity)tTileEntity; return null;} + + @Override + public final Block getBlock(int aX, int aY, int aZ) { + if (ignoreUnloadedChunks && crossedChunkBorder(aX, aZ) && !worldObj.blockExists(aX, aY, aZ)) return Blocks.air; + return worldObj.getBlock(aX, aY, aZ); + } + + @Override + public final byte getMetaID(int aX, int aY, int aZ) { + if (ignoreUnloadedChunks && crossedChunkBorder(aX, aZ) && !worldObj.blockExists(aX, aY, aZ)) return 0; + return (byte)worldObj.getBlockMetadata(aX, aY, aZ); + } + + @Override + public final byte getLightLevel(int aX, int aY, int aZ) { + if (ignoreUnloadedChunks && crossedChunkBorder(aX, aZ) && !worldObj.blockExists(aX, aY, aZ)) return 0; + return (byte)(worldObj.getLightBrightness(aX, aY, aZ)*15); + } + + @Override + public final boolean getSky(int aX, int aY, int aZ) { + if (ignoreUnloadedChunks && crossedChunkBorder(aX, aZ) && !worldObj.blockExists(aX, aY, aZ)) return true; + return worldObj.canBlockSeeTheSky(aX, aY, aZ); + } + + @Override + public final boolean getOpacity(int aX, int aY, int aZ) { + if (ignoreUnloadedChunks && crossedChunkBorder(aX, aZ) && !worldObj.blockExists(aX, aY, aZ)) return false; + return GT_Utility.isOpaqueBlock(worldObj, aX, aY, aZ); + } + + @Override + public final boolean getAir(int aX, int aY, int aZ) { + if (ignoreUnloadedChunks && crossedChunkBorder(aX, aZ) && !worldObj.blockExists(aX, aY, aZ)) return true; + return GT_Utility.isAirBlock(worldObj, aX, aY, aZ); + } + + @Override + public final TileEntity getTileEntity(int aX, int aY, int aZ) { + if (ignoreUnloadedChunks && crossedChunkBorder(aX, aZ) && !worldObj.blockExists(aX, aY, aZ)) return null; + return worldObj.getTileEntity(aX, aY, aZ); + } + + @Override + public final TileEntity getTileEntityAtSide(byte aSide) { + if (aSide < 0 || aSide >= 6 || mBufferedTileEntities[aSide] == this) return null; + int tX = getOffsetX(aSide, 1), tY = getOffsetY(aSide, 1), tZ = getOffsetZ(aSide, 1); + if (crossedChunkBorder(tX, tZ)) { + mBufferedTileEntities[aSide] = null; + if (ignoreUnloadedChunks && !worldObj.blockExists(tX, tY, tZ)) return null; + } + if (mBufferedTileEntities[aSide] == null) { + mBufferedTileEntities[aSide] = worldObj.getTileEntity(tX, tY, tZ); + if (mBufferedTileEntities[aSide] == null) { + mBufferedTileEntities[aSide] = this; + return null; + } + return mBufferedTileEntities[aSide]; + } + if (mBufferedTileEntities[aSide].isInvalid()) { + mBufferedTileEntities[aSide] = null; + return getTileEntityAtSide(aSide); + } + if (mBufferedTileEntities[aSide].xCoord == tX && mBufferedTileEntities[aSide].yCoord == tY && mBufferedTileEntities[aSide].zCoord == tZ) { + return mBufferedTileEntities[aSide]; + } + return null; + } + + @Override + public void writeToNBT(NBTTagCompound aNBT) { + super.writeToNBT(aNBT); + //isDead = true; + } + + @Override + public boolean isDead() { + return isDead || isInvalidTileEntity(); + } + + @Override + public void validate() { + clearNullMarkersFromTileEntityBuffer(); + super.validate(); + } + + @Override + public void invalidate() { + clearNullMarkersFromTileEntityBuffer(); + super.invalidate(); + } + + @Override + public void onChunkUnload() { + clearNullMarkersFromTileEntityBuffer(); + super.onChunkUnload(); + isDead = true; + } + + @Override + public void updateEntity() { + // Well if the TileEntity gets ticked it is alive. + isDead = false; + } + + public final void onAdjacentBlockChange(int aX, int aY, int aZ) { + clearNullMarkersFromTileEntityBuffer(); + } + + @Override + public final void sendBlockEvent(byte aID, byte aValue) { + NW.sendPacketToAllPlayersInRange(worldObj, new GT_Packet_Block_Event(xCoord, (short)yCoord, zCoord, aID, aValue), xCoord, zCoord); + } + + private boolean crossedChunkBorder(int aX, int aZ) { + return aX >> 4 != xCoord >> 4 || aZ >> 4 != zCoord >> 4; + } + + public final void setOnFire() { + GT_Utility.setCoordsOnFire(worldObj, xCoord, yCoord, zCoord, false); + } + + public final void setToFire() { + worldObj.setBlock(xCoord, yCoord, zCoord, Blocks.fire); + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java b/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java new file mode 100644 index 0000000..158c1ee --- /dev/null +++ b/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java @@ -0,0 +1,534 @@ +package gregtech.api.metatileentity; + +import static gregtech.api.enums.GT_Values.GT; +import static gregtech.api.enums.GT_Values.V; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.GregTech_API; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.objects.GT_ItemStack; +import gregtech.api.util.GT_Config; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_Utility; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTankInfo; + +/** + * NEVER INCLUDE THIS FILE IN YOUR MOD!!! + * + * Extend this Class to add a new MetaPipe + * Call the Constructor with the desired ID at the load-phase (not preload and also not postload!) + * Implement the newMetaEntity-Method to return a new ready instance of your MetaTileEntity + * + * Call the Constructor like the following example inside the Load Phase, to register it. + * "new GT_MetaTileEntity_E_Furnace(54, "GT_E_Furnace", "Automatic E-Furnace");" + */ +public abstract class MetaPipeEntity implements IMetaTileEntity { + /** + * This variable tells, which directions the Block is connected to. It is a Bitmask. + */ + public byte mConnections = 0; + + /** + * For Pipe Rendering + */ + public abstract float getThickNess(); + + /** + * For Pipe Rendering + */ + public abstract boolean renderInside(byte aSide); + + /** + * Only assigned for the MetaTileEntity in the List! Also only used to get the localized Name for the ItemStack and for getInvName. + */ + public String mName; + + public boolean doTickProfilingInThisTick = true; + + /** + * accessibility to this Field is no longer given, see below + */ + private IGregTechTileEntity mBaseMetaTileEntity; + + @Override + public IGregTechTileEntity getBaseMetaTileEntity() { + return mBaseMetaTileEntity; + } + + @Override + public ItemStack getStackForm(long aAmount) { + return new ItemStack(GregTech_API.sBlockMachines, (int)aAmount, getBaseMetaTileEntity().getMetaTileID()); + } + + /** + * The Inventory of the MetaTileEntity. Amount of Slots can be larger than 256. HAYO! + */ + public final ItemStack[] mInventory; + + /** + * This registers your Machine at the List. + * Use only ID's larger than 2048, because i reserved these ones. + * See also the List in the API, as it has a Description containing all the reservations. + * @param aID the ID + * @example for Constructor overload. + * + * public GT_MetaTileEntity_EBench(int aID, String mName, String mNameRegional) { + * super(aID, mName, mNameRegional); + * } + */ + public MetaPipeEntity(int aID, String aBasicName, String aRegionalName, int aInvSlotCount) { + if (GregTech_API.sPostloadStarted || !GregTech_API.sPreloadStarted) throw new IllegalAccessError("This Constructor has to be called in the load Phase"); + if (GregTech_API.METATILEENTITIES[aID] == null) { + GregTech_API.METATILEENTITIES[aID] = this; + } else { + throw new IllegalArgumentException("MetaMachine-Slot Nr. " + aID + " is already occupied!"); + } + mName = aBasicName.replaceAll(" ", "_").toLowerCase(); + setBaseMetaTileEntity(new BaseMetaPipeEntity()); + getBaseMetaTileEntity().setMetaTileID((short)aID); + GT_LanguageManager.addStringLocalization("gt.blockmachines." + mName + ".name", aRegionalName); + mInventory = new ItemStack[aInvSlotCount]; + + if (GT.isClientSide()) { + ItemStack tStack = new ItemStack(GregTech_API.sBlockMachines, 1, aID); + tStack.getItem().addInformation(tStack, null, new ArrayList(), true); + } + } + + @Override + public void setBaseMetaTileEntity(IGregTechTileEntity aBaseMetaTileEntity) { + if (mBaseMetaTileEntity != null && aBaseMetaTileEntity == null) { + mBaseMetaTileEntity.getMetaTileEntity().inValidate(); + mBaseMetaTileEntity.setMetaTileEntity(null); + } + mBaseMetaTileEntity = aBaseMetaTileEntity; + if (mBaseMetaTileEntity != null) { + mBaseMetaTileEntity.setMetaTileEntity(this); + } + } + + /** + * This is the normal Constructor. + */ + public MetaPipeEntity(String aName, int aInvSlotCount) { + mInventory = new ItemStack[aInvSlotCount]; + mName = aName; + } + + @Override + public void onServerStart() {/*Do nothing*/} + @Override + public void onWorldSave(File aSaveDirectory) {/*Do nothing*/} + @Override + public void onWorldLoad(File aSaveDirectory) {/*Do nothing*/} + @Override + public void onConfigLoad(GT_Config aConfig) {/*Do nothing*/} + @Override + public void setItemNBT(NBTTagCompound aNBT) {/*Do nothing*/} + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister aBlockIconRegister) {/*Do nothing*/} + + @Override + public boolean allowCoverOnSide(byte aSide, GT_ItemStack aCoverID) {return true;} + @Override + public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {/*Do nothing*/} + @Override + public boolean onWrenchRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {return false;} + @Override + public void onExplosion() {/*Do nothing*/} + @Override + public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) {/*Do nothing*/} + @Override + public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {/*Do nothing*/} + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {/*Do nothing*/} + @Override + public void inValidate() {/*Do nothing*/} + @Override + public void onRemoval() {/*Do nothing*/} + @Override + public void initDefaultModes(NBTTagCompound aNBT) {/*Do nothing*/} + + /** + * When a GUI is opened + */ + public void onOpenGUI() {/*Do nothing*/} + + /** + * When a GUI is closed + */ + public void onCloseGUI() {/*Do nothing*/} + + /** + * a Player rightclicks the Machine + * Sneaky rightclicks are not getting passed to this! + */ + @Override + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) {return false;} + @Override + public void onLeftclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {/*Do nothing*/} + @Override + public void onValueUpdate(byte aValue) {/*Do nothing*/} + @Override + public byte getUpdateData() {return 0;} + + @Override + public void doSound(byte aIndex, double aX, double aY, double aZ) {/*Do nothing*/} + @Override + public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) {/*Do nothing*/} + @Override + public void stopSoundLoop(byte aValue, double aX, double aY, double aZ) {/*Do nothing*/} + + @Override + public final void sendSound(byte aIndex) {if (!getBaseMetaTileEntity().hasMufflerUpgrade()) getBaseMetaTileEntity().sendBlockEvent((byte)4, aIndex);} + @Override + public final void sendLoopStart(byte aIndex) {if (!getBaseMetaTileEntity().hasMufflerUpgrade()) getBaseMetaTileEntity().sendBlockEvent((byte)5, aIndex);} + @Override + public final void sendLoopEnd(byte aIndex) {if (!getBaseMetaTileEntity().hasMufflerUpgrade()) getBaseMetaTileEntity().sendBlockEvent((byte)6, aIndex);} + + @Override + public boolean isFacingValid(byte aFacing) {return false;} + @Override + public boolean isAccessAllowed(EntityPlayer aPlayer) {return true;} + @Override + public boolean isValidSlot(int aIndex) {return true;} + @Override + public boolean setStackToZeroInsteadOfNull(int aIndex) {return false;} + + @Override + public ArrayList getSpecialDebugInfo(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, int aLogLevel, ArrayList aList) { + return aList; + } + + @Override + public boolean isLiquidInput(byte aSide) { + return true; + } + + @Override + public boolean isLiquidOutput(byte aSide) { + return true; + } + + /** + * gets the contained Liquid + */ + @Override + public FluidStack getFluid() {return null;} + + /** + * tries to fill this Tank + */ + @Override + public int fill(FluidStack resource, boolean doFill) {return 0;} + + /** + * tries to empty this Tank + */ + @Override + public FluidStack drain(int maxDrain, boolean doDrain) {return null;} + + /** + * Tank pressure + */ + public int getTankPressure() {return 0;} + + /** + * Liquid Capacity + */ + @Override + public int getCapacity() {return 0;} + + /** + * Progress this machine has already made + */ + public int getProgresstime() {return 0;} + + /** + * Progress this Machine has to do to produce something + */ + public int maxProgresstime() {return 0;} + + /** + * Increases the Progress, returns the overflown Progress. + */ + public int increaseProgress(int aProgress) {return 0;} + + @Override + public void onMachineBlockUpdate() {/*Do nothing*/} + @Override + public void receiveClientEvent(byte aEventID, byte aValue) {/*Do nothing*/} + @Override + public boolean isSimpleMachine() {return false;} + + @Override + public byte getComparatorValue(byte aSide) { + return 0; + } + + @Override + public boolean acceptsRotationalEnergy(byte aSide) { + return false; + } + + @Override + public boolean injectRotationalEnergy(byte aSide, long aSpeed, long aEnergy) { + return false; + } + + @Override + public String getSpecialVoltageToolTip() {return null;} + + @Override + public boolean isGivingInformation() {return false;} + @Override + public String[] getInfoData() {return new String[]{};} + + public boolean isDigitalChest() {return false;} + public ItemStack[] getStoredItemData() {return null;} + public void setItemCount(int aCount) {/*Do nothing*/} + public int getMaxItemCount() {return 0;} + + @Override + public int getSizeInventory() {return mInventory.length;} + @Override + public ItemStack getStackInSlot(int aIndex) {if (aIndex >= 0 && aIndex < mInventory.length) return mInventory[aIndex]; return null;} + @Override + public void setInventorySlotContents(int aIndex, ItemStack aStack) {if (aIndex >= 0 && aIndex < mInventory.length) mInventory[aIndex] = aStack;} + @Override + public String getInventoryName() {if (GregTech_API.METATILEENTITIES[getBaseMetaTileEntity().getMetaTileID()] != null) return GregTech_API.METATILEENTITIES[getBaseMetaTileEntity().getMetaTileID()].getMetaName(); return "";} + @Override + public int getInventoryStackLimit() {return 64;} + @Override + public boolean isItemValidForSlot(int aIndex, ItemStack aStack) {return getBaseMetaTileEntity().isValidSlot(aIndex);} + + @Override + public ItemStack decrStackSize(int aIndex, int aAmount) { + ItemStack tStack = getStackInSlot(aIndex), rStack = GT_Utility.copy(tStack); + if (tStack != null) { + if (tStack.stackSize <= aAmount) { + if (setStackToZeroInsteadOfNull(aIndex)) tStack.stackSize = 0; else setInventorySlotContents(aIndex, null); + } else { + rStack = tStack.splitStack(aAmount); + if (tStack.stackSize == 0 && !setStackToZeroInsteadOfNull(aIndex)) setInventorySlotContents(aIndex, null); + } + } + return rStack; + } + + @Override + public int[] getAccessibleSlotsFromSide(int aSide) { + ArrayList tList = new ArrayList(); + IGregTechTileEntity tTileEntity = getBaseMetaTileEntity(); + boolean tSkip = tTileEntity.getCoverBehaviorAtSide((byte)aSide).letsItemsIn((byte)aSide, tTileEntity.getCoverIDAtSide((byte)aSide), tTileEntity.getCoverDataAtSide((byte)aSide), -2, tTileEntity) || tTileEntity.getCoverBehaviorAtSide((byte)aSide).letsItemsOut((byte)aSide, tTileEntity.getCoverIDAtSide((byte)aSide), tTileEntity.getCoverDataAtSide((byte)aSide), -2, tTileEntity); + for (int i = 0; i < getSizeInventory(); i++) if (isValidSlot(i) && (tSkip || tTileEntity.getCoverBehaviorAtSide((byte)aSide).letsItemsOut((byte)aSide, tTileEntity.getCoverIDAtSide((byte)aSide), tTileEntity.getCoverDataAtSide((byte)aSide), i, tTileEntity) || tTileEntity.getCoverBehaviorAtSide((byte)aSide).letsItemsIn((byte)aSide, tTileEntity.getCoverIDAtSide((byte)aSide), tTileEntity.getCoverDataAtSide((byte)aSide), i, tTileEntity))) tList.add(i); + int[] rArray = new int[tList.size()]; + for (int i = 0; i < rArray.length; i++) rArray[i] = tList.get(i); + return rArray; + } + + @Override + public boolean canInsertItem(int aIndex, ItemStack aStack, int aSide) { + return isValidSlot(aIndex) && aStack != null && aIndex < mInventory.length && (mInventory[aIndex] == null || GT_Utility.areStacksEqual(aStack, mInventory[aIndex])) && allowPutStack(getBaseMetaTileEntity(), aIndex, (byte)aSide, aStack); + } + + @Override + public boolean canExtractItem(int aIndex, ItemStack aStack, int aSide) { + return isValidSlot(aIndex) && aStack != null && aIndex < mInventory.length && allowPullStack(getBaseMetaTileEntity(), aIndex, (byte)aSide, aStack); + } + + @Override + public boolean canFill(ForgeDirection aSide, Fluid aFluid) { + return fill(aSide, new FluidStack(aFluid, 1), false) == 1; + } + + @Override + public boolean canDrain(ForgeDirection aSide, Fluid aFluid) { + return drain(aSide, new FluidStack(aFluid, 1), false) != null; + } + + @Override + public FluidTankInfo[] getTankInfo(ForgeDirection aSide) { + if (getCapacity() <= 0 && !getBaseMetaTileEntity().hasSteamEngineUpgrade()) return new FluidTankInfo[] {}; + return new FluidTankInfo[] {getInfo()}; + } + + public int fill_default(ForgeDirection aSide, FluidStack aFluid, boolean doFill) { + return fill(aFluid, doFill); + } + + @Override + public int fill(ForgeDirection aSide, FluidStack aFluid, boolean doFill) { + return fill_default(aSide, aFluid, doFill); + } + + @Override + public FluidStack drain(ForgeDirection aSide, FluidStack aFluid, boolean doDrain) { + if (getFluid() != null && aFluid != null && getFluid().isFluidEqual(aFluid)) return drain(aFluid.amount, doDrain); + return null; + } + + @Override + public FluidStack drain(ForgeDirection aSide, int maxDrain, boolean doDrain) { + return drain(maxDrain, doDrain); + } + + @Override + public int getFluidAmount() { + return 0; + } + + @Override + public FluidTankInfo getInfo() { + return new FluidTankInfo(this); + } + + @Override + public String getMetaName() { + return mName; + } + + @Override + public ItemStack getStackInSlotOnClosing(int i) { + return null; + } + + @Override + public boolean doTickProfilingMessageDuringThisTick() { + return doTickProfilingInThisTick; + } + + @Override + public boolean isUseableByPlayer(EntityPlayer entityplayer) { + return false; + } + + @Override + public boolean connectsToItemPipe(byte aSide) { + return false; + } + + @Override + public void openInventory() { + // + } + + @Override + public void closeInventory() { + // + } + + @Override + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return null; + } + + @Override + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return null; + } + + @Override + public float getExplosionResistance(byte aSide) { + return 10.0F; + } + + @Override + public ItemStack[] getRealInventory() { + return mInventory; + } + + @Override + public boolean hasCustomInventoryName() { + return false; + } + + @Override + public void markDirty() { + // + } + + @Override + public void onColorChangeServer(byte aColor) { + // + } + + @Override + public void onColorChangeClient(byte aColor) { + // + } + + public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage) { + return 0; + } + + @Override + @SideOnly(Side.CLIENT) + public boolean renderInInventory(Block aBlock, int aMeta, RenderBlocks aRenderer) { + return false; + } + + @Override + @SideOnly(Side.CLIENT) + public boolean renderInWorld(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, RenderBlocks aRenderer) { + return false; + } + + @Override + public void doExplosion(long aExplosionPower) { + float tStrength = aExplosionPower outputAABB, Entity collider) { + AxisAlignedBB axisalignedbb1 = getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ); + if (axisalignedbb1 != null && inputAABB.intersectsWith(axisalignedbb1)) outputAABB.add(axisalignedbb1); + } + + @Override + public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) { + return AxisAlignedBB.getBoundingBox(aX, aY, aZ, aX+1, aY+1, aZ+1); + } + + @Override + public void onEntityCollidedWithBlock(World aWorld, int aX, int aY, int aZ, Entity collider) { + // + } + + @Override + public void onCreated(ItemStack aStack, World aWorld, EntityPlayer aPlayer) { + // + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java new file mode 100644 index 0000000..dfb325c --- /dev/null +++ b/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java @@ -0,0 +1,721 @@ +package gregtech.api.metatileentity; + +import static gregtech.api.enums.GT_Values.GT; +import static gregtech.api.enums.GT_Values.V; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.GregTech_API; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.objects.GT_ItemStack; +import gregtech.api.util.GT_Config; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Utility; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTankInfo; + +/** + * NEVER INCLUDE THIS FILE IN YOUR MOD!!! + * + * Extend this Class to add a new MetaMachine + * Call the Constructor with the desired ID at the load-phase (not preload and also not postload!) + * Implement the newMetaEntity-Method to return a new ready instance of your MetaTileEntity + * + * Call the Constructor like the following example inside the Load Phase, to register it. + * "new GT_MetaTileEntity_E_Furnace(54, "GT_E_Furnace", "Automatic E-Furnace");" + */ +public abstract class MetaTileEntity implements IMetaTileEntity { + /** + * Only assigned for the MetaTileEntity in the List! Also only used to get the localized Name for the ItemStack and for getInvName. + */ + public final String mName; + + public boolean doTickProfilingInThisTick = true; + + /** + * accessibility to this Field is no longer given, see below + */ + private IGregTechTileEntity mBaseMetaTileEntity; + + @Override + public IGregTechTileEntity getBaseMetaTileEntity() { + return mBaseMetaTileEntity; + } + + @Override + public ItemStack getStackForm(long aAmount) { + return new ItemStack(GregTech_API.sBlockMachines, (int)aAmount, getBaseMetaTileEntity().getMetaTileID()); + } + + public String getLocalName() { + return GT_LanguageManager.getTranslation("gt.blockmachines." + mName + ".name"); + } + + /** + * The Inventory of the MetaTileEntity. Amount of Slots can be larger than 256. HAYO! + */ + public final ItemStack[] mInventory; + + /** + * This registers your Machine at the List. + * Use only ID's larger than 2048, because i reserved these ones. + * See also the List in the API, as it has a Description containing all the reservations. + * @param aID the ID + * @example for Constructor overload. + * + * public GT_MetaTileEntity_EBench(int aID, String mName, String mNameRegional) { + * super(aID, mName, mNameRegional); + * } + */ + public MetaTileEntity(int aID, String aBasicName, String aRegionalName, int aInvSlotCount) { + if (GregTech_API.sPostloadStarted || !GregTech_API.sPreloadStarted) throw new IllegalAccessError("This Constructor has to be called in the load Phase"); + if (GregTech_API.METATILEENTITIES[aID] == null) { + GregTech_API.METATILEENTITIES[aID] = this; + } else { + throw new IllegalArgumentException("MetaMachine-Slot Nr. " + aID + " is already occupied!"); + } + mName = aBasicName.replaceAll(" ", "_").toLowerCase(); + setBaseMetaTileEntity(GregTech_API.constructBaseMetaTileEntity()); + getBaseMetaTileEntity().setMetaTileID((short)aID); + GT_LanguageManager.addStringLocalization("gt.blockmachines." + mName + ".name", aRegionalName); + mInventory = new ItemStack[aInvSlotCount]; + + if (GT.isClientSide()) { + ItemStack tStack = new ItemStack(GregTech_API.sBlockMachines, 1, aID); + tStack.getItem().addInformation(tStack, null, new ArrayList(), true); + } + } + + @Override + public void setBaseMetaTileEntity(IGregTechTileEntity aBaseMetaTileEntity) { + if (mBaseMetaTileEntity != null && aBaseMetaTileEntity == null) { + mBaseMetaTileEntity.getMetaTileEntity().inValidate(); + mBaseMetaTileEntity.setMetaTileEntity(null); + } + mBaseMetaTileEntity = aBaseMetaTileEntity; + if (mBaseMetaTileEntity != null) { + mBaseMetaTileEntity.setMetaTileEntity(this); + } + } + + /** + * This is the normal Constructor. + */ + public MetaTileEntity(String aName, int aInvSlotCount) { + mInventory = new ItemStack[aInvSlotCount]; + mName = aName; + } + + @Override + public void onServerStart() {/*Do nothing*/} + @Override + public void onWorldSave(File aSaveDirectory) {/*Do nothing*/} + @Override + public void onWorldLoad(File aSaveDirectory) {/*Do nothing*/} + @Override + public void onConfigLoad(GT_Config aConfig) {/*Do nothing*/} + @Override + public void setItemNBT(NBTTagCompound aNBT) {/*Do nothing*/} + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister aBlockIconRegister) {/*Do nothing*/} + + @Override + public boolean allowCoverOnSide(byte aSide, GT_ItemStack aStack) {return true;} + @Override + public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {/*Do nothing*/} + @Override + public boolean onWrenchRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {if (getBaseMetaTileEntity().isValidFacing(aWrenchingSide)) {getBaseMetaTileEntity().setFrontFacing(aWrenchingSide); return true;} return false;} + @Override + public void onExplosion() {/*Do nothing*/} + @Override + public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) {/*Do nothing*/} + @Override + public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {/*Do nothing*/} + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {/*Do nothing*/} + @Override + public void inValidate() {/*Do nothing*/} + @Override + public void onRemoval() {/*Do nothing*/} + @Override + public void initDefaultModes(NBTTagCompound aNBT) {/*Do nothing*/} + + /** + * When a GUI is opened + */ + public void onOpenGUI() {/*Do nothing*/} + + /** + * When a GUI is closed + */ + public void onCloseGUI() {/*Do nothing*/} + + /** + * a Player rightclicks the Machine + * Sneaky rightclicks are not getting passed to this! + */ + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {return false;} + + @Override + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) {return onRightclick(aBaseMetaTileEntity, aPlayer);} + @Override + public void onLeftclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {/*Do nothing*/} + @Override + public void onValueUpdate(byte aValue) {/*Do nothing*/} + @Override + public byte getUpdateData() {return 0;} + + @Override + public void doSound(byte aIndex, double aX, double aY, double aZ) {/*Do nothing*/} + @Override + public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) {/*Do nothing*/} + @Override + public void stopSoundLoop(byte aValue, double aX, double aY, double aZ) {/*Do nothing*/} + + @Override + public final void sendSound(byte aIndex) {if (!getBaseMetaTileEntity().hasMufflerUpgrade()) getBaseMetaTileEntity().sendBlockEvent((byte)4, aIndex);} + @Override + public final void sendLoopStart(byte aIndex) {if (!getBaseMetaTileEntity().hasMufflerUpgrade()) getBaseMetaTileEntity().sendBlockEvent((byte)5, aIndex);} + @Override + public final void sendLoopEnd(byte aIndex) {if (!getBaseMetaTileEntity().hasMufflerUpgrade()) getBaseMetaTileEntity().sendBlockEvent((byte)6, aIndex);} + + /** + * @return true if this Device emits Energy at all + */ + public boolean isElectric() {return true;} + + /** + * @return true if this Device emits Energy at all + */ + public boolean isPneumatic() {return false;} + + /** + * @return true if this Device emits Energy at all + */ + public boolean isSteampowered() {return false;} + + /** + * @return true if this Device emits Energy at all + */ + public boolean isEnetOutput() {return false;} + + /** + * @return true if this Device consumes Energy at all + */ + public boolean isEnetInput() {return false;} + + /** + * @return the amount of EU, which can be stored in this Device. Default is 0 EU. + */ + public long maxEUStore() {return 0;} + + /** + * @return the amount of EU/t, which can be accepted by this Device before it explodes. + */ + public long maxEUInput() {return 0;} + + /** + * @return the amount of EU/t, which can be outputted by this Device. + */ + public long maxEUOutput() {return 0;} + + /** + * @return the amount of E-net Impulses of the maxEUOutput size, which can be outputted by this Device. + * Default is 1 Pulse, this shouldn't be set to smaller Values than 1, as it won't output anything in that Case! + */ + public long maxAmperesOut() {return 1;} + + /** + * How many Amperes this Block can suck at max. Surpassing this value won't blow it up. + */ + public long maxAmperesIn() {return 1;} + + /** + * @return true if that Side is an Output. + */ + public boolean isOutputFacing(byte aSide) {return false;} + + /** + * @return true if that Side is an Input. + */ + public boolean isInputFacing(byte aSide) {return false;} + + /** + * @return true if Transformer Upgrades increase Packet Amount. + */ + public boolean isTransformingLowEnergy() {return true;} + + @Override + public boolean isFacingValid(byte aFacing) {return false;} + @Override + public boolean isAccessAllowed(EntityPlayer aPlayer) {return false;} + @Override + public boolean isValidSlot(int aIndex) {return true;} + @Override + public boolean setStackToZeroInsteadOfNull(int aIndex) {return false;} + + /** + * This is used to set the internal Energy to the given Parameter. I use this for the IDSU. + */ + public void setEUVar(long aEnergy) { + ((BaseMetaTileEntity)mBaseMetaTileEntity).mStoredEnergy = aEnergy; + } + + /** + * This is used to get the internal Energy. I use this for the IDSU. + */ + public long getEUVar() { + return ((BaseMetaTileEntity)mBaseMetaTileEntity).mStoredEnergy; + } + + /** + * This is used to set the internal Steam Energy to the given Parameter. + */ + public void setSteamVar(long aSteam) { + ((BaseMetaTileEntity)mBaseMetaTileEntity).mStoredSteam = aSteam; + } + + /** + * This is used to get the internal Steam Energy. + */ + public long getSteamVar() { + return ((BaseMetaTileEntity)mBaseMetaTileEntity).mStoredSteam; + } + + /** + * @return the amount of Steam, which can be stored in this Device. Default is 0 EU. + */ + public long maxSteamStore() {return 0;} + + /** + * @return the amount of EU, which this Device stores before starting to emit Energy. + * useful if you don't want to emit stored Energy until a certain Level is reached. + */ + public long getMinimumStoredEU() { + return 512; + } + + /** + * Determines the Tier of the Machine, used for de-charging Tools. + */ + public long getInputTier() { + return GT_Utility.getTier(getBaseMetaTileEntity().getInputVoltage()); + } + + /** + * Determines the Tier of the Machine, used for charging Tools. + */ + public long getOutputTier() { + return GT_Utility.getTier(getBaseMetaTileEntity().getOutputVoltage()); + } + + /** + * gets the first RechargerSlot + */ + public int rechargerSlotStartIndex() { + return 0; + } + + /** + * gets the amount of RechargerSlots + */ + public int rechargerSlotCount() { + return 0; + } + + /** + * gets the first DechargerSlot + */ + public int dechargerSlotStartIndex() { + return 0; + } + + /** + * gets the amount of DechargerSlots + */ + public int dechargerSlotCount() { + return 0; + } + + /** + * gets if this is protected from other Players per default or not + */ + public boolean ownerControl() { + return false; + } + + @Override + public ArrayList getSpecialDebugInfo(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, int aLogLevel, ArrayList aList) { + return aList; + } + + @Override + public boolean isLiquidInput(byte aSide) { + return true; + } + + @Override + public boolean isLiquidOutput(byte aSide) { + return true; + } + + /** + * gets the contained Liquid + */ + @Override + public FluidStack getFluid() {return null;} + + /** + * tries to fill this Tank + */ + @Override + public int fill(FluidStack resource, boolean doFill) {return 0;} + + /** + * tries to empty this Tank + */ + @Override + public FluidStack drain(int maxDrain, boolean doDrain) {return null;} + + /** + * Tank pressure + */ + public int getTankPressure() {return 0;} + + /** + * Liquid Capacity + */ + @Override + public int getCapacity() {return 0;} + + @Override + public void onMachineBlockUpdate() {/*Do nothing*/} + @Override + public void receiveClientEvent(byte aEventID, byte aValue) {/*Do nothing*/} + @Override + public boolean isSimpleMachine() {return false;} + + /** + * If this accepts up to 4 Overclockers + */ + public boolean isOverclockerUpgradable() {return false;} + + /** + * If this accepts Transformer Upgrades + */ + public boolean isTransformerUpgradable() {return false;} + + /** + * Progress this machine has already made + */ + public int getProgresstime() {return 0;} + + /** + * Progress this Machine has to do to produce something + */ + public int maxProgresstime() {return 0;} + + /** + * Increases the Progress, returns the overflown Progress. + */ + public int increaseProgress(int aProgress) {return 0;} + + /** + * If this TileEntity makes use of Sided Redstone behaviors. + * Determines only, if the Output Redstone Array is getting filled with 0 for true, or 15 for false. + */ + public boolean hasSidedRedstoneOutputBehavior() { + return false; + } + + /** + * When the Facing gets changed. + */ + public void onFacingChange() {/*Do nothing*/} + + /** + * if the IC2 Teleporter can drain from this. + */ + public boolean isTeleporterCompatible() { + return isEnetOutput() && getBaseMetaTileEntity().getOutputVoltage() >= 128 && getBaseMetaTileEntity().getUniversalEnergyCapacity() >= 500000; + } + + /** + * Gets the Output for the comparator on the given Side + */ + @Override + public byte getComparatorValue(byte aSide) { + return 0; + } + + @Override + public boolean acceptsRotationalEnergy(byte aSide) { + return false; + } + + @Override + public boolean injectRotationalEnergy(byte aSide, long aSpeed, long aEnergy) { + return false; + } + + @Override + public String getSpecialVoltageToolTip() {return null;} + + @Override + public boolean isGivingInformation() {return false;} + @Override + public String[] getInfoData() {return new String[]{};} + + public boolean isDigitalChest() {return false;} + public ItemStack[] getStoredItemData() {return null;} + public void setItemCount(int aCount) {/*Do nothing*/} + public int getMaxItemCount() {return 0;} + + @Override + public int getSizeInventory() {return mInventory.length;} + @Override + public ItemStack getStackInSlot(int aIndex) {if (aIndex >= 0 && aIndex < mInventory.length) return mInventory[aIndex]; return null;} + @Override + public void setInventorySlotContents(int aIndex, ItemStack aStack) {if (aIndex >= 0 && aIndex < mInventory.length) mInventory[aIndex] = aStack;} + @Override + public String getInventoryName() {if (GregTech_API.METATILEENTITIES[getBaseMetaTileEntity().getMetaTileID()] != null) return GregTech_API.METATILEENTITIES[getBaseMetaTileEntity().getMetaTileID()].getMetaName(); return "";} + @Override + public int getInventoryStackLimit() {return 64;} + @Override + public boolean isItemValidForSlot(int aIndex, ItemStack aStack) {return getBaseMetaTileEntity().isValidSlot(aIndex);} + + @Override + public ItemStack decrStackSize(int aIndex, int aAmount) { + ItemStack tStack = getStackInSlot(aIndex), rStack = GT_Utility.copy(tStack); + if (tStack != null) { + if (tStack.stackSize <= aAmount) { + if (setStackToZeroInsteadOfNull(aIndex)) tStack.stackSize = 0; else setInventorySlotContents(aIndex, null); + } else { + rStack = tStack.splitStack(aAmount); + if (tStack.stackSize == 0 && !setStackToZeroInsteadOfNull(aIndex)) setInventorySlotContents(aIndex, null); + } + } + return rStack; + } + + @Override + public int[] getAccessibleSlotsFromSide(int aSide) { + ArrayList tList = new ArrayList(); + IGregTechTileEntity tTileEntity = getBaseMetaTileEntity(); + boolean tSkip = tTileEntity.getCoverBehaviorAtSide((byte)aSide).letsItemsIn((byte)aSide, tTileEntity.getCoverIDAtSide((byte)aSide), tTileEntity.getCoverDataAtSide((byte)aSide), -2, tTileEntity) || tTileEntity.getCoverBehaviorAtSide((byte)aSide).letsItemsOut((byte)aSide, tTileEntity.getCoverIDAtSide((byte)aSide), tTileEntity.getCoverDataAtSide((byte)aSide), -2, tTileEntity); + for (int i = 0; i < getSizeInventory(); i++) if (isValidSlot(i) && (tSkip || tTileEntity.getCoverBehaviorAtSide((byte)aSide).letsItemsOut((byte)aSide, tTileEntity.getCoverIDAtSide((byte)aSide), tTileEntity.getCoverDataAtSide((byte)aSide), i, tTileEntity) || tTileEntity.getCoverBehaviorAtSide((byte)aSide).letsItemsIn((byte)aSide, tTileEntity.getCoverIDAtSide((byte)aSide), tTileEntity.getCoverDataAtSide((byte)aSide), i, tTileEntity))) tList.add(i); + int[] rArray = new int[tList.size()]; + for (int i = 0; i < rArray.length; i++) rArray[i] = tList.get(i); + return rArray; + } + + @Override + public boolean canInsertItem(int aIndex, ItemStack aStack, int aSide) { + return isValidSlot(aIndex) && aStack != null && aIndex < mInventory.length && (mInventory[aIndex] == null || GT_Utility.areStacksEqual(aStack, mInventory[aIndex])) && allowPutStack(getBaseMetaTileEntity(), aIndex, (byte)aSide, aStack); + } + + @Override + public boolean canExtractItem(int aIndex, ItemStack aStack, int aSide) { + return isValidSlot(aIndex) && aStack != null && aIndex < mInventory.length && allowPullStack(getBaseMetaTileEntity(), aIndex, (byte)aSide, aStack); + } + + @Override + public boolean canFill(ForgeDirection aSide, Fluid aFluid) { + return fill(aSide, new FluidStack(aFluid, 1), false) == 1; + } + + @Override + public boolean canDrain(ForgeDirection aSide, Fluid aFluid) { + return drain(aSide, new FluidStack(aFluid, 1), false) != null; + } + + @Override + public FluidTankInfo[] getTankInfo(ForgeDirection aSide) { + if (getCapacity() <= 0 && !getBaseMetaTileEntity().hasSteamEngineUpgrade()) return new FluidTankInfo[] {}; + return new FluidTankInfo[] {getInfo()}; + } + + public int fill_default(ForgeDirection aSide, FluidStack aFluid, boolean doFill) { + return fill(aFluid, doFill); + } + + @Override + public int fill(ForgeDirection aSide, FluidStack aFluid, boolean doFill) { + if (getBaseMetaTileEntity().hasSteamEngineUpgrade() && GT_ModHandler.isSteam(aFluid) && aFluid.amount > 1) { + int tSteam = (int)Math.min(Integer.MAX_VALUE, Math.min(aFluid.amount/2, getBaseMetaTileEntity().getSteamCapacity() - getBaseMetaTileEntity().getStoredSteam())); + if (tSteam > 0) { + if (doFill) getBaseMetaTileEntity().increaseStoredSteam(tSteam, true); + return tSteam*2; + } + } else { + return fill_default(aSide, aFluid, doFill); + } + return 0; + } + + @Override + public FluidStack drain(ForgeDirection aSide, FluidStack aFluid, boolean doDrain) { + if (getFluid() != null && aFluid != null && getFluid().isFluidEqual(aFluid)) return drain(aFluid.amount, doDrain); + return null; + } + + @Override + public FluidStack drain(ForgeDirection aSide, int maxDrain, boolean doDrain) { + return drain(maxDrain, doDrain); + } + + @Override + public int getFluidAmount() { + return 0; + } + + @Override + public FluidTankInfo getInfo() { + return new FluidTankInfo(this); + } + + @Override + public String getMetaName() { + return mName; + } + + @Override + public ItemStack getStackInSlotOnClosing(int i) { + return null; + } + + @Override + public boolean hasCustomInventoryName() { + return false; + } + + @Override + public boolean doTickProfilingMessageDuringThisTick() { + return doTickProfilingInThisTick; + } + + @Override + public void markDirty() { + // + } + + @Override + public boolean isUseableByPlayer(EntityPlayer entityplayer) { + return false; + } + + @Override + public void openInventory() { + // + } + + @Override + public void closeInventory() { + // + } + + @Override + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return null; + } + + @Override + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return null; + } + + @Override + public boolean connectsToItemPipe(byte aSide) { + return false; + } + + @Override + public float getExplosionResistance(byte aSide) { + return 10.0F; + } + + @Override + public ItemStack[] getRealInventory() { + return mInventory; + } + + @Override + public void onColorChangeServer(byte aColor) { + // + } + + @Override + public void onColorChangeClient(byte aColor) { + // + } + + @Override + @SideOnly(Side.CLIENT) + public boolean renderInInventory(Block aBlock, int aMeta, RenderBlocks aRenderer) { + return false; + } + + @Override + @SideOnly(Side.CLIENT) + public boolean renderInWorld(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, RenderBlocks aRenderer) { + return false; + } + + @Override + public void doExplosion(long aExplosionPower) { + float tStrength = aExplosionPower 0 ? 0 : 255; + } + + @Override + public void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, List outputAABB, Entity collider) { + AxisAlignedBB axisalignedbb1 = getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ); + if (axisalignedbb1 != null && inputAABB.intersectsWith(axisalignedbb1)) outputAABB.add(axisalignedbb1); + } + + @Override + public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) { + return AxisAlignedBB.getBoundingBox(aX, aY, aZ, aX+1, aY+1, aZ+1); + } + + @Override + public void onEntityCollidedWithBlock(World aWorld, int aX, int aY, int aZ, Entity collider) { + // + } + + @Override + public void onCreated(ItemStack aStack, World aWorld, EntityPlayer aPlayer) { + // + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/metatileentity/examples/GT_MetaTileEntity_E_Furnace.java b/src/main/java/gregtech/api/metatileentity/examples/GT_MetaTileEntity_E_Furnace.java new file mode 100644 index 0000000..a393ae5 --- /dev/null +++ b/src/main/java/gregtech/api/metatileentity/examples/GT_MetaTileEntity_E_Furnace.java @@ -0,0 +1,56 @@ +package gregtech.api.metatileentity.examples; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Utility; +import net.minecraft.item.ItemStack; + +/** + * This Example Implementation still works, however I use something completely different in my own Code. + */ +public class GT_MetaTileEntity_E_Furnace extends GT_MetaTileEntity_BasicMachine { + public GT_MetaTileEntity_E_Furnace(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, 1, "Not like using a Commodore 64", 1, 1, "E_Furnace.png", "smelting", new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_FURNACE_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_FURNACE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_FURNACE_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_FURNACE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_FURNACE_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_FURNACE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_FURNACE_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_FURNACE)); + } + + public GT_MetaTileEntity_E_Furnace(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { + super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); + } + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_E_Furnace(mName, mTier, mDescription, mTextures, mGUIName, mNEIName); + } + + @Override + public int checkRecipe() { + if (null != (mOutputItems[0] = GT_ModHandler.getSmeltingOutput(getInputAt(0), true, getOutputAt(0)))) { + mEUt = 4 * (1 << (mTier-1)) * (1 << (mTier-1)); + mMaxProgresstime = 128 / (1 << (mTier-1)); + return 2; + } + return 0; + } + + @Override + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack) && GT_ModHandler.getSmeltingOutput(GT_Utility.copyAmount(64, aStack), false, null) != null; + } + + @Override + public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { + super.startSoundLoop(aIndex, aX, aY, aZ); + if (aIndex == 1) GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(207), 10, 1.0F, aX, aY, aZ); + } + + @Override + public void startProcess() { + sendLoopStart((byte)1); + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java new file mode 100644 index 0000000..d7dd91c --- /dev/null +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java @@ -0,0 +1,229 @@ +package gregtech.api.metatileentity.implementations; + +import static gregtech.api.enums.GT_Values.VN; + +import java.util.ArrayList; +import java.util.Arrays; + +import gregtech.api.enums.Dyes; +import gregtech.api.enums.Materials; +import gregtech.api.enums.TextureSet; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.metatileentity.IMetaTileEntityCable; +import gregtech.api.interfaces.tileentity.IColoredTileEntity; +import gregtech.api.interfaces.tileentity.IEnergyConnected; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.BaseMetaPipeEntity; +import gregtech.api.metatileentity.MetaPipeEntity; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Utility; +import ic2.api.energy.tile.IEnergySink; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTileEntityCable { + public long mTransferredAmperage = 0, mTransferredAmperageLast20 = 0, mTransferredVoltageLast20 = 0; + + public final float mThickNess; + public final Materials mMaterial; + public final long mCableLossPerMeter, mAmperage, mVoltage; + public final boolean mInsulated, mCanShock; + + public GT_MetaPipeEntity_Cable(int aID, String aName, String aNameRegional, float aThickNess, Materials aMaterial, long aCableLossPerMeter, long aAmperage, long aVoltage, boolean aInsulated, boolean aCanShock) { + super(aID, aName, aNameRegional, 0); + mThickNess = aThickNess; + mMaterial = aMaterial; + mAmperage = aAmperage; + mVoltage = aVoltage; + mInsulated = aInsulated; + mCanShock = aCanShock; + mCableLossPerMeter = aCableLossPerMeter; + } + + public GT_MetaPipeEntity_Cable(String aName, float aThickNess, Materials aMaterial, long aCableLossPerMeter, long aAmperage, long aVoltage, boolean aInsulated, boolean aCanShock) { + super(aName, 0); + mThickNess = aThickNess; + mMaterial = aMaterial; + mAmperage = aAmperage; + mVoltage = aVoltage; + mInsulated = aInsulated; + mCanShock = aCanShock; + mCableLossPerMeter = aCableLossPerMeter; + } + + @Override + public byte getTileEntityBaseType() { + return (byte)(mInsulated?9:8); + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaPipeEntity_Cable(mName, mThickNess, mMaterial, mCableLossPerMeter, mAmperage, mVoltage, mInsulated, mCanShock); + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, byte aColorIndex, boolean aConnected, boolean aRedstone) { + if (!mInsulated) return new ITexture[] {new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa)}; + if (aConnected) { + float tThickNess = getThickNess(); + if (tThickNess < 0.37F) return new ITexture[] {new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_TINY , Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))}; + if (tThickNess < 0.49F) return new ITexture[] {new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_SMALL , Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))}; + if (tThickNess < 0.74F) return new ITexture[] {new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_MEDIUM , Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))}; + if (tThickNess < 0.99F) return new ITexture[] {new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_LARGE , Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))}; + return new ITexture[] {new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_HUGE , Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))}; + } + return new ITexture[] {new GT_RenderedTexture(Textures.BlockIcons.INSULATION_FULL, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))}; + } + + @Override + public void onEntityCollidedWithBlock(World aWorld, int aX, int aY, int aZ, Entity aEntity) { + if (mCanShock && (((BaseMetaPipeEntity)getBaseMetaTileEntity()).mConnections & -128) == 0 && aEntity instanceof EntityLivingBase) GT_Utility.applyElectricityDamage((EntityLivingBase)aEntity, mTransferredVoltageLast20, mTransferredAmperageLast20); + } + + @Override + public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) { + if (!mCanShock) return super.getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ); + return AxisAlignedBB.getBoundingBox(aX+0.125D, aY+0.125D, aZ+0.125D, aX+0.875D, aY+0.875D, aZ+0.875D); + } + + @Override public boolean isSimpleMachine() {return true;} + @Override public boolean isFacingValid(byte aFacing) {return false;} + @Override public boolean isValidSlot(int aIndex) {return true;} + @Override public final boolean renderInside(byte aSide) {return false;} + @Override public int getProgresstime() {return (int)mTransferredAmperage*64;} + @Override public int maxProgresstime() {return (int)mAmperage*64;} + + @Override + public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage) { + if (!getBaseMetaTileEntity().getCoverBehaviorAtSide(aSide).letsEnergyIn(aSide, getBaseMetaTileEntity().getCoverIDAtSide(aSide), getBaseMetaTileEntity().getCoverDataAtSide(aSide), getBaseMetaTileEntity())) return 0; + return transferElectricity(aSide, aVoltage, aAmperage, new ArrayList(Arrays.asList((TileEntity)getBaseMetaTileEntity()))); + } + + @Override + public long transferElectricity(byte aSide, long aVoltage, long aAmperage, ArrayList aAlreadyPassedTileEntityList) { + long rUsedAmperes = 0; + aVoltage -= mCableLossPerMeter; + if (aVoltage > 0) for (byte i = 0; i < 6 && aAmperage > rUsedAmperes; i++) if (i != aSide && (mConnections & (1<= 0) { + byte tColor = ((IEnergyConnected)tTileEntity).getColorization(); + if (tColor >= 0 && tColor != getBaseMetaTileEntity().getColorization()) continue; + } + if (tTileEntity instanceof IGregTechTileEntity && ((IGregTechTileEntity)tTileEntity).getMetaTileEntity() instanceof IMetaTileEntityCable && ((IGregTechTileEntity)tTileEntity).getCoverBehaviorAtSide(GT_Utility.getOppositeSide(i)).letsEnergyIn(GT_Utility.getOppositeSide(i), ((IGregTechTileEntity)tTileEntity).getCoverIDAtSide(GT_Utility.getOppositeSide(i)), ((IGregTechTileEntity)tTileEntity).getCoverDataAtSide(GT_Utility.getOppositeSide(i)), ((IGregTechTileEntity)tTileEntity))) { + if (((IGregTechTileEntity)tTileEntity).getTimer() > 50) rUsedAmperes += ((IMetaTileEntityCable)((IGregTechTileEntity)tTileEntity).getMetaTileEntity()).transferElectricity(GT_Utility.getOppositeSide(i), aVoltage, aAmperage-rUsedAmperes, aAlreadyPassedTileEntityList); + } else { + rUsedAmperes += ((IEnergyConnected)tTileEntity).injectEnergyUnits(GT_Utility.getOppositeSide(i), aVoltage, aAmperage-rUsedAmperes); + } +// } else if (tTileEntity instanceof IEnergySink) { +// ForgeDirection tDirection = ForgeDirection.getOrientation(i).getOpposite(); +// if (((IEnergySink)tTileEntity).acceptsEnergyFrom((TileEntity)getBaseMetaTileEntity(), tDirection)) { +// if (((IEnergySink)tTileEntity).demandedEnergyUnits() > 0 && ((IEnergySink)tTileEntity).injectEnergyUnits(tDirection, aVoltage) < aVoltage) rUsedAmperes++; +// } + } else if (tTileEntity instanceof IEnergySink) { + ForgeDirection tDirection = ForgeDirection.getOrientation(i).getOpposite(); + if (((IEnergySink)tTileEntity).acceptsEnergyFrom((TileEntity)getBaseMetaTileEntity(), tDirection)) { + if (((IEnergySink)tTileEntity).getDemandedEnergy() > 0 && ((IEnergySink)tTileEntity).injectEnergy(tDirection, aVoltage, aVoltage) < aVoltage) rUsedAmperes++; + } + } + } + } + mTransferredAmperage += rUsedAmperes; + mTransferredVoltageLast20 = Math.max(mTransferredVoltageLast20, aVoltage); + mTransferredAmperageLast20 = Math.max(mTransferredAmperageLast20, mTransferredAmperage); + if (aVoltage > mVoltage || mTransferredAmperage > mAmperage) { + getBaseMetaTileEntity().setToFire(); + return aAmperage; + } + return rUsedAmperes; + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if (aBaseMetaTileEntity.isServerSide()) { + mTransferredAmperage = 0; + + if (aTick % 20 == 0) { + mTransferredVoltageLast20 = 0; + mTransferredAmperageLast20 = 0; + mConnections = 0; + for (byte i = 0, j = 0; i < 6; i++) { + j = GT_Utility.getOppositeSide(i); + if (aBaseMetaTileEntity.getCoverBehaviorAtSide(i).alwaysLookConnected(i, aBaseMetaTileEntity.getCoverIDAtSide(i), aBaseMetaTileEntity.getCoverDataAtSide(i), aBaseMetaTileEntity) || aBaseMetaTileEntity.getCoverBehaviorAtSide(i).letsEnergyIn(i, aBaseMetaTileEntity.getCoverIDAtSide(i), aBaseMetaTileEntity.getCoverDataAtSide(i), aBaseMetaTileEntity) || aBaseMetaTileEntity.getCoverBehaviorAtSide(i).letsEnergyOut(i, aBaseMetaTileEntity.getCoverIDAtSide(i), aBaseMetaTileEntity.getCoverDataAtSide(i), aBaseMetaTileEntity)) { + TileEntity tTileEntity = aBaseMetaTileEntity.getTileEntityAtSide(i); + if (tTileEntity instanceof IColoredTileEntity) { + if (aBaseMetaTileEntity.getColorization() >= 0) { + byte tColor = ((IColoredTileEntity)tTileEntity).getColorization(); + if (tColor >= 0 && tColor != aBaseMetaTileEntity.getColorization()) continue; + } + } + if (tTileEntity instanceof IEnergyConnected && (((IEnergyConnected)tTileEntity).inputEnergyFrom(j) || ((IEnergyConnected)tTileEntity).outputsEnergyTo(j))) { + mConnections |= (1< 320) { + GT_Utility.applyHeatDamage((EntityLivingBase)aEntity, (tTemperature - 300) / 50.0F); + } else if (tTemperature < 260) { + GT_Utility.applyFrostDamage((EntityLivingBase)aEntity, (270 - tTemperature) / 25.0F); + } + } + } + + @Override + public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) { + return AxisAlignedBB.getBoundingBox(aX+0.125D, aY+0.125D, aZ+0.125D, aX+0.875D, aY+0.875D, aZ+0.875D); + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if (aBaseMetaTileEntity.isServerSide() && aTick % 5 == 0) { + mLastReceivedFrom &= 63; + if (mLastReceivedFrom == 63) { + mLastReceivedFrom = 0; + } + + if (mFluid != null && mFluid.amount > 0) { + int tTemperature = mFluid.getFluid().getTemperature(mFluid); + if (tTemperature > mHeatResistance) { + if (aBaseMetaTileEntity.getRandomNumber(100) == 0) { + aBaseMetaTileEntity.setToFire(); + return; + } + aBaseMetaTileEntity.setOnFire(); + } + if (!mGasProof && mFluid.getFluid().isGaseous(mFluid)) { + mFluid.amount -= 5; + sendSound((byte)9); + if (tTemperature > 320) { + try { + for (EntityLivingBase tLiving : (ArrayList)getBaseMetaTileEntity().getWorld().getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(getBaseMetaTileEntity().getXCoord()-2, getBaseMetaTileEntity().getYCoord()-2, getBaseMetaTileEntity().getZCoord()-2, getBaseMetaTileEntity().getXCoord()+3, getBaseMetaTileEntity().getYCoord()+3, getBaseMetaTileEntity().getZCoord()+3))) { + GT_Utility.applyHeatDamage(tLiving, (tTemperature - 300) / 25.0F); + } + } catch(Throwable e) { + if (D1) e.printStackTrace(GT_Log.err); + } + } else if (tTemperature < 260) { + try { + for (EntityLivingBase tLiving : (ArrayList)getBaseMetaTileEntity().getWorld().getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(getBaseMetaTileEntity().getXCoord()-2, getBaseMetaTileEntity().getYCoord()-2, getBaseMetaTileEntity().getZCoord()-2, getBaseMetaTileEntity().getXCoord()+3, getBaseMetaTileEntity().getYCoord()+3, getBaseMetaTileEntity().getZCoord()+3))) { + GT_Utility.applyFrostDamage(tLiving, (270 - tTemperature) / 12.5F); + } + } catch(Throwable e) { + if (D1) e.printStackTrace(GT_Log.err); + } + } + if (mFluid.amount <= 0) mFluid = null; + } + } + + if (mLastReceivedFrom == oLastReceivedFrom) { + HashMap tTanks = new HashMap(); + + mConnections = 0; + + for (byte tSide = 0, i = 0, j = (byte)aBaseMetaTileEntity.getRandomNumber(6); i < 6; i++) { + tSide = (byte)((j + i) % 6); + + IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide(tSide); + if (tTileEntity != null) { + if (tTileEntity instanceof IGregTechTileEntity) { + if (aBaseMetaTileEntity.getColorization() >= 0) { + byte tColor = ((IGregTechTileEntity)tTileEntity).getColorization(); + if (tColor >= 0 && (tColor & 15) != (aBaseMetaTileEntity.getColorization() & 15)) { + continue; + } + } + } + FluidTankInfo[] tInfo = tTileEntity.getTankInfo(ForgeDirection.getOrientation(tSide).getOpposite()); + if (tInfo != null && tInfo.length > 0) { + if (tTileEntity instanceof ICoverable && ((ICoverable)tTileEntity).getCoverBehaviorAtSide(GT_Utility.getOppositeSide(tSide)).alwaysLookConnected(GT_Utility.getOppositeSide(tSide), ((ICoverable)tTileEntity).getCoverIDAtSide(GT_Utility.getOppositeSide(tSide)), ((ICoverable)tTileEntity).getCoverDataAtSide(GT_Utility.getOppositeSide(tSide)), ((ICoverable)tTileEntity))) { + mConnections |= (1< 0) { + int tAmount = Math.max(1, Math.min(mCapacity*10, mFluid.amount / 2)), tSuccessfulTankAmount = 0; + + for (Entry tEntry : tTanks.entrySet()) if (tEntry.getKey().fill(tEntry.getValue(), drain(tAmount, false), false) > 0) tSuccessfulTankAmount++; + + if (tSuccessfulTankAmount > 0) { + if (tAmount >= tSuccessfulTankAmount) { + tAmount /= tSuccessfulTankAmount; + for (Entry tTileEntity : tTanks.entrySet()) { + if (mFluid == null || mFluid.amount <= 0) break; + int tFilledAmount = tTileEntity.getKey().fill(tTileEntity.getValue(), drain(tAmount, false), false); + if (tFilledAmount > 0) tTileEntity.getKey().fill(tTileEntity.getValue(), drain(tFilledAmount, true), true); + } + } else { + for (Entry tTileEntity : tTanks.entrySet()) { + if (mFluid == null || mFluid.amount <= 0) break; + int tFilledAmount = tTileEntity.getKey().fill(tTileEntity.getValue(), drain(mFluid.amount, false), false); + if (tFilledAmount > 0) tTileEntity.getKey().fill(tTileEntity.getValue(), drain(tFilledAmount, true), true); + } + } + } + } + + mLastReceivedFrom = 0; + } + + oLastReceivedFrom = mLastReceivedFrom; + } + } + + @Override + public void doSound(byte aIndex, double aX, double aY, double aZ) { + super.doSound(aIndex, aX, aY, aZ); + if (aIndex == 9) { + GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(4), 5, 1.0F, aX, aY, aZ); + for (byte i = 0; i < 6; i++) for (int l = 0; l < 2; ++l) getBaseMetaTileEntity().getWorld().spawnParticle("largesmoke", aX - 0.5 + Math.random(), aY - 0.5 + Math.random(), aZ - 0.5 + Math.random(), ForgeDirection.getOrientation(i).offsetX / 5.0, ForgeDirection.getOrientation(i).offsetY / 5.0, ForgeDirection.getOrientation(i).offsetZ / 5.0); + } + } + + @Override + public final int getCapacity() { + return mCapacity * 20; + } + + @Override + public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return false; + } + + @Override + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return false; + } + + @Override + public final FluidStack getFluid() { + return mFluid; + } + + @Override + public final int getFluidAmount() { + return mFluid != null ? mFluid.amount : 0; + } + + @Override + public final int fill_default(ForgeDirection aSide, FluidStack aFluid, boolean doFill) { + if (aFluid == null || aFluid.getFluid().getID() <= 0) return 0; + + if (mFluid == null || mFluid.getFluid().getID() <= 0) { + if(aFluid.amount <= getCapacity()) { + if (doFill) { + mFluid = aFluid.copy(); + mLastReceivedFrom |= (1<= 0) { + byte tColor = ((IGregTechTileEntity)tTileEntity).getColorization(); + if (tColor >= 0 && tColor != aBaseMetaTileEntity.getColorization()) { + continue; + } + } + if (((IGregTechTileEntity)tTileEntity).getMetaTileEntity().connectsToItemPipe(GT_Utility.getOppositeSide(i))) { + mConnections |= (1< tPipeList = new ArrayList(); + + for (boolean temp = true; temp && !isInventoryEmpty() && pipeCapacityCheck();) { + temp = false; + tPipeList.clear(); + for (IMetaTileEntityItemPipe tTileEntity : GT_Utility.sortMapByValuesAcending(IMetaTileEntityItemPipe.Util.scanPipes(this, new HashMap(), 0, false, false)).keySet()) { + if (temp) break; + tPipeList.add(tTileEntity); + while (!temp && !isInventoryEmpty() && tTileEntity.sendItemStack(aBaseMetaTileEntity)) for (IMetaTileEntityItemPipe tPipe : tPipeList) if (!tPipe.incrementTransferCounter(1)) temp = true; + } + } + } + + if (isInventoryEmpty()) mLastReceivedFrom = 6; + oLastReceivedFrom = mLastReceivedFrom; + } + } + + @Override + public boolean incrementTransferCounter(int aIncrement) { + mTransferredItems += aIncrement; + return pipeCapacityCheck(); + } + + @Override + public boolean sendItemStack(Object aSender) { + if (pipeCapacityCheck()) { + byte tOffset = (byte)getBaseMetaTileEntity().getRandomNumber(6), tSide = 0; + for (byte i = 0; i < 6; i++) { + tSide = (byte)((i+tOffset)%6); + if (isInventoryEmpty() || (tSide != mLastReceivedFrom || aSender != getBaseMetaTileEntity())) { + if (insertItemStackIntoTileEntity(aSender, tSide)) return true; + } + } + } + return false; + } + + @Override + public boolean insertItemStackIntoTileEntity(Object aSender, byte aSide) { + if (getBaseMetaTileEntity().getCoverBehaviorAtSide(aSide).letsItemsOut(aSide, getBaseMetaTileEntity().getCoverIDAtSide(aSide), getBaseMetaTileEntity().getCoverDataAtSide(aSide), -1, getBaseMetaTileEntity())) { + TileEntity tInventory = getBaseMetaTileEntity().getTileEntityAtSide(aSide); + if (tInventory != null && !(tInventory instanceof BaseMetaPipeEntity)) { + if ((!(tInventory instanceof TileEntityHopper) && !(tInventory instanceof TileEntityDispenser)) || getBaseMetaTileEntity().getMetaIDAtSide(aSide) != GT_Utility.getOppositeSide(aSide)) { + return GT_Utility.moveOneItemStack(aSender, tInventory, (byte)6, GT_Utility.getOppositeSide(aSide), null, false, (byte)64, (byte)1, (byte)64, (byte)1) > 0; + } + } + } + return false; + } + + @Override + public boolean pipeCapacityCheck() { + return mTransferredItems <= 0 || getPipeContent() < getMaxPipeCapacity(); + } + + private int getPipeContent() { + return mTransferredItems; + } + + private int getMaxPipeCapacity() { + return Math.max(1, getPipeCapacity()); + } + + /** + * Amount of ItemStacks this Pipe can conduct per Second. + */ + public int getPipeCapacity() { + return mInventory.length; + } + + @Override + public int getStepSize() { + return mStepSize; + } + + @Override + public boolean canExtractItem(int aIndex, ItemStack aStack, int aSide) { + return true; + } + + @Override + public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return true; + } + + @Override + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + if (isInventoryEmpty()) mLastReceivedFrom = aSide; + return mLastReceivedFrom == aSide && mInventory[aIndex] == null; + } + + @Override + public String[] getDescription() { + return new String[] {"Item Capacity: "+getMaxPipeCapacity()+" Stacks/sec", "Routing Value: " + mStepSize}; + } + + private boolean isInventoryEmpty() { + for (ItemStack tStack : mInventory) if (tStack != null) return false; + return true; + } + + @Override + public float getThickNess() { + return mThickNess; + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBatteryBuffer.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBatteryBuffer.java new file mode 100644 index 0000000..cb26984 --- /dev/null +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBatteryBuffer.java @@ -0,0 +1,151 @@ +package gregtech.api.metatileentity.implementations; + +import static gregtech.api.enums.GT_Values.V; + +import gregtech.api.enums.Textures; +import gregtech.api.gui.GT_Container_1by1; +import gregtech.api.gui.GT_Container_2by2; +import gregtech.api.gui.GT_Container_3by3; +import gregtech.api.gui.GT_Container_4by4; +import gregtech.api.gui.GT_GUIContainer_1by1; +import gregtech.api.gui.GT_GUIContainer_2by2; +import gregtech.api.gui.GT_GUIContainer_3by3; +import gregtech.api.gui.GT_GUIContainer_4by4; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.util.GT_ModHandler; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +/** + * NEVER INCLUDE THIS FILE IN YOUR MOD!!! + * + * This is the main construct for my Basic Machines such as the Automatic Extractor + * Extend this class to make a simple Machine + */ +public class GT_MetaTileEntity_BasicBatteryBuffer extends GT_MetaTileEntity_TieredMachineBlock { + public boolean mCharge = false, mDecharge = false; + public int mBatteryCount = 0, mChargeableCount = 0; + + public GT_MetaTileEntity_BasicBatteryBuffer(int aID, String aName, String aNameRegional, int aTier, String aDescription, int aSlotCount) { + super(aID, aName, aNameRegional, aTier, aSlotCount, aDescription); + } + + public GT_MetaTileEntity_BasicBatteryBuffer(String aName, int aTier, String aDescription, ITexture[][][] aTextures, int aSlotCount) { + super(aName, aTier, aSlotCount, aDescription, aTextures); + } + + @Override + public String[] getDescription() { + return new String[] {mDescription, mInventory.length + " Slots"}; + } + + @Override + public ITexture[][][] getTextureSet(ITexture[] aTextures) { + ITexture[][][] rTextures = new ITexture[2][17][]; + for (byte i = -1; i < 16; i++) { + rTextures[ 0][i+1] = new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][i+1]}; + rTextures[ 1][i+1] = new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][i+1], mInventory.length > 4 ? Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier] : Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier]}; + } + return rTextures; + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + return mTextures[aSide == aFacing ? 1 : 0][aColorIndex+1]; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_BasicBatteryBuffer(mName, mTier, mDescription, mTextures, mInventory.length); + } + + @Override public boolean isSimpleMachine() {return false;} + @Override public boolean isElectric() {return true;} + @Override public boolean isValidSlot(int aIndex) {return true;} + @Override public boolean isFacingValid(byte aFacing) {return true;} + @Override public boolean isEnetInput() {return true;} + @Override public boolean isEnetOutput() {return true;} + @Override public boolean isInputFacing(byte aSide) {return aSide!=getBaseMetaTileEntity().getFrontFacing();} + @Override public boolean isOutputFacing(byte aSide) {return aSide==getBaseMetaTileEntity().getFrontFacing();} + @Override public boolean isTeleporterCompatible() {return false;} + @Override public long getMinimumStoredEU() {return V[mTier]*16*mInventory.length;} + @Override public long maxEUStore() {return V[mTier]*64*mInventory.length;} + @Override public long maxEUInput() {return V[mTier];} + @Override public long maxEUOutput() {return V[mTier];} + @Override public long maxAmperesIn() {return mChargeableCount * 2;} + @Override public long maxAmperesOut() {return mBatteryCount;} + @Override public int rechargerSlotStartIndex() {return 0;} + @Override public int dechargerSlotStartIndex() {return 0;} + @Override public int rechargerSlotCount() {return mCharge?mInventory.length:0;} + @Override public int dechargerSlotCount() {return mDecharge?mInventory.length:0;} + @Override public int getProgresstime() {return (int)getBaseMetaTileEntity().getUniversalEnergyStored();} + @Override public int maxProgresstime() {return (int)getBaseMetaTileEntity().getUniversalEnergyCapacity();} + @Override public boolean isAccessAllowed(EntityPlayer aPlayer) {return true;} + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + // + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + // + } + + @Override + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { + if (aBaseMetaTileEntity.isClientSide()) return true; + aBaseMetaTileEntity.openGUI(aPlayer); + return true; + } + + @Override + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + switch (mInventory.length) { + case 1: return new GT_Container_1by1(aPlayerInventory, aBaseMetaTileEntity); + case 4: return new GT_Container_2by2(aPlayerInventory, aBaseMetaTileEntity); + case 9: return new GT_Container_3by3(aPlayerInventory, aBaseMetaTileEntity); + case 16: return new GT_Container_4by4(aPlayerInventory, aBaseMetaTileEntity); + } + return new GT_Container_1by1(aPlayerInventory, aBaseMetaTileEntity); + } + + @Override + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + switch (mInventory.length) { + case 1: return new GT_GUIContainer_1by1(aPlayerInventory, aBaseMetaTileEntity, getLocalName()); + case 4: return new GT_GUIContainer_2by2(aPlayerInventory, aBaseMetaTileEntity, getLocalName()); + case 9: return new GT_GUIContainer_3by3(aPlayerInventory, aBaseMetaTileEntity, getLocalName()); + case 16: return new GT_GUIContainer_4by4(aPlayerInventory, aBaseMetaTileEntity, getLocalName()); + } + return new GT_GUIContainer_1by1(aPlayerInventory, aBaseMetaTileEntity, getLocalName()); + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if (aBaseMetaTileEntity.isServerSide()) { + mCharge = aBaseMetaTileEntity.getStoredEU() / 2 > aBaseMetaTileEntity.getEUCapacity() / 3; + mDecharge = aBaseMetaTileEntity.getStoredEU() < aBaseMetaTileEntity.getEUCapacity() / 3; + mBatteryCount = 0; + mChargeableCount = 0; + for (ItemStack tStack : mInventory) if (GT_ModHandler.isElectricItem(tStack, mTier)) { + if (GT_ModHandler.isChargerItem(tStack)) mBatteryCount++; + mChargeableCount++; + } + } + } + + @Override + public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return false; + } + + @Override + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return false; + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java new file mode 100644 index 0000000..98674b6 --- /dev/null +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java @@ -0,0 +1,167 @@ +package gregtech.api.metatileentity.implementations; + +import static gregtech.api.enums.GT_Values.V; + +import java.util.Collection; + +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Recipe.GT_Recipe_Map; +import gregtech.api.util.GT_Utility; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + +public abstract class GT_MetaTileEntity_BasicGenerator extends GT_MetaTileEntity_BasicTank { + public GT_MetaTileEntity_BasicGenerator(int aID, String aName, String aNameRegional, int aTier, String aDescription, ITexture... aTextures) { + super(aID, aName, aNameRegional, aTier, 3, aDescription, aTextures); + } + + public GT_MetaTileEntity_BasicGenerator(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, 3, aDescription, aTextures); + } + + @Override + public ITexture[][][] getTextureSet(ITexture[] aTextures) { + ITexture[][][] rTextures = new ITexture[10][17][]; + for (byte i = -1; i < 16; i++) { + rTextures[ 0][i+1] = getFront(i); + rTextures[ 1][i+1] = getBack(i); + rTextures[ 2][i+1] = getBottom(i); + rTextures[ 3][i+1] = getTop(i); + rTextures[ 4][i+1] = getSides(i); + rTextures[ 5][i+1] = getFrontActive(i); + rTextures[ 6][i+1] = getBackActive(i); + rTextures[ 7][i+1] = getBottomActive(i); + rTextures[ 8][i+1] = getTopActive(i); + rTextures[ 9][i+1] = getSidesActive(i); + } + return rTextures; + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + return mTextures[(aActive?5:0)+(aSide==aFacing?0:aSide==GT_Utility.getOppositeSide(aFacing)?1:aSide==0?2:aSide==1?3:4)][aColorIndex+1]; + } + + @Override + public String[] getDescription() { + return new String[] {mDescription, "Fuel Efficiency: " + getEfficiency() + "%"}; + } + + @Override + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { + if (aBaseMetaTileEntity.isClientSide()) return true; + aBaseMetaTileEntity.openGUI(aPlayer); + return true; + } + + public ITexture[] getFront(byte aColor) {return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor+1]};} + public ITexture[] getBack(byte aColor) {return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor+1]};} + public ITexture[] getBottom(byte aColor) {return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor+1]};} + public ITexture[] getTop(byte aColor) {return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor+1]};} + public ITexture[] getSides(byte aColor) {return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor+1]};} + + public ITexture[] getFrontActive(byte aColor) {return getFront(aColor);} + public ITexture[] getBackActive(byte aColor) {return getBack(aColor);} + public ITexture[] getBottomActive(byte aColor) {return getBottom(aColor);} + public ITexture[] getTopActive(byte aColor) {return getTop(aColor);} + public ITexture[] getSidesActive(byte aColor) {return getSides(aColor);} + + @Override public boolean isFacingValid(byte aSide) {return aSide > 1;} + @Override public boolean isSimpleMachine() {return false;} + @Override public boolean isValidSlot(int aIndex) {return aIndex < 2;} + @Override public boolean isEnetOutput() {return true;} + @Override public boolean isOutputFacing(byte aSide) {return true;} + @Override public boolean isAccessAllowed(EntityPlayer aPlayer) {return true;} + @Override public long maxEUOutput() {return getBaseMetaTileEntity().isAllowedToWork()?V[mTier]:0;} + @Override public long maxEUStore() {return Math.max(getEUVar(), V[mTier] * 20 + getMinimumStoredEU());} + + @Override public boolean doesFillContainers() {return getBaseMetaTileEntity().isAllowedToWork();} + @Override public boolean doesEmptyContainers() {return getBaseMetaTileEntity().isAllowedToWork();} + @Override public boolean canTankBeFilled() {return getBaseMetaTileEntity().isAllowedToWork();} + @Override public boolean canTankBeEmptied() {return getBaseMetaTileEntity().isAllowedToWork();} + @Override public boolean displaysItemStack() {return true;} + @Override public boolean displaysStackSize() {return false;} + @Override public boolean isFluidInputAllowed(FluidStack aFluid) {return getFuelValue(aFluid) > 0;} + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isAllowedToWork() && aTick%10==0) { + if (mFluid == null) { + if (aBaseMetaTileEntity.getUniversalEnergyStored() < maxEUOutput() + getMinimumStoredEU()) { + mInventory[getStackDisplaySlot()] = null; + } else { + if (mInventory[getStackDisplaySlot()] == null) mInventory[getStackDisplaySlot()] = new ItemStack(Blocks.fire, 1); + mInventory[getStackDisplaySlot()].setStackDisplayName("Generating: " + (aBaseMetaTileEntity.getUniversalEnergyStored() - getMinimumStoredEU()) + " EU"); + } + } else { + int tFuelValue = getFuelValue(mFluid), tConsumed = consumedFluidPerOperation(mFluid); + if (tFuelValue > 0 && tConsumed > 0 && mFluid.amount > tConsumed) { + long tFluidAmountToUse = Math.min(mFluid.amount / tConsumed, (maxEUOutput() * 20 + getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue); + if (tFluidAmountToUse > 0 && aBaseMetaTileEntity.increaseStoredEnergyUnits(tFluidAmountToUse * tFuelValue, true)) mFluid.amount -= tFluidAmountToUse * tConsumed; + } + } + if (mInventory[getInputSlot()] != null && aBaseMetaTileEntity.getUniversalEnergyStored() < (maxEUOutput() * 20 + getMinimumStoredEU()) && GT_Utility.getFluidForFilledItem(mInventory[getInputSlot()], true) == null) { + int tFuelValue = getFuelValue(mInventory[getInputSlot()]); + if (tFuelValue > 0) { + ItemStack tEmptyContainer = getEmptyContainer(mInventory[getInputSlot()]); + if (aBaseMetaTileEntity.addStackToSlot(getOutputSlot(), tEmptyContainer)) { + aBaseMetaTileEntity.increaseStoredEnergyUnits(tFuelValue, true); + aBaseMetaTileEntity.decrStackSize(getInputSlot(), 1); + } + } + } + } + + if (aBaseMetaTileEntity.isServerSide()) aBaseMetaTileEntity.setActive(aBaseMetaTileEntity.isAllowedToWork() && aBaseMetaTileEntity.getUniversalEnergyStored() >= maxEUOutput() + getMinimumStoredEU()); + } + + public abstract GT_Recipe_Map getRecipes(); + + public abstract int getEfficiency(); + + public int consumedFluidPerOperation(FluidStack aLiquid) { + return 1; + } + + public int getFuelValue(FluidStack aLiquid) { + if (aLiquid == null || getRecipes() == null) return 0; + FluidStack tLiquid; + Collection tRecipeList = getRecipes().mRecipeList; + if (tRecipeList != null) for (GT_Recipe tFuel : tRecipeList) if ((tLiquid = GT_Utility.getFluidForFilledItem(tFuel.getRepresentativeInput(0), true)) != null) if (aLiquid.isFluidEqual(tLiquid)) return (int)(((long)tFuel.mSpecialValue * getEfficiency() * consumedFluidPerOperation(tLiquid)) / 100); + return 0; + } + + public int getFuelValue(ItemStack aStack) { + if (GT_Utility.isStackInvalid(aStack) || getRecipes() == null) return 0; + GT_Recipe tFuel = getRecipes().findRecipe(getBaseMetaTileEntity(), false, Long.MAX_VALUE, null, aStack); + if (tFuel != null) return (int)((tFuel.mSpecialValue * 1000L * getEfficiency()) / 100); + return 0; + } + + public ItemStack getEmptyContainer(ItemStack aStack) { + if (GT_Utility.isStackInvalid(aStack) || getRecipes() == null) return null; + GT_Recipe tFuel = getRecipes().findRecipe(getBaseMetaTileEntity(), false, Long.MAX_VALUE, null, aStack); + if (tFuel != null) return GT_Utility.copy(tFuel.getOutput(0)); + return GT_Utility.getContainerItem(aStack, true); + } + + @Override + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack) && (getFuelValue(aStack) > 0 || getFuelValue(GT_Utility.getFluidForFilledItem(aStack, true)) > 0); + } + + @Override + public int getCapacity() { + return 16000; + } + + @Override + public int getTankPressure() { + return -100; + } +} diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicHull.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicHull.java new file mode 100644 index 0000000..1f150ad --- /dev/null +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicHull.java @@ -0,0 +1,100 @@ +package gregtech.api.metatileentity.implementations; + +import static gregtech.api.enums.GT_Values.V; + +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + +public class GT_MetaTileEntity_BasicHull extends GT_MetaTileEntity_BasicTank { + public GT_MetaTileEntity_BasicHull(int aID, String aName, String aNameRegional, int aTier, String aDescription, ITexture... aTextures) { + super(aID, aName, aNameRegional, aTier, 1, aDescription, aTextures); + } + + public GT_MetaTileEntity_BasicHull(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String aDescription, ITexture... aTextures) { + super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription, aTextures); + } + + public GT_MetaTileEntity_BasicHull(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aInvSlotCount, aDescription, aTextures); + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_BasicHull(mName, mTier, mInventory.length, mDescription, mTextures); + } + + @Override public boolean isElectric() {return true;} + @Override public boolean isEnetInput() {return true;} + @Override public boolean isEnetOutput() {return true;} + @Override public boolean isAccessAllowed(EntityPlayer aPlayer) {return true;} + @Override public boolean isInputFacing(byte aSide) {return !isOutputFacing(aSide);} + @Override public boolean isOutputFacing(byte aSide) {return aSide == getBaseMetaTileEntity().getFrontFacing();} + @Override public long getMinimumStoredEU() {return 512;} + @Override public long maxEUStore() {return 512+V[mTier]*50;} + @Override public long maxEUInput() {return V[mTier];} + @Override public long maxEUOutput() {return V[mTier];} + + @Override public boolean isSimpleMachine() {return true;} + @Override public boolean isFacingValid(byte aFacing) {return true;} + @Override public boolean isValidSlot(int aIndex) {return true;} + @Override public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {return true;} + @Override public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {return true;} + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aConnected, boolean aRedstone) { + return mTextures[Math.min(2, aSide) + (aSide==aFacing?3:0)][aColorIndex+1]; + } + + @Override + public ITexture[][][] getTextureSet(ITexture[] aTextures) { + ITexture[][][] rTextures = new ITexture[6][17][]; + for (byte i = -1; i < 16; i++) { + rTextures[ 0][i+1] = new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][i+1]}; + rTextures[ 1][i+1] = new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][i+1]}; + rTextures[ 2][i+1] = new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][i+1]}; + rTextures[ 3][i+1] = new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][i+1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier]}; + rTextures[ 4][i+1] = new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][i+1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier]}; + rTextures[ 5][i+1] = new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][i+1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier]}; + } + return rTextures; + } + + @Override + public boolean doesFillContainers() { + return false; + } + + @Override + public boolean doesEmptyContainers() { + return false; + } + + @Override + public boolean canTankBeFilled() { + return true; + } + + @Override + public boolean canTankBeEmptied() { + return true; + } + + @Override + public boolean displaysItemStack() { + return false; + } + + @Override + public boolean displaysStackSize() { + return false; + } + + @Override + public int getCapacity() { + return (mTier + 1) * 1000; + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicHull_NonElectric.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicHull_NonElectric.java new file mode 100644 index 0000000..948e631 --- /dev/null +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicHull_NonElectric.java @@ -0,0 +1,32 @@ +package gregtech.api.metatileentity.implementations; + +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; + +public abstract class GT_MetaTileEntity_BasicHull_NonElectric extends GT_MetaTileEntity_BasicHull { + public GT_MetaTileEntity_BasicHull_NonElectric(int aID, String aName, String aNameRegional, int aTier, String aDescription) { + super(aID, aName, aNameRegional, aTier, aDescription); + } + + public GT_MetaTileEntity_BasicHull_NonElectric(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, 1, aDescription, aTextures); + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, byte aColorIndex, boolean aConnected, boolean aRedstone) { + return mTextures[Math.min(2, aSide)][aColorIndex+1]; + } + + @Override public boolean isElectric() {return false;} + @Override public boolean isEnetInput() {return false;} + @Override public boolean isEnetOutput() {return false;} + @Override public boolean isInputFacing(byte aSide) {return false;} + @Override public boolean isOutputFacing(byte aSide) {return false;} + @Override public long getMinimumStoredEU() {return 0;} + @Override public long maxEUStore() {return 0;} + @Override public long maxEUInput() {return 0;} + @Override public long maxEUOutput() {return 0;} + + @Override + public abstract ITexture[][][] getTextureSet(ITexture[] aTextures); +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java new file mode 100644 index 0000000..e3b2d0d --- /dev/null +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java @@ -0,0 +1,596 @@ +package gregtech.api.metatileentity.implementations; + +import static gregtech.api.enums.GT_Values.V; + +import java.util.Arrays; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Textures; +import gregtech.api.gui.GT_Container_BasicMachine; +import gregtech.api.gui.GT_GUIContainer_BasicMachine; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.objects.GT_ItemStack; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Recipe.GT_Recipe_Map; +import gregtech.api.util.GT_Utility; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +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.FluidStack; +import net.minecraftforge.fluids.IFluidHandler; + +/** + * NEVER INCLUDE THIS FILE IN YOUR MOD!!! + * + * This is the main construct for my Basic Machines such as the Automatic Extractor + * Extend this class to make a simple Machine + */ +public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_BasicTank { + public boolean mAllowInputFromOutputSide = false, mFluidTransfer = false, mItemTransfer = false, mHasBeenUpdated = false, mStuttering = false, mCharge = false, mDecharge = false; + public int mMainFacing = -1, mProgresstime = 0, mMaxProgresstime = 0, mEUt = 0, mOutputBlocked = 0; + public FluidStack mOutputFluid; + private FluidStack mFluidOut; + public String mGUIName = "", mNEIName = ""; + + public final ItemStack[] mOutputItems; + public final int mInputSlotCount, mAmperage; + + private static final int OTHER_SLOT_COUNT = 4; + + /** + * @param aOverlays + * 0 = SideFacingActive + * 1 = SideFacingInactive + * 2 = FrontFacingActive + * 3 = FrontFacingInactive + * 4 = TopFacingActive + * 5 = TopFacingInactive + * 6 = BottomFacingActive + * 7 = BottomFacingInactive + * ----- Not all Array Elements have to be initialised, you can also just use 8 Parameters for the Default Pipe Texture Overlays ----- + * 8 = BottomFacingPipeActive + * 9 = BottomFacingPipeInactive + * 10 = TopFacingPipeActive + * 11 = TopFacingPipeInactive + * 12 = SideFacingPipeActive + * 13 = SideFacingPipeInactive + */ + public GT_MetaTileEntity_BasicMachine(int aID, String aName, String aNameRegional, int aTier, int aAmperage, String aDescription, int aInputSlotCount, int aOutputSlotCount, String aGUIName, String aNEIName, ITexture... aOverlays) { + super(aID, aName, aNameRegional, aTier, OTHER_SLOT_COUNT+aInputSlotCount+aOutputSlotCount+1, aDescription, aOverlays); + mInputSlotCount = Math.max(0, aInputSlotCount); + mOutputItems = new ItemStack[Math.max(0, aOutputSlotCount)]; + mAmperage = aAmperage; + mGUIName = aGUIName; + mNEIName = aNEIName; + } + + public GT_MetaTileEntity_BasicMachine(String aName, int aTier, int aAmperage, String aDescription, ITexture[][][] aTextures, int aInputSlotCount, int aOutputSlotCount, String aGUIName, String aNEIName) { + super(aName, aTier, OTHER_SLOT_COUNT+aInputSlotCount+aOutputSlotCount+1, aDescription, aTextures); + mInputSlotCount = Math.max(0, aInputSlotCount); + mOutputItems = new ItemStack[Math.max(0, aOutputSlotCount)]; + mAmperage = aAmperage; + mGUIName = aGUIName; + mNEIName = aNEIName; + } + + @Override + public ITexture[][][] getTextureSet(ITexture[] aTextures) { + ITexture[][][] rTextures = new ITexture[14][17][]; + aTextures = Arrays.copyOf(aTextures, 14); + + for (int i = 0; i < aTextures.length; i++) if (aTextures[i] != null) for (byte c = -1; c < 16; c++) { + if (rTextures[ i][c+1] == null) rTextures[ i][c+1] = new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][c+1], aTextures[i]}; + } + + for (byte c = -1; c < 16; c++) { + if (rTextures[ 0][c+1] == null) rTextures[ 0][c+1] = getSideFacingActive(c); + if (rTextures[ 1][c+1] == null) rTextures[ 1][c+1] = getSideFacingInactive(c); + if (rTextures[ 2][c+1] == null) rTextures[ 2][c+1] = getFrontFacingActive(c); + if (rTextures[ 3][c+1] == null) rTextures[ 3][c+1] = getFrontFacingInactive(c); + if (rTextures[ 4][c+1] == null) rTextures[ 4][c+1] = getTopFacingActive(c); + if (rTextures[ 5][c+1] == null) rTextures[ 5][c+1] = getTopFacingInactive(c); + if (rTextures[ 6][c+1] == null) rTextures[ 6][c+1] = getBottomFacingActive(c); + if (rTextures[ 7][c+1] == null) rTextures[ 7][c+1] = getBottomFacingInactive(c); + if (rTextures[ 8][c+1] == null) rTextures[ 8][c+1] = getBottomFacingPipeActive(c); + if (rTextures[ 9][c+1] == null) rTextures[ 9][c+1] = getBottomFacingPipeInactive(c); + if (rTextures[10][c+1] == null) rTextures[10][c+1] = getTopFacingPipeActive(c); + if (rTextures[11][c+1] == null) rTextures[11][c+1] = getTopFacingPipeInactive(c); + if (rTextures[12][c+1] == null) rTextures[12][c+1] = getSideFacingPipeActive(c); + if (rTextures[13][c+1] == null) rTextures[13][c+1] = getSideFacingPipeInactive(c); + } + return rTextures; + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + return mTextures[mMainFacing<2?aSide==aFacing?aActive?2:3:aSide==0?aActive?6:7:aSide==1?aActive?4:5:aActive?0:1:aSide==mMainFacing?aActive?2:3:(showPipeFacing()&&aSide==aFacing)?aSide==0?aActive?8:9:aSide==1?aActive?10:11:aActive?12:13:aSide==0?aActive?6:7:aSide==1?aActive?4:5:aActive?0:1][aColorIndex+1]; + } + + @Override public boolean isSimpleMachine() {return false;} + @Override public boolean isOverclockerUpgradable() {return false;} + @Override public boolean isTransformerUpgradable() {return false;} + @Override public boolean isElectric() {return true;} + @Override public boolean isValidSlot(int aIndex) {return aIndex > 0 && super.isValidSlot(aIndex) && aIndex != OTHER_SLOT_COUNT+mInputSlotCount+mOutputItems.length;} + @Override public boolean isFacingValid(byte aFacing) {return mMainFacing > 1 || aFacing > 1;} + @Override public boolean isEnetInput() {return true;} + @Override public boolean isInputFacing(byte aSide) {return aSide!=mMainFacing;} + @Override public boolean isOutputFacing(byte aSide) {return false;} + @Override public boolean isTeleporterCompatible() {return false;} + @Override public boolean isLiquidInput(byte aSide) {return aSide!=mMainFacing && (mAllowInputFromOutputSide || aSide != getBaseMetaTileEntity().getFrontFacing());} + @Override public boolean isLiquidOutput(byte aSide) {return aSide!=mMainFacing;} + @Override public long getMinimumStoredEU() {return V[mTier]*16;} + @Override public long maxEUStore() {return V[mTier]*64;} + @Override public long maxEUInput() {return V[mTier];} + @Override public long maxSteamStore() {return maxEUStore();} + @Override public long maxAmperesIn() {return (mEUt * 2) / V[mTier] + 1;} + @Override public int getInputSlot() {return OTHER_SLOT_COUNT;} + @Override public int getOutputSlot() {return OTHER_SLOT_COUNT+mInputSlotCount;} + @Override public int getStackDisplaySlot() {return 2;} + @Override public int rechargerSlotStartIndex() {return 1;} + @Override public int dechargerSlotStartIndex() {return 1;} + @Override public int rechargerSlotCount() {return mCharge?1:0;} + @Override public int dechargerSlotCount() {return mDecharge?1:0;} + @Override public boolean isAccessAllowed(EntityPlayer aPlayer) {return true;} + @Override public int getProgresstime() {return mProgresstime;} + @Override public int maxProgresstime() {return mMaxProgresstime;} + @Override public int increaseProgress(int aProgress) {mProgresstime += aProgress; return mMaxProgresstime-mProgresstime;} + @Override public boolean isFluidInputAllowed(FluidStack aFluid) {return getFillableStack() != null || (getRecipeList() != null && getRecipeList().containsInput(aFluid));} + @Override public boolean isFluidChangingAllowed() {return true;} + @Override public boolean doesFillContainers() {return false;} + @Override public boolean doesEmptyContainers() {return false;} + @Override public boolean canTankBeFilled() {return true;} + @Override public boolean canTankBeEmptied() {return true;} + @Override public boolean displaysItemStack() {return true;} + @Override public boolean displaysStackSize() {return true;} + @Override public FluidStack getDisplayedFluid() {return displaysOutputFluid()?getDrainableStack():null;} + @Override public FluidStack getDrainableStack() {return mFluidOut;} + @Override public FluidStack setDrainableStack(FluidStack aFluid){mFluidOut = aFluid; return mFluidOut;} + + @Override + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { + if (aBaseMetaTileEntity.isClientSide()) return true; + aBaseMetaTileEntity.openGUI(aPlayer); + return true; + } + + @Override + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_Container_BasicMachine(aPlayerInventory, aBaseMetaTileEntity); + } + + @Override + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), mGUIName, GT_Utility.isStringValid(mNEIName) ? mNEIName : getRecipeList() != null ? getRecipeList().mUnlocalizedName : ""); + } + + @Override + public void initDefaultModes(NBTTagCompound aNBT) { + mMainFacing = -1; + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + super.saveNBTData(aNBT); + aNBT.setBoolean("mFluidTransfer", mFluidTransfer); + aNBT.setBoolean("mItemTransfer", mItemTransfer); + aNBT.setBoolean("mHasBeenUpdated", mHasBeenUpdated); + aNBT.setBoolean("mAllowInputFromOutputSide", mAllowInputFromOutputSide); + aNBT.setInteger("mEUt", mEUt); + aNBT.setInteger("mMainFacing", mMainFacing); + aNBT.setInteger("mProgresstime", mProgresstime); + aNBT.setInteger("mMaxProgresstime", mMaxProgresstime); + if (mOutputFluid != null) aNBT.setTag("mOutputFluid", mOutputFluid.writeToNBT(new NBTTagCompound())); + if (mFluidOut != null) aNBT.setTag("mFluidOut", mFluidOut.writeToNBT(new NBTTagCompound())); + + for (int i = 0; i < mOutputItems.length; i++) if (mOutputItems[i] != null) aNBT.setTag("mOutputItem"+i, mOutputItems[i].writeToNBT(new NBTTagCompound())); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + super.loadNBTData(aNBT); + mFluidTransfer = aNBT.getBoolean("mFluidTransfer"); + mItemTransfer = aNBT.getBoolean("mItemTransfer"); + mHasBeenUpdated = aNBT.getBoolean("mHasBeenUpdated"); + mAllowInputFromOutputSide = aNBT.getBoolean("mAllowInputFromOutputSide"); + mEUt = aNBT.getInteger("mEUt"); + mMainFacing = aNBT.getInteger("mMainFacing"); + mProgresstime = aNBT.getInteger("mProgresstime"); + mMaxProgresstime = aNBT.getInteger("mMaxProgresstime"); + mOutputFluid = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mOutputFluid")); + mFluidOut = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mFluidOut")); + + for (int i = 0; i < mOutputItems.length; i++) mOutputItems[i] = GT_Utility.loadItem(aNBT, "mOutputItem"+i); + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + super.onPostTick(aBaseMetaTileEntity, aTick); + + if (aBaseMetaTileEntity.isServerSide()) { + mCharge = aBaseMetaTileEntity.getStoredEU() / 2 > aBaseMetaTileEntity.getEUCapacity() / 3; + mDecharge = aBaseMetaTileEntity.getStoredEU() < aBaseMetaTileEntity.getEUCapacity() / 3; + + doDisplayThings(); + + boolean tSucceeded = false; + + if (mMaxProgresstime > 0 && (mProgresstime >= 0 || aBaseMetaTileEntity.isAllowedToWork())) { + aBaseMetaTileEntity.setActive(true); + if (mProgresstime < 0 || drainEnergyForProcess(mEUt)) { + if (++mProgresstime>=mMaxProgresstime) { + for (int i = 0; i < mOutputItems.length; i++) for (int j = 0; j < mOutputItems.length; j++) if (aBaseMetaTileEntity.addStackToSlot(getOutputSlot()+((j+i)%mOutputItems.length), mOutputItems[i])) break; + if (mOutputFluid != null) if (getDrainableStack() == null) setDrainableStack(mOutputFluid.copy()); else if (mOutputFluid.isFluidEqual(getDrainableStack())) getDrainableStack().amount += mOutputFluid.amount; + for (int i = 0; i < mOutputItems.length; i++) mOutputItems[i] = null; + mOutputFluid = null; + mEUt = 0; + mProgresstime = 0; + mMaxProgresstime = 0; + mStuttering = false; + tSucceeded = true; + endProcess(); + } + if (mProgresstime > 5) mStuttering = false; + } else { + if (!mStuttering) { + stutterProcess(); + if (canHaveInsufficientEnergy()) mProgresstime = -100; + mStuttering = true; + } + } + } else { + aBaseMetaTileEntity.setActive(false); + } + + boolean tRemovedOutputFluid = false; + + if (doesAutoOutputFluids() && getDrainableStack() != null && aBaseMetaTileEntity.getFrontFacing() != mMainFacing && (tSucceeded || aTick%20 == 0)) { + IFluidHandler tTank = aBaseMetaTileEntity.getITankContainerAtSide(aBaseMetaTileEntity.getFrontFacing()); + if (tTank != null) { + FluidStack tDrained = drain(1000, false); + if (tDrained != null) { + int tFilledAmount = tTank.fill(ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()), tDrained, false); + if (tFilledAmount > 0) tTank.fill(ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()), drain(tFilledAmount, true), true); + } + } + if (getDrainableStack() == null) tRemovedOutputFluid = true; + } + + if (doesAutoOutput() && !isOutputEmpty() && aBaseMetaTileEntity.getFrontFacing() != mMainFacing && (tSucceeded || mOutputBlocked%300 == 1 || aBaseMetaTileEntity.hasInventoryBeenModified() || aTick%600 == 0)) { + TileEntity tTileEntity2 = aBaseMetaTileEntity.getTileEntityAtSide(aBaseMetaTileEntity.getFrontFacing()); + for (int i = 0, tCosts = 1; i < mOutputItems.length && tCosts > 0 && aBaseMetaTileEntity.isUniversalEnergyStored(128); i++) { + tCosts = GT_Utility.moveOneItemStack(aBaseMetaTileEntity, tTileEntity2, aBaseMetaTileEntity.getFrontFacing(), aBaseMetaTileEntity.getBackFacing(), null, false, (byte)64, (byte)1, (byte)64, (byte)1); + if (tCosts > 0) aBaseMetaTileEntity.decreaseStoredEnergyUnits(tCosts, true); + } + } + + if (mOutputBlocked != 0) if (isOutputEmpty()) mOutputBlocked = 0; else mOutputBlocked++; + + if (allowToCheckRecipe()) { + if (mMaxProgresstime <= 0 && aBaseMetaTileEntity.isAllowedToWork() && (tRemovedOutputFluid || tSucceeded || aBaseMetaTileEntity.hasInventoryBeenModified() || aTick%600 == 0 || aBaseMetaTileEntity.hasWorkJustBeenEnabled()) && hasEnoughEnergyToCheckRecipe()) { + if (checkRecipe() == 2) { + if (mInventory[3] != null && mInventory[3].stackSize <= 0) mInventory[3] = null; + for (int i=getInputSlot() , j=i+mInputSlotCount ; i64) mOutputItems[i].stackSize=64; + mOutputItems[i] = GT_OreDictUnificator.get(true, mOutputItems[i]); + } + if (mFluid != null && mFluid.amount <= 0) mFluid = null; + mMaxProgresstime = Math.max(1, mMaxProgresstime); + if (GT_Utility.isDebugItem(mInventory[dechargerSlotStartIndex()])) { + mEUt = mMaxProgresstime = 1; + } + startProcess(); + } else { + mMaxProgresstime = 0; + for (int i = 0; i < mOutputItems.length; i++) mOutputItems[i] = null; + mOutputFluid = null; + } + } + } else { + if (!mStuttering) { + stutterProcess(); + mStuttering = true; + } + } + } + } + + protected void doDisplayThings() { + if (mMainFacing < 2 && getBaseMetaTileEntity().getFrontFacing() > 1) { + mMainFacing = getBaseMetaTileEntity().getFrontFacing(); + } + if (mMainFacing >= 2 && !mHasBeenUpdated) { + mHasBeenUpdated = true; + getBaseMetaTileEntity().setFrontFacing(getBaseMetaTileEntity().getBackFacing()); + } + + if (displaysInputFluid()) { + int tDisplayStackSlot = OTHER_SLOT_COUNT+mInputSlotCount+mOutputItems.length; + if (getFillableStack() == null) { + if (ItemList.Display_Fluid.isStackEqual(mInventory[tDisplayStackSlot], true, true)) mInventory[tDisplayStackSlot] = null; + } else { + mInventory[tDisplayStackSlot] = GT_Utility.getFluidDisplayStack(getFillableStack(), displaysStackSize()); + } + } + } + + protected boolean hasEnoughEnergyToCheckRecipe() { + return getBaseMetaTileEntity().isUniversalEnergyStored(getMinimumStoredEU() / 2); + } + + protected boolean drainEnergyForProcess(long aEUt) { + return getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEUt, false); + } + + protected void calculateOverclockedNess(GT_Recipe aRecipe) { + calculateOverclockedNess(aRecipe.mEUt, aRecipe.mDuration); + } + + protected void calculateOverclockedNess(int aEUt, int aDuration) { + if (aEUt <= 16) { + mEUt = aEUt * (1 << (mTier-1)) * (1 << (mTier-1)); + mMaxProgresstime = aDuration / (1 << (mTier-1)); + } else { + mEUt = aEUt; + mMaxProgresstime = aDuration; + while (mEUt <= V[mTier-1] * mAmperage) { + mEUt *= 4; + mMaxProgresstime /= 2; + } + } + } + + protected ItemStack getSpecialSlot() { + return mInventory[3]; + } + + protected ItemStack getOutputAt(int aIndex) { + return mInventory[getOutputSlot()+aIndex]; + } + + protected ItemStack[] getAllOutputs() { + ItemStack[] rOutputs = new ItemStack[mOutputItems.length]; + for (int i = 0; i < mOutputItems.length; i++) rOutputs[i] = getOutputAt(i); + return rOutputs; + } + + protected boolean canOutput(GT_Recipe aRecipe) { + return aRecipe != null && (aRecipe.mNeedsEmptyOutput ? isOutputEmpty() && getDrainableStack() == null : canOutput(aRecipe.getFluidOutput(0)) && canOutput(aRecipe.mOutputs)); + } + + protected boolean canOutput(ItemStack... aOutputs) { + if (aOutputs == null) return true; + ItemStack[] tOutputSlots = getAllOutputs(); + for (int i = 0; i < tOutputSlots.length && i < aOutputs.length; i++) if (tOutputSlots[i] != null && aOutputs[i] != null && (!GT_Utility.areStacksEqual(tOutputSlots[i], aOutputs[i], false) || tOutputSlots[i].stackSize + aOutputs[i].stackSize > tOutputSlots[i].getMaxStackSize())) { + mOutputBlocked++; + return false; + } + return true; + } + + protected boolean canOutput(FluidStack aOutput) { + return getDrainableStack() == null || aOutput == null || (getDrainableStack().isFluidEqual(aOutput) && (getDrainableStack().amount <= 0 || getDrainableStack().amount + aOutput.amount <= getCapacity())); + } + + protected ItemStack getInputAt(int aIndex) { + return mInventory[getInputSlot()+aIndex]; + } + + protected ItemStack[] getAllInputs() { + ItemStack[] rInputs = new ItemStack[mInputSlotCount]; + for (int i = 0; i < mInputSlotCount; i++) rInputs[i] = getInputAt(i); + return rInputs; + } + + protected boolean isOutputEmpty() { + boolean rIsEmpty = true; + for (ItemStack tOutputSlotContent : getAllOutputs()) if (tOutputSlotContent != null) rIsEmpty = false; + return rIsEmpty; + } + + protected boolean displaysInputFluid() { + return true; + } + + protected boolean displaysOutputFluid() { + return true; + } + + @Override + public void onValueUpdate(byte aValue) { + mMainFacing = aValue; + } + + @Override + public byte getUpdateData() { + return (byte)mMainFacing; + } + + @Override + public void doSound(byte aIndex, double aX, double aY, double aZ) { + super.doSound(aIndex, aX, aY, aZ); + if (aIndex == 8) GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(210), 100, 1.0F, aX, aY, aZ); + } + + public boolean doesAutoOutput() { + return mItemTransfer; + } + + public boolean doesAutoOutputFluids() { + return mFluidTransfer; + } + + public boolean allowToCheckRecipe() { + return true; + } + + public boolean showPipeFacing() { + return true; + } + + /** Called whenever the Machine successfully started a Process, useful for Sound Effects */ + public void startProcess() { + // + } + + /** Called whenever the Machine successfully finished a Process, useful for Sound Effects */ + public void endProcess() { + // + } + + /** Called whenever the Machine aborted a Process, useful for Sound Effects */ + public void abortProcess() { + // + } + + /** Called whenever the Machine aborted a Process but still works on it, useful for Sound Effects */ + public void stutterProcess() { + if (useStandardStutterSound()) sendSound((byte)8); + } + + /** If this Machine can have the Insufficient Energy Line Problem */ + public boolean canHaveInsufficientEnergy() { + return true; + } + + public boolean useStandardStutterSound() { + return true; + } + + @Override + public String[] getInfoData() { + return new String[] {"Progress:", (mProgresstime/20)+" secs", (mMaxProgresstime/20)+" secs"}; + } + + @Override + public boolean isGivingInformation() { + return true; + } + + @Override + public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + if (aSide == getBaseMetaTileEntity().getFrontFacing() || aSide == mMainFacing) { + mAllowInputFromOutputSide = !mAllowInputFromOutputSide; + GT_Utility.sendChatToPlayer(aPlayer, mAllowInputFromOutputSide?"Input from Output Side allowed":"Input from Output Side forbidden"); + } + } + + @Override + public boolean allowCoverOnSide(byte aSide, GT_ItemStack aCoverID) { + return (aSide!=mMainFacing||GregTech_API.getCoverBehavior(aCoverID.toStack()).isGUIClickable(aSide, GT_Utility.stackToInt(aCoverID.toStack()), 0, getBaseMetaTileEntity())); + } + + @Override + public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return aSide!=mMainFacing&&aIndex>=getOutputSlot()&&aIndex=getInputSlot()+mInputSlotCount||(!mAllowInputFromOutputSide&&aSide==aBaseMetaTileEntity.getFrontFacing())) return false; + for (int i=getInputSlot(), j=i+mInputSlotCount; i)getBaseMetaTileEntity().getWorld().getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(getBaseMetaTileEntity().getOffsetX(getBaseMetaTileEntity().getFrontFacing(), 1), getBaseMetaTileEntity().getOffsetY(getBaseMetaTileEntity().getFrontFacing(), 1), getBaseMetaTileEntity().getOffsetZ(getBaseMetaTileEntity().getFrontFacing(), 1), getBaseMetaTileEntity().getOffsetX(getBaseMetaTileEntity().getFrontFacing(), 1)+1, getBaseMetaTileEntity().getOffsetY(getBaseMetaTileEntity().getFrontFacing(), 1)+1, getBaseMetaTileEntity().getOffsetZ(getBaseMetaTileEntity().getFrontFacing(), 1)+1))) { + GT_Utility.applyHeatDamage(tLiving, getSteamDamage()); + } + } catch(Throwable e) { + if (D1) e.printStackTrace(GT_Log.err); + } + } + return !mNeedsSteamVenting; + } + + @Override + public void endProcess() { + if (isSteampowered()) mNeedsSteamVenting = true; + } + + @Override + public void doSound(byte aIndex, double aX, double aY, double aZ) { + super.doSound(aIndex, aX, aY, aZ); + if (aIndex == 9) { + GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(4), 5, 1.0F, aX, aY, aZ); + for (int l = 0; l < 8; ++l) getBaseMetaTileEntity().getWorld().spawnParticle("largesmoke", aX - 0.5 + Math.random(), aY - 0.5 + Math.random(), aZ - 0.5 + Math.random(), ForgeDirection.getOrientation(getBaseMetaTileEntity().getFrontFacing()).offsetX / 5.0, ForgeDirection.getOrientation(getBaseMetaTileEntity().getFrontFacing()).offsetY / 5.0, ForgeDirection.getOrientation(getBaseMetaTileEntity().getFrontFacing()).offsetZ / 5.0); + } + } + + @Override + public boolean isGivingInformation() { + return false; + } + + @Override + public boolean allowCoverOnSide(byte aSide, GT_ItemStack aCoverID) { + return GregTech_API.getCoverBehavior(aCoverID.toStack()).isSimpleCover() && super.allowCoverOnSide(aSide, aCoverID); + } + + public float getSteamDamage() { + return 6.0F; + } + + @Override + public ITexture[] getSideFacingActive(byte aColor) { + return new ITexture[] {new GT_RenderedTexture(mTier==1?Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE:Textures.BlockIcons.MACHINE_BRONZE_SIDE, Dyes.getModulation(aColor, Dyes._NULL.mRGBa))}; + } + + @Override + public ITexture[] getSideFacingInactive(byte aColor) { + return new ITexture[] {new GT_RenderedTexture(mTier==1?Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE:Textures.BlockIcons.MACHINE_BRONZE_SIDE, Dyes.getModulation(aColor, Dyes._NULL.mRGBa))}; + } + + @Override + public ITexture[] getFrontFacingActive(byte aColor) { + return new ITexture[] {new GT_RenderedTexture(mTier==1?Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE:Textures.BlockIcons.MACHINE_BRONZE_SIDE, Dyes.getModulation(aColor, Dyes._NULL.mRGBa))}; + } + + @Override + public ITexture[] getFrontFacingInactive(byte aColor) { + return new ITexture[] {new GT_RenderedTexture(mTier==1?Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE:Textures.BlockIcons.MACHINE_BRONZE_SIDE, Dyes.getModulation(aColor, Dyes._NULL.mRGBa))}; + } + + @Override + public ITexture[] getTopFacingActive(byte aColor) { + return new ITexture[] {new GT_RenderedTexture(mTier==1?Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP:Textures.BlockIcons.MACHINE_BRONZE_TOP, Dyes.getModulation(aColor, Dyes._NULL.mRGBa))}; + } + + @Override + public ITexture[] getTopFacingInactive(byte aColor) { + return new ITexture[] {new GT_RenderedTexture(mTier==1?Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP:Textures.BlockIcons.MACHINE_BRONZE_TOP, Dyes.getModulation(aColor, Dyes._NULL.mRGBa))}; + } + + @Override + public ITexture[] getBottomFacingActive(byte aColor) { + return new ITexture[] {new GT_RenderedTexture(mTier==1?Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM:Textures.BlockIcons.MACHINE_BRONZE_BOTTOM, Dyes.getModulation(aColor, Dyes._NULL.mRGBa))}; + } + + @Override + public ITexture[] getBottomFacingInactive(byte aColor) { + return new ITexture[] {new GT_RenderedTexture(mTier==1?Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM:Textures.BlockIcons.MACHINE_BRONZE_BOTTOM, Dyes.getModulation(aColor, Dyes._NULL.mRGBa))}; + } + + @Override + public ITexture[] getBottomFacingPipeActive(byte aColor) { + return new ITexture[] {new GT_RenderedTexture(mTier==1?Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM:Textures.BlockIcons.MACHINE_BRONZE_BOTTOM, Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)}; + } + + @Override + public ITexture[] getBottomFacingPipeInactive(byte aColor) { + return new ITexture[] {new GT_RenderedTexture(mTier==1?Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM:Textures.BlockIcons.MACHINE_BRONZE_BOTTOM, Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)}; + } + + @Override + public ITexture[] getTopFacingPipeActive(byte aColor) { + return new ITexture[] {new GT_RenderedTexture(mTier==1?Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP:Textures.BlockIcons.MACHINE_BRONZE_TOP, Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)}; + } + + @Override + public ITexture[] getTopFacingPipeInactive(byte aColor) { + return new ITexture[] {new GT_RenderedTexture(mTier==1?Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP:Textures.BlockIcons.MACHINE_BRONZE_TOP, Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)}; + } + + @Override + public ITexture[] getSideFacingPipeActive(byte aColor) { + return new ITexture[] {new GT_RenderedTexture(mTier==1?Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE:Textures.BlockIcons.MACHINE_BRONZE_SIDE, Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)}; + } + + @Override + public ITexture[] getSideFacingPipeInactive(byte aColor) { + return new ITexture[] {new GT_RenderedTexture(mTier==1?Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE:Textures.BlockIcons.MACHINE_BRONZE_SIDE, Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)}; + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java new file mode 100644 index 0000000..558ec60 --- /dev/null +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java @@ -0,0 +1,323 @@ +package gregtech.api.metatileentity.implementations; + +import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.GT_Values.W; + +import java.util.Random; + +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.Textures; +import gregtech.api.enums.Tier; +import gregtech.api.gui.GT_Container_BasicMachine; +import gregtech.api.gui.GT_GUIContainer_BasicMachine; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_ModHandler.RecipeBits; +import gregtech.api.util.GT_Recipe.GT_Recipe_Map; +import gregtech.api.util.GT_Utility; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + +/** + * NEVER INCLUDE THIS FILE IN YOUR MOD!!! + * + * This is the main construct for my Basic Machines such as the Automatic Extractor + * Extend this class to make a simple Machine + */ +public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_BasicMachine { + public static enum X {PUMP, WIRE, WIRE4, HULL, PIPE, GLASS, PLATE, MOTOR, ROTOR, SENSOR, PISTON, CIRCUIT, EMITTER, CONVEYOR, ROBOT_ARM, COIL_HEATING, COIL_ELECTRIC, STICK_MAGNETIC, STICK_DISTILLATION, BETTER_CIRCUIT, FIELD_GENERATOR, COIL_HEATING_DOUBLE, STICK_ELECTROMAGNETIC;} + + private final GT_Recipe_Map mRecipes; + private final int mTankCapacity, mSpecialEffect; + private final String mSound; + private final boolean mSharedTank, mRequiresFluidForFiltering; + private final byte mGUIParameterA, mGUIParameterB; + + public GT_MetaTileEntity_BasicMachine_GT_Recipe(int aID, String aName, String aNameRegional, int aTier, String aDescription, GT_Recipe_Map aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, int aGUIParameterA, int aGUIParameterB, String aGUIName, String aSound, boolean aSharedTank, boolean aRequiresFluidForFiltering, int aSpecialEffect, String aOverlays, Object[] aRecipe) { + super(aID, aName, aNameRegional, aTier, aRecipes.mAmperage, aDescription, aInputSlots, aOutputSlots, aGUIName, aRecipes.mNEIName, new ITexture[] {new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase() + "/OVERLAY_SIDE_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase() + "/OVERLAY_SIDE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase() + "/OVERLAY_FRONT_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase() + "/OVERLAY_FRONT")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase() + "/OVERLAY_TOP_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase() + "/OVERLAY_TOP")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase() + "/OVERLAY_BOTTOM_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase() + "/OVERLAY_BOTTOM"))}); + mSharedTank = aSharedTank; + mTankCapacity = aTankCapacity; + mSpecialEffect = aSpecialEffect; + mRequiresFluidForFiltering = aRequiresFluidForFiltering; + mRecipes = aRecipes; + mSound = aSound; + mGUIParameterA = (byte)aGUIParameterA; + mGUIParameterB = (byte)aGUIParameterB; + + if (aRecipe != null) { + for (int i = 3; i < aRecipe.length; i++) { + if (aRecipe[i] == X.CIRCUIT) {aRecipe[i] = Tier.ELECTRIC[mTier].mManagingObject; continue;} + if (aRecipe[i] == X.BETTER_CIRCUIT) {aRecipe[i] = Tier.ELECTRIC[mTier].mBetterManagingObject; continue;} + if (aRecipe[i] == X.HULL) {aRecipe[i] = Tier.ELECTRIC[mTier].mHullObject; continue;} + if (aRecipe[i] == X.WIRE) {aRecipe[i] = Tier.ELECTRIC[mTier].mConductingObject; continue;} + if (aRecipe[i] == X.WIRE4) {aRecipe[i] = Tier.ELECTRIC[mTier].mLargerConductingObject; continue;} + + if (aRecipe[i] == X.GLASS) {switch(mTier) { + default: aRecipe[i] = new ItemStack(Blocks.glass, 1, W); break; + }continue;} + + if (aRecipe[i] == X.PLATE) {switch(mTier) { + case 0: case 1: aRecipe[i] = OrePrefixes.plate.get(Materials.Steel); break; + case 2: aRecipe[i] = OrePrefixes.plate.get(Materials.Aluminium); break; + case 3: aRecipe[i] = OrePrefixes.plate.get(Materials.StainlessSteel); break; + case 4: aRecipe[i] = OrePrefixes.plate.get(Materials.Titanium); break; + default: aRecipe[i] = OrePrefixes.plate.get(Materials.TungstenSteel); break; + }continue;} + + if (aRecipe[i] == X.PIPE) {switch(mTier) { + case 0: case 1: aRecipe[i] = OrePrefixes.pipeMedium.get(Materials.Bronze); break; + case 2: aRecipe[i] = OrePrefixes.pipeMedium.get(Materials.Steel); break; + case 3: aRecipe[i] = OrePrefixes.pipeMedium.get(Materials.StainlessSteel); break; + case 4: aRecipe[i] = OrePrefixes.pipeMedium.get(Materials.Titanium); break; + default: aRecipe[i] = OrePrefixes.pipeMedium.get(Materials.TungstenSteel); break; + }continue;} + + if (aRecipe[i] == X.COIL_HEATING) {switch(mTier) { + case 0: case 1: aRecipe[i] = OrePrefixes.wireGt02.get(Materials.AnyCopper); break; + case 2: aRecipe[i] = OrePrefixes.wireGt02.get(Materials.Cupronickel); break; + case 3: aRecipe[i] = OrePrefixes.wireGt02.get(Materials.Kanthal); break; + case 4: aRecipe[i] = OrePrefixes.wireGt02.get(Materials.Nichrome); break; + default: aRecipe[i] = OrePrefixes.wireGt08.get(Materials.Nichrome); break; + }continue;} + + if (aRecipe[i] == X.COIL_HEATING_DOUBLE) {switch(mTier) { + case 0: case 1: aRecipe[i] = OrePrefixes.wireGt04.get(Materials.AnyCopper); break; + case 2: aRecipe[i] = OrePrefixes.wireGt04.get(Materials.Cupronickel); break; + case 3: aRecipe[i] = OrePrefixes.wireGt04.get(Materials.Kanthal); break; + case 4: aRecipe[i] = OrePrefixes.wireGt04.get(Materials.Nichrome); break; + default: aRecipe[i] = OrePrefixes.wireGt16.get(Materials.Nichrome); break; + }continue;} + + if (aRecipe[i] == X.STICK_DISTILLATION) {switch(mTier) { + default: aRecipe[i] = OrePrefixes.stick.get(Materials.Blaze); break; + }continue;} + + if (aRecipe[i] == X.STICK_MAGNETIC) {switch(mTier) { + case 0: case 1: aRecipe[i] = OrePrefixes.stick.get(Materials.IronMagnetic); break; + case 2: case 3: aRecipe[i] = OrePrefixes.stick.get(Materials.SteelMagnetic); break; + default: aRecipe[i] = OrePrefixes.stick.get(Materials.NeodymiumMagnetic); break; + }continue;} + + if (aRecipe[i] == X.STICK_ELECTROMAGNETIC) {switch(mTier) { + case 0: case 1: aRecipe[i] = OrePrefixes.stick.get(Materials.AnyIron); break; + case 2: case 3: aRecipe[i] = OrePrefixes.stick.get(Materials.Steel); break; + case 4: aRecipe[i] = OrePrefixes.stick.get(Materials.Neodymium); break; + default: aRecipe[i] = OrePrefixes.stick.get(Materials.VanadiumGallium); break; + }continue;} + + if (aRecipe[i] == X.COIL_ELECTRIC) {switch(mTier) { + case 0: aRecipe[i] = OrePrefixes.wireGt01.get(Materials.Tin); break; + case 1: aRecipe[i] = OrePrefixes.wireGt02.get(Materials.Tin); break; + case 2: aRecipe[i] = OrePrefixes.wireGt02.get(Materials.AnyCopper); break; + case 3: aRecipe[i] = OrePrefixes.wireGt04.get(Materials.AnyCopper); break; + case 4: aRecipe[i] = OrePrefixes.wireGt08.get(Materials.AnnealedCopper); break; + default: aRecipe[i] = OrePrefixes.wireGt16.get(Materials.AnnealedCopper); break; + }continue;} + + if (aRecipe[i] == X.ROBOT_ARM) {switch(mTier) { + case 0: case 1: aRecipe[i] = ItemList.Robot_Arm_LV; break; + case 2: aRecipe[i] = ItemList.Robot_Arm_MV; break; + case 3: aRecipe[i] = ItemList.Robot_Arm_HV; break; + case 4: aRecipe[i] = ItemList.Robot_Arm_EV; break; + case 5: aRecipe[i] = ItemList.Robot_Arm_IV; break; + case 6: aRecipe[i] = ItemList.Robot_Arm_LuV; break; + case 7: aRecipe[i] = ItemList.Robot_Arm_ZPM; break; + default: aRecipe[i] = ItemList.Robot_Arm_UV; break; + }continue;} + + if (aRecipe[i] == X.PUMP) {switch(mTier) { + case 0: case 1: aRecipe[i] = ItemList.Electric_Pump_LV; break; + case 2: aRecipe[i] = ItemList.Electric_Pump_MV; break; + case 3: aRecipe[i] = ItemList.Electric_Pump_HV; break; + case 4: aRecipe[i] = ItemList.Electric_Pump_EV; break; + case 5: aRecipe[i] = ItemList.Electric_Pump_IV; break; + case 6: aRecipe[i] = ItemList.Electric_Pump_LuV; break; + case 7: aRecipe[i] = ItemList.Electric_Pump_ZPM; break; + default: aRecipe[i] = ItemList.Electric_Pump_UV; break; + }continue;} + + if (aRecipe[i] == X.ROTOR) {switch(mTier) { + case 0: case 1: aRecipe[i] = OrePrefixes.rotor.get(Materials.Tin); break; + case 2: aRecipe[i] = OrePrefixes.rotor.get(Materials.Bronze); break; + case 3: aRecipe[i] = OrePrefixes.rotor.get(Materials.Steel); break; + case 4: aRecipe[i] = OrePrefixes.rotor.get(Materials.StainlessSteel); break; + case 5: aRecipe[i] = OrePrefixes.rotor.get(Materials.TungstenSteel); break; + case 6: aRecipe[i] = OrePrefixes.rotor.get(Materials.TungstenSteel); break; + case 7: aRecipe[i] = OrePrefixes.rotor.get(Materials.TungstenSteel); break; + default: aRecipe[i] = OrePrefixes.rotor.get(Materials.TungstenSteel); break; + }continue;} + + if (aRecipe[i] == X.MOTOR) {switch(mTier) { + case 0: case 1: aRecipe[i] = ItemList.Electric_Motor_LV; break; + case 2: aRecipe[i] = ItemList.Electric_Motor_MV; break; + case 3: aRecipe[i] = ItemList.Electric_Motor_HV; break; + case 4: aRecipe[i] = ItemList.Electric_Motor_EV; break; + case 5: aRecipe[i] = ItemList.Electric_Motor_IV; break; + case 6: aRecipe[i] = ItemList.Electric_Motor_LuV; break; + case 7: aRecipe[i] = ItemList.Electric_Motor_ZPM; break; + default: aRecipe[i] = ItemList.Electric_Motor_UV; break; + }continue;} + + if (aRecipe[i] == X.PISTON) {switch(mTier) { + case 0: case 1: aRecipe[i] = ItemList.Electric_Piston_LV; break; + case 2: aRecipe[i] = ItemList.Electric_Piston_MV; break; + case 3: aRecipe[i] = ItemList.Electric_Piston_HV; break; + case 4: aRecipe[i] = ItemList.Electric_Piston_EV; break; + case 5: aRecipe[i] = ItemList.Electric_Piston_IV; break; + case 6: aRecipe[i] = ItemList.Electric_Piston_LuV; break; + case 7: aRecipe[i] = ItemList.Electric_Piston_ZPM; break; + default: aRecipe[i] = ItemList.Electric_Piston_UV; break; + }continue;} + + if (aRecipe[i] == X.CONVEYOR) {switch(mTier) { + case 0: case 1: aRecipe[i] = ItemList.Conveyor_Module_LV; break; + case 2: aRecipe[i] = ItemList.Conveyor_Module_MV; break; + case 3: aRecipe[i] = ItemList.Conveyor_Module_HV; break; + case 4: aRecipe[i] = ItemList.Conveyor_Module_EV; break; + case 5: aRecipe[i] = ItemList.Conveyor_Module_IV; break; + case 6: aRecipe[i] = ItemList.Conveyor_Module_LuV; break; + case 7: aRecipe[i] = ItemList.Conveyor_Module_ZPM; break; + default: aRecipe[i] = ItemList.Conveyor_Module_UV; break; + }continue;} + + if (aRecipe[i] == X.EMITTER) {switch(mTier) { + case 0: case 1: aRecipe[i] = ItemList.Emitter_LV; break; + case 2: aRecipe[i] = ItemList.Emitter_MV; break; + case 3: aRecipe[i] = ItemList.Emitter_HV; break; + case 4: aRecipe[i] = ItemList.Emitter_EV; break; + case 5: aRecipe[i] = ItemList.Emitter_IV; break; + case 6: aRecipe[i] = ItemList.Emitter_LuV; break; + case 7: aRecipe[i] = ItemList.Emitter_ZPM; break; + default: aRecipe[i] = ItemList.Emitter_UV; break; + }continue;} + + if (aRecipe[i] == X.SENSOR) {switch(mTier) { + case 0: case 1: aRecipe[i] = ItemList.Sensor_LV; break; + case 2: aRecipe[i] = ItemList.Sensor_MV; break; + case 3: aRecipe[i] = ItemList.Sensor_HV; break; + case 4: aRecipe[i] = ItemList.Sensor_EV; break; + case 5: aRecipe[i] = ItemList.Sensor_IV; break; + case 6: aRecipe[i] = ItemList.Sensor_LuV; break; + case 7: aRecipe[i] = ItemList.Sensor_ZPM; break; + default: aRecipe[i] = ItemList.Sensor_UV; break; + }continue;} + + if (aRecipe[i] == X.FIELD_GENERATOR) {switch(mTier) { + case 0: case 1: aRecipe[i] = ItemList.Field_Generator_LV; break; + case 2: aRecipe[i] = ItemList.Field_Generator_MV; break; + case 3: aRecipe[i] = ItemList.Field_Generator_HV; break; + case 4: aRecipe[i] = ItemList.Field_Generator_EV; break; + case 5: aRecipe[i] = ItemList.Field_Generator_IV; break; + case 6: aRecipe[i] = ItemList.Field_Generator_LuV; break; + case 7: aRecipe[i] = ItemList.Field_Generator_ZPM; break; + default: aRecipe[i] = ItemList.Field_Generator_UV; break; + }continue;} + + if (aRecipe[i] instanceof X) throw new IllegalArgumentException("MISSING TIER MAPPING FOR: " + aRecipe[i] + " AT TIER " + mTier); + } + + if (!GT_ModHandler.addCraftingRecipe(getStackForm(1), RecipeBits.DISMANTLEABLE | RecipeBits.BUFFERED | RecipeBits.NOT_REMOVABLE | RecipeBits.REVERSIBLE, aRecipe)) { + throw new IllegalArgumentException("INVALID CRAFTING RECIPE FOR: " + getStackForm(1).getDisplayName()); + } + } + } + + public GT_MetaTileEntity_BasicMachine_GT_Recipe(String aName, int aTier, String aDescription, GT_Recipe_Map aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, int aAmperage, int aGUIParameterA, int aGUIParameterB, ITexture[][][] aTextures, String aGUIName, String aNEIName, String aSound, boolean aSharedTank, boolean aRequiresFluidForFiltering, int aSpecialEffect) { + super(aName, aTier, aAmperage, aDescription, aTextures, aInputSlots, aOutputSlots, aGUIName, aNEIName); + mSharedTank = aSharedTank; + mTankCapacity = aTankCapacity; + mSpecialEffect = aSpecialEffect; + mRequiresFluidForFiltering = aRequiresFluidForFiltering; + mRecipes = aRecipes; + mSound = aSound; + mGUIParameterA = (byte)aGUIParameterA; + mGUIParameterB = (byte)aGUIParameterB; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_BasicMachine_GT_Recipe(mName, mTier, mDescription, mRecipes, mInputSlotCount, mOutputItems==null?0:mOutputItems.length, mTankCapacity, mAmperage, mGUIParameterA, mGUIParameterB, mTextures, mGUIName, mNEIName, mSound, mSharedTank, mRequiresFluidForFiltering, mSpecialEffect); + } + + @Override + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_Container_BasicMachine(aPlayerInventory, aBaseMetaTileEntity); + } + + @Override + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), mGUIName, GT_Utility.isStringValid(mNEIName) ? mNEIName : getRecipeList() != null ? getRecipeList().mUnlocalizedName : "", mGUIParameterA, mGUIParameterB); + } + + @Override + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + if (!super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) return false; + if (mInventory[aIndex] != null) return true; + switch (mInputSlotCount) { + case 0: return false; + case 1: return getFillableStack() == null ? !mRequiresFluidForFiltering && getRecipeList().containsInput(aStack) : null!=getRecipeList().findRecipe(getBaseMetaTileEntity(), mLastRecipe, true, V[mTier], new FluidStack[] {getFillableStack()}, getSpecialSlot(), new ItemStack[] {aStack}); + case 2: return (!mRequiresFluidForFiltering || getFillableStack() != null) && (((getInputAt(0)!=null&&getInputAt(1)!=null) || (getInputAt(0)==null&&getInputAt(1)==null?getRecipeList().containsInput(aStack):null!=getRecipeList().findRecipe(getBaseMetaTileEntity(), mLastRecipe, true, V[mTier], new FluidStack[] {getFillableStack()}, getSpecialSlot(), aIndex == getInputSlot() ? new ItemStack[] {aStack, getInputAt(1)} : new ItemStack[] {getInputAt(0), aStack})))); + default: return getRecipeList().containsInput(aStack); + } + } + + @Override + public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + super.onPreTick(aBaseMetaTileEntity, aTick); + if (aBaseMetaTileEntity.isClientSide() && aBaseMetaTileEntity.isActive()) { + switch (mSpecialEffect) { + case 0: + break; + case 1: + if (aBaseMetaTileEntity.getFrontFacing() != 1 && aBaseMetaTileEntity.getCoverIDAtSide((byte)1) == 0 && !aBaseMetaTileEntity.getOpacityAtSide((byte)1)) { + Random tRandom = aBaseMetaTileEntity.getWorld().rand; + aBaseMetaTileEntity.getWorld().spawnParticle("smoke", aBaseMetaTileEntity.getXCoord() + 0.8F -tRandom.nextFloat()*0.6F, aBaseMetaTileEntity.getYCoord() + 0.9F + tRandom.nextFloat()*0.2F, aBaseMetaTileEntity.getZCoord() + 0.8F -tRandom.nextFloat()*0.6F, 0.0D, 0.0D, 0.0D); + } + break; + } + } + } + + @Override + public GT_Recipe_Map getRecipeList() { + return mRecipes; + } + + @Override + public int getCapacity() { + return mTankCapacity; + } + + @Override + public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { + super.startSoundLoop(aIndex, aX, aY, aZ); + if (aIndex == 1 && GT_Utility.isStringValid(mSound)) GT_Utility.doSoundAtClient(mSound, 100, 1.0F, aX, aY, aZ); + } + + @Override + public void startProcess() { + if (GT_Utility.isStringValid(mSound)) sendLoopStart((byte)1); + } + + @Override + public FluidStack getFillableStack() { + return mSharedTank ? getDrainableStack() : super.getFillableStack(); + } + + @Override + public FluidStack setFillableStack(FluidStack aFluid) { + return mSharedTank ? setDrainableStack(aFluid) : super.setFillableStack(aFluid); + } + + @Override + protected boolean displaysOutputFluid() { + return !mSharedTank; + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_Steel.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_Steel.java new file mode 100644 index 0000000..a9a172b --- /dev/null +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_Steel.java @@ -0,0 +1,103 @@ +package gregtech.api.metatileentity.implementations; + +import gregtech.api.enums.Dyes; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.objects.GT_RenderedTexture; + + +/** + * NEVER INCLUDE THIS FILE IN YOUR MOD!!! + * + * This is the main construct for my Basic Machines such as the Automatic Extractor + * Extend this class to make a simple Machine + */ +public abstract class GT_MetaTileEntity_BasicMachine_Steel extends GT_MetaTileEntity_BasicMachine_Bronze { + public GT_MetaTileEntity_BasicMachine_Steel(int aID, String aName, String aNameRegional, String aDescription, int aInputSlotCount, int aOutputSlotCount, boolean aBricked) { + super(aID, aName, aNameRegional, aDescription, aInputSlotCount, aOutputSlotCount, aBricked); + } + + public GT_MetaTileEntity_BasicMachine_Steel(String aName, String aDescription, ITexture[][][] aTextures, int aInputSlotCount, int aOutputSlotCount, boolean aBricked) { + super(aName, aDescription, aTextures, aInputSlotCount, aOutputSlotCount, aBricked); + } + /* + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_BasicMachine_Steel(mTier, mDescription, mTextures); + } + */ + @Override + public float getSteamDamage() { + return 12.0F; + } + + @Override + public ITexture[] getSideFacingActive(byte aColor) { + return new ITexture[] {new GT_RenderedTexture(mTier==1?Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE:Textures.BlockIcons.MACHINE_STEEL_SIDE, Dyes.getModulation(aColor, Dyes._NULL.mRGBa))}; + } + + @Override + public ITexture[] getSideFacingInactive(byte aColor) { + return new ITexture[] {new GT_RenderedTexture(mTier==1?Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE:Textures.BlockIcons.MACHINE_STEEL_SIDE, Dyes.getModulation(aColor, Dyes._NULL.mRGBa))}; + } + + @Override + public ITexture[] getFrontFacingActive(byte aColor) { + return new ITexture[] {new GT_RenderedTexture(mTier==1?Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE:Textures.BlockIcons.MACHINE_STEEL_SIDE, Dyes.getModulation(aColor, Dyes._NULL.mRGBa))}; + } + + @Override + public ITexture[] getFrontFacingInactive(byte aColor) { + return new ITexture[] {new GT_RenderedTexture(mTier==1?Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE:Textures.BlockIcons.MACHINE_STEEL_SIDE, Dyes.getModulation(aColor, Dyes._NULL.mRGBa))}; + } + + @Override + public ITexture[] getTopFacingActive(byte aColor) { + return new ITexture[] {new GT_RenderedTexture(mTier==1?Textures.BlockIcons.MACHINE_STEELBRICKS_TOP:Textures.BlockIcons.MACHINE_STEEL_TOP, Dyes.getModulation(aColor, Dyes._NULL.mRGBa))}; + } + + @Override + public ITexture[] getTopFacingInactive(byte aColor) { + return new ITexture[] {new GT_RenderedTexture(mTier==1?Textures.BlockIcons.MACHINE_STEELBRICKS_TOP:Textures.BlockIcons.MACHINE_STEEL_TOP, Dyes.getModulation(aColor, Dyes._NULL.mRGBa))}; + } + + @Override + public ITexture[] getBottomFacingActive(byte aColor) { + return new ITexture[] {new GT_RenderedTexture(mTier==1?Textures.BlockIcons.MACHINE_STEELBRICKS_BOTTOM:Textures.BlockIcons.MACHINE_STEEL_BOTTOM, Dyes.getModulation(aColor, Dyes._NULL.mRGBa))}; + } + + @Override + public ITexture[] getBottomFacingInactive(byte aColor) { + return new ITexture[] {new GT_RenderedTexture(mTier==1?Textures.BlockIcons.MACHINE_STEELBRICKS_BOTTOM:Textures.BlockIcons.MACHINE_STEEL_BOTTOM, Dyes.getModulation(aColor, Dyes._NULL.mRGBa))}; + } + + @Override + public ITexture[] getBottomFacingPipeActive(byte aColor) { + return new ITexture[] {new GT_RenderedTexture(mTier==1?Textures.BlockIcons.MACHINE_STEELBRICKS_BOTTOM:Textures.BlockIcons.MACHINE_STEEL_BOTTOM, Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)}; + } + + @Override + public ITexture[] getBottomFacingPipeInactive(byte aColor) { + return new ITexture[] {new GT_RenderedTexture(mTier==1?Textures.BlockIcons.MACHINE_STEELBRICKS_BOTTOM:Textures.BlockIcons.MACHINE_STEEL_BOTTOM, Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)}; + } + + @Override + public ITexture[] getTopFacingPipeActive(byte aColor) { + return new ITexture[] {new GT_RenderedTexture(mTier==1?Textures.BlockIcons.MACHINE_STEELBRICKS_TOP:Textures.BlockIcons.MACHINE_STEEL_TOP, Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)}; + } + + @Override + public ITexture[] getTopFacingPipeInactive(byte aColor) { + return new ITexture[] {new GT_RenderedTexture(mTier==1?Textures.BlockIcons.MACHINE_STEELBRICKS_TOP:Textures.BlockIcons.MACHINE_STEEL_TOP, Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)}; + } + + @Override + public ITexture[] getSideFacingPipeActive(byte aColor) { + return new ITexture[] {new GT_RenderedTexture(mTier==1?Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE:Textures.BlockIcons.MACHINE_STEEL_SIDE, Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)}; + } + + @Override + public ITexture[] getSideFacingPipeInactive(byte aColor) { + return new ITexture[] {new GT_RenderedTexture(mTier==1?Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE:Textures.BlockIcons.MACHINE_STEEL_SIDE, Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)}; + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicTank.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicTank.java new file mode 100644 index 0000000..594411c --- /dev/null +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicTank.java @@ -0,0 +1,206 @@ +package gregtech.api.metatileentity.implementations; + +import gregtech.api.enums.ItemList; +import gregtech.api.gui.GT_Container_BasicTank; +import gregtech.api.gui.GT_GUIContainer_BasicTank; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.util.GT_Utility; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.fluids.FluidStack; + +/** + * NEVER INCLUDE THIS FILE IN YOUR MOD!!! + * + * This is the main construct for my generic Tanks. Filling and emptying behavior have to be implemented manually + */ +public abstract class GT_MetaTileEntity_BasicTank extends GT_MetaTileEntity_TieredMachineBlock { + + public FluidStack mFluid; + + /** + * @param aInvSlotCount should be 3 + */ + public GT_MetaTileEntity_BasicTank(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String aDescription, ITexture... aTextures) { + super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription, aTextures); + } + + public GT_MetaTileEntity_BasicTank(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aInvSlotCount, aDescription, aTextures); + } + + @Override public boolean isSimpleMachine() {return false;} + @Override public boolean isValidSlot(int aIndex) {return aIndex != getStackDisplaySlot();} + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + if (mFluid != null) aNBT.setTag("mFluid", mFluid.writeToNBT(new NBTTagCompound())); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + mFluid = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mFluid")); + } + + public abstract boolean doesFillContainers(); + public abstract boolean doesEmptyContainers(); + public abstract boolean canTankBeFilled(); + public abstract boolean canTankBeEmptied(); + public abstract boolean displaysItemStack(); + public abstract boolean displaysStackSize(); + public int getInputSlot() {return 0;} + public int getOutputSlot() {return 1;} + public int getStackDisplaySlot() {return 2;} + + public boolean isFluidInputAllowed(FluidStack aFluid) {return true;} + public boolean isFluidChangingAllowed() {return true;} + + public FluidStack getFillableStack() {return mFluid;} + public FluidStack setFillableStack(FluidStack aFluid) {mFluid = aFluid; return mFluid;} + public FluidStack getDrainableStack() {return mFluid;} + public FluidStack setDrainableStack(FluidStack aFluid) {mFluid = aFluid; return mFluid;} + public FluidStack getDisplayedFluid() {return getDrainableStack();} + + @Override + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_Container_BasicTank(aPlayerInventory, aBaseMetaTileEntity); + } + + @Override + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_BasicTank(aPlayerInventory, aBaseMetaTileEntity, getLocalName()); + } + + @Override + public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if (aBaseMetaTileEntity.isServerSide()) { + if (isFluidChangingAllowed() && getFillableStack() != null && getFillableStack().amount <= 0) setFillableStack(null); + + if (displaysItemStack() && getStackDisplaySlot() >= 0 && getStackDisplaySlot() < mInventory.length) { + if (getDisplayedFluid() == null) { + if (ItemList.Display_Fluid.isStackEqual(mInventory[getStackDisplaySlot()], true, true)) mInventory[getStackDisplaySlot()] = null; + } else { + mInventory[getStackDisplaySlot()] = GT_Utility.getFluidDisplayStack(getDisplayedFluid(), displaysStackSize()); + } + } + + if (doesEmptyContainers()) { + FluidStack tFluid = GT_Utility.getFluidForFilledItem(mInventory[getInputSlot()], true); + if (tFluid != null && isFluidInputAllowed(tFluid)) { + if (getFillableStack() == null) { + if (isFluidInputAllowed(tFluid) && tFluid.amount <= getCapacity()) { + if (aBaseMetaTileEntity.addStackToSlot(getOutputSlot(), GT_Utility.getContainerItem(mInventory[getInputSlot()], true), 1)) { + setFillableStack(tFluid.copy()); + aBaseMetaTileEntity.decrStackSize(getInputSlot(), 1); + } + } + } else { + if (tFluid.isFluidEqual(getFillableStack()) && tFluid.amount + getFillableStack().amount <= getCapacity()) { + if (aBaseMetaTileEntity.addStackToSlot(getOutputSlot(), GT_Utility.getContainerItem(mInventory[getInputSlot()], true), 1)) { + getFillableStack().amount+=tFluid.amount; + aBaseMetaTileEntity.decrStackSize(getInputSlot(), 1); + } + } + } + } + } + + if (doesFillContainers()) { + ItemStack tOutput = GT_Utility.fillFluidContainer(getDrainableStack(), mInventory[getInputSlot()], false, true); + if (tOutput != null && aBaseMetaTileEntity.addStackToSlot(getOutputSlot(), tOutput, 1)) { + FluidStack tFluid = GT_Utility.getFluidForFilledItem(tOutput, true); + aBaseMetaTileEntity.decrStackSize(getInputSlot(), 1); + if (tFluid != null) getDrainableStack().amount -= tFluid.amount; + if (getDrainableStack().amount <= 0 && isFluidChangingAllowed()) setDrainableStack(null); + } + } + } + } + + @Override + public FluidStack getFluid() { + return getDrainableStack(); + } + + @Override + public int getFluidAmount() { + return getDrainableStack() != null ? getDrainableStack().amount : 0; + } + + @Override + public int fill(FluidStack aFluid, boolean doFill) { + if (aFluid == null || aFluid.getFluid().getID() <= 0 || aFluid.amount <= 0 || !canTankBeFilled() || !isFluidInputAllowed(aFluid)) return 0; + + if (getFillableStack() == null || getFillableStack().getFluid().getID() <= 0) { + if(aFluid.amount <= getCapacity()) { + if (doFill) { + setFillableStack(aFluid.copy()); + getBaseMetaTileEntity().markDirty(); + } + return aFluid.amount; + } + if (doFill) { + setFillableStack(aFluid.copy()); + getFillableStack().amount = getCapacity(); + getBaseMetaTileEntity().markDirty(); + } + return getCapacity(); + } + + if (!getFillableStack().isFluidEqual(aFluid)) + return 0; + + int space = getCapacity() - getFillableStack().amount; + if (aFluid.amount <= space) { + if (doFill) { + getFillableStack().amount += aFluid.amount; + getBaseMetaTileEntity().markDirty(); + } + return aFluid.amount; + } + if (doFill) + getFillableStack().amount = getCapacity(); + return space; + } + + @Override + public FluidStack drain(int maxDrain, boolean doDrain) { + if (getDrainableStack() == null || !canTankBeEmptied()) return null; + if (getDrainableStack().amount <= 0 && isFluidChangingAllowed()) { + setDrainableStack(null); + getBaseMetaTileEntity().markDirty(); + return null; + } + + int used = maxDrain; + if (getDrainableStack().amount < used) + used = getDrainableStack().amount; + + if (doDrain) { + getDrainableStack().amount -= used; + getBaseMetaTileEntity().markDirty(); + } + + FluidStack drained = getDrainableStack().copy(); + drained.amount = used; + + if (getDrainableStack().amount <= 0 && isFluidChangingAllowed()) { + setDrainableStack(null); + getBaseMetaTileEntity().markDirty(); + } + + return drained; + } + + @Override + public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return aIndex==getOutputSlot(); + } + + @Override + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return aIndex==getInputSlot(); + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java new file mode 100644 index 0000000..15552fd --- /dev/null +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java @@ -0,0 +1,173 @@ +package gregtech.api.metatileentity.implementations; + +import static gregtech.api.enums.GT_Values.V; + +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Utility; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredMachineBlock { + public boolean bOutput = false, bRedstoneIfFull = false, bInvert = false; + public int mSuccess = 0, mTargetStackSize = 0; + + public GT_MetaTileEntity_Buffer(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String aDescription) { + super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription); + } + + public GT_MetaTileEntity_Buffer(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aInvSlotCount, aDescription, aTextures); + } + + @Override + public ITexture[][][] getTextureSet(ITexture[] aTextures) { + ITexture[][][] rTextures = new ITexture[6][17][]; + ITexture tIcon = getOverlayIcon(), tOut = new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT), tUp = new GT_RenderedTexture(Textures.BlockIcons.ARROW_UP), tDown = new GT_RenderedTexture(Textures.BlockIcons.ARROW_DOWN), tLeft = new GT_RenderedTexture(Textures.BlockIcons.ARROW_LEFT), tRight = new GT_RenderedTexture(Textures.BlockIcons.ARROW_RIGHT); + for (byte i = -1; i < 16; i++) { + rTextures[ 0][i+1] = new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][i+1], tOut }; + rTextures[ 1][i+1] = new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][i+1], tRight , tIcon }; + rTextures[ 2][i+1] = new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][i+1], tDown , tIcon }; + rTextures[ 3][i+1] = new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][i+1], tLeft , tIcon }; + rTextures[ 4][i+1] = new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][i+1], tUp , tIcon }; + rTextures[ 5][i+1] = new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][i+1] , tIcon }; + } + return rTextures; + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + if (aSide == aFacing) return mTextures[5][aColorIndex+1]; + if (GT_Utility.getOppositeSide(aSide) == aFacing) return mTextures[0][aColorIndex+1]; + switch (aFacing) { + case 0: + return mTextures[4][aColorIndex+1]; + case 1: + return mTextures[2][aColorIndex+1]; + case 2: switch (aSide) { + case 0: return mTextures[2][aColorIndex+1]; + case 1: return mTextures[2][aColorIndex+1]; + case 4: return mTextures[1][aColorIndex+1]; + case 5: return mTextures[3][aColorIndex+1]; + } + case 3: switch (aSide) { + case 0: return mTextures[4][aColorIndex+1]; + case 1: return mTextures[4][aColorIndex+1]; + case 4: return mTextures[3][aColorIndex+1]; + case 5: return mTextures[1][aColorIndex+1]; + } + case 4: switch (aSide) { + case 0: return mTextures[3][aColorIndex+1]; + case 1: return mTextures[1][aColorIndex+1]; + case 2: return mTextures[3][aColorIndex+1]; + case 3: return mTextures[1][aColorIndex+1]; + } + case 5: switch (aSide) { + case 0: return mTextures[1][aColorIndex+1]; + case 1: return mTextures[3][aColorIndex+1]; + case 2: return mTextures[1][aColorIndex+1]; + case 3: return mTextures[3][aColorIndex+1]; + } + } + return mTextures[5][aColorIndex+1]; + } + + @Override public boolean isSimpleMachine() {return false;} + @Override public boolean isValidSlot(int aIndex) {return aIndex 0) aNBT.setInteger("mTargetStackSize", mTargetStackSize); + } + + @Override + public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + if (aSide == getBaseMetaTileEntity().getBackFacing()) { + mTargetStackSize=(byte)((mTargetStackSize+1)%65); + if (mTargetStackSize == 0) { + GT_Utility.sendChatToPlayer(aPlayer, "Do not regulate Item Stack Size"); + } else { + GT_Utility.sendChatToPlayer(aPlayer, "Regulate Item Stack Size to: " + mTargetStackSize); + } + } + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) { + if (aBaseMetaTileEntity.isAllowedToWork() && aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isUniversalEnergyStored(getMinimumStoredEU()) && (aBaseMetaTileEntity.hasWorkJustBeenEnabled() || aBaseMetaTileEntity.hasInventoryBeenModified() || aTimer%200 == 0 || mSuccess > 0)) { + mSuccess--; + moveItems(aBaseMetaTileEntity, aTimer); + aBaseMetaTileEntity.setGenericRedstoneOutput(bInvert); + if (bRedstoneIfFull) { + aBaseMetaTileEntity.setGenericRedstoneOutput(!bInvert); + for (int i = 0; i < mInventory.length; i++) if (isValidSlot(i)) { + if (mInventory[i] == null) { + aBaseMetaTileEntity.setGenericRedstoneOutput(bInvert); + aBaseMetaTileEntity.decreaseStoredEnergyUnits(1, true); + break; + } + } + } + } + } + + protected void moveItems(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) { + int tCost = GT_Utility.moveOneItemStack(aBaseMetaTileEntity, aBaseMetaTileEntity.getTileEntityAtSide(aBaseMetaTileEntity.getBackFacing()), aBaseMetaTileEntity.getBackFacing(), aBaseMetaTileEntity.getFrontFacing(), null, false, mTargetStackSize==0?64:(byte)mTargetStackSize, mTargetStackSize==0?1:(byte)mTargetStackSize, (byte)64, (byte)1); + if (tCost > 0 || aBaseMetaTileEntity.hasInventoryBeenModified()) { + mSuccess = 50; + aBaseMetaTileEntity.decreaseStoredEnergyUnits(Math.abs(tCost), true); + } + } + + @Override + public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return true; + } + + @Override + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return aSide != aBaseMetaTileEntity.getBackFacing(); + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch.java new file mode 100644 index 0000000..4945b9c --- /dev/null +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch.java @@ -0,0 +1,84 @@ +package gregtech.api.metatileentity.implementations; + +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import net.minecraft.nbt.NBTTagCompound; + +public abstract class GT_MetaTileEntity_Hatch extends GT_MetaTileEntity_BasicTank { + + public byte mMachineBlock = 0; + + public GT_MetaTileEntity_Hatch(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String aDescription, ITexture... aTextures) { + super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription, aTextures); + } + + public GT_MetaTileEntity_Hatch(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aInvSlotCount, aDescription, aTextures); + } + + @Override + public ITexture[][][] getTextureSet(ITexture[] aTextures) { + return new ITexture[0][0][0]; + } + + public abstract ITexture[] getTexturesActive(ITexture aBaseTexture); + public abstract ITexture[] getTexturesInactive(ITexture aBaseTexture); + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + return aSide != aFacing ? mMachineBlock != 0 ? new ITexture[] {Textures.BlockIcons.CASING_BLOCKS[mMachineBlock]} : new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex+1]} : mMachineBlock != 0 ? aActive ? getTexturesActive(Textures.BlockIcons.CASING_BLOCKS[mMachineBlock]) : getTexturesInactive(Textures.BlockIcons.CASING_BLOCKS[mMachineBlock]) : aActive ? getTexturesActive(Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex+1]) : getTexturesInactive(Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex+1]); + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + super.saveNBTData(aNBT); + aNBT.setByte("mMachineBlock", mMachineBlock); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + super.loadNBTData(aNBT); + mMachineBlock = aNBT.getByte("mMachineBlock"); + } + + @Override + public final void onValueUpdate(byte aValue) { + mMachineBlock = (byte)(aValue & 127); + } + + @Override + public final byte getUpdateData() { + return (byte)(mMachineBlock & 127); + } + + @Override + public boolean doesFillContainers() { + return false; + } + + @Override + public boolean doesEmptyContainers() { + return false; + } + + @Override + public boolean canTankBeFilled() { + return false; + } + + @Override + public boolean canTankBeEmptied() { + return false; + } + + @Override + public boolean displaysItemStack() { + return false; + } + + @Override + public boolean displaysStackSize() { + return false; + } +} diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Dynamo.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Dynamo.java new file mode 100644 index 0000000..0995271 --- /dev/null +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Dynamo.java @@ -0,0 +1,55 @@ +package gregtech.api.metatileentity.implementations; + +import static gregtech.api.enums.GT_Values.V; + +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + +public class GT_MetaTileEntity_Hatch_Dynamo extends GT_MetaTileEntity_Hatch { + public GT_MetaTileEntity_Hatch_Dynamo(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, 0, "Generating electric Energy from Multiblocks"); + } + + public GT_MetaTileEntity_Hatch_Dynamo(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, 0, aDescription, aTextures); + } + + @Override + public ITexture[] getTexturesActive(ITexture aBaseTexture) { + return new ITexture[] {aBaseTexture, Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier]}; + } + + @Override + public ITexture[] getTexturesInactive(ITexture aBaseTexture) { + return new ITexture[] {aBaseTexture, Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier]}; + } + + @Override public boolean isSimpleMachine() {return true;} + @Override public boolean isFacingValid(byte aFacing) {return true;} + @Override public boolean isAccessAllowed(EntityPlayer aPlayer) {return true;} + @Override public boolean isEnetOutput() {return true;} + @Override public boolean isOutputFacing(byte aSide) {return aSide==getBaseMetaTileEntity().getFrontFacing();} + @Override public boolean isValidSlot(int aIndex) {return false;} + @Override public long getMinimumStoredEU() {return 512;} + @Override public long maxEUOutput() {return V[mTier];} + @Override public long maxEUStore() {return 512+V[mTier+1]*2;} + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Hatch_Dynamo(mName, mTier, mDescription, mTextures); + } + + @Override + public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return false; + } + + @Override + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return false; + } +} diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Energy.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Energy.java new file mode 100644 index 0000000..b3801fa --- /dev/null +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Energy.java @@ -0,0 +1,56 @@ +package gregtech.api.metatileentity.implementations; + +import static gregtech.api.enums.GT_Values.V; + +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + +public class GT_MetaTileEntity_Hatch_Energy extends GT_MetaTileEntity_Hatch { + public GT_MetaTileEntity_Hatch_Energy(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, 0, "Energy Injector for Multiblocks"); + } + + public GT_MetaTileEntity_Hatch_Energy(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, 0, aDescription, aTextures); + } + + @Override + public ITexture[] getTexturesActive(ITexture aBaseTexture) { + return new ITexture[] {aBaseTexture, Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[mTier]}; + } + + @Override + public ITexture[] getTexturesInactive(ITexture aBaseTexture) { + return new ITexture[] {aBaseTexture, Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[mTier]}; + } + + @Override public boolean isSimpleMachine() {return true;} + @Override public boolean isFacingValid(byte aFacing) {return true;} + @Override public boolean isAccessAllowed(EntityPlayer aPlayer) {return true;} + @Override public boolean isEnetInput() {return true;} + @Override public boolean isInputFacing(byte aSide) {return aSide==getBaseMetaTileEntity().getFrontFacing();} + @Override public boolean isValidSlot(int aIndex) {return false;} + @Override public long getMinimumStoredEU() {return 512;} + @Override public long maxEUInput() {return V[mTier];} + @Override public long maxEUStore() {return 512+V[mTier]*8;} + @Override public long maxAmperesIn() {return 2;} + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Hatch_Energy(mName, mTier, mDescription, mTextures); + } + + @Override + public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return false; + } + + @Override + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return false; + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Input.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Input.java new file mode 100644 index 0000000..ecaa83d --- /dev/null +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Input.java @@ -0,0 +1,86 @@ +package gregtech.api.metatileentity.implementations; + +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Recipe.GT_Recipe_Map; +import gregtech.api.util.GT_Utility; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + +public class GT_MetaTileEntity_Hatch_Input extends GT_MetaTileEntity_Hatch { + public GT_Recipe_Map mRecipeMap = null; + + public GT_MetaTileEntity_Hatch_Input(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, 3, "For inputting Materials into Multiblocks"); + } + + public GT_MetaTileEntity_Hatch_Input(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, 3, aDescription, aTextures); + } + + @Override + public ITexture[] getTexturesActive(ITexture aBaseTexture) { + return new ITexture[] {aBaseTexture, new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_IN)}; + } + + @Override + public ITexture[] getTexturesInactive(ITexture aBaseTexture) { + return new ITexture[] {aBaseTexture, new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_IN)}; + } + + @Override public boolean isSimpleMachine() {return true;} + @Override public boolean isFacingValid(byte aFacing) {return true;} + @Override public boolean isAccessAllowed(EntityPlayer aPlayer) {return true;} + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Hatch_Input(mName, mTier, mDescription, mTextures); + } + + @Override + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { + if (aBaseMetaTileEntity.isClientSide()) return true; + aBaseMetaTileEntity.openGUI(aPlayer); + return true; + } + + @Override public boolean doesFillContainers() {return true;} + @Override public boolean doesEmptyContainers() {return true;} + @Override public boolean canTankBeFilled() {return true;} + @Override public boolean canTankBeEmptied() {return true;} + @Override public boolean displaysItemStack() {return true;} + @Override public boolean displaysStackSize() {return false;} + + public void updateSlots() { + if (mInventory[getInputSlot()] != null && mInventory[getInputSlot()].stackSize <= 0) mInventory[getInputSlot()] = null; + } + + @Override + public boolean isFluidInputAllowed(FluidStack aFluid) { + return mRecipeMap == null || mRecipeMap.containsInput(aFluid); + } + + @Override + public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return aSide == aBaseMetaTileEntity.getFrontFacing() && aIndex == 1; + } + + @Override + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return aSide == aBaseMetaTileEntity.getFrontFacing() && aIndex == 0 && (mRecipeMap == null || mRecipeMap.containsInput(aStack) || mRecipeMap.containsInput(GT_Utility.getFluidForFilledItem(aStack, true))); + } + + @Override + public int getCapacity() { + return 8000 * (mTier + 1); + } + + @Override + public int getTankPressure() { + return -100; + } +} diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBus.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBus.java new file mode 100644 index 0000000..7f7614b --- /dev/null +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBus.java @@ -0,0 +1,108 @@ +package gregtech.api.metatileentity.implementations; + +import gregtech.api.enums.Textures; +import gregtech.api.gui.GT_Container_1by1; +import gregtech.api.gui.GT_Container_2by2; +import gregtech.api.gui.GT_Container_3by3; +import gregtech.api.gui.GT_Container_4by4; +import gregtech.api.gui.GT_GUIContainer_1by1; +import gregtech.api.gui.GT_GUIContainer_2by2; +import gregtech.api.gui.GT_GUIContainer_3by3; +import gregtech.api.gui.GT_GUIContainer_4by4; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Recipe.GT_Recipe_Map; +import gregtech.api.util.GT_Utility; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; + +public class GT_MetaTileEntity_Hatch_InputBus extends GT_MetaTileEntity_Hatch { + public GT_Recipe_Map mRecipeMap = null; + + public GT_MetaTileEntity_Hatch_InputBus(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, aTier<1?1:aTier==1?4:aTier==2?9:16, "Better Input Hatch for more complex Multiblocks"); + } + + public GT_MetaTileEntity_Hatch_InputBus(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aTier<1?1:aTier==1?4:aTier==2?9:16, aDescription, aTextures); + } + + @Override + public ITexture[] getTexturesActive(ITexture aBaseTexture) { + return new ITexture[] {aBaseTexture, new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_IN)}; + } + + @Override + public ITexture[] getTexturesInactive(ITexture aBaseTexture) { + return new ITexture[] {aBaseTexture, new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_IN)}; + } + + @Override public boolean isSimpleMachine() {return true;} + @Override public boolean isFacingValid(byte aFacing) {return true;} + @Override public boolean isAccessAllowed(EntityPlayer aPlayer) {return true;} + @Override public boolean isValidSlot(int aIndex) {return true;} + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Hatch_InputBus(mName, mTier, mDescription, mTextures); + } + + @Override + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { + if (aBaseMetaTileEntity.isClientSide()) return true; + aBaseMetaTileEntity.openGUI(aPlayer); + return true; + } + + @Override + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + switch (mTier) { + case 0: return new GT_Container_1by1(aPlayerInventory, aBaseMetaTileEntity); + case 1: return new GT_Container_2by2(aPlayerInventory, aBaseMetaTileEntity); + case 2: return new GT_Container_3by3(aPlayerInventory, aBaseMetaTileEntity); + default: return new GT_Container_4by4(aPlayerInventory, aBaseMetaTileEntity); + } + } + + @Override + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + switch (mInventory.length) { + case 1: return new GT_GUIContainer_1by1(aPlayerInventory, aBaseMetaTileEntity, "Input Bus"); + case 4: return new GT_GUIContainer_2by2(aPlayerInventory, aBaseMetaTileEntity, "Input Bus"); + case 9: return new GT_GUIContainer_3by3(aPlayerInventory, aBaseMetaTileEntity, "Input Bus"); + case 16: return new GT_GUIContainer_4by4(aPlayerInventory, aBaseMetaTileEntity, "Input Bus"); + default: return new GT_GUIContainer_4by4(aPlayerInventory, aBaseMetaTileEntity, "Input Bus"); + } + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) { + if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.hasInventoryBeenModified()) { + fillStacksIntoFirstSlots(); + } + } + + public void updateSlots() { + for (int i = 0; i < mInventory.length; i++) if (mInventory[i] != null && mInventory[i].stackSize <= 0) mInventory[i] = null; + fillStacksIntoFirstSlots(); + } + + protected void fillStacksIntoFirstSlots() { + for (int i = 0; i < mInventory.length; i++) for (int j = i + 1; j < mInventory.length; j++) if (mInventory[j] != null && (mInventory[i] == null || GT_Utility.areStacksEqual(mInventory[i], mInventory[j]))) { + GT_Utility.moveStackFromSlotAToSlotB(getBaseMetaTileEntity(), getBaseMetaTileEntity(), j, i, (byte)64, (byte)1, (byte)64, (byte)1); + } + } + + @Override + public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return false; + } + + @Override + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return aSide == getBaseMetaTileEntity().getFrontFacing() && (mRecipeMap == null || mRecipeMap.containsInput(aStack)); + } +} diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Maintenance.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Maintenance.java new file mode 100644 index 0000000..fc68798 --- /dev/null +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Maintenance.java @@ -0,0 +1,106 @@ +package gregtech.api.metatileentity.implementations; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +import gregtech.api.gui.GT_Container_MaintenanceHatch; +import gregtech.api.gui.GT_GUIContainer_MaintenanceHatch; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Utility; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch { + public boolean mWrench = false, mScrewdriver = false, mSoftHammer = false, mHardHammer = false, mSolderingTool = false, mCrowbar = false; + + public GT_MetaTileEntity_Hatch_Maintenance(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, 1, "For maintaining Multiblocks"); + } + + public GT_MetaTileEntity_Hatch_Maintenance(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, 1, aDescription, aTextures); + } + + @Override + public String[] getDescription() { + return new String[] {mDescription, "Cannot be shared between Multiblocks!"}; + } + + @Override + public ITexture[] getTexturesActive(ITexture aBaseTexture) { + return new ITexture[] {aBaseTexture, new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_MAINTENANCE)}; + } + + @Override + public ITexture[] getTexturesInactive(ITexture aBaseTexture) { + return new ITexture[] {aBaseTexture, new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_MAINTENANCE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_DUCTTAPE)}; + } + + @Override + public void initDefaultModes(NBTTagCompound aNBT) { + getBaseMetaTileEntity().setActive(true); + } + + @Override public boolean isSimpleMachine() {return true;} + @Override public boolean isFacingValid(byte aFacing) {return true;} + @Override public boolean isAccessAllowed(EntityPlayer aPlayer) {return true;} + @Override public boolean isValidSlot(int aIndex) {return false;} + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Hatch_Maintenance(mName, mTier, mDescription, mTextures); + } + + @Override + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) { + if (aBaseMetaTileEntity.isClientSide()) return true; + if (aSide == aBaseMetaTileEntity.getFrontFacing()) aBaseMetaTileEntity.openGUI(aPlayer); + return true; + } + + @Override + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_Container_MaintenanceHatch(aPlayerInventory, aBaseMetaTileEntity); + } + + @Override + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_MaintenanceHatch(aPlayerInventory, aBaseMetaTileEntity); + } + + public void onToolClick(ItemStack aStack, EntityLivingBase aPlayer) { + if (aStack == null || aPlayer == null) return; + if (GT_Utility.isStackInList(aStack, GregTech_API.sWrenchList ) && GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) mWrench = true; + if (GT_Utility.isStackInList(aStack, GregTech_API.sScrewdriverList ) && GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) mScrewdriver = true; + if (GT_Utility.isStackInList(aStack, GregTech_API.sSoftHammerList ) && GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) mSoftHammer = true; + if (GT_Utility.isStackInList(aStack, GregTech_API.sHardHammerList ) && GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) mHardHammer = true; + if (GT_Utility.isStackInList(aStack, GregTech_API.sCrowbarList ) && GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) mCrowbar = true; + if (GT_ModHandler.useSolderingIron(aStack, aPlayer)) mSolderingTool = true; + if (GT_OreDictUnificator.isItemStackInstanceOf(aStack, "craftingDuctTape")) { + mWrench = mScrewdriver = mSoftHammer = mHardHammer = mCrowbar = mSolderingTool = true; + getBaseMetaTileEntity().setActive(false); + aStack.stackSize--; + } + if(mSolderingTool&&aPlayer instanceof EntityPlayerMP){ + EntityPlayerMP tPlayer = (EntityPlayerMP) aPlayer; + } + } + + @Override + public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return false; + } + + @Override + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return false; + } +} diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java new file mode 100644 index 0000000..de3b996 --- /dev/null +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java @@ -0,0 +1,58 @@ +package gregtech.api.metatileentity.implementations; + +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.objects.GT_RenderedTexture; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + +public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch { + public GT_MetaTileEntity_Hatch_Muffler(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, 0, "Outputs the Pollution (Pollution might come later)"); + } + + public GT_MetaTileEntity_Hatch_Muffler(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, 0, aDescription, aTextures); + } + + @Override + public String[] getDescription() { + return new String[] {mDescription, "DO NOT OBSTRUCT THE OUTPUT!"}; + } + + @Override + public ITexture[] getTexturesActive(ITexture aBaseTexture) { + return new ITexture[] {aBaseTexture, new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_MUFFLER)}; + } + + @Override + public ITexture[] getTexturesInactive(ITexture aBaseTexture) { + return new ITexture[] {aBaseTexture, new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_MUFFLER)}; + } + + @Override public boolean isSimpleMachine() {return true;} + @Override public boolean isFacingValid(byte aFacing) {return true;} + @Override public boolean isAccessAllowed(EntityPlayer aPlayer) {return true;} + @Override public boolean isValidSlot(int aIndex) {return false;} + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Hatch_Muffler(mName, mTier, mDescription, mTextures); + } + + public boolean polluteEnvironment() { + return (mTier > 1 && getBaseMetaTileEntity().getRandomNumber(mTier) != 0) || getBaseMetaTileEntity().getAirAtSide(getBaseMetaTileEntity().getFrontFacing()); + } + + @Override + public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return false; + } + + @Override + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return false; + } +} diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Output.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Output.java new file mode 100644 index 0000000..9dc9b14 --- /dev/null +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Output.java @@ -0,0 +1,141 @@ +package gregtech.api.metatileentity.implementations; + +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Utility; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.IFluidHandler; + +public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch { + public byte mMode = 0; + + public GT_MetaTileEntity_Hatch_Output(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, 3, "Use Screwdriver to specify Output Type"); + } + + public GT_MetaTileEntity_Hatch_Output(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, 3, aDescription, aTextures); + } + + @Override + public ITexture[] getTexturesActive(ITexture aBaseTexture) { + return new ITexture[] {aBaseTexture, new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)}; + } + + @Override + public ITexture[] getTexturesInactive(ITexture aBaseTexture) { + return new ITexture[] {aBaseTexture, new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)}; + } + + @Override public boolean isSimpleMachine() {return true;} + @Override public boolean isFacingValid(byte aFacing) {return true;} + @Override public boolean isAccessAllowed(EntityPlayer aPlayer) {return true;} + @Override public boolean isLiquidInput(byte aSide) {return false;} + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Hatch_Output(mName, mTier, mDescription, mTextures); + } + + @Override + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { + if (aBaseMetaTileEntity.isClientSide()) return true; + aBaseMetaTileEntity.openGUI(aPlayer); + return true; + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + super.onPostTick(aBaseMetaTileEntity, aTick); + if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isAllowedToWork()) { + IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide(aBaseMetaTileEntity.getFrontFacing()); + if (tTileEntity != null) { + for (boolean temp = true; temp && mFluid != null;) { + temp = false; + FluidStack tDrained = aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(aBaseMetaTileEntity.getFrontFacing()), Math.max(1, mFluid.amount), false); + if (tDrained != null) { + int tFilledAmount = tTileEntity.fill(ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()), tDrained, false); + if (tFilledAmount > 0) { + temp = true; + tTileEntity.fill(ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()), aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(aBaseMetaTileEntity.getFrontFacing()), tFilledAmount, true), true); + } + } + } + } + } + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + super.saveNBTData(aNBT); + aNBT.setByte("mMode", mMode); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + super.loadNBTData(aNBT); + mMode = aNBT.getByte("mMode"); + } + + @Override public boolean doesFillContainers() {return true;} + @Override public boolean doesEmptyContainers() {return true;} + @Override public boolean canTankBeFilled() {return true;} + @Override public boolean canTankBeEmptied() {return true;} + @Override public boolean displaysItemStack() {return true;} + @Override public boolean displaysStackSize() {return false;} + + @Override + public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return aSide == aBaseMetaTileEntity.getFrontFacing() && aIndex == 1; + } + + @Override + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return aSide == aBaseMetaTileEntity.getFrontFacing() && aIndex == 0; + } + + @Override + public int getCapacity() { + return 8000 * (mTier + 1); + } + + @Override + public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + if (!getBaseMetaTileEntity().getCoverBehaviorAtSide(aSide).isGUIClickable(aSide, getBaseMetaTileEntity().getCoverIDAtSide(aSide), getBaseMetaTileEntity().getCoverDataAtSide(aSide), getBaseMetaTileEntity())) return; + mMode = (byte)((mMode + 1) % 8); + switch (mMode) { + case 0: GT_Utility.sendChatToPlayer(aPlayer, "Outputs Liquids, Steam and Items"); break; + case 1: GT_Utility.sendChatToPlayer(aPlayer, "Outputs Steam and Items"); break; + case 2: GT_Utility.sendChatToPlayer(aPlayer, "Outputs Steam and Liquids"); break; + case 3: GT_Utility.sendChatToPlayer(aPlayer, "Outputs Steam"); break; + case 4: GT_Utility.sendChatToPlayer(aPlayer, "Outputs Liquids and Items"); break; + case 5: GT_Utility.sendChatToPlayer(aPlayer, "Outputs only Items"); break; + case 6: GT_Utility.sendChatToPlayer(aPlayer, "Outputs only Liquids"); break; + case 7: GT_Utility.sendChatToPlayer(aPlayer, "Outputs nothing"); break; + } + } + + public boolean outputsSteam() { + return mMode < 4; + } + + public boolean outputsLiquids() { + return mMode % 2 == 0; + } + + public boolean outputsItems() { + return mMode % 4 < 2; + } + + @Override + public int getTankPressure() { + return +100; + } +} diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBus.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBus.java new file mode 100644 index 0000000..a6f5d5f --- /dev/null +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBus.java @@ -0,0 +1,86 @@ +package gregtech.api.metatileentity.implementations; + +import gregtech.api.enums.Textures; +import gregtech.api.gui.GT_Container_1by1; +import gregtech.api.gui.GT_Container_2by2; +import gregtech.api.gui.GT_Container_3by3; +import gregtech.api.gui.GT_Container_4by4; +import gregtech.api.gui.GT_GUIContainer_1by1; +import gregtech.api.gui.GT_GUIContainer_2by2; +import gregtech.api.gui.GT_GUIContainer_3by3; +import gregtech.api.gui.GT_GUIContainer_4by4; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.objects.GT_RenderedTexture; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; + +public class GT_MetaTileEntity_Hatch_OutputBus extends GT_MetaTileEntity_Hatch { + public GT_MetaTileEntity_Hatch_OutputBus(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, aTier<1?1:aTier==1?4:aTier==2?9:16, "Better Output Hatch for the providing Multiblocks"); + } + + public GT_MetaTileEntity_Hatch_OutputBus(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aTier<1?1:aTier==1?4:aTier==2?9:16, aDescription, aTextures); + } + + @Override + public ITexture[] getTexturesActive(ITexture aBaseTexture) { + return new ITexture[] {aBaseTexture, new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)}; + } + + @Override + public ITexture[] getTexturesInactive(ITexture aBaseTexture) { + return new ITexture[] {aBaseTexture, new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)}; + } + + @Override public boolean isSimpleMachine() {return true;} + @Override public boolean isFacingValid(byte aFacing) {return true;} + @Override public boolean isAccessAllowed(EntityPlayer aPlayer) {return true;} + @Override public boolean isValidSlot(int aIndex) {return true;} + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Hatch_OutputBus(mName, mTier, mDescription, mTextures); + } + + @Override + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { + if (aBaseMetaTileEntity.isClientSide()) return true; + aBaseMetaTileEntity.openGUI(aPlayer); + return true; + } + + @Override + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + switch (mTier) { + case 0: return new GT_Container_1by1(aPlayerInventory, aBaseMetaTileEntity); + case 1: return new GT_Container_2by2(aPlayerInventory, aBaseMetaTileEntity); + case 2: return new GT_Container_3by3(aPlayerInventory, aBaseMetaTileEntity); + default: return new GT_Container_4by4(aPlayerInventory, aBaseMetaTileEntity); + } + } + + @Override + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + switch (mTier) { + case 0: return new GT_GUIContainer_1by1(aPlayerInventory, aBaseMetaTileEntity, "Output Bus"); + case 1: return new GT_GUIContainer_2by2(aPlayerInventory, aBaseMetaTileEntity, "Output Bus"); + case 2: return new GT_GUIContainer_3by3(aPlayerInventory, aBaseMetaTileEntity, "Output Bus"); + case 3: return new GT_GUIContainer_4by4(aPlayerInventory, aBaseMetaTileEntity, "Output Bus"); + default: return new GT_GUIContainer_4by4(aPlayerInventory, aBaseMetaTileEntity, "Output Bus"); + } + } + + @Override + public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return aSide == aBaseMetaTileEntity.getFrontFacing(); + } + + @Override + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return false; + } +} diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java new file mode 100644 index 0000000..43a1585 --- /dev/null +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java @@ -0,0 +1,645 @@ +package gregtech.api.metatileentity.implementations; + +import static gregtech.api.enums.GT_Values.V; + +import java.util.ArrayList; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.ConfigCategories; +import gregtech.api.gui.GT_Container_MultiMachine; +import gregtech.api.gui.GT_GUIContainer_MultiMachine; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.objects.GT_ItemStack; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Recipe.GT_Recipe_Map; +import gregtech.api.util.GT_Utility; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.fluids.FluidStack; + +public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity { + + public boolean mMachine = false, mWrench = false, mScrewdriver = false, mSoftHammer = false, mHardHammer = false, mSolderingTool = false, mCrowbar = false; + public int mPollution = 0, mProgresstime = 0, mMaxProgresstime = 0, mEUt = 0, mEfficiencyIncrease = 0, mUpdate = 0, mStartUpCheck = 100, mRuntime = 0, mEfficiency = 0; + public ItemStack[] mOutputItems = null; + public FluidStack[] mOutputFluids = null; + public static boolean disableMaintenance; + + public ArrayList mInputHatches = new ArrayList(); + public ArrayList mOutputHatches = new ArrayList(); + public ArrayList mInputBusses = new ArrayList(); + public ArrayList mOutputBusses = new ArrayList(); + public ArrayList mDynamoHatches = new ArrayList(); + public ArrayList mMufflerHatches = new ArrayList(); + public ArrayList mEnergyHatches = new ArrayList(); + public ArrayList mMaintenanceHatches = new ArrayList(); + + public GT_MetaTileEntity_MultiBlockBase(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional, 2); + GT_MetaTileEntity_MultiBlockBase.disableMaintenance = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MultiBlockMachines.disableMaintenance", false); + } + + public GT_MetaTileEntity_MultiBlockBase(String aName) { + super(aName, 2); + GT_MetaTileEntity_MultiBlockBase.disableMaintenance = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MultiBlockMachines.disableMaintenance", false); + } + + @Override + public boolean allowCoverOnSide(byte aSide, GT_ItemStack aCoverID) { + return aSide != getBaseMetaTileEntity().getFrontFacing(); + } + + @Override public boolean isSimpleMachine() {return false;} + @Override public boolean isFacingValid(byte aFacing) {return true;} + @Override public boolean isAccessAllowed(EntityPlayer aPlayer) {return true;} + @Override public boolean isValidSlot(int aIndex) {return aIndex > 0;} + @Override public int getProgresstime() {return mProgresstime;} + @Override public int maxProgresstime() {return mMaxProgresstime;} + @Override public int increaseProgress(int aProgress) {return aProgress;} + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + aNBT.setInteger("mEUt", mEUt); + aNBT.setInteger("mProgresstime", mProgresstime); + aNBT.setInteger("mMaxProgresstime", mMaxProgresstime); + aNBT.setInteger("mEfficiencyIncrease", mEfficiencyIncrease); + aNBT.setInteger("mEfficiency", mEfficiency); + aNBT.setInteger("mPollution", mPollution); + aNBT.setInteger("mRuntime", mRuntime); + + if (mOutputItems != null) for (int i = 0; i < mOutputItems.length; i++) if (mOutputItems[i] != null) { + NBTTagCompound tNBT = new NBTTagCompound(); + mOutputItems[i].writeToNBT(tNBT); + aNBT.setTag("mOutputItem"+i, tNBT); + } + + aNBT.setBoolean("mWrench", mWrench); + aNBT.setBoolean("mScrewdriver", mScrewdriver); + aNBT.setBoolean("mSoftHammer", mSoftHammer); + aNBT.setBoolean("mHardHammer", mHardHammer); + aNBT.setBoolean("mSolderingTool", mSolderingTool); + aNBT.setBoolean("mCrowbar", mCrowbar); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + mEUt = aNBT.getInteger("mEUt"); + mProgresstime = aNBT.getInteger("mProgresstime"); + mMaxProgresstime = aNBT.getInteger("mMaxProgresstime"); + mEfficiencyIncrease = aNBT.getInteger("mEfficiencyIncrease"); + mEfficiency = aNBT.getInteger("mEfficiency"); + mPollution = aNBT.getInteger("mPollution"); + mRuntime = aNBT.getInteger("mRuntime"); + mOutputItems = new ItemStack[getAmountOfOutputs()]; + for (int i = 0; i < mOutputItems.length; i++) mOutputItems[i] = GT_Utility.loadItem(aNBT, "mOutputItem" + i); + mWrench = aNBT.getBoolean("mWrench"); + mScrewdriver = aNBT.getBoolean("mScrewdriver"); + mSoftHammer = aNBT.getBoolean("mSoftHammer"); + mHardHammer = aNBT.getBoolean("mHardHammer"); + mSolderingTool = aNBT.getBoolean("mSolderingTool"); + mCrowbar = aNBT.getBoolean("mCrowbar"); + } + + @Override + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { + if (aBaseMetaTileEntity.isClientSide()) return true; + aBaseMetaTileEntity.openGUI(aPlayer); + return true; + } + + @Override + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_Container_MultiMachine(aPlayerInventory, aBaseMetaTileEntity); + } + + @Override + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "MultiblockDisplay.png"); + } + + @Override + public byte getTileEntityBaseType() { + return 2; + } + + @Override + public void onMachineBlockUpdate() { + mUpdate = 50; + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if (aBaseMetaTileEntity.isServerSide()) { + if (mEfficiency < 0) mEfficiency = 0; + if (--mUpdate==0 || --mStartUpCheck==0) { + mInputHatches.clear(); + mInputBusses.clear(); + mOutputHatches.clear(); + mOutputBusses.clear(); + mDynamoHatches.clear(); + mEnergyHatches.clear(); + mMufflerHatches.clear(); + mMaintenanceHatches.clear(); + mMachine = checkMachine(aBaseMetaTileEntity, mInventory[1]); + } + if (mStartUpCheck < 0) { + if (mMachine) { + for (GT_MetaTileEntity_Hatch_Maintenance tHatch : mMaintenanceHatches) { + if (isValidMetaTileEntity(tHatch)) { + if(!GT_MetaTileEntity_MultiBlockBase.disableMaintenance){ + if (tHatch.mWrench) mWrench = true; + if (tHatch.mScrewdriver) mScrewdriver = true; + if (tHatch.mSoftHammer) mSoftHammer = true; + if (tHatch.mHardHammer) mHardHammer = true; + if (tHatch.mSolderingTool) mSolderingTool = true; + if (tHatch.mCrowbar) mCrowbar = true;}else{ + mWrench = true; + mScrewdriver = true; + mSoftHammer = true; + mHardHammer = true; + mSolderingTool = true; + mCrowbar = true; + } + + tHatch.mWrench = false; + tHatch.mScrewdriver = false; + tHatch.mSoftHammer = false; + tHatch.mHardHammer = false; + tHatch.mSolderingTool = false; + tHatch.mCrowbar = false; + } + } + if (getRepairStatus() > 0) { + if (mMaxProgresstime > 0 && doRandomMaintenanceDamage()) { + if (onRunningTick(mInventory[1])) { + if (!polluteEnvironment(getPollutionPerTick(mInventory[1]))) { + stopMachine(); + } + if (mMaxProgresstime > 0 && ++mProgresstime>=mMaxProgresstime) { + if (mOutputItems != null) for (ItemStack tStack : mOutputItems) if (tStack != null) { + addOutput(tStack);} + if (mOutputFluids != null&&mOutputFluids.length==1) {for (FluidStack tStack : mOutputFluids) if (tStack != null) {addOutput(tStack);}} + else if(mOutputFluids!=null&&mOutputFluids.length>1){ + addFluidOutputs(mOutputFluids);} + mEfficiency = Math.max(0, Math.min(mEfficiency + mEfficiencyIncrease, getMaxEfficiency(mInventory[1]) - ((getIdealStatus() - getRepairStatus()) * 1000))); + mOutputItems = null; + mProgresstime = 0; + mMaxProgresstime = 0; + mEfficiencyIncrease = 0; + if (aBaseMetaTileEntity.isAllowedToWork()) checkRecipe(mInventory[1]); + if(mOutputFluids!=null&&mOutputFluids.length>0){ + } + } + } + } else { + if (aTick % 100 == 0 || aBaseMetaTileEntity.hasWorkJustBeenEnabled() || aBaseMetaTileEntity.hasInventoryBeenModified()) { + + if (aBaseMetaTileEntity.isAllowedToWork()) { + checkRecipe(mInventory[1]);} + if (mMaxProgresstime <= 0) mEfficiency = Math.max(0, mEfficiency - 1000); + } + } + } else { + stopMachine(); + } + } else { + stopMachine(); + } + } + aBaseMetaTileEntity.setErrorDisplayID((aBaseMetaTileEntity.getErrorDisplayID()&~127)|(mWrench?0:1)|(mScrewdriver?0:2)|(mSoftHammer?0:4)|(mHardHammer?0:8)|(mSolderingTool?0:16)|(mCrowbar?0:32)|(mMachine?0:64)); + aBaseMetaTileEntity.setActive(mMaxProgresstime>0); + } + } + + public boolean polluteEnvironment(int aPollutionLevel) { + mPollution += aPollutionLevel; + for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) { + if (isValidMetaTileEntity(tHatch)) { + if (mPollution >= 10000) { + if (tHatch.polluteEnvironment()) { + mPollution -= 10000; + } + } else { + break; + } + } + } + return mPollution < 10000; + } + + /** + * Called every tick the Machine runs + */ + public boolean onRunningTick(ItemStack aStack) { + if (mEUt > 0) { + addEnergyOutput(((long)mEUt * mEfficiency) / 10000); + return true; + } + if (mEUt < 0) { + if (!drainEnergyInput(((long)-mEUt * 10000) / Math.max(1000, mEfficiency))) { + stopMachine(); + return false; + } + } + return true; + } + + /** + * Checks if this is a Correct Machine Part for this kind of Machine (Turbine Rotor for example) + */ + public abstract boolean isCorrectMachinePart(ItemStack aStack); + + /** + * Checks the Recipe + */ + public abstract boolean checkRecipe(ItemStack aStack); + + /** + * Checks the Machine. You have to assign the MetaTileEntities for the Hatches here. + */ + public abstract boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack); + + /** + * Gets the maximum Efficiency that spare Part can get (0 - 10000) + */ + public abstract int getMaxEfficiency(ItemStack aStack); + + /** + * Gets the pollution this Device outputs to a Muffler per tick (10000 = one Pullution Block) + */ + public abstract int getPollutionPerTick(ItemStack aStack); + + /** + * Gets the damage to the ItemStack, usually 0 or 1. + */ + public abstract int getDamageToComponent(ItemStack aStack); + + /** + * Gets the Amount of possibly outputted Items for loading the Output Stack Array from NBT. + * This should be the largest Amount that can ever happen legitimately. + */ + public abstract int getAmountOfOutputs(); + + /** + * If it explodes when the Component has to be replaced. + */ + public abstract boolean explodesOnComponentBreak(ItemStack aStack); + + public void stopMachine() { + mOutputItems = null; + mEUt = 0; + mEfficiency = 0; + mProgresstime = 0; + mMaxProgresstime = 0; + mEfficiencyIncrease = 0; + getBaseMetaTileEntity().disableWorking(); + } + + public int getRepairStatus() { + return (mWrench?1:0) + (mScrewdriver?1:0) + (mSoftHammer?1:0) + (mHardHammer?1:0) + (mSolderingTool?1:0) + (mCrowbar?1:0); + } + + public int getIdealStatus() { + return 6; + } + + public static boolean isValidMetaTileEntity(MetaTileEntity aMetaTileEntity) { + return aMetaTileEntity.getBaseMetaTileEntity() != null && aMetaTileEntity.getBaseMetaTileEntity().getMetaTileEntity() == aMetaTileEntity && !aMetaTileEntity.getBaseMetaTileEntity().isDead(); + } + + public boolean doRandomMaintenanceDamage() { + if (!isCorrectMachinePart(mInventory[1]) || getRepairStatus() == 0) { + stopMachine(); + return false; + } + if (mRuntime++>1000) { + mRuntime = 0; + if (getBaseMetaTileEntity().getRandomNumber(6000) == 0) { + switch (getBaseMetaTileEntity().getRandomNumber(6)) { + case 0: mWrench = false; break; + case 1: mScrewdriver = false; break; + case 2: mSoftHammer = false; break; + case 3: mHardHammer = false; break; + case 4: mSolderingTool = false; break; + case 5: mCrowbar = false; break; + } + } + if (mInventory[1] != null && getBaseMetaTileEntity().getRandomNumber(2) == 0 &&!mInventory[1].getUnlocalizedName().startsWith("gt.blockmachines.basicmachine.")) { + } + } + return true; + } + + public void explodeMultiblock() { + mInventory[1] = null; + for (MetaTileEntity tTileEntity : mInputBusses) tTileEntity.getBaseMetaTileEntity().doExplosion(V[8]); + for (MetaTileEntity tTileEntity : mOutputBusses) tTileEntity.getBaseMetaTileEntity().doExplosion(V[8]); + for (MetaTileEntity tTileEntity : mInputHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[8]); + for (MetaTileEntity tTileEntity : mOutputHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[8]); + for (MetaTileEntity tTileEntity : mDynamoHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[8]); + for (MetaTileEntity tTileEntity : mMufflerHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[8]); + for (MetaTileEntity tTileEntity : mEnergyHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[8]); + for (MetaTileEntity tTileEntity : mMaintenanceHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[8]); + getBaseMetaTileEntity().doExplosion(V[8]); + } + + public boolean addEnergyOutput(long aEU) { + if (aEU <= 0) return true; + for (GT_MetaTileEntity_Hatch_Dynamo tHatch : mDynamoHatches) { + if (isValidMetaTileEntity(tHatch)) { + if (tHatch.getBaseMetaTileEntity().increaseStoredEnergyUnits(aEU, false)) { + return true; + } + } + } + return false; + } + + public long getMaxInputVoltage() { + long rVoltage = 0; + for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) if (isValidMetaTileEntity(tHatch)) rVoltage += tHatch.getBaseMetaTileEntity().getInputVoltage(); + return rVoltage; + } + + public boolean drainEnergyInput(long aEU) { + if (aEU <= 0) return true; + for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) if (isValidMetaTileEntity(tHatch)) { + if (tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU, false)) return true; + } + return false; + } + + public boolean addOutput(FluidStack aLiquid) { + if (aLiquid == null) return false; + for (GT_MetaTileEntity_Hatch_Output tHatch : mOutputHatches) { + if (isValidMetaTileEntity(tHatch) && GT_ModHandler.isSteam(aLiquid)?tHatch.outputsSteam():tHatch.outputsLiquids()) { + int tAmount = tHatch.fill(aLiquid, false); + if (tAmount >= aLiquid.amount) { + return tHatch.fill(aLiquid, true) >= aLiquid.amount; + } + } + } + return false; + } + + private void addFluidOutputs(FluidStack[] mOutputFluids2) { + for(int i=0;i=i&&mOutputHatches.get(i)!=null&&mOutputFluids2[i]!=null&&isValidMetaTileEntity(mOutputHatches.get(i))){ + mOutputHatches.get(i).fill(mOutputFluids2[i], true); + } + } + + } + + public boolean depleteInput(FluidStack aLiquid) { + if (aLiquid == null) return false; + for (GT_MetaTileEntity_Hatch_Input tHatch : mInputHatches) { + tHatch.mRecipeMap = getRecipeMap(); + if (isValidMetaTileEntity(tHatch)) { + FluidStack tLiquid = tHatch.getFluid(); + if (tLiquid != null && tLiquid.isFluidEqual(aLiquid)) { + tLiquid = tHatch.drain(aLiquid.amount, false); + if (tLiquid != null && tLiquid.amount >= aLiquid.amount) { + tLiquid = tHatch.drain(aLiquid.amount, true); + return tLiquid != null && tLiquid.amount >= aLiquid.amount; + } + } + } + } + return false; + } + + public boolean addOutput(ItemStack aStack) { + if (GT_Utility.isStackInvalid(aStack)) return false; + aStack = GT_Utility.copy(aStack); +// FluidStack aLiquid = GT_Utility.getFluidForFilledItem(aStack, true); +// if (aLiquid == null) { + for (GT_MetaTileEntity_Hatch_OutputBus tHatch : mOutputBusses) { + if (isValidMetaTileEntity(tHatch)) { + for (int i = tHatch.getSizeInventory() - 1; i >= 0; i--) { + if (tHatch.getBaseMetaTileEntity().addStackToSlot(i, aStack)) return true; + } + } + } + for (GT_MetaTileEntity_Hatch_Output tHatch : mOutputHatches) { + if (isValidMetaTileEntity(tHatch) && tHatch.outputsItems()) { + if (tHatch.getBaseMetaTileEntity().addStackToSlot(1, aStack)) return true; + } + } +// }else { +// for (GT_MetaTileEntity_Hatch_Output tHatch : mOutputHatches) { +// if (isValidMetaTileEntity(tHatch) && GT_ModHandler.isSteam(aLiquid)?tHatch.outputsSteam():tHatch.outputsLiquids()) { +// int tAmount = tHatch.fill(aLiquid, false); +// if (tAmount >= aLiquid.amount) { +// return tHatch.fill(aLiquid, true) >= aLiquid.amount; +// } +// } +// } +// } + return false; + } + + public boolean depleteInput(ItemStack aStack) { + if (GT_Utility.isStackInvalid(aStack)) return false; + FluidStack aLiquid = GT_Utility.getFluidForFilledItem(aStack, true); + if (aLiquid != null) return depleteInput(aLiquid); + for (GT_MetaTileEntity_Hatch_Input tHatch : mInputHatches) { + tHatch.mRecipeMap = getRecipeMap(); + if (isValidMetaTileEntity(tHatch)) { + if (GT_Utility.areStacksEqual(aStack, tHatch.getBaseMetaTileEntity().getStackInSlot(0))) { + if (tHatch.getBaseMetaTileEntity().getStackInSlot(0).stackSize >= aStack.stackSize) { + tHatch.getBaseMetaTileEntity().decrStackSize(0, aStack.stackSize); + return true; + } + } + } + } + for (GT_MetaTileEntity_Hatch_InputBus tHatch : mInputBusses) { + tHatch.mRecipeMap = getRecipeMap(); + if (isValidMetaTileEntity(tHatch)) { + for (int i = tHatch.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) { + if (GT_Utility.areStacksEqual(aStack, tHatch.getBaseMetaTileEntity().getStackInSlot(i))) { + if (tHatch.getBaseMetaTileEntity().getStackInSlot(0).stackSize >= aStack.stackSize) { + tHatch.getBaseMetaTileEntity().decrStackSize(0, aStack.stackSize); + return true; + } + } + } + } + } + return false; + } + + public ArrayList getStoredOutputs() { + ArrayList rList = new ArrayList(); + for (GT_MetaTileEntity_Hatch_Output tHatch : mOutputHatches) { + if (isValidMetaTileEntity(tHatch)) { + rList.add(tHatch.getBaseMetaTileEntity().getStackInSlot(1)); + } + } + for (GT_MetaTileEntity_Hatch_OutputBus tHatch : mOutputBusses) { + if (isValidMetaTileEntity(tHatch)) { + for (int i = tHatch.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) { + rList.add(tHatch.getBaseMetaTileEntity().getStackInSlot(i)); + } + } + } + return rList; + } + + public ArrayList getStoredFluids() { + ArrayList rList = new ArrayList(); + for (GT_MetaTileEntity_Hatch_Input tHatch : mInputHatches) { + tHatch.mRecipeMap = getRecipeMap(); + if (isValidMetaTileEntity(tHatch) && tHatch.getFillableStack() != null) { + rList.add(tHatch.getFillableStack()); + } + } + return rList; + } + + public ArrayList getStoredInputs() { + ArrayList rList = new ArrayList(); + for (GT_MetaTileEntity_Hatch_Input tHatch : mInputHatches) { + tHatch.mRecipeMap = getRecipeMap(); + if (isValidMetaTileEntity(tHatch) && tHatch.getBaseMetaTileEntity().getStackInSlot(0) != null) { + rList.add(tHatch.getBaseMetaTileEntity().getStackInSlot(0)); + } + } + for (GT_MetaTileEntity_Hatch_InputBus tHatch : mInputBusses) { + tHatch.mRecipeMap = getRecipeMap(); + if (isValidMetaTileEntity(tHatch)) { + for (int i = tHatch.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) { + if (tHatch.getBaseMetaTileEntity().getStackInSlot(i) != null) rList.add(tHatch.getBaseMetaTileEntity().getStackInSlot(i)); + } + } + } + return rList; + } + + public GT_Recipe_Map getRecipeMap() { + return null; + } + + public void updateSlots() { + for (GT_MetaTileEntity_Hatch_Input tHatch : mInputHatches) if (isValidMetaTileEntity(tHatch)) tHatch.updateSlots(); + for (GT_MetaTileEntity_Hatch_InputBus tHatch : mInputBusses) if (isValidMetaTileEntity(tHatch)) tHatch.updateSlots(); + } + + public boolean addToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null) return false; + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null) return false; + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch) ((GT_MetaTileEntity_Hatch)aMetaTileEntity).mMachineBlock = (byte)aBaseCasingIndex; + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) return mInputHatches.add((GT_MetaTileEntity_Hatch_Input)aMetaTileEntity); + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) return mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity); + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) return mOutputHatches.add((GT_MetaTileEntity_Hatch_Output)aMetaTileEntity); + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) return mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus)aMetaTileEntity); + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) return mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy)aMetaTileEntity); + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo) return mDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo)aMetaTileEntity); + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) return mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance)aMetaTileEntity); + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) return mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler)aMetaTileEntity); + return false; + } + + public boolean addMaintenanceToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null) return false; + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null) return false; + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) { + ((GT_MetaTileEntity_Hatch)aMetaTileEntity).mMachineBlock = (byte)aBaseCasingIndex; + return mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance)aMetaTileEntity); + } + return false; + } + + public boolean addEnergyInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null) { + return false;} + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null) return false; + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) { + ((GT_MetaTileEntity_Hatch)aMetaTileEntity).mMachineBlock = (byte)aBaseCasingIndex; + return mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy)aMetaTileEntity); + } + return false; + } + + public boolean addDynamoToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null) return false; + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null) return false; + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo) { + ((GT_MetaTileEntity_Hatch)aMetaTileEntity).mMachineBlock = (byte)aBaseCasingIndex; + return mDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo)aMetaTileEntity); + } + return false; + } + + public boolean addMufflerToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null) return false; + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null) return false; + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { + ((GT_MetaTileEntity_Hatch)aMetaTileEntity).mMachineBlock = (byte)aBaseCasingIndex; + return mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler)aMetaTileEntity); + } + return false; + } + + public boolean addInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null) return false; + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null) return false; + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { + ((GT_MetaTileEntity_Hatch)aMetaTileEntity).mMachineBlock = (byte)aBaseCasingIndex; + ((GT_MetaTileEntity_Hatch_Input)aMetaTileEntity).mRecipeMap = getRecipeMap(); + return mInputHatches.add((GT_MetaTileEntity_Hatch_Input)aMetaTileEntity); + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) { + ((GT_MetaTileEntity_Hatch)aMetaTileEntity).mMachineBlock = (byte)aBaseCasingIndex; + ((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity).mRecipeMap = getRecipeMap(); + return mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity); + } + return false; + } + + public boolean addOutputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null) return false; + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null) return false; + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { + ((GT_MetaTileEntity_Hatch)aMetaTileEntity).mMachineBlock = (byte)aBaseCasingIndex; + return mOutputHatches.add((GT_MetaTileEntity_Hatch_Output)aMetaTileEntity); + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { + ((GT_MetaTileEntity_Hatch)aMetaTileEntity).mMachineBlock = (byte)aBaseCasingIndex; + return mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus)aMetaTileEntity); + } + return false; + } + + @Override + public String[] getInfoData() { + return new String[] {"Progress:", (mProgresstime/20)+"secs", (mMaxProgresstime/20)+"secs", "Efficiency:", (mEfficiency/100.0F)+"%", "Problems:", ""+(getIdealStatus() - getRepairStatus())}; + } + + @Override + public boolean isGivingInformation() { + return true; + } + + @Override + public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return false; + } + + @Override + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return false; + } +} diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_TieredMachineBlock.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_TieredMachineBlock.java new file mode 100644 index 0000000..88b996f --- /dev/null +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_TieredMachineBlock.java @@ -0,0 +1,66 @@ +package gregtech.api.metatileentity.implementations; + +import static gregtech.api.enums.GT_Values.GT; + +import gregtech.api.interfaces.ITexture; +import gregtech.api.metatileentity.MetaTileEntity; + +public abstract class GT_MetaTileEntity_TieredMachineBlock extends MetaTileEntity { + /** + * Value between [0 - 9] to describe the Tier of this Machine. + */ + public final byte mTier; + + /** + * A simple Description. + */ + public final String mDescription; + + /** + * Contains all Textures used by this Block. + */ + public final ITexture[][][] mTextures; + + public GT_MetaTileEntity_TieredMachineBlock(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String aDescription, ITexture... aTextures) { + super(aID, aName, aNameRegional, aInvSlotCount); + mTier = (byte)Math.max(0, Math.min(aTier, 9)); + mDescription = aDescription; + + // must always be the last call! + if (GT.isClientSide()) mTextures = getTextureSet(aTextures); else mTextures = null; + } + + public GT_MetaTileEntity_TieredMachineBlock(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) { + super(aName, aInvSlotCount); + mTier = (byte)aTier; + mDescription = aDescription; + mTextures = aTextures; + } + + @Override + public byte getTileEntityBaseType() { + return (byte)(Math.min(3, mTier<=0?0:1+((mTier-1) / 4))); + } + + @Override + public long getInputTier() { + return mTier; + } + + @Override + public long getOutputTier() { + return mTier; + } + + @Override + public String[] getDescription() { + return new String[] {mDescription}; + } + + /** + * Used Client Side to get a Texture Set for this Block. + * Called after setting the Tier and the Description so that those two are accessible. + * @param aTextures is the optional Array you can give to the Constructor. + */ + public abstract ITexture[][][] getTextureSet(ITexture[] aTextures); +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Transformer.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Transformer.java new file mode 100644 index 0000000..9489aa9 --- /dev/null +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Transformer.java @@ -0,0 +1,112 @@ +package gregtech.api.metatileentity.implementations; + +import static gregtech.api.enums.GT_Values.V; + +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.util.GT_Utility; +import ic2.api.energy.tile.IEnergySource; +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; + +/** + * NEVER INCLUDE THIS FILE IN YOUR MOD!!! + * + * This is the main construct for my Basic Machines such as the Automatic Extractor + * Extend this class to make a simple Machine + */ +public class GT_MetaTileEntity_Transformer extends GT_MetaTileEntity_TieredMachineBlock { + public GT_MetaTileEntity_Transformer(int aID, String aName, String aNameRegional, int aTier, String aDescription) { + super(aID, aName, aNameRegional, aTier, 0, aDescription); + } + + public GT_MetaTileEntity_Transformer(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, 0, aDescription, aTextures); + } + + @Override + public ITexture[][][] getTextureSet(ITexture[] aTextures) { + ITexture[][][] rTextures = new ITexture[12][17][]; + for (byte i = -1; i < 16; i++) { + rTextures[ 0][i+1] = new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][i+1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier]}; + rTextures[ 1][i+1] = new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][i+1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier]}; + rTextures[ 2][i+1] = new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][i+1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier]}; + rTextures[ 3][i+1] = new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][i+1], Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[mTier]}; + rTextures[ 4][i+1] = new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][i+1], Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[mTier]}; + rTextures[ 5][i+1] = new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][i+1], Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[mTier]}; + rTextures[ 6][i+1] = new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][i+1], Textures.BlockIcons.OVERLAYS_ENERGY_IN[mTier]}; + rTextures[ 7][i+1] = new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][i+1], Textures.BlockIcons.OVERLAYS_ENERGY_IN[mTier]}; + rTextures[ 8][i+1] = new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][i+1], Textures.BlockIcons.OVERLAYS_ENERGY_IN[mTier]}; + rTextures[ 9][i+1] = new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][i+1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier]}; + rTextures[10][i+1] = new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][i+1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier]}; + rTextures[11][i+1] = new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][i+1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier]}; + } + return rTextures; + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + return mTextures[Math.min(2,aSide)+(aSide==aFacing?3:0)+(aActive?0:6)][aColorIndex+1]; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Transformer(mName, mTier, mDescription, mTextures); + } + + @Override public boolean isAccessAllowed(EntityPlayer aPlayer) {return true;} + @Override public boolean isSimpleMachine() {return true;} + @Override public boolean isFacingValid(byte aFacing) {return true;} + @Override public boolean isEnetInput() {return true;} + @Override public boolean isEnetOutput() {return true;} + @Override public boolean isInputFacing(byte aSide) {return getBaseMetaTileEntity().isAllowedToWork()?aSide==getBaseMetaTileEntity().getFrontFacing():aSide!=getBaseMetaTileEntity().getFrontFacing();} + @Override public boolean isOutputFacing(byte aSide) {return !isInputFacing(aSide);} + @Override public boolean isTeleporterCompatible() {return false;} + @Override public long getMinimumStoredEU() {return 512;} + @Override public long maxEUStore() {return 512+V[mTier+1]*2;} + @Override public long maxEUInput() {return V[getBaseMetaTileEntity().isAllowedToWork()?mTier+1:mTier];} + @Override public long maxEUOutput() {return V[getBaseMetaTileEntity().isAllowedToWork()?mTier:mTier+1];} + @Override public long maxAmperesOut() {return getBaseMetaTileEntity().isAllowedToWork()?V[mTier+1]/V[mTier]:1;} + @Override public long maxAmperesIn() {return getBaseMetaTileEntity().isAllowedToWork()?1:V[mTier+1]/V[mTier];} + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if (aBaseMetaTileEntity.isServerSide()) { + aBaseMetaTileEntity.setActive(aBaseMetaTileEntity.isAllowedToWork()); + for (byte i = 0; i < 6 && aBaseMetaTileEntity.getStoredEU() < aBaseMetaTileEntity.getEUCapacity(); i++) if (aBaseMetaTileEntity.inputEnergyFrom(i)) { + TileEntity tTileEntity = aBaseMetaTileEntity.getTileEntityAtSide(i); + if (tTileEntity instanceof IEnergySource && ((IEnergySource)tTileEntity).emitsEnergyTo((TileEntity)aBaseMetaTileEntity, ForgeDirection.getOrientation(GT_Utility.getOppositeSide(i)))) { +// long tEU = (long)((IEnergySource)tTileEntity).getOfferedEnergy(); + long tEU = Math.min(maxEUInput(), (long)((IEnergySource)tTileEntity).getOfferedEnergy()); + ((IEnergySource)tTileEntity).drawEnergy(tEU); + aBaseMetaTileEntity.injectEnergyUnits((byte)6, tEU, 1); + } + } + } + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + // + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + // + } + + @Override + public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return false; + } + + @Override + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return false; + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/net/GT_Packet.java b/src/main/java/gregtech/api/net/GT_Packet.java new file mode 100644 index 0000000..1639e33 --- /dev/null +++ b/src/main/java/gregtech/api/net/GT_Packet.java @@ -0,0 +1,29 @@ +package gregtech.api.net; + +import com.google.common.io.ByteArrayDataInput; + +import net.minecraft.world.IBlockAccess; + +public abstract class GT_Packet { + public GT_Packet(boolean aIsReference) { + // + } + + /** + * I use constant IDs instead of Dynamic ones, since that is much more fail safe + * @return a Packet ID for this Class + */ + public abstract byte getPacketID(); + + /** + * @return encoded byte Stream + */ + public abstract byte[] encode(); + + /** + * @return encoded byte Stream + */ + public abstract GT_Packet decode(ByteArrayDataInput aData); + + public abstract void process(IBlockAccess aWorld); +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/net/GT_Packet_Block_Event.java b/src/main/java/gregtech/api/net/GT_Packet_Block_Event.java new file mode 100644 index 0000000..14a9c6c --- /dev/null +++ b/src/main/java/gregtech/api/net/GT_Packet_Block_Event.java @@ -0,0 +1,59 @@ +package gregtech.api.net; + +import com.google.common.io.ByteArrayDataInput; +import com.google.common.io.ByteArrayDataOutput; +import com.google.common.io.ByteStreams; + +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; + +/** + * Used to transfer Block Events in a much better fashion + */ +public class GT_Packet_Block_Event extends GT_Packet { + private int mX, mZ; + private short mY; + private byte mID, mValue; + + public GT_Packet_Block_Event() { + super(true); + } + + public GT_Packet_Block_Event(int aX, short aY, int aZ, byte aID, byte aValue) { + super(false); + mX = aX; + mY = aY; + mZ = aZ; + mID = aID; + mValue = aValue; + } + + @Override + public byte[] encode() { + ByteArrayDataOutput tOut = ByteStreams.newDataOutput(10); + tOut.writeInt(mX); + tOut.writeShort(mY); + tOut.writeInt(mZ); + tOut.writeByte(mID); + tOut.writeByte(mValue); + return tOut.toByteArray(); + } + + @Override + public GT_Packet decode(ByteArrayDataInput aData) { + return new GT_Packet_Block_Event(aData.readInt(), aData.readShort(), aData.readInt(), aData.readByte(), aData.readByte()); + } + + @Override + public void process(IBlockAccess aWorld) { + if (aWorld != null) { + TileEntity tTileEntity = aWorld.getTileEntity(mX, mY, mZ); + if (tTileEntity != null) tTileEntity.receiveClientEvent(mID, mValue); + } + } + + @Override + public byte getPacketID() { + return 2; + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/net/GT_Packet_Sound.java b/src/main/java/gregtech/api/net/GT_Packet_Sound.java new file mode 100644 index 0000000..4f2c69d --- /dev/null +++ b/src/main/java/gregtech/api/net/GT_Packet_Sound.java @@ -0,0 +1,56 @@ +package gregtech.api.net; + +import com.google.common.io.ByteArrayDataInput; +import com.google.common.io.ByteArrayDataOutput; +import com.google.common.io.ByteStreams; + +import gregtech.api.util.GT_Utility; +import net.minecraft.world.IBlockAccess; + +public class GT_Packet_Sound extends GT_Packet { + private int mX, mZ; + private short mY; + private String mSoundName; + private float mSoundStrength, mSoundPitch; + + public GT_Packet_Sound() { + super(true); + } + + public GT_Packet_Sound(String aSoundName, float aSoundStrength, float aSoundPitch, int aX, short aY, int aZ) { + super(false); + mX = aX; + mY = aY; + mZ = aZ; + mSoundName = aSoundName; + mSoundStrength = aSoundStrength; + mSoundPitch = aSoundPitch; + } + + @Override + public byte[] encode() { + ByteArrayDataOutput tOut = ByteStreams.newDataOutput(10); + tOut.writeUTF(mSoundName); + tOut.writeFloat(mSoundStrength); + tOut.writeFloat(mSoundPitch); + tOut.writeInt(mX); + tOut.writeShort(mY); + tOut.writeInt(mZ); + return tOut.toByteArray(); + } + + @Override + public GT_Packet decode(ByteArrayDataInput aData) { + return new GT_Packet_Sound(aData.readUTF(), aData.readFloat(), aData.readFloat(), aData.readInt(), aData.readShort(), aData.readInt()); + } + + @Override + public void process(IBlockAccess aWorld) { + GT_Utility.doSoundAtClient(mSoundName, 1, mSoundStrength, mSoundPitch, mX, mY, mZ); + } + + @Override + public byte getPacketID() { + return 1; + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/net/GT_Packet_TileEntity.java b/src/main/java/gregtech/api/net/GT_Packet_TileEntity.java new file mode 100644 index 0000000..5a6062c --- /dev/null +++ b/src/main/java/gregtech/api/net/GT_Packet_TileEntity.java @@ -0,0 +1,83 @@ +package gregtech.api.net; + +import com.google.common.io.ByteArrayDataInput; +import com.google.common.io.ByteArrayDataOutput; +import com.google.common.io.ByteStreams; + +import gregtech.api.metatileentity.BaseMetaPipeEntity; +import gregtech.api.metatileentity.BaseMetaTileEntity; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; + +public class GT_Packet_TileEntity extends GT_Packet { + private int mX, mZ, mC0, mC1, mC2, mC3, mC4, mC5; + private short mY, mID; + private byte mTexture, mUpdate, mRedstone, mColor; + + public GT_Packet_TileEntity() { + super(true); + } + + public GT_Packet_TileEntity(int aX, short aY, int aZ, short aID, int aC0, int aC1, int aC2, int aC3, int aC4, int aC5, byte aTexture, byte aUpdate, byte aRedstone, byte aColor) { + super(false); + mX = aX; + mY = aY; + mZ = aZ; + mC0 = aC0; + mC1 = aC1; + mC2 = aC2; + mC3 = aC3; + mC4 = aC4; + mC5 = aC5; + mID = aID; + mTexture = aTexture; + mUpdate = aUpdate; + mRedstone = aRedstone; + mColor = aColor; + } + + @Override + public byte[] encode() { + ByteArrayDataOutput tOut = ByteStreams.newDataOutput(40); + + tOut.writeInt(mX); + tOut.writeShort(mY); + tOut.writeInt(mZ); + tOut.writeShort(mID); + + tOut.writeInt(mC0); + tOut.writeInt(mC1); + tOut.writeInt(mC2); + tOut.writeInt(mC3); + tOut.writeInt(mC4); + tOut.writeInt(mC5); + + tOut.writeByte(mTexture); + tOut.writeByte(mUpdate); + tOut.writeByte(mRedstone); + tOut.writeByte(mColor); + + return tOut.toByteArray(); + } + + @Override + public GT_Packet decode(ByteArrayDataInput aData) { + return new GT_Packet_TileEntity(aData.readInt(), aData.readShort(), aData.readInt(), aData.readShort(), aData.readInt(), aData.readInt(), aData.readInt(), aData.readInt(), aData.readInt(), aData.readInt(), aData.readByte(), aData.readByte(), aData.readByte(), aData.readByte()); + } + + @Override + public void process(IBlockAccess aWorld) { + if (aWorld != null) { + TileEntity tTileEntity = aWorld.getTileEntity(mX, mY, mZ); + if (tTileEntity != null) { + if (tTileEntity instanceof BaseMetaTileEntity) ((BaseMetaTileEntity)tTileEntity).receiveMetaTileEntityData(mID, mC0, mC1, mC2, mC3, mC4, mC5, mTexture, mUpdate, mRedstone, mColor); + else if (tTileEntity instanceof BaseMetaPipeEntity) ((BaseMetaPipeEntity)tTileEntity).receiveMetaTileEntityData(mID, mC0, mC1, mC2, mC3, mC4, mC5, mTexture, mUpdate, mRedstone, mColor); + } + } + } + + @Override + public byte getPacketID() { + return 0; + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/net/IGT_NetworkHandler.java b/src/main/java/gregtech/api/net/IGT_NetworkHandler.java new file mode 100644 index 0000000..9c6c9bd --- /dev/null +++ b/src/main/java/gregtech/api/net/IGT_NetworkHandler.java @@ -0,0 +1,12 @@ +package gregtech.api.net; + +import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.world.World; + +public interface IGT_NetworkHandler { + public void sendToPlayer(GT_Packet aPacket, EntityPlayerMP aPlayer); + public void sendToAllAround(GT_Packet aPacket, TargetPoint aPosition); + public void sendToServer(GT_Packet aPacket); + public void sendPacketToAllPlayersInRange(World aWorld, GT_Packet aPacket, int aX, int aZ); +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/objects/ElementStack.java b/src/main/java/gregtech/api/objects/ElementStack.java new file mode 100644 index 0000000..38443df --- /dev/null +++ b/src/main/java/gregtech/api/objects/ElementStack.java @@ -0,0 +1,41 @@ +package gregtech.api.objects; + +import gregtech.api.enums.Element; + +public class ElementStack implements Cloneable { + public int mAmount; + public Element mElement; + + public ElementStack(Element aElement, int aAmount) { + mElement = aElement==null?Element._NULL:aElement; + mAmount = aAmount; + } + + public ElementStack copy(int aAmount) { + return new ElementStack(mElement, aAmount); + } + + @Override + public ElementStack clone() { + return new ElementStack(mElement, mAmount); + } + + @Override + public boolean equals(Object aObject) { + if (aObject == this) return true; + if (aObject == null) return false; + if (aObject instanceof Element) return aObject == mElement; + if (aObject instanceof ElementStack) return ((ElementStack)aObject).mElement == mElement && (mAmount < 0 || ((ElementStack)aObject).mAmount < 0 || ((ElementStack)aObject).mAmount == mAmount); + return false; + } + + @Override + public String toString() { + return mElement.toString()+mAmount; + } + + @Override + public int hashCode() { + return mElement.hashCode(); + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/objects/GT_ArrayList.java b/src/main/java/gregtech/api/objects/GT_ArrayList.java new file mode 100644 index 0000000..a6c0750 --- /dev/null +++ b/src/main/java/gregtech/api/objects/GT_ArrayList.java @@ -0,0 +1,59 @@ +package gregtech.api.objects; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; + +public class GT_ArrayList extends ArrayList { + private static final long serialVersionUID = 1L; + + private final boolean mAllowNulls; + + public GT_ArrayList(boolean aAllowNulls, int aCapacity) { + super(aCapacity); + mAllowNulls = aAllowNulls; + } + + public GT_ArrayList(boolean aAllowNulls, E... aArray) { + super(Arrays.asList(aArray)); + mAllowNulls = aAllowNulls; + if (!mAllowNulls) for (int i = 0; i < size(); i++) if (get(i) == null) remove(i--); + } + + public GT_ArrayList(boolean aAllowNulls, Collection aList) { + super(aList); + mAllowNulls = aAllowNulls; + if (!mAllowNulls) for (int i = 0; i < size(); i++) if (get(i) == null) remove(i--); + } + + @Override + public E set(int aIndex, E aElement) { + if (mAllowNulls || aElement != null) return super.set(aIndex, aElement); + return null; + } + + @Override + public boolean add(E aElement) { + if (mAllowNulls || aElement != null) return super.add(aElement); + return false; + } + + @Override + public void add(int aIndex, E aElement) { + if (mAllowNulls || aElement != null) super.add(aIndex, aElement); + } + + @Override + public boolean addAll(Collection aList) { + boolean rReturn = super.addAll(aList); + if (!mAllowNulls) for (int i = 0; i < size(); i++) if (get(i) == null) remove(i--); + return rReturn; + } + + @Override + public boolean addAll(int aIndex, Collection aList) { + boolean rReturn = super.addAll(aIndex, aList); + if (!mAllowNulls) for (int i = 0; i < size(); i++) if (get(i) == null) remove(i--); + return rReturn; + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/objects/GT_CopiedBlockTexture.java b/src/main/java/gregtech/api/objects/GT_CopiedBlockTexture.java new file mode 100644 index 0000000..ffbbe09 --- /dev/null +++ b/src/main/java/gregtech/api/objects/GT_CopiedBlockTexture.java @@ -0,0 +1,96 @@ +package gregtech.api.objects; + +import gregtech.api.enums.Dyes; +import gregtech.api.interfaces.ITexture; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.IIcon; + +public class GT_CopiedBlockTexture implements ITexture { + private final Block mBlock; + private final byte mSide, mMeta; + + /** + * DO NOT MANIPULATE THE VALUES INSIDE THIS ARRAY!!! + * + * Just set this variable to another different Array instead. + * Otherwise some colored things will get Problems. + */ + public short[] mRGBa; + + private final boolean mAllowAlpha; + + public GT_CopiedBlockTexture(Block aBlock, int aSide, int aMeta, short[] aRGBa, boolean aAllowAlpha) { + if (aRGBa.length != 4) throw new IllegalArgumentException("RGBa doesn't have 4 Values @ GT_CopiedBlockTexture"); + mBlock = aBlock; + mRGBa = aRGBa; + mSide = (byte)aSide; + mMeta = (byte)aMeta; + mAllowAlpha = aAllowAlpha; + } + + public GT_CopiedBlockTexture(Block aBlock, int aSide, int aMeta, short[] aRGBa) { + this(aBlock, aSide, aMeta, aRGBa, true); + } + + public GT_CopiedBlockTexture(Block aBlock, int aSide, int aMeta) { + this(aBlock, aSide, aMeta, Dyes._NULL.mRGBa); + } + + private IIcon getIcon(int aSide) { + if (mSide == 6) return mBlock.getIcon(aSide, mMeta); + return mBlock.getIcon(mSide, mMeta); + } + + @Override + public void renderXPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + IIcon aIcon = getIcon(5); + Tessellator.instance.setColorRGBA((int)(mRGBa[0] * 0.6F), (int)(mRGBa[1] * 0.6F), (int)(mRGBa[2] * 0.6F), mAllowAlpha?255-mRGBa[3]:255); +// aRenderer.flipTexture = !aRenderer.flipTexture; + aRenderer.renderFaceXPos(aBlock, aX, aY, aZ, aIcon); +// aRenderer.flipTexture = !aRenderer.flipTexture; + } + + @Override + public void renderXNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + IIcon aIcon = getIcon(4); + Tessellator.instance.setColorRGBA((int)(mRGBa[0] * 0.6F), (int)(mRGBa[1] * 0.6F), (int)(mRGBa[2] * 0.6F), mAllowAlpha?255-mRGBa[3]:255); + aRenderer.renderFaceXNeg(aBlock, aX, aY, aZ, aIcon); + } + + @Override + public void renderYPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + IIcon aIcon = getIcon(1); + Tessellator.instance.setColorRGBA((int)(mRGBa[0] * 1.0F), (int)(mRGBa[1] * 1.0F), (int)(mRGBa[2] * 1.0F), mAllowAlpha?255-mRGBa[3]:255); + aRenderer.renderFaceYPos(aBlock, aX, aY, aZ, aIcon); + } + + @Override + public void renderYNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + IIcon aIcon = getIcon(0); + Tessellator.instance.setColorRGBA((int)(mRGBa[0] * 0.5F), (int)(mRGBa[1] * 0.5F), (int)(mRGBa[2] * 0.5F), mAllowAlpha?255-mRGBa[3]:255); + aRenderer.renderFaceYNeg(aBlock, aX, aY, aZ, aIcon); + } + + @Override + public void renderZPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + IIcon aIcon = getIcon(3); + Tessellator.instance.setColorRGBA((int)(mRGBa[0] * 0.8F), (int)(mRGBa[1] * 0.8F), (int)(mRGBa[2] * 0.8F), mAllowAlpha?255-mRGBa[3]:255); + aRenderer.renderFaceZPos(aBlock, aX, aY, aZ, aIcon); + } + + @Override + public void renderZNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + IIcon aIcon = getIcon(2); + Tessellator.instance.setColorRGBA((int)(mRGBa[0] * 0.8F), (int)(mRGBa[1] * 0.8F), (int)(mRGBa[2] * 0.8F), mAllowAlpha?255-mRGBa[3]:255); +// aRenderer.flipTexture = !aRenderer.flipTexture; + aRenderer.renderFaceZNeg(aBlock, aX, aY, aZ, aIcon); +// aRenderer.flipTexture = !aRenderer.flipTexture; + } + + @Override + public boolean isValidTexture() { + return mBlock != null; + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/objects/GT_Cover_Default.java b/src/main/java/gregtech/api/objects/GT_Cover_Default.java new file mode 100644 index 0000000..b317e0e --- /dev/null +++ b/src/main/java/gregtech/api/objects/GT_Cover_Default.java @@ -0,0 +1,68 @@ +package gregtech.api.objects; + +import gregtech.api.interfaces.tileentity.ICoverable; +import gregtech.api.util.GT_CoverBehavior; +import gregtech.api.util.GT_Utility; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraftforge.fluids.Fluid; + +public class GT_Cover_Default extends GT_CoverBehavior { + /** + * This is the Dummy, if there is a generic Cover without behavior + */ + public GT_Cover_Default() { + super(); + } + + @Override + public boolean isSimpleCover() { + return true; + } + + @Override + public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { + aCoverVariable=((aCoverVariable+1)&15); + GT_Utility.sendChatToPlayer(aPlayer, ((aCoverVariable & 1) != 0?"Redstone ":"") + ((aCoverVariable & 2) != 0?"Energy ":"") + ((aCoverVariable & 4) != 0?"Fluids ":"") + ((aCoverVariable & 8) != 0?"Items ":"")); + return aCoverVariable; + } + + @Override + public boolean letsRedstoneGoIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + return (aCoverVariable & 1) != 0; + } + + @Override + public boolean letsRedstoneGoOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + return (aCoverVariable & 1) != 0; + } + + @Override + public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + return (aCoverVariable & 2) != 0; + } + + @Override + public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + return (aCoverVariable & 2) != 0; + } + + @Override + public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { + return (aCoverVariable & 4) != 0; + } + + @Override + public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { + return (aCoverVariable & 4) != 0; + } + + @Override + public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) { + return (aCoverVariable & 8) != 0; + } + + @Override + public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) { + return (aCoverVariable & 8) != 0; + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/objects/GT_Cover_None.java b/src/main/java/gregtech/api/objects/GT_Cover_None.java new file mode 100644 index 0000000..89a0e17 --- /dev/null +++ b/src/main/java/gregtech/api/objects/GT_Cover_None.java @@ -0,0 +1,89 @@ +package gregtech.api.objects; + +import gregtech.api.interfaces.tileentity.ICoverable; +import gregtech.api.util.GT_CoverBehavior; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraftforge.fluids.Fluid; + +public class GT_Cover_None extends GT_CoverBehavior { + + /** + * This is the Dummy, if there is no Cover + */ + public GT_Cover_None() {} + + @Override + public float getBlastProofLevel(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + return 10.0F; + } + + @Override + public boolean letsRedstoneGoIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + return true; + } + + @Override + public boolean letsRedstoneGoOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + return true; + } + + @Override + public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + return true; + } + + @Override + public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + return true; + } + + @Override + public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { + return true; + } + + @Override + public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { + return true; + } + + @Override + public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) { + return true; + } + + @Override + public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) { + return true; + } + + @Override + public boolean isGUIClickable(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + return true; + } + + @Override + public boolean manipulatesSidedRedstoneOutput(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + return false; + } + + @Override + public boolean onCoverRightclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { + return false; + } + + @Override + public boolean onCoverRemoval(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, boolean aForced) { + return true; + } + + @Override + public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { + return 0; + } + + @Override + public boolean isSimpleCover() { + return true; + } +} diff --git a/src/main/java/gregtech/api/objects/GT_Fluid.java b/src/main/java/gregtech/api/objects/GT_Fluid.java new file mode 100644 index 0000000..f08988b --- /dev/null +++ b/src/main/java/gregtech/api/objects/GT_Fluid.java @@ -0,0 +1,29 @@ +package gregtech.api.objects; + +import static gregtech.api.enums.GT_Values.RES_PATH_BLOCK; + +import gregtech.api.GregTech_API; +import net.minecraftforge.fluids.Fluid; + +public class GT_Fluid extends Fluid implements Runnable { + private final short[] mRGBa; + + public final String mTextureName; + + public GT_Fluid(String aName, String aTextureName, short[] aRGBa) { + super(aName); + mRGBa = aRGBa; + mTextureName = aTextureName; + GregTech_API.sGTBlockIconload.add(this); + } + + @Override + public int getColor() { + return (Math.max(0, Math.min(255, mRGBa[0])) << 16) | (Math.max(0, Math.min(255, mRGBa[1])) << 8) | Math.max(0, Math.min(255, mRGBa[2])); + } + + @Override + public void run() { + setIcons(GregTech_API.sBlockIcons.registerIcon(RES_PATH_BLOCK + "fluids/fluid." + mTextureName)); + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/objects/GT_FluidStack.java b/src/main/java/gregtech/api/objects/GT_FluidStack.java new file mode 100644 index 0000000..351e0ed --- /dev/null +++ b/src/main/java/gregtech/api/objects/GT_FluidStack.java @@ -0,0 +1,54 @@ +package gregtech.api.objects; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Map; + +import gregtech.api.GregTech_API; +import gregtech.api.util.GT_Log; +import gregtech.api.util.GT_Utility; +import net.minecraftforge.common.ForgeVersion; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; + +/** + * Because Forge fucked this one up royally. + */ +public class GT_FluidStack extends FluidStack { + private static final Collection sAllFluidStacks = new ArrayList(5000); + private Fluid mFluid; + private static boolean lock=false; + + public GT_FluidStack(Fluid aFluid, int aAmount) { + super(aFluid, aAmount); + mFluid = aFluid; + sAllFluidStacks.add(this); + } + + public GT_FluidStack(FluidStack aFluid) { + this(aFluid.getFluid(), aFluid.amount); + } + + public static void fixAllThoseFuckingFluidIDs() { + if(ForgeVersion.getBuildVersion()<1355){ + while(lock){try {Thread.sleep(1);} catch (InterruptedException e) {}} + lock=true; + for (GT_FluidStack tFluid : sAllFluidStacks) tFluid.fixFluidIDForFucksSake(); + for (Map tMap : GregTech_API.sFluidMappings) try {GT_Utility.reMap(tMap);} catch(Throwable e) {e.printStackTrace(GT_Log.err);} + lock=false;} + } + + public void fixFluidIDForFucksSake() { + if(ForgeVersion.getBuildVersion()<1355){ + int fluidID; + try {fluidID = this.getFluid().getID();} catch(Throwable e){System.err.println(e);} + try {fluidID = mFluid.getID();} catch(Throwable e) {fluidID = -1;}} + } + + @Override + public FluidStack copy() { + if(ForgeVersion.getBuildVersion()<1355){ + fixFluidIDForFucksSake();} + return new GT_FluidStack(this); + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/objects/GT_HashSet.java b/src/main/java/gregtech/api/objects/GT_HashSet.java new file mode 100644 index 0000000..951b444 --- /dev/null +++ b/src/main/java/gregtech/api/objects/GT_HashSet.java @@ -0,0 +1,84 @@ +package gregtech.api.objects; + +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedHashMap; + +import gregtech.api.GregTech_API; +import gregtech.api.util.GT_Utility; +import net.minecraft.item.ItemStack; + +public class GT_HashSet extends HashSet { + private transient HashMap map; + private static final Object OBJECT = new Object(); + + public GT_HashSet() { + map = new HashMap(); + GregTech_API.sItemStackMappings.add(map); + } + + public GT_HashSet(Collection c) { + map = new HashMap(Math.max((int) (c.size()/.75f) + 1, 16)); + addAll(c); + GregTech_API.sItemStackMappings.add(map); + } + + public GT_HashSet(int initialCapacity, float loadFactor) { + map = new HashMap(initialCapacity, loadFactor); + GregTech_API.sItemStackMappings.add(map); + } + + public GT_HashSet(int initialCapacity) { + map = new HashMap(initialCapacity); + GregTech_API.sItemStackMappings.add(map); + } + + GT_HashSet(int initialCapacity, float loadFactor, boolean dummy) { + map = new LinkedHashMap(initialCapacity, loadFactor); + GregTech_API.sItemStackMappings.add(map); + } + + public HashMap getMap(){return map;} + + @Override + public Iterator iterator() { + return (Iterator)map.keySet().iterator(); + } + + @Override + public int size() { + return map.size(); + } + + @Override + public boolean isEmpty() { + return map.isEmpty(); + } + + @Override + public boolean contains(Object o) { + return map.containsKey(o); + } + + public boolean add(ItemStack aStack) { + if (GT_Utility.isStackInvalid(aStack)) return false; + return map.put(new GT_ItemStack(aStack), OBJECT)==null; + } + + @Override + public boolean add(Object object) { + return map.put((GT_ItemStack) object, OBJECT)==null; + } + + @Override + public boolean remove(Object o) { + return map.remove(o)==OBJECT; + } + + @Override + public void clear() { + map.clear(); + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/objects/GT_ItemStack.java b/src/main/java/gregtech/api/objects/GT_ItemStack.java new file mode 100644 index 0000000..8881d27 --- /dev/null +++ b/src/main/java/gregtech/api/objects/GT_ItemStack.java @@ -0,0 +1,52 @@ +package gregtech.api.objects; + +import gregtech.api.util.GT_Utility; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +public class GT_ItemStack { + public final Item mItem; + public final byte mStackSize; + public final short mMetaData; + + public GT_ItemStack(Item aItem, long aStackSize, long aMetaData) { + mItem = aItem; + mStackSize = (byte)aStackSize; + mMetaData = (short)aMetaData; + } + + public GT_ItemStack(ItemStack aStack) { + this(aStack==null?null:aStack.getItem(), aStack==null?0:aStack.stackSize, aStack==null?0:Items.feather.getDamage(aStack)); + } + + public GT_ItemStack(int aHashCode) { + this(GT_Utility.intToStack(aHashCode)); + } + + public ItemStack toStack() { + if (mItem == null) return null; + return new ItemStack(mItem, 1, mMetaData); + } + + public boolean isStackEqual(ItemStack aStack) { + return GT_Utility.areStacksEqual(toStack(), aStack); + } + + public boolean isStackEqual(GT_ItemStack aStack) { + return GT_Utility.areStacksEqual(toStack(), aStack.toStack()); + } + + @Override + public boolean equals(Object aStack) { + if (aStack == this) return true; + if (aStack instanceof GT_ItemStack) { + return ((GT_ItemStack)aStack).mItem == mItem && ((GT_ItemStack)aStack).mMetaData == mMetaData;} + return false; + } + + @Override + public int hashCode() { + return GT_Utility.stackToInt(toStack()); + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/objects/GT_MultiTexture.java b/src/main/java/gregtech/api/objects/GT_MultiTexture.java new file mode 100644 index 0000000..295e511 --- /dev/null +++ b/src/main/java/gregtech/api/objects/GT_MultiTexture.java @@ -0,0 +1,53 @@ +package gregtech.api.objects; + +import gregtech.api.interfaces.ITexture; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; + +/** + * Lets Multiple ITextures Render overlay over each other. + * + * I should have done this much earlier... + */ +public class GT_MultiTexture implements ITexture { + private final ITexture[] mTextures; + + public GT_MultiTexture(ITexture... aTextures) { + mTextures = aTextures; + } + + @Override + public void renderXPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + for (ITexture tTexture : mTextures) if (tTexture != null && tTexture.isValidTexture()) tTexture.renderXPos(aRenderer, aBlock, aX, aY, aZ); + } + + @Override + public void renderXNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + for (ITexture tTexture : mTextures) if (tTexture != null && tTexture.isValidTexture()) tTexture.renderXNeg(aRenderer, aBlock, aX, aY, aZ); + } + + @Override + public void renderYPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + for (ITexture tTexture : mTextures) if (tTexture != null && tTexture.isValidTexture()) tTexture.renderYPos(aRenderer, aBlock, aX, aY, aZ); + } + + @Override + public void renderYNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + for (ITexture tTexture : mTextures) if (tTexture != null && tTexture.isValidTexture()) tTexture.renderYNeg(aRenderer, aBlock, aX, aY, aZ); + } + + @Override + public void renderZPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + for (ITexture tTexture : mTextures) if (tTexture != null && tTexture.isValidTexture()) tTexture.renderZPos(aRenderer, aBlock, aX, aY, aZ); + } + + @Override + public void renderZNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + for (ITexture tTexture : mTextures) if (tTexture != null && tTexture.isValidTexture()) tTexture.renderZNeg(aRenderer, aBlock, aX, aY, aZ); + } + + @Override + public boolean isValidTexture() { + return true; + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/objects/GT_RenderedTexture.java b/src/main/java/gregtech/api/objects/GT_RenderedTexture.java new file mode 100644 index 0000000..356d687 --- /dev/null +++ b/src/main/java/gregtech/api/objects/GT_RenderedTexture.java @@ -0,0 +1,140 @@ +package gregtech.api.objects; + +import gregtech.api.enums.Dyes; +import gregtech.api.interfaces.IColorModulationContainer; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.interfaces.ITexture; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.IIcon; + +public class GT_RenderedTexture implements ITexture, IColorModulationContainer { + private final IIconContainer mIconContainer; + + /** + * DO NOT MANIPULATE THE VALUES INSIDE THIS ARRAY!!! + * + * Just set this variable to another different Array instead. + * Otherwise some colored things will get Problems. + */ + public short[] mRGBa; + + private final boolean mAllowAlpha; + + public GT_RenderedTexture(IIconContainer aIcon, short[] aRGBa, boolean aAllowAlpha) { + if (aRGBa.length != 4) throw new IllegalArgumentException("RGBa doesn't have 4 Values @ GT_RenderedTexture"); + mIconContainer = aIcon; + mAllowAlpha = aAllowAlpha; + mRGBa = aRGBa; + } + + public GT_RenderedTexture(IIconContainer aIcon, short[] aRGBa) { + this(aIcon, aRGBa, true); + } + + public GT_RenderedTexture(IIconContainer aIcon) { + this(aIcon, Dyes._NULL.mRGBa); + } + + @Override + public void renderXPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + Tessellator.instance.setColorRGBA((int)(mRGBa[0] * 0.6F), (int)(mRGBa[1] * 0.6F), (int)(mRGBa[2] * 0.6F), mAllowAlpha?255-mRGBa[3]:255); + aRenderer.renderFaceXPos(aBlock, aX, aY, aZ, mIconContainer.getIcon()); + if (mIconContainer.getOverlayIcon() != null) { + Tessellator.instance.setColorRGBA(153, 153, 153, 255); + aRenderer.renderFaceXPos(aBlock, aX, aY, aZ, mIconContainer.getOverlayIcon()); + } + } + + @Override + public void renderXNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + Tessellator.instance.setColorRGBA((int)(mRGBa[0] * 0.6F), (int)(mRGBa[1] * 0.6F), (int)(mRGBa[2] * 0.6F), mAllowAlpha?255-mRGBa[3]:255); + aRenderer.renderFaceXNeg(aBlock, aX, aY, aZ, mIconContainer.getIcon()); + if (mIconContainer.getOverlayIcon() != null) { + Tessellator.instance.setColorRGBA(153, 153, 153, 255); + aRenderer.renderFaceXNeg(aBlock, aX, aY, aZ, mIconContainer.getOverlayIcon()); + } + } + + @Override + public void renderYPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + Tessellator.instance.setColorRGBA((int)(mRGBa[0] * 1.0F), (int)(mRGBa[1] * 1.0F), (int)(mRGBa[2] * 1.0F), mAllowAlpha?255-mRGBa[3]:255); + aRenderer.renderFaceYPos(aBlock, aX, aY, aZ, mIconContainer.getIcon()); + if (mIconContainer.getOverlayIcon() != null) { + Tessellator.instance.setColorRGBA(255, 255, 255, 255); + aRenderer.renderFaceYPos(aBlock, aX, aY, aZ, mIconContainer.getOverlayIcon()); + } + } + + @Override + public void renderYNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + Tessellator.instance.setColorRGBA((int)(mRGBa[0] * 0.5F), (int)(mRGBa[1] * 0.5F), (int)(mRGBa[2] * 0.5F), mAllowAlpha?255-mRGBa[3]:255); + IIcon aIcon = mIconContainer.getIcon(); + + double d3 = aIcon.getInterpolatedU(aRenderer.renderMaxX * 16.0D); + double d4 = aIcon.getInterpolatedU(aRenderer.renderMinX * 16.0D); + double d5 = aIcon.getInterpolatedV(aRenderer.renderMinZ * 16.0D); + double d6 = aIcon.getInterpolatedV(aRenderer.renderMaxZ * 16.0D); + + if (aRenderer.renderMinX < 0.0D || aRenderer.renderMaxX > 1.0D) { + d3 = aIcon.getMaxU(); + d4 = aIcon.getMinU(); + } + + if (aRenderer.renderMinZ < 0.0D || aRenderer.renderMaxZ > 1.0D) { + d5 = aIcon.getMinV(); + d6 = aIcon.getMaxV(); + } + + double d11 = aX + aRenderer.renderMinX; + double d12 = aX + aRenderer.renderMaxX; + double d13 = aY + aRenderer.renderMinY; + double d14 = aZ + aRenderer.renderMinZ; + double d15 = aZ + aRenderer.renderMaxZ; + + Tessellator.instance.addVertexWithUV(d11, d13, d15, d3, d6); + Tessellator.instance.addVertexWithUV(d11, d13, d14, d3, d5); + Tessellator.instance.addVertexWithUV(d12, d13, d14, d4, d5); + Tessellator.instance.addVertexWithUV(d12, d13, d15, d4, d6); + + if ((aIcon = mIconContainer.getOverlayIcon()) != null) { + Tessellator.instance.setColorRGBA(128, 128, 128, 255); + + Tessellator.instance.addVertexWithUV(d11, d13, d15, d3, d6); + Tessellator.instance.addVertexWithUV(d11, d13, d14, d3, d5); + Tessellator.instance.addVertexWithUV(d12, d13, d14, d4, d5); + Tessellator.instance.addVertexWithUV(d12, d13, d15, d4, d6); + } + } + + @Override + public void renderZPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + Tessellator.instance.setColorRGBA((int)(mRGBa[0] * 0.8F), (int)(mRGBa[1] * 0.8F), (int)(mRGBa[2] * 0.8F), mAllowAlpha?255-mRGBa[3]:255); + aRenderer.renderFaceZPos(aBlock, aX, aY, aZ, mIconContainer.getIcon()); + if (mIconContainer.getOverlayIcon() != null) { + Tessellator.instance.setColorRGBA(204, 204, 204, 255); + aRenderer.renderFaceZPos(aBlock, aX, aY, aZ, mIconContainer.getOverlayIcon()); + } + } + + @Override + public void renderZNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + Tessellator.instance.setColorRGBA((int)(mRGBa[0] * 0.8F), (int)(mRGBa[1] * 0.8F), (int)(mRGBa[2] * 0.8F), mAllowAlpha?255-mRGBa[3]:255); + aRenderer.renderFaceZNeg(aBlock, aX, aY, aZ, mIconContainer.getIcon()); + if (mIconContainer.getOverlayIcon() != null) { + Tessellator.instance.setColorRGBA(204, 204, 204, 255); + aRenderer.renderFaceZNeg(aBlock, aX, aY, aZ, mIconContainer.getOverlayIcon()); + } + } + + @Override + public short[] getRGBA() { + return mRGBa; + } + + @Override + public boolean isValidTexture() { + return mIconContainer != null; + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/objects/GT_SidedTexture.java b/src/main/java/gregtech/api/objects/GT_SidedTexture.java new file mode 100644 index 0000000..183d5b8 --- /dev/null +++ b/src/main/java/gregtech/api/objects/GT_SidedTexture.java @@ -0,0 +1,169 @@ +package gregtech.api.objects; + +import gregtech.api.enums.Dyes; +import gregtech.api.interfaces.IColorModulationContainer; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.interfaces.ITexture; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.IIcon; + +public class GT_SidedTexture implements ITexture, IColorModulationContainer { + private final IIconContainer[] mIconContainer; + + /** + * DO NOT MANIPULATE THE VALUES INSIDE THIS ARRAY!!! + * + * Just set this variable to another different Array instead. + * Otherwise some colored things will get Problems. + */ + public short[] mRGBa; + + private final boolean mAllowAlpha; + + public GT_SidedTexture(IIconContainer aIcon0, IIconContainer aIcon1, IIconContainer aIcon2, IIconContainer aIcon3, IIconContainer aIcon4, IIconContainer aIcon5, short[] aRGBa, boolean aAllowAlpha) { + if (aRGBa.length != 4) throw new IllegalArgumentException("RGBa doesn't have 4 Values @ GT_RenderedTexture"); + mIconContainer = new IIconContainer[] {aIcon0, aIcon1, aIcon2, aIcon3, aIcon4, aIcon5}; + mAllowAlpha = aAllowAlpha; + mRGBa = aRGBa; + } + + public GT_SidedTexture(IIconContainer aIcon0, IIconContainer aIcon1, IIconContainer aIcon2, IIconContainer aIcon3, IIconContainer aIcon4, IIconContainer aIcon5, short[] aRGBa) { + this(aIcon0, aIcon1, aIcon2, aIcon3, aIcon4, aIcon5, aRGBa, true); + } + + public GT_SidedTexture(IIconContainer aIcon0, IIconContainer aIcon1, IIconContainer aIcon2, IIconContainer aIcon3, IIconContainer aIcon4, IIconContainer aIcon5) { + this(aIcon0, aIcon1, aIcon2, aIcon3, aIcon4, aIcon5, Dyes._NULL.mRGBa); + } + + public GT_SidedTexture(IIconContainer aBottom, IIconContainer aTop, IIconContainer aSides, short[] aRGBa) { + this(aBottom, aTop, aSides, aSides, aSides, aSides, aRGBa); + } + + public GT_SidedTexture(IIconContainer aBottom, IIconContainer aTop, IIconContainer aSides) { + this(aBottom, aTop, aSides, Dyes._NULL.mRGBa); + } + + @Override + public void renderXPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + Tessellator.instance.setColorRGBA((int)(mRGBa[0] * 0.6F), (int)(mRGBa[1] * 0.6F), (int)(mRGBa[2] * 0.6F), mAllowAlpha?255-mRGBa[3]:255); + aRenderer.renderFaceXPos(aBlock, aX, aY, aZ, mIconContainer[5].getIcon()); + if (mIconContainer[5].getOverlayIcon() != null) { + Tessellator.instance.setColorRGBA(153, 153, 153, 255); + aRenderer.renderFaceXPos(aBlock, aX, aY, aZ, mIconContainer[5].getOverlayIcon()); + } + } + + @Override + public void renderXNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + Tessellator.instance.setColorRGBA((int)(mRGBa[0] * 0.6F), (int)(mRGBa[1] * 0.6F), (int)(mRGBa[2] * 0.6F), mAllowAlpha?255-mRGBa[3]:255); + aRenderer.renderFaceXNeg(aBlock, aX, aY, aZ, mIconContainer[4].getIcon()); + if (mIconContainer[4].getOverlayIcon() != null) { + Tessellator.instance.setColorRGBA(153, 153, 153, 255); + aRenderer.renderFaceXNeg(aBlock, aX, aY, aZ, mIconContainer[4].getOverlayIcon()); + } + } + + @Override + public void renderYPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + Tessellator.instance.setColorRGBA((int)(mRGBa[0] * 1.0F), (int)(mRGBa[1] * 1.0F), (int)(mRGBa[2] * 1.0F), mAllowAlpha?255-mRGBa[3]:255); + aRenderer.renderFaceYPos(aBlock, aX, aY, aZ, mIconContainer[1].getIcon()); + if (mIconContainer[1].getOverlayIcon() != null) { + Tessellator.instance.setColorRGBA(255, 255, 255, 255); + aRenderer.renderFaceYPos(aBlock, aX, aY, aZ, mIconContainer[1].getOverlayIcon()); + } + } + + @Override + public void renderYNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + Tessellator.instance.setColorRGBA((int)(mRGBa[0] * 0.5F), (int)(mRGBa[1] * 0.5F), (int)(mRGBa[2] * 0.5F), mAllowAlpha?255-mRGBa[3]:255); + IIcon aIcon = mIconContainer[0].getIcon(); + + double d3 = aIcon.getInterpolatedU(aRenderer.renderMaxX * 16.0D); + double d4 = aIcon.getInterpolatedU(aRenderer.renderMinX * 16.0D); + double d5 = aIcon.getInterpolatedV(aRenderer.renderMinZ * 16.0D); + double d6 = aIcon.getInterpolatedV(aRenderer.renderMaxZ * 16.0D); + + if (aRenderer.renderMinX < 0.0D || aRenderer.renderMaxX > 1.0D) { + d3 = aIcon.getMaxU(); + d4 = aIcon.getMinU(); + } + + if (aRenderer.renderMinZ < 0.0D || aRenderer.renderMaxZ > 1.0D) { + d5 = aIcon.getMinV(); + d6 = aIcon.getMaxV(); + } + + double d11 = aX + aRenderer.renderMinX; + double d12 = aX + aRenderer.renderMaxX; + double d13 = aY + aRenderer.renderMinY; + double d14 = aZ + aRenderer.renderMinZ; + double d15 = aZ + aRenderer.renderMaxZ; + + Tessellator.instance.addVertexWithUV(d11, d13, d15, d3, d6); + Tessellator.instance.addVertexWithUV(d11, d13, d14, d3, d5); + Tessellator.instance.addVertexWithUV(d12, d13, d14, d4, d5); + Tessellator.instance.addVertexWithUV(d12, d13, d15, d4, d6); + + if ((aIcon = mIconContainer[0].getOverlayIcon()) != null) { + Tessellator.instance.setColorRGBA(128, 128, 128, 255); + + d3 = aIcon.getInterpolatedU(aRenderer.renderMaxX * 16.0D); + d4 = aIcon.getInterpolatedU(aRenderer.renderMinX * 16.0D); + d5 = aIcon.getInterpolatedV(aRenderer.renderMinZ * 16.0D); + d6 = aIcon.getInterpolatedV(aRenderer.renderMaxZ * 16.0D); + + if (aRenderer.renderMinX < 0.0D || aRenderer.renderMaxX > 1.0D) { + d3 = aIcon.getMaxU(); + d4 = aIcon.getMinU(); + } + + if (aRenderer.renderMinZ < 0.0D || aRenderer.renderMaxZ > 1.0D) { + d5 = aIcon.getMinV(); + d6 = aIcon.getMaxV(); + } + + d11 = aX + aRenderer.renderMinX; + d12 = aX + aRenderer.renderMaxX; + d13 = aY + aRenderer.renderMinY; + d14 = aZ + aRenderer.renderMinZ; + d15 = aZ + aRenderer.renderMaxZ; + + Tessellator.instance.addVertexWithUV(d11, d13, d15, d3, d6); + Tessellator.instance.addVertexWithUV(d11, d13, d14, d3, d5); + Tessellator.instance.addVertexWithUV(d12, d13, d14, d4, d5); + Tessellator.instance.addVertexWithUV(d12, d13, d15, d4, d6); + } + } + + @Override + public void renderZPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + Tessellator.instance.setColorRGBA((int)(mRGBa[0] * 0.8F), (int)(mRGBa[1] * 0.8F), (int)(mRGBa[2] * 0.8F), mAllowAlpha?255-mRGBa[3]:255); + aRenderer.renderFaceZPos(aBlock, aX, aY, aZ, mIconContainer[3].getIcon()); + if (mIconContainer[3].getOverlayIcon() != null) { + Tessellator.instance.setColorRGBA(204, 204, 204, 255); + aRenderer.renderFaceZPos(aBlock, aX, aY, aZ, mIconContainer[3].getOverlayIcon()); + } + } + + @Override + public void renderZNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + Tessellator.instance.setColorRGBA((int)(mRGBa[0] * 0.8F), (int)(mRGBa[1] * 0.8F), (int)(mRGBa[2] * 0.8F), mAllowAlpha?255-mRGBa[3]:255); + aRenderer.renderFaceZNeg(aBlock, aX, aY, aZ, mIconContainer[2].getIcon()); + if (mIconContainer[2].getOverlayIcon() != null) { + Tessellator.instance.setColorRGBA(204, 204, 204, 255); + aRenderer.renderFaceZNeg(aBlock, aX, aY, aZ, mIconContainer[2].getOverlayIcon()); + } + } + + @Override + public short[] getRGBA() { + return mRGBa; + } + + @Override + public boolean isValidTexture() { + return mIconContainer != null && mIconContainer[0] != null && mIconContainer[1] != null && mIconContainer[2] != null && mIconContainer[3] != null && mIconContainer[4] != null && mIconContainer[5] != null; + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/objects/ItemData.java b/src/main/java/gregtech/api/objects/ItemData.java new file mode 100644 index 0000000..6e35981 --- /dev/null +++ b/src/main/java/gregtech/api/objects/ItemData.java @@ -0,0 +1,119 @@ +package gregtech.api.objects; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; + +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import net.minecraft.item.ItemStack; + +public class ItemData { + private static final MaterialStack[] EMPTY_MATERIALSTACK_ARRAY = new MaterialStack[0]; + + public final List mExtraData = new GT_ArrayList(false, 1); + + public boolean mBlackListed = false; + public ItemStack mUnificationTarget = null; + + public final OrePrefixes mPrefix; + public final MaterialStack mMaterial; + public final MaterialStack[] mByProducts; + + public ItemData(OrePrefixes aPrefix, Materials aMaterial, boolean aBlackListed) { + mPrefix = aPrefix; + mMaterial = aMaterial==null?null:new MaterialStack(aMaterial, aPrefix.mMaterialAmount); + mBlackListed = aBlackListed; + mByProducts = aPrefix.mSecondaryMaterial==null||aPrefix.mSecondaryMaterial.mMaterial==null?EMPTY_MATERIALSTACK_ARRAY:new MaterialStack[] {aPrefix.mSecondaryMaterial.clone()}; + } + + public ItemData(OrePrefixes aPrefix, Materials aMaterial) { + this(aPrefix, aMaterial, false); + } + + public ItemData(MaterialStack aMaterial, MaterialStack... aByProducts) { + mPrefix = null; + mMaterial = aMaterial.mMaterial==null?null:aMaterial.clone(); + mBlackListed = true; + if (aByProducts == null) { + mByProducts = EMPTY_MATERIALSTACK_ARRAY; + } else { + MaterialStack[] tByProducts = aByProducts.length<1?EMPTY_MATERIALSTACK_ARRAY:new MaterialStack[aByProducts.length]; + int j = 0; + for (int i = 0; i < aByProducts.length; i++) if (aByProducts[i] != null && aByProducts[i].mMaterial != null) tByProducts[j++] = aByProducts[i].clone(); + mByProducts = j>0?new MaterialStack[j]:EMPTY_MATERIALSTACK_ARRAY; + for (int i = 0; i < mByProducts.length; i++) mByProducts[i] = tByProducts[i]; + } + } + + public ItemData(Materials aMaterial, long aAmount, MaterialStack... aByProducts) { + this(new MaterialStack(aMaterial, aAmount), aByProducts); + } + + public ItemData(Materials aMaterial, long aAmount, Materials aByProduct, long aByProductAmount) { + this(new MaterialStack(aMaterial, aAmount), new MaterialStack(aByProduct, aByProductAmount)); + } + + public ItemData(ItemData... aData) { + mPrefix = null; + mBlackListed = true; + + ArrayList aList = new ArrayList(), rList = new ArrayList(); + + for (ItemData tData : aData) if (tData != null) { + if (tData.hasValidMaterialData() && tData.mMaterial.mAmount > 0) aList.add(tData.mMaterial.clone()); + for (MaterialStack tMaterial : tData.mByProducts) if (tMaterial.mAmount > 0) aList.add(tMaterial.clone()); + } + + for (MaterialStack aMaterial : aList) { + boolean temp = true; + for (MaterialStack tMaterial : rList) if (aMaterial.mMaterial == tMaterial.mMaterial) { + tMaterial.mAmount += aMaterial.mAmount; + temp = false; break; + } + if (temp) rList.add(aMaterial.clone()); + } + + Collections.sort(rList, new Comparator() {@Override public int compare(MaterialStack a, MaterialStack b) {return a.mAmount == b.mAmount ? 0 : a.mAmount > b.mAmount ? -1 : +1;}}); + + if (rList.isEmpty()) { + mMaterial = null; + } else { + mMaterial = rList.get(0); + rList.remove(0); + } + + mByProducts = rList.toArray(new MaterialStack[rList.size()]); + } + + public boolean hasValidPrefixMaterialData() { + return mPrefix != null && mMaterial != null && mMaterial.mMaterial != null; + } + + public boolean hasValidPrefixData() { + return mPrefix != null; + } + + public boolean hasValidMaterialData() { + return mMaterial != null && mMaterial.mMaterial != null; + } + + public ArrayList getAllMaterialStacks() { + ArrayList rList = new ArrayList(); + if (hasValidMaterialData()) rList.add(mMaterial); + rList.addAll(Arrays.asList(mByProducts)); + return rList; + } + + public MaterialStack getByProduct(int aIndex) { + return aIndex>=0&&aIndex 1 && mAmount > 1 ? "(" : "") + mMaterial.getToolTip(true) + (mMaterial.mMaterialList.size() > 1 && mAmount > 1 ? ")" : "") + (mAmount > 1 ? mAmount : ""); + } + + @Override + public int hashCode() { + return mMaterial.hashCode(); + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/threads/GT_Runnable_MachineBlockUpdate.java b/src/main/java/gregtech/api/threads/GT_Runnable_MachineBlockUpdate.java new file mode 100644 index 0000000..02fa581 --- /dev/null +++ b/src/main/java/gregtech/api/threads/GT_Runnable_MachineBlockUpdate.java @@ -0,0 +1,37 @@ +package gregtech.api.threads; + +import java.util.ArrayList; + +import gregtech.api.GregTech_API; +import gregtech.api.interfaces.tileentity.IMachineBlockUpdateable; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.ChunkPosition; +import net.minecraft.world.World; + +public class GT_Runnable_MachineBlockUpdate implements Runnable { + private final int mX, mY, mZ; + private final World mWorld; + + public GT_Runnable_MachineBlockUpdate(World aWorld, int aX, int aY, int aZ) { + mWorld = aWorld; mX = aX; mY = aY; mZ = aZ; + } + + @Override + public void run() { + try {stepToUpdateMachine(mWorld, mX, mY, mZ, new ArrayList());} catch(Throwable e) {/**/} + } + + private static void stepToUpdateMachine(World aWorld, int aX, int aY, int aZ, ArrayList aList) { + aList.add(new ChunkPosition(aX, aY, aZ)); + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if (tTileEntity != null && tTileEntity instanceof IMachineBlockUpdateable) ((IMachineBlockUpdateable)tTileEntity).onMachineBlockUpdate(); + if (aList.size() < 5 || (tTileEntity != null && tTileEntity instanceof IMachineBlockUpdateable) || GregTech_API.isMachineBlock(aWorld.getBlock(aX, aY, aZ), aWorld.getBlockMetadata(aX, aY, aZ))) { + if (!aList.contains(new ChunkPosition(aX + 1, aY, aZ))) stepToUpdateMachine(aWorld, aX + 1, aY, aZ, aList); + if (!aList.contains(new ChunkPosition(aX - 1, aY, aZ))) stepToUpdateMachine(aWorld, aX - 1, aY, aZ, aList); + if (!aList.contains(new ChunkPosition(aX, aY + 1, aZ))) stepToUpdateMachine(aWorld, aX, aY + 1, aZ, aList); + if (!aList.contains(new ChunkPosition(aX, aY - 1, aZ))) stepToUpdateMachine(aWorld, aX, aY - 1, aZ, aList); + if (!aList.contains(new ChunkPosition(aX, aY, aZ + 1))) stepToUpdateMachine(aWorld, aX, aY, aZ + 1, aList); + if (!aList.contains(new ChunkPosition(aX, aY, aZ - 1))) stepToUpdateMachine(aWorld, aX, aY, aZ - 1, aList); + } + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/threads/GT_Runnable_Sound.java b/src/main/java/gregtech/api/threads/GT_Runnable_Sound.java new file mode 100644 index 0000000..aaa8b84 --- /dev/null +++ b/src/main/java/gregtech/api/threads/GT_Runnable_Sound.java @@ -0,0 +1,26 @@ +package gregtech.api.threads; + +import gregtech.api.util.GT_PlayedSound; +import gregtech.api.util.GT_Utility; +import net.minecraft.world.World; + +public class GT_Runnable_Sound implements Runnable { + private final int mX, mY, mZ, mTimeUntilNextSound; + private final World mWorld; + private final String mSoundName; + private final float mSoundStrength, mSoundModulation; + + public GT_Runnable_Sound(World aWorld, int aX, int aY, int aZ, int aTimeUntilNextSound, String aSoundName, float aSoundStrength, float aSoundModulation) { + mWorld = aWorld; mX = aX; mY = aY; mZ = aZ; mTimeUntilNextSound = aTimeUntilNextSound; mSoundName = aSoundName; mSoundStrength = aSoundStrength; mSoundModulation = aSoundModulation; + } + + @Override + public void run() { + try { + GT_PlayedSound tSound; + if (GT_Utility.sPlayedSoundMap.keySet().contains(tSound = new GT_PlayedSound(mSoundName, mX, mY, mZ))) return; + mWorld.playSound(mX, mY, mZ, mSoundName, mSoundStrength, mSoundModulation, false); + GT_Utility.sPlayedSoundMap.put(tSound, mTimeUntilNextSound); + } catch(Throwable e) {/**/} + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/util/GT_BaseCrop.java b/src/main/java/gregtech/api/util/GT_BaseCrop.java new file mode 100644 index 0000000..a37e59b --- /dev/null +++ b/src/main/java/gregtech/api/util/GT_BaseCrop.java @@ -0,0 +1,129 @@ +package gregtech.api.util; + +import static gregtech.api.enums.GT_Values.E; + +import java.util.ArrayList; +import java.util.Random; + +import gregtech.api.enums.ConfigCategories; +import ic2.api.crops.CropCard; +import ic2.api.crops.Crops; +import ic2.api.crops.ICropTile; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.ItemStack; + +public class GT_BaseCrop extends CropCard { + private String mName = E, mDiscoveredBy = "Gregorius Techneticies", mAttributes[]; + private int mTier = 0, mMaxSize = 0, mAfterHarvestSize = 0, mHarvestSize = 0, mStats[] = new int[5]; + private ItemStack mDrop = null, mSpecialDrops[] = null; + + public static ArrayList sCropList = new ArrayList(); + + /** + * To create new Crops + * @param aID Default ID + * @param aCropName Name of the Crop + * @param aDiscoveredBy The one who discovered the Crop + * @param aDrop The Item which is dropped by the Crop. must be != null + * @param aBaseSeed Baseseed to plant this Crop. null == crossbreed only + * @param aTier tier of the Crop. forced to be >= 1 + * @param aMaxSize maximum Size of the Crop. forced to be >= 3 + * @param aGrowthSpeed how fast the Crop grows. if < 0 then its set to Tier*300 + * @param aHarvestSize the size the Crop needs to be harvested. forced to be between 2 and max size + */ + public GT_BaseCrop(int aID, String aCropName, String aDiscoveredBy, ItemStack aDrop, ItemStack[] aSpecialDrops, ItemStack aBaseSeed, int aTier, int aMaxSize, int aGrowthSpeed, int aAfterHarvestSize, int aHarvestSize, int aStatChemical, int aStatFood, int aStatDefensive, int aStatColor, int aStatWeed, String[] aAttributes) { + mName = aCropName; + aID = GT_Config.addIDConfig(ConfigCategories.IDs.crops, mName.replaceAll(" ", "_"), aID); + if (aDiscoveredBy != null && !aDiscoveredBy.equals(E)) mDiscoveredBy = aDiscoveredBy; + if (aDrop != null && aID > 0 && aID < 256) { + mDrop = GT_Utility.copy(aDrop); + mSpecialDrops = aSpecialDrops; + mTier = Math.max(1, aTier); + mMaxSize = Math.max(3, aMaxSize); +// mGrowthSpeed = aGrowthSpeed>0?aGrowthSpeed:mTier*300; + mHarvestSize = Math.min(Math.max(aHarvestSize, 2), mMaxSize); + mAfterHarvestSize = Math.min(Math.max(aAfterHarvestSize, 1), mMaxSize-1); + mStats[0] = aStatChemical; + mStats[1] = aStatFood; + mStats[2] = aStatDefensive; + mStats[3] = aStatColor; + mStats[4] = aStatWeed; + mAttributes = aAttributes; + if (!Crops.instance.registerCrop(this, aID)) throw new GT_ItsNotMyFaultException("Make sure the Crop ID is valid!"); + if (aBaseSeed != null) Crops.instance.registerBaseSeed(aBaseSeed, aID, 1, 1, 1, 1); + sCropList.add(this); + } + } + + @Override + public byte getSizeAfterHarvest(ICropTile crop) { + return (byte)mAfterHarvestSize; + } + + @Override + public String[] attributes() { + return mAttributes; + } + + @Override + public String discoveredBy() { + return mDiscoveredBy; + } + + @Override + public final boolean canGrow(ICropTile aCrop) { + return aCrop.getSize() < maxSize(); + } + + @Override + public final boolean canBeHarvested(ICropTile aCrop) { + return aCrop.getSize() >= mHarvestSize; + } + + @Override + public boolean canCross(ICropTile aCrop) { + return aCrop.getSize() + 2 > maxSize(); + } + + @Override + public int stat(int n) { + if (n < 0 || n >= mStats.length) return 0; + return mStats[n]; + } + + @Override + public String name() { + return mName; + } + + @Override + public int tier() { + return mTier; + } + + @Override + public int maxSize() { + return mMaxSize; + } + + @Override + public ItemStack getGain(ICropTile aCrop) { + int tDrop = 0; + if (mSpecialDrops != null && (tDrop = new Random().nextInt(mSpecialDrops.length+4)) < mSpecialDrops.length && mSpecialDrops[tDrop] != null) { + return GT_Utility.copy(mSpecialDrops[tDrop]); + } + return GT_Utility.copy(mDrop); + } + + @Override + public boolean rightclick(ICropTile aCrop, EntityPlayer aPlayer) { + if (!canBeHarvested(aCrop)) return false; + return aCrop.harvest(aPlayer==null?false:aPlayer instanceof EntityPlayerMP); + } + + @Override + public int getOptimalHavestSize(ICropTile crop) { + return maxSize(); + } +} diff --git a/src/main/java/gregtech/api/util/GT_CircuitryBehavior.java b/src/main/java/gregtech/api/util/GT_CircuitryBehavior.java new file mode 100644 index 0000000..3607a08 --- /dev/null +++ b/src/main/java/gregtech/api/util/GT_CircuitryBehavior.java @@ -0,0 +1,178 @@ +package gregtech.api.util; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.GregTech_API; +import gregtech.api.interfaces.IRedstoneCircuitBlock; + +/** + * Redstone Circuit Control Code + * + * This should make everything possible what a Redstone Computer or BuildCraft Gate could do. + * It is intended to use this similar to BC-Gates (for acquiring Data) and RP Logic Gates. + * You could write an extremely specified and complex Logic Gate, which works only for you Setup, like + * with ComputerCraft, but you would have to write an extra Mod to add that, as it doesn't work Ingame. + * + * One can make use of the fact, that ItemStacks can be stored as Integer, so that you can scan + * Inventories for specific Items using that. Luckily the Buttons in the GUI enable Copy/Paste of + * ItemID+MetaData to Integer, including the WildCard Damage Value when you use rightclick to place it. + * You just need to use @GT_Utility.stackToInt(ItemStack aStack) to get it. + * + * All Functions run usually in a seperate try/catch Block, so that failed Logic won't crash the TileEntity. + */ +public abstract class GT_CircuitryBehavior { + /** + * @param aIndex 0 - 1023 are my own Indices, so use other Numbers! + */ + public GT_CircuitryBehavior(int aIndex) { + GregTech_API.sCircuitryBehaviors.put(aIndex, this); + } + + /** + * Initializes the Parameters of this Circuit, all Parameters have been set to 0 right before calling this + * @param aCircuitData, The Data Storage you can use (8 Slots) + * @param aRedstoneCircuitBlock, The Circuit Block MetaTileEntity itself + */ + public abstract void initParameters(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock); + + /** + * Validates the Parameters of this Circuit when a value has been changed by the GUI + * Also called right after @initParameters and when the Chunk reloads + * @param aCircuitData, The Data Storage you can use (8 Slots and only the first 4 are User definable) + * @param aRedstoneCircuitBlock, The Circuit Block MetaTileEntity itself + */ + public abstract void validateParameters(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock); + + /** + * Called every tick if the Block has enough Energy and if the Block is Active + * @param aCircuitData, The Data Storage you can use (8 Slots) + * @param aRedstoneCircuitBlock, The Circuit Block MetaTileEntity itself + */ + public abstract void onTick(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock); + + /** + * If the ItemStack should be displayed. Parameters are between 0 and 3. + */ + public abstract boolean displayItemStack(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock, int aIndex); + + /***************** + * GUI Functions * + *****************/ + + /** + * The Name of the Gate for the GUI + */ + @SideOnly(Side.CLIENT) + public abstract String getName(); + + /** + * The Description of the Gate for the GUI + */ + @SideOnly(Side.CLIENT) + public abstract String getDescription(); + + /** + * The Description of the Data Field for the GUI + */ + @SideOnly(Side.CLIENT) + public abstract String getDataDescription(int[] aCircuitData, int aCircuitDataIndex); + + /** + * How the Integer should be displayed in the GUI. + * null means, that it just displays as regular Number. + */ + @SideOnly(Side.CLIENT) + public String getDataDisplay(int[] aCircuitData, int aCircuitDataIndex) { + return null; + } + + + /**************************** + * Useful Utility Functions * + ****************************/ + + /** + * returns if there is Redstone applied to any of the valid Inputs (OR) + */ + public static final boolean getAnyRedstone(IRedstoneCircuitBlock aRedstoneCircuitBlock) { + for (byte i = 0; i < 6; i++) { + if (i != aRedstoneCircuitBlock.getOutputFacing() && aRedstoneCircuitBlock.getCover(i).letsRedstoneGoIn(i, aRedstoneCircuitBlock.getCoverID(i), aRedstoneCircuitBlock.getCoverVariable(i), aRedstoneCircuitBlock.getOwnTileEntity())) { + if (aRedstoneCircuitBlock.getInputRedstone(i) > 0) { + return true; + } + } + } + return false; + } + + /** + * returns if there is Redstone applied to all the valid Inputs (AND) + */ + public static final boolean getAllRedstone(IRedstoneCircuitBlock aRedstoneCircuitBlock) { + for (byte i = 0; i < 6; i++) { + if (i != aRedstoneCircuitBlock.getOutputFacing() && aRedstoneCircuitBlock.getCover(i).letsRedstoneGoIn(i, aRedstoneCircuitBlock.getCoverID(i), aRedstoneCircuitBlock.getCoverVariable(i), aRedstoneCircuitBlock.getOwnTileEntity())) { + if (aRedstoneCircuitBlock.getInputRedstone(i) == 0) { + return false; + } + } + } + return true; + } + + /** + * returns if there is Redstone applied to exactly one of the valid Inputs (XOR) + */ + public static final boolean getOneRedstone(IRedstoneCircuitBlock aRedstoneCircuitBlock) { + int tRedstoneAmount = 0; + for (byte i = 0; i < 6; i++) { + if (i != aRedstoneCircuitBlock.getOutputFacing() && aRedstoneCircuitBlock.getCover(i).letsRedstoneGoIn(i, aRedstoneCircuitBlock.getCoverID(i), aRedstoneCircuitBlock.getCoverVariable(i), aRedstoneCircuitBlock.getOwnTileEntity())) { + if (aRedstoneCircuitBlock.getInputRedstone(i) > 0) { + tRedstoneAmount++; + } + } + } + return tRedstoneAmount == 1; + } + + /** + * returns the strongest incoming RS-Power + */ + public static final byte getStrongestRedstone(IRedstoneCircuitBlock aRedstoneCircuitBlock) { + byte tRedstoneAmount = 0; + for (byte i = 0; i < 6; i++) { + if (i != aRedstoneCircuitBlock.getOutputFacing() && aRedstoneCircuitBlock.getCover(i).letsRedstoneGoIn(i, aRedstoneCircuitBlock.getCoverID(i), aRedstoneCircuitBlock.getCoverVariable(i), aRedstoneCircuitBlock.getOwnTileEntity())) { + tRedstoneAmount = (byte)Math.max(tRedstoneAmount, aRedstoneCircuitBlock.getInputRedstone(i)); + } + } + return tRedstoneAmount; + } + + /** + * returns the weakest incoming non-zero RS-Power + */ + public static final byte getWeakestNonZeroRedstone(IRedstoneCircuitBlock aRedstoneCircuitBlock) { + if (!getAnyRedstone(aRedstoneCircuitBlock)) return 0; + byte tRedstoneAmount = 15; + for (byte i = 0; i < 6; i++) { + if (i != aRedstoneCircuitBlock.getOutputFacing() && aRedstoneCircuitBlock.getCover(i).letsRedstoneGoIn(i, aRedstoneCircuitBlock.getCoverID(i), aRedstoneCircuitBlock.getCoverVariable(i), aRedstoneCircuitBlock.getOwnTileEntity())) { + if (aRedstoneCircuitBlock.getInputRedstone(i) > 0) + tRedstoneAmount = (byte)Math.min(tRedstoneAmount, aRedstoneCircuitBlock.getInputRedstone(i)); + } + } + return tRedstoneAmount; + } + + /** + * returns the weakest incoming RS-Power + */ + public static final byte getWeakestRedstone(IRedstoneCircuitBlock aRedstoneCircuitBlock) { + if (!getAnyRedstone(aRedstoneCircuitBlock)) return 0; + byte tRedstoneAmount = 15; + for (byte i = 0; i < 6; i++) { + if (i != aRedstoneCircuitBlock.getOutputFacing() && aRedstoneCircuitBlock.getCover(i).letsRedstoneGoIn(i, aRedstoneCircuitBlock.getCoverID(i), aRedstoneCircuitBlock.getCoverVariable(i), aRedstoneCircuitBlock.getOwnTileEntity())) { + tRedstoneAmount = (byte)Math.min(tRedstoneAmount, aRedstoneCircuitBlock.getInputRedstone(i)); + } + } + return tRedstoneAmount; + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/util/GT_Config.java b/src/main/java/gregtech/api/util/GT_Config.java new file mode 100644 index 0000000..9c7b362 --- /dev/null +++ b/src/main/java/gregtech/api/util/GT_Config.java @@ -0,0 +1,83 @@ +package gregtech.api.util; + +import static gregtech.api.enums.GT_Values.E; +import static gregtech.api.enums.GT_Values.F; + +import gregtech.api.GregTech_API; +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.config.Configuration; +import net.minecraftforge.common.config.Property; + +public class GT_Config implements Runnable { + public static boolean troll = F; + + public static Configuration sConfigFileIDs; + + public static int addIDConfig(Object aCategory, String aName, int aDefault) { + if (GT_Utility.isStringInvalid(aName)) return aDefault; + Property tProperty = sConfigFileIDs.get(aCategory.toString().replaceAll("\\|", "."), aName.replaceAll("\\|", "."), aDefault); + int rResult = tProperty.getInt(aDefault); + if (!tProperty.wasRead() && GregTech_API.sPostloadFinished) sConfigFileIDs.save(); + return rResult; + } + + public final Configuration mConfig; + + public GT_Config(Configuration aConfig) { + mConfig = aConfig; + mConfig.load(); + mConfig.save(); + GregTech_API.sAfterGTPreload.add(this); // in case of crash on startup + GregTech_API.sAfterGTLoad.add(this); // in case of crash on startup + GregTech_API.sAfterGTPostload.add(this); + } + + public static String getStackConfigName(ItemStack aStack) { + if (GT_Utility.isStackInvalid(aStack)) return E; + Object rName = GT_OreDictUnificator.getAssociation(aStack); + if (rName != null) return rName.toString(); + try {if (GT_Utility.isStringValid(rName = aStack.getUnlocalizedName())) return rName.toString();} catch (Throwable e) {/*Do nothing*/} + return aStack.getItem() + "." + aStack.getItemDamage(); + } + + public boolean get(Object aCategory, ItemStack aStack, boolean aDefault) { + return get(aCategory, getStackConfigName(aStack), aDefault); + } + + public boolean get(Object aCategory, String aName, boolean aDefault) { + if (GT_Utility.isStringInvalid(aName)) return aDefault; + Property tProperty = mConfig.get(aCategory.toString().replaceAll("\\|", "_"), (aName+"_"+aDefault).replaceAll("\\|", "_"), aDefault); + boolean rResult = tProperty.getBoolean(aDefault); + if (!tProperty.wasRead() && GregTech_API.sPostloadFinished) mConfig.save(); + return rResult; + } + + public int get(Object aCategory, ItemStack aStack, int aDefault) { + return get(aCategory, getStackConfigName(aStack), aDefault); + } + + public int get(Object aCategory, String aName, int aDefault) { + if (GT_Utility.isStringInvalid(aName)) return aDefault; + Property tProperty = mConfig.get(aCategory.toString().replaceAll("\\|", "_"), (aName+"_"+aDefault).replaceAll("\\|", "_"), aDefault); + int rResult = tProperty.getInt(aDefault); + if (!tProperty.wasRead() && GregTech_API.sPostloadFinished) mConfig.save(); + return rResult; + } + + public double get(Object aCategory, ItemStack aStack, double aDefault) { + return get(aCategory, getStackConfigName(aStack), aDefault); + } + + public double get(Object aCategory, String aName, double aDefault) { + if (GT_Utility.isStringInvalid(aName)) return aDefault; + Property tProperty = mConfig.get(aCategory.toString().replaceAll("\\|", "_"), (aName+"_"+aDefault).replaceAll("\\|", "_"), aDefault); + double rResult = tProperty.getDouble(aDefault); + if (!tProperty.wasRead() && GregTech_API.sPostloadFinished) mConfig.save(); + return rResult; + } + + @Override + public void run() { + mConfig.save(); + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/util/GT_CoverBehavior.java b/src/main/java/gregtech/api/util/GT_CoverBehavior.java new file mode 100644 index 0000000..a3b088f --- /dev/null +++ b/src/main/java/gregtech/api/util/GT_CoverBehavior.java @@ -0,0 +1,218 @@ +package gregtech.api.util; + +import static gregtech.api.enums.GT_Values.E; + +import gregtech.api.interfaces.tileentity.ICoverable; +import gregtech.api.objects.GT_ItemStack; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.Fluid; + +/** + * For Covers with a special behavior. + */ +public abstract class GT_CoverBehavior { + /** + * Called by updateEntity inside the covered TileEntity. aCoverVariable is the Value you returned last time. + */ + public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { + return aCoverVariable; + } + + /** + * Called when someone rightclicks this Cover. + * + * return true, if something actually happens. + */ + public boolean onCoverRightclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { + return false; + } + + /** + * Called when someone rightclicks this Cover Client Side + * + * return true, if something actually happens. + */ + public boolean onCoverRightclickClient(byte aSide, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { + return false; + } + + /** + * Called when someone rightclicks this Cover with a Screwdriver. Doesn't call @onCoverRightclick in this Case. + * + * return the new Value of the Cover Variable + */ + public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { + return aCoverVariable; + } + + /** + * Checks if the Cover can be placed on this. + */ + public boolean isCoverPlaceable(byte aSide, GT_ItemStack aStack, ICoverable aTileEntity) { + return true; + } + + /** + * Removes the Cover if this returns true, or if aForced is true. + * Doesn't get called when the Machine Block is getting broken, only if you break the Cover away from the Machine. + */ + public boolean onCoverRemoval(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, boolean aForced) { + return true; + } + + /** + * Gives a small Text for the status of the Cover. + */ + public String getDescription(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + return E; + } + + /** + * How Blast Proof the Cover is. 30 is normal. + */ + public float getBlastProofLevel(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + return 10.0F; + } + + /** + * If it lets RS-Signals into the Block + * + * This is just Informative so that Machines know if their Redstone Input is blocked or not + */ + public boolean letsRedstoneGoIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + return false; + } + + /** + * If it lets RS-Signals out of the Block + */ + public boolean letsRedstoneGoOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + return false; + } + + /** + * If it lets Fibre-Signals into the Block + * + * This is just Informative so that Machines know if their Redstone Input is blocked or not + */ + public boolean letsFibreGoIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + return false; + } + + /** + * If it lets Fibre-Signals out of the Block + */ + public boolean letsFibreGoOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + return false; + } + + /** + * If it lets Energy into the Block + */ + public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + return false; + } + + /** + * If it lets Energy out of the Block + */ + public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + return false; + } + + /** + * If it lets Liquids into the Block, aFluid can be null meaning if this is generally allowing Fluids or not. + */ + public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { + return false; + } + + /** + * If it lets Liquids out of the Block, aFluid can be null meaning if this is generally allowing Fluids or not. + */ + public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { + return false; + } + + /** + * If it lets Items into the Block, aSlot = -1 means if it is generally accepting Items (return false for no Interaction at all), aSlot = -2 means if it would accept for all Slots (return true to skip the Checks for each Slot). + */ + public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) { + return false; + } + + /** + * If it lets Items out of the Block, aSlot = -1 means if it is generally accepting Items (return false for no Interaction at all), aSlot = -2 means if it would accept for all Slots (return true to skip the Checks for each Slot). + */ + public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) { + return false; + } + + /** + * If it lets you rightclick the Machine normally + */ + public boolean isGUIClickable(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + return false; + } + + /** + * Needs to return true for Covers, which have a Redstone Output on their Facing. + */ + public boolean manipulatesSidedRedstoneOutput(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + return false; + } + + /** + * if this Cover should let Pipe Connections look connected even if it is not the case. + */ + public boolean alwaysLookConnected(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + return false; + } + + /** + * Called to determine the incoming Redstone Signal of a Machine. + * Returns the original Redstone per default. + * The Cover should @letsRedstoneGoIn or the aInputRedstone Parameter is always 0. + */ + public byte getRedstoneInput(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + return letsRedstoneGoIn(aSide, aCoverID, aCoverVariable, aTileEntity)?aInputRedstone:0; + } + + /** + * Gets the Tick Rate for doCoverThings of the Cover + * + * 0 = No Ticks! Yes, 0 is Default, you have to override this + */ + public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + return 0; + } + + /** + * If this is a simple Cover, which can also be used on Bronze Machines and similar. + */ + public boolean isSimpleCover() { + return false; + } + + /** + * The MC Color of this Lens. -1 for no Color (meaning this isn't a Lens then). + */ + public byte getLensColor(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + return -1; + } + + /** + * @return the ItemStack dropped by this Cover + */ + public ItemStack getDrop(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + return GT_OreDictUnificator.get(true, aTileEntity.getCoverItemAtSide(aSide)); + } + + /** + * @return sets the Cover upon placement. + */ + public void placeCover(byte aSide, ItemStack aCover, ICoverable aTileEntity) { + aTileEntity.setCoverIDAtSide(aSide, GT_Utility.stackToInt(aCover)); + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/util/GT_CreativeTab.java b/src/main/java/gregtech/api/util/GT_CreativeTab.java new file mode 100644 index 0000000..d789fdc --- /dev/null +++ b/src/main/java/gregtech/api/util/GT_CreativeTab.java @@ -0,0 +1,24 @@ +package gregtech.api.util; + +import gregtech.api.enums.ItemList; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +public class GT_CreativeTab extends CreativeTabs { + public GT_CreativeTab(String aName, String aLocalName) { + super("GregTech." + aName); + GT_LanguageManager.addStringLocalization("itemGroup.GregTech." + aName, aLocalName); + } + + @Override + public ItemStack getIconItemStack() { + return ItemList.Tool_Cheat.get(1, new ItemStack(Blocks.iron_block, 1)); + } + + @Override + public Item getTabIconItem() { + return ItemList.Circuit_Integrated.getItem(); + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/util/GT_FoodStat.java b/src/main/java/gregtech/api/util/GT_FoodStat.java new file mode 100644 index 0000000..37e045a --- /dev/null +++ b/src/main/java/gregtech/api/util/GT_FoodStat.java @@ -0,0 +1,103 @@ +package gregtech.api.util; + +import static gregtech.api.enums.GT_Values.F; + +import gregtech.api.damagesources.GT_DamageSources; +import gregtech.api.interfaces.IFoodStat; +import gregtech.api.items.GT_MetaBase_Item; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.EnumAction; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.PotionEffect; + +public class GT_FoodStat implements IFoodStat { + private final int mFoodLevel; + private final int[] mPotionEffects; + private final float mSaturation; + private final EnumAction mAction; + private final ItemStack mEmptyContainer; + private final boolean mAlwaysEdible, mInvisibleParticles, mIsRotten; + private boolean mExplosive = F, mMilk = F; + + /** + * @param aFoodLevel Amount of Food in Half Bacon [0 - 20] + * @param aSaturation Amount of Saturation [0.0F - 1.0F] + * @param aAction The Action to be used. If this is null, it uses the Eating Action + * @param aEmptyContainer An empty Container (Optional) + * @param aAlwaysEdible If this Item is always edible, like Golden Apples or Potions + * @param aInvisibleParticles If the Particles of the Potion Effects are invisible + * @param aPotionEffects An Array of Potion Effects with %4==0 Elements as follows + * ID of a Potion Effect. 0 for none + * Duration of the Potion in Ticks + * Level of the Effect. [0, 1, 2] are for [I, II, III] + * The likelihood that this Potion Effect takes place upon being eaten [1 - 100] + */ + public GT_FoodStat(int aFoodLevel, float aSaturation, EnumAction aAction, ItemStack aEmptyContainer, boolean aAlwaysEdible, boolean aInvisibleParticles, boolean aIsRotten, int... aPotionEffects) { + mFoodLevel = aFoodLevel; + mSaturation = aSaturation; + mAction = aAction==null?EnumAction.eat:aAction; + mPotionEffects = aPotionEffects; + mEmptyContainer = GT_Utility.copy(aEmptyContainer); + mInvisibleParticles = aInvisibleParticles; + mAlwaysEdible = aAlwaysEdible; + mIsRotten = aIsRotten; + } + + public GT_FoodStat setExplosive() { + mExplosive = true; + return this; + } + + public GT_FoodStat setMilk() { + mMilk = true; + return this; + } + + @Override + public int getFoodLevel(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer) { + return mFoodLevel; + } + + @Override + public float getSaturation(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer) { + return mSaturation; + } + + @Override + public void onEaten(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer) { + aStack.stackSize--; + ItemStack tStack = GT_OreDictUnificator.get(GT_Utility.copy(mEmptyContainer)); + if (tStack != null && !aPlayer.inventory.addItemStackToInventory(tStack)) aPlayer.dropPlayerItemWithRandomChoice(tStack, true); + aPlayer.worldObj.playSoundAtEntity(aPlayer, "random.burp", 0.5F, aPlayer.worldObj.rand.nextFloat() * 0.1F + 0.9F); + if (!aPlayer.worldObj.isRemote) { + if (mMilk) { + aPlayer.curePotionEffects(new ItemStack(Items.milk_bucket, 1, 0)); + } + for (int i = 3; i < mPotionEffects.length; i+=4) { + if (aPlayer.worldObj.rand.nextInt(100) < mPotionEffects[i]) { + aPlayer.addPotionEffect(new PotionEffect(mPotionEffects[i-3], mPotionEffects[i-2], mPotionEffects[i-1], mInvisibleParticles)); + } + } + if (mExplosive) { + aPlayer.worldObj.newExplosion(aPlayer, aPlayer.posX, aPlayer.posY, aPlayer.posZ, 4, true, true); + aPlayer.attackEntityFrom(GT_DamageSources.getExplodingDamage(), Float.MAX_VALUE); + } + } + } + + @Override + public EnumAction getFoodAction(GT_MetaBase_Item aItem, ItemStack aStack) { + return mAction; + } + + @Override + public boolean alwaysEdible(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer) { + return mAlwaysEdible; + } + + @Override + public boolean isRotten(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer) { + return mIsRotten; + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/util/GT_IBoxableWrapper.java b/src/main/java/gregtech/api/util/GT_IBoxableWrapper.java new file mode 100644 index 0000000..e8fcf70 --- /dev/null +++ b/src/main/java/gregtech/api/util/GT_IBoxableWrapper.java @@ -0,0 +1,13 @@ +package gregtech.api.util; + +import static gregtech.api.enums.GT_Values.T; + +import ic2.api.item.IBoxable; +import net.minecraft.item.ItemStack; + +public class GT_IBoxableWrapper implements IBoxable { + @Override + public boolean canBeStoredInToolbox(ItemStack itemstack) { + return T; + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/util/GT_ItsNotMyFaultException.java b/src/main/java/gregtech/api/util/GT_ItsNotMyFaultException.java new file mode 100644 index 0000000..0c15970 --- /dev/null +++ b/src/main/java/gregtech/api/util/GT_ItsNotMyFaultException.java @@ -0,0 +1,16 @@ +package gregtech.api.util; + +public class GT_ItsNotMyFaultException extends RuntimeException { + private static final long serialVersionUID = -8752778866486460495L; + + private String mError; + + public GT_ItsNotMyFaultException(String aError) { + mError = aError; + } + + @Override + public String toString() { + return "The GregTech-Addon has a Problem.\nIT'S NOT MY FAULT!!! Below is how to fix it.\n" + mError + "\nDO NOT COME TO ME WITH THIS CRASH. YOU CAUSED IT YOURSELF, AND I TOLD YOU HOW TO FIX IT!!!"; + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/util/GT_LanguageManager.java b/src/main/java/gregtech/api/util/GT_LanguageManager.java new file mode 100644 index 0000000..af16b3d --- /dev/null +++ b/src/main/java/gregtech/api/util/GT_LanguageManager.java @@ -0,0 +1,95 @@ +package gregtech.api.util; + +import static gregtech.api.enums.GT_Values.E; + +import java.util.HashMap; +import java.util.Map.Entry; + +import cpw.mods.fml.common.registry.LanguageRegistry; +import gregtech.api.GregTech_API; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.StatCollector; +import net.minecraftforge.common.config.Configuration; +import net.minecraftforge.common.config.Property; + +public class GT_LanguageManager { + public static Configuration sEnglishFile; + + public static final HashMap TEMPMAP = new HashMap(), BUFFERMAP = new HashMap(); + + public static String addStringLocalization(String aKey, String aEnglish) { + return addStringLocalization(aKey, aEnglish, true); + } + + public static String addStringLocalization(String aKey, String aEnglish, boolean aWriteIntoLangFile) { + if (aKey == null) return E; + if (aWriteIntoLangFile) aEnglish = writeToLangFile(aKey, aEnglish); + TEMPMAP.put(aKey.trim(), aEnglish); + LanguageRegistry.instance().injectLanguage("en_US", TEMPMAP); + TEMPMAP.clear(); + return aEnglish; + } + + private static synchronized String writeToLangFile(String aKey, String aEnglish) { + if (aKey == null) return E; + if (sEnglishFile == null) { + BUFFERMAP.put(aKey.trim(), aEnglish); + } else { + if (!BUFFERMAP.isEmpty()) { + for (Entry tEntry : BUFFERMAP.entrySet()) { + Property tProperty = sEnglishFile.get("LanguageFile", tEntry.getKey(), tEntry.getValue()); + if (!tProperty.wasRead() && GregTech_API.sPostloadFinished) sEnglishFile.save(); + } + BUFFERMAP.clear(); + } + Property tProperty = sEnglishFile.get("LanguageFile", aKey.trim(), aEnglish); + if (!tProperty.wasRead() && GregTech_API.sPostloadFinished) sEnglishFile.save(); + if (sEnglishFile.get("EnableLangFile", "UseThisFileAsLanguageFile", false).getBoolean(false)) aEnglish = tProperty.getString(); + } + return aEnglish; + } + + public static String getTranslation(String aKey) { + if (aKey == null) return E; + String tTrimmedKey = aKey.trim(), rTranslation = LanguageRegistry.instance().getStringLocalization(tTrimmedKey); + if (GT_Utility.isStringInvalid(rTranslation)) { + rTranslation = StatCollector.translateToLocal(tTrimmedKey); + if (GT_Utility.isStringInvalid(rTranslation) || tTrimmedKey.equals(rTranslation)) { + if (aKey.endsWith(".name")) { + rTranslation = StatCollector.translateToLocal(tTrimmedKey.substring(0, tTrimmedKey.length() - 5)); + if (GT_Utility.isStringInvalid(rTranslation) || tTrimmedKey.substring(0, tTrimmedKey.length() - 5).equals(rTranslation)) { + return aKey; + } + } else { + rTranslation = StatCollector.translateToLocal(tTrimmedKey + ".name"); + if (GT_Utility.isStringInvalid(rTranslation) || (tTrimmedKey + ".name").equals(rTranslation)) { + return aKey; + } + } + } + } + return rTranslation; + } + + public static String getTranslation(String aKey, String aSeperator) { + if (aKey == null) return E; + String rTranslation = E; + for (String tString : aKey.split(aSeperator)) { + rTranslation += getTranslation(tString); + } + return rTranslation; + } + + public static String getTranslateableItemStackName(ItemStack aStack) { + if (GT_Utility.isStackInvalid(aStack)) return "null"; + NBTTagCompound tNBT = aStack.getTagCompound(); + if (tNBT != null && tNBT.hasKey("display")) { + String tName = tNBT.getCompoundTag("display").getString("Name"); + if (GT_Utility.isStringValid(tName)) { + return tName; + } + } + return aStack.getUnlocalizedName() + ".name"; + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/util/GT_Log.java b/src/main/java/gregtech/api/util/GT_Log.java new file mode 100644 index 0000000..06a0091 --- /dev/null +++ b/src/main/java/gregtech/api/util/GT_Log.java @@ -0,0 +1,35 @@ +package gregtech.api.util; + +import java.io.File; +import java.io.OutputStream; +import java.io.PrintStream; +import java.util.ArrayList; +import java.util.List; + +/** + * NEVER INCLUDE THIS FILE IN YOUR MOD!!! + * + * Just a simple Logging Function. If on Server, then this will point to System.out and System.err + */ +public class GT_Log { + public static PrintStream out = System.out; + public static PrintStream err = System.err; + public static PrintStream ore = new LogBuffer(); + public static PrintStream pal = null; + public static File mLogFile; + public static File mOreDictLogFile; + public static File mPlayerActivityLogFile; + + public static class LogBuffer extends PrintStream { + public final List mBufferedOreDictLog = new ArrayList(); + + public LogBuffer() { + super(new OutputStream() {@Override public void write(int arg0) {/*Do nothing*/}}); + } + + @Override + public void println(String aString) { + mBufferedOreDictLog.add(aString); + } + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/util/GT_ModHandler.java b/src/main/java/gregtech/api/util/GT_ModHandler.java new file mode 100644 index 0000000..d7d2471 --- /dev/null +++ b/src/main/java/gregtech/api/util/GT_ModHandler.java @@ -0,0 +1,1729 @@ +package gregtech.api.util; + +import static gregtech.api.enums.GT_Values.B; +import static gregtech.api.enums.GT_Values.D1; +import static gregtech.api.enums.GT_Values.DW; +import static gregtech.api.enums.GT_Values.E; +import static gregtech.api.enums.GT_Values.F; +import static gregtech.api.enums.GT_Values.M; +import static gregtech.api.enums.GT_Values.RA; +import static gregtech.api.enums.GT_Values.T; +import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.GT_Values.W; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; + +import cpw.mods.fml.common.event.FMLInterModComms; +import cpw.mods.fml.common.registry.GameRegistry; +import gregtech.api.GregTech_API; +import gregtech.api.enums.ConfigCategories; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OreDictNames; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.ToolDictNames; +import gregtech.api.interfaces.IDamagableItem; +import gregtech.api.interfaces.IItemContainer; +import gregtech.api.interfaces.internal.IGT_CraftingRecipe; +import gregtech.api.objects.GT_HashSet; +import gregtech.api.objects.GT_ItemStack; +import gregtech.api.objects.ItemData; +import ic2.api.item.IBoxable; +import ic2.api.item.IC2Items; +import ic2.api.item.IElectricItem; +import ic2.api.reactor.IReactorComponent; +import ic2.api.recipe.IRecipeInput; +import ic2.api.recipe.RecipeInputItemStack; +import ic2.api.recipe.RecipeOutput; +import net.minecraft.block.Block; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.item.crafting.FurnaceRecipes; +import net.minecraft.item.crafting.IRecipe; +import net.minecraft.item.crafting.ShapedRecipes; +import net.minecraft.item.crafting.ShapelessRecipes; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntityFurnace; +import net.minecraft.world.World; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.oredict.ShapedOreRecipe; +import net.minecraftforge.oredict.ShapelessOreRecipe; + +/** + * NEVER INCLUDE THIS FILE IN YOUR MOD!!! + * + * This is the Interface I use for interacting with other Mods. + * + * Due to the many imports, this File can cause compile Problems if not all the APIs are installed + */ +public class GT_ModHandler { + public static volatile int VERSION = 508; + + /** + * Returns if that Liquid is Water or Distilled Water + */ + public static boolean isWater(FluidStack aFluid) { + if (aFluid == null) return F; + return aFluid.isFluidEqual(getWater(1)) || aFluid.isFluidEqual(getDistilledWater(1)); + } + + /** + * Returns a Liquid Stack with given amount of Water. + */ + public static FluidStack getWater(long aAmount) { + return FluidRegistry.getFluidStack("water", (int)aAmount); + } + + /** + * Returns a Liquid Stack with given amount of distilled Water. + */ + public static FluidStack getDistilledWater(long aAmount) { + return FluidRegistry.getFluidStack("ic2distilledwater", (int)aAmount); + } + + /** + * Returns if that Liquid is Lava + */ + public static boolean isLava(FluidStack aFluid) { + if (aFluid == null) return F; + return aFluid.isFluidEqual(getLava(1)); + } + + /** + * Returns a Liquid Stack with given amount of Lava. + */ + public static FluidStack getLava(long aAmount) { + return FluidRegistry.getFluidStack("lava", (int)aAmount); + } + + /** + * Returns if that Liquid is Steam + */ + public static boolean isSteam(FluidStack aFluid) { + if (aFluid == null) return F; + return aFluid.isFluidEqual(getSteam(1)); + } + + /** + * Returns a Liquid Stack with given amount of Steam. + */ + public static FluidStack getSteam(long aAmount) { + return FluidRegistry.getFluidStack("steam", (int)aAmount); + } + + /** + * Returns if that Liquid is Milk + */ + public static boolean isMilk(FluidStack aFluid) { + if (aFluid == null) return F; + return aFluid.isFluidEqual(getMilk(1)); + } + + /** + * Returns a Liquid Stack with given amount of Milk. + */ + public static FluidStack getMilk(long aAmount) { + return FluidRegistry.getFluidStack("milk", (int)aAmount); + } + + public static ItemStack getEmptyFuelCan(long aAmount) { + return ItemList.IC2_Fuel_Can_Empty.get(aAmount); + } + + public static ItemStack getEmptyCell(long aAmount) { + return ItemList.Cell_Empty.get(aAmount); + } + + public static ItemStack getAirCell(long aAmount) { + return ItemList.Cell_Air.get(aAmount); + } + + public static ItemStack getWaterCell(long aAmount) { + return ItemList.Cell_Water.get(aAmount); + } + + public static ItemStack getLavaCell(long aAmount) { + return ItemList.Cell_Lava.get(aAmount); + } + + /** + * @param aValue the Value of this Stack, when burning inside a Furnace (200 = 1 Burn Process = 500 EU, max = 32767 (that is 81917.5 EU)), limited to Short because the vanilla Furnace otherwise can't handle it properly, stupid Mojang... + */ + public static ItemStack setFuelValue(ItemStack aStack, short aValue) { + aStack.setTagCompound(GT_Utility.getNBTContainingShort(aStack.getTagCompound(), "GT.ItemFuelValue", aValue)); + return aStack; + } + + /** + * @return the Value of this Stack, when burning inside a Furnace (200 = 1 Burn Process = 500 EU, max = 32767 (that is 81917.5 EU)), limited to Short because the vanilla Furnace otherwise can't handle it properly, stupid Mojang... + */ + public static short getFuelValue(ItemStack aStack) { + return (short)TileEntityFurnace.getItemBurnTime(aStack); + } + + /** + * @param aValue Fuel value in EU + */ + public static ItemStack getFuelCan(int aValue) { + if (aValue < 5) return ItemList.IC2_Fuel_Can_Empty.get(1); + ItemStack rFuelCanStack = ItemList.IC2_Fuel_Can_Filled.get(1); + if (rFuelCanStack == null) return null; + NBTTagCompound tNBT = new NBTTagCompound(); + tNBT.setInteger("value", aValue/5); + rFuelCanStack.setTagCompound(tNBT); + return rFuelCanStack; + } + + /** + * @param aFuelCan the Item you want to check + * @return the exact Value in EU the Fuel Can is worth if its even a Fuel Can. + */ + public static int getFuelCanValue(ItemStack aFuelCan) { + if (GT_Utility.isStackInvalid(aFuelCan) || !ItemList.IC2_Fuel_Can_Filled.isStackEqual(aFuelCan, F, T)) return 0; + NBTTagCompound tNBT = aFuelCan.getTagCompound(); + return tNBT==null?0:tNBT.getInteger("value")*5; + } + + private static final Map sIC2ItemMap = new HashMap(); + + /** + * Gets an Item from IndustrialCraft, and returns a Replacement Item if not possible + */ + public static ItemStack getIC2Item(String aItem, long aAmount, ItemStack aReplacement) { + if (GT_Utility.isStringInvalid(aItem) || !GregTech_API.sPreloadStarted) return null; + //if (D1) GT_Log.out.println("Requested the Item '" + aItem + "' from the IC2-API"); + if (!sIC2ItemMap.containsKey(aItem)) try {ItemStack tStack = IC2Items.getItem(aItem); sIC2ItemMap.put(aItem, tStack); if (tStack == null && D1) GT_Log.err.println(aItem + " is not found in the IC2 Items!");} catch (Throwable e) {/*Do nothing*/} + return GT_Utility.copyAmount(aAmount, sIC2ItemMap.get(aItem), aReplacement); + } + + /** + * Gets an Item from IndustrialCraft, but the Damage Value can be specified, and returns a Replacement Item with the same Damage if not possible + */ + public static ItemStack getIC2Item(String aItem, long aAmount, int aMeta, ItemStack aReplacement) { + ItemStack rStack = getIC2Item(aItem, aAmount, aReplacement); + if (rStack == null) return null; + Items.feather.setDamage(rStack, aMeta); + return rStack; + } + + /** + * Gets an Item from IndustrialCraft, but the Damage Value can be specified + */ + public static ItemStack getIC2Item(String aItem, long aAmount, int aMeta) { + return getIC2Item(aItem, aAmount, aMeta, null); + } + + /** + * Gets an Item from IndustrialCraft + */ + public static ItemStack getIC2Item(String aItem, long aAmount) { + return getIC2Item(aItem, aAmount, null); + } + + /** + * Gets an Item from RailCraft + */ + public static ItemStack getModItem(String aModID, String aItem, long aAmount) { + return getModItem(aModID, aItem, aAmount, null); + } + + /** + * Gets an Item from RailCraft, and returns a Replacement Item if not possible + */ + public static ItemStack getModItem(String aModID, String aItem, long aAmount, ItemStack aReplacement) { + if (GT_Utility.isStringInvalid(aItem) || !GregTech_API.sPreloadStarted) return null; + return GT_Utility.copyAmount(aAmount, GameRegistry.findItemStack(aModID, aItem, (int)aAmount), aReplacement); + } + + /** + * Gets an Item from RailCraft, but the Damage Value can be specified + */ + public static ItemStack getModItem(String aModID, String aItem, long aAmount, int aMeta) { + ItemStack rStack = getModItem(aModID, aItem, aAmount); + if (rStack == null) return null; + Items.feather.setDamage(rStack, aMeta); + return rStack; + } + + /** + * Gets an Item from RailCraft, but the Damage Value can be specified, and returns a Replacement Item with the same Damage if not possible + */ + public static ItemStack getModItem(String aModID, String aItem, long aAmount, int aMeta, ItemStack aReplacement) { + ItemStack rStack = getModItem(aModID, aItem, aAmount, aReplacement); + if (rStack == null) return null; + Items.feather.setDamage(rStack, aMeta); + return rStack; + } + + /** + * OUT OF ORDER + */ + public static boolean getModeKeyDown(EntityPlayer aPlayer) { + return F; + } + + /** + * OUT OF ORDER + */ + public static boolean getBoostKeyDown(EntityPlayer aPlayer) { + return F; + } + + /** + * OUT OF ORDER + */ + public static boolean getJumpKeyDown(EntityPlayer aPlayer) { + return F; + } + + /** + * Adds a Valuable Ore to the Miner + */ + public static boolean addValuableOre(Block aBlock, int aMeta, int aValue) { + if (aValue <= 0) return F; + try { + Class.forName("ic2.core.IC2").getMethod("addValuableOre", IRecipeInput.class, int.class).invoke(null, new RecipeInputItemStack(new ItemStack(aBlock, 1, aMeta)), aValue); + } catch (Throwable e) {/*Do nothing*/} + return T; + } + + /** + * Adds a Scrapbox Drop. Fails at April first for the "suddenly Hoes"-Feature of IC2 + */ + public static boolean addScrapboxDrop(float aChance, ItemStack aOutput) { + aOutput = GT_OreDictUnificator.get(T, aOutput); + if (aOutput == null || aChance <= 0) return F; + aOutput.stackSize = 1; + if (GT_Config.troll && !GT_Utility.areStacksEqual(aOutput, new ItemStack(Items.wooden_hoe, 1, 0))) return F; + aChance = (float)GregTech_API.sRecipeFile.get(ConfigCategories.Machines.scrapboxdrops, aOutput, aChance); + if (aChance <= 0) return F; + try { + GT_Utility.callMethod(GT_Utility.getFieldContent("ic2.api.recipe.Recipes", "scrapboxDrops", T, T), "addDrop", T, F, T, GT_Utility.copy(aOutput), aChance); + GT_Utility.callMethod(GT_Utility.getFieldContent("ic2.api.recipe.Recipes", "scrapboxDrops", T, T), "addRecipe", T, T, F, GT_Utility.copy(aOutput), aChance); + } catch (Throwable e) {/*Do nothing*/} + return T; + } + + /** + * Adds an Item to the Recycler Blacklist + */ + public static boolean addToRecyclerBlackList(ItemStack aRecycledStack) { + if (aRecycledStack == null) return F; + try { + ic2.api.recipe.Recipes.recyclerBlacklist.add(new RecipeInputItemStack(aRecycledStack)); + } catch (Throwable e) {/*Do nothing*/} + return T; + } + + /** + * Just simple Furnace smelting. Unbelievable how Minecraft fails at making a simple ItemStack->ItemStack mapping... + */ + public static boolean addSmeltingRecipe(ItemStack aInput, ItemStack aOutput) { + aOutput = GT_OreDictUnificator.get(T, aOutput); + if (aInput == null || aOutput == null || GT_Utility.getContainerItem(aInput, F) != null) return F; + if (!GregTech_API.sRecipeFile.get(ConfigCategories.Machines.smelting, aInput, T)) return F; + FurnaceRecipes.smelting().func_151394_a(aInput, GT_Utility.copy(aOutput), 0.0F); + return T; + } + + /** + * Adds to Furnace AND Alloysmelter AND Induction Smelter + */ + public static boolean addSmeltingAndAlloySmeltingRecipe(ItemStack aInput, ItemStack aOutput) { + if (aInput == null || aOutput == null) return F; + boolean temp = F; + if (aInput.stackSize == 1 && addSmeltingRecipe(aInput, aOutput)) temp = T; + if (RA.addAlloySmelterRecipe(aInput, OrePrefixes.ingot.contains(aOutput)?ItemList.Shape_Mold_Ingot.get(0):OrePrefixes.block.contains(aOutput)?ItemList.Shape_Mold_Block.get(0):OrePrefixes.nugget.contains(aOutput)?ItemList.Shape_Mold_Nugget.get(0):null, aOutput, 130, 3)) temp = T; + if (addInductionSmelterRecipe(aInput, null, aOutput, null, aOutput.stackSize*1600, 0)) temp = T; + return temp; + } + + /** + * LiquidTransposer Recipe for both directions + */ + public static boolean addLiquidTransposerRecipe(ItemStack aEmptyContainer, FluidStack aLiquid, ItemStack aFullContainer, int aMJ) { + aFullContainer = GT_OreDictUnificator.get(T, aFullContainer); + if (aEmptyContainer == null || aFullContainer == null || aLiquid == null) return F; + if (!GregTech_API.sRecipeFile.get(ConfigCategories.Machines.liquidtransposer, aFullContainer, T)) return F; + try { + ThermalExpansion.addTransposerFill(aMJ*10, aEmptyContainer, aFullContainer, aLiquid, T); + } catch(Throwable e) {/*Do nothing*/} + return T; + } + + /** + * LiquidTransposer Recipe for filling Containers + */ + public static boolean addLiquidTransposerFillRecipe(ItemStack aEmptyContainer, FluidStack aLiquid, ItemStack aFullContainer, int aMJ) { + aFullContainer = GT_OreDictUnificator.get(T, aFullContainer); + if (aEmptyContainer == null || aFullContainer == null || aLiquid == null) return F; + if (!GregTech_API.sRecipeFile.get(ConfigCategories.Machines.liquidtransposerfilling, aFullContainer, T)) return F; + try { + ThermalExpansion.addTransposerFill(aMJ*10, aEmptyContainer, aFullContainer, aLiquid, F); + } catch(Throwable e) {/*Do nothing*/} + return T; + } + + /** + * LiquidTransposer Recipe for emptying Containers + */ + public static boolean addLiquidTransposerEmptyRecipe(ItemStack aFullContainer, FluidStack aLiquid, ItemStack aEmptyContainer, int aMJ) { + aEmptyContainer = GT_OreDictUnificator.get(T, aEmptyContainer); + if (aFullContainer == null || aEmptyContainer == null || aLiquid == null) return F; + if (!GregTech_API.sRecipeFile.get(ConfigCategories.Machines.liquidtransposeremptying, aFullContainer, T)) return F; + try { + ThermalExpansion.addTransposerExtract(aMJ*10, aFullContainer, aEmptyContainer, aLiquid, 100, F); + } catch(Throwable e) {/*Do nothing*/} + return T; + } + + /** + * IC2-Extractor Recipe. Overloads old Recipes automatically + */ + public static boolean addExtractionRecipe(ItemStack aInput, ItemStack aOutput) { + aOutput = GT_OreDictUnificator.get(T, aOutput); + if (aInput == null || aOutput == null) return F; + GT_Utility.removeSimpleIC2MachineRecipe(aInput, getExtractorRecipeList(), null); + if (!GregTech_API.sRecipeFile.get(ConfigCategories.Machines.extractor, aInput, T)) return F; + GT_Utility.addSimpleIC2MachineRecipe(aInput, getExtractorRecipeList(), null, aOutput); + return T; + } + + /** + * RC-BlastFurnace Recipes + */ + public static boolean addRCBlastFurnaceRecipe(ItemStack aInput, ItemStack aOutput, int aTime) { + aOutput = GT_OreDictUnificator.get(T, aOutput); + if (aInput == null || aOutput == null || aTime <= 0) return F; + if (!GregTech_API.sRecipeFile.get(ConfigCategories.Machines.rcblastfurnace, aInput, T)) return F; + aInput = GT_Utility.copy(aInput); + aOutput = GT_Utility.copy(aOutput); + return T; + } + + public static boolean addPulverisationRecipe(ItemStack aInput, ItemStack aOutput1) { + return addPulverisationRecipe(aInput, aOutput1, null, 0, F); + } + + public static boolean addPulverisationRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2) { + return addPulverisationRecipe(aInput, aOutput1, aOutput2, 100, F); + } + + public static boolean addPulverisationRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, int aChance) { + return addPulverisationRecipe(aInput, aOutput1, aOutput2, aChance, F); + } + + public static boolean addPulverisationRecipe(ItemStack aInput, ItemStack aOutput1, boolean aOverwrite) { + return addPulverisationRecipe(aInput, aOutput1, null, 0, aOverwrite); + } + + public static boolean addPulverisationRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, boolean aOverwrite) { + return addPulverisationRecipe(aInput, aOutput1, aOutput2, 100, aOverwrite); + } + + public static boolean addPulverisationRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, int aChance, boolean aOverwrite) { + return addPulverisationRecipe(aInput, aOutput1, aOutput2, aChance, null, 0, aOverwrite); + } + + /** + * Adds Several Pulverizer-Type Recipes. + */ + public static boolean addPulverisationRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, int aChance2, ItemStack aOutput3, int aChance3, boolean aOverwrite) { + aOutput1 = GT_OreDictUnificator.get(T, aOutput1); + aOutput2 = GT_OreDictUnificator.get(T, aOutput2); + if (GT_Utility.isStackInvalid(aInput) || GT_Utility.isStackInvalid(aOutput1)) return F; + GT_Utility.removeSimpleIC2MachineRecipe(aInput, getMaceratorRecipeList(), null); + + if (GT_Utility.getContainerItem(aInput, F) == null) { + if (GregTech_API.sRecipeFile.get(ConfigCategories.Machines.maceration, aInput, T)) { + GT_Utility.addSimpleIC2MachineRecipe(aInput, getMaceratorRecipeList(), null, aOutput1); + } + + RA.addPulveriserRecipe(aInput, new ItemStack[] {aOutput1, aOutput2, aOutput3}, new int[] {10000, aChance2<=0?1000:100*aChance2, aChance3<=0?1000:100*aChance3}, 400, 2); + + if (!OrePrefixes.log.contains(aInput)) { + if (Materials.Wood.contains(aOutput1)) { + if (GregTech_API.sRecipeFile.get(ConfigCategories.Machines.pulverization, aInput, T)) { + if (aOutput2 == null) + ThermalExpansion.addSawmillRecipe(32000, GT_Utility.copy(aInput), GT_Utility.copy(aOutput1)); + else + ThermalExpansion.addSawmillRecipe(32000, GT_Utility.copy(aInput), GT_Utility.copy(aOutput1), GT_Utility.copy(aOutput2), aChance2<=0?10:aChance2); + } + } else { + if (GregTech_API.sRecipeFile.get(ConfigCategories.Machines.rockcrushing, aInput, T)) { + } + if (GregTech_API.sRecipeFile.get(ConfigCategories.Machines.pulverization, aInput, T)) { + if (aOutput2 == null) + ThermalExpansion.addPulverizerRecipe(32000, GT_Utility.copy(aInput), GT_Utility.copy(aOutput1)); + else + ThermalExpansion.addPulverizerRecipe(32000, GT_Utility.copy(aInput), GT_Utility.copy(aOutput1), GT_Utility.copy(aOutput2), aChance2<=0?10:aChance2); + } + } + } + } + return T; + } + + /** + * Adds a Recipe to the Sawmills of GregTech and ThermalCraft + */ + public static boolean addSawmillRecipe(ItemStack aInput1, ItemStack aOutput1, ItemStack aOutput2) { + aOutput1 = GT_OreDictUnificator.get(T, aOutput1); + aOutput2 = GT_OreDictUnificator.get(T, aOutput2); + if (aInput1 == null || aOutput1 == null) return F; + if (!GregTech_API.sRecipeFile.get(ConfigCategories.Machines.sawmill, aInput1, T)) return F; + try { + ThermalExpansion.addSawmillRecipe(1600, aInput1, aOutput1, aOutput2, 100); + } catch(Throwable e) {/*Do nothing*/} + return T; + } + + /** + * Induction Smelter Recipes and Alloy Smelter Recipes + */ + public static boolean addAlloySmelterRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, int aEUt, boolean aAllowSecondaryInputEmpty) { + if (aInput1 == null || (aInput2 == null && !aAllowSecondaryInputEmpty) || aOutput1 == null) return F; + aOutput1 = GT_OreDictUnificator.get(T, aOutput1); + boolean temp = F; + if (RA.addAlloySmelterRecipe(aInput1, aInput2, aOutput1, aDuration, aEUt)) temp = T; + if (addInductionSmelterRecipe(aInput1, aInput2, aOutput1, null, aDuration * aEUt * 2, 0)) temp = T; + return temp; + } + + /** + * Induction Smelter Recipes for TE + */ + public static boolean addInductionSmelterRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, ItemStack aOutput2, int aEnergy, int aChance) { + aOutput1 = GT_OreDictUnificator.get(T, aOutput1); + aOutput2 = GT_OreDictUnificator.get(T, aOutput2); + if (aInput1 == null || aOutput1 == null || GT_Utility.getContainerItem(aInput1, F) != null) return F; + if (!GregTech_API.sRecipeFile.get(ConfigCategories.Machines.inductionsmelter, aInput2==null?aInput1:aOutput1, T)) return F; + try { + ThermalExpansion.addSmelterRecipe(aEnergy*10, GT_Utility.copy(aInput1), aInput2==null?new ItemStack(Blocks.sand, 1, 0):aInput2, aOutput1, aOutput2, aChance); + } catch(Throwable e) {/*Do nothing*/} + return T; + } + + /** + * Smelts Ores to Ingots + */ + public static boolean addOreToIngotSmeltingRecipe(ItemStack aInput, ItemStack aOutput) { + aOutput = GT_OreDictUnificator.get(T, aOutput); + if (aInput == null || aOutput == null) return F; + FurnaceRecipes.smelting().func_151394_a(aInput, GT_Utility.copy(aOutput), 0.0F); + return T; + } + + private static Map sExtractorRecipes = new HashMap(); + private static Map sMaceratorRecipes = new HashMap(); + private static Map sCompressorRecipes = new HashMap(); + private static Map sOreWashingRecipes = new HashMap(); + private static Map sThermalCentrifugeRecipes = new HashMap(); + private static Map sMassfabRecipes = new HashMap(); + + public static Map getExtractorRecipeList() { + try { + return ic2.api.recipe.Recipes.extractor.getRecipes(); + } catch(Throwable e) {/*Do nothing*/} + return sExtractorRecipes; + } + + public static Map getCompressorRecipeList() { + try { + return ic2.api.recipe.Recipes.compressor.getRecipes(); + } catch(Throwable e) {/*Do nothing*/} + return sCompressorRecipes; + } + + public static Map getMaceratorRecipeList() { + try { + return ic2.api.recipe.Recipes.macerator.getRecipes(); + } catch(Throwable e) {/*Do nothing*/} + return sMaceratorRecipes; + } + + public static Map getThermalCentrifugeRecipeList() { + try { + return ic2.api.recipe.Recipes.centrifuge.getRecipes(); + } catch(Throwable e) {/*Do nothing*/} + return sThermalCentrifugeRecipes; + } + + public static Map getOreWashingRecipeList() { + try { + return ic2.api.recipe.Recipes.oreWashing.getRecipes(); + } catch(Throwable e) {/*Do nothing*/} + return sOreWashingRecipes; + } + + public static Map getMassFabricatorList() { + try { + return ic2.api.recipe.Recipes.matterAmplifier.getRecipes(); + } catch(Throwable e) {/*Do nothing*/} + return sMassfabRecipes; + } + + /** + * IC2-ThermalCentrifuge Recipe. Overloads old Recipes automatically + */ + public static boolean addThermalCentrifugeRecipe(ItemStack aInput, int aHeat, Object... aOutput) { + if (aInput == null || aOutput == null || aOutput.length <= 0 || aOutput[0] == null) return F; + GT_Utility.removeSimpleIC2MachineRecipe(aInput, getThermalCentrifugeRecipeList(), null); + if (!GregTech_API.sRecipeFile.get(ConfigCategories.Machines.thermalcentrifuge, aInput, T)) return F; + NBTTagCompound tNBT = new NBTTagCompound(); + tNBT.setInteger("minHeat", aHeat); + GT_Utility.addSimpleIC2MachineRecipe(aInput, getThermalCentrifugeRecipeList(), tNBT, aOutput); + return T; + } + + /** + * IC2-OreWasher Recipe. Overloads old Recipes automatically + */ + public static boolean addOreWasherRecipe(ItemStack aInput, int aWaterAmount, Object... aOutput) { + if (aInput == null || aOutput == null || aOutput.length <= 0 || aOutput[0] == null) return F; + GT_Utility.removeSimpleIC2MachineRecipe(aInput, getOreWashingRecipeList(), null); + if (!GregTech_API.sRecipeFile.get(ConfigCategories.Machines.orewashing, aInput, T)) return F; + NBTTagCompound tNBT = new NBTTagCompound(); + tNBT.setInteger("amount", aWaterAmount); + GT_Utility.addSimpleIC2MachineRecipe(aInput, getOreWashingRecipeList(), tNBT, aOutput); + return T; + } + + /** + * IC2-Compressor Recipe. Overloads old Recipes automatically + */ + public static boolean addCompressionRecipe(ItemStack aInput, ItemStack aOutput) { + aOutput = GT_OreDictUnificator.get(T, aOutput); + if (aInput == null || aOutput == null) return F; + GT_Utility.removeSimpleIC2MachineRecipe(aInput, getCompressorRecipeList(), null); + if (!GregTech_API.sRecipeFile.get(ConfigCategories.Machines.compression, aInput, T)) return F; + GT_Utility.addSimpleIC2MachineRecipe(aInput, getCompressorRecipeList(), null, aOutput); + return T; + } + + /** + * @param aValue Scrap = 5000, Scrapbox = 45000, Diamond Dust 125000 + */ + public static boolean addIC2MatterAmplifier(ItemStack aAmplifier, int aValue) { + if (aAmplifier == null || aValue <= 0) return F; + if (!GregTech_API.sRecipeFile.get(ConfigCategories.Machines.massfabamplifier, aAmplifier, T)) return F; + try { + NBTTagCompound tNBT = new NBTTagCompound(); + tNBT.setInteger("amplification", aValue); + GT_Utility.callMethod(ic2.api.recipe.Recipes.matterAmplifier, "addRecipe", F, F, F, aAmplifier, tNBT); + } catch(Throwable e) {/*Do nothing*/} + return T; + } + + /** + * Rolling Machine Crafting Recipe + */ + public static boolean addRollingMachineRecipe(ItemStack aResult, Object[] aRecipe) { + aResult = GT_OreDictUnificator.get(T, aResult); + if (aResult == null || aRecipe == null || aResult.stackSize <= 0) return F; + return T; + } + + private static boolean sBufferCraftingRecipes = T; + private static final List sAllRecipeList = Collections.synchronizedList(new ArrayList(5000)), sBufferRecipeList = new ArrayList(1000); + public static final List sSingleNonBlockDamagableRecipeList = new ArrayList(1000); + + public static void stopBufferingCraftingRecipes() { + sBufferCraftingRecipes = F; + for (IRecipe tRecipe : sBufferRecipeList) GameRegistry.addRecipe(tRecipe); + sBufferRecipeList.clear(); + } + + public static class RecipeBits { + /** Mirrors the Recipe */ + public static long MIRRORED = B[0]; + /** Buffers the Recipe for later addition. This makes things more efficient. */ + public static long BUFFERED = B[1]; + /** This is a special Tag I used for crafting Coins up and down. */ + public static long KEEPNBT = B[2]; + /** Makes the Recipe Reverse Craftable in the Disassembler. */ + public static long DISMANTLEABLE = B[3]; + /** Prevents the Recipe from accidentally getting removed by my own Handlers. */ + public static long NOT_REMOVABLE = B[4]; + /** Reverses the Output of the Recipe for smelting and pulverising. */ + public static long REVERSIBLE = B[5]; + /** Removes all Recipes with the same Output Item regardless of NBT, unless another Recipe Deletion Bit is added too. */ + public static long DELETE_ALL_OTHER_RECIPES = B[6]; + /** Removes all Recipes with the same Output Item limited to the same NBT. */ + public static long DELETE_ALL_OTHER_RECIPES_IF_SAME_NBT = B[7]; + /** Removes all Recipes with the same Output Item limited to Shaped Recipes. */ + public static long DELETE_ALL_OTHER_SHAPED_RECIPES = B[8]; + /** Removes all Recipes with the same Output Item limited to native Recipe Handlers. */ + public static long DELETE_ALL_OTHER_NATIVE_RECIPES = B[9]; + /** Disables the check for colliding Recipes. */ + public static long DO_NOT_CHECK_FOR_COLLISIONS = B[10]; + /** Only adds the Recipe if there is another Recipe having that Output */ + public static long ONLY_ADD_IF_THERE_IS_ANOTHER_RECIPE_FOR_IT = B[11]; + /** Only adds the Recipe if it has an Output */ + public static long ONLY_ADD_IF_RESULT_IS_NOT_NULL = B[12]; + } + + /** + * Shapeless Crafting Recipes. Deletes conflicting Recipes too. + */ + public static boolean addCraftingRecipe(ItemStack aResult, Enchantment[] aEnchantmentsAdded, int[] aEnchantmentLevelsAdded, Object[] aRecipe) { + return addCraftingRecipe(aResult, aEnchantmentsAdded, aEnchantmentLevelsAdded, F, T, F, F, F, F, F, F, F, F, F, F, T, aRecipe); + } + + /** + * Regular Crafting Recipes. Deletes conflicting Recipes too. + * + * You can insert instances of IItemContainer into the Recipe Input Array directly without having to call "get(1)" on them. + * + * Enums are automatically getting their "name()"-Method called in order to deliver an OreDict String. + * + * Lowercase Letters are reserved for Tools. They are as follows: + * + * 'b' ToolDictNames.craftingToolBlade + * 'c' ToolDictNames.craftingToolCrowbar, + * 'd' ToolDictNames.craftingToolScrewdriver, + * 'f' ToolDictNames.craftingToolFile, + * 'h' ToolDictNames.craftingToolHardHammer, + * 'i' ToolDictNames.craftingToolSolderingIron, + * 'j' ToolDictNames.craftingToolSolderingMetal, + * 'k' ToolDictNames.craftingToolKnive + * 'm' ToolDictNames.craftingToolMortar, + * 'p' ToolDictNames.craftingToolDrawplate, + * 'r' ToolDictNames.craftingToolSoftHammer, + * 's' ToolDictNames.craftingToolSaw, + * 'w' ToolDictNames.craftingToolWrench, + * 'x' ToolDictNames.craftingToolWireCutter, + */ + public static boolean addCraftingRecipe(ItemStack aResult, Object[] aRecipe) { + return addCraftingRecipe(aResult, 0, aRecipe); + } + + /** + * Regular Crafting Recipes. Deletes conflicting Recipes too. + * + * You can insert instances of IItemContainer into the Recipe Input Array directly without having to call "get(1)" on them. + * + * Enums are automatically getting their "name()"-Method called in order to deliver an OreDict String. + * + * Lowercase Letters are reserved for Tools. They are as follows: + * + * 'b' ToolDictNames.craftingToolBlade + * 'c' ToolDictNames.craftingToolCrowbar, + * 'd' ToolDictNames.craftingToolScrewdriver, + * 'f' ToolDictNames.craftingToolFile, + * 'h' ToolDictNames.craftingToolHardHammer, + * 'i' ToolDictNames.craftingToolSolderingIron, + * 'j' ToolDictNames.craftingToolSolderingMetal, + * 'k' ToolDictNames.craftingToolKnive + * 'm' ToolDictNames.craftingToolMortar, + * 'p' ToolDictNames.craftingToolDrawplate, + * 'r' ToolDictNames.craftingToolSoftHammer, + * 's' ToolDictNames.craftingToolSaw, + * 'w' ToolDictNames.craftingToolWrench, + * 'x' ToolDictNames.craftingToolWireCutter, + */ + public static boolean addCraftingRecipe(ItemStack aResult, long aBitMask, Object[] aRecipe) { + return addCraftingRecipe(aResult, new Enchantment[0], new int[0], (aBitMask & RecipeBits.MIRRORED) != 0, (aBitMask & RecipeBits.BUFFERED) != 0, (aBitMask & RecipeBits.KEEPNBT) != 0, (aBitMask & RecipeBits.DISMANTLEABLE) != 0, (aBitMask & RecipeBits.NOT_REMOVABLE) == 0, (aBitMask & RecipeBits.REVERSIBLE) != 0, (aBitMask & RecipeBits.DELETE_ALL_OTHER_RECIPES) != 0, (aBitMask & RecipeBits.DELETE_ALL_OTHER_RECIPES_IF_SAME_NBT) != 0, (aBitMask & RecipeBits.DELETE_ALL_OTHER_SHAPED_RECIPES) != 0, (aBitMask & RecipeBits.DELETE_ALL_OTHER_NATIVE_RECIPES) != 0, (aBitMask & RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS) == 0, (aBitMask & RecipeBits.ONLY_ADD_IF_THERE_IS_ANOTHER_RECIPE_FOR_IT) != 0, (aBitMask & RecipeBits.ONLY_ADD_IF_RESULT_IS_NOT_NULL) != 0, aRecipe); + } + + /** + * Internal realisation of the Crafting Recipe adding Process. + */ + private static boolean addCraftingRecipe(ItemStack aResult, Enchantment[] aEnchantmentsAdded, int[] aEnchantmentLevelsAdded, boolean aMirrored, boolean aBuffered, boolean aKeepNBT, boolean aDismantleable, boolean aRemovable, boolean aReversible, boolean aRemoveAllOthersWithSameOutput, boolean aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT, boolean aRemoveAllOtherShapedsWithSameOutput, boolean aRemoveAllOtherNativeRecipes, boolean aCheckForCollisions, boolean aOnlyAddIfThereIsAnyRecipeOutputtingThis, boolean aOnlyAddIfResultIsNotNull, Object[] aRecipe) { + aResult = GT_OreDictUnificator.get(T, aResult); + if (aOnlyAddIfResultIsNotNull && aResult == null) return F; + if (aResult != null && Items.feather.getDamage(aResult) == W) Items.feather.setDamage(aResult, 0); + if (aRecipe == null || aRecipe.length <= 0) return F; + + boolean tThereWasARecipe = F; + + for (byte i = 0; i < aRecipe.length; i++) { + if (aRecipe[i] instanceof IItemContainer) + aRecipe[i] = ((IItemContainer)aRecipe[i]).get(1); + else if (aRecipe[i] instanceof Enum) + aRecipe[i] = ((Enum)aRecipe[i]).name(); + else if (!(aRecipe[i] == null || aRecipe[i] instanceof ItemStack || aRecipe[i] instanceof ItemData || aRecipe[i] instanceof String || aRecipe[i] instanceof Character)) + aRecipe[i] = aRecipe[i].toString(); + } + + try { + String shape = E; + int idx = 0; + if (aRecipe[idx] instanceof Boolean) { + throw new IllegalArgumentException(); + } + + ArrayList tRecipeList = new ArrayList(Arrays.asList(aRecipe)); + + while (aRecipe[idx] instanceof String) { + String s = (String)aRecipe[idx++]; + shape += s; + while (s.length() < 3) s+=" "; + if (s.length() > 3) throw new IllegalArgumentException(); + + for (char c : s.toCharArray()) { + switch(c) { + case 'b': tRecipeList.add(c); tRecipeList.add(ToolDictNames.craftingToolBlade .name()); break; + case 'c': tRecipeList.add(c); tRecipeList.add(ToolDictNames.craftingToolCrowbar .name()); break; + case 'd': tRecipeList.add(c); tRecipeList.add(ToolDictNames.craftingToolScrewdriver .name()); break; + case 'f': tRecipeList.add(c); tRecipeList.add(ToolDictNames.craftingToolFile .name()); break; + case 'h': tRecipeList.add(c); tRecipeList.add(ToolDictNames.craftingToolHardHammer .name()); break; + case 'i': tRecipeList.add(c); tRecipeList.add(ToolDictNames.craftingToolSolderingIron .name()); break; + case 'j': tRecipeList.add(c); tRecipeList.add(ToolDictNames.craftingToolSolderingMetal .name()); break; + case 'k': tRecipeList.add(c); tRecipeList.add(ToolDictNames.craftingToolKnife .name()); break; + case 'm': tRecipeList.add(c); tRecipeList.add(ToolDictNames.craftingToolMortar .name()); break; + case 'p': tRecipeList.add(c); tRecipeList.add(ToolDictNames.craftingToolDrawplate .name()); break; + case 'r': tRecipeList.add(c); tRecipeList.add(ToolDictNames.craftingToolSoftHammer .name()); break; + case 's': tRecipeList.add(c); tRecipeList.add(ToolDictNames.craftingToolSaw .name()); break; + case 'w': tRecipeList.add(c); tRecipeList.add(ToolDictNames.craftingToolWrench .name()); break; + case 'x': tRecipeList.add(c); tRecipeList.add(ToolDictNames.craftingToolWireCutter .name()); break; + } + } + } + + aRecipe = tRecipeList.toArray(); + + if (aRecipe[idx] instanceof Boolean) { + idx++; + } + HashMap tItemStackMap = new HashMap(); + HashMap tItemDataMap = new HashMap(); + tItemStackMap.put(' ', null); + + boolean tRemoveRecipe = T; + + for (; idx < aRecipe.length; idx += 2) { + if (aRecipe[idx] == null || aRecipe[idx + 1] == null) { + if (D1) { + GT_Log.err.println("WARNING: Missing Item for shaped Recipe: " + (aResult==null?"null":aResult.getDisplayName())); + for (Object tContent : aRecipe) GT_Log.err.println(tContent); + } + return F; + } + Character chr = (Character)aRecipe[idx]; + Object in = aRecipe[idx + 1]; + if (in instanceof ItemStack) { + tItemStackMap.put(chr, GT_Utility.copy((ItemStack)in)); + tItemDataMap.put(chr, GT_OreDictUnificator.getItemData((ItemStack)in)); + } else if (in instanceof ItemData) { + String tString = in.toString(); + if (tString.equals("plankWood")) { + tItemDataMap.put(chr, new ItemData(Materials.Wood, M)); + } else if (tString.equals("stoneNetherrack")) { + tItemDataMap.put(chr, new ItemData(Materials.Netherrack, M)); + } else if (tString.equals("stoneObsidian")) { + tItemDataMap.put(chr, new ItemData(Materials.Obsidian, M)); + } else if (tString.equals("stoneEndstone")) { + tItemDataMap.put(chr, new ItemData(Materials.Endstone, M)); + } else { + tItemDataMap.put(chr, (ItemData)in); + } + ItemStack tStack = GT_OreDictUnificator.getFirstOre(in, 1); + if (tStack == null) tRemoveRecipe = F; else tItemStackMap.put(chr, tStack); + in = aRecipe[idx + 1] = in.toString(); + } else if (in instanceof String) { + if (in.equals(OreDictNames.craftingChest .toString())) tItemDataMap.put(chr, new ItemData(Materials.Wood, M * 8)); + else if (in.equals(OreDictNames.craftingBook .toString())) tItemDataMap.put(chr, new ItemData(Materials.Paper, M * 3)); + else if (in.equals(OreDictNames.craftingPiston .toString())) tItemDataMap.put(chr, new ItemData(Materials.Stone, M * 4, Materials.Wood, M * 3)); + else if (in.equals(OreDictNames.craftingFurnace .toString())) tItemDataMap.put(chr, new ItemData(Materials.Stone, M * 8)); + else if (in.equals(OreDictNames.craftingIndustrialDiamond .toString())) tItemDataMap.put(chr, new ItemData(Materials.Diamond, M)); + else if (in.equals(OreDictNames.craftingAnvil .toString())) tItemDataMap.put(chr, new ItemData(Materials.Iron, M * 10)); + ItemStack tStack = GT_OreDictUnificator.getFirstOre(in, 1); + if (tStack == null) tRemoveRecipe = F; else tItemStackMap.put(chr, tStack); + } else { + throw new IllegalArgumentException(); + } + } + + if (aReversible && aResult != null) { + ItemData[] tData = new ItemData[9]; + int x = -1; + for (char chr : shape.toCharArray()) tData[++x] = tItemDataMap.get(chr); + if (GT_Utility.arrayContainsNonNull(tData)) GT_OreDictUnificator.addItemData(aResult, new ItemData(tData)); + } + + if (aCheckForCollisions && tRemoveRecipe) { + ItemStack[] tRecipe = new ItemStack[9]; + int x = -1; + for (char chr : shape.toCharArray()) { + tRecipe[++x] = tItemStackMap.get(chr); + if (tRecipe[x] != null && Items.feather.getDamage(tRecipe[x]) == W) Items.feather.setDamage(tRecipe[x], 0); + } + tThereWasARecipe = removeRecipe(tRecipe) != null || tThereWasARecipe; + } + } catch(Throwable e) {e.printStackTrace(GT_Log.err);} + + if (aResult == null || aResult.stackSize <= 0) return F; + + if (aRemoveAllOthersWithSameOutput || aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT || aRemoveAllOtherShapedsWithSameOutput || aRemoveAllOtherNativeRecipes) + tThereWasARecipe = removeRecipeByOutput(aResult, !aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT, aRemoveAllOtherShapedsWithSameOutput, aRemoveAllOtherNativeRecipes) || tThereWasARecipe; + + if (aOnlyAddIfThereIsAnyRecipeOutputtingThis && !tThereWasARecipe) { + ArrayList tList = (ArrayList)CraftingManager.getInstance().getRecipeList(); + for (int i = 0; i < tList.size() && !tThereWasARecipe; i++) { + IRecipe tRecipe = tList.get(i); + if (sSpecialRecipeClasses.contains(tRecipe.getClass().getName())) continue; + if (GT_Utility.areStacksEqual(GT_OreDictUnificator.get(tRecipe.getRecipeOutput()), aResult, T)) { + tList.remove(i--); + tThereWasARecipe = T; + } + } + } + + if (Items.feather.getDamage(aResult) == W || Items.feather.getDamage(aResult) < 0) Items.feather.setDamage(aResult, 0); + + GT_Utility.updateItemStack(aResult); + + if (tThereWasARecipe || !aOnlyAddIfThereIsAnyRecipeOutputtingThis) { + if (sBufferCraftingRecipes && aBuffered) + sBufferRecipeList.add(new GT_Shaped_Recipe(GT_Utility.copy(aResult), aDismantleable, aRemovable, aKeepNBT, aEnchantmentsAdded, aEnchantmentLevelsAdded, aRecipe).setMirrored(aMirrored)); + else + GameRegistry.addRecipe(new GT_Shaped_Recipe(GT_Utility.copy(aResult), aDismantleable, aRemovable, aKeepNBT, aEnchantmentsAdded, aEnchantmentLevelsAdded, aRecipe).setMirrored(aMirrored)); + } + return T; + } + + /** + * Shapeless Crafting Recipes. Deletes conflicting Recipes too. + */ + public static boolean addShapelessEnchantingRecipe(ItemStack aResult, Enchantment[] aEnchantmentsAdded, int[] aEnchantmentLevelsAdded, Object[] aRecipe) { + return addShapelessCraftingRecipe(aResult, aEnchantmentsAdded, aEnchantmentLevelsAdded, T, F, F, F, aRecipe); + } + + /** + * Shapeless Crafting Recipes. Deletes conflicting Recipes too. + */ + public static boolean addShapelessCraftingRecipe(ItemStack aResult, Object[] aRecipe) { + return addShapelessCraftingRecipe(aResult, RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | RecipeBits.BUFFERED, aRecipe); + } + + /** + * Shapeless Crafting Recipes. Deletes conflicting Recipes too. + */ + public static boolean addShapelessCraftingRecipe(ItemStack aResult, long aBitMask, Object[] aRecipe) { + return addShapelessCraftingRecipe(aResult, new Enchantment[0], new int[0], (aBitMask & RecipeBits.BUFFERED) != 0, (aBitMask & RecipeBits.KEEPNBT) != 0, (aBitMask & RecipeBits.DISMANTLEABLE) != 0, (aBitMask & RecipeBits.NOT_REMOVABLE) == 0, aRecipe); + } + + /** + * Shapeless Crafting Recipes. Deletes conflicting Recipes too. + */ + private static boolean addShapelessCraftingRecipe(ItemStack aResult, Enchantment[] aEnchantmentsAdded, int[] aEnchantmentLevelsAdded, boolean aBuffered, boolean aKeepNBT, boolean aDismantleable, boolean aRemovable, Object[] aRecipe) { + aResult = GT_OreDictUnificator.get(T, aResult); + if (aRecipe == null || aRecipe.length <= 0) return F; + for (byte i = 0; i < aRecipe.length; i++) { + if (aRecipe[i] instanceof IItemContainer) + aRecipe[i] = ((IItemContainer)aRecipe[i]).get(1); + else if (aRecipe[i] instanceof Enum) + aRecipe[i] = ((Enum)aRecipe[i]).name(); + else if (!(aRecipe[i] == null || aRecipe[i] instanceof ItemStack || aRecipe[i] instanceof String || aRecipe[i] instanceof Character)) + aRecipe[i] = aRecipe[i].toString(); + } + try { + ItemStack[] tRecipe = new ItemStack[9]; + int i = 0; + for (Object tObject : aRecipe) { + if (tObject == null) { + if (D1) GT_Log.err.println("WARNING: Missing Item for shapeless Recipe: " + (aResult==null?"null":aResult.getDisplayName())); + for (Object tContent : aRecipe) GT_Log.err.println(tContent); + return F; + } + if (tObject instanceof ItemStack) { + tRecipe[i] = (ItemStack)tObject; + } else if (tObject instanceof String) { + tRecipe[i] = GT_OreDictUnificator.getFirstOre(tObject, 1); + if (tRecipe[i] == null) break; + } else if (tObject instanceof Boolean) { + // + } else { + throw new IllegalArgumentException(); + } + i++; + } + removeRecipe(tRecipe); + } catch(Throwable e) {e.printStackTrace(GT_Log.err);} + + if (aResult == null || aResult.stackSize <= 0) return F; + + if (Items.feather.getDamage(aResult) == W || Items.feather.getDamage(aResult) < 0) Items.feather.setDamage(aResult, 0); + + GT_Utility.updateItemStack(aResult); + + if (sBufferCraftingRecipes && aBuffered) + sBufferRecipeList.add(new GT_Shapeless_Recipe(GT_Utility.copy(aResult), aDismantleable, aRemovable, aKeepNBT, aEnchantmentsAdded, aEnchantmentLevelsAdded, aRecipe)); + else + GameRegistry.addRecipe(new GT_Shapeless_Recipe(GT_Utility.copy(aResult), aDismantleable, aRemovable, aKeepNBT, aEnchantmentsAdded, aEnchantmentLevelsAdded, aRecipe)); + return T; + } + + /** + * Removes a Smelting Recipe + */ + public static boolean removeFurnaceSmelting(ItemStack aInput) { + if (aInput != null) { + for (Object tInput : FurnaceRecipes.smelting().getSmeltingList().keySet()) { + if (GT_Utility.isStackValid(tInput) && GT_Utility.areStacksEqual(aInput, (ItemStack)tInput, T)) { + FurnaceRecipes.smelting().getSmeltingList().remove(tInput); + return T; + } + } + } + return F; + } + + /** + * Removes a Crafting Recipe and gives you the former output of it. + * @param aRecipe The content of the Crafting Grid as ItemStackArray with length 9 + * @return the output of the old Recipe or null if there was nothing. + */ + public static ItemStack removeRecipe(ItemStack... aRecipe) { + if (aRecipe == null) return null; + boolean temp = F; + for (byte i = 0; i < aRecipe.length; i++) { + if (aRecipe[i] != null) { + temp = T; + break; + } + } + if (!temp) return null; + ItemStack rReturn = null; + InventoryCrafting aCrafting = new InventoryCrafting(new Container() {@Override public boolean canInteractWith(EntityPlayer var1) {return F;}}, 3, 3); + for (int i = 0; i < aRecipe.length && i < 9; i++) aCrafting.setInventorySlotContents(i, aRecipe[i]); + ArrayList tList = (ArrayList)CraftingManager.getInstance().getRecipeList(); + for (int i = 0; i < tList.size(); i++) {try {for (; i < tList.size(); i++) { + if ((!(tList.get(i) instanceof IGT_CraftingRecipe) || ((IGT_CraftingRecipe)tList.get(i)).isRemovable()) && tList.get(i).matches(aCrafting, DW)) { + rReturn = tList.get(i).getCraftingResult(aCrafting); + if (rReturn != null) tList.remove(i--); + } + }} catch(Throwable e) {e.printStackTrace(GT_Log.err);}} + return rReturn; + } + + public static boolean removeRecipeByOutput(ItemStack aOutput) { + return removeRecipeByOutput(aOutput, T, F, F); + } + + public static Collection sNativeRecipeClasses = new HashSet(), sSpecialRecipeClasses = new HashSet(); + + static { + sNativeRecipeClasses.add(ShapedRecipes.class.getName()); + sNativeRecipeClasses.add(ShapedOreRecipe.class.getName()); + sNativeRecipeClasses.add(GT_Shaped_Recipe.class.getName()); + sNativeRecipeClasses.add(ShapelessRecipes.class.getName()); + sNativeRecipeClasses.add(ShapelessOreRecipe.class.getName()); + sNativeRecipeClasses.add(GT_Shapeless_Recipe.class.getName()); + sNativeRecipeClasses.add(ic2.core.AdvRecipe.class.getName()); + sNativeRecipeClasses.add(ic2.core.AdvShapelessRecipe.class.getName()); + sNativeRecipeClasses.add("appeng.recipes.game.ShapedRecipe"); + sNativeRecipeClasses.add("appeng.recipes.game.ShapelessRecipe"); + sNativeRecipeClasses.add("forestry.core.utils.ShapedRecipeCustom"); + + // Recipe Classes, which should never be removed. + sSpecialRecipeClasses.add(net.minecraft.item.crafting.RecipeFireworks.class.getName()); + sSpecialRecipeClasses.add(net.minecraft.item.crafting.RecipesArmorDyes.class.getName()); + sSpecialRecipeClasses.add(net.minecraft.item.crafting.RecipeBookCloning.class.getName()); + sSpecialRecipeClasses.add(net.minecraft.item.crafting.RecipesMapCloning.class.getName()); + sSpecialRecipeClasses.add(net.minecraft.item.crafting.RecipesMapExtending.class.getName()); + sSpecialRecipeClasses.add("jds.bibliocraft.BiblioSpecialRecipes"); + sSpecialRecipeClasses.add("dan200.qcraft.shared.EntangledQBlockRecipe"); + sSpecialRecipeClasses.add("dan200.qcraft.shared.EntangledQuantumComputerRecipe"); + sSpecialRecipeClasses.add("dan200.qcraft.shared.QBlockRecipe"); + sSpecialRecipeClasses.add("appeng.recipes.game.FacadeRecipe"); + sSpecialRecipeClasses.add("appeng.recipes.game.DisassembleRecipe"); + sSpecialRecipeClasses.add("mods.railcraft.common.carts.LocomotivePaintingRecipe"); + sSpecialRecipeClasses.add("mods.railcraft.common.util.crafting.RotorRepairRecipe"); + sSpecialRecipeClasses.add("mods.railcraft.common.util.crafting.RoutingTableCopyRecipe"); + sSpecialRecipeClasses.add("mods.railcraft.common.util.crafting.RoutingTicketCopyRecipe"); + sSpecialRecipeClasses.add("mods.railcraft.common.util.crafting.TankCartFilterRecipe"); + sSpecialRecipeClasses.add("mods.railcraft.common.emblems.LocomotiveEmblemRecipe"); + sSpecialRecipeClasses.add("mods.railcraft.common.emblems.EmblemPostColorRecipe"); + sSpecialRecipeClasses.add("mods.railcraft.common.emblems.EmblemPostEmblemRecipe"); + sSpecialRecipeClasses.add("mods.immibis.redlogic.interaction.RecipeDyeLumarButton"); + sSpecialRecipeClasses.add("thaumcraft.common.items.armor.RecipesRobeArmorDyes"); + sSpecialRecipeClasses.add("thaumcraft.common.items.armor.RecipesVoidRobeArmorDyes"); + sSpecialRecipeClasses.add("thaumcraft.common.lib.crafting.ShapelessNBTOreRecipe"); + sSpecialRecipeClasses.add("twilightforest.item.TFMapCloningRecipe"); + sSpecialRecipeClasses.add("forestry.lepidopterology.MatingRecipe"); + sSpecialRecipeClasses.add("micdoodle8.mods.galacticraft.planets.asteroids.recipe.CanisterRecipes"); + sSpecialRecipeClasses.add("shedar.mods.ic2.nuclearcontrol.StorageArrayRecipe"); + } + + /** + * Removes a Crafting Recipe. + * @param aOutput The output of the Recipe. + * @return if it has removed at least one Recipe. + */ + public static boolean removeRecipeByOutput(ItemStack aOutput, boolean aIgnoreNBT, boolean aNotRemoveShapelessRecipes, boolean aOnlyRemoveNativeHandlers) { + if (aOutput == null) return F; + boolean rReturn = F; + ArrayList tList = (ArrayList)CraftingManager.getInstance().getRecipeList(); + aOutput = GT_OreDictUnificator.get(aOutput); + for (int i = 0; i < tList.size(); i++) { + IRecipe tRecipe = tList.get(i); + if (aNotRemoveShapelessRecipes && (tRecipe instanceof ShapelessRecipes || tRecipe instanceof ShapelessOreRecipe)) continue; + if (aOnlyRemoveNativeHandlers) { + if (!sNativeRecipeClasses.contains(tRecipe.getClass().getName())) continue; + } else { + if (sSpecialRecipeClasses.contains(tRecipe.getClass().getName())) continue; + } + ItemStack tStack = tRecipe.getRecipeOutput(); + if ((!(tRecipe instanceof IGT_CraftingRecipe) || ((IGT_CraftingRecipe)tRecipe).isRemovable()) && GT_Utility.areStacksEqual(GT_OreDictUnificator.get(tStack), aOutput, aIgnoreNBT)) { + tList.remove(i--); + rReturn = T; + } + } + return rReturn; + } + + /** + * Checks all Crafting Handlers for Recipe Output + * Used for the Autocrafting Table + */ + public static ItemStack getAllRecipeOutput(World aWorld, ItemStack... aRecipe) { + if (aRecipe == null || aRecipe.length == 0) return null; + + if (aWorld == null) aWorld = DW; + + boolean temp = F; + for (byte i = 0; i < aRecipe.length; i++) { + if (aRecipe[i] != null) { + temp = T; + break; + } + } + if (!temp) return null; + InventoryCrafting aCrafting = new InventoryCrafting(new Container() {@Override public boolean canInteractWith(EntityPlayer var1) {return F;}}, 3, 3); + for (int i = 0; i < 9 && i < aRecipe.length; i++) aCrafting.setInventorySlotContents(i, aRecipe[i]); + List tList = CraftingManager.getInstance().getRecipeList(); + synchronized(sAllRecipeList) { + if (sAllRecipeList.size() != tList.size()) { + sAllRecipeList.clear(); + sAllRecipeList.addAll(tList); + } + for (int i = 0, j = sAllRecipeList.size(); i < j; i++) { + IRecipe tRecipe = sAllRecipeList.get(i); + if (tRecipe.matches(aCrafting, aWorld)) { + if (i > 10) { + sAllRecipeList.remove(i); + sAllRecipeList.add(i-10, tRecipe); + } + return tRecipe.getCraftingResult(aCrafting); + } + } + } + + int tIndex = 0; + ItemStack tStack1 = null, tStack2 = null; + for (int i = 0, j = aCrafting.getSizeInventory(); i < j; i++) { + ItemStack tStack = aCrafting.getStackInSlot(i); + if (tStack != null) { + if (tIndex == 0) tStack1 = tStack; + if (tIndex == 1) tStack2 = tStack; + tIndex++; + } + } + + if (tIndex == 2) { + assert tStack1 != null && tStack2 != null; + if (tStack1.getItem() == tStack2.getItem() && tStack1.stackSize == 1 && tStack2.stackSize == 1 && tStack1.getItem().isRepairable()) { + int tNewDamage = tStack1.getMaxDamage() + tStack1.getItemDamage() - tStack2.getItemDamage() + tStack1.getMaxDamage() / 20; + return new ItemStack(tStack1.getItem(), 1, tNewDamage<0?0:tNewDamage); + } + } + + return null; + } + + /** + * Gives you a copy of the Output from a Crafting Recipe + * Used for Recipe Detection. + */ + public static ItemStack getRecipeOutput(ItemStack... aRecipe) { + return getRecipeOutput(F, aRecipe); + } + + /** + * Gives you a copy of the Output from a Crafting Recipe + * Used for Recipe Detection. + */ + public static ItemStack getRecipeOutput(boolean aUncopiedStack, ItemStack... aRecipe) { + if (aRecipe == null) return null; + boolean temp = F; + for (byte i = 0; i < aRecipe.length; i++) { + if (aRecipe[i] != null) { + temp = T; + break; + } + } + if (!temp) return null; + InventoryCrafting aCrafting = new InventoryCrafting(new Container() {@Override public boolean canInteractWith(EntityPlayer var1) {return F;}}, 3, 3); + for (int i = 0; i < 9 && i < aRecipe.length; i++) aCrafting.setInventorySlotContents(i, aRecipe[i]); + ArrayList tList = (ArrayList)CraftingManager.getInstance().getRecipeList(); + for (int i = 0; i < tList.size(); i++) {temp = F; + try { + temp = tList.get(i).matches(aCrafting, DW); + } catch(Throwable e) {e.printStackTrace(GT_Log.err);} + if (temp) { + ItemStack tOutput = aUncopiedStack?tList.get(i).getRecipeOutput():tList.get(i).getCraftingResult(aCrafting); + if (tOutput == null || tOutput.stackSize <= 0) { + // Seriously, who would ever do that shit? + if (!GregTech_API.sPostloadFinished) throw new GT_ItsNotMyFaultException("Seems another Mod added a Crafting Recipe with null Output. Tell the Developer of said Mod to fix that."); + } else { + if (aUncopiedStack) return tOutput; + return GT_Utility.copy(tOutput); + } + } + } + return null; + } + + public static GT_HashSet sNonReplaceableItems = new GT_HashSet(); + + /** + * Gives you a list of the Outputs from a Crafting Recipe + * If you have multiple Mods, which add Bronze Armor for example + * This also removes old Recipes from the List. + */ + public static ArrayList getVanillyToolRecipeOutputs(ItemStack... aRecipe) { + if (!GregTech_API.sPostloadStarted || GregTech_API.sPostloadFinished) sSingleNonBlockDamagableRecipeList.clear(); + if (sSingleNonBlockDamagableRecipeList.isEmpty()) { + for (IRecipe tRecipe : (ArrayList)CraftingManager.getInstance().getRecipeList()) { + ItemStack tStack = tRecipe.getRecipeOutput(); + if (GT_Utility.isStackValid(tStack) && tStack.getMaxStackSize() == 1 && tStack.getMaxDamage() > 0 && !(tStack.getItem() instanceof ItemBlock) && !(tStack.getItem() instanceof IReactorComponent) && !isElectricItem(tStack) && !GT_Utility.isStackInList(tStack, sNonReplaceableItems)) { + if (!(tRecipe instanceof ShapelessRecipes || tRecipe instanceof ShapelessOreRecipe)) { + if (tRecipe instanceof ShapedOreRecipe) { + boolean temp = T; + for (Object tObject : ((ShapedOreRecipe)tRecipe).getInput()) if (tObject != null) { + if (tObject instanceof ItemStack && (((ItemStack)tObject).getItem() == null || ((ItemStack)tObject).getMaxStackSize() < 2 || ((ItemStack)tObject).getMaxDamage() > 0 || ((ItemStack)tObject).getItem() instanceof ItemBlock)) { + temp = F; + break; + } + if (tObject instanceof List && ((List)tObject).isEmpty()) { + temp = F; + break; + } + } + if (temp) sSingleNonBlockDamagableRecipeList.add(tRecipe); + } else if (tRecipe instanceof ShapedRecipes) { + boolean temp = T; + for (ItemStack tObject : ((ShapedRecipes)tRecipe).recipeItems) { + if (tObject != null && (tObject.getItem() == null || tObject.getMaxStackSize() < 2 || tObject.getMaxDamage() > 0 || tObject.getItem() instanceof ItemBlock)) { + temp = F; + break; + } + } + if (temp) sSingleNonBlockDamagableRecipeList.add(tRecipe); + } else { + sSingleNonBlockDamagableRecipeList.add(tRecipe); + } + } + } + } + GT_Log.out.println("GT_Mod: Created a List of Tool Recipes containing " + sSingleNonBlockDamagableRecipeList.size() + " Recipes for recycling." + (sSingleNonBlockDamagableRecipeList.size()>1024?" Scanning all these Recipes is the reason for the startup Lag you receive right now.":E)); + } + ArrayList rList = getRecipeOutputs(sSingleNonBlockDamagableRecipeList, T, aRecipe); + if (!GregTech_API.sPostloadStarted || GregTech_API.sPostloadFinished) sSingleNonBlockDamagableRecipeList.clear(); + return rList; + } + + /** + * Gives you a list of the Outputs from a Crafting Recipe + * If you have multiple Mods, which add Bronze Armor for example + */ + public static ArrayList getRecipeOutputs(ItemStack... aRecipe) { + return getRecipeOutputs(CraftingManager.getInstance().getRecipeList(), F, aRecipe); + } + + /** + * Gives you a list of the Outputs from a Crafting Recipe + * If you have multiple Mods, which add Bronze Armor for example + */ + public static ArrayList getRecipeOutputs(List aList, boolean aDeleteFromList, ItemStack... aRecipe) { + ArrayList rList = new ArrayList(); + if (aRecipe == null) return rList; + boolean temp = F; + for (byte i = 0; i < aRecipe.length; i++) { + if (aRecipe[i] != null) { + temp = T; + break; + } + } + if (!temp) return rList; + InventoryCrafting aCrafting = new InventoryCrafting(new Container() {@Override + public boolean canInteractWith(EntityPlayer var1) {return F;}}, 3, 3); + for (int i = 0; i < 9 && i < aRecipe.length; i++) aCrafting.setInventorySlotContents(i, aRecipe[i]); + for (int i = 0; i < aList.size(); i++) { + temp = F; + try { + temp = aList.get(i).matches(aCrafting, DW); + } catch(Throwable e) {e.printStackTrace(GT_Log.err);} + if (temp) { + ItemStack tOutput = aList.get(i).getCraftingResult(aCrafting); + if (tOutput == null || tOutput.stackSize <= 0) { + // Seriously, who would ever do that shit? + if (!GregTech_API.sPostloadFinished) throw new GT_ItsNotMyFaultException("Seems another Mod added a Crafting Recipe with null Output. Tell the Developer of said Mod to fix that."); + } else { + rList.add(GT_Utility.copy(tOutput)); + if (aDeleteFromList) aList.remove(i--); + } + } + } + return rList; + } + + /** + * Used in my own Macerator. Decreases StackSize of the Input if wanted. + */ + public static ItemStack getMaceratorOutput(ItemStack aInput, boolean aRemoveInput, ItemStack aOutputSlot) { + return GT_Utility.copy(getMachineOutput(aInput, getMaceratorRecipeList(), aRemoveInput, new NBTTagCompound(), aOutputSlot)[0]); + } + + /** + * Used in my own Extractor. Decreases StackSize of the Input if wanted. + */ + public static ItemStack getExtractorOutput(ItemStack aInput, boolean aRemoveInput, ItemStack aOutputSlot) { + return GT_Utility.copy(getMachineOutput(aInput, getExtractorRecipeList(), aRemoveInput, new NBTTagCompound(), aOutputSlot)[0]); + } + + /** + * Used in my own Compressor. Decreases StackSize of the Input if wanted. + */ + public static ItemStack getCompressorOutput(ItemStack aInput, boolean aRemoveInput, ItemStack aOutputSlot) { + return GT_Utility.copy(getMachineOutput(aInput, getCompressorRecipeList(), aRemoveInput, new NBTTagCompound(), aOutputSlot)[0]); + } + + /** + * Used in my own Furnace. + */ + public static ItemStack getSmeltingOutput(ItemStack aInput, boolean aRemoveInput, ItemStack aOutputSlot) { + if (aInput == null || aInput.stackSize < 1) return null; + ItemStack rStack = GT_OreDictUnificator.get(FurnaceRecipes.smelting().getSmeltingResult(aInput)); + if (rStack != null && (aOutputSlot == null || (GT_Utility.areStacksEqual(rStack, aOutputSlot) && rStack.stackSize + aOutputSlot.stackSize <= aOutputSlot.getMaxStackSize()))) { + if (aRemoveInput) aInput.stackSize--; + return rStack; + } + return null; + } + + /** + * Used in my own Machines. Decreases StackSize of the Input if wanted. + * + * Checks also if there is enough Space in the Output Slots. + */ + public static ItemStack[] getMachineOutput(ItemStack aInput, Map aRecipeList, boolean aRemoveInput, NBTTagCompound rRecipeMetaData, ItemStack... aOutputSlots) { + if (aOutputSlots == null || aOutputSlots.length <= 0) return new ItemStack[0]; + if (aInput == null) return new ItemStack[aOutputSlots.length]; + try { + for (Entry tEntry : aRecipeList.entrySet()) { + if (tEntry.getKey().matches(aInput)) { + if (tEntry.getKey().getAmount() <= aInput.stackSize) { + ItemStack[] tList = (ItemStack[])tEntry.getValue().items.toArray(); + if (tList.length == 0) break; + ItemStack[] rList = new ItemStack[aOutputSlots.length]; + rRecipeMetaData.setTag("return", tEntry.getValue().metadata); + for (byte i = 0; i < aOutputSlots.length && i < tList.length; i++) { + if (tList[i] != null) { + if (aOutputSlots[i] == null || (GT_Utility.areStacksEqual(tList[i], aOutputSlots[i]) && tList[i].stackSize + aOutputSlots[i].stackSize <= aOutputSlots[i].getMaxStackSize())) { + rList[i] = GT_Utility.copy(tList[i]); + } else { + return new ItemStack[aOutputSlots.length]; + } + } + } + + if (aRemoveInput) aInput.stackSize-=tEntry.getKey().getAmount(); + return rList; + } + break; + } + } + } catch(Throwable e) { + if (D1) e.printStackTrace(GT_Log.err); + } + return new ItemStack[aOutputSlots.length]; + } + + /** + * Used in my own Recycler. + * + * Only produces Scrap if aScrapChance == 0. aScrapChance is usually the random Number I give to the Function + * If you directly insert 0 as aScrapChance then you can check if its Recycler-Blacklisted or similar + */ + public static ItemStack getRecyclerOutput(ItemStack aInput, int aScrapChance) { + if (aInput == null || aScrapChance != 0) return null; + try { + if (ic2.api.recipe.Recipes.recyclerWhitelist.isEmpty()) return ic2.api.recipe.Recipes.recyclerBlacklist.contains(aInput)?null:ItemList.IC2_Scrap.get(1); + return ic2.api.recipe.Recipes.recyclerWhitelist.contains(aInput)?ItemList.IC2_Scrap.get(1):null; + } catch (Throwable e) {/*Do nothing*/} + try { + return ic2.api.recipe.Recipes.recyclerBlacklist.contains(aInput)?null:ItemList.IC2_Scrap.get(1); + } catch (Throwable e) {/*Do nothing*/} + return null; + } + + /** + * For the Scrapboxinator + */ + public static ItemStack getRandomScrapboxDrop() { + return ic2.api.recipe.Recipes.scrapboxDrops.getDrop(ItemList.IC2_Scrapbox.get(1), F); + } + + /** + * Charges an Electric Item. Only if it's a valid Electric Item of course. + * This forces the Usage of proper Voltages (so not the transfer limits defined by the Items) unless you ignore the Transfer Limit. + * If aTier is Integer.MAX_VALUE it will ignore Tier based Limitations. + * @return the actually used Energy. + */ + public static int chargeElectricItem(ItemStack aStack, int aCharge, int aTier, boolean aIgnoreLimit, boolean aSimulate) { + try { + if (isElectricItem(aStack)) { + int tTier = ((ic2.api.item.IElectricItem)aStack.getItem()).getTier(aStack); + if (tTier < 0 || tTier == aTier || aTier == Integer.MAX_VALUE) { + if (!aIgnoreLimit && tTier >= 0) aCharge = (int)Math.min(aCharge, V[Math.max(0, Math.min(V.length-1, tTier))]); + if (aCharge > 0) { + int rCharge = (int)Math.max(0.0, ic2.api.item.ElectricItem.manager.charge(aStack, aCharge, tTier, T, aSimulate)); + return rCharge + (rCharge * 4 > aTier ? aTier : 0); + } + } + } + } catch (Throwable e) {/*Do nothing*/} + return 0; + } + + /** + * Discharges an Electric Item. Only if it's a valid Electric Item for that of course. + * This forces the Usage of proper Voltages (so not the transfer limits defined by the Items) unless you ignore the Transfer Limit. + * If aTier is Integer.MAX_VALUE it will ignore Tier based Limitations. + * @return the Energy got from the Item. + */ + public static int dischargeElectricItem(ItemStack aStack, int aCharge, int aTier, boolean aIgnoreLimit, boolean aSimulate, boolean aIgnoreDischargability) { + try { +// if (isElectricItem(aStack) && (aIgnoreDischargability || ((ic2.api.item.IElectricItem)aStack.getItem()).canProvideEnergy(aStack))) { + if (isElectricItem(aStack)) { + int tTier = ((ic2.api.item.IElectricItem)aStack.getItem()).getTier(aStack); + if (tTier < 0 || tTier == aTier || aTier == Integer.MAX_VALUE) { + if (!aIgnoreLimit && tTier >= 0) aCharge = (int)Math.min(aCharge, V[Math.max(0, Math.min(V.length-1, tTier))]); + if (aCharge > 0) { +// int rCharge = Math.max(0, ic2.api.item.ElectricItem.manager.discharge(aStack, aCharge + (aCharge * 4 > aTier ? aTier : 0), tTier, T, aSimulate)); + int rCharge = (int)Math.max(0, ic2.api.item.ElectricItem.manager.discharge(aStack, aCharge + (aCharge * 4 > aTier ? aTier : 0), tTier, T, !aIgnoreDischargability, aSimulate)); + return rCharge - (rCharge * 4 > aTier ? aTier : 0); + } + } + } + } catch (Throwable e) {/*Do nothing*/} + return 0; + } + + /** + * Uses an Electric Item. Only if it's a valid Electric Item for that of course. + * @return if the action was successful + */ + public static boolean canUseElectricItem(ItemStack aStack, int aCharge) { + try { + if (isElectricItem(aStack)) { + return ic2.api.item.ElectricItem.manager.canUse(aStack, aCharge); + } + } catch (Throwable e) {/*Do nothing*/} + return F; + } + + /** + * Uses an Electric Item. Only if it's a valid Electric Item for that of course. + * @return if the action was successful + */ + public static boolean useElectricItem(ItemStack aStack, int aCharge, EntityPlayer aPlayer) { + try { + if (isElectricItem(aStack)) { + ic2.api.item.ElectricItem.manager.use(aStack, 0, aPlayer); + if (ic2.api.item.ElectricItem.manager.canUse(aStack, aCharge)) { + return ic2.api.item.ElectricItem.manager.use(aStack, aCharge, aPlayer); + } + } + } catch (Throwable e) {/*Do nothing*/} + return F; + } + + /** + * Uses an Item. Tries to discharge in case of Electric Items + */ + public static boolean damageOrDechargeItem(ItemStack aStack, int aDamage, int aDecharge, EntityLivingBase aPlayer) { + if (GT_Utility.isStackInvalid(aStack) || (aStack.getMaxStackSize() <= 1 && aStack.stackSize > 1)) return F; + if (aPlayer != null && aPlayer instanceof EntityPlayer && ((EntityPlayer)aPlayer).capabilities.isCreativeMode) return T; + if (aStack.getItem() instanceof IDamagableItem) { + return ((IDamagableItem)aStack.getItem()).doDamageToItem(aStack, aDamage); + } else if (GT_ModHandler.isElectricItem(aStack)) { + if (canUseElectricItem(aStack, aDecharge)) { + if (aPlayer != null && aPlayer instanceof EntityPlayer) { + return GT_ModHandler.useElectricItem(aStack, aDecharge, (EntityPlayer)aPlayer); + } + return GT_ModHandler.dischargeElectricItem(aStack, aDecharge, Integer.MAX_VALUE, T, F, T) >= aDecharge; + } + } else if (aStack.getItem().isDamageable()) { + if (aPlayer == null) { + aStack.setItemDamage(aStack.getItemDamage() + aDamage); + } else { + aStack.damageItem(aDamage, aPlayer); + } + if (aStack.getItemDamage() >= aStack.getMaxDamage()) { + aStack.setItemDamage(aStack.getMaxDamage()+1); + ItemStack tStack = GT_Utility.getContainerItem(aStack, T); + if (tStack != null) { + aStack.func_150996_a(tStack.getItem()); + aStack.setItemDamage(tStack.getItemDamage()); + aStack.stackSize = tStack.stackSize; + aStack.setTagCompound(tStack.getTagCompound()); + } + } + return T; + } + return F; + } + + /** + * Uses a Soldering Iron + */ + public static boolean useSolderingIron(ItemStack aStack, EntityLivingBase aPlayer) { + if (aPlayer == null || aStack == null) return F; + if (GT_Utility.isStackInList(aStack, GregTech_API.sSolderingToolList)) { + if (aPlayer instanceof EntityPlayer) { + EntityPlayer tPlayer = (EntityPlayer)aPlayer; + if (tPlayer.capabilities.isCreativeMode) return T; + System.out.println("hier"); + for (int i = 0; i < tPlayer.inventory.mainInventory.length; i++) { + if (GT_Utility.isStackInList(tPlayer.inventory.mainInventory[i], GregTech_API.sSolderingMetalList)) { + tPlayer.inventory.mainInventory[i].stackSize--; + if (tPlayer.inventoryContainer != null) tPlayer.inventoryContainer.detectAndSendChanges(); + if (canUseElectricItem(aStack, 10000)) { + return GT_ModHandler.useElectricItem(aStack, 10000, (EntityPlayer)aPlayer); + } + } + } + } else { + damageOrDechargeItem(aStack, 1, 1000, aPlayer); + return T; + } + } + return F; + } + + /** + * Is this an electric Item, which can charge other Items? + */ + public static boolean isChargerItem(ItemStack aStack) { + try { + if (isElectricItem(aStack)) { + return ((ic2.api.item.IElectricItem)aStack.getItem()).canProvideEnergy(aStack); + } + } catch (Throwable e) {/*Do nothing*/} + return F; + } + + /** + * Is this an electric Item? + */ + public static boolean isElectricItem(ItemStack aStack) { + try { + return aStack != null && aStack.getItem() instanceof ic2.api.item.IElectricItem && ((IElectricItem)aStack.getItem()).getTier(aStack) < Integer.MAX_VALUE; + } catch (Throwable e) {/*Do nothing*/} + return F; + } + + public static boolean isElectricItem(ItemStack aStack, byte aTier) { + try { + return aStack != null && aStack.getItem() instanceof ic2.api.item.IElectricItem && ((IElectricItem)aStack.getItem()).getTier(aStack) == aTier; + } catch (Throwable e) {/*Do nothing*/} + return F; + } + + public static Object sBoxableWrapper = GT_Utility.callConstructor("gregtechmod.api.util.GT_IBoxableWrapper", 0, null, F); + + public static void registerBoxableItemToToolBox(ItemStack aStack) { + if (aStack != null) registerBoxableItemToToolBox(aStack.getItem()); + } + + public static void registerBoxableItemToToolBox(Item aItem) { + if (aItem != null && sBoxableWrapper != null) { + try { + ic2.api.item.ItemWrapper.registerBoxable(aItem, (IBoxable)sBoxableWrapper); + } catch(Throwable e) {/*Do nothing*/} + } + } + + public static int getCapsuleCellContainerCountMultipliedWithStackSize(ItemStack... aStacks) { + int rAmount = 0; + for (ItemStack tStack : aStacks) if (tStack != null) rAmount += getCapsuleCellContainerCount(tStack) * tStack.stackSize; + return rAmount; + } + + public static int getCapsuleCellContainerCount(ItemStack aStack) { + if (aStack == null) return 0; + return GT_Utility.areStacksEqual(GT_Utility.getContainerForFilledItem(aStack, T), ItemList.Cell_Empty.get(1)) || OrePrefixes.cell.contains(aStack) || OrePrefixes.cellPlasma.contains(aStack) || GT_Utility.areStacksEqual(aStack, getIC2Item("waterCell", 1, W)) ? 1 : 0; + } + + /** + * Copy of the original Helper Class of Thermal Expansion, just to make sure it works even when other Mods include TE-APIs + */ + public static class ThermalExpansion { + public static void addFurnaceRecipe(int energy, ItemStack input, ItemStack output) { + NBTTagCompound toSend = new NBTTagCompound(); + toSend.setInteger("energy", energy); + toSend.setTag("input", new NBTTagCompound()); + toSend.setTag("output", new NBTTagCompound()); + input.writeToNBT(toSend.getCompoundTag("input")); + output.writeToNBT(toSend.getCompoundTag("output")); + FMLInterModComms.sendMessage("ThermalExpansion", "FurnaceRecipe", toSend); + } + + public static void addPulverizerRecipe(int energy, ItemStack input, ItemStack primaryOutput) { + addPulverizerRecipe(energy, input, primaryOutput, null, 0); + } + + public static void addPulverizerRecipe(int energy, ItemStack input, ItemStack primaryOutput, ItemStack secondaryOutput) { + addPulverizerRecipe(energy, input, primaryOutput, secondaryOutput, 100); + } + + public static void addPulverizerRecipe(int energy, ItemStack input, ItemStack primaryOutput, ItemStack secondaryOutput, int secondaryChance) { + if (input == null || primaryOutput == null) return; + NBTTagCompound toSend = new NBTTagCompound(); + toSend.setInteger("energy", energy); + toSend.setTag("input", new NBTTagCompound()); + toSend.setTag("primaryOutput", new NBTTagCompound()); + toSend.setTag("secondaryOutput", new NBTTagCompound()); + input.writeToNBT(toSend.getCompoundTag("input")); + primaryOutput.writeToNBT(toSend.getCompoundTag("primaryOutput")); + if (secondaryOutput != null) secondaryOutput.writeToNBT(toSend.getCompoundTag("secondaryOutput")); + toSend.setInteger("secondaryChance", secondaryChance); + FMLInterModComms.sendMessage("ThermalExpansion", "PulverizerRecipe", toSend); + } + + public static void addSawmillRecipe(int energy, ItemStack input, ItemStack primaryOutput) { + addSawmillRecipe(energy, input, primaryOutput, null, 0); + } + + public static void addSawmillRecipe(int energy, ItemStack input, ItemStack primaryOutput, ItemStack secondaryOutput) { + addSawmillRecipe(energy, input, primaryOutput, secondaryOutput, 100); + } + + public static void addSawmillRecipe(int energy, ItemStack input, ItemStack primaryOutput, ItemStack secondaryOutput, int secondaryChance) { + if (input == null || primaryOutput == null) return; + NBTTagCompound toSend = new NBTTagCompound(); + toSend.setInteger("energy", energy); + toSend.setTag("input", new NBTTagCompound()); + toSend.setTag("primaryOutput", new NBTTagCompound()); + toSend.setTag("secondaryOutput", new NBTTagCompound()); + input.writeToNBT(toSend.getCompoundTag("input")); + primaryOutput.writeToNBT(toSend.getCompoundTag("primaryOutput")); + if (secondaryOutput != null) secondaryOutput.writeToNBT(toSend.getCompoundTag("secondaryOutput")); + toSend.setInteger("secondaryChance", secondaryChance); + FMLInterModComms.sendMessage("ThermalExpansion", "SawmillRecipe", toSend); + } + + public static void addSmelterRecipe(int energy, ItemStack primaryInput, ItemStack secondaryInput, ItemStack primaryOutput) { + addSmelterRecipe(energy, primaryInput, secondaryInput, primaryOutput, null, 0); + } + + public static void addSmelterRecipe(int energy, ItemStack primaryInput, ItemStack secondaryInput, ItemStack primaryOutput, ItemStack secondaryOutput) { + addSmelterRecipe(energy, primaryInput, secondaryInput, primaryOutput, secondaryOutput, 100); + } + + public static void addSmelterRecipe(int energy, ItemStack primaryInput, ItemStack secondaryInput, ItemStack primaryOutput, ItemStack secondaryOutput, int secondaryChance) { + if (primaryInput == null || secondaryInput == null || primaryOutput == null) return; + NBTTagCompound toSend = new NBTTagCompound(); + toSend.setInteger("energy", energy); + toSend.setTag("primaryInput", new NBTTagCompound()); + toSend.setTag("secondaryInput", new NBTTagCompound()); + toSend.setTag("primaryOutput", new NBTTagCompound()); + toSend.setTag("secondaryOutput", new NBTTagCompound()); + primaryInput.writeToNBT(toSend.getCompoundTag("primaryInput")); + secondaryInput.writeToNBT(toSend.getCompoundTag("secondaryInput")); + primaryOutput.writeToNBT(toSend.getCompoundTag("primaryOutput")); + if (secondaryOutput != null) secondaryOutput.writeToNBT(toSend.getCompoundTag("secondaryOutput")); + toSend.setInteger("secondaryChance", secondaryChance); + FMLInterModComms.sendMessage("ThermalExpansion", "SmelterRecipe", toSend); + } + + public static void addSmelterBlastOre(Materials aMaterial) { + NBTTagCompound toSend = new NBTTagCompound(); + toSend.setString("oreType", aMaterial.toString()); + FMLInterModComms.sendMessage("ThermalExpansion", "SmelterBlastOreType", toSend); + } + + public static void addCrucibleRecipe(int energy, ItemStack input, FluidStack output) { + if (input == null || output == null) return; + NBTTagCompound toSend = new NBTTagCompound(); + toSend.setInteger("energy", energy); + toSend.setTag("input", new NBTTagCompound()); + toSend.setTag("output", new NBTTagCompound()); + input.writeToNBT(toSend.getCompoundTag("input")); + output.writeToNBT(toSend.getCompoundTag("output")); + FMLInterModComms.sendMessage("ThermalExpansion", "CrucibleRecipe", toSend); + } + + public static void addTransposerFill(int energy, ItemStack input, ItemStack output, FluidStack fluid, boolean reversible) { + if (input == null || output == null || fluid == null) return; + NBTTagCompound toSend = new NBTTagCompound(); + toSend.setInteger("energy", energy); + toSend.setTag("input", new NBTTagCompound()); + toSend.setTag("output", new NBTTagCompound()); + toSend.setTag("fluid", new NBTTagCompound()); + input.writeToNBT(toSend.getCompoundTag("input")); + output.writeToNBT(toSend.getCompoundTag("output")); + toSend.setBoolean("reversible", reversible); + fluid.writeToNBT(toSend.getCompoundTag("fluid")); + FMLInterModComms.sendMessage("ThermalExpansion", "TransposerFillRecipe", toSend); + } + + public static void addTransposerExtract(int energy, ItemStack input, ItemStack output, FluidStack fluid, int chance, boolean reversible) { + if (input == null || output == null || fluid == null) return; + NBTTagCompound toSend = new NBTTagCompound(); + toSend.setInteger("energy", energy); + toSend.setTag("input", new NBTTagCompound()); + toSend.setTag("output", new NBTTagCompound()); + toSend.setTag("fluid", new NBTTagCompound()); + input.writeToNBT(toSend.getCompoundTag("input")); + output.writeToNBT(toSend.getCompoundTag("output")); + toSend.setBoolean("reversible", reversible); + toSend.setInteger("chance", chance); + fluid.writeToNBT(toSend.getCompoundTag("fluid")); + FMLInterModComms.sendMessage("ThermalExpansion", "TransposerExtractRecipe", toSend); + } + + public static void addMagmaticFuel(String fluidName, int energy) { + NBTTagCompound toSend = new NBTTagCompound(); + toSend.setString("fluidName", fluidName); + toSend.setInteger("energy", energy); + FMLInterModComms.sendMessage("ThermalExpansion", "MagmaticFuel", toSend); + } + + public static void addCompressionFuel(String fluidName, int energy) { + NBTTagCompound toSend = new NBTTagCompound(); + toSend.setString("fluidName", fluidName); + toSend.setInteger("energy", energy); + FMLInterModComms.sendMessage("ThermalExpansion", "CompressionFuel", toSend); + } + + public static void addCoolant(String fluidName, int energy) { + NBTTagCompound toSend = new NBTTagCompound(); + toSend.setString("fluidName", fluidName); + toSend.setInteger("energy", energy); + FMLInterModComms.sendMessage("ThermalExpansion", "Coolant", toSend); + } + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/util/GT_OreDictUnificator.java b/src/main/java/gregtech/api/util/GT_OreDictUnificator.java new file mode 100644 index 0000000..a108df1 --- /dev/null +++ b/src/main/java/gregtech/api/util/GT_OreDictUnificator.java @@ -0,0 +1,332 @@ +package gregtech.api.util; + +import static gregtech.api.enums.GT_Values.E; +import static gregtech.api.enums.GT_Values.M; +import static gregtech.api.enums.GT_Values.W; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map.Entry; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.Dyes; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.SubTag; +import gregtech.api.objects.GT_HashSet; +import gregtech.api.objects.GT_ItemStack; +import gregtech.api.objects.ItemData; +import gregtech.api.objects.MaterialStack; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; + +/** + * NEVER INCLUDE THIS FILE IN YOUR MOD!!! + * + * This is the Core of my OreDict Unification Code + * + * If you just want to use this to unificate your Items, then use the Function in the GregTech_API File + * + * P.S. It is intended to be named "Unificator" and not "Unifier", because that sounds more awesome. + */ +public class GT_OreDictUnificator { + public static volatile int VERSION = 508; + + private static final HashMap sName2StackMap = new HashMap(); + private static final HashMap sItemStack2DataMap = new HashMap(); + private static final GT_HashSet sNoUnificationList = new GT_HashSet(); + + private static int isRegisteringOre = 0, isAddingOre = 0; + + static { + GregTech_API.sItemStackMappings.add(sItemStack2DataMap); + } + + /** + * The Blacklist just prevents the Item from being unificated into something else. + * Useful if you have things like the Industrial Diamond, which is better than regular Diamond, but also usable in absolutely all Diamond Recipes. + */ + public static void addToBlacklist(ItemStack aStack) { + if (GT_Utility.isStackValid(aStack) && !GT_Utility.isStackInList(aStack, sNoUnificationList)) sNoUnificationList.add(aStack); + } + + public static boolean isBlacklisted(ItemStack aStack) { + return GT_Utility.isStackInList(aStack, sNoUnificationList); + } + + public static void add(OrePrefixes aPrefix, Materials aMaterial, ItemStack aStack) { + set(aPrefix, aMaterial, aStack, false, false); + } + + public static void set(OrePrefixes aPrefix, Materials aMaterial, ItemStack aStack) { + set(aPrefix, aMaterial, aStack, true, false); + } + + public static void set(OrePrefixes aPrefix, Materials aMaterial, ItemStack aStack, boolean aOverwrite, boolean aAlreadyRegistered) { + if (aMaterial == null || aPrefix == null || GT_Utility.isStackInvalid(aStack) || Items.feather.getDamage(aStack) == W) return; + isAddingOre++; + aStack = GT_Utility.copyAmount(1, aStack); + if (!aAlreadyRegistered) registerOre(aPrefix.get(aMaterial), aStack); + addAssociation(aPrefix, aMaterial, aStack, isBlacklisted(aStack)); + if (aOverwrite || GT_Utility.isStackInvalid(sName2StackMap.get(aPrefix.get(aMaterial).toString()))) sName2StackMap.put(aPrefix.get(aMaterial).toString(), aStack); + isAddingOre--; + } + + public static ItemStack getFirstOre(Object aName, long aAmount) { + if (GT_Utility.isStringInvalid(aName)) return null; + ItemStack tStack = sName2StackMap.get(aName.toString()); + if (GT_Utility.isStackValid(tStack)) return GT_Utility.copyAmount(aAmount, tStack); + return GT_Utility.copyAmount(aAmount, getOres(aName).toArray()); + } + + public static ItemStack get(Object aName, long aAmount) { + return get(aName, null, aAmount, true, true); + } + + public static ItemStack get(Object aName, ItemStack aReplacement, long aAmount) { + return get(aName, aReplacement, aAmount, true, true); + } + + public static ItemStack get(OrePrefixes aPrefix, Object aMaterial, long aAmount) { + return get(aPrefix, aMaterial, null, aAmount); + } + + public static ItemStack get(OrePrefixes aPrefix, Object aMaterial, ItemStack aReplacement, long aAmount) { + return get(aPrefix.get(aMaterial), aReplacement, aAmount, false, true); + } + + public static ItemStack get(Object aName, ItemStack aReplacement, long aAmount, boolean aMentionPossibleTypos, boolean aNoInvalidAmounts) { + if (aNoInvalidAmounts && aAmount < 1) return null; + if (!sName2StackMap.containsKey(aName.toString()) && aMentionPossibleTypos) GT_Log.err.println("Unknown Key for Unification, Typo? " + aName); + return GT_Utility.copyAmount(aAmount, sName2StackMap.get(aName.toString()), getFirstOre(aName, aAmount), aReplacement); + } + + public static ItemStack[] setStackArray(boolean aUseBlackList, ItemStack... aStacks) { + for (int i = 0; i < aStacks.length; i++) aStacks[i] = get(aUseBlackList, GT_Utility.copy(aStacks[i])); + return aStacks; + } + + public static ItemStack[] getStackArray(boolean aUseBlackList, Object... aStacks) { + ItemStack[] rStacks = new ItemStack[aStacks.length]; + for (int i = 0; i < aStacks.length; i++) rStacks[i] = get(aUseBlackList, GT_Utility.copy(aStacks[i])); + return rStacks; + } + + public static ItemStack setStack(ItemStack aStack) { + return setStack(true, aStack); + } + + public static ItemStack setStack(boolean aUseBlackList, ItemStack aStack) { + if (GT_Utility.isStackInvalid(aStack)) return aStack; + ItemStack tStack = get(aUseBlackList, aStack); + if (GT_Utility.areStacksEqual(aStack, tStack)) return aStack; + aStack.func_150996_a(tStack.getItem()); + Items.feather.setDamage(aStack, Items.feather.getDamage(tStack)); + return aStack; + } + + public static ItemStack get(ItemStack aStack) { + return get(true, aStack); + } + + public static ItemStack get(boolean aUseBlackList, ItemStack aStack) { + if (GT_Utility.isStackInvalid(aStack)) return null; + ItemData tPrefixMaterial = getAssociation(aStack); + ItemStack rStack = null; + if (tPrefixMaterial == null || !tPrefixMaterial.hasValidPrefixMaterialData() || (aUseBlackList && tPrefixMaterial.mBlackListed)) return GT_Utility.copy(aStack); + if (aUseBlackList && !GregTech_API.sUnificationEntriesRegistered && isBlacklisted(aStack)) {tPrefixMaterial.mBlackListed = true; return GT_Utility.copy(aStack);} + if (tPrefixMaterial.mUnificationTarget == null) tPrefixMaterial.mUnificationTarget = sName2StackMap.get(tPrefixMaterial.toString()); + rStack = tPrefixMaterial.mUnificationTarget; + if (GT_Utility.isStackInvalid(rStack)) return GT_Utility.copy(aStack); + assert rStack != null; + rStack.setTagCompound(aStack.getTagCompound()); + return GT_Utility.copyAmount(aStack.stackSize, rStack); + } + + public static void addItemData(ItemStack aStack, ItemData aData) { + if (GT_Utility.isStackValid(aStack) && getItemData(aStack) == null && aData != null) setItemData(aStack, aData); + } + + private static boolean mRunThroughTheList = true; + + public static void setItemData(ItemStack aStack, ItemData aData) { + if (GT_Utility.isStackInvalid(aStack) || aData == null) return; + ItemData tData = getItemData(aStack); + if (tData == null || !tData.hasValidPrefixMaterialData()) { + if (tData != null) for (Object tObject : tData.mExtraData) if (!aData.mExtraData.contains(tObject)) aData.mExtraData.add(tObject); + if (aStack.stackSize > 1) { + if (aData.mMaterial != null) aData.mMaterial.mAmount /= aStack.stackSize; + for (MaterialStack tMaterial : aData.mByProducts) tMaterial.mAmount /= aStack.stackSize; + aStack = GT_Utility.copyAmount(1, aStack); + } + sItemStack2DataMap.put(new GT_ItemStack(aStack), aData); + if (aData.hasValidMaterialData()) { + long tValidMaterialAmount = aData.mMaterial.mMaterial.contains(SubTag.NO_RECYCLING)?0:aData.mMaterial.mAmount>=0?aData.mMaterial.mAmount:M; + for (MaterialStack tMaterial : aData.mByProducts) tValidMaterialAmount += tMaterial.mMaterial.contains(SubTag.NO_RECYCLING)?0:tMaterial.mAmount>=0?tMaterial.mAmount:M; + if (tValidMaterialAmount < M) GT_ModHandler.addToRecyclerBlackList(aStack); + } + if (mRunThroughTheList) { + if (GregTech_API.sLoadStarted) { + mRunThroughTheList = false; + for (Entry tEntry : sItemStack2DataMap.entrySet()) if (!tEntry.getValue().hasValidPrefixData() || tEntry.getValue().mPrefix.mAllowNormalRecycling) GT_RecipeRegistrator.registerMaterialRecycling(tEntry.getKey().toStack(), tEntry.getValue()); + } + } else { + if (!aData.hasValidPrefixData() || aData.mPrefix.mAllowNormalRecycling) GT_RecipeRegistrator.registerMaterialRecycling(aStack, aData); + } + } else { + for (Object tObject : aData.mExtraData) if (!tData.mExtraData.contains(tObject)) tData.mExtraData.add(tObject); + } + } + + public static void addAssociation(OrePrefixes aPrefix, Materials aMaterial, ItemStack aStack, boolean aBlackListed) { + if (aPrefix == null || aMaterial == null || GT_Utility.isStackInvalid(aStack)) return; + if (Items.feather.getDamage(aStack) == W) for (byte i = 0; i < 16; i++) setItemData(GT_Utility.copyAmountAndMetaData(1, i, aStack), new ItemData(aPrefix, aMaterial, aBlackListed)); + setItemData(aStack, new ItemData(aPrefix, aMaterial, aBlackListed)); + } + + public static ItemData getItemData(ItemStack aStack) { + if (GT_Utility.isStackInvalid(aStack)) return null; + ItemData rData = sItemStack2DataMap.get(new GT_ItemStack(aStack)); + if (rData == null) rData = sItemStack2DataMap.get(new GT_ItemStack(GT_Utility.copyMetaData(W, aStack))); + return rData; + } + + public static ItemData getAssociation(ItemStack aStack) { + ItemData rData = getItemData(aStack); + return rData != null && rData.hasValidPrefixMaterialData() ? rData : null; + } + + public static boolean isItemStackInstanceOf(ItemStack aStack, Object aName) { + if (GT_Utility.isStringInvalid(aName) || GT_Utility.isStackInvalid(aStack)) return false; + for (ItemStack tOreStack : getOres(aName.toString())) if (GT_Utility.areStacksEqual(tOreStack, aStack, true)) return true; + return false; + } + + public static boolean isItemStackDye(ItemStack aStack) { + if (GT_Utility.isStackInvalid(aStack)) return false; + for (Dyes tDye : Dyes.VALUES) if (isItemStackInstanceOf(aStack, tDye.toString())) return true; + return false; + } + + public static boolean registerOre(OrePrefixes aPrefix, Object aMaterial, ItemStack aStack) { + return registerOre(aPrefix.get(aMaterial), aStack); + } + + public static boolean registerOre(Object aName, ItemStack aStack) { + if (aName == null || GT_Utility.isStackInvalid(aStack)) return false; + String tName = aName.toString(); + if (GT_Utility.isStringInvalid(tName)) return false; + ArrayList tList = getOres(tName); + for (int i = 0; i < tList.size(); i++) if (GT_Utility.areStacksEqual(tList.get(i), aStack, true)) return false; + isRegisteringOre++; + OreDictionary.registerOre(tName, GT_Utility.copyAmount(1, aStack)); + isRegisteringOre--; + return true; + } + + public static boolean isRegisteringOres() { + return isRegisteringOre > 0; + } + + public static boolean isAddingOres() { + return isAddingOre > 0; + } + + public static void resetUnificationEntries() { + for (ItemData tPrefixMaterial : sItemStack2DataMap.values()) tPrefixMaterial.mUnificationTarget = null; + } + + public static ItemStack getGem(MaterialStack aMaterial) { + return aMaterial==null?null:getGem(aMaterial.mMaterial, aMaterial.mAmount); + } + + public static ItemStack getGem(Materials aMaterial, OrePrefixes aPrefix) { + return aMaterial==null?null:getGem(aMaterial, aPrefix.mMaterialAmount); + } + + public static ItemStack getGem(Materials aMaterial, long aMaterialAmount) { + ItemStack rStack = null; + if ( (( aMaterialAmount >= M ) || aMaterialAmount >= M * 32)) rStack = get(OrePrefixes.gem , aMaterial, aMaterialAmount / M ); + if (rStack == null && (((aMaterialAmount * 2) % M == 0) || aMaterialAmount >= M * 16)) rStack = get(OrePrefixes.gemFlawed , aMaterial, (aMaterialAmount * 2) / M ); + if (rStack == null && (((aMaterialAmount * 4) >= M ) )) rStack = get(OrePrefixes.gemChipped , aMaterial, (aMaterialAmount * 4) / M ); + return rStack; + } + + public static ItemStack getDust(MaterialStack aMaterial) { + return aMaterial==null?null:getDust(aMaterial.mMaterial, aMaterial.mAmount); + } + + public static ItemStack getDust(Materials aMaterial, OrePrefixes aPrefix) { + return aMaterial==null?null:getDust(aMaterial, aPrefix.mMaterialAmount); + } + + public static ItemStack getDust(Materials aMaterial, long aMaterialAmount) { + if (aMaterialAmount <= 0) return null; + ItemStack rStack = null; + if ( (( aMaterialAmount % M == 0) || aMaterialAmount >= M * 16)) rStack = get(OrePrefixes.dust , aMaterial, aMaterialAmount / M ); + if (rStack == null && (((aMaterialAmount * 4) % M == 0) || aMaterialAmount >= M * 8)) rStack = get(OrePrefixes.dustSmall , aMaterial, (aMaterialAmount * 4) / M ); + if (rStack == null && (((aMaterialAmount * 9) >= M ) )) rStack = get(OrePrefixes.dustTiny , aMaterial, (aMaterialAmount * 9) / M ); + return rStack; + } + + public static ItemStack getIngot(MaterialStack aMaterial) { + return aMaterial==null?null:getIngot(aMaterial.mMaterial, aMaterial.mAmount); + } + + public static ItemStack getIngot(Materials aMaterial, OrePrefixes aPrefix) { + return aMaterial==null?null:getIngot(aMaterial, aPrefix.mMaterialAmount); + } + + public static ItemStack getIngot(Materials aMaterial, long aMaterialAmount) { + if (aMaterialAmount <= 0) return null; + ItemStack rStack = null; + if ( (( aMaterialAmount % (M *9) == 0 && aMaterialAmount / (M * 9) > 1) || aMaterialAmount >= M * 72)) rStack = get(OrePrefixes.block , aMaterial, aMaterialAmount / (M * 9)); + if (rStack == null && (( aMaterialAmount % M == 0 ) || aMaterialAmount >= M * 8)) rStack = get(OrePrefixes.ingot , aMaterial, aMaterialAmount / M ); + if (rStack == null && (((aMaterialAmount * 9) >= M ) )) rStack = get(OrePrefixes.nugget , aMaterial, (aMaterialAmount * 9) / M ); + return rStack; + } + + public static ItemStack getIngotOrDust(Materials aMaterial, long aMaterialAmount) { + if (aMaterialAmount <= 0) return null; + ItemStack rStack = getIngot(aMaterial, aMaterialAmount); + if (rStack == null) rStack = getDust(aMaterial, aMaterialAmount); + return rStack; + } + + public static ItemStack getIngotOrDust(MaterialStack aMaterial) { + ItemStack rStack = getIngot(aMaterial); + if (rStack == null) rStack = getDust(aMaterial); + return rStack; + } + + public static ItemStack getDustOrIngot(Materials aMaterial, long aMaterialAmount) { + if (aMaterialAmount <= 0) return null; + ItemStack rStack = getDust(aMaterial, aMaterialAmount); + if (rStack == null) rStack = getIngot(aMaterial, aMaterialAmount); + return rStack; + } + + public static ItemStack getDustOrIngot(MaterialStack aMaterial) { + ItemStack rStack = getDust(aMaterial); + if (rStack == null) rStack = getIngot(aMaterial); + return rStack; + } + + /** + * @return a Copy of the OreDictionary.getOres() List + */ + public static ArrayList getOres(OrePrefixes aPrefix, Object aMaterial) { + return getOres(aPrefix.get(aMaterial)); + } + + /** + * @return a Copy of the OreDictionary.getOres() List + */ + public static ArrayList getOres(Object aOreName) { + String aName = aOreName==null?E:aOreName.toString(); + ArrayList rList = new ArrayList(); + if (GT_Utility.isStringValid(aName)) rList.addAll(OreDictionary.getOres(aName)); + return rList; + } +} diff --git a/src/main/java/gregtech/api/util/GT_PlayedSound.java b/src/main/java/gregtech/api/util/GT_PlayedSound.java new file mode 100644 index 0000000..fa98693 --- /dev/null +++ b/src/main/java/gregtech/api/util/GT_PlayedSound.java @@ -0,0 +1,28 @@ +package gregtech.api.util; + +import static gregtech.api.enums.GT_Values.E; + +public class GT_PlayedSound { + public final String mSoundName; + public final int mX, mY, mZ; + + public GT_PlayedSound(String aSoundName, double aX, double aY, double aZ) { + mSoundName = aSoundName==null?E:aSoundName; + mX = (int)aX; + mY = (int)aY; + mZ = (int)aZ; + } + + @Override + public boolean equals(Object aObject) { + if (aObject != null && aObject instanceof GT_PlayedSound) { + return ((GT_PlayedSound)aObject).mX == mX && ((GT_PlayedSound)aObject).mY == mY && ((GT_PlayedSound)aObject).mZ == mZ && ((GT_PlayedSound)aObject).mSoundName.equals(mSoundName); + } + return false; + } + + @Override + public int hashCode() { + return mX+mY+mZ+mSoundName.hashCode(); + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/util/GT_Recipe.java b/src/main/java/gregtech/api/util/GT_Recipe.java new file mode 100644 index 0000000..4fdb453 --- /dev/null +++ b/src/main/java/gregtech/api/util/GT_Recipe.java @@ -0,0 +1,1045 @@ +package gregtech.api.util; + +import static gregtech.api.enums.GT_Values.D2; +import static gregtech.api.enums.GT_Values.E; +import static gregtech.api.enums.GT_Values.F; +import static gregtech.api.enums.GT_Values.L; +import static gregtech.api.enums.GT_Values.RES_PATH_GUI; +import static gregtech.api.enums.GT_Values.T; +import static gregtech.api.enums.GT_Values.W; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.Dyes; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.SubTag; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.interfaces.tileentity.IHasWorldObjectAndCoords; +import gregtech.api.objects.GT_FluidStack; +import gregtech.api.objects.GT_ItemStack; +import gregtech.api.objects.ItemData; +import gregtech.api.objects.MaterialStack; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntityFurnace; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.IFluidContainerItem; + +/** + * NEVER INCLUDE THIS FILE IN YOUR MOD!!! + * + * This File contains the functions used for Recipes. Please do not include this File AT ALL in your Moddownload as it ruins compatibility + * This is just the Core of my Recipe System, if you just want to GET the Recipes I add, then you can access this File. + * Do NOT add Recipes using the Constructors inside this Class, The GregTech_API File calls the correct Functions for these Constructors. + * + * I know this File causes some Errors, because of missing Main Functions, but if you just need to compile Stuff, then remove said erroreous Functions. + */ +public class GT_Recipe { + public static volatile int VERSION = 508; + + public static class GT_Recipe_Map { + /** Contains all Recipe Maps */ + public static final Collection sMappings = new ArrayList(); + + public static final GT_Recipe_Map sOreWasherRecipes = new GT_Recipe_Map_OreWasher (new HashSet( 0), "ic.recipe.orewasher" , "Ore Washer" , "ic2.blockOreWashingPlant" , RES_PATH_GUI+"basicmachines/OreWasher" , 1, 3, 1, 1, 1, E , 1, E , T, F); + public static final GT_Recipe_Map sThermalCentrifugeRecipes = new GT_Recipe_Map_ThermalCentrifuge (new HashSet( 0), "ic.recipe.thermalcentrifuge" , "Thermal Centrifuge" , "ic2.blockCentrifuge" , RES_PATH_GUI+"basicmachines/ThermalCentrifuge" , 1, 3, 1, 0, 2, E , 1, E , T, F); + public static final GT_Recipe_Map sCompressorRecipes = new GT_Recipe_Map_Compressor (new HashSet( 0), "ic.recipe.compressor" , "Compressor" , "ic2.compressor" , RES_PATH_GUI+"basicmachines/Compressor" , 1, 1, 1, 0, 1, E , 1, E , T, F); + public static final GT_Recipe_Map sExtractorRecipes = new GT_Recipe_Map_Extractor (new HashSet( 0), "ic.recipe.extractor" , "Extractor" , "ic2.extractor" , RES_PATH_GUI+"basicmachines/Extractor" , 1, 1, 1, 0, 1, E , 1, E , T, F); + public static final GT_Recipe_Map sRecyclerRecipes = new GT_Recipe_Map_Recycler (new HashSet( 0), "ic.recipe.recycler" , "Recycler" , "ic2.recycler" , RES_PATH_GUI+"basicmachines/Recycler" , 1, 1, 1, 0, 1, E , 1, E , T, F); + public static final GT_Recipe_Map sFurnaceRecipes = new GT_Recipe_Map_Furnace (new HashSet( 0), "mc.recipe.furnace" , "Furnace" , "smelting" , RES_PATH_GUI+"basicmachines/E_Furnace" , 1, 1, 1, 0, 1, E , 1, E , T, F); + public static final GT_Recipe_Map sMicrowaveRecipes = new GT_Recipe_Map_Microwave (new HashSet( 0), "gt.recipe.microwave" , "Microwave" , "smelting" , RES_PATH_GUI+"basicmachines/E_Furnace" , 1, 1, 1, 0, 1, E , 1, E , T, F); + + public static final GT_Recipe_Map sScannerFakeRecipes = new GT_Recipe_Map (new HashSet( 3), "gt.recipe.scanner" , "Scanner" , null , RES_PATH_GUI+"basicmachines/Scanner" , 1, 1, 1, 0, 1, E , 1, E , T, T); + public static final GT_Recipe_Map sRockBreakerFakeRecipes = new GT_Recipe_Map (new HashSet( 3), "gt.recipe.rockbreaker" , "Rock Breaker" , null , RES_PATH_GUI+"basicmachines/RockBreaker" , 1, 1, 0, 0, 1, E , 1, E , T, T); + public static final GT_Recipe_Map sByProductList = new GT_Recipe_Map (new HashSet( 1000), "gt.recipe.byproductlist" , "Ore Byproduct List" , null , RES_PATH_GUI+"basicmachines/Default" , 1, 6, 1, 0, 1, E , 1, E , T, T); + + public static final GT_Recipe_Map sPlasmaArcFurnaceRecipes = new GT_Recipe_Map (new HashSet(10000), "gt.recipe.plasmaarcfurnace" , "Plasma Arc Furnace" , null , RES_PATH_GUI+"basicmachines/PlasmaArcFurnace" , 1, 4, 1, 1, 1, E , 1, E , T, T); + public static final GT_Recipe_Map sArcFurnaceRecipes = new GT_Recipe_Map (new HashSet(10000), "gt.recipe.arcfurnace" , "Arc Furnace" , null , RES_PATH_GUI+"basicmachines/ArcFurnace" , 1, 4, 1, 1, 3, E , 1, E , T, T); + public static final GT_Recipe_Map sPrinterRecipes = new GT_Recipe_Map_Printer (new HashSet( 100), "gt.recipe.printer" , "Printer" , null , RES_PATH_GUI+"basicmachines/Printer" , 1, 1, 1, 1, 1, E , 1, E , T, T); + public static final GT_Recipe_Map sSifterRecipes = new GT_Recipe_Map (new HashSet( 100), "gt.recipe.sifter" , "Sifter" , null , RES_PATH_GUI+"basicmachines/Sifter" , 1, 9, 1, 0, 1, E , 1, E , T, T); + public static final GT_Recipe_Map sPressRecipes = new GT_Recipe_Map_FormingPress (new HashSet( 100), "gt.recipe.press" , "Forming Press" , null , RES_PATH_GUI+"basicmachines/Press" , 2, 1, 2, 0, 1, E , 1, E , T, T); + public static final GT_Recipe_Map sLaserEngraverRecipes = new GT_Recipe_Map (new HashSet( 100), "gt.recipe.laserengraver" , "Precision Laser Engraver" , null , RES_PATH_GUI+"basicmachines/LaserEngraver" , 2, 1, 2, 0, 1, E , 1, E , T, T); + public static final GT_Recipe_Map sMixerRecipes = new GT_Recipe_Map (new HashSet( 100), "gt.recipe.mixer" , "Mixer" , null , RES_PATH_GUI+"basicmachines/Mixer" , 4, 1, 1, 0, 1, E , 1, E , T, T); + public static final GT_Recipe_Map sAutoclaveRecipes = new GT_Recipe_Map (new HashSet( 200), "gt.recipe.autoclave" , "Autoclave" , null , RES_PATH_GUI+"basicmachines/Autoclave" , 1, 1, 1, 1, 1, E , 1, E , T, T); + public static final GT_Recipe_Map sElectroMagneticSeparatorRecipes = new GT_Recipe_Map (new HashSet( 50), "gt.recipe.electromagneticseparator" , "Electromagnetic Separator" , null , RES_PATH_GUI+"basicmachines/ElectromagneticSeparator" , 1, 3, 1, 0, 1, E , 1, E , T, T); + public static final GT_Recipe_Map sPolarizerRecipes = new GT_Recipe_Map (new HashSet( 100), "gt.recipe.polarizer" , "Electromagnetic Polarizer" , null , RES_PATH_GUI+"basicmachines/Polarizer" , 1, 1, 1, 0, 1, E , 1, E , T, T); + public static final GT_Recipe_Map sMaceratorRecipes = new GT_Recipe_Map_Macerator (new HashSet(10000), "gt.recipe.macerator" , "Pulverization" , null , RES_PATH_GUI+"basicmachines/Macerator4" , 1, 4, 1, 0, 1, E , 1, E , T, T); + public static final GT_Recipe_Map sChemicalBathRecipes = new GT_Recipe_Map (new HashSet( 200), "gt.recipe.chemicalbath" , "Chemical Bath" , null , RES_PATH_GUI+"basicmachines/ChemicalBath" , 1, 3, 1, 1, 1, E , 1, E , T, T); + public static final GT_Recipe_Map sFluidCannerRecipes = new GT_Recipe_Map_FluidCanner (new HashSet( 100), "gt.recipe.fluidcanner" , "Fluid Canning Machine" , null , RES_PATH_GUI+"basicmachines/FluidCannerNEI" , 1, 1, 1, 0, 1, E , 1, E , T, T); + public static final GT_Recipe_Map sBrewingRecipes = new GT_Recipe_Map (new HashSet( 100), "gt.recipe.brewer" , "Brewing Machine" , null , RES_PATH_GUI+"basicmachines/PotionBrewer" , 1, 0, 1, 1, 1, E , 1, E , T, T); + public static final GT_Recipe_Map sFluidHeaterRecipes = new GT_Recipe_Map (new HashSet( 100), "gt.recipe.fluidheater" , "Fluid Heater" , null , RES_PATH_GUI+"basicmachines/FluidHeater" , 1, 0, 1, 1, 1, E , 1, E , T, T); + public static final GT_Recipe_Map sDistilleryRecipes = new GT_Recipe_Map (new HashSet( 100), "gt.recipe.distillery" , "Distillery" , null , RES_PATH_GUI+"basicmachines/Distillery" , 1, 0, 1, 1, 1, E , 1, E , T, T); + public static final GT_Recipe_Map sFermentingRecipes = new GT_Recipe_Map (new HashSet( 100), "gt.recipe.fermenter" , "Fermenter" , null , RES_PATH_GUI+"basicmachines/Fermenter" , 0, 0, 0, 1, 1, E , 1, E , T, T); + public static final GT_Recipe_Map sFluidSolidficationRecipes = new GT_Recipe_Map (new HashSet( 100), "gt.recipe.fluidsolidifier" , "Fluid Solidifier" , null , RES_PATH_GUI+"basicmachines/FluidSolidifier" , 1, 1, 1, 1, 1, E , 1, E , T, T); + public static final GT_Recipe_Map sFluidExtractionRecipes = new GT_Recipe_Map (new HashSet( 100), "gt.recipe.fluidextractor" , "Fluid Extractor" , null , RES_PATH_GUI+"basicmachines/FluidExtractor" , 1, 1, 1, 0, 1, E , 1, E , T, T); + public static final GT_Recipe_Map sBoxinatorRecipes = new GT_Recipe_Map (new HashSet( 2500), "gt.recipe.packager" , "Packager" , null , RES_PATH_GUI+"basicmachines/Packager" , 2, 1, 2, 0, 1, E , 1, E , T, T); + public static final GT_Recipe_Map sUnboxinatorRecipes = new GT_Recipe_Map_Unboxinator (new HashSet( 2500), "gt.recipe.unpackager" , "Unpackager" , null , RES_PATH_GUI+"basicmachines/Unpackager" , 1, 2, 1, 0, 1, E , 1, E , T, T); + public static final GT_Recipe_Map sFusionRecipes = new GT_Recipe_Map (new HashSet( 50), "gt.recipe.fusionreactor" , "Fusion Reactor" , null , RES_PATH_GUI+"basicmachines/Default" , 0, 0, 0, 2, 1, "Start: " , 1, " EU" , T, T); + public static final GT_Recipe_Map sCentrifugeRecipes = new GT_Recipe_Map (new HashSet( 1000), "gt.recipe.centrifuge" , "Centrifuge" , null , RES_PATH_GUI+"basicmachines/Centrifuge" , 2, 6, 0, 0, 1, E , 1, E , T, T); + public static final GT_Recipe_Map sElectrolyzerRecipes = new GT_Recipe_Map (new HashSet( 200), "gt.recipe.electrolyzer" , "Electrolyzer" , null , RES_PATH_GUI+"basicmachines/Electrolyzer" , 2, 6, 0, 0, 1, E , 1, E , T, T); + public static final GT_Recipe_Map sBlastRecipes = new GT_Recipe_Map (new HashSet( 500), "gt.recipe.blastfurnace" , "Blast Furnace" , null , RES_PATH_GUI+"basicmachines/Default" , 2, 2, 1, 0, 1, "Heat Capacity: " , 1, " K" , F, T); + public static final GT_Recipe_Map sImplosionRecipes = new GT_Recipe_Map (new HashSet( 50), "gt.recipe.implosioncompressor" , "Implosion Compressor" , null , RES_PATH_GUI+"basicmachines/Default" , 2, 2, 2, 0, 1, E , 1, E , T, T); + public static final GT_Recipe_Map sVacuumRecipes = new GT_Recipe_Map (new HashSet( 100), "gt.recipe.vacuumfreezer" , "Vacuum Freezer" , null , RES_PATH_GUI+"basicmachines/Default" , 1, 1, 1, 0, 1, E , 1, E , T, T); + public static final GT_Recipe_Map sChemicalRecipes = new GT_Recipe_Map (new HashSet( 100), "gt.recipe.chemicalreactor" , "Chemical Reactor" , null , RES_PATH_GUI+"basicmachines/ChemicalReactor" , 2, 1, 1, 0, 1, E , 1, E , T, T); + public static final GT_Recipe_Map sDistillationRecipes = new GT_Recipe_Map (new HashSet( 50), "gt.recipe.distillationtower" , "Distillation Tower" , null , RES_PATH_GUI+"basicmachines/Default" , 2, 4, 0, 0, 1, E , 1, E , T, T); + public static final GT_Recipe_Map sWiremillRecipes = new GT_Recipe_Map (new HashSet( 50), "gt.recipe.wiremill" , "Wiremill" , null , RES_PATH_GUI+"basicmachines/Wiremill" , 1, 1, 1, 0, 1, E , 1, E , T, T); + public static final GT_Recipe_Map sBenderRecipes = new GT_Recipe_Map (new HashSet( 400), "gt.recipe.metalbender" , "Metal Bender" , null , RES_PATH_GUI+"basicmachines/Bender" , 2, 1, 2, 0, 1, E , 1, E , T, T); + public static final GT_Recipe_Map sAlloySmelterRecipes = new GT_Recipe_Map (new HashSet( 3000), "gt.recipe.alloysmelter" , "Alloy Smelter" , null , RES_PATH_GUI+"basicmachines/AlloySmelter" , 2, 1, 2, 0, 1, E , 1, E , T, T); + public static final GT_Recipe_Map sAssemblerRecipes = new GT_Recipe_Map_Assembler (new HashSet( 300), "gt.recipe.assembler" , "Assembler" , null , RES_PATH_GUI+"basicmachines/Assembler" , 2, 1, 1, 0, 1, E , 1, E , T, T); + public static final GT_Recipe_Map sCannerRecipes = new GT_Recipe_Map (new HashSet( 300), "gt.recipe.canner" , "Canning Machine" , null , RES_PATH_GUI+"basicmachines/Canner" , 2, 2, 1, 0, 1, E , 1, E , T, T); + public static final GT_Recipe_Map sCNCRecipes = new GT_Recipe_Map (new HashSet( 100), "gt.recipe.cncmachine" , "CNC Machine" , null , RES_PATH_GUI+"basicmachines/Default" , 2, 1, 2, 1, 1, E , 1, E , T, T); + public static final GT_Recipe_Map sLatheRecipes = new GT_Recipe_Map (new HashSet( 400), "gt.recipe.lathe" , "Lathe" , null , RES_PATH_GUI+"basicmachines/Lathe" , 1, 2, 1, 0, 1, E , 1, E , T, T); + public static final GT_Recipe_Map sCutterRecipes = new GT_Recipe_Map (new HashSet( 200), "gt.recipe.cuttingsaw" , "Cutting Saw" , null , RES_PATH_GUI+"basicmachines/Cutter" , 1, 2, 1, 1, 1, E , 1, E , T, T); + public static final GT_Recipe_Map sSlicerRecipes = new GT_Recipe_Map (new HashSet( 200), "gt.recipe.slicer" , "Slicer" , null , RES_PATH_GUI+"basicmachines/Slicer" , 2, 1, 2, 0, 1, E , 1, E , T, T); + public static final GT_Recipe_Map sExtruderRecipes = new GT_Recipe_Map (new HashSet( 1000), "gt.recipe.extruder" , "Extruder" , null , RES_PATH_GUI+"basicmachines/Extruder" , 2, 1, 2, 0, 1, E , 1, E , T, T); + public static final GT_Recipe_Map sHammerRecipes = new GT_Recipe_Map (new HashSet( 200), "gt.recipe.hammer" , "Hammer" , null , RES_PATH_GUI+"basicmachines/Hammer" , 1, 1, 1, 0, 1, E , 1, E , T, T); + public static final GT_Recipe_Map sAmplifiers = new GT_Recipe_Map (new HashSet( 10), "gt.recipe.uuamplifier" , "UU Amplifier" , null , RES_PATH_GUI+"basicmachines/Amplifabricator" , 1, 0, 1, 0, 1, E , 1, E , T, T); + public static final GT_Recipe_Map_Fuel sDieselFuels = new GT_Recipe_Map_Fuel (new HashSet( 10), "gt.recipe.dieselgeneratorfuel" , "Diesel Generator Fuel" , null , RES_PATH_GUI+"basicmachines/Default" , 1, 1, 0, 0, 1, "Fuel Value: " , 1000, " EU" , T, T); + public static final GT_Recipe_Map_Fuel sTurbineFuels = new GT_Recipe_Map_Fuel (new HashSet( 10), "gt.recipe.gasturbinefuel" , "Gas Turbine Fuel" , null , RES_PATH_GUI+"basicmachines/Default" , 1, 1, 0, 0, 1, "Fuel Value: " , 1000, " EU" , T, T); + public static final GT_Recipe_Map_Fuel sHotFuels = new GT_Recipe_Map_Fuel (new HashSet( 10), "gt.recipe.thermalgeneratorfuel" , "Thermal Generator Fuel" , null , RES_PATH_GUI+"basicmachines/Default" , 1, 1, 0, 0, 1, "Fuel Value: " , 1000, " EU" , T, F); + public static final GT_Recipe_Map_Fuel sDenseLiquidFuels = new GT_Recipe_Map_Fuel (new HashSet( 10), "gt.recipe.semifluidboilerfuels" , "Semifluid Boiler Fuels" , null , RES_PATH_GUI+"basicmachines/Default" , 1, 1, 0, 0, 1, "Fuel Value: " , 1000, " EU" , T, T); + public static final GT_Recipe_Map_Fuel sPlasmaFuels = new GT_Recipe_Map_Fuel (new HashSet( 10), "gt.recipe.plasmageneratorfuels" , "Plasma generator Fuels" , null , RES_PATH_GUI+"basicmachines/Default" , 1, 1, 0, 0, 1, "Fuel Value: " , 1000, " EU" , T, T); + public static final GT_Recipe_Map_Fuel sMagicFuels = new GT_Recipe_Map_Fuel (new HashSet( 10), "gt.recipe.magicfuels" , "Magic Fuels" , null , RES_PATH_GUI+"basicmachines/Default" , 1, 1, 0, 0, 1, "Fuel Value: " , 1000, " EU" , T, T); + public static final GT_Recipe_Map_Fuel sSmallNaquadahReactorFuels = new GT_Recipe_Map_Fuel (new HashSet( 10), "gt.recipe.smallnaquadahreactor" , "Small Naquadah Reactor" , null , RES_PATH_GUI+"basicmachines/Default" , 1, 1, 0, 0, 1, "Fuel Value: " , 1000, " EU" , T, T); + public static final GT_Recipe_Map_Fuel sLargeNaquadahReactorFuels = new GT_Recipe_Map_Fuel (new HashSet( 10), "gt.recipe.largenaquadahreactor" , "Large Naquadah Reactor" , null , RES_PATH_GUI+"basicmachines/Default" , 1, 1, 0, 0, 1, "Fuel Value: " , 1000, " EU" , T, T); + public static final GT_Recipe_Map_Fuel sFluidNaquadahReactorFuels = new GT_Recipe_Map_Fuel (new HashSet( 10), "gt.recipe.fluidnaquadahreactor" , "Fluid Naquadah Reactor" , null , RES_PATH_GUI+"basicmachines/Default" , 1, 1, 0, 0, 1, "Fuel Value: " , 1000, " EU" , T, T); + + /** HashMap of Recipes based on their Items */ + public final Map> mRecipeItemMap = new HashMap>(); + /** HashMap of Recipes based on their Fluids */ + public final Map> mRecipeFluidMap = new HashMap>(); + /** The List of all Recipes */ + public final Collection mRecipeList; + /** String used as an unlocalised Name. */ + public final String mUnlocalizedName; + /** String used in NEI for the Recipe Lists. If null it will use the unlocalised Name instead*/ + public final String mNEIName; + /** GUI used for NEI Display. Usually the GUI of the Machine itself */ + public final String mNEIGUIPath; + public final String mNEISpecialValuePre, mNEISpecialValuePost; + public final int mUsualInputCount, mUsualOutputCount, mNEISpecialValueMultiplier, mMinimalInputItems, mMinimalInputFluids, mAmperage; + public final boolean mNEIAllowed, mShowVoltageAmperageInNEI; + + /** + * Initialises a new type of Recipe Handler. + * @param aRecipeList a List you specify as Recipe List. Usually just an ArrayList with a pre-initialised Size. + * @param aUnlocalizedName the unlocalised Name of this Recipe Handler, used mainly for NEI. + * @param aLocalName the displayed Name inside the NEI Recipe GUI. + * @param aNEIGUIPath the displayed GUI Texture, usually just a Machine GUI. Auto-Attaches ".png" if forgotten. + * @param aUsualInputCount the usual amount of Input Slots this Recipe Class has. + * @param aUsualOutputCount the usual amount of Output Slots this Recipe Class has. + * @param aNEISpecialValuePre the String in front of the Special Value in NEI. + * @param aNEISpecialValueMultiplier the Value the Special Value is getting Multiplied with before displaying + * @param aNEISpecialValuePost the String after the Special Value. Usually for a Unit or something. + * @param aNEIAllowed if NEI is allowed to display this Recipe Handler in general. + */ + public GT_Recipe_Map(Collection aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { + sMappings.add(this); + mNEIAllowed = aNEIAllowed; + mShowVoltageAmperageInNEI = aShowVoltageAmperageInNEI; + mRecipeList = aRecipeList; + mNEIName = aNEIName == null ? aUnlocalizedName : aNEIName; + mNEIGUIPath = aNEIGUIPath.endsWith(".png")?aNEIGUIPath:aNEIGUIPath + ".png"; + mNEISpecialValuePre = aNEISpecialValuePre; + mNEISpecialValueMultiplier = aNEISpecialValueMultiplier; + mNEISpecialValuePost = aNEISpecialValuePost; + mAmperage = aAmperage; + mUsualInputCount = aUsualInputCount; + mUsualOutputCount = aUsualOutputCount; + mMinimalInputItems = aMinimalInputItems; + mMinimalInputFluids = aMinimalInputFluids; + GregTech_API.sFluidMappings.add(mRecipeFluidMap); + GregTech_API.sItemStackMappings.add(mRecipeItemMap); + GT_LanguageManager.addStringLocalization(mUnlocalizedName = aUnlocalizedName, aLocalName); + } + + public GT_Recipe addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { + return addRecipe(new GT_Recipe(aOptimize, aInputs, aOutputs, aSpecial, aOutputChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)); + } + + public GT_Recipe addRecipe(int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { + return addRecipe(new GT_Recipe(false, null, null, null, aOutputChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue),F,F,F); + } + + public GT_Recipe addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { + return addRecipe(new GT_Recipe(aOptimize, aInputs, aOutputs, aSpecial, null, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)); + } + + public GT_Recipe addRecipe(GT_Recipe aRecipe) { + return addRecipe(aRecipe, T, F, F); + } + + protected GT_Recipe addRecipe(GT_Recipe aRecipe, boolean aCheckForCollisions, boolean aFakeRecipe, boolean aHidden) { + aRecipe.mHidden = aHidden; + aRecipe.mFakeRecipe = aFakeRecipe; + if (aRecipe.mFluidInputs.length < mMinimalInputFluids && aRecipe.mInputs.length < mMinimalInputItems) return null; + if (aCheckForCollisions && findRecipe(null, F, Long.MAX_VALUE, aRecipe.mFluidInputs, aRecipe.mInputs) != null) return null; + return add(aRecipe); + } + + /** Only used for fake Recipe Handlers to show something in NEI, do not use this for adding actual Recipes! findRecipe wont find fake Recipes, containsInput WILL find fake Recipes */ + public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { + return addFakeRecipe(aCheckForCollisions, new GT_Recipe(F, aInputs, aOutputs, aSpecial, aOutputChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)); + } + + /** Only used for fake Recipe Handlers to show something in NEI, do not use this for adding actual Recipes! findRecipe wont find fake Recipes, containsInput WILL find fake Recipes */ + public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { + return addFakeRecipe(aCheckForCollisions, new GT_Recipe(F, aInputs, aOutputs, aSpecial, null, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)); + } + + /** Only used for fake Recipe Handlers to show something in NEI, do not use this for adding actual Recipes! findRecipe wont find fake Recipes, containsInput WILL find fake Recipes */ + public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, GT_Recipe aRecipe) { + return addRecipe(aRecipe, aCheckForCollisions, T, F); + } + + public GT_Recipe add(GT_Recipe aRecipe) { + mRecipeList.add(aRecipe); + for (FluidStack aFluid : aRecipe.mFluidInputs) if (aFluid != null) { + Collection tList = mRecipeFluidMap.get(aFluid.getFluid()); + if (tList == null) mRecipeFluidMap.put(aFluid.getFluid(), tList = new HashSet(1)); + tList.add(aRecipe); + } + return addToItemMap(aRecipe); + } + + public void reInit() { + Map> tMap = mRecipeItemMap; + if (tMap != null) tMap.clear(); + for (GT_Recipe tRecipe : mRecipeList) { + GT_OreDictUnificator.setStackArray(T, tRecipe.mInputs); + GT_OreDictUnificator.setStackArray(T, tRecipe.mOutputs); + if (tMap != null) addToItemMap(tRecipe); + } + } + + /** @return if this Item is a valid Input for any for the Recipes */ + public boolean containsInput(ItemStack aStack) { + return aStack != null && (mRecipeItemMap.containsKey(new GT_ItemStack(aStack)) || mRecipeItemMap.containsKey(new GT_ItemStack(GT_Utility.copyMetaData(W, aStack)))); + } + + /** @return if this Fluid is a valid Input for any for the Recipes */ + public boolean containsInput(FluidStack aFluid) { + return aFluid != null && containsInput(aFluid.getFluid()); + } + + /** @return if this Fluid is a valid Input for any for the Recipes */ + public boolean containsInput(Fluid aFluid) { + return aFluid != null && mRecipeFluidMap.containsKey(aFluid); + } + + public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack... aInputs) { + return findRecipe(aTileEntity, null, aNotUnificated, aVoltage, aFluids, null, aInputs); + } + + public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack... aInputs) { + return findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, null, aInputs); + } + + /** + * finds a Recipe matching the aFluid and ItemStack Inputs. + * @param aTileEntity an Object representing the current coordinates of the executing Block/Entity/Whatever. This may be null, especially during Startup. + * @param aRecipe in case this is != null it will try to use this Recipe first when looking things up. + * @param aNotUnificated if this is T the Recipe searcher will unificate the ItemStack Inputs + * @param aVoltage Voltage of the Machine or Long.MAX_VALUE if it has no Voltage + * @param aFluids the Fluid Inputs + * @param aSpecialSlot the content of the Special Slot, the regular Manager doesn't do anything with this, but some custom ones do. + * @param aInputs the Item Inputs + * @return the Recipe it has found or null for no matching Recipe + */ + public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { + // No Recipes? Well, nothing to be found then. + if (mRecipeList.isEmpty()) return null; + + // Some Recipe Classes require a certain amount of Inputs of certain kinds. Like "at least 1 Fluid + 1 Stack" or "at least 2 Stacks" before they start searching for Recipes. + // This improves Performance massively, especially if people leave things like Circuits, Molds or Shapes in their Machines to select Sub Recipes. + if (GregTech_API.sPostloadFinished) { + if (mMinimalInputFluids > 0) { + if (aFluids == null) return null; + int tAmount = 0; + for (FluidStack aFluid : aFluids) if (aFluid != null) tAmount++; + if (tAmount < mMinimalInputFluids) return null; + } + if (mMinimalInputItems > 0) { + if (aInputs == null) return null; + int tAmount = 0; + for (ItemStack aInput : aInputs) if (aInput != null) tAmount++; + if (tAmount < mMinimalInputItems) return null; + } + } + + // Unification happens here in case the Input isn't already unificated. + if (aNotUnificated) aInputs = GT_OreDictUnificator.getStackArray(T, (Object[])aInputs); + + // Check the Recipe which has been used last time in order to not have to search for it again, if possible. + if (aRecipe != null) if (!aRecipe.mFakeRecipe && aRecipe.mCanBeBuffered && aRecipe.isRecipeInputEqual(F, T, aFluids, aInputs)) return aRecipe.mEnabled&&aVoltage*mAmperage>=aRecipe.mEUt?aRecipe:null; + + // Now look for the Recipes inside the Item HashMaps, but only when the Recipes usually have Items. + if (mUsualInputCount > 0 && aInputs != null) for (ItemStack tStack : aInputs) if (tStack != null) { + Collection + tRecipes = mRecipeItemMap.get(new GT_ItemStack(tStack)); + if (tRecipes != null) for (GT_Recipe tRecipe : tRecipes) if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(F, T, aFluids, aInputs)) return tRecipe.mEnabled&&aVoltage*mAmperage>=tRecipe.mEUt?tRecipe:null; + tRecipes = mRecipeItemMap.get(new GT_ItemStack(GT_Utility.copyMetaData(W, tStack))); + if (tRecipes != null) for (GT_Recipe tRecipe : tRecipes) if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(F, T, aFluids, aInputs)) return tRecipe.mEnabled&&aVoltage*mAmperage>=tRecipe.mEUt?tRecipe:null; + } + + // If the minimal Amount of Items for the Recipe is 0, then it could be a Fluid-Only Recipe, so check that Map too. + if (mMinimalInputItems == 0 && aFluids != null) for (FluidStack aFluid : aFluids) if (aFluid != null) { + Collection + tRecipes = mRecipeFluidMap.get(aFluid.getFluid()); + if (tRecipes != null) for (GT_Recipe tRecipe : tRecipes) if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(F, T, aFluids, aInputs)) return tRecipe.mEnabled&&aVoltage*mAmperage>=tRecipe.mEUt?tRecipe:null; + } + + // And nothing has been found. + return null; + } + + protected GT_Recipe addToItemMap(GT_Recipe aRecipe) { + for (ItemStack aStack : aRecipe.mInputs) if (aStack != null) { + GT_ItemStack tStack = new GT_ItemStack(aStack); + Collection tList = mRecipeItemMap.get(tStack); + if (tList == null) mRecipeItemMap.put(tStack, tList = new HashSet(1)); + tList.add(aRecipe); + } + return aRecipe; + } + } + + public static void reInit() { + GT_Log.out.println("GT_Mod: Re-Unificating Recipes."); + for (GT_Recipe_Map tMapEntry : GT_Recipe_Map.sMappings) tMapEntry.reInit(); + } + + /** If you want to change the Output, feel free to modify or even replace the whole ItemStack Array, for Inputs, please add a new Recipe, because of the HashMaps. */ + public ItemStack[] mInputs, mOutputs; + /** If you want to change the Output, feel free to modify or even replace the whole ItemStack Array, for Inputs, please add a new Recipe, because of the HashMaps. */ + public FluidStack[] mFluidInputs, mFluidOutputs; + /** If you changed the amount of Array-Items inside the Output Array then the length of this Array must be larger or equal to the Output Array. A chance of 10000 equals 100% */ + public int[] mChances; + /** An Item that needs to be inside the Special Slot, like for example the Copy Slot inside the Printer. This is only useful for Fake Recipes in NEI, since findRecipe() and containsInput() don't give a shit about this Field. Lists are also possible. */ + public Object mSpecialItems; + + public int mDuration, mEUt, mSpecialValue; + + /** Use this to just disable a specific Recipe, but the Configuration enables that already for every single Recipe. */ + public boolean mEnabled = T; + /** If this Recipe is hidden from NEI */ + public boolean mHidden = F; + /** If this Recipe is Fake and therefore doesn't get found by the findRecipe Function (It is still in the HashMaps, so that containsInput does return T on those fake Inputs) */ + public boolean mFakeRecipe = F; + /** If this Recipe can be stored inside a Machine in order to make Recipe searching more Efficient by trying the previously used Recipe first. In case you have a Recipe Map overriding things and returning one time use Recipes, you have to set this to F. */ + public boolean mCanBeBuffered = T; + /** If this Recipe needs the Output Slots to be completely empty. Needed in case you have randomised Outputs */ + public boolean mNeedsEmptyOutput = F; + + public ItemStack getRepresentativeInput(int aIndex) {if (aIndex < 0 || aIndex >= mInputs.length) return null; return GT_Utility.copy(mInputs[aIndex]);} + public ItemStack getOutput(int aIndex) {if (aIndex < 0 || aIndex >= mOutputs.length) return null; return GT_Utility.copy(mOutputs[aIndex]);} + + public int getOutputChance(int aIndex) {if (aIndex < 0 || aIndex >= mChances.length) return 10000; return mChances[aIndex];} + + public FluidStack getRepresentativeFluidInput(int aIndex) {if (aIndex < 0 || aIndex >= mFluidInputs.length || mFluidInputs[aIndex] == null) return null; return mFluidInputs[aIndex].copy();} + public FluidStack getFluidOutput(int aIndex) {if (aIndex < 0 || aIndex >= mFluidOutputs.length || mFluidOutputs[aIndex] == null) return null; return mFluidOutputs[aIndex].copy();} + + public void checkCellBalance() { + if (!D2 || mInputs.length < 1) return; + + int tInputAmount = GT_ModHandler.getCapsuleCellContainerCountMultipliedWithStackSize(mInputs); + int tOutputAmount = GT_ModHandler.getCapsuleCellContainerCountMultipliedWithStackSize(mOutputs); + + if (tInputAmount < tOutputAmount) { + if (!Materials.Tin.contains(mInputs)) { + GT_Log.err.println("You get more Cells, than you put in? There must be something wrong."); + new Exception().printStackTrace(GT_Log.err); + } + } else if (tInputAmount > tOutputAmount) { + if (!Materials.Tin.contains(mOutputs)) { + GT_Log.err.println("You get less Cells, than you put in? GT Machines usually don't destroy Cells."); + new Exception().printStackTrace(GT_Log.err); + } + } + } + + public GT_Recipe copy() { + return new GT_Recipe(this); + } + + public boolean isRecipeInputEqual(boolean aDecreaseStacksizeBySuccess, FluidStack[] aFluidInputs, ItemStack... aInputs) { + return isRecipeInputEqual(aDecreaseStacksizeBySuccess, F, aFluidInputs, aInputs); + } + + public boolean isRecipeInputEqual(boolean aDecreaseStacksizeBySuccess, boolean aDontCheckStackSizes, FluidStack[] aFluidInputs, ItemStack... aInputs) { + if (mFluidInputs.length > 0 && aFluidInputs == null) return F; + for (FluidStack tFluid : mFluidInputs) if (tFluid != null) { + boolean temp = T; + for (FluidStack aFluid : aFluidInputs) if (aFluid != null && aFluid.isFluidEqual(tFluid) && (aDontCheckStackSizes || aFluid.amount >= tFluid.amount)) {temp = F; break;} + if (temp) return F; + } + + if (mInputs.length > 0 && aInputs == null) return F; + + for (ItemStack tStack : mInputs) if (tStack != null) { + boolean temp = T; + for (ItemStack aStack : aInputs) if ((GT_Utility.areUnificationsEqual(aStack, tStack, T) || GT_Utility.areUnificationsEqual(GT_OreDictUnificator.get(F, aStack), tStack, T)) && (aDontCheckStackSizes || aStack.stackSize >= tStack.stackSize)) {temp = F; break;} + if (temp) return F; + } + + if (aDecreaseStacksizeBySuccess) { + if (aFluidInputs != null) { + for (FluidStack tFluid : mFluidInputs) if (tFluid != null) { + for (FluidStack aFluid : aFluidInputs) if (aFluid != null && aFluid.isFluidEqual(tFluid) && (aDontCheckStackSizes || aFluid.amount >= tFluid.amount)) {aFluid.amount -= tFluid.amount; break;} + } + } + + if (aInputs != null) { + for (ItemStack tStack : mInputs) if (tStack != null) { + for (ItemStack aStack : aInputs) if ((GT_Utility.areUnificationsEqual(aStack, tStack, T) || GT_Utility.areUnificationsEqual(GT_OreDictUnificator.get(F, aStack), tStack, T)) && (aDontCheckStackSizes || aStack.stackSize >= tStack.stackSize)) {aStack.stackSize -= tStack.stackSize; break;} + } + } + } + + return T; + } + + private GT_Recipe(GT_Recipe aRecipe) { + mInputs = GT_Utility.copyStackArray((Object[])aRecipe.mInputs); + mOutputs = GT_Utility.copyStackArray((Object[])aRecipe.mOutputs); + mSpecialItems = aRecipe.mSpecialItems; + mChances = aRecipe.mChances; + mFluidInputs = GT_Utility.copyFluidArray(aRecipe.mFluidInputs); + mFluidOutputs = GT_Utility.copyFluidArray(aRecipe.mFluidOutputs); + mDuration = aRecipe.mDuration; + mSpecialValue = aRecipe.mSpecialValue; + mEUt = aRecipe.mEUt; + mNeedsEmptyOutput = aRecipe.mNeedsEmptyOutput; + mCanBeBuffered = aRecipe.mCanBeBuffered; + mFakeRecipe = aRecipe.mFakeRecipe; + mEnabled = aRecipe.mEnabled; + mHidden = aRecipe.mHidden; + } + + protected GT_Recipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { + if (aInputs == null) aInputs = new ItemStack[0]; + if (aOutputs == null) aOutputs = new ItemStack[0]; + if (aFluidInputs == null) aFluidInputs = new FluidStack[0]; + if (aFluidOutputs == null) aFluidOutputs = new FluidStack[0]; + if (aChances == null) aChances = new int[aOutputs.length]; + if (aChances.length < aOutputs.length) aChances = Arrays.copyOf(aChances, aOutputs.length); + + aInputs = GT_Utility.getArrayListWithoutTrailingNulls(aInputs ).toArray(new ItemStack[0]); + aOutputs = GT_Utility.getArrayListWithoutTrailingNulls(aOutputs ).toArray(new ItemStack[0]); + aFluidInputs = GT_Utility.getArrayListWithoutNulls(aFluidInputs ).toArray(new FluidStack[0]); + aFluidOutputs = GT_Utility.getArrayListWithoutNulls(aFluidOutputs ).toArray(new FluidStack[0]); + + GT_OreDictUnificator.setStackArray(T, aInputs); + GT_OreDictUnificator.setStackArray(T, aOutputs); + + for (ItemStack tStack : aOutputs) GT_Utility.updateItemStack(tStack); + + for (int i = 0; i < aChances .length; i++) if (aChances[i] <= 0) aChances[i] = 10000; + for (int i = 0; i < aFluidInputs .length; i++) aFluidInputs [i] = new GT_FluidStack(aFluidInputs [i]); + for (int i = 0; i < aFluidOutputs .length; i++) aFluidOutputs[i] = new GT_FluidStack(aFluidOutputs[i]); + + for (int i = 0; i < aInputs.length; i++) if (aInputs[i] != null && Items.feather.getDamage(aInputs[i]) != W) for (int j = 0; j < aOutputs.length; j++) { + if (GT_Utility.areStacksEqual(aInputs[i], aOutputs[j])) { + if (aInputs[i].stackSize >= aOutputs[j].stackSize) { + aInputs[i].stackSize -= aOutputs[j].stackSize; + aOutputs[j] = null; + } else { + aOutputs[j].stackSize -= aInputs[i].stackSize; + } + } + } + + if (aOptimize && aDuration >= 32) { + ArrayList tList = new ArrayList(); + tList.addAll(Arrays.asList(aInputs)); + tList.addAll(Arrays.asList(aOutputs)); + for (int i = 0; i < tList.size(); i++) if (tList.get(i) == null) tList.remove(i--); + + for (byte i = (byte)Math.min(64, aDuration / 16); i > 1; i--) if (aDuration / i >= 16) { + boolean temp = T; + for (int j = 0, k = tList.size(); temp && j < k; j++) if (tList.get(j).stackSize % i != 0) temp = F; + for (int j = 0; temp && j < aFluidInputs .length; j++) if (aFluidInputs [j].amount % i != 0) temp = F; + for (int j = 0; temp && j < aFluidOutputs.length; j++) if (aFluidOutputs[j].amount % i != 0) temp = F; + if (temp) { + for (int j = 0, k = tList.size(); j < k; j++) tList.get(j).stackSize /= i; + for (int j = 0; j < aFluidInputs .length; j++) aFluidInputs [j].amount /= i; + for (int j = 0; j < aFluidOutputs.length; j++) aFluidOutputs[j].amount /= i; + aDuration /= i; + } + } + } + + mInputs = aInputs; + mOutputs = aOutputs; + mSpecialItems = aSpecialItems; + mChances = aChances; + mFluidInputs = aFluidInputs; + mFluidOutputs = aFluidOutputs; + mDuration = aDuration; + mSpecialValue = aSpecialValue; + mEUt = aEUt; + +// checkCellBalance(); + } + + // ----- + // Old Constructors, do not use! + // ----- + + public GT_Recipe(ItemStack aInput1, ItemStack aOutput1, int aFuelValue, int aType) { + this(aInput1, aOutput1, null, null, null, aFuelValue, aType); + } + + // aSpecialValue = EU per Liter! If there is no Liquid for this Object, then it gets multiplied with 1000! + public GT_Recipe(ItemStack aInput1, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, int aSpecialValue, int aType) { + this(T, new ItemStack[] {aInput1}, new ItemStack[] {aOutput1, aOutput2, aOutput3, aOutput4}, null, null, null, null, 0, 0, Math.max(1, aSpecialValue)); + + if (mInputs.length > 0 && aSpecialValue > 0) { + switch (aType) { + // Diesel Generator + case 0: + GT_Recipe_Map.sDieselFuels.addRecipe(this); + break; + // Gas Turbine + case 1: + GT_Recipe_Map.sTurbineFuels.addRecipe(this); + break; + // Thermal Generator + case 2: + GT_Recipe_Map.sHotFuels.addRecipe(this); + break; + // Plasma Generator + case 4: + GT_Recipe_Map.sPlasmaFuels.addRecipe(this); + break; + // Magic Generator + case 5: + GT_Recipe_Map.sMagicFuels.addRecipe(this); + break; + // Fluid Generator. Usually 3. Every wrong Type ends up in the Semifluid Generator + default: + GT_Recipe_Map.sDenseLiquidFuels.addRecipe(this); + break; + } + } + } + + public GT_Recipe(FluidStack aInput1, FluidStack aInput2, FluidStack aOutput1, int aDuration, int aEUt, int aSpecialValue) { + this(T, null, null, null, null,new FluidStack[] {aInput1, aInput2}, new FluidStack[] {aOutput1}, Math.max(aDuration, 1), aEUt, Math.max(Math.min(aSpecialValue, 160000000), 0)); + if (mInputs.length > 1) { + GT_Recipe_Map.sFusionRecipes.addRecipe(this); + } + } + + public GT_Recipe(ItemStack aInput1, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt) { + this(T, new ItemStack[] {aInput1}, new ItemStack[] {aOutput1, aOutput2}, null, null, null, null, aDuration, aEUt, 0); + if (mInputs.length > 0 && mOutputs[0] != null) { + GT_Recipe_Map.sLatheRecipes.addRecipe(this); + } + } + + public GT_Recipe(ItemStack aInput1, int aCellAmount, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, int aDuration, int aEUt) { + this(T, new ItemStack[] {aInput1, aCellAmount>0?ItemList.Cell_Empty.get(Math.min(64, Math.max(1, aCellAmount))):null}, new ItemStack[] {aOutput1, aOutput2, aOutput3, aOutput4}, null, null, null, null, Math.max(aDuration, 1), Math.max(aEUt, 1), 0); + if (mInputs.length > 0 && mOutputs[0] != null) { + GT_Recipe_Map.sDistillationRecipes.addRecipe(this); + } + } + + public GT_Recipe(ItemStack aInput1, int aInput2, ItemStack aOutput1, ItemStack aOutput2) { + this(T, new ItemStack[] {aInput1, GT_ModHandler.getIC2Item("industrialTnt", aInput2>0?aInput2<64?aInput2:64:1, new ItemStack(Blocks.tnt, aInput2>0?aInput2<64?aInput2:64:1))}, new ItemStack[] {aOutput1, aOutput2}, null, null, null, null, 20, 30, 0); + if (mInputs.length > 0 && mOutputs[0] != null) { + GT_Recipe_Map.sImplosionRecipes.addRecipe(this); + } + } + + public GT_Recipe(int aEUt, int aDuration, ItemStack aInput1, ItemStack aOutput1) { + this(T, new ItemStack[] {aInput1, ItemList.Circuit_Integrated.getWithDamage(0, aInput1.stackSize)}, new ItemStack[] {aOutput1}, null, null, null, null, Math.max(aDuration, 1), Math.max(aEUt, 1), 0); + if (mInputs.length > 0 && mOutputs[0] != null) { + GT_Recipe_Map.sBenderRecipes.addRecipe(this); + } + } + + public GT_Recipe(ItemStack aInput1, ItemStack aInput2, int aEUt, int aDuration, ItemStack aOutput1) { + this(T, aInput2==null ? new ItemStack[] {aInput1} : new ItemStack[] {aInput1, aInput2}, new ItemStack[] {aOutput1}, null, null, null, null, Math.max(aDuration, 1), Math.max(aEUt, 1), 0); + if (mInputs.length > 0 && mOutputs[0] != null) { + GT_Recipe_Map.sAlloySmelterRecipes.addRecipe(this); + } + } + + public GT_Recipe(ItemStack aInput1, int aEUt, ItemStack aInput2, int aDuration, ItemStack aOutput1, ItemStack aOutput2) { + this(T, aInput2==null?new ItemStack[] {aInput1}:new ItemStack[] {aInput1, aInput2}, new ItemStack[] {aOutput1, aOutput2}, null, null, null, null, Math.max(aDuration, 1), Math.max(aEUt, 1), 0); + if (mInputs.length > 0 && mOutputs[0] != null) { + GT_Recipe_Map.sCannerRecipes.addRecipe(this); + } + } + + public GT_Recipe(ItemStack aInput1, ItemStack aOutput1, int aDuration) { + this(T, new ItemStack[] {aInput1}, new ItemStack[] {aOutput1}, null, null, null, null, Math.max(aDuration, 1), 120, 0); + if (mInputs.length > 0 && mOutputs[0] != null) { + GT_Recipe_Map.sVacuumRecipes.addRecipe(this); + } + } + + // ----------------------------------------------------------------------------------------------------------------- + // Here are a few Classes I use for Special Cases in some Machines without having to write a separate Machine Class. + // ----------------------------------------------------------------------------------------------------------------- + + /** + * Abstract Class for general Recipe Handling of non GT Recipes + */ + public static abstract class GT_Recipe_Map_NonGTRecipes extends GT_Recipe_Map { + public GT_Recipe_Map_NonGTRecipes(Collection aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { + super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed); + } + + @Override public boolean containsInput(ItemStack aStack) {return F;} + @Override public boolean containsInput(FluidStack aFluid) {return F;} + @Override public boolean containsInput(Fluid aFluid) {return F;} + + @Override public GT_Recipe addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {return null;} + @Override public GT_Recipe addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {return null;} + @Override public GT_Recipe addRecipe(GT_Recipe aRecipe) {return null;} + @Override public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {return null;} + @Override public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {return null;} + @Override public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, GT_Recipe aRecipe) {return null;} + @Override public GT_Recipe add(GT_Recipe aRecipe) {return null;} + @Override public void reInit() {/**/} + @Override protected GT_Recipe addToItemMap(GT_Recipe aRecipe) {return null;} + } + + /** + * Just a Recipe Map with Utility specifically for Fuels. + */ + public static class GT_Recipe_Map_Fuel extends GT_Recipe_Map { + public GT_Recipe_Map_Fuel(Collection aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { + super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed); + } + + public GT_Recipe addFuel(ItemStack aInput, ItemStack aOutput, int aFuelValueInEU) { + return addFuel(aInput, aOutput, null, null, 10000, aFuelValueInEU); + } + + public GT_Recipe addFuel(ItemStack aInput, ItemStack aOutput, int aChance, int aFuelValueInEU) { + return addFuel(aInput, aOutput, null, null, aChance, aFuelValueInEU); + } + + public GT_Recipe addFuel(FluidStack aFluidInput, FluidStack aFluidOutput, int aFuelValueInEU) { + return addFuel(null, null, aFluidInput, aFluidOutput, 10000, aFuelValueInEU); + } + + public GT_Recipe addFuel(ItemStack aInput, ItemStack aOutput, FluidStack aFluidInput, FluidStack aFluidOutput, int aFuelValueInEU) { + return addFuel(aInput, aOutput, aFluidInput, aFluidOutput, 10000, aFuelValueInEU); + } + + public GT_Recipe addFuel(ItemStack aInput, ItemStack aOutput, FluidStack aFluidInput, FluidStack aFluidOutput, int aChance, int aFuelValueInEU) { + return addRecipe(T, new ItemStack[] {aInput}, new ItemStack[] {aOutput}, null, new int[] {aChance}, new FluidStack[] {aFluidInput}, new FluidStack[] {aFluidOutput}, 0, 0, aFuelValueInEU); + } + } + + /** + * Special Class for Furnace Recipe handling. + */ + public static class GT_Recipe_Map_Furnace extends GT_Recipe_Map_NonGTRecipes { + public GT_Recipe_Map_Furnace(Collection aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { + super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed); + } + + @Override + public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { + if (aInputs == null || aInputs.length <= 0 || aInputs[0] == null) return null; + if (aRecipe != null && aRecipe.isRecipeInputEqual(F, T, aFluids, aInputs)) return aRecipe; + ItemStack tOutput = GT_ModHandler.getSmeltingOutput(aInputs[0], F, null); + return tOutput == null ? null : new GT_Recipe(F, new ItemStack[] {GT_Utility.copyAmount(1, aInputs[0])}, new ItemStack[] {tOutput}, null, null, null, null, 128, 4, 0); + } + + @Override public boolean containsInput(ItemStack aStack) {return GT_ModHandler.getSmeltingOutput(aStack, F, null) != null;} + } + + /** + * Special Class for Microwave Recipe handling. + */ + public static class GT_Recipe_Map_Microwave extends GT_Recipe_Map_NonGTRecipes { + public GT_Recipe_Map_Microwave(Collection aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { + super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed); + } + + @Override + public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { + if (aInputs == null || aInputs.length <= 0 || aInputs[0] == null) return null; + if (aRecipe != null && aRecipe.isRecipeInputEqual(F, T, aFluids, aInputs)) return aRecipe; + ItemStack tOutput = GT_ModHandler.getSmeltingOutput(aInputs[0], F, null); + + if (GT_Utility.areStacksEqual(aInputs[0], new ItemStack(Items.book, 1, W))) { + return new GT_Recipe(F, new ItemStack[] {GT_Utility.copyAmount(1, aInputs[0])}, new ItemStack[] {GT_Utility.getWrittenBook("Manual_Microwave", ItemList.Book_Written_03.get(1))}, null, null, null, null, 32, 4, 0); + } + + // Check Container Item of Input since it is around the Input, then the Input itself, then Container Item of Output and last check the Output itself + for (ItemStack tStack : new ItemStack[] {GT_Utility.getContainerItem(aInputs[0], T), aInputs[0], GT_Utility.getContainerItem(tOutput, T), tOutput}) if (tStack != null) { + if (GT_Utility.areStacksEqual(tStack, new ItemStack(Blocks.netherrack, 1, W), T) + || GT_Utility.areStacksEqual(tStack, new ItemStack(Blocks.tnt, 1, W), T) + || GT_Utility.areStacksEqual(tStack, new ItemStack(Items.egg, 1, W), T) + || GT_Utility.areStacksEqual(tStack, new ItemStack(Items.firework_charge, 1, W), T) + || GT_Utility.areStacksEqual(tStack, new ItemStack(Items.fireworks, 1, W), T) + || GT_Utility.areStacksEqual(tStack, new ItemStack(Items.fire_charge, 1, W), T) + ) { + if (aTileEntity instanceof IGregTechTileEntity) ((IGregTechTileEntity)aTileEntity).doExplosion(aVoltage * 4); + return null; + } + ItemData tData = GT_OreDictUnificator.getItemData(tStack); + + + + if (tData != null) { + if (tData.mMaterial != null && tData.mMaterial.mMaterial != null) { + if (tData.mMaterial.mMaterial.contains(SubTag.METAL) || tData.mMaterial.mMaterial.contains(SubTag.EXPLOSIVE)) { + if (aTileEntity instanceof IGregTechTileEntity) ((IGregTechTileEntity)aTileEntity).doExplosion(aVoltage * 4); + return null; + } + if (tData.mMaterial.mMaterial.contains(SubTag.FLAMMABLE)) { + if (aTileEntity instanceof IGregTechTileEntity) ((IGregTechTileEntity)aTileEntity).setOnFire(); + return null; + } + } + for (MaterialStack tMaterial : tData.mByProducts) if (tMaterial != null) { + if (tMaterial.mMaterial.contains(SubTag.METAL) || tMaterial.mMaterial.contains(SubTag.EXPLOSIVE)) { + if (aTileEntity instanceof IGregTechTileEntity) ((IGregTechTileEntity)aTileEntity).doExplosion(aVoltage * 4); + return null; + } + if (tMaterial.mMaterial.contains(SubTag.FLAMMABLE)) { + if (aTileEntity instanceof IGregTechTileEntity) ((IGregTechTileEntity)aTileEntity).setOnFire(); + return null; + } + } + } + if (TileEntityFurnace.getItemBurnTime(tStack) > 0) { + if (aTileEntity instanceof IGregTechTileEntity) ((IGregTechTileEntity)aTileEntity).setOnFire(); + return null; + } + + } + + return tOutput == null ? null : new GT_Recipe(F, new ItemStack[] {GT_Utility.copyAmount(1, aInputs[0])}, new ItemStack[] {tOutput}, null, null, null, null, 32, 4, 0); + } + + @Override public boolean containsInput(ItemStack aStack) {return GT_ModHandler.getSmeltingOutput(aStack, F, null) != null;} + } + + /** + * Special Class for Unboxinator handling. + */ + public static class GT_Recipe_Map_Unboxinator extends GT_Recipe_Map { + public GT_Recipe_Map_Unboxinator(Collection aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { + super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed); + } + + @Override + public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { + if (aInputs == null || aInputs.length <= 0 || !ItemList.IC2_Scrapbox.isStackEqual(aInputs[0], F, T)) return super.findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, aSpecialSlot, aInputs); + ItemStack tOutput = GT_ModHandler.getRandomScrapboxDrop(); + if (tOutput == null) return super.findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, aSpecialSlot, aInputs); + GT_Recipe rRecipe = new GT_Recipe(F, new ItemStack[] {ItemList.IC2_Scrapbox.get(1)}, new ItemStack[] {tOutput}, null, null, null, null, 16, 1, 0); + // It is not allowed to be buffered due to the random Output + rRecipe.mCanBeBuffered = F; + // Due to its randomness it is not good if there are Items in the Output Slot, because those Items could manipulate the outcome. + rRecipe.mNeedsEmptyOutput = T; + return rRecipe; + } + + @Override public boolean containsInput(ItemStack aStack) {return ItemList.IC2_Scrapbox.isStackEqual(aStack, F, T) || super.containsInput(aStack);} + } + + /** + * Special Class for Fluid Canner handling. + */ + public static class GT_Recipe_Map_FluidCanner extends GT_Recipe_Map { + public GT_Recipe_Map_FluidCanner(Collection aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { + super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed); + } + + @Override + public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { + GT_Recipe rRecipe = super.findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, aSpecialSlot, aInputs); + if (aInputs == null || aInputs.length <= 0 || aInputs[0] == null || rRecipe != null || !GregTech_API.sPostloadFinished) return rRecipe; + if (aFluids != null && aFluids.length > 0 && aFluids[0] != null) { + ItemStack tOutput = GT_Utility.fillFluidContainer(aFluids[0], aInputs[0], F, T); + FluidStack tFluid = GT_Utility.getFluidForFilledItem(tOutput, T); + if (tFluid != null) rRecipe = new GT_Recipe(F, new ItemStack[] {GT_Utility.copyAmount(1, aInputs[0])}, new ItemStack[] {tOutput}, null, null, new FluidStack[] {tFluid}, null, Math.max(tFluid.amount / 64, 16), 1, 0); + } + if (rRecipe == null) { + FluidStack tFluid = GT_Utility.getFluidForFilledItem(aInputs[0], T); + if (tFluid != null) rRecipe = new GT_Recipe(F, new ItemStack[] {GT_Utility.copyAmount(1, aInputs[0])}, new ItemStack[] {GT_Utility.getContainerItem(aInputs[0], T)}, null, null, null, new FluidStack[] {tFluid}, Math.max(tFluid.amount / 64, 16), 1, 0); + } + if (rRecipe != null) rRecipe.mCanBeBuffered = F; + return rRecipe; + } + + @Override public boolean containsInput(ItemStack aStack) {return aStack != null && (super.containsInput(aStack) || (aStack.getItem() instanceof IFluidContainerItem && ((IFluidContainerItem)aStack.getItem()).getCapacity(aStack) > 0));} + @Override public boolean containsInput(FluidStack aFluid) {return T;} + @Override public boolean containsInput(Fluid aFluid) {return T;} + } + + /** + * Special Class for Recycler Recipe handling. + */ + public static class GT_Recipe_Map_Recycler extends GT_Recipe_Map_NonGTRecipes { + public GT_Recipe_Map_Recycler(Collection aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { + super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed); + } + + @Override + public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { + if (aInputs == null || aInputs.length <= 0 || aInputs[0] == null) return null; + if (aRecipe != null && aRecipe.isRecipeInputEqual(F, T, aFluids, aInputs)) return aRecipe; + return new GT_Recipe(F, new ItemStack[] {GT_Utility.copyAmount(1, aInputs[0])}, GT_ModHandler.getRecyclerOutput(GT_Utility.copyAmount(64, aInputs[0]), 0) == null ? null : new ItemStack[] {ItemList.IC2_Scrap.get(1)}, null, new int[] {1250}, null, null, 45, 1, 0); + } + + @Override public boolean containsInput(ItemStack aStack) {return GT_ModHandler.getRecyclerOutput(GT_Utility.copyAmount(64, aStack), 0) != null;} + } + + /** + * Special Class for Compressor Recipe handling. + */ + public static class GT_Recipe_Map_Compressor extends GT_Recipe_Map_NonGTRecipes { + public GT_Recipe_Map_Compressor(Collection aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { + super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed); + } + + @Override + public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { + if (aInputs == null || aInputs.length <= 0 || aInputs[0] == null) return null; + if (aRecipe != null && aRecipe.isRecipeInputEqual(F, T, aFluids, aInputs)) return aRecipe; + ItemStack tComparedInput = GT_Utility.copy(aInputs[0]); + ItemStack[] tOutputItems = GT_ModHandler.getMachineOutput(tComparedInput, ic2.api.recipe.Recipes.compressor.getRecipes(), T, new NBTTagCompound(), null, null, null); + return GT_Utility.arrayContainsNonNull(tOutputItems) ? new GT_Recipe(F, new ItemStack[] {GT_Utility.copyAmount(aInputs[0].stackSize - tComparedInput.stackSize, aInputs[0])}, tOutputItems, null, null, null, null, 400, 2, 0) : null; + } + + @Override public boolean containsInput(ItemStack aStack) {return GT_Utility.arrayContainsNonNull(GT_ModHandler.getMachineOutput(GT_Utility.copyAmount(64, aStack), ic2.api.recipe.Recipes.compressor.getRecipes(), F, new NBTTagCompound(), null, null, null));} + } + + /** + * Special Class for Extractor Recipe handling. + */ + public static class GT_Recipe_Map_Extractor extends GT_Recipe_Map_NonGTRecipes { + public GT_Recipe_Map_Extractor(Collection aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { + super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed); + } + + @Override + public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { + if (aInputs == null || aInputs.length <= 0 || aInputs[0] == null) return null; + if (aRecipe != null && aRecipe.isRecipeInputEqual(F, T, aFluids, aInputs)) return aRecipe; + ItemStack tComparedInput = GT_Utility.copy(aInputs[0]); + ItemStack[] tOutputItems = GT_ModHandler.getMachineOutput(tComparedInput, ic2.api.recipe.Recipes.extractor.getRecipes(), T, new NBTTagCompound(), null, null, null); + return GT_Utility.arrayContainsNonNull(tOutputItems) ? new GT_Recipe(F, new ItemStack[] {GT_Utility.copyAmount(aInputs[0].stackSize - tComparedInput.stackSize, aInputs[0])}, tOutputItems, null, null, null, null, 400, 2, 0) : null; + } + + @Override public boolean containsInput(ItemStack aStack) {return GT_Utility.arrayContainsNonNull(GT_ModHandler.getMachineOutput(GT_Utility.copyAmount(64, aStack), ic2.api.recipe.Recipes.extractor.getRecipes(), F, new NBTTagCompound(), null, null, null));} + } + + /** + * Special Class for Thermal Centrifuge Recipe handling. + */ + public static class GT_Recipe_Map_ThermalCentrifuge extends GT_Recipe_Map_NonGTRecipes { + public GT_Recipe_Map_ThermalCentrifuge(Collection aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { + super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed); + } + + @Override + public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { + if (aInputs == null || aInputs.length <= 0 || aInputs[0] == null) return null; + if (aRecipe != null && aRecipe.isRecipeInputEqual(F, T, aFluids, aInputs)) return aRecipe; + ItemStack tComparedInput = GT_Utility.copy(aInputs[0]); + ItemStack[] tOutputItems = GT_ModHandler.getMachineOutput(tComparedInput, ic2.api.recipe.Recipes.centrifuge.getRecipes(), T, new NBTTagCompound(), null, null, null); + return GT_Utility.arrayContainsNonNull(tOutputItems) ? new GT_Recipe(F, new ItemStack[] {GT_Utility.copyAmount(aInputs[0].stackSize - tComparedInput.stackSize, aInputs[0])}, tOutputItems, null, null, null, null, 400, 48, 0) : null; + } + + @Override public boolean containsInput(ItemStack aStack) {return GT_Utility.arrayContainsNonNull(GT_ModHandler.getMachineOutput(GT_Utility.copyAmount(64, aStack), ic2.api.recipe.Recipes.centrifuge.getRecipes(), F, new NBTTagCompound(), null, null, null));} + } + + /** + * Special Class for Ore Washer Recipe handling. + */ + public static class GT_Recipe_Map_OreWasher extends GT_Recipe_Map_NonGTRecipes { + public GT_Recipe_Map_OreWasher(Collection aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { + super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed); + } + + @Override + public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { + if (aInputs == null || aInputs.length <= 0 || aInputs[0] == null || aFluids == null || aFluids.length < 1 || !GT_ModHandler.isWater(aFluids[0])) return null; + if (aRecipe != null && aRecipe.isRecipeInputEqual(F, T, aFluids, aInputs)) return aRecipe; + ItemStack tComparedInput = GT_Utility.copy(aInputs[0]); + NBTTagCompound aRecipeMetaData = new NBTTagCompound(); + ItemStack[] tOutputItems = GT_ModHandler.getMachineOutput(tComparedInput, ic2.api.recipe.Recipes.oreWashing.getRecipes(), T, aRecipeMetaData, null, null, null); + return GT_Utility.arrayContainsNonNull(tOutputItems) ? new GT_Recipe(F, new ItemStack[] {GT_Utility.copyAmount(aInputs[0].stackSize - tComparedInput.stackSize, aInputs[0])}, tOutputItems, null, null, new FluidStack[] {new FluidStack(aFluids[0].getFluid(), ((NBTTagCompound)aRecipeMetaData.getTag("return")).getInteger("amount"))}, null, 400, 16, 0) : null; + } + + @Override public boolean containsInput(ItemStack aStack) {return GT_Utility.arrayContainsNonNull(GT_ModHandler.getMachineOutput(GT_Utility.copyAmount(64, aStack), ic2.api.recipe.Recipes.oreWashing.getRecipes(), F, new NBTTagCompound(), null, null, null));} + @Override public boolean containsInput(FluidStack aFluid) {return GT_ModHandler.isWater(aFluid);} + @Override public boolean containsInput(Fluid aFluid) {return GT_ModHandler.isWater(new FluidStack(aFluid, 0));} + } + + /** + * Special Class for Macerator/RockCrusher Recipe handling. + */ + public static class GT_Recipe_Map_Macerator extends GT_Recipe_Map { + public GT_Recipe_Map_Macerator(Collection aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { + super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed); + } + + @Override + public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { + if (aInputs == null || aInputs.length <= 0 || aInputs[0] == null || !GregTech_API.sPostloadFinished) return super.findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, aSpecialSlot, aInputs); + aRecipe = super.findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, aSpecialSlot, aInputs); + if (aRecipe != null) return aRecipe; + ItemStack tComparedInput = GT_Utility.copy(aInputs[0]); + ItemStack[] tOutputItems = GT_ModHandler.getMachineOutput(tComparedInput, ic2.api.recipe.Recipes.macerator.getRecipes(), T, new NBTTagCompound(), null, null, null); + return GT_Utility.arrayContainsNonNull(tOutputItems) ? new GT_Recipe(F, new ItemStack[] {GT_Utility.copyAmount(aInputs[0].stackSize - tComparedInput.stackSize, aInputs[0])}, tOutputItems, null, null, null, null, 400, 2, 0) : null; + } + + @Override public boolean containsInput(ItemStack aStack) {return super.containsInput(aStack) || GT_Utility.arrayContainsNonNull(GT_ModHandler.getMachineOutput(GT_Utility.copyAmount(64, aStack), ic2.api.recipe.Recipes.macerator.getRecipes(), F, new NBTTagCompound(), null, null, null));} + } + + /** + * Special Class for Assembler handling. + */ + public static class GT_Recipe_Map_Assembler extends GT_Recipe_Map { + public GT_Recipe_Map_Assembler(Collection aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { + super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed); + } + + @Override + public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { + GT_Recipe rRecipe = super.findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, aSpecialSlot, aInputs); + if (aInputs == null || aInputs.length <= 0 || aInputs[0] == null || rRecipe == null || !GregTech_API.sPostloadFinished) return rRecipe; + for (ItemStack aInput : aInputs) { + if (ItemList.Paper_Printed_Pages.isStackEqual(aInput, F, T)) { + rRecipe = rRecipe.copy(); + rRecipe.mCanBeBuffered = F; + rRecipe.mOutputs[0].setTagCompound(aInput.getTagCompound()); + } + } + return rRecipe; + } + } + + /** + * Special Class for Forming Press handling. + */ + public static class GT_Recipe_Map_FormingPress extends GT_Recipe_Map { + public GT_Recipe_Map_FormingPress(Collection aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { + super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed); + } + + @Override + public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { + GT_Recipe rRecipe = super.findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, aSpecialSlot, aInputs); + if (aInputs == null || aInputs.length < 2 || aInputs[0] == null || aInputs[1] == null || !GregTech_API.sPostloadFinished) return rRecipe; + if (rRecipe == null) { + if (ItemList.Shape_Mold_Name.isStackEqual(aInputs[0], F, T)) { + ItemStack tOutput = GT_Utility.copyAmount(1, aInputs[1]); + tOutput.setStackDisplayName(aInputs[0].getDisplayName()); + rRecipe = new GT_Recipe(F, new ItemStack[] {ItemList.Shape_Mold_Name.get(0), GT_Utility.copyAmount(1, aInputs[1])}, new ItemStack[] {tOutput}, null, null, null, null, 128, 8, 0); + rRecipe.mCanBeBuffered = F; + return rRecipe; + } + if (ItemList.Shape_Mold_Name.isStackEqual(aInputs[1], F, T)) { + ItemStack tOutput = GT_Utility.copyAmount(1, aInputs[0]); + tOutput.setStackDisplayName(aInputs[1].getDisplayName()); + rRecipe = new GT_Recipe(F, new ItemStack[] {ItemList.Shape_Mold_Name.get(0), GT_Utility.copyAmount(1, aInputs[0])}, new ItemStack[] {tOutput}, null, null, null, null, 128, 8, 0); + rRecipe.mCanBeBuffered = F; + return rRecipe; + } + return null; + } + for (ItemStack aMold : aInputs) { + if (ItemList.Shape_Mold_Credit.isStackEqual(aMold, F, T)) { + NBTTagCompound tNBT = aMold.getTagCompound(); + if (tNBT == null) tNBT = new NBTTagCompound(); + if (!tNBT.hasKey("credit_security_id")) tNBT.setLong("credit_security_id", System.nanoTime()); + aMold.setTagCompound(tNBT); + + rRecipe = rRecipe.copy(); + rRecipe.mCanBeBuffered = F; + rRecipe.mOutputs[0].setTagCompound(tNBT); + return rRecipe; + } + } + return rRecipe; + } + } + + /** + * Special Class for Printer handling. + */ + public static class GT_Recipe_Map_Printer extends GT_Recipe_Map { + public GT_Recipe_Map_Printer(Collection aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { + super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed); + } + + @Override + public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { + GT_Recipe rRecipe = super.findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, aSpecialSlot, aInputs); + if (aInputs == null || aInputs.length <= 0 || aInputs[0] == null || aFluids == null || aFluids.length <= 0 || aFluids[0] == null || !GregTech_API.sPostloadFinished) return rRecipe; + + Dyes aDye = null; for (Dyes tDye : Dyes.VALUES) if (tDye.isFluidDye(aFluids[0])) {aDye = tDye; break;} + + if (aDye == null) return rRecipe; + + if (rRecipe == null) { + ItemStack + tOutput = GT_ModHandler.getAllRecipeOutput(aTileEntity==null?null:aTileEntity.getWorld(), aInputs[0], aInputs[0], aInputs[0], aInputs[0], ItemList.DYE_ONLY_ITEMS[aDye.mIndex].get(1), aInputs[0], aInputs[0], aInputs[0], aInputs[0]); + if (tOutput != null) return addRecipe(new GT_Recipe(T, new ItemStack[] {GT_Utility.copyAmount(8, aInputs[0])}, new ItemStack[] {tOutput}, null, null, new FluidStack[] {new FluidStack(aFluids[0].getFluid(), (int)L)}, null, 256, 2, 0), F, F, T); + + tOutput = GT_ModHandler.getAllRecipeOutput(aTileEntity==null?null:aTileEntity.getWorld(), aInputs[0], ItemList.DYE_ONLY_ITEMS[aDye.mIndex].get(1)); + if (tOutput != null) return addRecipe(new GT_Recipe(T, new ItemStack[] {GT_Utility.copyAmount(1, aInputs[0])}, new ItemStack[] {tOutput}, null, null, new FluidStack[] {new FluidStack(aFluids[0].getFluid(), (int)L)}, null, 32, 2, 0), F, F, T); + } else { + if (aInputs[0].getItem() == Items.paper) { + if (!ItemList.Tool_DataStick.isStackEqual(aSpecialSlot, F, T)) return null; + NBTTagCompound tNBT = aSpecialSlot.getTagCompound(); + if (tNBT == null || GT_Utility.isStringInvalid(tNBT.getString("title")) || GT_Utility.isStringInvalid(tNBT.getString("author"))) return null; + + rRecipe = rRecipe.copy(); + rRecipe.mCanBeBuffered = F; + rRecipe.mOutputs[0].setTagCompound(tNBT); + return rRecipe; + } + if (aInputs[0].getItem() == Items.map) { + if (!ItemList.Tool_DataStick.isStackEqual(aSpecialSlot, F, T)) return null; + NBTTagCompound tNBT = aSpecialSlot.getTagCompound(); + if (tNBT == null || !tNBT.hasKey("map_id")) return null; + + rRecipe = rRecipe.copy(); + rRecipe.mCanBeBuffered = F; + rRecipe.mOutputs[0].setItemDamage(tNBT.getShort("map_id")); + return rRecipe; + } + if (ItemList.Paper_Punch_Card_Empty.isStackEqual(aInputs[0], F, T)) { + if (!ItemList.Tool_DataStick.isStackEqual(aSpecialSlot, F, T)) return null; + NBTTagCompound tNBT = aSpecialSlot.getTagCompound(); + if (tNBT == null || !tNBT.hasKey("GT.PunchCardData")) return null; + + rRecipe = rRecipe.copy(); + rRecipe.mCanBeBuffered = F; + rRecipe.mOutputs[0].setTagCompound(GT_Utility.getNBTContainingString(new NBTTagCompound(), "GT.PunchCardData", tNBT.getString("GT.PunchCardData"))); + return rRecipe; + } + } + return rRecipe; + } + + @Override public boolean containsInput(ItemStack aStack) {return T;} + @Override public boolean containsInput(FluidStack aFluid) {return super.containsInput(aFluid) || Dyes.isAnyFluidDye(aFluid);} + @Override public boolean containsInput(Fluid aFluid) {return super.containsInput(aFluid) || Dyes.isAnyFluidDye(aFluid);} + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/util/GT_RecipeRegistrator.java b/src/main/java/gregtech/api/util/GT_RecipeRegistrator.java new file mode 100644 index 0000000..9a2f062 --- /dev/null +++ b/src/main/java/gregtech/api/util/GT_RecipeRegistrator.java @@ -0,0 +1,317 @@ +package gregtech.api.util; + +import static gregtech.api.enums.GT_Values.L; +import static gregtech.api.enums.GT_Values.M; +import static gregtech.api.enums.GT_Values.RA; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.ConfigCategories; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.SubTag; +import gregtech.api.enums.TC_Aspects; +import gregtech.api.enums.TC_Aspects.TC_AspectStack; +import gregtech.api.interfaces.internal.IThaumcraftCompat; +import gregtech.api.objects.ItemData; +import gregtech.api.objects.MaterialStack; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; + +/** + * Class for Automatic Recipe registering. + */ +public class GT_RecipeRegistrator { + public static volatile int VERSION = 508; + + /** List of Materials, which are used in the Creation of Sticks. All Rod Materials are automatically added to this List. */ + public static final List sRodMaterialList = new ArrayList(); + + public static void registerMaterialRecycling(ItemStack aStack, Materials aMaterial, long aMaterialAmount, MaterialStack aByproduct) { + if (GT_Utility.isStackInvalid(aStack)) return; + if (aByproduct != null) {aByproduct = aByproduct.clone(); aByproduct.mAmount /= aStack.stackSize;} + GT_OreDictUnificator.addItemData(GT_Utility.copyAmount(1, aStack), new ItemData(aMaterial, aMaterialAmount / aStack.stackSize, aByproduct)); + } + + public static void registerMaterialRecycling(ItemStack aStack, ItemData aData) { + if (GT_Utility.isStackInvalid(aStack) || GT_Utility.areStacksEqual(new ItemStack(Items.blaze_rod), aStack) || aData == null || !aData.hasValidMaterialData() || aData.mMaterial.mAmount <= 0 || GT_Utility.getFluidForFilledItem(aStack, false) != null) return; + registerReverseMacerating (GT_Utility.copyAmount(1, aStack), aData, aData.mPrefix == null); + registerReverseSmelting (GT_Utility.copyAmount(1, aStack), aData.mMaterial.mMaterial, aData.mMaterial.mAmount, true); + registerReverseFluidSmelting (GT_Utility.copyAmount(1, aStack), aData.mMaterial.mMaterial, aData.mMaterial.mAmount, aData.getByProduct(0)); + registerReverseArcSmelting (GT_Utility.copyAmount(1, aStack), aData); + } + + /** + * @param aStack the stack to be recycled. + * @param aMaterial the Material. + * @param aMaterialAmount the amount of it in Material Units. + */ + public static void registerReverseFluidSmelting(ItemStack aStack, Materials aMaterial, long aMaterialAmount, MaterialStack aByproduct) { + if (aStack == null || aMaterial == null || aMaterial.mSmeltInto.mStandardMoltenFluid == null || !aMaterial.contains(SubTag.SMELTING_TO_FLUID) || (L * aMaterialAmount) / (M * aStack.stackSize) <= 0) return; + RA.addFluidSmelterRecipe(GT_Utility.copyAmount(1, aStack), aByproduct==null?null:aByproduct.mMaterial.contains(SubTag.NO_SMELTING)||!aByproduct.mMaterial.contains(SubTag.METAL)?aByproduct.mMaterial.contains(SubTag.FLAMMABLE)?GT_OreDictUnificator.getDust(Materials.Ash, aByproduct.mAmount/2):aByproduct.mMaterial.contains(SubTag.UNBURNABLE)?GT_OreDictUnificator.getDustOrIngot(aByproduct.mMaterial.mSmeltInto, aByproduct.mAmount):null:GT_OreDictUnificator.getIngotOrDust(aByproduct.mMaterial.mSmeltInto, aByproduct.mAmount), aMaterial.mSmeltInto.getMolten((L * aMaterialAmount) / (M * aStack.stackSize)), 10000, (int)Math.max(1, (24 * aMaterialAmount) / M), Math.max(8, (int)Math.sqrt(2*aMaterial.mSmeltInto.mStandardMoltenFluid.getTemperature()))); + } + + /** + * @param aStack the stack to be recycled. + * @param aMaterial the Material. + * @param aMaterialAmount the amount of it in Material Units. + * @param aAllowAlloySmelter if it is allowed to be recycled inside the Alloy Smelter. + */ + public static void registerReverseSmelting(ItemStack aStack, Materials aMaterial, long aMaterialAmount, boolean aAllowAlloySmelter) { + if (aStack == null || aMaterial == null || aMaterialAmount <= 0 || aMaterial.contains(SubTag.NO_SMELTING) || (aMaterialAmount > M && aMaterial.contains(SubTag.METAL))) return; + aMaterialAmount /= aStack.stackSize; + if (aAllowAlloySmelter) + GT_ModHandler.addSmeltingAndAlloySmeltingRecipe(GT_Utility.copyAmount(1, aStack), GT_OreDictUnificator.getIngot(aMaterial.mSmeltInto, aMaterialAmount)); + else + GT_ModHandler.addSmeltingRecipe(GT_Utility.copyAmount(1, aStack), GT_OreDictUnificator.getIngot(aMaterial.mSmeltInto, aMaterialAmount)); + } + + public static void registerReverseArcSmelting(ItemStack aStack, Materials aMaterial, long aMaterialAmount, MaterialStack aByProduct01, MaterialStack aByProduct02, MaterialStack aByProduct03) { + registerReverseArcSmelting(aStack, new ItemData(aMaterial==null?null:new MaterialStack(aMaterial, aMaterialAmount), aByProduct01, aByProduct02, aByProduct03)); + } + + public static void registerReverseArcSmelting(ItemStack aStack, ItemData aData) { + if (aStack == null || aData == null) return; + aData = new ItemData(aData); + + if (!aData.hasValidMaterialData()) return; + + for (MaterialStack tMaterial : aData.getAllMaterialStacks()) { + if (tMaterial.mMaterial.contains(SubTag.UNBURNABLE)) { + tMaterial.mMaterial = tMaterial.mMaterial.mSmeltInto.mArcSmeltInto; + continue; + } + if (tMaterial.mMaterial.contains(SubTag.EXPLOSIVE)) { + tMaterial.mMaterial = Materials.Ash; + tMaterial.mAmount /= 4; + continue; + } + if (tMaterial.mMaterial.contains(SubTag.FLAMMABLE)) { + tMaterial.mMaterial = Materials.Ash; + tMaterial.mAmount /= 2; + continue; + } + if (tMaterial.mMaterial.contains(SubTag.NO_SMELTING)) { + tMaterial.mAmount = 0; + continue; + } + if (tMaterial.mMaterial.contains(SubTag.METAL)) { + tMaterial.mMaterial = tMaterial.mMaterial.mSmeltInto.mArcSmeltInto; + continue; + } + tMaterial.mAmount = 0; + } + + aData = new ItemData(aData); + + if (aData.mByProducts.length > 3) for (MaterialStack tMaterial : aData.getAllMaterialStacks()) if (tMaterial.mMaterial == Materials.Ash) tMaterial.mAmount = 0; + + aData = new ItemData(aData); + + if (!aData.hasValidMaterialData()) return; + + long tAmount = 0; for (MaterialStack tMaterial : aData.getAllMaterialStacks()) tAmount += tMaterial.mAmount * tMaterial.mMaterial.getMass(); + + RA.addArcFurnaceRecipe(aStack, new ItemStack[] {GT_OreDictUnificator.getIngotOrDust(aData.mMaterial), GT_OreDictUnificator.getIngotOrDust(aData.getByProduct(0)), GT_OreDictUnificator.getIngotOrDust(aData.getByProduct(1)), GT_OreDictUnificator.getIngotOrDust(aData.getByProduct(2))}, null, (int)Math.max(16, tAmount / M), 96); + } + + public static void registerReverseMacerating(ItemStack aStack, Materials aMaterial, long aMaterialAmount, MaterialStack aByProduct01, MaterialStack aByProduct02, MaterialStack aByProduct03, boolean aAllowHammer) { + registerReverseMacerating(aStack, new ItemData(aMaterial==null?null:new MaterialStack(aMaterial, aMaterialAmount), aByProduct01, aByProduct02, aByProduct03), aAllowHammer); + } + + public static void registerReverseMacerating(ItemStack aStack, ItemData aData, boolean aAllowHammer) { + if (aStack == null || aData == null) return; + aData = new ItemData(aData); + + if (!aData.hasValidMaterialData()) return; + + for (MaterialStack tMaterial : aData.getAllMaterialStacks()) tMaterial.mMaterial = tMaterial.mMaterial.mMacerateInto; + + aData = new ItemData(aData); + + if (!aData.hasValidMaterialData()) return; + + long tAmount = 0; for (MaterialStack tMaterial : aData.getAllMaterialStacks()) tAmount += tMaterial.mAmount * tMaterial.mMaterial.getMass(); + + RA.addPulveriserRecipe(aStack, new ItemStack[] {GT_OreDictUnificator.getDust(aData.mMaterial), GT_OreDictUnificator.getDust(aData.getByProduct(0)), GT_OreDictUnificator.getDust(aData.getByProduct(1)), GT_OreDictUnificator.getDust(aData.getByProduct(2))}, null, (int)Math.max(16, tAmount / M), 4); + + if (aAllowHammer) for (MaterialStack tMaterial : aData.getAllMaterialStacks()) if (tMaterial.mMaterial.contains(SubTag.CRYSTAL) && !tMaterial.mMaterial.contains(SubTag.METAL)) { + if (RA.addForgeHammerRecipe(GT_Utility.copyAmount(1, aStack), GT_OreDictUnificator.getGem(aData.mMaterial), 200, 32)) break; + } + ItemStack tDust = GT_OreDictUnificator.getDust(aData.mMaterial); + if (tDust != null && GT_ModHandler.addPulverisationRecipe(GT_Utility.copyAmount(1, aStack), tDust, GT_OreDictUnificator.getDust(aData.getByProduct(0)), 100, GT_OreDictUnificator.getDust(aData.getByProduct(1)), 100, true)) { + if (GregTech_API.sThaumcraftCompat != null) GregTech_API.sThaumcraftCompat.addCrucibleRecipe(IThaumcraftCompat.ADVANCEDENTROPICPROCESSING, aStack, tDust, Arrays.asList(new TC_AspectStack(TC_Aspects.PERDITIO, Math.max(1, (aData.mMaterial.mAmount * 2) / M)))); + } + } + + /** + * You give this Function a Material and it will scan almost everything for adding recycling Recipes + * + * @param aMat a Material, for example an Ingot or a Gem. + * @param aOutput the Dust you usually get from macerating aMat + * @param aRecipeReplacing allows to replace the Recipe with a Plate variant + */ + public static synchronized void registerUsagesForMaterials(ItemStack aMat, String aPlate, boolean aRecipeReplacing) { + if (aMat == null) return; + aMat = GT_Utility.copy(aMat); + ItemStack tStack; + ItemData aItemData = GT_OreDictUnificator.getItemData(aMat); + if (aItemData == null || aItemData.mPrefix != OrePrefixes.ingot) aPlate = null; + if (aPlate != null && GT_OreDictUnificator.getFirstOre(aPlate, 1) == null) aPlate = null; + + sMt1.func_150996_a(aMat.getItem()); + sMt1.stackSize = 1; + Items.feather.setDamage(sMt1, Items.feather.getDamage(aMat)); + + sMt2.func_150996_a(new ItemStack(Blocks.dirt).getItem()); + sMt2.stackSize = 1; + Items.feather.setDamage(sMt2, 0); + + for (ItemStack[] tRecipe : sShapes1) { + int tAmount1 = 0; + for (ItemStack tMat : tRecipe) { + if (tMat == sMt1) tAmount1++; + } + if (aItemData != null && aItemData.hasValidPrefixMaterialData()) for (ItemStack tCrafted : GT_ModHandler.getRecipeOutputs(tRecipe)) { + GT_OreDictUnificator.addItemData(tCrafted, new ItemData(aItemData.mMaterial.mMaterial, aItemData.mMaterial.mAmount * tAmount1)); + } + } + + for (Materials tMaterial : sRodMaterialList) { + ItemStack tMt2 = GT_OreDictUnificator.get(OrePrefixes.stick, tMaterial, 1); + if (tMt2 != null) { + sMt2.func_150996_a(tMt2.getItem()); + sMt2.stackSize = 1; + Items.feather.setDamage(sMt2, Items.feather.getDamage(tMt2)); + + for (int i = 0; i < sShapes1.length; i++) { + ItemStack[] tRecipe = sShapes1[i]; + + int tAmount1 = 0, tAmount2 = 0; + for (ItemStack tMat : tRecipe) { + if (tMat == sMt1) tAmount1++; + if (tMat == sMt2) tAmount2++; + } + for (ItemStack tCrafted : GT_ModHandler.getVanillyToolRecipeOutputs(tRecipe)) { + if (aItemData != null && aItemData.hasValidPrefixMaterialData()) GT_OreDictUnificator.addItemData(tCrafted, new ItemData(aItemData.mMaterial.mMaterial, aItemData.mMaterial.mAmount * tAmount1, new MaterialStack(tMaterial, OrePrefixes.stick.mMaterialAmount * tAmount2))); + + if (aRecipeReplacing && aPlate != null && sShapesA[i] != null && sShapesA[i].length > 1) { + assert aItemData != null; + if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.recipereplacements, aItemData.mMaterial.mMaterial+"."+sShapesA[i][0], true)) { + if (null != (tStack = GT_ModHandler.removeRecipe(tRecipe))) { + switch (sShapesA[i].length) { + case 2: GT_ModHandler.addCraftingRecipe(tStack, GT_ModHandler.RecipeBits.BUFFERED, new Object[] {sShapesA[i][1] , s_P.charAt(0), aPlate, s_R.charAt(0), OrePrefixes.stick.get(tMaterial), s_I.charAt(0), aItemData}); break; + case 3: GT_ModHandler.addCraftingRecipe(tStack, GT_ModHandler.RecipeBits.BUFFERED, new Object[] {sShapesA[i][1], sShapesA[i][2] , s_P.charAt(0), aPlate, s_R.charAt(0), OrePrefixes.stick.get(tMaterial), s_I.charAt(0), aItemData}); break; + default: GT_ModHandler.addCraftingRecipe(tStack, GT_ModHandler.RecipeBits.BUFFERED, new Object[] {sShapesA[i][1], sShapesA[i][2], sShapesA[i][3] , s_P.charAt(0), aPlate, s_R.charAt(0), OrePrefixes.stick.get(tMaterial), s_I.charAt(0), aItemData}); break; + } + } + } + } + } + } + } + } + } + + private static final ItemStack sMt1 = new ItemStack(Blocks.dirt, 1, 0), sMt2 = new ItemStack(Blocks.dirt, 1, 0); + private static final String s_H = "h", s_F = "f", s_I = "I", s_P = "P", s_R = "R"; + + private static final ItemStack[][] + sShapes1 = new ItemStack[][] { + {sMt1, null, sMt1, sMt1, sMt1, sMt1, null, sMt1, null}, + {sMt1, null, sMt1, sMt1, null, sMt1, sMt1, sMt1, sMt1}, + {null, sMt1, null, sMt1, sMt1, sMt1, sMt1, null, sMt1}, + {sMt1, sMt1, sMt1, sMt1, null, sMt1, null, null, null}, + {sMt1, null, sMt1, sMt1, sMt1, sMt1, sMt1, sMt1, sMt1}, + {sMt1, sMt1, sMt1, sMt1, null, sMt1, sMt1, null, sMt1}, + {null, null, null, sMt1, null, sMt1, sMt1, null, sMt1}, + {null, sMt1, null, null, sMt1, null, null, sMt2, null}, + {sMt1, sMt1, sMt1, null, sMt2, null, null, sMt2, null}, + {null, sMt1, null, null, sMt2, null, null, sMt2, null}, + {sMt1, sMt1, null, sMt1, sMt2, null, null, sMt2, null}, + {null, sMt1, sMt1, null, sMt2, sMt1, null, sMt2, null}, + {sMt1, sMt1, null, null, sMt2, null, null, sMt2, null}, + {null, sMt1, sMt1, null, sMt2, null, null, sMt2, null}, + {null, sMt1, null, sMt1, null, null, null, sMt1, sMt2}, + {null, sMt1, null, null, null, sMt1, sMt2, sMt1, null}, + {null, sMt1, null, sMt1, null, sMt1, null, null, sMt2}, + {null, sMt1, null, sMt1, null, sMt1, sMt2, null, null}, + {null, sMt2, null, null, sMt1, null, null, sMt1, null}, + {null, sMt2, null, null, sMt2, null, sMt1, sMt1, sMt1}, + {null, sMt2, null, null, sMt2, null, null, sMt1, null}, + {null, sMt2, null, sMt1, sMt2, null, sMt1, sMt1, null}, + {null, sMt2, null, null, sMt2, sMt1, null, sMt1, sMt1}, + {null, sMt2, null, null, sMt2, null, sMt1, sMt1, null}, + {sMt1, null, null, null, sMt2, null, null, null, sMt2}, + {null, null, sMt1, null, sMt2, null, sMt2, null, null}, + {sMt1, null, null, null, sMt2, null, null, null, null}, + {null, null, sMt1, null, sMt2, null, null, null, null}, + {sMt1, sMt2, null, null, null, null, null, null, null}, + {sMt2, sMt1, null, null, null, null, null, null, null}, + {sMt1, null, null, sMt2, null, null, null, null, null}, + {sMt2, null, null, sMt1, null, null, null, null, null}, + {sMt1, sMt1, sMt1, sMt1, sMt1, sMt1, null, sMt2, null}, + {sMt1, sMt1, null, sMt1, sMt1, sMt2, sMt1, sMt1, null}, + {null, sMt1, sMt1, sMt2, sMt1, sMt1, null, sMt1, sMt1}, + {null, sMt2, null, sMt1, sMt1, sMt1, sMt1, sMt1, sMt1}, + {sMt1, sMt1, sMt1, sMt1, sMt2, sMt1, null, sMt2, null}, + {sMt1, sMt1, null, sMt1, sMt2, sMt2, sMt1, sMt1, null}, + {null, sMt1, sMt1, sMt2, sMt2, sMt1, null, sMt1, sMt1}, + {null, sMt2, null, sMt1, sMt2, sMt1, sMt1, sMt1, sMt1}, + {sMt1, null, null, null, sMt1, null, null, null, null}, + {null, sMt1, null, sMt1, null, null, null, null, null}, + {sMt1, sMt1, null, sMt2, null, sMt1, sMt2, null, null}, + {null, sMt1, sMt1, sMt1, null, sMt2, null, null, sMt2} + }; + + private static final String[][] sShapesA = new String[][] { + null, + null, + null, + {"Helmet" , s_P+s_P+s_P, s_P+s_H+s_P}, + {"ChestPlate" , s_P+s_H+s_P, s_P+s_P+s_P, s_P+s_P+s_P}, + {"Pants" , s_P+s_P+s_P, s_P+s_H+s_P, s_P+" "+s_P}, + {"Boots" , s_P+" "+s_P, s_P+s_H+s_P}, + {"Sword" , " "+s_P+" ", s_F+s_P+s_H, " "+s_R+" "}, + {"Pickaxe" , s_P+s_I+s_I, s_F+s_R+s_H, " "+s_R+" "}, + {"Shovel" , s_F+s_P+s_H, " "+s_R+" ", " "+s_R+" "}, + {"Axe" , s_P+s_I+s_H, s_P+s_R+" ", s_F+s_R+" "}, + {"Axe" , s_P+s_I+s_H, s_P+s_R+" ", s_F+s_R+" "}, + {"Hoe" , s_P+s_I+s_H, s_F+s_R+" ", " "+s_R+" "}, + {"Hoe" , s_P+s_I+s_H, s_F+s_R+" ", " "+s_R+" "}, + {"Sickle" , " "+s_P+" ", s_P+s_F+" ", s_H+s_P+s_R}, + {"Sickle" , " "+s_P+" ", s_P+s_F+" ", s_H+s_P+s_R}, + {"Sickle" , " "+s_P+" ", s_P+s_F+" ", s_H+s_P+s_R}, + {"Sickle" , " "+s_P+" ", s_P+s_F+" ", s_H+s_P+s_R}, + {"Sword" , " "+s_R+" ", s_F+s_P+s_H, " "+s_P+" "}, + {"Pickaxe" , " "+s_R+" ", s_F+s_R+s_H, s_P+s_I+s_I}, + {"Shovel" , " "+s_R+" ", " "+s_R+" ", s_F+s_P+s_H}, + {"Axe" , s_F+s_R+" ", s_P+s_R+" ", s_P+s_I+s_H}, + {"Axe" , s_F+s_R+" ", s_P+s_R+" ", s_P+s_I+s_H}, + {"Hoe" , " "+s_R+" ", s_F+s_R+" ", s_P+s_I+s_H}, + {"Hoe" , " "+s_R+" ", s_F+s_R+" ", s_P+s_I+s_H}, + {"Spear" , s_P+s_H+" ", s_F+s_R+" ", " "+" "+s_R}, + {"Spear" , s_P+s_H+" ", s_F+s_R+" ", " "+" "+s_R}, + {"Knive" , s_H+s_P, s_R+s_F}, + {"Knive" , s_F+s_H, s_P+s_R}, + {"Knive" , s_F+s_H, s_P+s_R}, + {"Knive" , s_P+s_F, s_R+s_H}, + {"Knive" , s_P+s_F, s_R+s_H}, + null, + null, + null, + null, + {"WarAxe" , s_P+s_P+s_P, s_P+s_R+s_P, s_F+s_R+s_H}, + null, + null, + null, + {"Shears" , s_H+s_P, s_P+s_F}, + {"Shears" , s_H+s_P, s_P+s_F}, + {"Scythe" , s_I+s_P+s_H, s_R+s_F+s_P, s_R+" "+" "}, + {"Scythe" , s_H+s_P+s_I, s_P+s_F+s_R, " "+" "+s_R} + }; +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/util/GT_Shaped_Recipe.java b/src/main/java/gregtech/api/util/GT_Shaped_Recipe.java new file mode 100644 index 0000000..dcf4659 --- /dev/null +++ b/src/main/java/gregtech/api/util/GT_Shaped_Recipe.java @@ -0,0 +1,95 @@ +package gregtech.api.util; + +import gregtech.api.interfaces.internal.IGT_CraftingRecipe; +import gregtech.api.items.GT_MetaGenerated_Tool; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import net.minecraftforge.oredict.ShapedOreRecipe; + +public class GT_Shaped_Recipe extends ShapedOreRecipe implements IGT_CraftingRecipe { + public final boolean mDismantleable, mRemovableByGT, mKeepingNBT; + private final Enchantment[] mEnchantmentsAdded; + private final int[] mEnchantmentLevelsAdded; + + public GT_Shaped_Recipe(ItemStack aResult, boolean aDismantleAble, boolean aRemovableByGT, boolean aKeepingNBT, Enchantment[] aEnchantmentsAdded, int[] aEnchantmentLevelsAdded, Object... aRecipe) { + super(aResult, aRecipe); + mEnchantmentsAdded = aEnchantmentsAdded; + mEnchantmentLevelsAdded = aEnchantmentLevelsAdded; + mRemovableByGT = aRemovableByGT; + mKeepingNBT = aKeepingNBT; + mDismantleable = aDismantleAble; + } + + @Override + public boolean matches(InventoryCrafting aGrid, World aWorld) { + if (mKeepingNBT) { + ItemStack tStack = null; + for (int i = 0; i < aGrid.getSizeInventory(); i++) { + if (aGrid.getStackInSlot(i) != null) { + if (tStack != null) { + if ((tStack.hasTagCompound() != aGrid.getStackInSlot(i).hasTagCompound()) || (tStack.hasTagCompound() && !tStack.getTagCompound().equals(aGrid.getStackInSlot(i).getTagCompound()))) return false; + } + tStack = aGrid.getStackInSlot(i); + } + } + } + return super.matches(aGrid, aWorld); + } + + @Override + public ItemStack getCraftingResult(InventoryCrafting aGrid) { + ItemStack rStack = super.getCraftingResult(aGrid); + if (rStack != null) { + // Update the Stack + GT_Utility.updateItemStack(rStack); + + // Keeping NBT + if (mKeepingNBT) for (int i = 0; i < aGrid.getSizeInventory(); i++) { + if (aGrid.getStackInSlot(i) != null && aGrid.getStackInSlot(i).hasTagCompound()) { + rStack.setTagCompound((NBTTagCompound)aGrid.getStackInSlot(i).getTagCompound().copy()); + break; + } + } + + // Charge Values + if (GT_ModHandler.isElectricItem(rStack)) { + GT_ModHandler.dischargeElectricItem(rStack, Integer.MAX_VALUE, Integer.MAX_VALUE, true, false, true); + int tCharge = 0; + for (int i = 0; i < aGrid.getSizeInventory(); i++) tCharge += GT_ModHandler.dischargeElectricItem(aGrid.getStackInSlot(i), Integer.MAX_VALUE, Integer.MAX_VALUE, true, true, true); + if (tCharge > 0) GT_ModHandler.chargeElectricItem(rStack, tCharge, Integer.MAX_VALUE, true, false); + } + + // Saving Ingredients inside the Item. + if (mDismantleable) { + NBTTagCompound rNBT = rStack.getTagCompound(), tNBT = new NBTTagCompound(); + if (rNBT == null) rNBT = new NBTTagCompound(); + for (int i = 0; i < 9; i++) { + ItemStack tStack = aGrid.getStackInSlot(i); + if (tStack != null && GT_Utility.getContainerItem(tStack, true) == null && !(tStack.getItem() instanceof GT_MetaGenerated_Tool)) { + tStack = GT_Utility.copyAmount(1, tStack); + GT_ModHandler.dischargeElectricItem(tStack, Integer.MAX_VALUE, Integer.MAX_VALUE, true, false, true); + tNBT.setTag("Ingredient."+i, tStack.writeToNBT(new NBTTagCompound())); + } + } + rNBT.setTag("GT.CraftingComponents", tNBT); + rStack.setTagCompound(rNBT); + } + + // Add Enchantments + for (int i = 0; i < mEnchantmentsAdded.length; i++) GT_Utility.ItemNBT.addEnchantment(rStack, mEnchantmentsAdded[i], EnchantmentHelper.getEnchantmentLevel(mEnchantmentsAdded[i].effectId, rStack) + mEnchantmentLevelsAdded[i]); + + // Update the Stack again + GT_Utility.updateItemStack(rStack); + } + return rStack; + } + + @Override + public boolean isRemovable() { + return mRemovableByGT; + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/util/GT_Shapeless_Recipe.java b/src/main/java/gregtech/api/util/GT_Shapeless_Recipe.java new file mode 100644 index 0000000..1fcca08 --- /dev/null +++ b/src/main/java/gregtech/api/util/GT_Shapeless_Recipe.java @@ -0,0 +1,95 @@ +package gregtech.api.util; + +import gregtech.api.interfaces.internal.IGT_CraftingRecipe; +import gregtech.api.items.GT_MetaGenerated_Tool; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import net.minecraftforge.oredict.ShapelessOreRecipe; + +public class GT_Shapeless_Recipe extends ShapelessOreRecipe implements IGT_CraftingRecipe { + public final boolean mDismantleable, mRemovableByGT, mKeepingNBT; + private final Enchantment[] mEnchantmentsAdded; + private final int[] mEnchantmentLevelsAdded; + + public GT_Shapeless_Recipe(ItemStack aResult, boolean aDismantleAble, boolean aRemovableByGT, boolean aKeepingNBT, Enchantment[] aEnchantmentsAdded, int[] aEnchantmentLevelsAdded, Object... aRecipe) { + super(aResult, aRecipe); + mEnchantmentsAdded = aEnchantmentsAdded; + mEnchantmentLevelsAdded = aEnchantmentLevelsAdded; + mRemovableByGT = aRemovableByGT; + mKeepingNBT = aKeepingNBT; + mDismantleable = aDismantleAble; + } + + @Override + public boolean matches(InventoryCrafting aGrid, World aWorld) { + if (mKeepingNBT) { + ItemStack tStack = null; + for (int i = 0; i < aGrid.getSizeInventory(); i++) { + if (aGrid.getStackInSlot(i) != null) { + if (tStack != null) { + if ((tStack.hasTagCompound() != aGrid.getStackInSlot(i).hasTagCompound()) || (tStack.hasTagCompound() && !tStack.getTagCompound().equals(aGrid.getStackInSlot(i).getTagCompound()))) return false; + } + tStack = aGrid.getStackInSlot(i); + } + } + } + return super.matches(aGrid, aWorld); + } + + @Override + public ItemStack getCraftingResult(InventoryCrafting aGrid) { + ItemStack rStack = super.getCraftingResult(aGrid); + if (rStack != null) { + // Update the Stack + GT_Utility.updateItemStack(rStack); + + // Keeping NBT + if (mKeepingNBT) for (int i = 0; i < aGrid.getSizeInventory(); i++) { + if (aGrid.getStackInSlot(i) != null && aGrid.getStackInSlot(i).hasTagCompound()) { + rStack.setTagCompound((NBTTagCompound)aGrid.getStackInSlot(i).getTagCompound().copy()); + break; + } + } + + // Charge Values + if (GT_ModHandler.isElectricItem(rStack)) { + GT_ModHandler.dischargeElectricItem(rStack, Integer.MAX_VALUE, Integer.MAX_VALUE, true, false, true); + int tCharge = 0; + for (int i = 0; i < aGrid.getSizeInventory(); i++) tCharge += GT_ModHandler.dischargeElectricItem(aGrid.getStackInSlot(i), Integer.MAX_VALUE, Integer.MAX_VALUE, true, true, true); + if (tCharge > 0) GT_ModHandler.chargeElectricItem(rStack, tCharge, Integer.MAX_VALUE, true, false); + } + + // Saving Ingredients inside the Item. + if (mDismantleable) { + NBTTagCompound rNBT = rStack.getTagCompound(), tNBT = new NBTTagCompound(); + if (rNBT == null) rNBT = new NBTTagCompound(); + for (int i = 0; i < 9; i++) { + ItemStack tStack = aGrid.getStackInSlot(i); + if (tStack != null && GT_Utility.getContainerItem(tStack, true) == null && !(tStack.getItem() instanceof GT_MetaGenerated_Tool)) { + tStack = GT_Utility.copyAmount(1, tStack); + GT_ModHandler.dischargeElectricItem(tStack, Integer.MAX_VALUE, Integer.MAX_VALUE, true, false, true); + tNBT.setTag("Ingredient."+i, tStack.writeToNBT(new NBTTagCompound())); + } + } + rNBT.setTag("GT.CraftingComponents", tNBT); + rStack.setTagCompound(rNBT); + } + + // Add Enchantments + for (int i = 0; i < mEnchantmentsAdded.length; i++) GT_Utility.ItemNBT.addEnchantment(rStack, mEnchantmentsAdded[i], EnchantmentHelper.getEnchantmentLevel(mEnchantmentsAdded[i].effectId, rStack) + mEnchantmentLevelsAdded[i]); + + // Update the Stack again + GT_Utility.updateItemStack(rStack); + } + return rStack; + } + + @Override + public boolean isRemovable() { + return mRemovableByGT; + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/util/GT_SpawnEventHandler.java b/src/main/java/gregtech/api/util/GT_SpawnEventHandler.java new file mode 100644 index 0000000..565b414 --- /dev/null +++ b/src/main/java/gregtech/api/util/GT_SpawnEventHandler.java @@ -0,0 +1,35 @@ +package gregtech.api.util; + +import java.util.ArrayList; +import java.util.List; + +import cpw.mods.fml.common.eventhandler.Event; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.entity.living.LivingSpawnEvent.CheckSpawn; + +public class GT_SpawnEventHandler { + + public static volatile List mobReps = new ArrayList(); + + public GT_SpawnEventHandler(){ + MinecraftForge.EVENT_BUS.register(this); + } + + @SubscribeEvent + public void denyMobSpawn(CheckSpawn event) + { + if (event.getResult() == Event.Result.ALLOW) {return;} + if (event.entityLiving.isCreatureType(EnumCreatureType.monster, false)) + { + for(int[] rep : mobReps){ + if(rep[3] == event.entity.worldObj.provider.dimensionId){ + TileEntity tTile = event.entity.worldObj.getTileEntity(rep[0], rep[1], rep[2]); + + } + } + } + } +} diff --git a/src/main/java/gregtech/api/util/GT_Utility.java b/src/main/java/gregtech/api/util/GT_Utility.java new file mode 100644 index 0000000..ca294ff --- /dev/null +++ b/src/main/java/gregtech/api/util/GT_Utility.java @@ -0,0 +1,1768 @@ +package gregtech.api.util; + +import static gregtech.api.enums.GT_Values.D1; +import static gregtech.api.enums.GT_Values.DW; +import static gregtech.api.enums.GT_Values.E; +import static gregtech.api.enums.GT_Values.F; +import static gregtech.api.enums.GT_Values.GT; +import static gregtech.api.enums.GT_Values.L; +import static gregtech.api.enums.GT_Values.M; +import static gregtech.api.enums.GT_Values.NW; +import static gregtech.api.enums.GT_Values.T; +import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.GT_Values.W; + +import java.lang.reflect.Constructor; +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.text.DecimalFormat; +import java.text.DecimalFormatSymbols; +import java.text.NumberFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Random; + +import cpw.mods.fml.common.FMLCommonHandler; +import gregtech.api.GregTech_API; +import gregtech.api.damagesources.GT_DamageSources; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.SubTag; +import gregtech.api.events.BlockScanningEvent; +import gregtech.api.interfaces.IDebugableBlock; +import gregtech.api.interfaces.IProjectileItem; +import gregtech.api.interfaces.tileentity.IBasicEnergyContainer; +import gregtech.api.interfaces.tileentity.ICoverable; +import gregtech.api.interfaces.tileentity.IGregTechDeviceInformation; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.interfaces.tileentity.IMachineProgress; +import gregtech.api.interfaces.tileentity.IUpgradableMachine; +import gregtech.api.items.GT_EnergyArmor_Item; +import gregtech.api.items.GT_Generic_Item; +import gregtech.api.net.GT_Packet_Sound; +import gregtech.api.objects.GT_ItemStack; +import gregtech.api.objects.ItemData; +import gregtech.api.threads.GT_Runnable_Sound; +import ic2.api.recipe.IRecipeInput; +import ic2.api.recipe.RecipeInputItemStack; +import ic2.api.recipe.RecipeInputOreDict; +import ic2.api.recipe.RecipeOutput; +import net.minecraft.block.Block; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EnumCreatureAttribute; +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.init.Items; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTBase.NBTPrimitive; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.nbt.NBTTagString; +import net.minecraft.network.play.server.S07PacketRespawn; +import net.minecraft.network.play.server.S1DPacketEntityEffect; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.server.MinecraftServer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; +import net.minecraftforge.common.DimensionManager; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidContainerRegistry.FluidContainerData; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidContainerItem; +import net.minecraftforge.fluids.IFluidHandler; + +/** + * NEVER INCLUDE THIS FILE IN YOUR MOD!!! + * + * Just a few Utility Functions I use. + */ +public class GT_Utility { + public static volatile int VERSION = 508; + + public static class ItemNBT { + public static void setNBT(ItemStack aStack, NBTTagCompound aNBT) { + if (aNBT == null) {aStack.setTagCompound(null); return;} + ArrayList tTagsToRemove = new ArrayList(); + for (Object tKey : aNBT.func_150296_c()) { + NBTBase tValue = aNBT.getTag((String)tKey); + if (tValue == null || (tValue instanceof NBTPrimitive && ((NBTPrimitive)tValue).func_150291_c() == 0) || (tValue instanceof NBTTagString && isStringInvalid(((NBTTagString)tValue).func_150285_a_()))) tTagsToRemove.add((String)tKey); + } + for (Object tKey : tTagsToRemove) aNBT.removeTag((String)tKey); + aStack.setTagCompound(aNBT.hasNoTags()?null:aNBT); + } + + public static NBTTagCompound getNBT(ItemStack aStack) { + NBTTagCompound rNBT = aStack.getTagCompound(); + return rNBT==null?new NBTTagCompound():rNBT; + } + + public static void setPunchCardData(ItemStack aStack, String aPunchCardData) { + NBTTagCompound tNBT = getNBT(aStack); + tNBT.setString("GT.PunchCardData", aPunchCardData); + setNBT(aStack, tNBT); + } + public static String getPunchCardData(ItemStack aStack) { + NBTTagCompound tNBT = getNBT(aStack); + return tNBT.getString("GT.PunchCardData"); + } + + public static void setLighterFuel(ItemStack aStack, long aFuel) { + NBTTagCompound tNBT = getNBT(aStack); + tNBT.setLong("GT.LighterFuel", aFuel); + setNBT(aStack, tNBT); + } + public static long getLighterFuel(ItemStack aStack) { + NBTTagCompound tNBT = getNBT(aStack); + return tNBT.getLong("GT.LighterFuel"); + } + + public static void setMapID(ItemStack aStack, short aMapID) { + NBTTagCompound tNBT = getNBT(aStack); + tNBT.setShort("map_id", aMapID); + setNBT(aStack, tNBT); + } + public static short getMapID(ItemStack aStack) { + NBTTagCompound tNBT = getNBT(aStack); + if (!tNBT.hasKey("map_id")) return -1; + return tNBT.getShort("map_id"); + } + + public static void setBookTitle(ItemStack aStack, String aTitle) { + NBTTagCompound tNBT = getNBT(aStack); + tNBT.setString("title", aTitle); + setNBT(aStack, tNBT); + } + public static String getBookTitle(ItemStack aStack) { + NBTTagCompound tNBT = getNBT(aStack); + return tNBT.getString("title"); + } + + public static void setBookAuthor(ItemStack aStack, String aAuthor) { + NBTTagCompound tNBT = getNBT(aStack); + tNBT.setString("author", aAuthor); + setNBT(aStack, tNBT); + } + public static String getBookAuthor(ItemStack aStack) { + NBTTagCompound tNBT = getNBT(aStack); + return tNBT.getString("author"); + } + + public static void addEnchantment(ItemStack aStack, Enchantment aEnchantment, int aLevel) { + NBTTagCompound tNBT = getNBT(aStack), tEnchantmentTag; + if (!tNBT.hasKey("ench", 9)) tNBT.setTag("ench", new NBTTagList()); + NBTTagList tList = tNBT.getTagList("ench", 10); + + boolean temp = T; + + for (int i = 0; i < tList.tagCount(); i++) { + tEnchantmentTag = tList.getCompoundTagAt(i); + if (tEnchantmentTag.getShort("id") == aEnchantment.effectId) { + tEnchantmentTag.setShort("id", (short)aEnchantment.effectId); + tEnchantmentTag.setShort("lvl", (byte)aLevel); + temp = F; + break; + } + } + + if (temp) { + tEnchantmentTag = new NBTTagCompound(); + tEnchantmentTag.setShort("id", (short)aEnchantment.effectId); + tEnchantmentTag.setShort("lvl", (byte)aLevel); + tList.appendTag(tEnchantmentTag); + } + aStack.setTagCompound(tNBT); + } + } + + /** + * THIS IS BULLSHIT!!! WHY DO I HAVE TO DO THIS SHIT JUST TO HAVE ENCHANTS PROPERLY!?! + */ + public static class GT_EnchantmentHelper { + private static final BullshitIteratorA mBullshitIteratorA = new BullshitIteratorA(); + private static final BullshitIteratorB mBullshitIteratorB = new BullshitIteratorB(); + + private static void applyBullshit(IBullshit aBullshitModifier, ItemStack aStack) { + if (aStack != null) { + NBTTagList nbttaglist = aStack.getEnchantmentTagList(); + if (nbttaglist != null) { + for (int i = 0; i < nbttaglist.tagCount(); ++i) { + try { + short short1 = nbttaglist.getCompoundTagAt(i).getShort("id"); + short short2 = nbttaglist.getCompoundTagAt(i).getShort("lvl"); + if (Enchantment.enchantmentsList[short1] != null) aBullshitModifier.calculateModifier(Enchantment.enchantmentsList[short1], short2); + } catch(Throwable e) { + // + } + } + } + } + } + + private static void applyArrayOfBullshit(IBullshit aBullshitModifier, ItemStack[] aStacks) { + ItemStack[] aitemstack1 = aStacks; + int i = aStacks.length; + for (int j = 0; j < i; ++j) { + ItemStack itemstack = aitemstack1[j]; + applyBullshit(aBullshitModifier, itemstack); + } + } + + public static void applyBullshitA(EntityLivingBase aPlayer, Entity aEntity, ItemStack aStack) { + mBullshitIteratorA.mPlayer = aPlayer; + mBullshitIteratorA.mEntity = aEntity; + if (aPlayer != null) applyArrayOfBullshit(mBullshitIteratorA, aPlayer.getLastActiveItems()); + if (aStack != null) applyBullshit(mBullshitIteratorA, aStack); + } + + public static void applyBullshitB(EntityLivingBase aPlayer, Entity aEntity, ItemStack aStack) { + mBullshitIteratorB.mPlayer = aPlayer; + mBullshitIteratorB.mEntity = aEntity; + if (aPlayer != null) applyArrayOfBullshit(mBullshitIteratorB, aPlayer.getLastActiveItems()); + if (aStack != null) applyBullshit(mBullshitIteratorB, aStack); + } + + static final class BullshitIteratorA implements IBullshit { + public EntityLivingBase mPlayer; + public Entity mEntity; + BullshitIteratorA() {} + + @Override + public void calculateModifier(Enchantment aEnchantment, int aLevel) { + aEnchantment.func_151367_b(mPlayer, mEntity, aLevel); + } + } + + static final class BullshitIteratorB implements IBullshit { + public EntityLivingBase mPlayer; + public Entity mEntity; + BullshitIteratorB() {} + + @Override + public void calculateModifier(Enchantment aEnchantment, int aLevel) { + aEnchantment.func_151368_a(mPlayer, mEntity, aLevel); + } + } + + interface IBullshit { + void calculateModifier(Enchantment aEnchantment, int aLevel); + } + } + + public static Field getPublicField(Object aObject, String aField) { + Field rField = null; + try { + rField = aObject.getClass().getDeclaredField(aField); + } catch (Throwable e) {/*Do nothing*/} + return rField; + } + + public static Field getField(Object aObject, String aField) { + Field rField = null; + try { + rField = aObject.getClass().getDeclaredField(aField); + rField.setAccessible(T); + } catch (Throwable e) {/*Do nothing*/} + return rField; + } + + public static Field getField(Class aObject, String aField) { + Field rField = null; + try { + rField = aObject.getDeclaredField(aField); + rField.setAccessible(T); + } catch (Throwable e) {/*Do nothing*/} + return rField; + } + + public static Method getMethod(Class aObject, String aMethod, Class... aParameterTypes) { + Method rMethod = null; + try { + rMethod = aObject.getMethod(aMethod, aParameterTypes); + rMethod.setAccessible(T); + } catch (Throwable e) {/*Do nothing*/} + return rMethod; + } + + public static Method getMethod(Object aObject, String aMethod, Class... aParameterTypes) { + Method rMethod = null; + try { + rMethod = aObject.getClass().getMethod(aMethod, aParameterTypes); + rMethod.setAccessible(T); + } catch (Throwable e) {/*Do nothing*/} + return rMethod; + } + + public static Field getField(Object aObject, String aField, boolean aPrivate, boolean aLogErrors) { + try { + Field tField = (aObject instanceof Class)?((Class)aObject).getDeclaredField(aField):(aObject instanceof String)?Class.forName((String)aObject).getDeclaredField(aField):aObject.getClass().getDeclaredField(aField); + if (aPrivate) tField.setAccessible(T); + return tField; + } catch (Throwable e) { + if (aLogErrors) e.printStackTrace(GT_Log.err); + } + return null; + } + + public static Object getFieldContent(Object aObject, String aField, boolean aPrivate, boolean aLogErrors) { + try { + Field tField = (aObject instanceof Class)?((Class)aObject).getDeclaredField(aField):(aObject instanceof String)?Class.forName((String)aObject).getDeclaredField(aField):aObject.getClass().getDeclaredField(aField); + if (aPrivate) tField.setAccessible(T); + return tField.get(aObject instanceof Class || aObject instanceof String ? null : aObject); + } catch (Throwable e) { + if (aLogErrors) e.printStackTrace(GT_Log.err); + } + return null; + } + + public static Object callPublicMethod(Object aObject, String aMethod, Object... aParameters) { + return callMethod(aObject, aMethod, F, F, T, aParameters); + } + + public static Object callPrivateMethod(Object aObject, String aMethod, Object... aParameters) { + return callMethod(aObject, aMethod, T, F, T, aParameters); + } + + public static Object callMethod(Object aObject, String aMethod, boolean aPrivate, boolean aUseUpperCasedDataTypes, boolean aLogErrors, Object... aParameters) { + try { + Class[] tParameterTypes = new Class[aParameters.length]; + for (byte i = 0; i < aParameters.length; i++) { + if (aParameters[i] instanceof Class) { + tParameterTypes[i] = (Class)aParameters[i]; + aParameters[i] = null; + } else { + tParameterTypes[i] = aParameters[i].getClass(); + } + if (!aUseUpperCasedDataTypes) { + if (tParameterTypes[i] == Boolean.class ) tParameterTypes[i] = boolean.class; else + if (tParameterTypes[i] == Byte.class ) tParameterTypes[i] = byte.class; else + if (tParameterTypes[i] == Short.class ) tParameterTypes[i] = short.class; else + if (tParameterTypes[i] == Integer.class ) tParameterTypes[i] = int.class; else + if (tParameterTypes[i] == Long.class ) tParameterTypes[i] = long.class; else + if (tParameterTypes[i] == Float.class ) tParameterTypes[i] = float.class; else + if (tParameterTypes[i] == Double.class ) tParameterTypes[i] = double.class; + } + } + + Method tMethod = (aObject instanceof Class)?((Class)aObject).getMethod(aMethod, tParameterTypes):aObject.getClass().getMethod(aMethod, tParameterTypes); + if (aPrivate) tMethod.setAccessible(T); + return tMethod.invoke(aObject, aParameters); + } catch (Throwable e) { + if (aLogErrors) e.printStackTrace(GT_Log.err); + } + return null; + } + + public static Object callConstructor(String aClass, int aConstructorIndex, Object aReplacementObject, boolean aLogErrors, Object... aParameters) { + if (aConstructorIndex < 0) { + try { + for (Constructor tConstructor : Class.forName(aClass).getConstructors()) { + try { + return tConstructor.newInstance(aParameters); + } catch (Throwable e) {/*Do nothing*/} + } + } catch (Throwable e) { + if (aLogErrors) e.printStackTrace(GT_Log.err); + } + } else { + try { + return Class.forName(aClass).getConstructors()[aConstructorIndex].newInstance(aParameters); + } catch (Throwable e) { + if (aLogErrors) e.printStackTrace(GT_Log.err); + } + } + return aReplacementObject; + } + + public static String capitalizeString(String aString) { + if (aString != null && aString.length() > 0) return aString.substring(0, 1).toUpperCase() + aString.substring(1); + return E; + } + + public static boolean getPotion(EntityLivingBase aPlayer, int aPotionIndex) { + try { + Field tPotionHashmap = null; + + Field[] var3 = EntityLiving.class.getDeclaredFields(); + int var4 = var3.length; + + for (int var5 = 0; var5 < var4; ++var5) { + Field var6 = var3[var5]; + if (var6.getType() == HashMap.class) { + tPotionHashmap = var6; + tPotionHashmap.setAccessible(T); + break; + } + } + + if (tPotionHashmap != null) return ((HashMap)tPotionHashmap.get(aPlayer)).get(Integer.valueOf(aPotionIndex)) != null; + } catch (Throwable e) { + if (D1) e.printStackTrace(GT_Log.err); + } + return F; + } + + public static String getClassName(Object aObject) { + if (aObject == null) return "null"; + return aObject.getClass().getName().substring(aObject.getClass().getName().lastIndexOf(".")+1); + } + + public static void removePotion(EntityLivingBase aPlayer, int aPotionIndex) { + try { + Field tPotionHashmap = null; + + Field[] var3 = EntityLiving.class.getDeclaredFields(); + int var4 = var3.length; + + for (int var5 = 0; var5 < var4; ++var5) { + Field var6 = var3[var5]; + if (var6.getType() == HashMap.class) { + tPotionHashmap = var6; + tPotionHashmap.setAccessible(T); + break; + } + } + + if (tPotionHashmap != null) ((HashMap)tPotionHashmap.get(aPlayer)).remove(Integer.valueOf(aPotionIndex)); + } catch (Throwable e) { + if (D1) e.printStackTrace(GT_Log.err); + } + } + + public static boolean getFullInvisibility(EntityPlayer aPlayer) { + try { + if (aPlayer.isInvisible()) { + for (int i = 0; i < 4; i++) { + if (aPlayer.inventory.armorInventory[i] != null) { + if (aPlayer.inventory.armorInventory[i].getItem() instanceof GT_EnergyArmor_Item) { + if ((((GT_EnergyArmor_Item)aPlayer.inventory.armorInventory[i].getItem()).mSpecials & 512) != 0) { + if (GT_ModHandler.canUseElectricItem(aPlayer.inventory.armorInventory[i], 10000)) { + return T; + } + } + } + } + } + } + } catch(Throwable e) {if (D1) e.printStackTrace(GT_Log.err);} + return F; + } + + public static ItemStack suckOneItemStackAt(World aWorld, double aX, double aY, double aZ, double aL, double aH, double aW) { + for (EntityItem tItem : (ArrayList)aWorld.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(aX, aY, aZ, aX+aL, aY+aH, aZ+aW))) { + if (!tItem.isDead) { + aWorld.removeEntity(tItem); + tItem.setDead(); + return tItem.getEntityItem(); + } + } + return null; + } + + public static byte getOppositeSide(int aSide) { + return (byte)ForgeDirection.getOrientation(aSide).getOpposite().ordinal(); + } + + public static byte getTier(long l) { + byte i = -1; + while (++i < V.length) if (l <= V[i]) return i; + return i; + } + + public static void sendChatToPlayer(EntityPlayer aPlayer, String aChatMessage) { + if (aPlayer != null && aPlayer instanceof EntityPlayerMP && aChatMessage != null) { + aPlayer.addChatComponentMessage(new ChatComponentText(aChatMessage)); + } + } + + public static boolean TE_CHECK = F, BC_CHECK = F, CHECK_ALL = T; + + public static void checkAvailabilities() { + if (CHECK_ALL) { + CHECK_ALL = F; + } + } + + public static boolean isConnectableNonInventoryPipe(Object aTileEntity, int aSide) { + if (aTileEntity == null) return F; + checkAvailabilities(); + return F; + } + + /** + * Moves Stack from Inv-Slot to Inv-Slot, without checking if its even allowed. + * @return the Amount of moved Items + */ + public static byte moveStackIntoPipe(IInventory aTileEntity1, Object aTileEntity2, int[] aGrabSlots, int aGrabFrom, int aPutTo, List aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize, byte aMaxMoveAtOnce, byte aMinMoveAtOnce) { + if (aTileEntity1 == null || aMaxTargetStackSize <= 0 || aMinTargetStackSize <= 0 || aMinTargetStackSize > aMaxTargetStackSize || aMaxMoveAtOnce <= 0 || aMinMoveAtOnce > aMaxMoveAtOnce) return 0; + if (aTileEntity2 != null) { + checkAvailabilities(); + } + + ForgeDirection tDirection = ForgeDirection.getOrientation(aGrabFrom); + if (aTileEntity1 instanceof TileEntity && tDirection != ForgeDirection.UNKNOWN && tDirection.getOpposite() == ForgeDirection.getOrientation(aPutTo)) { + int tX = ((TileEntity)aTileEntity1).xCoord + tDirection.offsetX, tY = ((TileEntity)aTileEntity1).yCoord + tDirection.offsetY, tZ = ((TileEntity)aTileEntity1).zCoord + tDirection.offsetZ; + if (!hasBlockHitBox(((TileEntity)aTileEntity1).getWorldObj(), tX, tY, tZ)) { + for (int i = 0; i < aGrabSlots.length; i++) { + if (listContainsItem(aFilter, aTileEntity1.getStackInSlot(aGrabSlots[i]), T, aInvertFilter)) { + if (isAllowedToTakeFromSlot(aTileEntity1, aGrabSlots[i], (byte)aGrabFrom, aTileEntity1.getStackInSlot(aGrabSlots[i]))) { + if (Math.max(aMinMoveAtOnce, aMinTargetStackSize) <= aTileEntity1.getStackInSlot(aGrabSlots[i]).stackSize) { + ItemStack tStack = copyAmount(Math.min(aTileEntity1.getStackInSlot(aGrabSlots[i]).stackSize, Math.min(aMaxMoveAtOnce, aMaxTargetStackSize)), aTileEntity1.getStackInSlot(aGrabSlots[i])); + EntityItem tEntity = new EntityItem(((TileEntity)aTileEntity1).getWorldObj(), tX+0.5, tY+0.5, tZ+0.5, tStack); + tEntity.motionX = tEntity.motionY = tEntity.motionZ = 0; + ((TileEntity)aTileEntity1).getWorldObj().spawnEntityInWorld(tEntity); + aTileEntity1.decrStackSize(aGrabSlots[i], tStack.stackSize); + aTileEntity1.markDirty(); + return (byte)tStack.stackSize; + } + } + } + } + } + } + return 0; + } + + /** + * Moves Stack from Inv-Slot to Inv-Slot, without checking if its even allowed. (useful for internal Inventory Operations) + * @return the Amount of moved Items + */ + public static byte moveStackFromSlotAToSlotB(IInventory aTileEntity1, IInventory aTileEntity2, int aGrabFrom, int aPutTo, byte aMaxTargetStackSize, byte aMinTargetStackSize, byte aMaxMoveAtOnce, byte aMinMoveAtOnce) { + if (aTileEntity1 == null || aTileEntity2 == null || aMaxTargetStackSize <= 0 || aMinTargetStackSize <= 0 || aMinTargetStackSize > aMaxTargetStackSize || aMaxMoveAtOnce <= 0 || aMinMoveAtOnce > aMaxMoveAtOnce) return 0; + + ItemStack tStack1 = aTileEntity1.getStackInSlot(aGrabFrom), tStack2 = aTileEntity2.getStackInSlot(aPutTo), tStack3 = null; + if (tStack1 != null) { + if (tStack2 != null && !areStacksEqual(tStack1, tStack2)) return 0; + tStack3 = copy(tStack1); + aMaxTargetStackSize = (byte)Math.min(aMaxTargetStackSize, Math.min(tStack3.getMaxStackSize(), Math.min(tStack2==null?Integer.MAX_VALUE:tStack2.getMaxStackSize(), aTileEntity2.getInventoryStackLimit()))); + tStack3.stackSize = Math.min(tStack3.stackSize, aMaxTargetStackSize - (tStack2 == null?0:tStack2.stackSize)); + if (tStack3.stackSize > aMaxMoveAtOnce) tStack3.stackSize = aMaxMoveAtOnce; + if (tStack3.stackSize + (tStack2==null?0:tStack2.stackSize) >= Math.min(tStack3.getMaxStackSize(), aMinTargetStackSize) && tStack3.stackSize >= aMinMoveAtOnce) { + tStack3 = aTileEntity1.decrStackSize(aGrabFrom, tStack3.stackSize); + aTileEntity1.markDirty(); + if (tStack3 != null) { + if (tStack2 == null) { + aTileEntity2.setInventorySlotContents(aPutTo, copy(tStack3)); + aTileEntity2.markDirty(); + } else { + tStack2.stackSize += tStack3.stackSize; + aTileEntity2.markDirty(); + } + return (byte)tStack3.stackSize; + } + } + } + return 0; + } + + public static boolean isAllowedToTakeFromSlot(IInventory aTileEntity, int aSlot, byte aSide, ItemStack aStack) { + if (ForgeDirection.getOrientation(aSide) == ForgeDirection.UNKNOWN) { + return isAllowedToTakeFromSlot(aTileEntity, aSlot, (byte)0, aStack) + || isAllowedToTakeFromSlot(aTileEntity, aSlot, (byte)1, aStack) + || isAllowedToTakeFromSlot(aTileEntity, aSlot, (byte)2, aStack) + || isAllowedToTakeFromSlot(aTileEntity, aSlot, (byte)3, aStack) + || isAllowedToTakeFromSlot(aTileEntity, aSlot, (byte)4, aStack) + || isAllowedToTakeFromSlot(aTileEntity, aSlot, (byte)5, aStack); + } + if (aTileEntity instanceof ISidedInventory) return ((ISidedInventory)aTileEntity).canExtractItem(aSlot, aStack, aSide); + return T; + } + + public static boolean isAllowedToPutIntoSlot(IInventory aTileEntity, int aSlot, byte aSide, ItemStack aStack, byte aMaxStackSize) { + ItemStack tStack = aTileEntity.getStackInSlot(aSlot); + if (tStack != null && (!areStacksEqual(tStack, aStack) || tStack.stackSize >= tStack.getMaxStackSize())) return F; + if (ForgeDirection.getOrientation(aSide) == ForgeDirection.UNKNOWN) { + return isAllowedToPutIntoSlot(aTileEntity, aSlot, (byte)0, aStack, aMaxStackSize) + || isAllowedToPutIntoSlot(aTileEntity, aSlot, (byte)1, aStack, aMaxStackSize) + || isAllowedToPutIntoSlot(aTileEntity, aSlot, (byte)2, aStack, aMaxStackSize) + || isAllowedToPutIntoSlot(aTileEntity, aSlot, (byte)3, aStack, aMaxStackSize) + || isAllowedToPutIntoSlot(aTileEntity, aSlot, (byte)4, aStack, aMaxStackSize) + || isAllowedToPutIntoSlot(aTileEntity, aSlot, (byte)5, aStack, aMaxStackSize); + } + if (aTileEntity instanceof ISidedInventory && !((ISidedInventory)aTileEntity).canInsertItem(aSlot, aStack, aSide)) return F; + return aTileEntity.isItemValidForSlot(aSlot, aStack); + } + + /** + * Moves Stack from Inv-Side to Inv-Side. + * @return the Amount of moved Items + */ + public static byte moveOneItemStack(Object aTileEntity1, Object aTileEntity2, byte aGrabFrom, byte aPutTo, List aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize, byte aMaxMoveAtOnce, byte aMinMoveAtOnce) { + if (aTileEntity1 != null && aTileEntity1 instanceof IInventory) return moveOneItemStack((IInventory)aTileEntity1, aTileEntity2, aGrabFrom, aPutTo, aFilter, aInvertFilter, aMaxTargetStackSize, aMinTargetStackSize, aMaxMoveAtOnce, aMinMoveAtOnce, T); + return 0; + } + + /** + * This is only because I needed an additional Parameter for the Double Chest Check. + */ + private static byte moveOneItemStack(IInventory aTileEntity1, Object aTileEntity2, byte aGrabFrom, byte aPutTo, List aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize, byte aMaxMoveAtOnce, byte aMinMoveAtOnce, boolean aDoCheckChests) { + if (aTileEntity1 == null || aMaxTargetStackSize <= 0 || aMinTargetStackSize <= 0 || aMaxMoveAtOnce <= 0 || aMinTargetStackSize > aMaxTargetStackSize || aMinMoveAtOnce > aMaxMoveAtOnce) return 0; + + int[] tGrabSlots = null; + if (aTileEntity1 instanceof ISidedInventory) tGrabSlots = ((ISidedInventory)aTileEntity1).getAccessibleSlotsFromSide(aGrabFrom); + if (tGrabSlots == null) { + tGrabSlots = new int[aTileEntity1.getSizeInventory()]; + for (int i = 0; i < tGrabSlots.length; i++) tGrabSlots[i] = i; + } + + if (aTileEntity2 != null && aTileEntity2 instanceof IInventory) { + int[] tPutSlots = null; + if (aTileEntity2 instanceof ISidedInventory) tPutSlots = ((ISidedInventory)aTileEntity2).getAccessibleSlotsFromSide(aPutTo); + + if (tPutSlots == null) { + tPutSlots = new int[((IInventory)aTileEntity2).getSizeInventory()]; + for (int i = 0; i < tPutSlots.length; i++) tPutSlots[i] = i; + } + + for (int i = 0; i < tGrabSlots.length; i++) { + for (int j = 0; j < tPutSlots.length; j++) { + if (listContainsItem(aFilter, aTileEntity1.getStackInSlot(tGrabSlots[i]), T, aInvertFilter)) { + if (isAllowedToTakeFromSlot(aTileEntity1, tGrabSlots[i], aGrabFrom, aTileEntity1.getStackInSlot(tGrabSlots[i]))) { + if (isAllowedToPutIntoSlot((IInventory)aTileEntity2, tPutSlots[j], aPutTo, aTileEntity1.getStackInSlot(tGrabSlots[i]), aMaxTargetStackSize)) { + byte tMovedItemCount = moveStackFromSlotAToSlotB(aTileEntity1, (IInventory)aTileEntity2, tGrabSlots[i], tPutSlots[j], aMaxTargetStackSize, aMinTargetStackSize, aMaxMoveAtOnce, aMinMoveAtOnce); + if (tMovedItemCount > 0) return tMovedItemCount; + } + } + } + } + } + + if (aDoCheckChests && aTileEntity1 instanceof TileEntityChest) { + TileEntityChest tTileEntity1 = (TileEntityChest)aTileEntity1; + if (tTileEntity1.adjacentChestChecked) { + byte tAmount = 0; + if (tTileEntity1.adjacentChestXNeg != null) { + tAmount = moveOneItemStack(tTileEntity1.adjacentChestXNeg, aTileEntity2, aGrabFrom, aPutTo, aFilter, aInvertFilter, aMaxTargetStackSize, aMinTargetStackSize, aMaxMoveAtOnce, aMinMoveAtOnce, F); + } else if (tTileEntity1.adjacentChestZNeg != null) { + tAmount = moveOneItemStack(tTileEntity1.adjacentChestZNeg, aTileEntity2, aGrabFrom, aPutTo, aFilter, aInvertFilter, aMaxTargetStackSize, aMinTargetStackSize, aMaxMoveAtOnce, aMinMoveAtOnce, F); + } else if (tTileEntity1.adjacentChestXPos != null) { + tAmount = moveOneItemStack(tTileEntity1.adjacentChestXPos, aTileEntity2, aGrabFrom, aPutTo, aFilter, aInvertFilter, aMaxTargetStackSize, aMinTargetStackSize, aMaxMoveAtOnce, aMinMoveAtOnce, F); + } else if (tTileEntity1.adjacentChestZPos != null) { + tAmount = moveOneItemStack(tTileEntity1.adjacentChestZPos, aTileEntity2, aGrabFrom, aPutTo, aFilter, aInvertFilter, aMaxTargetStackSize, aMinTargetStackSize, aMaxMoveAtOnce, aMinMoveAtOnce, F); + } + if (tAmount != 0) return tAmount; + } + } + if (aDoCheckChests && aTileEntity2 instanceof TileEntityChest) { + TileEntityChest tTileEntity2 = (TileEntityChest)aTileEntity2; + if (tTileEntity2.adjacentChestChecked) { + byte tAmount = 0; + if (tTileEntity2.adjacentChestXNeg != null) { + tAmount = moveOneItemStack(aTileEntity1, tTileEntity2.adjacentChestXNeg, aGrabFrom, aPutTo, aFilter, aInvertFilter, aMaxTargetStackSize, aMinTargetStackSize, aMaxMoveAtOnce, aMinMoveAtOnce, F); + } else if (tTileEntity2.adjacentChestZNeg != null) { + tAmount = moveOneItemStack(aTileEntity1, tTileEntity2.adjacentChestZNeg, aGrabFrom, aPutTo, aFilter, aInvertFilter, aMaxTargetStackSize, aMinTargetStackSize, aMaxMoveAtOnce, aMinMoveAtOnce, F); + } else if (tTileEntity2.adjacentChestXPos != null) { + tAmount = moveOneItemStack(aTileEntity1, tTileEntity2.adjacentChestXPos, aGrabFrom, aPutTo, aFilter, aInvertFilter, aMaxTargetStackSize, aMinTargetStackSize, aMaxMoveAtOnce, aMinMoveAtOnce, F); + } else if (tTileEntity2.adjacentChestZPos != null) { + tAmount = moveOneItemStack(aTileEntity1, tTileEntity2.adjacentChestZPos, aGrabFrom, aPutTo, aFilter, aInvertFilter, aMaxTargetStackSize, aMinTargetStackSize, aMaxMoveAtOnce, aMinMoveAtOnce, F); + } + if (tAmount != 0) return tAmount; + } + } + } + + return moveStackIntoPipe(aTileEntity1, aTileEntity2, tGrabSlots, aGrabFrom, aPutTo, aFilter, aInvertFilter, aMaxTargetStackSize, aMinTargetStackSize, aMaxMoveAtOnce, aMinMoveAtOnce); + } + + /** + * Moves Stack from Inv-Side to Inv-Slot. + * @return the Amount of moved Items + */ + public static byte moveOneItemStackIntoSlot(Object aTileEntity1, Object aTileEntity2, byte aGrabFrom, int aPutTo, List aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize, byte aMaxMoveAtOnce, byte aMinMoveAtOnce) { + if (aTileEntity1 == null || !(aTileEntity1 instanceof IInventory) || aPutTo < 0 || aMaxTargetStackSize <= 0 || aMinTargetStackSize <= 0 || aMaxMoveAtOnce <= 0 || aMinTargetStackSize > aMaxTargetStackSize || aMinMoveAtOnce > aMaxMoveAtOnce) return 0; + + int[] tGrabSlots = null; + if (aTileEntity1 instanceof ISidedInventory) tGrabSlots = ((ISidedInventory)aTileEntity1).getAccessibleSlotsFromSide(aGrabFrom); + if (tGrabSlots == null) { + tGrabSlots = new int[((IInventory)aTileEntity1).getSizeInventory()]; + for (int i = 0; i < tGrabSlots.length; i++) tGrabSlots[i] = i; + } + + if (aTileEntity2 != null && aTileEntity2 instanceof IInventory) { + for (int i = 0; i < tGrabSlots.length; i++) { + if (listContainsItem(aFilter, ((IInventory)aTileEntity1).getStackInSlot(tGrabSlots[i]), T, aInvertFilter)) { + if (isAllowedToTakeFromSlot((IInventory)aTileEntity1, tGrabSlots[i], aGrabFrom, ((IInventory)aTileEntity1).getStackInSlot(tGrabSlots[i]))) { + if (isAllowedToPutIntoSlot((IInventory)aTileEntity2, aPutTo, (byte)6, ((IInventory)aTileEntity1).getStackInSlot(tGrabSlots[i]), aMaxTargetStackSize)) { + byte tMovedItemCount = moveStackFromSlotAToSlotB((IInventory)aTileEntity1, (IInventory)aTileEntity2, tGrabSlots[i], aPutTo, aMaxTargetStackSize, aMinTargetStackSize, aMaxMoveAtOnce, aMinMoveAtOnce); + if (tMovedItemCount > 0) return tMovedItemCount; + } + } + } + } + } + + moveStackIntoPipe(((IInventory)aTileEntity1), aTileEntity2, tGrabSlots, aGrabFrom, aPutTo, aFilter, aInvertFilter, aMaxTargetStackSize, aMinTargetStackSize, aMaxMoveAtOnce, aMinMoveAtOnce); + return 0; + } + + /** + * Moves Stack from Inv-Slot to Inv-Slot. + * @return the Amount of moved Items + */ + public static byte moveFromSlotToSlot(IInventory aTileEntity1, IInventory aTileEntity2, int aGrabFrom, int aPutTo, List aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize, byte aMaxMoveAtOnce, byte aMinMoveAtOnce) { + if (aTileEntity1 == null || aTileEntity2 == null || aGrabFrom < 0 || aPutTo < 0 || aMaxTargetStackSize <= 0 || aMinTargetStackSize <= 0 || aMaxMoveAtOnce <= 0 || aMinTargetStackSize > aMaxTargetStackSize || aMinMoveAtOnce > aMaxMoveAtOnce) return 0; + if (listContainsItem(aFilter, aTileEntity1.getStackInSlot(aGrabFrom), T, aInvertFilter)) { + if (isAllowedToTakeFromSlot(aTileEntity1, aGrabFrom, (byte)6, aTileEntity1.getStackInSlot(aGrabFrom))) { + if (isAllowedToPutIntoSlot(aTileEntity2, aPutTo, (byte)6, aTileEntity1.getStackInSlot(aGrabFrom), aMaxTargetStackSize)) { + byte tMovedItemCount = moveStackFromSlotAToSlotB(aTileEntity1, aTileEntity2, aGrabFrom, aPutTo, aMaxTargetStackSize, aMinTargetStackSize, aMaxMoveAtOnce, aMinMoveAtOnce); + if (tMovedItemCount > 0) return tMovedItemCount; + } + } + } + return 0; + } + + public static boolean listContainsItem(Collection aList, ItemStack aStack, boolean aTIfListEmpty, boolean aInvertFilter) { + if (aStack == null || aStack.stackSize < 1) return F; + if (aList == null) return aTIfListEmpty; + while (aList.contains(null)) aList.remove(null); + if (aList.size() < 1) return aTIfListEmpty; + Iterator tIterator = aList.iterator(); + ItemStack tStack = null; + while (tIterator.hasNext()) if ((tStack = tIterator.next())!= null && areStacksEqual(aStack, tStack)) return !aInvertFilter; + return aInvertFilter; + } + + public static boolean areStacksOrToolsEqual(ItemStack aStack1, ItemStack aStack2) { + if (aStack1 != null && aStack2 != null && aStack1.getItem() == aStack2.getItem()) { + if (aStack1.getItem().isDamageable()) return T; + return ((aStack1.getTagCompound() == null) == (aStack2.getTagCompound() == null)) && (aStack1.getTagCompound() == null || aStack1.getTagCompound().equals(aStack2.getTagCompound())) && (Items.feather.getDamage(aStack1) == Items.feather.getDamage(aStack2) || Items.feather.getDamage(aStack1) == W || Items.feather.getDamage(aStack2) == W); + } + return F; + } + + public static boolean areFluidsEqual(FluidStack aFluid1, FluidStack aFluid2) { + return areFluidsEqual(aFluid1, aFluid2, F); + } + + public static boolean areFluidsEqual(FluidStack aFluid1, FluidStack aFluid2, boolean aIgnoreNBT) { + return aFluid1 != null && aFluid2 != null && aFluid1.getFluid() == aFluid2.getFluid() && (aIgnoreNBT || ((aFluid1.tag == null) == (aFluid2.tag == null)) && (aFluid1.tag == null || aFluid1.tag.equals(aFluid2.tag))); + } + + public static boolean areStacksEqual(ItemStack aStack1, ItemStack aStack2) { + return areStacksEqual(aStack1, aStack2, F); + } + + public static boolean areStacksEqual(ItemStack aStack1, ItemStack aStack2, boolean aIgnoreNBT) { + return aStack1 != null && aStack2 != null && aStack1.getItem() == aStack2.getItem() && (aIgnoreNBT || ((aStack1.getTagCompound() == null) == (aStack2.getTagCompound() == null)) && (aStack1.getTagCompound() == null || aStack1.getTagCompound().equals(aStack2.getTagCompound()))) && (Items.feather.getDamage(aStack1) == Items.feather.getDamage(aStack2) || Items.feather.getDamage(aStack1) == W || Items.feather.getDamage(aStack2) == W); + } + + public static boolean areUnificationsEqual(ItemStack aStack1, ItemStack aStack2) { + return areUnificationsEqual(aStack1, aStack2, F); + } + + public static boolean areUnificationsEqual(ItemStack aStack1, ItemStack aStack2, boolean aIgnoreNBT) { + return areStacksEqual(GT_OreDictUnificator.get(aStack1), GT_OreDictUnificator.get(aStack2), aIgnoreNBT); + } + + public static String getFluidName(Fluid aFluid, boolean aLocalized) { + if (aFluid == null) return E; + String rName = aLocalized?aFluid.getLocalizedName(new FluidStack(aFluid, 0)):aFluid.getUnlocalizedName(); + if (rName.contains("fluid.") || rName.contains("tile.")) return capitalizeString(rName.replaceAll("fluid.", E).replaceAll("tile.", E)); + return rName; + } + + public static String getFluidName(FluidStack aFluid, boolean aLocalized) { + if (aFluid == null) return E; + return getFluidName(aFluid.getFluid(), aLocalized); + } + + /** + * Forge screwed the Fluid Registry up again, so I make my own, which is also much more efficient than the stupid Stuff over there. + */ + private static final List sFluidContainerList = new ArrayList(); + private static final Map sFilledContainerToData = new HashMap(); + private static final Map> sEmptyContainerToFluidToData = new HashMap>(); + + static { + GregTech_API.sItemStackMappings.add(sFilledContainerToData); + GregTech_API.sItemStackMappings.add(sEmptyContainerToFluidToData); + } + + public static void reInit() { + sFilledContainerToData.clear(); + sEmptyContainerToFluidToData.clear(); + for (FluidContainerData tData : sFluidContainerList) { + sFilledContainerToData.put(new GT_ItemStack(tData.filledContainer), tData); + Map tFluidToContainer = sEmptyContainerToFluidToData.get(new GT_ItemStack(tData.emptyContainer)); + if (tFluidToContainer == null) { + sEmptyContainerToFluidToData.put(new GT_ItemStack(tData.emptyContainer), tFluidToContainer = new HashMap()); + GregTech_API.sFluidMappings.add(tFluidToContainer); + } + tFluidToContainer.put(tData.fluid.getFluid(), tData); + } + } + + public static void addFluidContainerData(FluidContainerData aData) { + sFluidContainerList.add(aData); + sFilledContainerToData.put(new GT_ItemStack(aData.filledContainer), aData); + Map tFluidToContainer = sEmptyContainerToFluidToData.get(new GT_ItemStack(aData.emptyContainer)); + if (tFluidToContainer == null) { + sEmptyContainerToFluidToData.put(new GT_ItemStack(aData.emptyContainer), tFluidToContainer = new HashMap()); + GregTech_API.sFluidMappings.add(tFluidToContainer); + } + tFluidToContainer.put(aData.fluid.getFluid(), aData); + } + + public static ItemStack fillFluidContainer(FluidStack aFluid, ItemStack aStack, boolean aRemoveFluidDirectly, boolean aCheckIFluidContainerItems) { + if (isStackInvalid(aStack) || aFluid == null) return null; + if (GT_ModHandler.isWater(aFluid) && ItemList.Bottle_Empty.isStackEqual(aStack)) { + if (aFluid.amount >= 250) { + if (aRemoveFluidDirectly) aFluid.amount -= 250; + return new ItemStack(Items.potionitem, 1, 0); + } + return null; + } + if (aCheckIFluidContainerItems && aStack.getItem() instanceof IFluidContainerItem && ((IFluidContainerItem)aStack.getItem()).getFluid(aStack) == null && ((IFluidContainerItem)aStack.getItem()).getCapacity(aStack) <= aFluid.amount) { + if (aRemoveFluidDirectly) + aFluid.amount -= ((IFluidContainerItem)aStack.getItem()).fill(aStack = copyAmount(1, aStack), aFluid, T); + else + ((IFluidContainerItem)aStack.getItem()).fill(aStack = copyAmount(1, aStack), aFluid, T); + return aStack; + } + Map tFluidToContainer = sEmptyContainerToFluidToData.get(new GT_ItemStack(aStack)); + if (tFluidToContainer == null) return null; + FluidContainerData tData = tFluidToContainer.get(aFluid.getFluid()); + if (tData == null || tData.fluid.amount > aFluid.amount) return null; + if (aRemoveFluidDirectly) aFluid.amount -= tData.fluid.amount; + return copyAmount(1, tData.filledContainer); + } + + public static ItemStack getFluidDisplayStack(Fluid aFluid) { + return aFluid==null?null:getFluidDisplayStack(new FluidStack(aFluid, 0), F); + } + + public static ItemStack getFluidDisplayStack(FluidStack aFluid, boolean aUseStackSize) { + if (aFluid == null || aFluid.getFluid() == null) return null; + int tmp = 0; + try{ + tmp = aFluid.getFluid().getID(); + }catch(Exception e){ + System.err.println(e); + } + ItemStack rStack = ItemList.Display_Fluid.getWithDamage(aUseStackSize ? aFluid.amount / 1000 : 1, tmp); + NBTTagCompound tNBT = new NBTTagCompound(); + tNBT.setLong("mFluidDisplayAmount", aFluid.amount); + tNBT.setLong("mFluidDisplayHeat", aFluid.getFluid().getTemperature(aFluid)); + tNBT.setBoolean("mFluidState", aFluid.getFluid().isGaseous(aFluid)); + rStack.setTagCompound(tNBT); + return rStack; + } + + public static boolean containsFluid(ItemStack aStack, FluidStack aFluid, boolean aCheckIFluidContainerItems) { + if (isStackInvalid(aStack) || aFluid == null) return F; + if (aCheckIFluidContainerItems && aStack.getItem() instanceof IFluidContainerItem && ((IFluidContainerItem)aStack.getItem()).getCapacity(aStack) > 0) return aFluid.isFluidEqual(((IFluidContainerItem)aStack.getItem()).getFluid(aStack = copyAmount(1, aStack))); + FluidContainerData tData = sFilledContainerToData.get(new GT_ItemStack(aStack)); + return tData==null?F:tData.fluid.isFluidEqual(aFluid); + } + + public static FluidStack getFluidForFilledItem(ItemStack aStack, boolean aCheckIFluidContainerItems) { + if (isStackInvalid(aStack)) return null; + if (aCheckIFluidContainerItems && aStack.getItem() instanceof IFluidContainerItem && ((IFluidContainerItem)aStack.getItem()).getCapacity(aStack) > 0) return ((IFluidContainerItem)aStack.getItem()).drain(copyAmount(1, aStack), Integer.MAX_VALUE, T); + FluidContainerData tData = sFilledContainerToData.get(new GT_ItemStack(aStack)); + return tData==null?null:tData.fluid.copy(); + } + + public static ItemStack getContainerForFilledItem(ItemStack aStack, boolean aCheckIFluidContainerItems) { + if (isStackInvalid(aStack)) return null; + FluidContainerData tData = sFilledContainerToData.get(new GT_ItemStack(aStack)); + if (tData != null) return copyAmount(1, tData.emptyContainer); + if (aCheckIFluidContainerItems && aStack.getItem() instanceof IFluidContainerItem && ((IFluidContainerItem)aStack.getItem()).getCapacity(aStack) > 0) { + ((IFluidContainerItem)aStack.getItem()).drain(aStack = copyAmount(1, aStack), Integer.MAX_VALUE, T); + return aStack; + } + return null; + } + + public static ItemStack getContainerItem(ItemStack aStack, boolean aCheckIFluidContainerItems) { + if (isStackInvalid(aStack)) return null; + if (aStack.getItem().hasContainerItem(aStack)) return aStack.getItem().getContainerItem(aStack); + /** These are all special Cases, in which it is intended to have only GT Blocks outputting those Container Items */ + if (ItemList.Cell_Empty.isStackEqual(aStack, F, T)) return null; + if (ItemList.IC2_Fuel_Can_Filled.isStackEqual(aStack, F, T)) return ItemList.IC2_Fuel_Can_Empty.get(1); + if (aStack.getItem() == Items.potionitem || aStack.getItem() == Items.experience_bottle || ItemList.TF_Vial_FieryBlood.isStackEqual(aStack) || ItemList.TF_Vial_FieryTears.isStackEqual(aStack)) return ItemList.Bottle_Empty.get(1); + + if (aCheckIFluidContainerItems && aStack.getItem() instanceof IFluidContainerItem && ((IFluidContainerItem)aStack.getItem()).getCapacity(aStack) > 0) { + ItemStack tStack = copyAmount(1, aStack); + ((IFluidContainerItem)aStack.getItem()).drain(tStack, Integer.MAX_VALUE, T); + if (!areStacksEqual(aStack, tStack)) return tStack; + return null; + } + + int tCapsuleCount = GT_ModHandler.getCapsuleCellContainerCount(aStack); + if (tCapsuleCount > 0) return ItemList.Cell_Empty.get(tCapsuleCount); + + if (ItemList.IC2_ForgeHammer.isStackEqual(aStack) || ItemList.IC2_WireCutter.isStackEqual(aStack)) return copyMetaData(Items.feather.getDamage(aStack) + 1, aStack); + return null; + } + + public static synchronized boolean removeSimpleIC2MachineRecipe(ItemStack aInput, Map aRecipeList, ItemStack aOutput) { + if ((isStackInvalid(aInput) && isStackInvalid(aOutput)) || aRecipeList == null) return F; + boolean rReturn = F; + Iterator> tIterator = aRecipeList.entrySet().iterator(); + aOutput = GT_OreDictUnificator.get(aOutput); + while (tIterator.hasNext()) { + Map.Entry tEntry = tIterator.next(); + if (aInput == null || tEntry.getKey().matches(aInput)) { + List tList = tEntry.getValue().items; + if (tList != null) for (ItemStack tOutput : tList) if (aOutput == null || areStacksEqual(GT_OreDictUnificator.get(tOutput), aOutput)) { + tIterator.remove(); + rReturn = T; + break; + } + } + } + return rReturn; + } + + public static boolean addSimpleIC2MachineRecipe(ItemStack aInput, Map aRecipeList, NBTTagCompound aNBT, Object... aOutput) { + if (isStackInvalid(aInput) || aOutput.length == 0 || aRecipeList == null) return F; + ItemData tOreName = GT_OreDictUnificator.getAssociation(aInput); + for(int i = 0;i " + aPages[i]); + } else { + GT_Log.err.println("WARNING: Too much Pages for written Book! -> " + aTitle); + break; + } + } + tNBTList.appendTag(new NBTTagString("Credits to " + aAuthor + " for writing this Book. This was Book Nr. " + sBookCount + " at its creation. Gotta get 'em all!")); + tNBT.setTag("pages", tNBTList); + rStack.setTagCompound(tNBT); + GT_Log.out.println("GT_Mod: Added Book to Book List - Mapping: '"+aMapping+"' - Name: '"+aTitle+"' - Author: '"+aAuthor+"'"); + GregTech_API.sBookList.put(aMapping, rStack); + return copy(rStack); + } + + public static Map sPlayedSoundMap = new HashMap(); + + public static boolean doSoundAtClient(String aSoundName, int aTimeUntilNextSound, float aSoundStrength) { + return doSoundAtClient(aSoundName, aTimeUntilNextSound, aSoundStrength, GT.getThePlayer()); + } + + public static boolean doSoundAtClient(String aSoundName, int aTimeUntilNextSound, float aSoundStrength, Entity aEntity) { + if (aEntity == null) return F; + return doSoundAtClient(aSoundName, aTimeUntilNextSound, aSoundStrength, aEntity.posX, aEntity.posY, aEntity.posZ); + } + + public static boolean doSoundAtClient(String aSoundName, int aTimeUntilNextSound, float aSoundStrength, double aX, double aY, double aZ) { + return doSoundAtClient(aSoundName, aTimeUntilNextSound, aSoundStrength, 0.9F + new Random().nextFloat() * 0.2F, aX, aY, aZ); + } + + public static boolean doSoundAtClient(String aSoundName, int aTimeUntilNextSound, float aSoundStrength, float aSoundModulation, double aX, double aY, double aZ) { + if (isStringInvalid(aSoundName) || !FMLCommonHandler.instance().getEffectiveSide().isClient() || GT.getThePlayer() == null || !GT.getThePlayer().worldObj.isRemote) return F; + if (GregTech_API.sMultiThreadedSounds) + new Thread(new GT_Runnable_Sound(GT.getThePlayer().worldObj, MathHelper.floor_double(aX), MathHelper.floor_double(aY), MathHelper.floor_double(aZ), aTimeUntilNextSound, aSoundName, aSoundStrength, aSoundModulation), "Sound Effect").start(); + else + new GT_Runnable_Sound(GT.getThePlayer().worldObj, MathHelper.floor_double(aX), MathHelper.floor_double(aY), MathHelper.floor_double(aZ), aTimeUntilNextSound, aSoundName, aSoundStrength, aSoundModulation).run(); + return T; + } + + public static boolean sendSoundToPlayers(World aWorld, String aSoundName, float aSoundStrength, float aSoundModulation, int aX, int aY, int aZ) { + if (isStringInvalid(aSoundName) || aWorld == null || aWorld.isRemote) return F; + NW.sendPacketToAllPlayersInRange(aWorld, new GT_Packet_Sound(aSoundName, aSoundStrength, aSoundModulation, aX, (short)aY, aZ), aX, aZ); + return T; + } + + public static int stackToInt(ItemStack aStack) { + if (isStackInvalid(aStack)) return 0; + return Item.getIdFromItem(aStack.getItem()) | (Items.feather.getDamage(aStack)<<16); + } + + public static int stackToWildcard(ItemStack aStack) { + if (isStackInvalid(aStack)) return 0; + return Item.getIdFromItem(aStack.getItem()) | (W<<16); + } + + public static ItemStack intToStack(int aStack) { + int tID = aStack&(~0>>>16), tMeta = aStack>>>16; + Item tItem = Item.getItemById(tID); + if (tItem != null) return new ItemStack(tItem, 1, tMeta); + return null; + } + + public static Integer[] stacksToIntegerArray(ItemStack... aStacks) { + Integer[] rArray = new Integer[aStacks.length]; + for (int i = 0; i < rArray.length; i++) { + rArray[i] = stackToInt(aStacks[i]); + } + return rArray; + } + + public static int[] stacksToIntArray(ItemStack... aStacks) { + int[] rArray = new int[aStacks.length]; + for (int i = 0; i < rArray.length; i++) { + rArray[i] = stackToInt(aStacks[i]); + } + return rArray; + } + + public static boolean arrayContains(Object aObject, Object... aObjects) { + return listContains(aObject, Arrays.asList(aObjects)); + } + + public static boolean listContains(Object aObject, Collection aObjects) { + if (aObjects == null) return F; + return aObjects.contains(aObject); + } + + public static boolean arrayContainsNonNull(T... aArray) { + if (aArray != null) for (Object tObject : aArray) if (tObject != null) return T; + return F; + } + + public static ArrayList getArrayListWithoutNulls(T... aArray) { + if (aArray == null) return new ArrayList(); + ArrayList rList = new ArrayList(Arrays.asList(aArray)); + for (int i = 0; i < rList.size(); i++) if (rList.get(i) == null) rList.remove(i--); + return rList; + } + + public static ArrayList getArrayListWithoutTrailingNulls(T... aArray) { + if (aArray == null) return new ArrayList(); + ArrayList rList = new ArrayList(Arrays.asList(aArray)); + for (int i = rList.size() - 1; i >= 0 && rList.get(i) == null;) rList.remove(i--); + return rList; + } + + public static Block getBlock(Object aBlock) { + return (Block)aBlock; + } + + public static Block getBlockFromStack(Object aStack) { + if (isStackInvalid(aStack)) return Blocks.air; + return Block.getBlockFromItem(((ItemStack)aStack).getItem()); + } + + public static boolean isBlockValid(Object aBlock) { + return aBlock != null && (aBlock instanceof Block); + } + + public static boolean isBlockInvalid(Object aBlock) { + return aBlock == null || !(aBlock instanceof Block); + } + + public static boolean isStringValid(Object aString) { + return aString != null && !aString.toString().isEmpty(); + } + + public static boolean isStringInvalid(Object aString) { + return aString == null || aString.toString().isEmpty(); + } + + public static boolean isStackValid(Object aStack) { + return aStack != null && (aStack instanceof ItemStack) && ((ItemStack)aStack).getItem() != null && ((ItemStack)aStack).stackSize >= 0; + } + + public static boolean isStackInvalid(Object aStack) { + return aStack == null || !(aStack instanceof ItemStack) || ((ItemStack)aStack).getItem() == null || ((ItemStack)aStack).stackSize < 0; + } + + public static boolean isDebugItem(ItemStack aStack) { + return /*ItemList.Armor_Cheat.isStackEqual(aStack, T, T) || */areStacksEqual(GT_ModHandler.getIC2Item("debug", 1), aStack, T); + } + + public static ItemStack updateItemStack(ItemStack aStack) { + if (isStackValid(aStack) && aStack.getItem() instanceof GT_Generic_Item) ((GT_Generic_Item)aStack.getItem()).isItemStackUsable(aStack); + return aStack; + } + + public static boolean isOpaqueBlock(World aWorld, int aX, int aY, int aZ) { + return aWorld.getBlock(aX, aY, aZ).isOpaqueCube(); + } + + public static boolean isAirBlock(World aWorld, int aX, int aY, int aZ) { + return aWorld.getBlock(aX, aY, aZ).isAir(aWorld, aX, aY, aZ); + } + + public static boolean hasBlockHitBox(World aWorld, int aX, int aY, int aZ) { + return aWorld.getBlock(aX, aY, aZ).getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ) != null; + } + + public static void setCoordsOnFire(World aWorld, int aX, int aY, int aZ, boolean aReplaceCenter) { + if (aReplaceCenter) + if (aWorld.getBlock(aX , aY , aZ ).getCollisionBoundingBoxFromPool(aWorld, aX , aY , aZ ) == null) aWorld.setBlock(aX , aY , aZ , Blocks.fire); + if (aWorld.getBlock(aX+1, aY , aZ ).getCollisionBoundingBoxFromPool(aWorld, aX+1, aY , aZ ) == null) aWorld.setBlock(aX+1, aY , aZ , Blocks.fire); + if (aWorld.getBlock(aX-1, aY , aZ ).getCollisionBoundingBoxFromPool(aWorld, aX-1, aY , aZ ) == null) aWorld.setBlock(aX-1, aY , aZ , Blocks.fire); + if (aWorld.getBlock(aX , aY+1, aZ ).getCollisionBoundingBoxFromPool(aWorld, aX , aY+1, aZ ) == null) aWorld.setBlock(aX , aY+1, aZ , Blocks.fire); + if (aWorld.getBlock(aX , aY-1, aZ ).getCollisionBoundingBoxFromPool(aWorld, aX , aY-1, aZ ) == null) aWorld.setBlock(aX , aY-1, aZ , Blocks.fire); + if (aWorld.getBlock(aX , aY , aZ+1).getCollisionBoundingBoxFromPool(aWorld, aX , aY , aZ+1) == null) aWorld.setBlock(aX , aY , aZ+1, Blocks.fire); + if (aWorld.getBlock(aX , aY , aZ-1).getCollisionBoundingBoxFromPool(aWorld, aX , aY , aZ-1) == null) aWorld.setBlock(aX , aY , aZ-1, Blocks.fire); + } + + public static ItemStack getProjectile(SubTag aProjectileType, IInventory aInventory) { + if (aInventory != null) for (int i = 0, j = aInventory.getSizeInventory(); i < j; i++) { + ItemStack rStack = aInventory.getStackInSlot(i); + if (isStackValid(rStack) && rStack.getItem() instanceof IProjectileItem && ((IProjectileItem)rStack.getItem()).hasProjectile(aProjectileType, rStack)) return updateItemStack(rStack); + } + return null; + } + + public static void removeNullStacksFromInventory(IInventory aInventory) { + if (aInventory != null) for (int i = 0, j = aInventory.getSizeInventory(); i < j; i++) { + ItemStack tStack = aInventory.getStackInSlot(i); + if (tStack != null && (tStack.stackSize == 0 || tStack.getItem() == null)) aInventory.setInventorySlotContents(i, null); + } + } + + /** + * Converts a Number to a String + */ + public static String parseNumberToString(int aNumber) { + String tString = E; + boolean temp = T, negative = F; + + if (aNumber<0) { + aNumber *= -1; + negative = T; + } + + for (int i = 1000000000; i > 0; i /= 10) { + int tDigit = (aNumber/i)%10; + if ( temp && tDigit != 0) temp = F; + if (!temp) { + tString += tDigit; + if (i != 1) for (int j = i; j > 0; j /= 1000) if (j == 1) tString += ","; + } + } + + if (tString.equals(E)) tString = "0"; + + return negative?"-"+tString:tString; + } + + public static NBTTagCompound getNBTContainingBoolean(NBTTagCompound aNBT, Object aTag, boolean aValue) { + if (aNBT == null) aNBT = new NBTTagCompound(); + aNBT.setBoolean(aTag.toString(), aValue); + return aNBT; + } + + public static NBTTagCompound getNBTContainingByte(NBTTagCompound aNBT, Object aTag, byte aValue) { + if (aNBT == null) aNBT = new NBTTagCompound(); + aNBT.setByte(aTag.toString(), aValue); + return aNBT; + } + + public static NBTTagCompound getNBTContainingShort(NBTTagCompound aNBT, Object aTag, short aValue) { + if (aNBT == null) aNBT = new NBTTagCompound(); + aNBT.setShort(aTag.toString(), aValue); + return aNBT; + } + + public static NBTTagCompound getNBTContainingInteger(NBTTagCompound aNBT, Object aTag, int aValue) { + if (aNBT == null) aNBT = new NBTTagCompound(); + aNBT.setInteger(aTag.toString(), aValue); + return aNBT; + } + + public static NBTTagCompound getNBTContainingFloat(NBTTagCompound aNBT, Object aTag, float aValue) { + if (aNBT == null) aNBT = new NBTTagCompound(); + aNBT.setFloat(aTag.toString(), aValue); + return aNBT; + } + + public static NBTTagCompound getNBTContainingDouble(NBTTagCompound aNBT, Object aTag, double aValue) { + if (aNBT == null) aNBT = new NBTTagCompound(); + aNBT.setDouble(aTag.toString(), aValue); + return aNBT; + } + + public static NBTTagCompound getNBTContainingString(NBTTagCompound aNBT, Object aTag, Object aValue) { + if (aNBT == null) aNBT = new NBTTagCompound(); + if (aValue == null) return aNBT; + aNBT.setString(aTag.toString(), aValue.toString()); + return aNBT; + } + + public static boolean isWearingFullFrostHazmat(EntityLivingBase aEntity) { + for (byte i = 1; i < 5; i++) if (!isStackInList(aEntity.getEquipmentInSlot(i), GregTech_API.sFrostHazmatList)) return F; + return T; + } + + public static boolean isWearingFullHeatHazmat(EntityLivingBase aEntity) { + for (byte i = 1; i < 5; i++) if (!isStackInList(aEntity.getEquipmentInSlot(i), GregTech_API.sHeatHazmatList)) return F; + return T; + } + + public static boolean isWearingFullBioHazmat(EntityLivingBase aEntity) { + for (byte i = 1; i < 5; i++) if (!isStackInList(aEntity.getEquipmentInSlot(i), GregTech_API.sBioHazmatList)) return F; + return T; + } + + public static boolean isWearingFullRadioHazmat(EntityLivingBase aEntity) { + for (byte i = 1; i < 5; i++) if (!isStackInList(aEntity.getEquipmentInSlot(i), GregTech_API.sRadioHazmatList)) return F; + return T; + } + + public static boolean isWearingFullElectroHazmat(EntityLivingBase aEntity) { + for (byte i = 1; i < 5; i++) if (!isStackInList(aEntity.getEquipmentInSlot(i), GregTech_API.sElectroHazmatList)) return F; + return T; + } + + public static boolean isWearingFullGasHazmat(EntityLivingBase aEntity) { + for (byte i = 1; i < 5; i++) if (!isStackInList(aEntity.getEquipmentInSlot(i), GregTech_API.sGasHazmatList)) return F; + return T; + } + + public static float getHeatDamageFromItem(ItemStack aStack) { + ItemData tData = GT_OreDictUnificator.getItemData(aStack); + return tData==null?0:(tData.mPrefix==null?0:tData.mPrefix.mHeatDamage) + (tData.hasValidMaterialData()?tData.mMaterial.mMaterial.mHeatDamage:0); + } + + public static int getRadioactivityLevel(ItemStack aStack) { + return 0; + } + + public static boolean isImmuneToBreathingGasses(EntityLivingBase aEntity) { + return isWearingFullGasHazmat(aEntity); + } + + public static boolean applyHeatDamage(EntityLivingBase aEntity, float aDamage) { + if (aDamage > 0 && aEntity != null && aEntity.getActivePotionEffect(Potion.fireResistance) == null && !isWearingFullHeatHazmat(aEntity)) { + aEntity.attackEntityFrom(GT_DamageSources.getHeatDamage(), aDamage); + return T; + } + return F; + } + + public static boolean applyFrostDamage(EntityLivingBase aEntity, float aDamage) { + if (aDamage > 0 && aEntity != null && !isWearingFullFrostHazmat(aEntity)) { + aEntity.attackEntityFrom(GT_DamageSources.getFrostDamage(), aDamage); + return T; + } + return F; + } + + public static boolean applyElectricityDamage(EntityLivingBase aEntity, long aVoltage, long aAmperage) { + long aDamage = getTier(aVoltage) * aAmperage * 4; + if (aDamage > 0 && aEntity != null && !isWearingFullElectroHazmat(aEntity)) { + aEntity.attackEntityFrom(GT_DamageSources.getElectricDamage(), aDamage); + return T; + } + return F; + } + + public static boolean applyRadioactivity(EntityLivingBase aEntity, int aLevel, int aAmountOfItems) { + if (aLevel > 0 && aEntity != null && aEntity.getCreatureAttribute() != EnumCreatureAttribute.UNDEAD && aEntity.getCreatureAttribute() != EnumCreatureAttribute.ARTHROPOD && !isWearingFullRadioHazmat(aEntity)) { + PotionEffect tEffect = null; + aEntity.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id , aLevel * 140 * aAmountOfItems + Math.max(0, ((tEffect = aEntity.getActivePotionEffect(Potion.moveSlowdown ))==null?0:tEffect.getDuration())), Math.max(0, (5*aLevel) / 7))); + aEntity.addPotionEffect(new PotionEffect(Potion.digSlowdown.id , aLevel * 150 * aAmountOfItems + Math.max(0, ((tEffect = aEntity.getActivePotionEffect(Potion.digSlowdown ))==null?0:tEffect.getDuration())), Math.max(0, (5*aLevel) / 7))); + aEntity.addPotionEffect(new PotionEffect(Potion.confusion.id , aLevel * 130 * aAmountOfItems + Math.max(0, ((tEffect = aEntity.getActivePotionEffect(Potion.confusion ))==null?0:tEffect.getDuration())), Math.max(0, (5*aLevel) / 7))); + aEntity.addPotionEffect(new PotionEffect(Potion.weakness.id , aLevel * 150 * aAmountOfItems + Math.max(0, ((tEffect = aEntity.getActivePotionEffect(Potion.weakness ))==null?0:tEffect.getDuration())), Math.max(0, (5*aLevel) / 7))); + aEntity.addPotionEffect(new PotionEffect(Potion.hunger.id , aLevel * 130 * aAmountOfItems + Math.max(0, ((tEffect = aEntity.getActivePotionEffect(Potion.hunger ))==null?0:tEffect.getDuration())), Math.max(0, (5*aLevel) / 7))); + aEntity.addPotionEffect(new PotionEffect(24 /* IC2 Radiation */ , aLevel * 180 * aAmountOfItems + Math.max(0, ((tEffect = aEntity.getActivePotionEffect(Potion.potionTypes[24] ))==null?0:tEffect.getDuration())), Math.max(0, (5*aLevel) / 7))); + return T; + } + return F; + } + + public static ItemStack setStack(Object aSetStack, Object aToStack) { + if (isStackInvalid(aSetStack) || isStackInvalid(aToStack)) return null; + ((ItemStack)aSetStack).func_150996_a(((ItemStack)aToStack).getItem()); + ((ItemStack)aSetStack).stackSize = ((ItemStack)aToStack).stackSize; + Items.feather.setDamage((ItemStack)aSetStack, Items.feather.getDamage((ItemStack)aToStack)); + ((ItemStack)aSetStack).setTagCompound(((ItemStack)aToStack).getTagCompound()); + return (ItemStack)aSetStack; + } + + public static FluidStack[] copyFluidArray(FluidStack... aStacks) { + FluidStack[] rStacks = new FluidStack[aStacks.length]; + for (int i = 0; i < aStacks.length; i++) if (aStacks[i] != null) rStacks[i] = aStacks[i].copy(); + return rStacks; + } + + public static ItemStack[] copyStackArray(Object... aStacks) { + ItemStack[] rStacks = new ItemStack[aStacks.length]; + for (int i = 0; i < aStacks.length; i++) rStacks[i] = copy(aStacks[i]); + return rStacks; + } + + public static ItemStack copy(Object... aStacks) { + for (Object tStack : aStacks) if (isStackValid(tStack)) return ((ItemStack)tStack).copy(); + return null; + } + + public static ItemStack copyAmount(long aAmount, Object... aStacks) { + ItemStack rStack = copy(aStacks); + if (isStackInvalid(rStack)) return null; + if (aAmount > 64) aAmount = 64; else if (aAmount == -1) aAmount = 111; else if (aAmount < 0) aAmount = 0; + rStack.stackSize = (byte)aAmount; + return rStack; + } + + public static ItemStack copyMetaData(long aMetaData, Object... aStacks) { + ItemStack rStack = copy(aStacks); + if (isStackInvalid(rStack)) return null; + Items.feather.setDamage(rStack, (short)aMetaData); + return rStack; + } + + public static ItemStack copyAmountAndMetaData(long aAmount, long aMetaData, Object... aStacks) { + ItemStack rStack = copyAmount(aAmount, aStacks); + if (isStackInvalid(rStack)) return null; + Items.feather.setDamage(rStack, (short)aMetaData); + return rStack; + } + + /** + * returns a copy of an ItemStack with its Stacksize being multiplied by aMultiplier + */ + public static ItemStack mul(long aMultiplier, Object... aStacks) { + ItemStack rStack = copy(aStacks); + if (rStack == null) return null; + rStack.stackSize *= aMultiplier; + return rStack; + } + + /** + * Loads an ItemStack properly. + */ + public static ItemStack loadItem(NBTTagCompound aNBT, String aTagName) { + return loadItem(aNBT.getCompoundTag(aTagName)); + } + + /** + * Loads an ItemStack properly. + */ + public static ItemStack loadItem(NBTTagCompound aNBT) { + if (aNBT == null) return null; + ItemStack rStack = ItemStack.loadItemStackFromNBT(aNBT); + try { + if (rStack != null && (rStack.getItem().getClass().getName().startsWith("ic2.core.migration"))) { + rStack.getItem().onUpdate(rStack, DW, null, 0, F); + } + } catch(Throwable e) { + e.printStackTrace(GT_Log.err); + } + return GT_OreDictUnificator.get(T, rStack); + } + + public static E selectItemInList(int aIndex, E aReplacement, List aList) { + if (aList == null || aList.isEmpty()) return aReplacement; + if (aList.size() <= aIndex) return aList.get(aList.size() - 1); + if (aIndex < 0) return aList.get(0); + return aList.get(aIndex); + } + + public static E selectItemInList(int aIndex, E aReplacement, E... aList) { + if (aList == null || aList.length == 0) return aReplacement; + if (aList.length <= aIndex) return aList[aList.length - 1]; + if (aIndex < 0) return aList[0]; + return aList[aIndex]; + } + + public static boolean isStackInList(ItemStack aStack, Collection aList) { + if (aStack == null) {return F;} + return isStackInList(new GT_ItemStack(aStack), aList); + } + +// public static boolean isStackInList2(ItemStack aStack, Collection aList) { +// if (aStack == null) {return F;} +// GT_ItemStack bStack = new GT_ItemStack(aStack); +// for(Iterator it = aList.iterator();it.hasNext();){ +// GT_ItemStack stack = (GT_ItemStack) it.next(); +// if(stack.mItem==bStack.mItem){ +// if(stack.mMetaData==bStack.mMetaData){ +// return true; +// } +// } +// } +// return false; +// } + + public static boolean isStackInList(GT_ItemStack aStack, Collection aList) { + return aStack != null && (aList.contains(aStack) || aList.contains(new GT_ItemStack(aStack.mItem, aStack.mStackSize, W))); + } + + /** + * re-maps all Keys of a Map after the Keys were weakened. + */ + public static Map reMap(Map aMap) { + Map tMap = new HashMap(); + tMap.putAll(aMap); + aMap.clear(); + aMap.putAll(tMap); + return aMap; + } + + /** + * Why the fuck do neither Java nor Guava have a Function to do this? + */ + public static LinkedHashMap sortMapByValuesAcending(Map aMap) { + List> tEntrySet = new LinkedList>(aMap.entrySet()); + Collections.sort(tEntrySet, new Comparator>() {@Override public int compare(Entry aValue1, Entry aValue2) {return aValue1.getValue().compareTo(aValue2.getValue());}}); + LinkedHashMap rMap = new LinkedHashMap(); + for (Map.Entry tEntry : tEntrySet) rMap.put(tEntry.getKey(), tEntry.getValue()); + return rMap; + } + + /** + * Why the fuck do neither Java nor Guava have a Function to do this? + */ + public static LinkedHashMap sortMapByValuesDescending(Map aMap) { + List> tEntrySet = new LinkedList>(aMap.entrySet()); + Collections.sort(tEntrySet, new Comparator>() {@Override public int compare(Entry aValue1, Entry aValue2) {return -aValue1.getValue().compareTo(aValue2.getValue());}}); + LinkedHashMap rMap = new LinkedHashMap(); + for (Map.Entry tEntry : tEntrySet) rMap.put(tEntry.getKey(), tEntry.getValue()); + return rMap; + } + + /** + * Translates a Material Amount into an Amount of Fluid in Fluid Material Units. + */ + public static long translateMaterialToFluidAmount(long aMaterialAmount, boolean aRoundUp) { + return translateMaterialToAmount(aMaterialAmount, L, aRoundUp); + } + + /** + * Translates a Material Amount into an Amount of Fluid. Second Parameter for things like Bucket Amounts (1000) and similar + */ + public static long translateMaterialToAmount(long aMaterialAmount, long aAmountPerUnit, boolean aRoundUp) { + return Math.max(0, ((aMaterialAmount * aAmountPerUnit) / M) + (aRoundUp && (aMaterialAmount * aAmountPerUnit) % M > 0 ? 1 : 0)); + } + + /** + * This checks if the Dimension is really a Dimension and not another Planet or something. + * Used for my Teleporter. + */ + public static boolean isRealDimension(int aDimensionID) { + try { + if (DimensionManager.getProvider(aDimensionID).getClass().getName().contains("com.xcompwiz.mystcraft")) return T; + } catch (Throwable e) {/*Do nothing*/} + try { + if (DimensionManager.getProvider(aDimensionID).getClass().getName().contains("TwilightForest")) return T; + } catch (Throwable e) {/*Do nothing*/} + return GregTech_API.sDimensionalList.contains(aDimensionID); + } + + public static boolean moveEntityToDimensionAtCoords(Entity aEntity, int aDimension, double aX, double aY, double aZ) { + WorldServer tTargetWorld = DimensionManager.getWorld(aDimension), tOriginalWorld = DimensionManager.getWorld(aEntity.worldObj.provider.dimensionId); + if (tTargetWorld != null && tOriginalWorld != null && tTargetWorld != tOriginalWorld) { + if (aEntity.ridingEntity != null) aEntity.mountEntity(null); + if (aEntity.riddenByEntity != null) aEntity.riddenByEntity.mountEntity(null); + + if (aEntity instanceof EntityPlayerMP) { + EntityPlayerMP aPlayer = (EntityPlayerMP)aEntity; + aPlayer.dimension = aDimension; + aPlayer.playerNetServerHandler.sendPacket(new S07PacketRespawn(aPlayer.dimension, aPlayer.worldObj.difficultySetting, aPlayer.worldObj.getWorldInfo().getTerrainType(), aPlayer.theItemInWorldManager.getGameType())); + tOriginalWorld.removePlayerEntityDangerously(aPlayer); + aPlayer.isDead = F; + aPlayer.setWorld(tTargetWorld); + MinecraftServer.getServer().getConfigurationManager().func_72375_a(aPlayer, tOriginalWorld); + aPlayer.playerNetServerHandler.setPlayerLocation(aX+0.5, aY+0.5, aZ+0.5, aPlayer.rotationYaw, aPlayer.rotationPitch); + aPlayer.theItemInWorldManager.setWorld(tTargetWorld); + MinecraftServer.getServer().getConfigurationManager().updateTimeAndWeatherForPlayer(aPlayer, tTargetWorld); + MinecraftServer.getServer().getConfigurationManager().syncPlayerInventory(aPlayer); + Iterator tIterator = aPlayer.getActivePotionEffects().iterator(); + while (tIterator.hasNext()) { + PotionEffect potioneffect = (PotionEffect)tIterator.next(); + aPlayer.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(aPlayer.getEntityId(), potioneffect)); + } + aPlayer.playerNetServerHandler.setPlayerLocation(aX+0.5, aY+0.5, aZ+0.5, aPlayer.rotationYaw, aPlayer.rotationPitch); + FMLCommonHandler.instance().firePlayerChangedDimensionEvent(aPlayer, tOriginalWorld.provider.dimensionId, aDimension); + } else { + aEntity.setPosition(aX+0.5, aY+0.5, aZ+0.5); + aEntity.worldObj.removeEntity(aEntity); + aEntity.dimension = aDimension; + aEntity.isDead = F; + Entity tNewEntity = EntityList.createEntityByName(EntityList.getEntityString(aEntity), tTargetWorld); + if (tNewEntity != null) { + tNewEntity.copyDataFrom(aEntity, T); + aEntity.setDead(); + tNewEntity.isDead = F; + boolean temp = tNewEntity.forceSpawn; + tNewEntity.forceSpawn = T; + tTargetWorld.spawnEntityInWorld(tNewEntity); + tNewEntity.forceSpawn = temp; + tNewEntity.isDead = F; + aEntity = tNewEntity; + } + } + + if (aEntity instanceof EntityLivingBase) { + ((EntityLivingBase)aEntity).setPositionAndUpdate(aX, aY, aZ); + } else { + aEntity.setPosition(aX, aY, aZ); + } + + tOriginalWorld.resetUpdateEntityTick(); + tTargetWorld.resetUpdateEntityTick(); + return T; + } + return F; + } + + public static int getCoordinateScan(ArrayList aList, EntityPlayer aPlayer, World aWorld, int aScanLevel, int aX, int aY, int aZ, int aSide, float aClickX, float aClickY, float aClickZ) { + if (aList == null) return 0; + + ArrayList tList = new ArrayList(); + int rEUAmount = 0; + + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + + Block tBlock = aWorld.getBlock(aX, aY, aZ); + + tList.add("----- X: " + aX + " Y: " + aY + " Z: " + aZ + " -----"); + try { + if (tTileEntity != null && tTileEntity instanceof IInventory) + tList.add("Name: " + ((IInventory)tTileEntity).getInventoryName() + " MetaData: " + aWorld.getBlockMetadata(aX, aY, aZ)); + else + tList.add("Name: " + tBlock.getUnlocalizedName() + " MetaData: " + aWorld.getBlockMetadata(aX, aY, aZ)); + + tList.add("Hardness: " + tBlock.getBlockHardness(aWorld, aX, aY, aZ) + " Blast Resistance: " + tBlock.getExplosionResistance(aPlayer, aWorld, aX, aY, aZ, aPlayer.posX, aPlayer.posY, aPlayer.posZ)); + if (tBlock.isBeaconBase(aWorld, aX, aY, aZ, aX, aY+1, aZ)) tList.add("Is valid Beacon Pyramid Material"); + } catch(Throwable e) {if (D1) e.printStackTrace(GT_Log.err);} + if (tTileEntity != null) { + try {if (tTileEntity instanceof IFluidHandler) { + rEUAmount+=500; + FluidTankInfo[] tTanks = ((IFluidHandler)tTileEntity).getTankInfo(ForgeDirection.getOrientation(aSide)); + if (tTanks != null) for (byte i = 0; i < tTanks.length; i++) { + tList.add("Tank " + i + ": " + GT_Utility.formatNumbers((tTanks[i].fluid==null?0:tTanks[i].fluid.amount)) + " / " + GT_Utility.formatNumbers(tTanks[i].capacity) + " " + getFluidName(tTanks[i].fluid, T)); + } + }} catch(Throwable e) {if (D1) e.printStackTrace(GT_Log.err);} + try {if (tTileEntity instanceof ic2.api.reactor.IReactorChamber) { + rEUAmount+=500; + tTileEntity = (TileEntity)(((ic2.api.reactor.IReactorChamber)tTileEntity).getReactor()); + }} catch(Throwable e) {if (D1) e.printStackTrace(GT_Log.err);} + try {if (tTileEntity instanceof ic2.api.reactor.IReactor) { + rEUAmount+=500; + tList.add("Heat: " + ((ic2.api.reactor.IReactor)tTileEntity).getHeat() + "/" + ((ic2.api.reactor.IReactor)tTileEntity).getMaxHeat() + + " HEM: " + ((ic2.api.reactor.IReactor)tTileEntity).getHeatEffectModifier() + " Base EU Output: "/* + ((ic2.api.reactor.IReactor)tTileEntity).getOutput()*/); + }} catch(Throwable e) {if (D1) e.printStackTrace(GT_Log.err);} + try {if (tTileEntity instanceof ic2.api.tile.IWrenchable) { + rEUAmount+=100; + tList.add("Facing: " + ((ic2.api.tile.IWrenchable)tTileEntity).getFacing() + " / Chance: " + (((ic2.api.tile.IWrenchable)tTileEntity).getWrenchDropRate()*100) + "%"); + tList.add(((ic2.api.tile.IWrenchable)tTileEntity).wrenchCanRemove(aPlayer)?"You can remove this with a Wrench":"You can NOT remove this with a Wrench"); + }} catch(Throwable e) {if (D1) e.printStackTrace(GT_Log.err);} + try {if (tTileEntity instanceof ic2.api.energy.tile.IEnergyTile) { + rEUAmount+=200; + //aList.add(((ic2.api.energy.tile.IEnergyTile)tTileEntity).isAddedToEnergyNet()?"Added to E-net":"Not added to E-net! Bug?"); + }} catch(Throwable e) {if (D1) e.printStackTrace(GT_Log.err);} + try {if (tTileEntity instanceof ic2.api.energy.tile.IEnergySink) { + rEUAmount+=400; + //aList.add("Demanded Energy: " + ((ic2.api.energy.tile.IEnergySink)tTileEntity).demandsEnergy()); + //tList.add("Max Safe Input: " + getTier(((ic2.api.energy.tile.IEnergySink)tTileEntity).getSinkTier())); + //tList.add("Max Safe Input: " + ((ic2.api.energy.tile.IEnergySink)tTileEntity).getMaxSafeInput()); + }} catch(Throwable e) {if (D1) e.printStackTrace(GT_Log.err);} + try {if (tTileEntity instanceof ic2.api.energy.tile.IEnergySource) { + rEUAmount+=400; + //aList.add("Max Energy Output: " + ((ic2.api.energy.tile.IEnergySource)tTileEntity).getMaxEnergyOutput()); + }} catch(Throwable e) {if (D1) e.printStackTrace(GT_Log.err);} + try {if (tTileEntity instanceof ic2.api.energy.tile.IEnergyConductor) { + rEUAmount+=200; + tList.add("Conduction Loss: " + ((ic2.api.energy.tile.IEnergyConductor)tTileEntity).getConductionLoss()); + }} catch(Throwable e) {if (D1) e.printStackTrace(GT_Log.err);} + try {if (tTileEntity instanceof ic2.api.tile.IEnergyStorage) { + rEUAmount+=200; + tList.add("Contained Energy: " + ((ic2.api.tile.IEnergyStorage)tTileEntity).getStored() + " of " + ((ic2.api.tile.IEnergyStorage)tTileEntity).getCapacity()); + //aList.add(((ic2.api.tile.IEnergyStorage)tTileEntity).isTeleporterCompatible(ic2.api.Direction.YP)?"Teleporter Compatible":"Not Teleporter Compatible"); + }} catch(Throwable e) {if (D1) e.printStackTrace(GT_Log.err);} + try {if (tTileEntity instanceof IUpgradableMachine) { + rEUAmount+=500; + if (((IUpgradableMachine)tTileEntity).hasMufflerUpgrade()) tList.add("Has Muffler Upgrade"); + }} catch(Throwable e) {if (D1) e.printStackTrace(GT_Log.err);} + try {if (tTileEntity instanceof IMachineProgress) { + rEUAmount+=400; + int tValue = 0; + if (0 < (tValue = ((IMachineProgress)tTileEntity).getMaxProgress())) tList.add("Progress: " + GT_Utility.formatNumbers(tValue) + " / " + GT_Utility.formatNumbers(((IMachineProgress)tTileEntity).getProgress())); + }} catch(Throwable e) {if (D1) e.printStackTrace(GT_Log.err);} + try {if (tTileEntity instanceof ICoverable) { + rEUAmount+=300; + String tString = ((ICoverable)tTileEntity).getCoverBehaviorAtSide((byte)aSide).getDescription((byte)aSide, ((ICoverable)tTileEntity).getCoverIDAtSide((byte)aSide), ((ICoverable)tTileEntity).getCoverDataAtSide((byte)aSide), (ICoverable)tTileEntity); + if (tString != null && !tString.equals(E)) tList.add(tString); + }} catch(Throwable e) {if (D1) e.printStackTrace(GT_Log.err);} + try {if (tTileEntity instanceof IBasicEnergyContainer && ((IBasicEnergyContainer)tTileEntity).getEUCapacity() > 0) { + tList.add("Max IN: " + ((IBasicEnergyContainer)tTileEntity).getInputVoltage() + " EU"); + tList.add("Max OUT: " + ((IBasicEnergyContainer)tTileEntity).getOutputVoltage() + " EU at " + ((IBasicEnergyContainer)tTileEntity).getOutputAmperage() + " Amperes"); + tList.add("Energy: " + GT_Utility.formatNumbers(((IBasicEnergyContainer)tTileEntity).getStoredEU()) + " / " + GT_Utility.formatNumbers(((IBasicEnergyContainer)tTileEntity).getEUCapacity()) + "EU"); + }} catch(Throwable e) {if (D1) e.printStackTrace(GT_Log.err);} + try {if (tTileEntity instanceof IGregTechTileEntity) { + tList.add("Owned by: " + ((IGregTechTileEntity)tTileEntity).getOwnerName()); + }} catch(Throwable e) {if (D1) e.printStackTrace(GT_Log.err);} + try {if (tTileEntity instanceof IGregTechDeviceInformation && ((IGregTechDeviceInformation)tTileEntity).isGivingInformation()) { + tList.addAll(Arrays.asList(((IGregTechDeviceInformation)tTileEntity).getInfoData())); + }} catch(Throwable e) {if (D1) e.printStackTrace(GT_Log.err);} + try {if (tTileEntity instanceof ic2.api.crops.ICropTile) { + if (((ic2.api.crops.ICropTile)tTileEntity).getScanLevel() < 4) { + rEUAmount+=10000; + ((ic2.api.crops.ICropTile)tTileEntity).setScanLevel((byte)4); + } + if (((ic2.api.crops.ICropTile)tTileEntity).getID() >= 0 && ((ic2.api.crops.ICropTile)tTileEntity).getID() < ic2.api.crops.Crops.instance.getCropList().length && ic2.api.crops.Crops.instance.getCropList()[((ic2.api.crops.ICropTile)tTileEntity).getID()] != null) { + rEUAmount+=1000; + tList.add("Type -- Crop-Name: " + ic2.api.crops.Crops.instance.getCropList()[((ic2.api.crops.ICropTile)tTileEntity).getID()].name() + + " Growth: " + ((ic2.api.crops.ICropTile)tTileEntity).getGrowth() + + " Gain: " + ((ic2.api.crops.ICropTile)tTileEntity).getGain() + + " Resistance: " + ((ic2.api.crops.ICropTile)tTileEntity).getResistance() + ); + tList.add("Plant -- Fertilizer: " + ((ic2.api.crops.ICropTile)tTileEntity).getNutrientStorage() + + " Water: " + ((ic2.api.crops.ICropTile)tTileEntity).getHydrationStorage() + + " Weed-Ex: " + ((ic2.api.crops.ICropTile)tTileEntity).getWeedExStorage() + + " Scan-Level: " + ((ic2.api.crops.ICropTile)tTileEntity).getScanLevel() + ); + tList.add("Environment -- Nutrients: " + ((ic2.api.crops.ICropTile)tTileEntity).getNutrients() + + " Humidity: " + ((ic2.api.crops.ICropTile)tTileEntity).getHumidity() + + " Air-Quality: " + ((ic2.api.crops.ICropTile)tTileEntity).getAirQuality() + ); + String tString = E; + for (String tAttribute : ic2.api.crops.Crops.instance.getCropList()[((ic2.api.crops.ICropTile)tTileEntity).getID()].attributes()) { + tString += ", " + tAttribute; + } + tList.add("Attributes:" + tString.replaceFirst(",", E)); + tList.add("Discovered by: " + ic2.api.crops.Crops.instance.getCropList()[((ic2.api.crops.ICropTile)tTileEntity).getID()].discoveredBy()); + } + }} catch(Throwable e) {if (D1) e.printStackTrace(GT_Log.err);} + } + try {if (tBlock instanceof IDebugableBlock) { + rEUAmount+=500; + ArrayList temp = ((IDebugableBlock)tBlock).getDebugInfo(aPlayer, aX, aY, aZ, 3); + if (temp != null) tList.addAll(temp); + }} catch(Throwable e) {if (D1) e.printStackTrace(GT_Log.err);} + + BlockScanningEvent tEvent = new BlockScanningEvent(aWorld, aPlayer, aX, aY, aZ, (byte)aSide, aScanLevel, tBlock, tTileEntity, tList, aClickX, aClickY, aClickZ); + tEvent.mEUCost = rEUAmount; + MinecraftForge.EVENT_BUS.post(tEvent); + if (!tEvent.isCanceled()) aList.addAll(tList); + return tEvent.mEUCost; + } + + /** + * @return an Array containing the X and the Y Coordinate of the clicked Point, with the top left Corner as Origin, like on the Texture Sheet. return values should always be between [0.0F and 0.99F]. + */ + public static float[] getClickedFacingCoords(byte aSide, float aX, float aY, float aZ) { + switch (aSide) { + case 0: return new float[] {Math.min(0.99F, Math.max(0,1-aX)), Math.min(0.99F, Math.max(0, aZ))}; + case 1: return new float[] {Math.min(0.99F, Math.max(0, aX)), Math.min(0.99F, Math.max(0, aZ))}; + case 2: return new float[] {Math.min(0.99F, Math.max(0,1-aX)), Math.min(0.99F, Math.max(0,1-aY))}; + case 3: return new float[] {Math.min(0.99F, Math.max(0, aX)), Math.min(0.99F, Math.max(0,1-aY))}; + case 4: return new float[] {Math.min(0.99F, Math.max(0, aZ)), Math.min(0.99F, Math.max(0,1-aY))}; + case 5: return new float[] {Math.min(0.99F, Math.max(0,1-aZ)), Math.min(0.99F, Math.max(0,1-aY))}; + default: return new float[] {0.5F, 0.5F}; + } + } + + /** + * This Function determines the direction a Block gets when being Wrenched. + * returns -1 if invalid. Even though that could never happen. + */ + public static byte determineWrenchingSide(byte aSide, float aX, float aY, float aZ) { + byte tBack = getOppositeSide(aSide); + switch (aSide) { + case 0: case 1: + if (aX < 0.25) { + if (aZ < 0.25) return tBack; + if (aZ > 0.75) return tBack; + return 4; + } + if (aX > 0.75) { + if (aZ < 0.25) return tBack; + if (aZ > 0.75) return tBack; + return 5; + } + if (aZ < 0.25) return 2; + if (aZ > 0.75) return 3; + return aSide; + case 2: case 3: + if (aX < 0.25) { + if (aY < 0.25) return tBack; + if (aY > 0.75) return tBack; + return 4; + } + if (aX > 0.75) { + if (aY < 0.25) return tBack; + if (aY > 0.75) return tBack; + return 5; + } + if (aY < 0.25) return 0; + if (aY > 0.75) return 1; + return aSide; + case 4: case 5: + if (aZ < 0.25) { + if (aY < 0.25) return tBack; + if (aY > 0.75) return tBack; + return 2; + } + if (aZ > 0.75) { + if (aY < 0.25) return tBack; + if (aY > 0.75) return tBack; + return 3; + } + if (aY < 0.25) return 0; + if (aY > 0.75) return 1; + return aSide; + } + return -1; + } + + public static String formatNumbers(long aNumber){ + DecimalFormat formatter = (DecimalFormat) NumberFormat.getInstance(Locale.US); + DecimalFormatSymbols symbols = formatter.getDecimalFormatSymbols(); + symbols.setGroupingSeparator(' '); + return formatter.format(aNumber); + } + +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/world/GT_Worldgen.java b/src/main/java/gregtech/api/world/GT_Worldgen.java new file mode 100644 index 0000000..2274065 --- /dev/null +++ b/src/main/java/gregtech/api/world/GT_Worldgen.java @@ -0,0 +1,60 @@ +package gregtech.api.world; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Random; + +import gregtech.api.GregTech_API; +import net.minecraft.world.World; +import net.minecraft.world.chunk.IChunkProvider; + +public abstract class GT_Worldgen { + + public final String mWorldGenName; + public final boolean mEnabled; + private final Map mDimensionMap = new HashMap(); + + public GT_Worldgen(String aName, List aList, boolean aDefault) { + mWorldGenName = aName; + mEnabled = GregTech_API.sWorldgenFile.get("worldgen", mWorldGenName, aDefault); + if (mEnabled) aList.add(this); + } + + /** + * @param aWorld The World Object + * @param aRandom The Random Generator to use + * @param aBiome The Name of the Biome (always != null) + * @param aDimensionType The Type of Worldgeneration to add. -1 = Nether, 0 = Overworld, +1 = End + * @param aChunkX xCoord of the Chunk + * @param aChunkZ zCoord of the Chunk + * @return if the Worldgeneration has been successfully completed + */ + public boolean executeWorldgen(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { + return false; + } + + /** + * @param aWorld The World Object + * @param aRandom The Random Generator to use + * @param aBiome The Name of the Biome (always != null) + * @param aDimensionType The Type of Worldgeneration to add. -1 = Nether, 0 = Overworld, +1 = End + * @param aChunkX xCoord of the Chunk + * @param aChunkZ zCoord of the Chunk + * @return if the Worldgeneration has been successfully completed + */ + public boolean executeCavegen(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { + return false; + } + + public boolean isGenerationAllowed(World aWorld, int aDimensionType, int aAllowedDimensionType) { + String aDimName = aWorld.provider.getDimensionName(); + Boolean tAllowed = mDimensionMap.get(aDimName); + if (tAllowed == null) { + boolean tValue = GregTech_API.sWorldgenFile.get("worldgen.dimensions."+mWorldGenName, aDimName, aDimensionType == aAllowedDimensionType); + mDimensionMap.put(aDimName, tValue); + return tValue; + } + return tAllowed; + } +} diff --git a/src/main/java/gregtech/api/world/GT_Worldgen_Boulder.java b/src/main/java/gregtech/api/world/GT_Worldgen_Boulder.java new file mode 100644 index 0000000..9c90639 --- /dev/null +++ b/src/main/java/gregtech/api/world/GT_Worldgen_Boulder.java @@ -0,0 +1,70 @@ +package gregtech.api.world; + +import java.util.Collection; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.chunk.IChunkProvider; + +public class GT_Worldgen_Boulder extends GT_Worldgen_Ore { + public GT_Worldgen_Boulder(String aName, boolean aDefault, Block aBlock, int aBlockMeta, int aDimensionType, int aAmount, int aSize, int aProbability, int aMinY, int aMaxY, Collection aBiomeList, boolean aAllowToGenerateinVoid) { + super(aName, aDefault, aBlock, aBlockMeta, aDimensionType, aAmount, aSize, aProbability, aMinY, aMaxY, aBiomeList, aAllowToGenerateinVoid); + } + + @Override + public boolean executeWorldgen(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { + if (isGenerationAllowed(aWorld, aDimensionType, mDimensionType) && (mBiomeList.isEmpty() || mBiomeList.contains(aBiome)) && (mProbability <= 1 || aRandom.nextInt(mProbability) == 0)) { + for (int i = 0; i < mAmount; i++) { + int tX = aChunkX + aRandom.nextInt(16), tY = mMinY + aRandom.nextInt(mMaxY - mMinY), tZ = aChunkZ + aRandom.nextInt(16); + Block tBlock = aWorld.getBlock(tX, tY - 7, tZ); + if (tBlock != null && tBlock.isOpaqueCube() && aWorld.getBlock(tX, tY-6, tZ).isAir(aWorld, tX, tY-6, tZ)) { + float var6 = aRandom.nextFloat() * (float)Math.PI; + double var7 = ((tX + 8) + MathHelper.sin(var6) * mSize / 8.0F); + double var9 = ((tX + 8) - MathHelper.sin(var6) * mSize / 8.0F); + double var11 = ((tZ + 8) + MathHelper.cos(var6) * mSize / 8.0F); + double var13 = ((tZ + 8) - MathHelper.cos(var6) * mSize / 8.0F); + double var15 = (tY + aRandom.nextInt(3) - 2); + double var17 = (tY + aRandom.nextInt(3) - 2); + + for (int var19 = 0; var19 <= mSize; ++var19) { + double var20 = var7 + (var9 - var7) * var19 / mSize; + double var22 = var15 + (var17 - var15) * var19 / mSize; + double var24 = var11 + (var13 - var11) * var19 / mSize; + double var26 = aRandom.nextDouble() * mSize / 16.0D; + double var28 = (MathHelper.sin(var19 * (float)Math.PI / mSize) + 1.0F) * var26 + 1.0D; + double var30 = (MathHelper.sin(var19 * (float)Math.PI / mSize) + 1.0F) * var26 + 1.0D; + int var32 = MathHelper.floor_double(var20 - var28 / 2.0D); + int var33 = MathHelper.floor_double(var22 - var30 / 2.0D); + int var34 = MathHelper.floor_double(var24 - var28 / 2.0D); + int var35 = MathHelper.floor_double(var20 + var28 / 2.0D); + int var36 = MathHelper.floor_double(var22 + var30 / 2.0D); + int var37 = MathHelper.floor_double(var24 + var28 / 2.0D); + + for (int var38 = var32; var38 <= var35; ++var38) { + double var39 = (var38 + 0.5D - var20) / (var28 / 2.0D); + if (var39 * var39 < 1.0D) { + for (int var41 = var33; var41 <= var36; ++var41) { + double var42 = (var41 + 0.5D - var22) / (var30 / 2.0D); + if (var39 * var39 + var42 * var42 < 1.0D) { + for (int var44 = var34; var44 <= var37; ++var44) { + double var45 = (var44 + 0.5D - var24) / (var28 / 2.0D); + Block block = aWorld.getBlock(var38, var41, var44); + if (var39 * var39 + var42 * var42 + var45 * var45 < 1.0D && ((mAllowToGenerateinVoid&&aWorld.getBlock(var38, var41, var44).isAir(aWorld, var38, var41, var44)) || (block != null && !(block instanceof BlockContainer)))) { + aWorld.setBlock(var38, var41, var44, mBlock, mBlockMeta, 0); + } + } + } + } + } + } + } + } + } + return true; + } + return false; + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/world/GT_Worldgen_Ore.java b/src/main/java/gregtech/api/world/GT_Worldgen_Ore.java new file mode 100644 index 0000000..57d16d5 --- /dev/null +++ b/src/main/java/gregtech/api/world/GT_Worldgen_Ore.java @@ -0,0 +1,28 @@ +package gregtech.api.world; + +import java.util.ArrayList; +import java.util.Collection; + +import gregtech.api.GregTech_API; +import net.minecraft.block.Block; + +public abstract class GT_Worldgen_Ore extends GT_Worldgen { + public final int mBlockMeta, mAmount, mSize, mMinY, mMaxY, mProbability, mDimensionType; + public final Block mBlock; + public final Collection mBiomeList; + public final boolean mAllowToGenerateinVoid; + + public GT_Worldgen_Ore(String aName, boolean aDefault, Block aBlock, int aBlockMeta, int aDimensionType, int aAmount, int aSize, int aProbability, int aMinY, int aMaxY, Collection aBiomeList, boolean aAllowToGenerateinVoid) { + super(aName, GregTech_API.sWorldgenList, aDefault); + mDimensionType = aDimensionType; + mBlock = aBlock; + mBlockMeta = Math.min(Math.max(aBlockMeta, 0), 15); + mProbability = GregTech_API.sWorldgenFile.get("worldgen."+mWorldGenName, "Probability" , aProbability); + mAmount = GregTech_API.sWorldgenFile.get("worldgen."+mWorldGenName, "Amount" , aAmount); + mSize = GregTech_API.sWorldgenFile.get("worldgen."+mWorldGenName, "Size" , aSize); + mMinY = GregTech_API.sWorldgenFile.get("worldgen."+mWorldGenName, "MinHeight" , aMinY); + mMaxY = GregTech_API.sWorldgenFile.get("worldgen."+mWorldGenName, "MaxHeight" , aMaxY); + if (aBiomeList == null) mBiomeList = new ArrayList(); else mBiomeList = aBiomeList; + mAllowToGenerateinVoid = aAllowToGenerateinVoid; + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/world/GT_Worldgen_Ore_Normal.java b/src/main/java/gregtech/api/world/GT_Worldgen_Ore_Normal.java new file mode 100644 index 0000000..c382a6f --- /dev/null +++ b/src/main/java/gregtech/api/world/GT_Worldgen_Ore_Normal.java @@ -0,0 +1,69 @@ +package gregtech.api.world; + +import java.util.Collection; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.chunk.IChunkProvider; + +public class GT_Worldgen_Ore_Normal extends GT_Worldgen_Ore { + public GT_Worldgen_Ore_Normal(String aName, boolean aDefault, Block aBlock, int aBlockMeta, int aDimensionType, int aAmount, int aSize, int aProbability, int aMinY, int aMaxY, Collection aBiomeList, boolean aAllowToGenerateinVoid) { + super(aName, aDefault, aBlock, aBlockMeta, aDimensionType, aAmount, aSize, aProbability, aMinY, aMaxY, aBiomeList, aAllowToGenerateinVoid); + } + + @Override + public boolean executeWorldgen(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { + if (isGenerationAllowed(aWorld, aDimensionType, mDimensionType) && (mBiomeList.isEmpty() || mBiomeList.contains(aBiome)) && (mProbability <= 1 || aRandom.nextInt(mProbability) == 0)) { + for (int i = 0; i < mAmount; i++) { + int tX = aChunkX + aRandom.nextInt(16), tY = mMinY + aRandom.nextInt(mMaxY - mMinY), tZ = aChunkZ + aRandom.nextInt(16); + if (mAllowToGenerateinVoid || aWorld.getBlock(tX, tY, tZ).isAir(aWorld, tX, tY, tZ)) { + float var6 = aRandom.nextFloat() * (float)Math.PI; + double var7 = ((tX + 8) + MathHelper.sin(var6) * mSize / 8.0F); + double var9 = ((tX + 8) - MathHelper.sin(var6) * mSize / 8.0F); + double var11 = ((tZ + 8) + MathHelper.cos(var6) * mSize / 8.0F); + double var13 = ((tZ + 8) - MathHelper.cos(var6) * mSize / 8.0F); + double var15 = (tY + aRandom.nextInt(3) - 2); + double var17 = (tY + aRandom.nextInt(3) - 2); + + for (int var19 = 0; var19 <= mSize; ++var19) { + double var20 = var7 + (var9 - var7) * var19 / mSize; + double var22 = var15 + (var17 - var15) * var19 / mSize; + double var24 = var11 + (var13 - var11) * var19 / mSize; + double var26 = aRandom.nextDouble() * mSize / 16.0D; + double var28 = (MathHelper.sin(var19 * (float)Math.PI / mSize) + 1.0F) * var26 + 1.0D; + double var30 = (MathHelper.sin(var19 * (float)Math.PI / mSize) + 1.0F) * var26 + 1.0D; + int var32 = MathHelper.floor_double(var20 - var28 / 2.0D); + int var33 = MathHelper.floor_double(var22 - var30 / 2.0D); + int var34 = MathHelper.floor_double(var24 - var28 / 2.0D); + int var35 = MathHelper.floor_double(var20 + var28 / 2.0D); + int var36 = MathHelper.floor_double(var22 + var30 / 2.0D); + int var37 = MathHelper.floor_double(var24 + var28 / 2.0D); + + for (int var38 = var32; var38 <= var35; ++var38) { + double var39 = (var38 + 0.5D - var20) / (var28 / 2.0D); + if (var39 * var39 < 1.0D) { + for (int var41 = var33; var41 <= var36; ++var41) { + double var42 = (var41 + 0.5D - var22) / (var30 / 2.0D); + if (var39 * var39 + var42 * var42 < 1.0D) { + for (int var44 = var34; var44 <= var37; ++var44) { + double var45 = (var44 + 0.5D - var24) / (var28 / 2.0D); + Block block = aWorld.getBlock(var38, var41, var44); + if (var39 * var39 + var42 * var42 + var45 * var45 < 1.0D && ((mAllowToGenerateinVoid&&aWorld.getBlock(var38, var41, var44).isAir(aWorld, var38, var41, var44)) || (block != null && (block.isReplaceableOreGen(aWorld, var38, var41, var44, Blocks.stone) || block.isReplaceableOreGen(aWorld, var38, var41, var44, Blocks.end_stone) || block.isReplaceableOreGen(aWorld, var38, var41, var44, Blocks.netherrack))))) { + aWorld.setBlock(var38, var41, var44, mBlock, mBlockMeta, 0); + } + } + } + } + } + } + } + } + } + return true; + } + return false; + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/world/GT_Worldgen_Ore_SingleBlock.java b/src/main/java/gregtech/api/world/GT_Worldgen_Ore_SingleBlock.java new file mode 100644 index 0000000..62dc220 --- /dev/null +++ b/src/main/java/gregtech/api/world/GT_Worldgen_Ore_SingleBlock.java @@ -0,0 +1,30 @@ +package gregtech.api.world; + +import java.util.Collection; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.chunk.IChunkProvider; + +public class GT_Worldgen_Ore_SingleBlock extends GT_Worldgen_Ore { + public GT_Worldgen_Ore_SingleBlock(String aName, boolean aDefault, Block aBlock, int aBlockMeta, int aDimensionType, int aAmount, int aSize, int aProbability, int aMinY, int aMaxY, Collection aBiomeList, boolean aAllowToGenerateinVoid) { + super(aName, aDefault, aBlock, aBlockMeta, aDimensionType, aAmount, aSize, aProbability, aMinY, aMaxY, aBiomeList, aAllowToGenerateinVoid); + } + + @Override + public boolean executeWorldgen(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { + if (isGenerationAllowed(aWorld, aDimensionType, mDimensionType) && (mBiomeList.isEmpty() || mBiomeList.contains(aBiome)) && (mProbability <= 1 || aRandom.nextInt(mProbability) == 0)) { + for (int i = 0; i < mAmount; i++) { + int tX = aChunkX + aRandom.nextInt(16), tY = mMinY + aRandom.nextInt(mMaxY - mMinY), tZ = aChunkZ + aRandom.nextInt(16); + Block tBlock = aWorld.getBlock(tX, tY, tZ); + if (((mAllowToGenerateinVoid&&aWorld.getBlock(tX, tY, tZ).isAir(aWorld, tX, tY, tZ)) || (tBlock != null && (tBlock.isReplaceableOreGen(aWorld, tX, tY, tZ, Blocks.stone) || tBlock.isReplaceableOreGen(aWorld, tX, tY, tZ, Blocks.end_stone) || tBlock.isReplaceableOreGen(aWorld, tX, tY, tZ, Blocks.netherrack))))) { + aWorld.setBlock(tX, tY, tZ, mBlock, mBlockMeta, 0); + } + } + return true; + } + return false; + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/world/GT_Worldgen_Ore_SingleBlock_UnderLava.java b/src/main/java/gregtech/api/world/GT_Worldgen_Ore_SingleBlock_UnderLava.java new file mode 100644 index 0000000..fc92108 --- /dev/null +++ b/src/main/java/gregtech/api/world/GT_Worldgen_Ore_SingleBlock_UnderLava.java @@ -0,0 +1,30 @@ +package gregtech.api.world; + +import java.util.Collection; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.chunk.IChunkProvider; + +public class GT_Worldgen_Ore_SingleBlock_UnderLava extends GT_Worldgen_Ore { + public GT_Worldgen_Ore_SingleBlock_UnderLava(String aName, boolean aDefault, Block aBlock, int aBlockMeta, int aDimensionType, int aAmount, int aSize, int aProbability, int aMinY, int aMaxY, Collection aBiomeList, boolean aAllowToGenerateinVoid) { + super(aName, aDefault, aBlock, aBlockMeta, aDimensionType, aAmount, aSize, aProbability, aMinY, aMaxY, aBiomeList, aAllowToGenerateinVoid); + } + + @Override + public boolean executeCavegen(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { + if (isGenerationAllowed(aWorld, aDimensionType, mDimensionType) && (mBiomeList.isEmpty() || mBiomeList.contains(aBiome)) && (mProbability <= 1 || aRandom.nextInt(mProbability) == 0)) { + for (int i = 0; i < mAmount; i++) { + int tX = aChunkX + aRandom.nextInt(16), tY = mMinY + aRandom.nextInt(mMaxY - mMinY), tZ = aChunkZ + aRandom.nextInt(16); + Block tBlock = aWorld.getBlock(tX, tY, tZ); + if (((mAllowToGenerateinVoid&&aWorld.getBlock(tX, tY, tZ).isAir(aWorld, tX, tY, tZ)) || (tBlock != null && (tBlock.isReplaceableOreGen(aWorld, tX, tY, tZ, Blocks.stone) || tBlock.isReplaceableOreGen(aWorld, tX, tY, tZ, Blocks.end_stone) || tBlock.isReplaceableOreGen(aWorld, tX, tY, tZ, Blocks.netherrack))))) { + if (aWorld.getBlock(tX, tY+1, tZ) == Blocks.lava || aWorld.getBlock(tX, tY, tZ) == Blocks.flowing_lava) aWorld.setBlock(tX, tY, tZ, mBlock, mBlockMeta, 0); + } + } + return true; + } + return false; + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Arm.java b/src/main/java/gregtech/common/covers/GT_Cover_Arm.java new file mode 100644 index 0000000..30bdce1 --- /dev/null +++ b/src/main/java/gregtech/common/covers/GT_Cover_Arm.java @@ -0,0 +1,131 @@ +/* 1: */ package gregtech.common.covers; +/* 2: */ +/* 3: */ import gregtech.api.interfaces.tileentity.ICoverable; +/* 4: */ import gregtech.api.interfaces.tileentity.IMachineProgress; +/* 5: */ import gregtech.api.util.GT_CoverBehavior; +/* 6: */ import gregtech.api.util.GT_Utility; +/* 7: */ import net.minecraft.entity.player.EntityPlayer; +/* 8: */ import net.minecraft.tileentity.TileEntity; +/* 9: */ import net.minecraftforge.fluids.Fluid; +/* 10: */ +/* 11: */ public class GT_Cover_Arm +/* 12: */ extends GT_CoverBehavior +/* 13: */ { +/* 14: */ public final int mTickRate; +/* 15: */ +/* 16: */ public GT_Cover_Arm(int aTickRate) +/* 17: */ { +/* 18:16 */ this.mTickRate = aTickRate; +/* 19: */ } +/* 20: */ +/* 21: */ @Override +public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) +/* 22: */ { +/* 23:21 */ if ((aCoverVariable == 0) || (((aTileEntity instanceof IMachineProgress)) && (!((IMachineProgress)aTileEntity).isAllowedToWork()))) { +/* 24:21 */ return aCoverVariable; +/* 25: */ } +/* 26:22 */ TileEntity tTileEntity = aTileEntity.getTileEntityAtSide(aSide); +/* 27:23 */ aTileEntity.decreaseStoredEnergyUnits(1L, true); +/* 28:24 */ if (aTileEntity.getUniversalEnergyCapacity() >= 128L) +/* 29: */ { +/* 30:25 */ if (aTileEntity.isUniversalEnergyStored(256L)) { +/* 31:26 */ aTileEntity.decreaseStoredEnergyUnits(4 * GT_Utility.moveOneItemStackIntoSlot(aCoverVariable > 0 ? aTileEntity : tTileEntity, aCoverVariable > 0 ? tTileEntity : aTileEntity, aCoverVariable > 0 ? aSide : GT_Utility.getOppositeSide(aSide), Math.abs(aCoverVariable) - 1, null, false, (byte)64, (byte)1, (byte)64, (byte)1), true); +/* 32: */ } +/* 33: */ } +/* 34: */ else { +/* 35:29 */ GT_Utility.moveOneItemStackIntoSlot(aCoverVariable > 0 ? aTileEntity : tTileEntity, aCoverVariable > 0 ? tTileEntity : aTileEntity, aCoverVariable > 0 ? aSide : GT_Utility.getOppositeSide(aSide), Math.abs(aCoverVariable) - 1, null, false, (byte)64, (byte)1, (byte)64, (byte)1); +/* 36: */ } +/* 37:31 */ return aCoverVariable; +/* 38: */ } +/* 39: */ +/* 40: */ @Override +public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) +/* 41: */ { +/* 42:36 */ if (GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ)[0] >= 0.5F) { +/* 43:36 */ aCoverVariable += 16; +/* 44: */ } else { +/* 45:36 */ aCoverVariable -= 16; +/* 46: */ } +/* 47:37 */ GT_Utility.sendChatToPlayer(aPlayer, (aCoverVariable > 0 ? "Puts out into adjacent Slot #" : "Grabs in for own Slot #") + (Math.abs(aCoverVariable) - 1)); +/* 48:38 */ return aCoverVariable; +/* 49: */ } +/* 50: */ +/* 51: */ @Override +public boolean onCoverRightclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) +/* 52: */ { +/* 53:43 */ if (GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ)[0] >= 0.5F) { +/* 54:43 */ aCoverVariable++; +/* 55: */ } else { +/* 56:43 */ aCoverVariable--; +/* 57: */ } +/* 58:44 */ GT_Utility.sendChatToPlayer(aPlayer, (aCoverVariable > 0 ? "Puts out into adjacent Slot #" : "Grabs in for own Slot #") + (Math.abs(aCoverVariable) - 1)); +/* 59:45 */ aTileEntity.setCoverDataAtSide(aSide, aCoverVariable); +/* 60:46 */ return true; +/* 61: */ } +/* 62: */ +/* 63: */ @Override +public boolean letsRedstoneGoIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 64: */ { +/* 65:51 */ return true; +/* 66: */ } +/* 67: */ +/* 68: */ @Override +public boolean letsRedstoneGoOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 69: */ { +/* 70:56 */ return true; +/* 71: */ } +/* 72: */ +/* 73: */ @Override +public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 74: */ { +/* 75:61 */ return true; +/* 76: */ } +/* 77: */ +/* 78: */ @Override +public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 79: */ { +/* 80:66 */ return true; +/* 81: */ } +/* 82: */ +/* 83: */ @Override +public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) +/* 84: */ { +/* 85:71 */ return true; +/* 86: */ } +/* 87: */ +/* 88: */ @Override +public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) +/* 89: */ { +/* 90:76 */ return true; +/* 91: */ } +/* 92: */ +/* 93: */ @Override +public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) +/* 94: */ { +/* 95:81 */ return true; +/* 96: */ } +/* 97: */ +/* 98: */ @Override +public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) +/* 99: */ { +/* :0:86 */ return true; +/* :1: */ } +/* :2: */ +/* :3: */ @Override +public boolean alwaysLookConnected(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* :4: */ { +/* :5:91 */ return true; +/* :6: */ } +/* :7: */ +/* :8: */ @Override +public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* :9: */ { +/* ;0:96 */ return this.mTickRate; +/* ;1: */ } +/* ;2: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.covers.GT_Cover_Arm + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Blastproof.java b/src/main/java/gregtech/common/covers/GT_Cover_Blastproof.java new file mode 100644 index 0000000..83e8761 --- /dev/null +++ b/src/main/java/gregtech/common/covers/GT_Cover_Blastproof.java @@ -0,0 +1,33 @@ +/* 1: */ package gregtech.common.covers; +/* 2: */ +/* 3: */ import gregtech.api.interfaces.tileentity.ICoverable; +/* 4: */ import gregtech.api.util.GT_CoverBehavior; +/* 5: */ +/* 6: */ public class GT_Cover_Blastproof +/* 7: */ extends GT_CoverBehavior +/* 8: */ { +/* 9: */ private final float mLevel; +/* 10: */ +/* 11: */ public GT_Cover_Blastproof(float aLevel) +/* 12: */ { +/* 13:11 */ this.mLevel = aLevel; +/* 14: */ } +/* 15: */ +/* 16: */ @Override +public float getBlastProofLevel(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 17: */ { +/* 18:16 */ return this.mLevel; +/* 19: */ } +/* 20: */ +/* 21: */ @Override +public boolean isSimpleCover() +/* 22: */ { +/* 23:21 */ return true; +/* 24: */ } +/* 25: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.covers.GT_Cover_Blastproof + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/covers/GT_Cover_ControlsWork.java b/src/main/java/gregtech/common/covers/GT_Cover_ControlsWork.java new file mode 100644 index 0000000..b639620 --- /dev/null +++ b/src/main/java/gregtech/common/covers/GT_Cover_ControlsWork.java @@ -0,0 +1,101 @@ +/* 1: */ package gregtech.common.covers; +/* 2: */ +/* 3: */ import gregtech.api.interfaces.tileentity.ICoverable; +/* 4: */ import gregtech.api.interfaces.tileentity.IMachineProgress; +/* 5: */ import gregtech.api.util.GT_CoverBehavior; +/* 6: */ import gregtech.api.util.GT_Utility; +/* 7: */ import net.minecraft.entity.player.EntityPlayer; +/* 8: */ import net.minecraftforge.fluids.Fluid; +/* 9: */ +/* 10: */ public class GT_Cover_ControlsWork +/* 11: */ extends GT_CoverBehavior +/* 12: */ { +/* 13: */ @Override +public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) +/* 14: */ { + if(aTileEntity instanceof IMachineProgress) + { + if((aInputRedstone > 0) == (aCoverVariable == 0) && aCoverVariable != 2) + ((IMachineProgress)aTileEntity).enableWorking(); + else + ((IMachineProgress)aTileEntity).disableWorking(); + ((IMachineProgress)aTileEntity).setWorkDataValue(aInputRedstone); + } + return aCoverVariable; +} +/* 30: */ +/* 31: */ @Override +public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 32: */ { +/* 33:22 */ return true; +/* 34: */ } +/* 35: */ +/* 36: */ @Override +public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 37: */ { +/* 38:27 */ return true; +/* 39: */ } +/* 40: */ +/* 41: */ @Override +public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) +/* 42: */ { +/* 43:32 */ return true; +/* 44: */ } +/* 45: */ +/* 46: */ @Override +public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) +/* 47: */ { +/* 48:37 */ return true; +/* 49: */ } +/* 50: */ +/* 51: */ @Override +public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) +/* 52: */ { +/* 53:42 */ return true; +/* 54: */ } +/* 55: */ +/* 56: */ @Override +public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) +/* 57: */ { +/* 58:47 */ return true; +/* 59: */ } +/* 60: */ +/* 61: */ @Override +public boolean onCoverRemoval(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, boolean aForced) +/* 62: */ { +/* 63:52 */ if ((aTileEntity instanceof IMachineProgress)) +/* 64: */ { +/* 65:53 */ ((IMachineProgress)aTileEntity).enableWorking(); +/* 66:54 */ ((IMachineProgress)aTileEntity).setWorkDataValue((byte)0); +/* 67: */ } +/* 68:56 */ return true; +/* 69: */ } +/* 70: */ +/* 71: */ @Override +public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) +/* 72: */ { +/* 73:61 */ aCoverVariable = (aCoverVariable + 1) % 3; +/* 74:62 */ if (aCoverVariable == 0) { +/* 75:62 */ GT_Utility.sendChatToPlayer(aPlayer, "Normal"); +/* 76: */ } +/* 77:63 */ if (aCoverVariable == 1) { +/* 78:63 */ GT_Utility.sendChatToPlayer(aPlayer, "Inverted"); +/* 79: */ } +/* 80:64 */ if (aCoverVariable == 2) { +/* 81:64 */ GT_Utility.sendChatToPlayer(aPlayer, "No Work at all"); +/* 82: */ } +/* 83:65 */ return aCoverVariable; +/* 84: */ } +/* 85: */ +/* 86: */ @Override +public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 87: */ { +/* 88:70 */ return 1; +/* 89: */ } +/* 90: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.covers.GT_Cover_ControlsWork + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java b/src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java new file mode 100644 index 0000000..86363ea --- /dev/null +++ b/src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java @@ -0,0 +1,151 @@ +/* 1: */ package gregtech.common.covers; +/* 2: */ +/* 3: */ import gregtech.api.interfaces.tileentity.ICoverable; +/* 4: */ import gregtech.api.interfaces.tileentity.IMachineProgress; +/* 5: */ import gregtech.api.util.GT_CoverBehavior; +/* 6: */ import gregtech.api.util.GT_Utility; +/* 7: */ import net.minecraft.entity.player.EntityPlayer; +/* 8: */ import net.minecraft.tileentity.TileEntity; +/* 9: */ import net.minecraftforge.fluids.Fluid; +/* 10: */ +/* 11: */ public class GT_Cover_Conveyor +/* 12: */ extends GT_CoverBehavior +/* 13: */ { +/* 14: */ public final int mTickRate; +/* 15: */ +/* 16: */ public GT_Cover_Conveyor(int aTickRate) +/* 17: */ { +/* 18:16 */ this.mTickRate = aTickRate; +/* 19: */ } +/* 20: */ +/* 21: */ @Override +public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) +/* 22: */ { +/* 23:21 */ if ((aCoverVariable % 6 > 1) && ((aTileEntity instanceof IMachineProgress))) { +/* 24:21 */ if (((IMachineProgress)aTileEntity).isAllowedToWork() != aCoverVariable % 6 < 4) { +/* 25:21 */ return aCoverVariable; +/* 26: */ } +/* 27: */ } +/* 28:22 */ TileEntity tTileEntity = aTileEntity.getTileEntityAtSide(aSide); +/* 29:23 */ aTileEntity.decreaseStoredEnergyUnits(1L, true); +/* 30:24 */ if (((aCoverVariable % 2 != 1) || (aSide != 1)) && ((aCoverVariable % 2 != 0) || (aSide != 0)) && (aTileEntity.getUniversalEnergyCapacity() >= 128L)) +/* 31: */ { +/* 32:25 */ if (aTileEntity.isUniversalEnergyStored(256L)) { +/* 33:26 */ aTileEntity.decreaseStoredEnergyUnits(4 * GT_Utility.moveOneItemStack(aCoverVariable % 2 == 0 ? aTileEntity : tTileEntity, aCoverVariable % 2 != 0 ? aTileEntity : tTileEntity, aCoverVariable % 2 != 0 ? GT_Utility.getOppositeSide(aSide) : aSide, aCoverVariable % 2 == 0 ? GT_Utility.getOppositeSide(aSide) : aSide, null, false, (byte)64, (byte)1, (byte)64, (byte)1), true); +/* 34: */ } +/* 35: */ } +/* 36: */ else { +/* 37:29 */ GT_Utility.moveOneItemStack(aCoverVariable % 2 == 0 ? aTileEntity : tTileEntity, aCoverVariable % 2 != 0 ? aTileEntity : tTileEntity, aCoverVariable % 2 != 0 ? GT_Utility.getOppositeSide(aSide) : aSide, aCoverVariable % 2 == 0 ? GT_Utility.getOppositeSide(aSide) : aSide, null, false, (byte)64, (byte)1, (byte)64, (byte)1); +/* 38: */ } +/* 39:31 */ return aCoverVariable; +/* 40: */ } +/* 41: */ +/* 42: */ @Override +public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) +/* 43: */ { +/* 44:36 */ aCoverVariable = (aCoverVariable + 1) % 12; +/* 45:37 */ if (aCoverVariable == 0) { +/* 46:37 */ GT_Utility.sendChatToPlayer(aPlayer, "Export"); +/* 47: */ } +/* 48:38 */ if (aCoverVariable == 1) { +/* 49:38 */ GT_Utility.sendChatToPlayer(aPlayer, "Import"); +/* 50: */ } +/* 51:39 */ if (aCoverVariable == 2) { +/* 52:39 */ GT_Utility.sendChatToPlayer(aPlayer, "Export (conditional)"); +/* 53: */ } +/* 54:40 */ if (aCoverVariable == 3) { +/* 55:40 */ GT_Utility.sendChatToPlayer(aPlayer, "Import (conditional)"); +/* 56: */ } +/* 57:41 */ if (aCoverVariable == 4) { +/* 58:41 */ GT_Utility.sendChatToPlayer(aPlayer, "Export (invert cond)"); +/* 59: */ } +/* 60:42 */ if (aCoverVariable == 5) { +/* 61:42 */ GT_Utility.sendChatToPlayer(aPlayer, "Import (invert cond)"); +/* 62: */ } +/* 63:43 */ if (aCoverVariable == 6) { +/* 64:43 */ GT_Utility.sendChatToPlayer(aPlayer, "Export allow Input"); +/* 65: */ } +/* 66:44 */ if (aCoverVariable == 7) { +/* 67:44 */ GT_Utility.sendChatToPlayer(aPlayer, "Import allow Output"); +/* 68: */ } +/* 69:45 */ if (aCoverVariable == 8) { +/* 70:45 */ GT_Utility.sendChatToPlayer(aPlayer, "Export allow Input (conditional)"); +/* 71: */ } +/* 72:46 */ if (aCoverVariable == 9) { +/* 73:46 */ GT_Utility.sendChatToPlayer(aPlayer, "Import allow Output (conditional)"); +/* 74: */ } +/* 75:47 */ if (aCoverVariable == 10) { +/* 76:47 */ GT_Utility.sendChatToPlayer(aPlayer, "Export allow Input (invert cond)"); +/* 77: */ } +/* 78:48 */ if (aCoverVariable == 11) { +/* 79:48 */ GT_Utility.sendChatToPlayer(aPlayer, "Import allow Output (invert cond)"); +/* 80: */ } +/* 81:49 */ return aCoverVariable; +/* 82: */ } +/* 83: */ +/* 84: */ @Override +public boolean letsRedstoneGoIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 85: */ { +/* 86:54 */ return true; +/* 87: */ } +/* 88: */ +/* 89: */ @Override +public boolean letsRedstoneGoOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 90: */ { +/* 91:59 */ return true; +/* 92: */ } +/* 93: */ +/* 94: */ @Override +public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 95: */ { +/* 96:64 */ return true; +/* 97: */ } +/* 98: */ +/* 99: */ @Override +public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* :0: */ { +/* :1:69 */ return true; +/* :2: */ } +/* :3: */ +/* :4: */ @Override +public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) +/* :5: */ { +/* :6:74 */ return true; +/* :7: */ } +/* :8: */ +/* :9: */ @Override +public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) +/* ;0: */ { +/* ;1:79 */ return true; +/* ;2: */ } +/* ;3: */ +/* ;4: */ @Override +public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) +/* ;5: */ { +/* ;6:84 */ return (aCoverVariable >= 6) || (aCoverVariable % 2 != 0); +/* ;7: */ } +/* ;8: */ +/* ;9: */ @Override +public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) +/* <0: */ { +/* <1:89 */ return (aCoverVariable >= 6) || (aCoverVariable % 2 == 0); +/* <2: */ } +/* <3: */ +/* <4: */ @Override +public boolean alwaysLookConnected(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* <5: */ { +/* <6:94 */ return true; +/* <7: */ } +/* <8: */ +/* <9: */ @Override +public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* =0: */ { +/* =1:99 */ return this.mTickRate; +/* =2: */ } +/* =3: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.covers.GT_Cover_Conveyor + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Crafting.java b/src/main/java/gregtech/common/covers/GT_Cover_Crafting.java new file mode 100644 index 0000000..c877761 --- /dev/null +++ b/src/main/java/gregtech/common/covers/GT_Cover_Crafting.java @@ -0,0 +1,39 @@ +/* 1: */ package gregtech.common.covers; +/* 2: */ +/* 3: */ import gregtech.api.interfaces.tileentity.ICoverable; +/* 4: */ import gregtech.api.util.GT_CoverBehavior; +/* 5: */ import net.minecraft.entity.player.EntityPlayer; +/* 6: */ import net.minecraft.entity.player.EntityPlayerMP; +/* 9: */ import net.minecraft.inventory.ContainerWorkbench; +/* 11: */ import net.minecraft.network.play.server.S2DPacketOpenWindow; +/* 13: */ +/* 14: */ public class GT_Cover_Crafting +/* 15: */ extends GT_CoverBehavior +/* 16: */ { +/* 17: */ @Override +public boolean onCoverRightclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) +/* 18: */ { +/* 19:13 */ if ((aPlayer instanceof EntityPlayerMP)) +/* 20: */ { +/* 21:14 */ ((EntityPlayerMP)aPlayer).getNextWindowId(); +/* 22:15 */ ((EntityPlayerMP)aPlayer).playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(((EntityPlayerMP)aPlayer).currentWindowId, 1, "Crafting", 9, true)); +/* 23:16 */ ((EntityPlayerMP)aPlayer).openContainer = new ContainerWorkbench(((EntityPlayerMP)aPlayer).inventory, ((EntityPlayerMP)aPlayer).worldObj, aTileEntity.getXCoord(), aTileEntity.getYCoord(), aTileEntity.getZCoord()) +/* 24: */ { +/* 25: */ @Override +public boolean canInteractWith(EntityPlayer par1EntityPlayer) +/* 26: */ { +/* 27:19 */ return true; +/* 28: */ } +/* 29:21 */ }; +/* 30:22 */ ((EntityPlayerMP)aPlayer).openContainer.windowId = ((EntityPlayerMP)aPlayer).currentWindowId; +/* 31:23 */ ((EntityPlayerMP)aPlayer).openContainer.addCraftingToCrafters((EntityPlayerMP)aPlayer); +/* 32: */ } +/* 33:25 */ return true; +/* 34: */ } +/* 35: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.covers.GT_Cover_Crafting + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/covers/GT_Cover_DoesWork.java b/src/main/java/gregtech/common/covers/GT_Cover_DoesWork.java new file mode 100644 index 0000000..9d56f5a --- /dev/null +++ b/src/main/java/gregtech/common/covers/GT_Cover_DoesWork.java @@ -0,0 +1,110 @@ +/* 1: */ package gregtech.common.covers; +/* 2: */ +/* 3: */ import gregtech.api.interfaces.tileentity.ICoverable; +/* 4: */ import gregtech.api.interfaces.tileentity.IMachineProgress; +/* 5: */ import gregtech.api.util.GT_CoverBehavior; +/* 6: */ import gregtech.api.util.GT_Utility; +/* 7: */ import net.minecraft.entity.player.EntityPlayer; +/* 8: */ import net.minecraftforge.fluids.Fluid; +/* 9: */ +/* 10: */ public class GT_Cover_DoesWork +/* 11: */ extends GT_CoverBehavior +/* 12: */ { +/* 13: */ @Override +public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) +/* 14: */ { +/* 15:13 */ if ((aTileEntity instanceof IMachineProgress)) +/* 16: */ { +/* 17:14 */ if (aCoverVariable < 2) +/* 18: */ { +/* 19:15 */ int tScale = ((IMachineProgress)aTileEntity).getMaxProgress() / 15; +/* 20:16 */ if ((tScale > 0) && (((IMachineProgress)aTileEntity).hasThingsToDo())) { +/* 21:17 */ aTileEntity.setOutputRedstoneSignal(aSide, aCoverVariable % 2 == 0 ? (byte)(((IMachineProgress)aTileEntity).getProgress() / tScale) : (byte)(15 - ((IMachineProgress)aTileEntity).getProgress() / tScale)); +/* 22: */ } else { +/* 23:19 */ aTileEntity.setOutputRedstoneSignal(aSide, (byte)(aCoverVariable % 2 == 0 ? 0 : 15)); +/* 24: */ } +/* 25: */ } +/* 26: */ else +/* 27: */ { +/* 28:22 */ aTileEntity.setOutputRedstoneSignal(aSide, (byte)((aCoverVariable % 2 == 0 ? 1 : 0) != (((IMachineProgress)aTileEntity).getMaxProgress() == 0 ? 1 : 0) ? 0 : 15)); +/* 29: */ } +/* 30: */ } +/* 31: */ else { +/* 32:25 */ aTileEntity.setOutputRedstoneSignal(aSide, (byte)0); +/* 33: */ } +/* 34:27 */ return aCoverVariable; +/* 35: */ } +/* 36: */ +/* 37: */ @Override +public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) +/* 38: */ { +/* 39:32 */ aCoverVariable = (aCoverVariable + 1) % 4; +/* 40:33 */ if (aCoverVariable == 0) { +/* 41:33 */ GT_Utility.sendChatToPlayer(aPlayer, "Normal"); +/* 42: */ } +/* 43:34 */ if (aCoverVariable == 1) { +/* 44:34 */ GT_Utility.sendChatToPlayer(aPlayer, "Inverted"); +/* 45: */ } +/* 46:35 */ if (aCoverVariable == 2) { +/* 47:35 */ GT_Utility.sendChatToPlayer(aPlayer, "Ready to work"); +/* 48: */ } +/* 49:36 */ if (aCoverVariable == 3) { +/* 50:36 */ GT_Utility.sendChatToPlayer(aPlayer, "Not ready to work"); +/* 51: */ } +/* 52:37 */ return aCoverVariable; +/* 53: */ } +/* 54: */ +/* 55: */ @Override +public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 56: */ { +/* 57:42 */ return true; +/* 58: */ } +/* 59: */ +/* 60: */ @Override +public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 61: */ { +/* 62:47 */ return true; +/* 63: */ } +/* 64: */ +/* 65: */ @Override +public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) +/* 66: */ { +/* 67:52 */ return true; +/* 68: */ } +/* 69: */ +/* 70: */ @Override +public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) +/* 71: */ { +/* 72:57 */ return true; +/* 73: */ } +/* 74: */ +/* 75: */ @Override +public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) +/* 76: */ { +/* 77:62 */ return true; +/* 78: */ } +/* 79: */ +/* 80: */ @Override +public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) +/* 81: */ { +/* 82:67 */ return true; +/* 83: */ } +/* 84: */ +/* 85: */ @Override +public boolean manipulatesSidedRedstoneOutput(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 86: */ { +/* 87:72 */ return true; +/* 88: */ } +/* 89: */ +/* 90: */ @Override +public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 91: */ { +/* 92:77 */ return 5; +/* 93: */ } +/* 94: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.covers.GT_Cover_DoesWork + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Drain.java b/src/main/java/gregtech/common/covers/GT_Cover_Drain.java new file mode 100644 index 0000000..bc89a85 --- /dev/null +++ b/src/main/java/gregtech/common/covers/GT_Cover_Drain.java @@ -0,0 +1,117 @@ +/* 1: */ package gregtech.common.covers; +/* 2: */ +/* 3: */ import gregtech.api.enums.Materials; +/* 4: */ import gregtech.api.interfaces.tileentity.ICoverable; +/* 5: */ import gregtech.api.interfaces.tileentity.IMachineProgress; +/* 6: */ import gregtech.api.util.GT_CoverBehavior; +/* 7: */ import gregtech.api.util.GT_Utility; +/* 8: */ import net.minecraft.block.Block; +/* 9: */ import net.minecraft.entity.player.EntityPlayer; +/* 10: */ import net.minecraft.init.Blocks; +/* 13: */ import net.minecraftforge.common.util.ForgeDirection; +/* 14: */ import net.minecraftforge.fluids.Fluid; +/* 15: */ import net.minecraftforge.fluids.FluidStack; +/* 16: */ import net.minecraftforge.fluids.IFluidBlock; +/* 17: */ import net.minecraftforge.fluids.IFluidHandler; +/* 18: */ +/* 19: */ public class GT_Cover_Drain +/* 20: */ extends GT_CoverBehavior +/* 21: */ { +/* 22: */ @Override +public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) +/* 23: */ { +/* 24:20 */ if ((aCoverVariable % 3 > 1) && ((aTileEntity instanceof IMachineProgress))) { +/* 25:20 */ if (((IMachineProgress)aTileEntity).isAllowedToWork() != aCoverVariable % 3 < 2) { +/* 26:20 */ return aCoverVariable; +/* 27: */ } +/* 28: */ } +/* 29:21 */ if (aSide != 6) +/* 30: */ { +/* 31:22 */ Block tBlock = aTileEntity.getBlockAtSide(aSide); +/* 32:23 */ if ((aCoverVariable < 3) && ((aTileEntity instanceof IFluidHandler))) +/* 33: */ { +/* 34:24 */ if ((aSide == 1) && +/* 35:25 */ (aTileEntity.getWorld().isRaining()) && +/* 36:26 */ (aTileEntity.getWorld().getPrecipitationHeight(aTileEntity.getXCoord(), aTileEntity.getZCoord()) - 2 < aTileEntity.getYCoord())) +/* 37: */ { +/* 38:27 */ int tAmount = (int)(aTileEntity.getBiome().rainfall * 10.0F); +/* 39:28 */ if (tAmount > 0) { +/* 40:29 */ ((IFluidHandler)aTileEntity).fill(ForgeDirection.getOrientation(aSide), Materials.Water.getFluid(aTileEntity.getWorld().isThundering() ? tAmount * 2 : tAmount), true); +/* 41: */ } +/* 42: */ } +/* 43:34 */ FluidStack tLiquid = null; +/* 44:35 */ if (tBlock != null) +/* 45: */ { +/* 46:36 */ if (((tBlock == Blocks.water) || (tBlock == Blocks.flowing_water)) && (aTileEntity.getMetaIDAtSide(aSide) == 0)) { +/* 47:37 */ tLiquid = Materials.Water.getFluid(1000L); +/* 48:38 */ } else if (((tBlock == Blocks.lava) || (tBlock == Blocks.flowing_lava)) && (aTileEntity.getMetaIDAtSide(aSide) == 0)) { +/* 49:39 */ tLiquid = Materials.Lava.getFluid(1000L); +/* 50:40 */ } else if ((tBlock instanceof IFluidBlock)) { +/* 51:41 */ tLiquid = ((IFluidBlock)tBlock).drain(aTileEntity.getWorld(), aTileEntity.getOffsetX(aSide, 1), aTileEntity.getOffsetY(aSide, 1), aTileEntity.getOffsetZ(aSide, 1), false); +/* 52: */ } +/* 53:43 */ if ((tLiquid != null) && (tLiquid.getFluid() != null) && ((aSide > 1) || ((aSide == 0) && (tLiquid.getFluid().getDensity() <= 0)) || ((aSide == 1) && (tLiquid.getFluid().getDensity() >= 0))) && +/* 54:44 */ (((IFluidHandler)aTileEntity).fill(ForgeDirection.getOrientation(aSide), tLiquid, false) == tLiquid.amount)) +/* 55: */ { +/* 56:45 */ ((IFluidHandler)aTileEntity).fill(ForgeDirection.getOrientation(aSide), tLiquid, true); +/* 57:46 */ aTileEntity.getWorld().setBlockToAir(aTileEntity.getXCoord() + ForgeDirection.getOrientation(aSide).offsetX, aTileEntity.getYCoord() + ForgeDirection.getOrientation(aSide).offsetY, aTileEntity.getZCoord() + ForgeDirection.getOrientation(aSide).offsetZ); +/* 58: */ } +/* 59: */ } +/* 60: */ } +/* 61:51 */ if ((aCoverVariable >= 3) && (tBlock != null) && ( +/* 62:52 */ (tBlock == Blocks.lava) || (tBlock == Blocks.flowing_lava) || (tBlock == Blocks.water) || (tBlock == Blocks.flowing_water) || ((tBlock instanceof IFluidBlock)))) { +/* 63:53 */ aTileEntity.getWorld().setBlock(aTileEntity.getOffsetX(aSide, 1), aTileEntity.getOffsetY(aSide, 1), aTileEntity.getOffsetZ(aSide, 1), Blocks.air, 0, 0); +/* 64: */ } +/* 65: */ } +/* 66:57 */ return aCoverVariable; +/* 67: */ } +/* 68: */ +/* 69: */ @Override +public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) +/* 70: */ { +/* 71:62 */ aCoverVariable = (aCoverVariable + 1) % 6; +/* 72:63 */ if (aCoverVariable == 0) { +/* 73:63 */ GT_Utility.sendChatToPlayer(aPlayer, "Import"); +/* 74: */ } +/* 75:64 */ if (aCoverVariable == 1) { +/* 76:64 */ GT_Utility.sendChatToPlayer(aPlayer, "Import (conditional)"); +/* 77: */ } +/* 78:65 */ if (aCoverVariable == 2) { +/* 79:65 */ GT_Utility.sendChatToPlayer(aPlayer, "Import (invert cond)"); +/* 80: */ } +/* 81:66 */ if (aCoverVariable == 3) { +/* 82:66 */ GT_Utility.sendChatToPlayer(aPlayer, "Keep Liquids Away"); +/* 83: */ } +/* 84:67 */ if (aCoverVariable == 4) { +/* 85:67 */ GT_Utility.sendChatToPlayer(aPlayer, "Keep Liquids Away (conditional)"); +/* 86: */ } +/* 87:68 */ if (aCoverVariable == 5) { +/* 88:68 */ GT_Utility.sendChatToPlayer(aPlayer, "Keep Liquids Away (invert cond)"); +/* 89: */ } +/* 90:69 */ return aCoverVariable; +/* 91: */ } +/* 92: */ +/* 93: */ @Override +public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) +/* 94: */ { +/* 95:74 */ if ((aCoverVariable > 1) && ((aTileEntity instanceof IMachineProgress))) {} +/* 96:74 */ return ((IMachineProgress)aTileEntity).isAllowedToWork() == aCoverVariable < 2; +/* 97: */ } +/* 98: */ +/* 99: */ @Override +public boolean alwaysLookConnected(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* :0: */ { +/* :1:79 */ return true; +/* :2: */ } +/* :3: */ +/* :4: */ @Override +public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* :5: */ { +/* :6:84 */ return aCoverVariable < 3 ? 50 : 1; +/* :7: */ } +/* :8: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.covers.GT_Cover_Drain + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/covers/GT_Cover_EUMeter.java b/src/main/java/gregtech/common/covers/GT_Cover_EUMeter.java new file mode 100644 index 0000000..476c7b7 --- /dev/null +++ b/src/main/java/gregtech/common/covers/GT_Cover_EUMeter.java @@ -0,0 +1,154 @@ +/* 1: */ package gregtech.common.covers; +/* 2: */ +/* 3: */ import gregtech.api.interfaces.tileentity.ICoverable; +/* 4: */ import gregtech.api.util.GT_CoverBehavior; +/* 5: */ import gregtech.api.util.GT_Utility; +/* 6: */ import net.minecraft.entity.player.EntityPlayer; +/* 7: */ import net.minecraftforge.fluids.Fluid; +/* 8: */ +/* 9: */ public class GT_Cover_EUMeter +/* 10: */ extends GT_CoverBehavior +/* 11: */ { +/* 12: */ @Override +public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) +/* 13: */ { +/* 14: 12 */ long tScale = 0L; +/* 15: 13 */ if (aCoverVariable < 2) +/* 16: */ { +/* 17: 14 */ tScale = aTileEntity.getUniversalEnergyCapacity() / 15L; +/* 18: 15 */ if (tScale > 0L) { +/* 19: 16 */ aTileEntity.setOutputRedstoneSignal(aSide, aCoverVariable % 2 == 0 ? (byte)(int)(aTileEntity.getUniversalEnergyStored() / tScale) : (byte)(int)(15L - aTileEntity.getUniversalEnergyStored() / tScale)); +/* 20: */ } else { +/* 21: 18 */ aTileEntity.setOutputRedstoneSignal(aSide, (byte)(aCoverVariable % 2 == 0 ? 0 : 15)); +/* 22: */ } +/* 23: */ } +/* 24: 20 */ else if (aCoverVariable < 4) +/* 25: */ { +/* 26: 21 */ tScale = aTileEntity.getEUCapacity() / 15L; +/* 27: 22 */ if (tScale > 0L) { +/* 28: 23 */ aTileEntity.setOutputRedstoneSignal(aSide, aCoverVariable % 2 == 0 ? (byte)(int)(aTileEntity.getStoredEU() / tScale) : (byte)(int)(15L - aTileEntity.getStoredEU() / tScale)); +/* 29: */ } else { +/* 30: 25 */ aTileEntity.setOutputRedstoneSignal(aSide, (byte)(aCoverVariable % 2 == 0 ? 0 : 15)); +/* 31: */ } +/* 32: */ } +/* 33: 27 */ else if (aCoverVariable < 6) +/* 34: */ { +/* 35: 28 */ tScale = aTileEntity.getSteamCapacity() / 15L; +/* 36: 29 */ if (tScale > 0L) { +/* 37: 30 */ aTileEntity.setOutputRedstoneSignal(aSide, aCoverVariable % 2 == 0 ? (byte)(int)(aTileEntity.getStoredSteam() / tScale) : (byte)(int)(15L - aTileEntity.getStoredSteam() / tScale)); +/* 38: */ } else { +/* 39: 32 */ aTileEntity.setOutputRedstoneSignal(aSide, (byte)(aCoverVariable % 2 == 0 ? 0 : 15)); +/* 40: */ } +/* 41: */ } +/* 42: 34 */ else if (aCoverVariable < 8) +/* 43: */ { +/* 44: 35 */ tScale = aTileEntity.getInputVoltage() * aTileEntity.getInputAmperage() / 15L; +/* 45: 36 */ if (tScale > 0L) { +/* 46: 37 */ aTileEntity.setOutputRedstoneSignal(aSide, aCoverVariable % 2 == 0 ? (byte)(int)(aTileEntity.getAverageElectricInput() / tScale) : (byte)(int)(15L - aTileEntity.getAverageElectricInput() / tScale)); +/* 47: */ } else { +/* 48: 39 */ aTileEntity.setOutputRedstoneSignal(aSide, (byte)(aCoverVariable % 2 == 0 ? 0 : 15)); +/* 49: */ } +/* 50: */ } +/* 51: 41 */ else if (aCoverVariable < 10) +/* 52: */ { +/* 53: 42 */ tScale = aTileEntity.getOutputVoltage() * aTileEntity.getOutputAmperage() / 15L; +/* 54: 43 */ if (tScale > 0L) { +/* 55: 44 */ aTileEntity.setOutputRedstoneSignal(aSide, aCoverVariable % 2 == 0 ? (byte)(int)(aTileEntity.getAverageElectricOutput() / tScale) : (byte)(int)(15L - aTileEntity.getAverageElectricOutput() / tScale)); +/* 56: */ } else { +/* 57: 46 */ aTileEntity.setOutputRedstoneSignal(aSide, (byte)(aCoverVariable % 2 == 0 ? 0 : 15)); +/* 58: */ } +/* 59: */ } +/* 60: 49 */ return aCoverVariable; +/* 61: */ } +/* 62: */ +/* 63: */ @Override +public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) +/* 64: */ { +/* 65: 54 */ aCoverVariable = (aCoverVariable + 1) % 10; +/* 66: 55 */ if (aCoverVariable == 0) { +/* 67: 55 */ GT_Utility.sendChatToPlayer(aPlayer, "Normal Universal Storage"); +/* 68: */ } +/* 69: 56 */ if (aCoverVariable == 1) { +/* 70: 56 */ GT_Utility.sendChatToPlayer(aPlayer, "Inverted Universal Storage"); +/* 71: */ } +/* 72: 57 */ if (aCoverVariable == 2) { +/* 73: 57 */ GT_Utility.sendChatToPlayer(aPlayer, "Normal Electricity Storage"); +/* 74: */ } +/* 75: 58 */ if (aCoverVariable == 3) { +/* 76: 58 */ GT_Utility.sendChatToPlayer(aPlayer, "Inverted Electricity Storage"); +/* 77: */ } +/* 78: 59 */ if (aCoverVariable == 4) { +/* 79: 59 */ GT_Utility.sendChatToPlayer(aPlayer, "Normal Steam Storage"); +/* 80: */ } +/* 81: 60 */ if (aCoverVariable == 5) { +/* 82: 60 */ GT_Utility.sendChatToPlayer(aPlayer, "Inverted Steam Storage"); +/* 83: */ } +/* 84: 61 */ if (aCoverVariable == 6) { +/* 85: 61 */ GT_Utility.sendChatToPlayer(aPlayer, "Normal Average Electric Input"); +/* 86: */ } +/* 87: 62 */ if (aCoverVariable == 7) { +/* 88: 62 */ GT_Utility.sendChatToPlayer(aPlayer, "Inverted Average Electric Input"); +/* 89: */ } +/* 90: 63 */ if (aCoverVariable == 8) { +/* 91: 63 */ GT_Utility.sendChatToPlayer(aPlayer, "Normal Average Electric Output"); +/* 92: */ } +/* 93: 64 */ if (aCoverVariable == 9) { +/* 94: 64 */ GT_Utility.sendChatToPlayer(aPlayer, "Inverted Average Electric Output"); +/* 95: */ } +/* 96: 65 */ return aCoverVariable; +/* 97: */ } +/* 98: */ +/* 99: */ @Override +public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 100: */ { +/* 101: 70 */ return true; +/* 102: */ } +/* 103: */ +/* 104: */ @Override +public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 105: */ { +/* 106: 75 */ return true; +/* 107: */ } +/* 108: */ +/* 109: */ @Override +public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) +/* 110: */ { +/* 111: 80 */ return true; +/* 112: */ } +/* 113: */ +/* 114: */ @Override +public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) +/* 115: */ { +/* 116: 85 */ return true; +/* 117: */ } +/* 118: */ +/* 119: */ @Override +public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) +/* 120: */ { +/* 121: 90 */ return true; +/* 122: */ } +/* 123: */ +/* 124: */ @Override +public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) +/* 125: */ { +/* 126: 95 */ return true; +/* 127: */ } +/* 128: */ +/* 129: */ @Override +public boolean manipulatesSidedRedstoneOutput(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 130: */ { +/* 131:100 */ return true; +/* 132: */ } +/* 133: */ +/* 134: */ @Override +public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 135: */ { +/* 136:105 */ return 5; +/* 137: */ } +/* 138: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.covers.GT_Cover_EUMeter + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/covers/GT_Cover_EnergyOnly.java b/src/main/java/gregtech/common/covers/GT_Cover_EnergyOnly.java new file mode 100644 index 0000000..203d0ce --- /dev/null +++ b/src/main/java/gregtech/common/covers/GT_Cover_EnergyOnly.java @@ -0,0 +1,122 @@ +/* 1: */ package gregtech.common.covers; +/* 2: */ +/* 3: */ import gregtech.api.interfaces.tileentity.ICoverable; +/* 4: */ import gregtech.api.interfaces.tileentity.IMachineProgress; +/* 5: */ import gregtech.api.util.GT_CoverBehavior; +/* 6: */ import gregtech.api.util.GT_Utility; +/* 7: */ import net.minecraft.entity.player.EntityPlayer; +/* 8: */ import net.minecraftforge.fluids.Fluid; +/* 9: */ +/* 10: */ public class GT_Cover_EnergyOnly +/* 11: */ extends GT_CoverBehavior +/* 12: */ { +/* 13: */ @Override +public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) +/* 14: */ { +/* 15:13 */ aCoverVariable = (aCoverVariable + 1) % 3; +/* 16:14 */ if (aCoverVariable == 0) { +/* 17:14 */ GT_Utility.sendChatToPlayer(aPlayer, "Allow"); +/* 18: */ } +/* 19:15 */ if (aCoverVariable == 1) { +/* 20:15 */ GT_Utility.sendChatToPlayer(aPlayer, "Allow (conditional)"); +/* 21: */ } +/* 22:16 */ if (aCoverVariable == 2) { +/* 23:16 */ GT_Utility.sendChatToPlayer(aPlayer, "Disallow (conditional)"); +/* 24: */ } +/* 25:17 */ return aCoverVariable; +/* 26: */ } +/* 27: */ +/* 28: */ @Override +public float getBlastProofLevel(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 29: */ { +/* 30:22 */ return 20.0F; +/* 31: */ } +/* 32: */ +/* 33: */ @Override +public boolean letsRedstoneGoIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 34: */ { +/* 35:27 */ return false; +/* 36: */ } +/* 37: */ +/* 38: */ @Override +public boolean letsRedstoneGoOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 39: */ { +/* 40:32 */ return false; +/* 41: */ } +/* 42: */ +/* 43: */ @Override +public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 44: */ { +/* 45:37 */ if ((aCoverVariable > 1) && ((aTileEntity instanceof IMachineProgress))) { +/* 46:37 */ if (((IMachineProgress)aTileEntity).isAllowedToWork() != aCoverVariable < 2) { +/* 47:37 */ return false; +/* 48: */ } +/* 49: */ } +/* 50:38 */ return true; +/* 51: */ } +/* 52: */ +/* 53: */ @Override +public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 54: */ { +/* 55:43 */ if ((aCoverVariable > 1) && ((aTileEntity instanceof IMachineProgress))) { +/* 56:43 */ if (((IMachineProgress)aTileEntity).isAllowedToWork() != aCoverVariable < 2) { +/* 57:43 */ return false; +/* 58: */ } +/* 59: */ } +/* 60:44 */ return true; +/* 61: */ } +/* 62: */ +/* 63: */ @Override +public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) +/* 64: */ { +/* 65:49 */ return false; +/* 66: */ } +/* 67: */ +/* 68: */ @Override +public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) +/* 69: */ { +/* 70:54 */ return false; +/* 71: */ } +/* 72: */ +/* 73: */ @Override +public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) +/* 74: */ { +/* 75:59 */ return false; +/* 76: */ } +/* 77: */ +/* 78: */ @Override +public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) +/* 79: */ { +/* 80:64 */ return false; +/* 81: */ } +/* 82: */ +/* 83: */ @Override +public boolean isGUIClickable(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 84: */ { +/* 85:69 */ return false; +/* 86: */ } +/* 87: */ +/* 88: */ @Override +public boolean manipulatesSidedRedstoneOutput(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 89: */ { +/* 90:74 */ return false; +/* 91: */ } +/* 92: */ +/* 93: */ @Override +public boolean onCoverRightclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) +/* 94: */ { +/* 95:79 */ return false; +/* 96: */ } +/* 97: */ +/* 98: */ @Override +public boolean onCoverRemoval(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, boolean aForced) +/* 99: */ { +/* :0:84 */ return true; +/* :1: */ } +/* :2: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.covers.GT_Cover_EnergyOnly + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java b/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java new file mode 100644 index 0000000..12e556f --- /dev/null +++ b/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java @@ -0,0 +1,109 @@ +/* 1: */ package gregtech.common.covers; +/* 2: */ +/* 3: */ import gregtech.api.interfaces.tileentity.ICoverable; +/* 4: */ import gregtech.api.util.GT_CoverBehavior; +/* 5: */ import gregtech.api.util.GT_Utility; +/* 6: */ import net.minecraft.entity.player.EntityPlayer; +/* 7: */ import net.minecraft.item.ItemStack; +/* 8: */ import net.minecraftforge.fluids.Fluid; +/* 9: */ +/* 10: */ public class GT_Cover_ItemMeter +/* 11: */ extends GT_CoverBehavior +/* 12: */ { +/* 13: */ @Override +public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) +/* 14: */ { +/* 15: */ int[] tSlots; +/* 17:14 */ if (aCoverVariable < 2) { +/* 18:15 */ tSlots = aTileEntity.getAccessibleSlotsFromSide(aSide); +/* 19: */ } else { +/* 20:17 */ tSlots = new int[] { aCoverVariable - 2 }; +/* 21: */ } +/* 22:19 */ int tAll = 0;int tFull = 0; +/* 23:20 */ for (int i : tSlots) { +/* 24:21 */ if ((i > 0) && (i < aTileEntity.getSizeInventory())) +/* 25: */ { +/* 26:22 */ tAll += 64; +/* 27:23 */ ItemStack tStack = aTileEntity.getStackInSlot(i); +/* 28:24 */ if (tStack != null) { +/* 29:25 */ tFull += tStack.stackSize * 64 / tStack.getMaxStackSize(); +/* 30: */ } +/* 31: */ } +/* 32: */ } +/* 33:29 */ tAll /= 14; +/* 34:30 */ if (tAll > 0) { +/* 35:31 */ aTileEntity.setOutputRedstoneSignal(aSide, aCoverVariable != 1 ? 0 : tFull > 0 ? (byte)(tFull / tAll + 1) : (byte)(15 - (tFull > 0 ? tFull / tAll + 1 : 0))); +/* 36: */ } else { +/* 37:33 */ aTileEntity.setOutputRedstoneSignal(aSide, (byte)(aCoverVariable != 1 ? 0 : 15)); +/* 38: */ } +/* 39:35 */ return aCoverVariable; +/* 40: */ } +/* 41: */ +/* 42: */ @Override +public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) +/* 43: */ { +/* 44:40 */ aCoverVariable = (aCoverVariable + 1) % (2 + aTileEntity.getSizeInventory()); +/* 45:41 */ if (aCoverVariable == 0) { +/* 46:41 */ GT_Utility.sendChatToPlayer(aPlayer, "Normal"); +/* 47:42 */ } else if (aCoverVariable == 1) { +/* 48:42 */ GT_Utility.sendChatToPlayer(aPlayer, "Inverted"); +/* 49: */ } else { +/* 50:43 */ GT_Utility.sendChatToPlayer(aPlayer, "Slot: " + (aCoverVariable - 2)); +/* 51: */ } +/* 52:44 */ return aCoverVariable; +/* 53: */ } +/* 54: */ +/* 55: */ @Override +public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 56: */ { +/* 57:49 */ return true; +/* 58: */ } +/* 59: */ +/* 60: */ @Override +public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 61: */ { +/* 62:54 */ return true; +/* 63: */ } +/* 64: */ +/* 65: */ @Override +public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) +/* 66: */ { +/* 67:59 */ return true; +/* 68: */ } +/* 69: */ +/* 70: */ @Override +public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) +/* 71: */ { +/* 72:64 */ return true; +/* 73: */ } +/* 74: */ +/* 75: */ @Override +public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) +/* 76: */ { +/* 77:69 */ return true; +/* 78: */ } +/* 79: */ +/* 80: */ @Override +public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) +/* 81: */ { +/* 82:74 */ return true; +/* 83: */ } +/* 84: */ +/* 85: */ @Override +public boolean manipulatesSidedRedstoneOutput(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 86: */ { +/* 87:79 */ return true; +/* 88: */ } +/* 89: */ +/* 90: */ @Override +public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 91: */ { +/* 92:84 */ return 5; +/* 93: */ } +/* 94: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.covers.GT_Cover_ItemMeter + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Lens.java b/src/main/java/gregtech/common/covers/GT_Cover_Lens.java new file mode 100644 index 0000000..e4a1f6d --- /dev/null +++ b/src/main/java/gregtech/common/covers/GT_Cover_Lens.java @@ -0,0 +1,27 @@ +/* 1: */ package gregtech.common.covers; +/* 2: */ +/* 3: */ import gregtech.api.interfaces.tileentity.ICoverable; +/* 4: */ import gregtech.api.util.GT_CoverBehavior; +/* 5: */ +/* 6: */ public class GT_Cover_Lens +/* 7: */ extends GT_CoverBehavior +/* 8: */ { +/* 9: */ private final byte mColor; +/* 10: */ +/* 11: */ public GT_Cover_Lens(byte aColor) +/* 12: */ { +/* 13:10 */ this.mColor = aColor; +/* 14: */ } +/* 15: */ +/* 16: */ @Override +public byte getLensColor(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 17: */ { +/* 18:15 */ return this.mColor; +/* 19: */ } +/* 20: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.covers.GT_Cover_Lens + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/covers/GT_Cover_LiquidMeter.java b/src/main/java/gregtech/common/covers/GT_Cover_LiquidMeter.java new file mode 100644 index 0000000..d05d639 --- /dev/null +++ b/src/main/java/gregtech/common/covers/GT_Cover_LiquidMeter.java @@ -0,0 +1,113 @@ +/* 1: */ package gregtech.common.covers; +/* 2: */ +/* 3: */ import gregtech.api.interfaces.tileentity.ICoverable; +/* 4: */ import gregtech.api.util.GT_CoverBehavior; +/* 5: */ import gregtech.api.util.GT_Utility; +/* 6: */ import net.minecraft.entity.player.EntityPlayer; +/* 7: */ import net.minecraftforge.common.util.ForgeDirection; +/* 8: */ import net.minecraftforge.fluids.Fluid; +/* 9: */ import net.minecraftforge.fluids.FluidStack; +/* 10: */ import net.minecraftforge.fluids.FluidTankInfo; +/* 11: */ import net.minecraftforge.fluids.IFluidHandler; +/* 12: */ +/* 13: */ public class GT_Cover_LiquidMeter +/* 14: */ extends GT_CoverBehavior +/* 15: */ { +/* 16: */ @Override +public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) +/* 17: */ { +/* 18:16 */ if ((aTileEntity instanceof IFluidHandler)) +/* 19: */ { +/* 20:17 */ FluidTankInfo[] tTanks = ((IFluidHandler)aTileEntity).getTankInfo(ForgeDirection.UNKNOWN); +/* 21:18 */ long tAll = 0L;long tFull = 0L; +/* 22:19 */ if (tTanks != null) { +/* 23:19 */ for (FluidTankInfo tTank : tTanks) { +/* 24:19 */ if (tTank != null) +/* 25: */ { +/* 26:20 */ tAll += tTank.capacity; +/* 27:21 */ FluidStack tLiquid = tTank.fluid; +/* 28:22 */ if (tLiquid != null) { +/* 29:23 */ tFull += tLiquid.amount; +/* 30: */ } +/* 31: */ } +/* 32: */ } +/* 33: */ } +/* 34:26 */ tAll /= 14L; +/* 35:27 */ if (tAll > 0L) { +/* 36:28 */ aTileEntity.setOutputRedstoneSignal(aSide, aCoverVariable == 0 ? 0 : tFull > 0L ? (byte)(int)(tFull / tAll + 1L) : (byte)(int)(15L - (tFull > 0L ? tFull / tAll + 1L : 0L))); +/* 37: */ } else { +/* 38:30 */ aTileEntity.setOutputRedstoneSignal(aSide, (byte)(aCoverVariable == 0 ? 0 : 15)); +/* 39: */ } +/* 40: */ } +/* 41: */ else +/* 42: */ { +/* 43:33 */ aTileEntity.setOutputRedstoneSignal(aSide, (byte)0); +/* 44: */ } +/* 45:35 */ return aCoverVariable; +/* 46: */ } +/* 47: */ +/* 48: */ @Override +public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) +/* 49: */ { +/* 50:40 */ if (aCoverVariable == 0) { +/* 51:41 */ GT_Utility.sendChatToPlayer(aPlayer, "Inverted"); +/* 52: */ } else { +/* 53:43 */ GT_Utility.sendChatToPlayer(aPlayer, "Normal"); +/* 54: */ } +/* 55:44 */ return aCoverVariable == 0 ? 1 : 0; +/* 56: */ } +/* 57: */ +/* 58: */ @Override +public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 59: */ { +/* 60:49 */ return true; +/* 61: */ } +/* 62: */ +/* 63: */ @Override +public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 64: */ { +/* 65:54 */ return true; +/* 66: */ } +/* 67: */ +/* 68: */ @Override +public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) +/* 69: */ { +/* 70:59 */ return true; +/* 71: */ } +/* 72: */ +/* 73: */ @Override +public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) +/* 74: */ { +/* 75:64 */ return true; +/* 76: */ } +/* 77: */ +/* 78: */ @Override +public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) +/* 79: */ { +/* 80:69 */ return true; +/* 81: */ } +/* 82: */ +/* 83: */ @Override +public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) +/* 84: */ { +/* 85:74 */ return true; +/* 86: */ } +/* 87: */ +/* 88: */ @Override +public boolean manipulatesSidedRedstoneOutput(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 89: */ { +/* 90:79 */ return true; +/* 91: */ } +/* 92: */ +/* 93: */ @Override +public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 94: */ { +/* 95:84 */ return 5; +/* 96: */ } +/* 97: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.covers.GT_Cover_LiquidMeter + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/covers/GT_Cover_NeedMaintainance.java b/src/main/java/gregtech/common/covers/GT_Cover_NeedMaintainance.java new file mode 100644 index 0000000..8626948 --- /dev/null +++ b/src/main/java/gregtech/common/covers/GT_Cover_NeedMaintainance.java @@ -0,0 +1,129 @@ +package gregtech.common.covers; + +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.ICoverable; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; +import gregtech.api.util.GT_CoverBehavior; +import gregtech.api.util.GT_Utility; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraftforge.fluids.Fluid; + +public class GT_Cover_NeedMaintainance extends GT_CoverBehavior{ + + @Override + public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) + { + boolean needsRepair = false; + if(aTileEntity instanceof IGregTechTileEntity){ + IGregTechTileEntity tTileEntity = (IGregTechTileEntity) aTileEntity; + IMetaTileEntity mTileEntity = tTileEntity.getMetaTileEntity(); + if(mTileEntity instanceof GT_MetaTileEntity_MultiBlockBase){ + GT_MetaTileEntity_MultiBlockBase multi = (GT_MetaTileEntity_MultiBlockBase) mTileEntity; + int ideal = multi.getIdealStatus(); + int real = multi.getRepairStatus(); + if((aCoverVariable ==0||aCoverVariable==1)&&(ideal-real>0)){ + needsRepair=true; + } + if((aCoverVariable ==2||aCoverVariable==3)&&(ideal-real>1)){ + needsRepair=true; + }if((aCoverVariable ==4||aCoverVariable==5)&&(ideal-real>2)){ + needsRepair=true; + }if((aCoverVariable ==6||aCoverVariable==7)&&(ideal-real>3)){ + needsRepair=true; + } + }} + if(aCoverVariable % 2 == 0){ + needsRepair = !needsRepair; + } + + aTileEntity.setOutputRedstoneSignal(aSide, (byte)(needsRepair ? 0 : 15)); + return aCoverVariable; + } + + @Override + public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) + /* 64: */ { + /* 65: 54 */ aCoverVariable = (aCoverVariable + 1) % 10; + /* 66: 55 */ if (aCoverVariable == 0) { + /* 67: 55 */ GT_Utility.sendChatToPlayer(aPlayer, "Emit if 1 Maintainance Needed"); + /* 68: */ } + /* 69: 56 */ if (aCoverVariable == 1) { + /* 70: 56 */ GT_Utility.sendChatToPlayer(aPlayer, "Emit if 1 Maintainance Needed(inverted)"); + /* 71: */ } + /* 72: 57 */ if (aCoverVariable == 2) { + /* 73: 57 */ GT_Utility.sendChatToPlayer(aPlayer, "Emit if 2 Maintainance Needed"); + /* 74: */ } + /* 75: 58 */ if (aCoverVariable == 3) { + /* 76: 58 */ GT_Utility.sendChatToPlayer(aPlayer, "Emit if 2 Maintainance Needed(inverted)"); + /* 77: */ } + /* 78: 59 */ if (aCoverVariable == 4) { + /* 79: 59 */ GT_Utility.sendChatToPlayer(aPlayer, "Emit if 3 Maintainance Needed"); + /* 80: */ } + /* 81: 60 */ if (aCoverVariable == 5) { + /* 82: 60 */ GT_Utility.sendChatToPlayer(aPlayer, "Emit if 3 Maintainance Needed(inverted)"); + /* 83: */ } + /* 84: 61 */ if (aCoverVariable == 6) { + /* 85: 61 */ GT_Utility.sendChatToPlayer(aPlayer, "Emit if 4 Maintainance Needed"); + /* 86: */ } + /* 87: 62 */ if (aCoverVariable == 7) { + /* 88: 62 */ GT_Utility.sendChatToPlayer(aPlayer, "Emit if 4 Maintainance Needed(inverted)"); + /* 89: */ } + /* 90: 63 */ if (aCoverVariable == 8) { + /* 91: 63 */ GT_Utility.sendChatToPlayer(aPlayer, "Emit if 5 Maintainance Needed"); + /* 92: */ } + /* 93: 64 */ if (aCoverVariable == 9) { + /* 94: 64 */ GT_Utility.sendChatToPlayer(aPlayer, "Emit if 5 Maintainance Needed(inverted)"); + /* 95: */ } + /* 96: 65 */ return aCoverVariable; + /* 97: */ } + /* 98: */ + /* 99: */ @Override + public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) + /* 100: */ { + /* 101: 70 */ return true; + /* 102: */ } + /* 103: */ + /* 104: */ @Override + public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) + /* 105: */ { + /* 106: 75 */ return true; + /* 107: */ } + /* 108: */ + /* 109: */ @Override + public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) + /* 110: */ { + /* 111: 80 */ return true; + /* 112: */ } + /* 113: */ + /* 114: */ @Override + public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) + /* 115: */ { + /* 116: 85 */ return true; + /* 117: */ } + /* 118: */ + /* 119: */ @Override + public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) + /* 120: */ { + /* 121: 90 */ return true; + /* 122: */ } + /* 123: */ + /* 124: */ @Override + public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) + /* 125: */ { + /* 126: 95 */ return true; + /* 127: */ } + /* 128: */ + /* 129: */ @Override + public boolean manipulatesSidedRedstoneOutput(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) + /* 130: */ { + /* 131:100 */ return true; + /* 132: */ } + /* 133: */ + /* 134: */ @Override + public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) + /* 135: */ { + /* 136:105 */ return 60; + /* 137: */ } + +} diff --git a/src/main/java/gregtech/common/covers/GT_Cover_PlayerDetector.java b/src/main/java/gregtech/common/covers/GT_Cover_PlayerDetector.java new file mode 100644 index 0000000..83d8011 --- /dev/null +++ b/src/main/java/gregtech/common/covers/GT_Cover_PlayerDetector.java @@ -0,0 +1,126 @@ +package gregtech.common.covers; + +import gregtech.api.interfaces.tileentity.ICoverable; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.util.GT_CoverBehavior; +import gregtech.api.util.GT_Utility; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraftforge.fluids.Fluid; + +public class GT_Cover_PlayerDetector extends GT_CoverBehavior{ + + private String placer = ""; + private int range = 8; + + @Override + public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) + { + boolean playerDetected = false; + + if(aTileEntity instanceof IGregTechTileEntity){ + if(aTileEntity.isUniversalEnergyStored(20)){ + aTileEntity.decreaseStoredEnergyUnits(20, true); + range = 32; + }else{range = 8;} + placer = ((IGregTechTileEntity) aTileEntity).getOwnerName(); + } + for (Object tObject : aTileEntity.getWorld().playerEntities) { + if ((tObject instanceof EntityPlayerMP)) + { + EntityPlayerMP tEntity = (EntityPlayerMP)tObject; + int dist = Math.max(1, (int)tEntity.getDistance(aTileEntity.getXCoord() + 0.5D, aTileEntity.getYCoord() + 0.5D, aTileEntity.getZCoord() + 0.5D)); + if (dist < range) + { + if (aCoverVariable == 0) + { + playerDetected=true; + break; + } + if (tEntity.getDisplayName().equalsIgnoreCase(placer)) + { + if (aCoverVariable == 1) + { + playerDetected=true; + break; + } + } + else if (aCoverVariable == 2) + { + playerDetected=true; + break; + } + } + } + } + + + aTileEntity.setOutputRedstoneSignal(aSide, (byte)(playerDetected ? 15 : 0)); + return aCoverVariable; + } + + @Override + public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) + /* 64: */ { + /* 65: 54 */ aCoverVariable = (aCoverVariable + 1) % 3; + /* 66: 55 */ if (aCoverVariable == 0) { + /* 67: 55 */ GT_Utility.sendChatToPlayer(aPlayer, "Emit if any Player is close"); + /* 68: */ } + /* 69: 56 */ if (aCoverVariable == 1) { + /* 70: 56 */ GT_Utility.sendChatToPlayer(aPlayer, "Emit if you are close"); + /* 71: */ } + /* 72: 57 */ if (aCoverVariable == 2) { + /* 73: 57 */ GT_Utility.sendChatToPlayer(aPlayer, "Emit if other player is close"); + /* 74: */ } + /* 96: 65 */ return aCoverVariable; + /* 97: */ } + /* 98: */ + /* 99: */ @Override + public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) + /* 100: */ { + /* 101: 70 */ return true; + /* 102: */ } + /* 103: */ + /* 104: */ @Override + public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) + /* 105: */ { + /* 106: 75 */ return true; + /* 107: */ } + /* 108: */ + /* 109: */ @Override + public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) + /* 110: */ { + /* 111: 80 */ return true; + /* 112: */ } + /* 113: */ + /* 114: */ @Override + public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) + /* 115: */ { + /* 116: 85 */ return true; + /* 117: */ } + /* 118: */ + /* 119: */ @Override + public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) + /* 120: */ { + /* 121: 90 */ return true; + /* 122: */ } + /* 123: */ + /* 124: */ @Override + public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) + /* 125: */ { + /* 126: 95 */ return true; + /* 127: */ } + /* 128: */ + /* 129: */ @Override + public boolean manipulatesSidedRedstoneOutput(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) + /* 130: */ { + /* 131:100 */ return true; + /* 132: */ } + /* 133: */ + /* 134: */ @Override + public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) + /* 135: */ { + /* 136:105 */ return 20; + /* 137: */ } + +} diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Pump.java b/src/main/java/gregtech/common/covers/GT_Cover_Pump.java new file mode 100644 index 0000000..558b0de --- /dev/null +++ b/src/main/java/gregtech/common/covers/GT_Cover_Pump.java @@ -0,0 +1,205 @@ +/* 1: */ package gregtech.common.covers; +/* 2: */ +/* 3: */ import gregtech.api.interfaces.tileentity.ICoverable; +/* 4: */ import gregtech.api.interfaces.tileentity.IMachineProgress; +/* 5: */ import gregtech.api.util.GT_CoverBehavior; +/* 6: */ import gregtech.api.util.GT_Utility; +/* 7: */ import net.minecraft.entity.player.EntityPlayer; +/* 8: */ import net.minecraftforge.common.util.ForgeDirection; +/* 9: */ import net.minecraftforge.fluids.Fluid; +/* 10: */ import net.minecraftforge.fluids.FluidStack; +/* 11: */ import net.minecraftforge.fluids.IFluidHandler; +/* 12: */ +/* 13: */ public class GT_Cover_Pump +/* 14: */ extends GT_CoverBehavior +/* 15: */ { +/* 16: */ public final int mTransferRate; +/* 17: */ +/* 18: */ public GT_Cover_Pump(int aTransferRate) +/* 19: */ { +/* 20: 18 */ this.mTransferRate = aTransferRate; +/* 21: */ } +/* 22: */ +/* 23: */ @Override +public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) +/* 24: */ { +/* 25: 23 */ if ((aCoverVariable % 6 > 1) && ((aTileEntity instanceof IMachineProgress))) { +/* 26: 23 */ if (((IMachineProgress)aTileEntity).isAllowedToWork() != aCoverVariable % 6 < 4) { +/* 27: 23 */ return aCoverVariable; +/* 28: */ } +/* 29: */ } +/* 30: 24 */ if ((aTileEntity instanceof IFluidHandler)) +/* 31: */ { +/* 32: 25 */ IFluidHandler tTank2 = aTileEntity.getITankContainerAtSide(aSide); +/* 33: 26 */ if (tTank2 != null) +/* 34: */ { +/* 35: 27 */ aTileEntity.decreaseStoredEnergyUnits(GT_Utility.getTier(this.mTransferRate), true); +/* 36: 28 */ IFluidHandler tTank1 = (IFluidHandler)aTileEntity; +/* 37: 29 */ if (aCoverVariable % 2 == 0) +/* 38: */ { +/* 39: 30 */ FluidStack tLiquid = tTank1.drain(ForgeDirection.getOrientation(aSide), this.mTransferRate, false); +/* 40: 31 */ if (tLiquid != null) +/* 41: */ { +/* 42: 32 */ tLiquid = tLiquid.copy(); +/* 43: 33 */ tLiquid.amount = tTank2.fill(ForgeDirection.getOrientation(aSide).getOpposite(), tLiquid, false); +/* 44: 34 */ if (tLiquid.amount > 0) { +/* 45: 35 */ if (((aCoverVariable % 2 != 1) || (aSide != 1)) && ((aCoverVariable % 2 != 0) || (aSide != 0)) && (aTileEntity.getUniversalEnergyCapacity() >= Math.min(1, tLiquid.amount / 10))) +/* 46: */ { +/* 47: 36 */ if (aTileEntity.isUniversalEnergyStored(Math.min(1, tLiquid.amount / 10))) +/* 48: */ { +/* 49: 37 */ aTileEntity.decreaseStoredEnergyUnits(Math.min(1, tLiquid.amount / 10), true); +/* 50: 38 */ tTank2.fill(ForgeDirection.getOrientation(aSide).getOpposite(), tTank1.drain(ForgeDirection.getOrientation(aSide), tLiquid.amount, true), true); +/* 51: */ } +/* 52: */ } +/* 53: */ else { +/* 54: 41 */ tTank2.fill(ForgeDirection.getOrientation(aSide).getOpposite(), tTank1.drain(ForgeDirection.getOrientation(aSide), tLiquid.amount, true), true); +/* 55: */ } +/* 56: */ } +/* 57: */ } +/* 58: */ } +/* 59: */ else +/* 60: */ { +/* 61: 46 */ FluidStack tLiquid = tTank2.drain(ForgeDirection.getOrientation(aSide).getOpposite(), this.mTransferRate, false); +/* 62: 47 */ if (tLiquid != null) +/* 63: */ { +/* 64: 48 */ tLiquid = tLiquid.copy(); +/* 65: 49 */ tLiquid.amount = tTank1.fill(ForgeDirection.getOrientation(aSide), tLiquid, false); +/* 66: 50 */ if (tLiquid.amount > 0) { +/* 67: 51 */ if (((aCoverVariable % 2 != 1) || (aSide != 1)) && ((aCoverVariable % 2 != 0) || (aSide != 0)) && (aTileEntity.getUniversalEnergyCapacity() >= Math.min(1, tLiquid.amount / 10))) +/* 68: */ { +/* 69: 52 */ if (aTileEntity.isUniversalEnergyStored(Math.min(1, tLiquid.amount / 10))) +/* 70: */ { +/* 71: 53 */ aTileEntity.decreaseStoredEnergyUnits(Math.min(1, tLiquid.amount / 10), true); +/* 72: 54 */ tTank1.fill(ForgeDirection.getOrientation(aSide), tTank2.drain(ForgeDirection.getOrientation(aSide).getOpposite(), tLiquid.amount, true), true); +/* 73: */ } +/* 74: */ } +/* 75: */ else { +/* 76: 57 */ tTank1.fill(ForgeDirection.getOrientation(aSide), tTank2.drain(ForgeDirection.getOrientation(aSide).getOpposite(), tLiquid.amount, true), true); +/* 77: */ } +/* 78: */ } +/* 79: */ } +/* 80: */ } +/* 81: */ } +/* 82: */ } +/* 83: 64 */ return aCoverVariable; +/* 84: */ } +/* 85: */ +/* 86: */ @Override +public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) +/* 87: */ { +/* 88: 69 */ aCoverVariable = (aCoverVariable + 1) % 12; +/* 89: 70 */ if (aCoverVariable == 0) { +/* 90: 70 */ GT_Utility.sendChatToPlayer(aPlayer, "Export"); +/* 91: */ } +/* 92: 71 */ if (aCoverVariable == 1) { +/* 93: 71 */ GT_Utility.sendChatToPlayer(aPlayer, "Import"); +/* 94: */ } +/* 95: 72 */ if (aCoverVariable == 2) { +/* 96: 72 */ GT_Utility.sendChatToPlayer(aPlayer, "Export (conditional)"); +/* 97: */ } +/* 98: 73 */ if (aCoverVariable == 3) { +/* 99: 73 */ GT_Utility.sendChatToPlayer(aPlayer, "Import (conditional)"); +/* 100: */ } +/* 101: 74 */ if (aCoverVariable == 4) { +/* 102: 74 */ GT_Utility.sendChatToPlayer(aPlayer, "Export (invert cond)"); +/* 103: */ } +/* 104: 75 */ if (aCoverVariable == 5) { +/* 105: 75 */ GT_Utility.sendChatToPlayer(aPlayer, "Import (invert cond)"); +/* 106: */ } +/* 107: 76 */ if (aCoverVariable == 6) { +/* 108: 76 */ GT_Utility.sendChatToPlayer(aPlayer, "Export allow Input"); +/* 109: */ } +/* 110: 77 */ if (aCoverVariable == 7) { +/* 111: 77 */ GT_Utility.sendChatToPlayer(aPlayer, "Import allow Output"); +/* 112: */ } +/* 113: 78 */ if (aCoverVariable == 8) { +/* 114: 78 */ GT_Utility.sendChatToPlayer(aPlayer, "Export allow Input (conditional)"); +/* 115: */ } +/* 116: 79 */ if (aCoverVariable == 9) { +/* 117: 79 */ GT_Utility.sendChatToPlayer(aPlayer, "Import allow Output (conditional)"); +/* 118: */ } +/* 119: 80 */ if (aCoverVariable == 10) { +/* 120: 80 */ GT_Utility.sendChatToPlayer(aPlayer, "Export allow Input (invert cond)"); +/* 121: */ } +/* 122: 81 */ if (aCoverVariable == 11) { +/* 123: 81 */ GT_Utility.sendChatToPlayer(aPlayer, "Import allow Output (invert cond)"); +/* 124: */ } +/* 125: 82 */ return aCoverVariable; +/* 126: */ } +/* 127: */ +/* 128: */ @Override +public boolean letsRedstoneGoIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 129: */ { +/* 130: 87 */ return true; +/* 131: */ } +/* 132: */ +/* 133: */ @Override +public boolean letsRedstoneGoOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 134: */ { +/* 135: 92 */ return true; +/* 136: */ } +/* 137: */ +/* 138: */ @Override +public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 139: */ { +/* 140: 97 */ return true; +/* 141: */ } +/* 142: */ +/* 143: */ @Override +public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 144: */ { +/* 145:102 */ return true; +/* 146: */ } +/* 147: */ +/* 148: */ @Override +public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) +/* 149: */ { +/* 150:107 */ return true; +/* 151: */ } +/* 152: */ +/* 153: */ @Override +public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) +/* 154: */ { +/* 155:112 */ return true; +/* 156: */ } +/* 157: */ +/* 158: */ @Override +public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) +/* 159: */ { +/* 160:117 */ if ((aCoverVariable > 1) && ((aTileEntity instanceof IMachineProgress))) { +/* 161:117 */ if (((IMachineProgress)aTileEntity).isAllowedToWork() != aCoverVariable % 6 < 4) { +/* 162:117 */ return false; +/* 163: */ } +/* 164: */ } +/* 165:118 */ return (aCoverVariable >= 6) || (aCoverVariable % 2 != 0); +/* 166: */ } +/* 167: */ +/* 168: */ @Override +public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) +/* 169: */ { +/* 170:123 */ if ((aCoverVariable > 1) && ((aTileEntity instanceof IMachineProgress))) { +/* 171:123 */ if (((IMachineProgress)aTileEntity).isAllowedToWork() != aCoverVariable % 6 < 4) { +/* 172:123 */ return false; +/* 173: */ } +/* 174: */ } +/* 175:124 */ return (aCoverVariable >= 6) || (aCoverVariable % 2 == 0); +/* 176: */ } +/* 177: */ +/* 178: */ @Override +public boolean alwaysLookConnected(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 179: */ { +/* 180:129 */ return true; +/* 181: */ } +/* 182: */ +/* 183: */ @Override +public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 184: */ { +/* 185:134 */ return 1; +/* 186: */ } +/* 187: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.covers.GT_Cover_Pump + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneConductor.java b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneConductor.java new file mode 100644 index 0000000..9bddf2a --- /dev/null +++ b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneConductor.java @@ -0,0 +1,100 @@ +/* 1: */ package gregtech.common.covers; +/* 2: */ +/* 3: */ import gregtech.api.interfaces.tileentity.ICoverable; +/* 4: */ import gregtech.api.util.GT_CoverBehavior; +/* 5: */ import gregtech.api.util.GT_Utility; +/* 6: */ import net.minecraft.entity.player.EntityPlayer; +/* 7: */ import net.minecraftforge.fluids.Fluid; +/* 8: */ +/* 9: */ public class GT_Cover_RedstoneConductor +/* 10: */ extends GT_CoverBehavior +/* 11: */ { +/* 12: */ @Override +public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) +/* 13: */ { +/* 14:12 */ if (aCoverVariable == 0) { +/* 15:12 */ aTileEntity.setOutputRedstoneSignal(aSide, aTileEntity.getStrongestRedstone()); +/* 16:13 */ } else if (aCoverVariable < 7) { +/* 17:13 */ aTileEntity.setOutputRedstoneSignal(aSide, aTileEntity.getInternalInputRedstoneSignal((byte)(aCoverVariable - 1))); +/* 18: */ } +/* 19:15 */ return aCoverVariable; +/* 20: */ } +/* 21: */ +/* 22: */ @Override +public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) +/* 23: */ { +/* 24:20 */ aCoverVariable = (aCoverVariable + 1) % 7; +/* 25:21 */ switch (aCoverVariable) +/* 26: */ { +/* 27: */ case 0: +/* 28:22 */ GT_Utility.sendChatToPlayer(aPlayer, "Conducts strongest Input"); break; +/* 29: */ case 1: +/* 30:23 */ GT_Utility.sendChatToPlayer(aPlayer, "Conducts from bottom Input"); break; +/* 31: */ case 2: +/* 32:24 */ GT_Utility.sendChatToPlayer(aPlayer, "Conducts from top Input"); break; +/* 33: */ case 3: +/* 34:25 */ GT_Utility.sendChatToPlayer(aPlayer, "Conducts from north Input"); break; +/* 35: */ case 4: +/* 36:26 */ GT_Utility.sendChatToPlayer(aPlayer, "Conducts from south Input"); break; +/* 37: */ case 5: +/* 38:27 */ GT_Utility.sendChatToPlayer(aPlayer, "Conducts from west Input"); break; +/* 39: */ case 6: +/* 40:28 */ GT_Utility.sendChatToPlayer(aPlayer, "Conducts from east Input"); +/* 41: */ } +/* 42:30 */ return aCoverVariable; +/* 43: */ } +/* 44: */ +/* 45: */ @Override +public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 46: */ { +/* 47:35 */ return true; +/* 48: */ } +/* 49: */ +/* 50: */ @Override +public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 51: */ { +/* 52:40 */ return true; +/* 53: */ } +/* 54: */ +/* 55: */ @Override +public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) +/* 56: */ { +/* 57:45 */ return true; +/* 58: */ } +/* 59: */ +/* 60: */ @Override +public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) +/* 61: */ { +/* 62:50 */ return true; +/* 63: */ } +/* 64: */ +/* 65: */ @Override +public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) +/* 66: */ { +/* 67:55 */ return true; +/* 68: */ } +/* 69: */ +/* 70: */ @Override +public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) +/* 71: */ { +/* 72:60 */ return true; +/* 73: */ } +/* 74: */ +/* 75: */ @Override +public boolean manipulatesSidedRedstoneOutput(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 76: */ { +/* 77:65 */ return true; +/* 78: */ } +/* 79: */ +/* 80: */ @Override +public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 81: */ { +/* 82:70 */ return 1; +/* 83: */ } +/* 84: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.covers.GT_Cover_RedstoneConductor + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneReceiverExternal.java b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneReceiverExternal.java new file mode 100644 index 0000000..689804f --- /dev/null +++ b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneReceiverExternal.java @@ -0,0 +1,33 @@ +/* 1: */ package gregtech.common.covers; +/* 2: */ +/* 3: */ import gregtech.api.GregTech_API; +/* 4: */ import gregtech.api.interfaces.tileentity.ICoverable; +/* 6: */ +/* 7: */ public class GT_Cover_RedstoneReceiverExternal +/* 8: */ extends GT_Cover_RedstoneWirelessBase +/* 9: */ { +/* 10: */ @Override +public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) +/* 11: */ { +/* 12: 9 */ aTileEntity.setOutputRedstoneSignal(aSide, GregTech_API.sWirelessRedstone.get(Integer.valueOf(aCoverVariable)) == null ? 0 : GregTech_API.sWirelessRedstone.get(Integer.valueOf(aCoverVariable)).byteValue()); +/* 13:10 */ return aCoverVariable; +/* 14: */ } +/* 15: */ +/* 16: */ @Override +public boolean manipulatesSidedRedstoneOutput(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 17: */ { +/* 18:15 */ return true; +/* 19: */ } +/* 20: */ +/* 21: */ @Override +public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 22: */ { +/* 23:20 */ return 1; +/* 24: */ } +/* 25: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.covers.GT_Cover_RedstoneReceiverExternal + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneReceiverInternal.java b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneReceiverInternal.java new file mode 100644 index 0000000..c2141a7 --- /dev/null +++ b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneReceiverInternal.java @@ -0,0 +1,32 @@ +/* 1: */ package gregtech.common.covers; +/* 2: */ +/* 3: */ import gregtech.api.GregTech_API; +/* 4: */ import gregtech.api.interfaces.tileentity.ICoverable; +/* 6: */ +/* 7: */ public class GT_Cover_RedstoneReceiverInternal +/* 8: */ extends GT_Cover_RedstoneWirelessBase +/* 9: */ { +/* 10: */ @Override +public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) +/* 11: */ { +/* 12: 9 */ return aCoverVariable; +/* 13: */ } +/* 14: */ +/* 15: */ @Override +public byte getRedstoneInput(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 16: */ { +/* 17:14 */ return GregTech_API.sWirelessRedstone.get(Integer.valueOf(aCoverVariable)) == null ? 0 : GregTech_API.sWirelessRedstone.get(Integer.valueOf(aCoverVariable)).byteValue(); +/* 18: */ } +/* 19: */ +/* 20: */ @Override +public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 21: */ { +/* 22:19 */ return 1; +/* 23: */ } +/* 24: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.covers.GT_Cover_RedstoneReceiverInternal + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneSignalizer.java b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneSignalizer.java new file mode 100644 index 0000000..ff89620 --- /dev/null +++ b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneSignalizer.java @@ -0,0 +1,96 @@ +/* 1: */ package gregtech.common.covers; +/* 2: */ +/* 3: */ import gregtech.api.interfaces.tileentity.ICoverable; +/* 4: */ import gregtech.api.interfaces.tileentity.IMachineProgress; +/* 5: */ import gregtech.api.util.GT_CoverBehavior; +/* 6: */ import gregtech.api.util.GT_Utility; +/* 7: */ import net.minecraft.entity.player.EntityPlayer; +/* 8: */ import net.minecraftforge.fluids.Fluid; +/* 9: */ +/* 10: */ public class GT_Cover_RedstoneSignalizer +/* 11: */ extends GT_CoverBehavior +/* 12: */ { +/* 13: */ @Override +public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) +/* 14: */ { +/* 15:13 */ aCoverVariable = (aCoverVariable + 1) % 48; +/* 16:14 */ if (aCoverVariable / 16 == 0) { +/* 17:15 */ GT_Utility.sendChatToPlayer(aPlayer, "Signal = " + (aCoverVariable & 0xF)); +/* 18:16 */ } else if (aCoverVariable / 16 == 1) { +/* 19:17 */ GT_Utility.sendChatToPlayer(aPlayer, "Conditional Signal = " + (aCoverVariable & 0xF)); +/* 20:18 */ } else if (aCoverVariable / 16 == 2) { +/* 21:19 */ GT_Utility.sendChatToPlayer(aPlayer, "Inverted Conditional Signal = " + (aCoverVariable & 0xF)); +/* 22: */ } +/* 23:20 */ return aCoverVariable; +/* 24: */ } +/* 25: */ +/* 26: */ @Override +public boolean letsRedstoneGoIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 27: */ { +/* 28:25 */ return true; +/* 29: */ } +/* 30: */ +/* 31: */ @Override +public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 32: */ { +/* 33:30 */ return true; +/* 34: */ } +/* 35: */ +/* 36: */ @Override +public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 37: */ { +/* 38:35 */ return true; +/* 39: */ } +/* 40: */ +/* 41: */ @Override +public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) +/* 42: */ { +/* 43:40 */ return true; +/* 44: */ } +/* 45: */ +/* 46: */ @Override +public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) +/* 47: */ { +/* 48:45 */ return true; +/* 49: */ } +/* 50: */ +/* 51: */ @Override +public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) +/* 52: */ { +/* 53:50 */ return true; +/* 54: */ } +/* 55: */ +/* 56: */ @Override +public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) +/* 57: */ { +/* 58:55 */ return true; +/* 59: */ } +/* 60: */ +/* 61: */ @Override +public byte getRedstoneInput(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 62: */ { +/* 63:60 */ if (aCoverVariable < 16) { +/* 64:60 */ return (byte)(aCoverVariable & 0xF); +/* 65: */ } +/* 66:61 */ if ((aTileEntity instanceof IMachineProgress)) +/* 67: */ { +/* 68:62 */ if (((IMachineProgress)aTileEntity).isAllowedToWork()) +/* 69: */ { +/* 70:63 */ if (aCoverVariable / 16 == 1) { +/* 71:64 */ return (byte)(aCoverVariable & 0xF); +/* 72: */ } +/* 73: */ } +/* 74:67 */ else if (aCoverVariable / 16 == 2) { +/* 75:68 */ return (byte)(aCoverVariable & 0xF); +/* 76: */ } +/* 77:71 */ return 0; +/* 78: */ } +/* 79:73 */ return (byte)(aCoverVariable & 0xF); +/* 80: */ } +/* 81: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.covers.GT_Cover_RedstoneSignalizer + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneTransmitterExternal.java b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneTransmitterExternal.java new file mode 100644 index 0000000..bf8337b --- /dev/null +++ b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneTransmitterExternal.java @@ -0,0 +1,33 @@ +/* 1: */ package gregtech.common.covers; +/* 2: */ +/* 3: */ import gregtech.api.GregTech_API; +/* 4: */ import gregtech.api.interfaces.tileentity.ICoverable; +/* 6: */ +/* 7: */ public class GT_Cover_RedstoneTransmitterExternal +/* 8: */ extends GT_Cover_RedstoneWirelessBase +/* 9: */ { +/* 10: */ @Override +public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) +/* 11: */ { +/* 12: 9 */ GregTech_API.sWirelessRedstone.put(Integer.valueOf(aCoverVariable), Byte.valueOf(aInputRedstone)); +/* 13:10 */ return aCoverVariable; +/* 14: */ } +/* 15: */ +/* 16: */ @Override +public boolean letsRedstoneGoIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 17: */ { +/* 18:15 */ return true; +/* 19: */ } +/* 20: */ +/* 21: */ @Override +public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 22: */ { +/* 23:20 */ return 1; +/* 24: */ } +/* 25: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.covers.GT_Cover_RedstoneTransmitterExternal + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneTransmitterInternal.java b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneTransmitterInternal.java new file mode 100644 index 0000000..1e1fcbb --- /dev/null +++ b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneTransmitterInternal.java @@ -0,0 +1,33 @@ +/* 1: */ package gregtech.common.covers; +/* 2: */ +/* 3: */ import gregtech.api.GregTech_API; +/* 4: */ import gregtech.api.interfaces.tileentity.ICoverable; +/* 6: */ +/* 7: */ public class GT_Cover_RedstoneTransmitterInternal +/* 8: */ extends GT_Cover_RedstoneWirelessBase +/* 9: */ { +/* 10: */ @Override +public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) +/* 11: */ { +/* 12: 9 */ GregTech_API.sWirelessRedstone.put(Integer.valueOf(aCoverVariable), Byte.valueOf(aTileEntity.getOutputRedstoneSignal(aSide))); +/* 13:10 */ return aCoverVariable; +/* 14: */ } +/* 15: */ +/* 16: */ @Override +public boolean letsRedstoneGoOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 17: */ { +/* 18:15 */ return true; +/* 19: */ } +/* 20: */ +/* 21: */ @Override +public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 22: */ { +/* 23:20 */ return 1; +/* 24: */ } +/* 25: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.covers.GT_Cover_RedstoneTransmitterInternal + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneWirelessBase.java b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneWirelessBase.java new file mode 100644 index 0000000..cdf5a31 --- /dev/null +++ b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneWirelessBase.java @@ -0,0 +1,113 @@ +/* 1: */ package gregtech.common.covers; +/* 2: */ +/* 3: */ import gregtech.api.GregTech_API; +/* 4: */ import gregtech.api.interfaces.tileentity.ICoverable; +/* 5: */ import gregtech.api.util.GT_CoverBehavior; +/* 6: */ import gregtech.api.util.GT_Utility; +/* 8: */ import net.minecraft.entity.player.EntityPlayer; +/* 10: */ import net.minecraftforge.fluids.Fluid; +/* 11: */ +/* 12: */ public abstract class GT_Cover_RedstoneWirelessBase +/* 13: */ extends GT_CoverBehavior +/* 14: */ { +/* 15: */ @Override +public boolean onCoverRemoval(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, boolean aForced) +/* 16: */ { +/* 17:13 */ GregTech_API.sWirelessRedstone.put(Integer.valueOf(aCoverVariable), Byte.valueOf((byte)0)); +/* 18:14 */ return true; +/* 19: */ } +/* 20: */ +/* 21: */ @Override +public boolean onCoverRightclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) +/* 22: */ { +/* 23:19 */ if (((aX > 0.375D) && (aX < 0.625D)) || ((aSide > 3) && (((aY > 0.375D) && (aY < 0.625D)) || ((aSide < 2) && (((aZ > 0.375D) && (aZ < 0.625D)) || (aSide == 2) || (aSide == 3)))))) +/* 24: */ { +/* 25:20 */ GregTech_API.sWirelessRedstone.put(Integer.valueOf(aCoverVariable), Byte.valueOf((byte)0)); +/* 26:21 */ aCoverVariable = GT_Utility.stackToInt(aPlayer.inventory.getCurrentItem()); +/* 27:22 */ aTileEntity.setCoverDataAtSide(aSide, aCoverVariable); +/* 28:23 */ GT_Utility.sendChatToPlayer(aPlayer, "Frequency: " + aCoverVariable); +/* 29:24 */ return true; +/* 30: */ } +/* 31:26 */ return false; +/* 32: */ } +/* 33: */ +/* 34: */ @Override +public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) +/* 35: */ { +/* 36:31 */ if (((aX > 0.375D) && (aX < 0.625D)) || ((aSide <= 3) || (((aY > 0.375D) && (aY < 0.625D)) || ((aSide >= 2) || (((aZ <= 0.375D) || (aZ >= 0.625D)) && (aSide != 2) && (aSide != 3)))))) +/* 37: */ { +/* 38:34 */ GregTech_API.sWirelessRedstone.put(Integer.valueOf(aCoverVariable), Byte.valueOf((byte)0)); +/* 39:35 */ float[] tCoords = GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ); +/* 40:36 */ switch ((byte)((byte)(int)(tCoords[0] * 2.0F) + 2 * (byte)(int)(tCoords[1] * 2.0F))) +/* 41: */ { +/* 42: */ case 0: +/* 43:38 */ aCoverVariable -= 32; +/* 44:39 */ break; +/* 45: */ case 1: +/* 46:41 */ aCoverVariable += 32; +/* 47:42 */ break; +/* 48: */ case 2: +/* 49:44 */ aCoverVariable -= 1024; +/* 50:45 */ break; +/* 51: */ case 3: +/* 52:47 */ aCoverVariable += 1024; +/* 53: */ } +/* 54: */ } +/* 55:51 */ GT_Utility.sendChatToPlayer(aPlayer, "Frequency: " + aCoverVariable); +/* 56:52 */ return aCoverVariable; +/* 57: */ } +/* 58: */ +/* 59: */ @Override +public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 60: */ { +/* 61:57 */ return true; +/* 62: */ } +/* 63: */ +/* 64: */ @Override +public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 65: */ { +/* 66:62 */ return true; +/* 67: */ } +/* 68: */ +/* 69: */ @Override +public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) +/* 70: */ { +/* 71:67 */ return true; +/* 72: */ } +/* 73: */ +/* 74: */ @Override +public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) +/* 75: */ { +/* 76:72 */ return true; +/* 77: */ } +/* 78: */ +/* 79: */ @Override +public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) +/* 80: */ { +/* 81:77 */ return true; +/* 82: */ } +/* 83: */ +/* 84: */ @Override +public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) +/* 85: */ { +/* 86:82 */ return true; +/* 87: */ } +/* 88: */ +/* 89: */ @Override +public String getDescription(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 90: */ { +/* 91:87 */ return "Frequency: " + aCoverVariable; +/* 92: */ } +/* 93: */ +/* 94: */ @Override +public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 95: */ { +/* 96:92 */ return 1; +/* 97: */ } +/* 98: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.covers.GT_Cover_RedstoneWirelessBase + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Screen.java b/src/main/java/gregtech/common/covers/GT_Cover_Screen.java new file mode 100644 index 0000000..06c1ac0 --- /dev/null +++ b/src/main/java/gregtech/common/covers/GT_Cover_Screen.java @@ -0,0 +1,100 @@ +/* 1: */ package gregtech.common.covers; +/* 2: */ +/* 3: */ import gregtech.api.interfaces.tileentity.ICoverable; +/* 4: */ import gregtech.api.util.GT_CoverBehavior; +/* 5: */ import net.minecraft.entity.player.EntityPlayer; +/* 6: */ import net.minecraftforge.fluids.Fluid; +/* 7: */ +/* 8: */ public class GT_Cover_Screen +/* 9: */ extends GT_CoverBehavior +/* 10: */ { +/* 11: */ @Override +public float getBlastProofLevel(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 12: */ { +/* 13:11 */ return 20.0F; +/* 14: */ } +/* 15: */ +/* 16: */ @Override +public boolean letsRedstoneGoIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 17: */ { +/* 18:16 */ return false; +/* 19: */ } +/* 20: */ +/* 21: */ @Override +public boolean letsRedstoneGoOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 22: */ { +/* 23:21 */ return false; +/* 24: */ } +/* 25: */ +/* 26: */ @Override +public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 27: */ { +/* 28:26 */ return false; +/* 29: */ } +/* 30: */ +/* 31: */ @Override +public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 32: */ { +/* 33:31 */ return false; +/* 34: */ } +/* 35: */ +/* 36: */ @Override +public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) +/* 37: */ { +/* 38:36 */ return false; +/* 39: */ } +/* 40: */ +/* 41: */ @Override +public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) +/* 42: */ { +/* 43:41 */ return false; +/* 44: */ } +/* 45: */ +/* 46: */ @Override +public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) +/* 47: */ { +/* 48:46 */ return false; +/* 49: */ } +/* 50: */ +/* 51: */ @Override +public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) +/* 52: */ { +/* 53:51 */ return false; +/* 54: */ } +/* 55: */ +/* 56: */ @Override +public boolean isGUIClickable(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 57: */ { +/* 58:56 */ return true; +/* 59: */ } +/* 60: */ +/* 61: */ @Override +public boolean manipulatesSidedRedstoneOutput(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 62: */ { +/* 63:61 */ return false; +/* 64: */ } +/* 65: */ +/* 66: */ @Override +public boolean onCoverRightclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) +/* 67: */ { +/* 68:66 */ return false; +/* 69: */ } +/* 70: */ +/* 71: */ @Override +public boolean onCoverRemoval(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, boolean aForced) +/* 72: */ { +/* 73:71 */ return true; +/* 74: */ } +/* 75: */ +/* 76: */ @Override +public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) +/* 77: */ { +/* 78:76 */ return 0; +/* 79: */ } +/* 80: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.covers.GT_Cover_Screen + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Shutter.java b/src/main/java/gregtech/common/covers/GT_Cover_Shutter.java new file mode 100644 index 0000000..8bfca37 --- /dev/null +++ b/src/main/java/gregtech/common/covers/GT_Cover_Shutter.java @@ -0,0 +1,103 @@ +/* 1: */ package gregtech.common.covers; +/* 2: */ +/* 3: */ import gregtech.api.interfaces.tileentity.ICoverable; +import gregtech.api.interfaces.tileentity.IMachineProgress; +/* 4: */ import gregtech.api.util.GT_CoverBehavior; +/* 5: */ import gregtech.api.util.GT_Utility; +/* 6: */ import net.minecraft.entity.player.EntityPlayer; +/* 7: */ import net.minecraftforge.fluids.Fluid; +/* 8: */ +/* 9: */ public class GT_Cover_Shutter +/* 10: */ extends GT_CoverBehavior +/* 11: */ { +/* 12: */ @Override +public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) +/* 13: */ { +/* 14:13 */ return aCoverVariable; +/* 15: */ } +/* 16: */ +/* 17: */ @Override +public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) +/* 18: */ { +/* 19:18 */ aCoverVariable = (aCoverVariable + 1) % 4; +/* 20:19 */ if (aCoverVariable == 0) { +/* 21:19 */ GT_Utility.sendChatToPlayer(aPlayer, "Open if work enabled"); +/* 22: */ } +/* 23:20 */ if (aCoverVariable == 1) { +/* 24:20 */ GT_Utility.sendChatToPlayer(aPlayer, "Open if work disabled"); +/* 25: */ } +/* 26:21 */ if (aCoverVariable == 2) { +/* 27:21 */ GT_Utility.sendChatToPlayer(aPlayer, "Only Output allowed"); +/* 28: */ } +/* 29:22 */ if (aCoverVariable == 3) { +/* 30:22 */ GT_Utility.sendChatToPlayer(aPlayer, "Only Input allowed"); +/* 31: */ } +/* 32:23 */ return aCoverVariable; +/* 33: */ } +/* 34: */ +/* 35: */ @Override +public boolean letsRedstoneGoIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +{ + return aCoverVariable >= 2 ? aCoverVariable == 3 : (aTileEntity instanceof IMachineProgress) ? ((IMachineProgress)aTileEntity).isAllowedToWork() ? aCoverVariable % 2 == 0 : aCoverVariable % 2 != 0 : true; +} + +@Override +public boolean letsRedstoneGoOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +{ + return aCoverVariable >= 2 ? aCoverVariable == 2 : (aTileEntity instanceof IMachineProgress) ? ((IMachineProgress)aTileEntity).isAllowedToWork() ? aCoverVariable % 2 == 0 : aCoverVariable % 2 != 0 : true; +} + +@Override +public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +{ + return aCoverVariable >= 2 ? aCoverVariable == 3 : (aTileEntity instanceof IMachineProgress) ? ((IMachineProgress)aTileEntity).isAllowedToWork() ? aCoverVariable % 2 == 0 : aCoverVariable % 2 != 0 : true; +} + +@Override +public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +{ + return aCoverVariable >= 2 ? aCoverVariable == 2 : (aTileEntity instanceof IMachineProgress) ? ((IMachineProgress)aTileEntity).isAllowedToWork() ? aCoverVariable % 2 == 0 : aCoverVariable % 2 != 0 : true; +} + +@Override +public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) +{ + return aCoverVariable >= 2 ? aCoverVariable == 3 : (aTileEntity instanceof IMachineProgress) ? ((IMachineProgress)aTileEntity).isAllowedToWork() ? aCoverVariable % 2 == 0 : aCoverVariable % 2 != 0 : true; +} + +@Override +public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) +{ + return aCoverVariable >= 2 ? aCoverVariable == 2 : (aTileEntity instanceof IMachineProgress) ? ((IMachineProgress)aTileEntity).isAllowedToWork() ? aCoverVariable % 2 == 0 : aCoverVariable % 2 != 0 : true; +} + +@Override +public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) +{ + return aCoverVariable >= 2 ? aCoverVariable == 3 : (aTileEntity instanceof IMachineProgress) ? ((IMachineProgress)aTileEntity).isAllowedToWork() ? aCoverVariable % 2 == 0 : aCoverVariable % 2 != 0 : true; +} + +@Override +public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) +{ + return aCoverVariable >= 2 ? aCoverVariable == 2 : (aTileEntity instanceof IMachineProgress) ? ((IMachineProgress)aTileEntity).isAllowedToWork() ? aCoverVariable % 2 == 0 : aCoverVariable % 2 != 0 : true; +} +/* 74: */ +/* 75: */ @Override +public boolean alwaysLookConnected(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 76: */ { +/* 77:68 */ return true; +/* 78: */ } +/* 79: */ +/* 80: */ @Override +public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 81: */ { +/* 82:73 */ return 0; +/* 83: */ } +/* 84: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.covers.GT_Cover_Shutter + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/covers/GT_Cover_SolarPanel.java b/src/main/java/gregtech/common/covers/GT_Cover_SolarPanel.java new file mode 100644 index 0000000..2e3664f --- /dev/null +++ b/src/main/java/gregtech/common/covers/GT_Cover_SolarPanel.java @@ -0,0 +1,47 @@ +/* 1: */ package gregtech.common.covers; +/* 2: */ +/* 3: */ import gregtech.api.interfaces.tileentity.ICoverable; +/* 4: */ import gregtech.api.util.GT_CoverBehavior; +/* 7: */ +/* 8: */ public class GT_Cover_SolarPanel +/* 9: */ extends GT_CoverBehavior +/* 10: */ { +/* 11: */ private final int mVoltage; +/* 12: */ +/* 13: */ public GT_Cover_SolarPanel(int aVoltage) +/* 14: */ { +/* 15:11 */ this.mVoltage = aVoltage; +/* 16: */ } +/* 17: */ +/* 18: */ @Override +public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) +/* 19: */ { +/* 20:16 */ if (aTimer % 100L == 0L) { +/* 21:17 */ if ((aSide != 1) || (aTileEntity.getWorld().isThundering())) +/* 22: */ { +/* 23:18 */ aCoverVariable = 0; +/* 24: */ } +/* 25: */ else +/* 26: */ { +/* 27:20 */ boolean bRain = (aTileEntity.getWorld().isRaining()) && (aTileEntity.getBiome().rainfall > 0.0F); +/* 28:21 */ aCoverVariable = ((!bRain) || (aTileEntity.getWorld().skylightSubtracted < 4)) && (aTileEntity.getSkyAtSide(aSide)) ? 1 : (bRain) || (!aTileEntity.getWorld().isDaytime()) ? 2 : 0; +/* 29: */ } +/* 30: */ } +/* 31:24 */ if ((aCoverVariable == 1) || ((aCoverVariable == 2) && (aTimer % 8L == 0L))) { +/* 32:24 */ aTileEntity.injectEnergyUnits((byte)6, this.mVoltage, 1L); +/* 33: */ } +/* 34:25 */ return aCoverVariable; +/* 35: */ } +/* 36: */ +/* 37: */ @Override +public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 38: */ { +/* 39:30 */ return 1; +/* 40: */ } +/* 41: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.covers.GT_Cover_SolarPanel + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Vent.java b/src/main/java/gregtech/common/covers/GT_Cover_Vent.java new file mode 100644 index 0000000..1d14725 --- /dev/null +++ b/src/main/java/gregtech/common/covers/GT_Cover_Vent.java @@ -0,0 +1,49 @@ +/* 1: */ package gregtech.common.covers; +/* 2: */ +/* 3: */ import gregtech.api.interfaces.tileentity.ICoverable; +/* 4: */ import gregtech.api.interfaces.tileentity.IMachineProgress; +/* 5: */ import gregtech.api.util.GT_CoverBehavior; +/* 6: */ import gregtech.api.util.GT_Utility; +/* 7: */ +/* 8: */ public class GT_Cover_Vent +/* 9: */ extends GT_CoverBehavior +/* 10: */ { +/* 11: */ private final int mEfficiency; +/* 12: */ +/* 13: */ public GT_Cover_Vent(int aEfficiency) +/* 14: */ { +/* 15:13 */ this.mEfficiency = aEfficiency; +/* 16: */ } +/* 17: */ +/* 18: */ @Override +public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) +/* 19: */ { +/* 20:18 */ if ((aTileEntity instanceof IMachineProgress)) +/* 21: */ { +/* 22:19 */ if ((((IMachineProgress)aTileEntity).hasThingsToDo()) && (aCoverVariable != ((IMachineProgress)aTileEntity).getProgress()) && +/* 23:20 */ (!GT_Utility.hasBlockHitBox(aTileEntity.getWorld(), aTileEntity.getOffsetX(aSide, 1), aTileEntity.getOffsetY(aSide, 1), aTileEntity.getOffsetZ(aSide, 1)))) { +/* 24:21 */ ((IMachineProgress)aTileEntity).increaseProgress(this.mEfficiency); +/* 25: */ } +/* 26:24 */ return ((IMachineProgress)aTileEntity).getProgress(); +/* 27: */ } +/* 28:26 */ return 0; +/* 29: */ } +/* 30: */ +/* 31: */ @Override +public boolean alwaysLookConnected(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 32: */ { +/* 33:31 */ return true; +/* 34: */ } +/* 35: */ +/* 36: */ @Override +public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +/* 37: */ { +/* 38:36 */ return 60; +/* 39: */ } +/* 40: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.covers.GT_Cover_Vent + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/entities/GT_Entity_Arrow.java b/src/main/java/gregtech/common/entities/GT_Entity_Arrow.java new file mode 100644 index 0000000..f444b74 --- /dev/null +++ b/src/main/java/gregtech/common/entities/GT_Entity_Arrow.java @@ -0,0 +1,397 @@ +/* 1: */ package gregtech.common.entities; +/* 10: */ import java.util.List; +/* 12: */ import java.util.UUID; + +/* 2: */ +/* 3: */ import com.mojang.authlib.GameProfile; + +/* 5: */ import gregtech.api.objects.ItemData; +/* 7: */ import gregtech.api.util.GT_OreDictUnificator; +/* 8: */ import gregtech.api.util.GT_Utility; +/* 13: */ import net.minecraft.block.Block; +/* 14: */ import net.minecraft.block.material.Material; +/* 15: */ import net.minecraft.enchantment.Enchantment; +/* 16: */ import net.minecraft.enchantment.EnchantmentHelper; +/* 17: */ import net.minecraft.entity.Entity; +/* 18: */ import net.minecraft.entity.EntityLivingBase; +/* 19: */ import net.minecraft.entity.monster.EntityCreeper; +/* 20: */ import net.minecraft.entity.monster.EntityEnderman; +/* 21: */ import net.minecraft.entity.player.EntityPlayer; +/* 22: */ import net.minecraft.entity.player.EntityPlayerMP; +/* 25: */ import net.minecraft.entity.projectile.EntityArrow; +/* 26: */ import net.minecraft.init.Blocks; +/* 27: */ import net.minecraft.init.Items; +/* 28: */ import net.minecraft.item.ItemStack; +/* 29: */ import net.minecraft.nbt.NBTTagCompound; +/* 31: */ import net.minecraft.network.play.server.S2BPacketChangeGameState; +/* 32: */ import net.minecraft.potion.Potion; +/* 33: */ import net.minecraft.util.AxisAlignedBB; +/* 34: */ import net.minecraft.util.DamageSource; +/* 35: */ import net.minecraft.util.MathHelper; +/* 36: */ import net.minecraft.util.MovingObjectPosition; +/* 37: */ import net.minecraft.util.Vec3; +/* 38: */ import net.minecraft.world.World; +/* 39: */ import net.minecraft.world.WorldServer; +/* 40: */ import net.minecraftforge.common.util.FakePlayerFactory; +/* 41: */ +/* 42: */ public class GT_Entity_Arrow +/* 43: */ extends EntityArrow +/* 44: */ { +/* 45: 36 */ private int mHitBlockX = -1; +/* 46: 37 */ private int mHitBlockY = -1; +/* 47: 38 */ private int mHitBlockZ = -1; +/* 48: 39 */ private Block mHitBlock = Blocks.air; +/* 49: 40 */ private int mHitBlockMeta = 0; +/* 50: 41 */ private boolean inGround = false; +/* 51: 42 */ private int mTicksAlive = 0; +/* 52: 43 */ private int ticksInAir = 0; +/* 53: 44 */ private int mKnockback = 0; +/* 54: 46 */ private ItemStack mArrow = null; +/* 55: */ +/* 56: */ public GT_Entity_Arrow(World aWorld) +/* 57: */ { +/* 58: 49 */ super(aWorld); +/* 59: */ } +/* 60: */ +/* 61: */ public GT_Entity_Arrow(World aWorld, double aX, double aY, double aZ) +/* 62: */ { +/* 63: 53 */ super(aWorld, aX, aY, aZ); +/* 64: */ } +/* 65: */ +/* 66: */ public GT_Entity_Arrow(World aWorld, EntityLivingBase aEntity, float aSpeed) +/* 67: */ { +/* 68: 57 */ super(aWorld, aEntity, aSpeed); +/* 69: */ } +/* 70: */ +/* 71: */ public GT_Entity_Arrow(EntityArrow aArrow, ItemStack aStack) +/* 72: */ { +/* 73: 61 */ super(aArrow.worldObj); +/* 74: 62 */ NBTTagCompound tNBT = new NBTTagCompound(); +/* 75: 63 */ aArrow.writeToNBT(tNBT); +/* 76: 64 */ readFromNBT(tNBT); +/* 77: 65 */ setArrowItem(aStack); +/* 78: */ } +/* 79: */ +/* 80: */ @Override +public void onUpdate() +/* 81: */ { +/* 82: 70 */ onEntityUpdate(); +/* 83: 71 */ if ((this.mArrow == null) && (!this.worldObj.isRemote)) +/* 84: */ { +/* 85: 72 */ setDead(); +/* 86: 73 */ return; +/* 87: */ } +/* 88: 76 */ Entity tShootingEntity = this.shootingEntity; +/* 89: 78 */ if ((this.prevRotationPitch == 0.0F) && (this.prevRotationYaw == 0.0F)) +/* 90: */ { +/* 91: 79 */ float f = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); +/* 92: 80 */ this.prevRotationYaw = (this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / 3.141592653589793D)); +/* 93: 81 */ this.prevRotationPitch = (this.rotationPitch = (float)(Math.atan2(this.motionY, f) * 180.0D / 3.141592653589793D)); +/* 94: */ } +/* 95: 84 */ if (this.mTicksAlive++ == 3000) { +/* 96: 84 */ setDead(); +/* 97: */ } +/* 98: 86 */ Block tBlock = this.worldObj.getBlock(this.mHitBlockX, this.mHitBlockY, this.mHitBlockZ); +/* 99: 88 */ if (tBlock.getMaterial() != Material.air) +/* 100: */ { +/* 101: 89 */ tBlock.setBlockBoundsBasedOnState(this.worldObj, this.mHitBlockX, this.mHitBlockY, this.mHitBlockZ); +/* 102: 90 */ AxisAlignedBB axisalignedbb = tBlock.getCollisionBoundingBoxFromPool(this.worldObj, this.mHitBlockX, this.mHitBlockY, this.mHitBlockZ); +/* 103: 91 */ if ((axisalignedbb != null) && (axisalignedbb.isVecInside(Vec3.createVectorHelper(this.posX, this.posY, this.posZ)))) { +/* 104: 91 */ this.inGround = true; +/* 105: */ } +/* 106: */ } +/* 107: 94 */ if (this.arrowShake > 0) { +/* 108: 94 */ this.arrowShake -= 1; +/* 109: */ } +/* 110: 96 */ if (this.inGround) +/* 111: */ { +/* 112: 97 */ int j = this.worldObj.getBlockMetadata(this.mHitBlockX, this.mHitBlockY, this.mHitBlockZ); +/* 113: 98 */ if ((tBlock != this.mHitBlock) || (j != this.mHitBlockMeta)) +/* 114: */ { +/* 115: 99 */ this.inGround = false; +/* 116:100 */ this.motionX *= this.rand.nextFloat() * 0.2F; +/* 117:101 */ this.motionY *= this.rand.nextFloat() * 0.2F; +/* 118:102 */ this.motionZ *= this.rand.nextFloat() * 0.2F; +/* 119:103 */ this.mTicksAlive = 0; +/* 120:104 */ this.ticksInAir = 0; +/* 121: */ } +/* 122: */ } +/* 123: */ else +/* 124: */ { +/* 125:107 */ this.ticksInAir += 1; +/* 126:108 */ Vec3 vec31 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); +/* 127:109 */ Vec3 vec3 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); +/* 128:110 */ MovingObjectPosition tVector = this.worldObj.func_147447_a(vec31, vec3, false, true, false); +/* 129:111 */ vec31 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); +/* 130:112 */ vec3 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); +/* 131:114 */ if (tVector != null) { +/* 132:114 */ vec3 = Vec3.createVectorHelper(tVector.hitVec.xCoord, tVector.hitVec.yCoord, tVector.hitVec.zCoord); +/* 133: */ } +/* 134:116 */ Entity tHitEntity = null; +/* 135:117 */ List tAllPotentiallyHitEntities = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D)); +/* 136:118 */ double tLargestDistance = 1.7976931348623157E+308D; +/* 137:120 */ for (int i = 0; i < tAllPotentiallyHitEntities.size(); i++) +/* 138: */ { +/* 139:121 */ Entity entity1 = (Entity)tAllPotentiallyHitEntities.get(i); +/* 140:123 */ if ((entity1.canBeCollidedWith()) && ((entity1 != tShootingEntity) || (this.ticksInAir >= 5))) +/* 141: */ { +/* 142:124 */ AxisAlignedBB axisalignedbb1 = entity1.boundingBox.expand(0.3D, 0.3D, 0.3D); +/* 143:125 */ MovingObjectPosition movingobjectposition1 = axisalignedbb1.calculateIntercept(vec31, vec3); +/* 144:127 */ if (movingobjectposition1 != null) +/* 145: */ { +/* 146:128 */ double tDistance = vec31.distanceTo(movingobjectposition1.hitVec); +/* 147:130 */ if (tDistance < tLargestDistance) +/* 148: */ { +/* 149:131 */ tHitEntity = entity1; +/* 150:132 */ tLargestDistance = tDistance; +/* 151: */ } +/* 152: */ } +/* 153: */ } +/* 154: */ } +/* 155:138 */ if (tHitEntity != null) { +/* 156:138 */ tVector = new MovingObjectPosition(tHitEntity); +/* 157: */ } +/* 158:140 */ if ((tVector != null) && (tVector.entityHit != null) && ((tVector.entityHit instanceof EntityPlayer))) +/* 159: */ { +/* 160:141 */ EntityPlayer entityplayer = (EntityPlayer)tVector.entityHit; +/* 161:142 */ if ((entityplayer.capabilities.disableDamage) || (((tShootingEntity instanceof EntityPlayer)) && (!((EntityPlayer)tShootingEntity).canAttackPlayer(entityplayer)))) { +/* 162:142 */ tVector = null; +/* 163: */ } +/* 164: */ } +/* 165:145 */ if (tVector != null) { +/* 166:146 */ if (tVector.entityHit != null) +/* 167: */ { +/* 168:147 */ ItemData tData = GT_OreDictUnificator.getItemData(this.mArrow); +/* 169: */ +/* 170: */ +/* 171:150 */ float tMagicDamage = (tVector.entityHit instanceof EntityLivingBase) ? EnchantmentHelper.func_152377_a(this.mArrow, ((EntityLivingBase)tVector.entityHit).getCreatureAttribute()) : 0.0F; +/* 172:151 */ float tDamage = MathHelper.ceiling_double_int(MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ) * (getDamage() + ((tData != null) && (tData.mMaterial != null) && (tData.mMaterial.mMaterial != null) ? tData.mMaterial.mMaterial.mToolQuality / 2.0F - 1.0F : 0.0F))); +/* 173:153 */ if (getIsCritical()) { +/* 174:153 */ tDamage += this.rand.nextInt((int)(tDamage / 2.0D + 2.0D)); +/* 175: */ } +/* 176:156 */ int tFireDamage = (isBurning() ? 5 : 0) + 4 * EnchantmentHelper.getEnchantmentLevel(Enchantment.fireAspect.effectId, this.mArrow); +/* 177:157 */ int tKnockback = this.mKnockback + EnchantmentHelper.getEnchantmentLevel(Enchantment.knockback.effectId, this.mArrow); +/* 178:158 */ int tHitTimer = -1; +/* 179: */ +/* 180:160 */ int[] tDamages = onHitEntity(tVector.entityHit, tShootingEntity == null ? this : tShootingEntity, this.mArrow == null ? new ItemStack(Items.arrow, 1) : this.mArrow, (int)(tDamage * 2.0F), (int)(tMagicDamage * 2.0F), tKnockback, tFireDamage, tHitTimer); +/* 181:162 */ if (tDamages != null) +/* 182: */ { +/* 183:163 */ tDamage = tDamages[0] / 2.0F; +/* 184:164 */ tMagicDamage = tDamages[1] / 2.0F; +/* 185:165 */ tKnockback = tDamages[2]; +/* 186:166 */ tFireDamage = tDamages[3]; +/* 187:167 */ tHitTimer = tDamages[4]; +/* 188:169 */ if ((tFireDamage > 0) && (!(tVector.entityHit instanceof EntityEnderman))) { +/* 189:169 */ tVector.entityHit.setFire(tFireDamage); +/* 190: */ } +/* 191:171 */ if ((!(tHitEntity instanceof EntityPlayer)) && (EnchantmentHelper.getEnchantmentLevel(Enchantment.looting.effectId, this.mArrow) > 0)) +/* 192: */ { +/* 193:172 */ EntityPlayer tPlayer = null; +/* 194:173 */ if ((this.worldObj instanceof WorldServer)) { +/* 195:173 */ tPlayer = FakePlayerFactory.get((WorldServer)this.worldObj, new GameProfile(new UUID(0L, 0L), (tShootingEntity instanceof EntityLivingBase) ? ((EntityLivingBase)tShootingEntity).getCommandSenderName() : "Arrow")); +/* 196: */ } +/* 197:174 */ if (tPlayer != null) +/* 198: */ { +/* 199:175 */ tPlayer.inventory.currentItem = 0; +/* 200:176 */ tPlayer.inventory.setInventorySlotContents(0, getArrowItem()); +/* 201:177 */ tShootingEntity = tPlayer; +/* 202:178 */ tPlayer.setDead(); +/* 203: */ } +/* 204: */ } +/* 205:182 */ DamageSource tDamageSource = DamageSource.causeArrowDamage(this, tShootingEntity == null ? this : tShootingEntity); +/* 206:184 */ if ((tDamage + tMagicDamage > 0.0F) && (tVector.entityHit.attackEntityFrom(tDamageSource, tDamage + tMagicDamage))) +/* 207: */ { +/* 208:185 */ if ((tVector.entityHit instanceof EntityLivingBase)) +/* 209: */ { +/* 210:186 */ if (tHitTimer >= 0) { +/* 211:186 */ tVector.entityHit.hurtResistantTime = tHitTimer; +/* 212: */ } +/* 213:188 */ if (((tVector.entityHit instanceof EntityCreeper)) && (EnchantmentHelper.getEnchantmentLevel(Enchantment.fireAspect.effectId, this.mArrow) > 0)) { +/* 214:188 */ ((EntityCreeper)tVector.entityHit).func_146079_cb(); +/* 215: */ } +/* 216:190 */ EntityLivingBase tHitLivingEntity = (EntityLivingBase)tVector.entityHit; +/* 217:192 */ if (!this.worldObj.isRemote) { +/* 218:192 */ tHitLivingEntity.setArrowCountInEntity(tHitLivingEntity.getArrowCountInEntity() + 1); +/* 219: */ } +/* 220:194 */ if (tKnockback > 0) +/* 221: */ { +/* 222:195 */ float tKnockbackDivider = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); +/* 223:196 */ if (tKnockbackDivider > 0.0F) { +/* 224:196 */ tHitLivingEntity.addVelocity(this.motionX * tKnockback * 0.6000000238418579D / tKnockbackDivider, 0.1D, this.motionZ * tKnockback * 0.6000000238418579D / tKnockbackDivider); +/* 225: */ } +/* 226: */ } +/* 227:199 */ GT_Utility.GT_EnchantmentHelper.applyBullshitA(tHitLivingEntity, tShootingEntity == null ? this : tShootingEntity, this.mArrow); +/* 228:200 */ GT_Utility.GT_EnchantmentHelper.applyBullshitB((tShootingEntity instanceof EntityLivingBase) ? (EntityLivingBase)tShootingEntity : null, tHitLivingEntity, this.mArrow); +/* 229:202 */ if ((tShootingEntity != null) && (tHitLivingEntity != tShootingEntity) && ((tHitLivingEntity instanceof EntityPlayer)) && ((tShootingEntity instanceof EntityPlayerMP))) { +/* 230:203 */ ((EntityPlayerMP)tShootingEntity).playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(6, 0.0F)); +/* 231: */ } +/* 232: */ } +/* 233:207 */ if (((tShootingEntity instanceof EntityPlayer)) && (tMagicDamage > 0.0F)) { +/* 234:207 */ ((EntityPlayer)tShootingEntity).onEnchantmentCritical(tVector.entityHit); +/* 235: */ } +/* 236:209 */ if ((!(tVector.entityHit instanceof EntityEnderman)) || (((EntityEnderman)tVector.entityHit).getActivePotionEffect(Potion.weakness) != null)) +/* 237: */ { +/* 238:210 */ if (tFireDamage > 0) { +/* 239:210 */ tVector.entityHit.setFire(tFireDamage); +/* 240: */ } +/* 241:211 */ playSound("random.bowhit", 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F)); +/* 242:212 */ setDead(); +/* 243: */ } +/* 244: */ } +/* 245: */ else +/* 246: */ { +/* 247:215 */ this.motionX *= -0.1000000014901161D; +/* 248:216 */ this.motionY *= -0.1000000014901161D; +/* 249:217 */ this.motionZ *= -0.1000000014901161D; +/* 250:218 */ this.rotationYaw += 180.0F; +/* 251:219 */ this.prevRotationYaw += 180.0F; +/* 252:220 */ this.ticksInAir = 0; +/* 253: */ } +/* 254: */ } +/* 255: */ } +/* 256: */ else +/* 257: */ { +/* 258:224 */ this.mHitBlockX = tVector.blockX; +/* 259:225 */ this.mHitBlockY = tVector.blockY; +/* 260:226 */ this.mHitBlockZ = tVector.blockZ; +/* 261:227 */ this.mHitBlock = this.worldObj.getBlock(this.mHitBlockX, this.mHitBlockY, this.mHitBlockZ); +/* 262:228 */ this.mHitBlockMeta = this.worldObj.getBlockMetadata(this.mHitBlockX, this.mHitBlockY, this.mHitBlockZ); +/* 263:229 */ this.motionX = ((float)(tVector.hitVec.xCoord - this.posX)); +/* 264:230 */ this.motionY = ((float)(tVector.hitVec.yCoord - this.posY)); +/* 265:231 */ this.motionZ = ((float)(tVector.hitVec.zCoord - this.posZ)); +/* 266:232 */ float f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ); +/* 267:233 */ this.posX -= this.motionX / f2 * 0.0500000007450581D; +/* 268:234 */ this.posY -= this.motionY / f2 * 0.0500000007450581D; +/* 269:235 */ this.posZ -= this.motionZ / f2 * 0.0500000007450581D; +/* 270:236 */ playSound("random.bowhit", 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F)); +/* 271:237 */ this.inGround = true; +/* 272:238 */ this.arrowShake = 7; +/* 273:239 */ setIsCritical(false); +/* 274:241 */ if (this.mHitBlock.getMaterial() != Material.air) { +/* 275:241 */ this.mHitBlock.onEntityCollidedWithBlock(this.worldObj, this.mHitBlockX, this.mHitBlockY, this.mHitBlockZ, this); +/* 276: */ } +/* 277:243 */ if ((!this.worldObj.isRemote) && (EnchantmentHelper.getEnchantmentLevel(Enchantment.fireAspect.effectId, this.mArrow) > 2)) { +/* 278:243 */ GT_Utility.setCoordsOnFire(this.worldObj, this.mHitBlockX, this.mHitBlockY, this.mHitBlockZ, true); +/* 279: */ } +/* 280:245 */ if (breaksOnImpact()) { +/* 281:245 */ setDead(); +/* 282: */ } +/* 283: */ } +/* 284: */ } +/* 285:249 */ if (getIsCritical()) { +/* 286:249 */ for (int i = 0; i < 4; i++) { +/* 287:249 */ this.worldObj.spawnParticle("crit", this.posX + this.motionX * i / 4.0D, this.posY + this.motionY * i / 4.0D, this.posZ + this.motionZ * i / 4.0D, -this.motionX, -this.motionY + 0.2D, -this.motionZ); +/* 288: */ } +/* 289: */ } +/* 290:251 */ this.posX += this.motionX;this.posY += this.motionY;this.posZ += this.motionZ; +/* 291: */ +/* 292:253 */ this.rotationYaw = ((float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / 3.141592653589793D)); +/* 293:255 */ for (this.rotationPitch = ((float)(Math.atan2(this.motionY, MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ)) * 180.0D / 3.141592653589793D)); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) {} +/* 294:257 */ while (this.rotationPitch - this.prevRotationPitch >= 180.0F) { +/* 295:257 */ this.prevRotationPitch += 360.0F; +/* 296: */ } +/* 297:258 */ while (this.rotationYaw - this.prevRotationYaw < -180.0F) { +/* 298:258 */ this.prevRotationYaw -= 360.0F; +/* 299: */ } +/* 300:259 */ while (this.rotationYaw - this.prevRotationYaw >= 180.0F) { +/* 301:259 */ this.prevRotationYaw += 360.0F; +/* 302: */ } +/* 303:261 */ this.rotationPitch = (this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F); +/* 304:262 */ this.rotationYaw = (this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F); +/* 305:263 */ float tFrictionMultiplier = 0.99F; +/* 306:265 */ if (isInWater()) +/* 307: */ { +/* 308:266 */ for (int l = 0; l < 4; l++) { +/* 309:266 */ this.worldObj.spawnParticle("bubble", this.posX - this.motionX * 0.25D, this.posY - this.motionY * 0.25D, this.posZ - this.motionZ * 0.25D, this.motionX, this.motionY, this.motionZ); +/* 310: */ } +/* 311:267 */ tFrictionMultiplier = 0.8F; +/* 312: */ } +/* 313:270 */ if (isWet()) { +/* 314:270 */ extinguish(); +/* 315: */ } +/* 316:272 */ this.motionX *= tFrictionMultiplier; +/* 317:273 */ this.motionY *= tFrictionMultiplier; +/* 318:274 */ this.motionZ *= tFrictionMultiplier; +/* 319:275 */ this.motionY -= 0.0500000007450581D; +/* 320:276 */ setPosition(this.posX, this.posY, this.posZ); +/* 321:277 */ func_145775_I(); +/* 322: */ } +/* 323: */ } +/* 324: */ +/* 325: */ @Override +public void writeEntityToNBT(NBTTagCompound aNBT) +/* 326: */ { +/* 327:283 */ super.writeEntityToNBT(aNBT); +/* 328:284 */ aNBT.setShort("xTile", (short)this.mHitBlockX); +/* 329:285 */ aNBT.setShort("yTile", (short)this.mHitBlockY); +/* 330:286 */ aNBT.setShort("zTile", (short)this.mHitBlockZ); +/* 331:287 */ aNBT.setShort("life", (short)this.mTicksAlive); +/* 332:288 */ aNBT.setByte("inTile", (byte)Block.getIdFromBlock(this.mHitBlock)); +/* 333:289 */ aNBT.setByte("inData", (byte)this.mHitBlockMeta); +/* 334:290 */ aNBT.setByte("shake", (byte)this.arrowShake); +/* 335:291 */ aNBT.setByte("inGround", (byte)(this.inGround ? 1 : 0)); +/* 336:292 */ aNBT.setByte("pickup", (byte)this.canBePickedUp); +/* 337:293 */ aNBT.setDouble("damage", getDamage()); +/* 338:294 */ aNBT.setTag("mArrow", this.mArrow == null ? null : this.mArrow.writeToNBT(new NBTTagCompound())); +/* 339: */ } +/* 340: */ +/* 341: */ @Override +public void readEntityFromNBT(NBTTagCompound aNBT) +/* 342: */ { +/* 343:299 */ super.readEntityFromNBT(aNBT); +/* 344:300 */ this.mHitBlockX = aNBT.getShort("xTile"); +/* 345:301 */ this.mHitBlockY = aNBT.getShort("yTile"); +/* 346:302 */ this.mHitBlockZ = aNBT.getShort("zTile"); +/* 347:303 */ this.mTicksAlive = aNBT.getShort("life"); +/* 348:304 */ this.mHitBlock = Block.getBlockById(aNBT.getByte("inTile") & 0xFF); +/* 349:305 */ this.mHitBlockMeta = (aNBT.getByte("inData") & 0xFF); +/* 350:306 */ this.arrowShake = (aNBT.getByte("shake") & 0xFF); +/* 351:307 */ this.inGround = (aNBT.getByte("inGround") == 1); +/* 352:308 */ setDamage(aNBT.getDouble("damage")); +/* 353:309 */ this.canBePickedUp = aNBT.getByte("pickup"); +/* 354:310 */ this.mArrow = GT_Utility.loadItem(aNBT, "mArrow"); +/* 355: */ } +/* 356: */ +/* 357: */ @Override +public void onCollideWithPlayer(EntityPlayer aPlayer) +/* 358: */ { +/* 359:315 */ if ((!this.worldObj.isRemote) && (this.inGround) && (this.arrowShake <= 0) && (this.canBePickedUp == 1) && (aPlayer.inventory.addItemStackToInventory(getArrowItem()))) +/* 360: */ { +/* 361:316 */ playSound("random.pop", 0.2F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F); +/* 362:317 */ aPlayer.onItemPickup(this, 1); +/* 363:318 */ setDead(); +/* 364: */ } +/* 365: */ } +/* 366: */ +/* 367: */ public int[] onHitEntity(Entity aHitEntity, Entity aShootingEntity, ItemStack aArrow, int aRegularDamage, int aMagicDamage, int aKnockback, int aFireDamage, int aHitTimer) +/* 368: */ { +/* 369:333 */ return new int[] { aRegularDamage, aMagicDamage, aKnockback, aFireDamage, aHitTimer }; +/* 370: */ } +/* 371: */ +/* 372: */ public void setArrowItem(ItemStack aStack) +/* 373: */ { +/* 374:337 */ this.mArrow = GT_Utility.updateItemStack(GT_Utility.copyAmount(1L, new Object[] { aStack })); +/* 375: */ } +/* 376: */ +/* 377: */ public ItemStack getArrowItem() +/* 378: */ { +/* 379:341 */ return GT_Utility.copy(new Object[] { this.mArrow }); +/* 380: */ } +/* 381: */ +/* 382: */ public boolean breaksOnImpact() +/* 383: */ { +/* 384:345 */ return false; +/* 385: */ } +/* 386: */ +/* 387: */ @Override +public void setKnockbackStrength(int aKnockback) +/* 388: */ { +/* 389:350 */ this.mKnockback = aKnockback; +/* 390: */ } +/* 391: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.entities.GT_Entity_Arrow + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/entities/GT_Entity_Arrow_Potion.java b/src/main/java/gregtech/common/entities/GT_Entity_Arrow_Potion.java new file mode 100644 index 0000000..8a047ec --- /dev/null +++ b/src/main/java/gregtech/common/entities/GT_Entity_Arrow_Potion.java @@ -0,0 +1,79 @@ +/* 1: */ package gregtech.common.entities; +/* 4: */ import net.minecraft.entity.Entity; +/* 5: */ import net.minecraft.entity.EntityLivingBase; +/* 6: */ import net.minecraft.item.ItemStack; +/* 7: */ import net.minecraft.nbt.NBTTagCompound; +/* 8: */ import net.minecraft.potion.PotionEffect; +/* 9: */ import net.minecraft.world.World; +/* 10: */ +/* 11: */ public class GT_Entity_Arrow_Potion +/* 12: */ extends GT_Entity_Arrow +/* 13: */ { +/* 14: */ public GT_Entity_Arrow_Potion(World aWorld) +/* 15: */ { +/* 16:13 */ super(aWorld); +/* 17: */ } +/* 18: */ +/* 19: */ public GT_Entity_Arrow_Potion(World aWorld, double aX, double aY, double aZ) +/* 20: */ { +/* 21:17 */ super(aWorld, aX, aY, aZ); +/* 22: */ } +/* 23: */ +/* 24: */ public GT_Entity_Arrow_Potion(World aWorld, EntityLivingBase aEntity, float aSpeed) +/* 25: */ { +/* 26:21 */ super(aWorld, aEntity, aSpeed); +/* 27: */ } +/* 28: */ +/* 29: */ @Override +public void writeEntityToNBT(NBTTagCompound aNBT) +/* 30: */ { +/* 31:26 */ super.writeEntityToNBT(aNBT); +/* 32:27 */ aNBT.setIntArray("mPotions", this.mPotions); +/* 33: */ } +/* 34: */ +/* 35: */ @Override +public void readEntityFromNBT(NBTTagCompound aNBT) +/* 36: */ { +/* 37:32 */ super.readEntityFromNBT(aNBT); +/* 38:33 */ setPotions(aNBT.getIntArray("mPotions")); +/* 39: */ } +/* 40: */ +/* 41: */ @Override +public boolean breaksOnImpact() +/* 42: */ { +/* 43:38 */ return true; +/* 44: */ } +/* 45: */ +/* 46: */ public void setPotions(int... aPotions) +/* 47: */ { +/* 48:49 */ if (aPotions != null) { +/* 49:49 */ this.mPotions = aPotions; +/* 50: */ } +/* 51: */ } +/* 52: */ +/* 53: */ public int[] getPotions() +/* 54: */ { +/* 55:53 */ return this.mPotions; +/* 56: */ } +/* 57: */ +/* 58:56 */ private int[] mPotions = new int[0]; +/* 59: */ +/* 60: */ @Override +public int[] onHitEntity(Entity aHitEntity, Entity aShootingEntity, ItemStack aArrow, int aRegularDamage, int aMagicDamage, int aKnockback, int aFireDamage, int aHitTimer) +/* 61: */ { +/* 62:60 */ if ((aHitEntity instanceof EntityLivingBase)) { +/* 63:60 */ for (int i = 3; i < this.mPotions.length; i += 4) { +/* 64:61 */ if (aHitEntity.worldObj.rand.nextInt(100) < this.mPotions[i]) { +/* 65:62 */ ((EntityLivingBase)aHitEntity).addPotionEffect(new PotionEffect(this.mPotions[(i - 3)], this.mPotions[(i - 2)], this.mPotions[(i - 1)], false)); +/* 66: */ } +/* 67: */ } +/* 68: */ } +/* 69:65 */ return super.onHitEntity(aHitEntity, aShootingEntity, aArrow, 1, aMagicDamage, aKnockback, aFireDamage, aHitTimer); +/* 70: */ } +/* 71: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.entities.GT_Entity_Arrow_Potion + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/gui/GT_Container_Boiler.java b/src/main/java/gregtech/common/gui/GT_Container_Boiler.java new file mode 100644 index 0000000..df33c4d --- /dev/null +++ b/src/main/java/gregtech/common/gui/GT_Container_Boiler.java @@ -0,0 +1,101 @@ +/* 1: */ package gregtech.common.gui; +/* 8: */ import java.util.Iterator; + +/* 2: */ +/* 3: */ import cpw.mods.fml.relauncher.Side; +/* 4: */ import cpw.mods.fml.relauncher.SideOnly; +/* 5: */ import gregtech.api.gui.GT_ContainerMetaTile_Machine; +/* 6: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 7: */ import gregtech.common.tileentities.boilers.GT_MetaTileEntity_Boiler; +/* 10: */ import net.minecraft.entity.player.InventoryPlayer; +/* 11: */ import net.minecraft.inventory.ICrafting; +/* 12: */ import net.minecraft.inventory.Slot; +/* 14: */ +/* 15: */ public class GT_Container_Boiler +/* 16: */ extends GT_ContainerMetaTile_Machine +/* 17: */ { +/* 18: */ public GT_Container_Boiler(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, int aSteamCapacity) +/* 19: */ { +/* 20:20 */ super(aInventoryPlayer, aTileEntity); +/* 21:21 */ this.mSteamCapacity = aSteamCapacity; +/* 22: */ } +/* 23: */ +/* 24: */ @Override +public void addSlots(InventoryPlayer aInventoryPlayer) +/* 25: */ { +/* 26:26 */ addSlotToContainer(new Slot(this.mTileEntity, 2, 116, 62)); +/* 27:27 */ addSlotToContainer(new Slot(this.mTileEntity, 0, 44, 26)); +/* 28:28 */ addSlotToContainer(new Slot(this.mTileEntity, 1, 44, 62)); +/* 29:29 */ addSlotToContainer(new Slot(this.mTileEntity, 3, 116, 26)); +/* 30: */ } +/* 31: */ +/* 32: */ @Override +public int getSlotCount() +/* 33: */ { +/* 34:34 */ return 4; +/* 35: */ } +/* 36: */ +/* 37: */ @Override +public int getShiftClickSlotCount() +/* 38: */ { +/* 39:39 */ return 1; +/* 40: */ } +/* 41: */ +/* 42:42 */ public int mWaterAmount = 0; +/* 43:42 */ public int mSteamAmount = 0; +/* 44:42 */ public int mProcessingEnergy = 0; +/* 45:42 */ public int mTemperature = 2; +/* 46: */ private final int mSteamCapacity; +/* 47: */ +/* 48: */ @Override +public void detectAndSendChanges() +/* 49: */ { +/* 50:46 */ super.detectAndSendChanges(); +/* 51:47 */ if ((this.mTileEntity.isClientSide()) || (this.mTileEntity.getMetaTileEntity() == null)) { +/* 52:47 */ return; +/* 53: */ } +/* 54:49 */ this.mTemperature = ((GT_MetaTileEntity_Boiler)this.mTileEntity.getMetaTileEntity()).mTemperature; +/* 55:50 */ this.mProcessingEnergy = ((GT_MetaTileEntity_Boiler)this.mTileEntity.getMetaTileEntity()).mProcessingEnergy; +/* 56:51 */ this.mSteamAmount = (((GT_MetaTileEntity_Boiler)this.mTileEntity.getMetaTileEntity()).mSteam == null ? 0 : ((GT_MetaTileEntity_Boiler)this.mTileEntity.getMetaTileEntity()).mSteam.amount); +/* 57:52 */ this.mWaterAmount = (((GT_MetaTileEntity_Boiler)this.mTileEntity.getMetaTileEntity()).mFluid == null ? 0 : ((GT_MetaTileEntity_Boiler)this.mTileEntity.getMetaTileEntity()).mFluid.amount); +/* 58: */ +/* 59:54 */ this.mTemperature = Math.min(54, Math.max(0, this.mTemperature * 54 / (((GT_MetaTileEntity_Boiler)this.mTileEntity.getMetaTileEntity()).maxProgresstime() - 10))); +/* 60:55 */ this.mSteamAmount = Math.min(54, Math.max(0, this.mSteamAmount * 54 / (this.mSteamCapacity - 100))); +/* 61:56 */ this.mWaterAmount = Math.min(54, Math.max(0, this.mWaterAmount * 54 / 15900)); +/* 62:57 */ this.mProcessingEnergy = Math.min(14, Math.max(this.mProcessingEnergy > 0 ? 1 : 0, this.mProcessingEnergy * 14 / 1000)); +/* 63: */ +/* 64:59 */ Iterator var2 = this.crafters.iterator(); +/* 65:60 */ while (var2.hasNext()) +/* 66: */ { +/* 67:61 */ ICrafting var1 = (ICrafting)var2.next(); +/* 68:62 */ var1.sendProgressBarUpdate(this, 100, this.mTemperature); +/* 69:63 */ var1.sendProgressBarUpdate(this, 101, this.mProcessingEnergy); +/* 70:64 */ var1.sendProgressBarUpdate(this, 102, this.mSteamAmount); +/* 71:65 */ var1.sendProgressBarUpdate(this, 103, this.mWaterAmount); +/* 72: */ } +/* 73: */ } +/* 74: */ +/* 75: */ @Override +@SideOnly(Side.CLIENT) +/* 76: */ public void updateProgressBar(int par1, int par2) +/* 77: */ { +/* 78:72 */ super.updateProgressBar(par1, par2); +/* 79:73 */ switch (par1) +/* 80: */ { +/* 81: */ case 100: +/* 82:74 */ this.mTemperature = par2; break; +/* 83: */ case 101: +/* 84:75 */ this.mProcessingEnergy = par2; break; +/* 85: */ case 102: +/* 86:76 */ this.mSteamAmount = par2; break; +/* 87: */ case 103: +/* 88:77 */ this.mWaterAmount = par2; +/* 89: */ } +/* 90: */ } +/* 91: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.gui.GT_Container_Boiler + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/gui/GT_Container_BronzeBlastFurnace.java b/src/main/java/gregtech/common/gui/GT_Container_BronzeBlastFurnace.java new file mode 100644 index 0000000..d71fd80 --- /dev/null +++ b/src/main/java/gregtech/common/gui/GT_Container_BronzeBlastFurnace.java @@ -0,0 +1,43 @@ +/* 1: */ package gregtech.common.gui; +/* 2: */ +/* 3: */ import gregtech.api.gui.GT_ContainerMetaTile_Machine; +/* 4: */ import gregtech.api.gui.GT_Slot_Output; +/* 5: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 6: */ import net.minecraft.entity.player.InventoryPlayer; +/* 7: */ import net.minecraft.inventory.Slot; +/* 8: */ +/* 9: */ public class GT_Container_BronzeBlastFurnace +/* 10: */ extends GT_ContainerMetaTile_Machine +/* 11: */ { +/* 12: */ public GT_Container_BronzeBlastFurnace(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) +/* 13: */ { +/* 14:12 */ super(aInventoryPlayer, aTileEntity); +/* 15: */ } +/* 16: */ +/* 17: */ @Override +public void addSlots(InventoryPlayer aInventoryPlayer) +/* 18: */ { +/* 19:17 */ addSlotToContainer(new Slot(this.mTileEntity, 0, 34, 16)); +/* 20:18 */ addSlotToContainer(new Slot(this.mTileEntity, 1, 34, 34)); +/* 21:19 */ addSlotToContainer(new GT_Slot_Output(this.mTileEntity, 2, 86, 25)); +/* 22:20 */ addSlotToContainer(new GT_Slot_Output(this.mTileEntity, 3, 104, 25)); +/* 23: */ } +/* 24: */ +/* 25: */ @Override +public int getSlotCount() +/* 26: */ { +/* 27:25 */ return 4; +/* 28: */ } +/* 29: */ +/* 30: */ @Override +public int getShiftClickSlotCount() +/* 31: */ { +/* 32:30 */ return 2; +/* 33: */ } +/* 34: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.gui.GT_Container_BronzeBlastFurnace + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/gui/GT_Container_ChestBuffer.java b/src/main/java/gregtech/common/gui/GT_Container_ChestBuffer.java new file mode 100644 index 0000000..174a61d --- /dev/null +++ b/src/main/java/gregtech/common/gui/GT_Container_ChestBuffer.java @@ -0,0 +1,97 @@ +/* 1: */ package gregtech.common.gui; +/* 2: */ +/* 3: */ import gregtech.api.gui.GT_ContainerMetaTile_Machine; +/* 4: */ import gregtech.api.gui.GT_Slot_Holo; +/* 5: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 6: */ import gregtech.api.util.GT_Utility; +/* 7: */ import gregtech.common.tileentities.automation.GT_MetaTileEntity_ChestBuffer; +/* 9: */ import net.minecraft.entity.player.EntityPlayer; +/* 10: */ import net.minecraft.entity.player.InventoryPlayer; +/* 11: */ import net.minecraft.inventory.Slot; +/* 12: */ import net.minecraft.item.ItemStack; +/* 13: */ +/* 14: */ public class GT_Container_ChestBuffer +/* 15: */ extends GT_ContainerMetaTile_Machine +/* 16: */ { +/* 17: */ public GT_Container_ChestBuffer(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) +/* 18: */ { +/* 19:16 */ super(aInventoryPlayer, aTileEntity); +/* 20: */ } +/* 21: */ +/* 22: */ @Override +public void addSlots(InventoryPlayer aInventoryPlayer) +/* 23: */ { +/* 24:21 */ for (int y = 0; y < 3; y++) { +/* 25:21 */ for (int x = 0; x < 9; x++) { +/* 26:21 */ addSlotToContainer(new Slot(this.mTileEntity, x + y * 9, 8 + x * 18, 5 + y * 18)); +/* 27: */ } +/* 28: */ } +/* 29:22 */ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 27, 8, 63, false, true, 1)); +/* 30:23 */ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 27, 26, 63, false, true, 1)); +/* 31:24 */ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 27, 44, 63, false, true, 1)); +/* 32: */ } +/* 33: */ +/* 34: */ @Override +public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) +/* 35: */ { +/* 36:29 */ if (aSlotIndex < 27) { +/* 37:29 */ return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); +/* 38: */ } +/* 39:31 */ Slot tSlot = (Slot)this.inventorySlots.get(aSlotIndex); +/* 40:32 */ if (tSlot != null) +/* 41: */ { +/* 42:33 */ if (this.mTileEntity.getMetaTileEntity() == null) { +/* 43:33 */ return null; +/* 44: */ } +/* 45:34 */ if (aSlotIndex == 27) +/* 46: */ { +/* 47:35 */ ((GT_MetaTileEntity_ChestBuffer)this.mTileEntity.getMetaTileEntity()).bOutput = (!((GT_MetaTileEntity_ChestBuffer)this.mTileEntity.getMetaTileEntity()).bOutput); +/* 48:36 */ if (((GT_MetaTileEntity_ChestBuffer)this.mTileEntity.getMetaTileEntity()).bOutput) { +/* 49:37 */ GT_Utility.sendChatToPlayer(aPlayer, "Emit Energy to Outputside"); +/* 50: */ } else { +/* 51:39 */ GT_Utility.sendChatToPlayer(aPlayer, "Don't emit Energy"); +/* 52: */ } +/* 53:40 */ return null; +/* 54: */ } +/* 55:41 */ if (aSlotIndex == 28) +/* 56: */ { +/* 57:42 */ ((GT_MetaTileEntity_ChestBuffer)this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull = (!((GT_MetaTileEntity_ChestBuffer)this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull); +/* 58:43 */ if (((GT_MetaTileEntity_ChestBuffer)this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull) { +/* 59:44 */ GT_Utility.sendChatToPlayer(aPlayer, "Emit Redstone if no Slot is free"); +/* 60: */ } else { +/* 61:46 */ GT_Utility.sendChatToPlayer(aPlayer, "Don't emit Redstone"); +/* 62: */ } +/* 63:47 */ return null; +/* 64: */ } +/* 65:48 */ if (aSlotIndex == 29) +/* 66: */ { +/* 67:49 */ ((GT_MetaTileEntity_ChestBuffer)this.mTileEntity.getMetaTileEntity()).bInvert = (!((GT_MetaTileEntity_ChestBuffer)this.mTileEntity.getMetaTileEntity()).bInvert); +/* 68:50 */ if (((GT_MetaTileEntity_ChestBuffer)this.mTileEntity.getMetaTileEntity()).bInvert) { +/* 69:51 */ GT_Utility.sendChatToPlayer(aPlayer, "Invert Redstone"); +/* 70: */ } else { +/* 71:53 */ GT_Utility.sendChatToPlayer(aPlayer, "Don't invert Redstone"); +/* 72: */ } +/* 73:54 */ return null; +/* 74: */ } +/* 75: */ } +/* 76:58 */ return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); +/* 77: */ } +/* 78: */ +/* 79: */ @Override +public int getSlotCount() +/* 80: */ { +/* 81:64 */ return 27; +/* 82: */ } +/* 83: */ +/* 84: */ @Override +public int getShiftClickSlotCount() +/* 85: */ { +/* 86:69 */ return 27; +/* 87: */ } +/* 88: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.gui.GT_Container_ChestBuffer + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/gui/GT_Container_Filter.java b/src/main/java/gregtech/common/gui/GT_Container_Filter.java new file mode 100644 index 0000000..1dd475d --- /dev/null +++ b/src/main/java/gregtech/common/gui/GT_Container_Filter.java @@ -0,0 +1,152 @@ +/* 1: */ package gregtech.common.gui; +/* 2: */ +/* 3: */ import gregtech.api.gui.GT_ContainerMetaTile_Machine; +/* 4: */ import gregtech.api.gui.GT_Slot_Holo; +/* 5: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 6: */ import gregtech.api.util.GT_Utility; +/* 7: */ import gregtech.common.tileentities.automation.GT_MetaTileEntity_Filter; +/* 9: */ import net.minecraft.entity.player.EntityPlayer; +/* 10: */ import net.minecraft.entity.player.InventoryPlayer; +/* 11: */ import net.minecraft.inventory.Slot; +/* 12: */ import net.minecraft.item.ItemStack; +/* 13: */ +/* 14: */ public class GT_Container_Filter +/* 15: */ extends GT_ContainerMetaTile_Machine +/* 16: */ { +/* 17: */ public GT_Container_Filter(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) +/* 18: */ { +/* 19: 17 */ super(aInventoryPlayer, aTileEntity); +/* 20: */ } +/* 21: */ +/* 22: */ @Override +public void addSlots(InventoryPlayer aInventoryPlayer) +/* 23: */ { +/* 24: 22 */ addSlotToContainer(new Slot(this.mTileEntity, 0, 98, 5)); +/* 25: 23 */ addSlotToContainer(new Slot(this.mTileEntity, 1, 116, 5)); +/* 26: 24 */ addSlotToContainer(new Slot(this.mTileEntity, 2, 134, 5)); +/* 27: 25 */ addSlotToContainer(new Slot(this.mTileEntity, 3, 98, 23)); +/* 28: 26 */ addSlotToContainer(new Slot(this.mTileEntity, 4, 116, 23)); +/* 29: 27 */ addSlotToContainer(new Slot(this.mTileEntity, 5, 134, 23)); +/* 30: 28 */ addSlotToContainer(new Slot(this.mTileEntity, 6, 98, 41)); +/* 31: 29 */ addSlotToContainer(new Slot(this.mTileEntity, 7, 116, 41)); +/* 32: 30 */ addSlotToContainer(new Slot(this.mTileEntity, 8, 134, 41)); +/* 33: */ +/* 34: 32 */ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 9, 18, 6, false, true, 1)); +/* 35: 33 */ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 10, 35, 6, false, true, 1)); +/* 36: 34 */ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 11, 52, 6, false, true, 1)); +/* 37: 35 */ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 12, 18, 23, false, true, 1)); +/* 38: 36 */ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 13, 35, 23, false, true, 1)); +/* 39: 37 */ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 14, 52, 23, false, true, 1)); +/* 40: 38 */ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 15, 18, 40, false, true, 1)); +/* 41: 39 */ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 16, 35, 40, false, true, 1)); +/* 42: 40 */ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 17, 52, 40, false, true, 1)); +/* 43: */ +/* 44: 42 */ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 18, 8, 63, false, true, 1)); +/* 45: 43 */ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 18, 26, 63, false, true, 1)); +/* 46: 44 */ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 18, 44, 63, false, true, 1)); +/* 47: 45 */ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 18, 62, 63, false, true, 1)); +/* 48: 46 */ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 18, 80, 63, false, true, 1)); +/* 49: */ } +/* 50: */ +/* 51: */ @Override +public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) +/* 52: */ { +/* 53: 51 */ if (aSlotIndex < 9) { +/* 54: 51 */ return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); +/* 55: */ } +/* 56: 53 */ Slot tSlot = (Slot)this.inventorySlots.get(aSlotIndex); +/* 57: 54 */ if (tSlot != null) +/* 58: */ { +/* 59: 55 */ if (this.mTileEntity.getMetaTileEntity() == null) { +/* 60: 55 */ return null; +/* 61: */ } +/* 62: 56 */ if (aSlotIndex < 18) +/* 63: */ { +/* 64: 57 */ ItemStack tStack = aPlayer.inventory.getItemStack(); +/* 65: 58 */ if (tStack == null) +/* 66: */ { +/* 67: 59 */ tStack = tSlot.getStack(); +/* 68: 60 */ if (aMouseclick == 0) { +/* 69: 61 */ tSlot.putStack(null); +/* 70: 63 */ } else if (tStack != null) { +/* 71: 64 */ tStack.setItemDamage(32767); +/* 72: */ } +/* 73: */ } +/* 74: */ else +/* 75: */ { +/* 76: 68 */ tSlot.putStack(GT_Utility.copyAmount(1L, new Object[] { tStack })); +/* 77: */ } +/* 78: 70 */ return null; +/* 79: */ } +/* 80: 71 */ if (aSlotIndex == 18) +/* 81: */ { +/* 82: 72 */ ((GT_MetaTileEntity_Filter)this.mTileEntity.getMetaTileEntity()).bOutput = (!((GT_MetaTileEntity_Filter)this.mTileEntity.getMetaTileEntity()).bOutput); +/* 83: 73 */ if (((GT_MetaTileEntity_Filter)this.mTileEntity.getMetaTileEntity()).bOutput) { +/* 84: 74 */ GT_Utility.sendChatToPlayer(aPlayer, "Emit Energy to Outputside"); +/* 85: */ } else { +/* 86: 76 */ GT_Utility.sendChatToPlayer(aPlayer, "Don't emit Energy"); +/* 87: */ } +/* 88: 77 */ return null; +/* 89: */ } +/* 90: 78 */ if (aSlotIndex == 19) +/* 91: */ { +/* 92: 79 */ ((GT_MetaTileEntity_Filter)this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull = (!((GT_MetaTileEntity_Filter)this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull); +/* 93: 80 */ if (((GT_MetaTileEntity_Filter)this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull) { +/* 94: 81 */ GT_Utility.sendChatToPlayer(aPlayer, "Emit Redstone if slots contain something"); +/* 95: */ } else { +/* 96: 83 */ GT_Utility.sendChatToPlayer(aPlayer, "Don't emit Redstone"); +/* 97: */ } +/* 98: 84 */ return null; +/* 99: */ } +/* 100: 85 */ if (aSlotIndex == 20) +/* 101: */ { +/* 102: 86 */ ((GT_MetaTileEntity_Filter)this.mTileEntity.getMetaTileEntity()).bInvert = (!((GT_MetaTileEntity_Filter)this.mTileEntity.getMetaTileEntity()).bInvert); +/* 103: 87 */ if (((GT_MetaTileEntity_Filter)this.mTileEntity.getMetaTileEntity()).bInvert) { +/* 104: 88 */ GT_Utility.sendChatToPlayer(aPlayer, "Invert Redstone"); +/* 105: */ } else { +/* 106: 90 */ GT_Utility.sendChatToPlayer(aPlayer, "Don't invert Redstone"); +/* 107: */ } +/* 108: 91 */ return null; +/* 109: */ } +/* 110: 92 */ if (aSlotIndex == 21) +/* 111: */ { +/* 112: 93 */ ((GT_MetaTileEntity_Filter)this.mTileEntity.getMetaTileEntity()).bInvertFilter = (!((GT_MetaTileEntity_Filter)this.mTileEntity.getMetaTileEntity()).bInvertFilter); +/* 113: 94 */ if (((GT_MetaTileEntity_Filter)this.mTileEntity.getMetaTileEntity()).bInvertFilter) { +/* 114: 95 */ GT_Utility.sendChatToPlayer(aPlayer, "Invert Filter"); +/* 115: */ } else { +/* 116: 97 */ GT_Utility.sendChatToPlayer(aPlayer, "Don't invert Filter"); +/* 117: */ } +/* 118: 98 */ return null; +/* 119: */ } +/* 120: 99 */ if (aSlotIndex == 22) +/* 121: */ { +/* 122:100 */ ((GT_MetaTileEntity_Filter)this.mTileEntity.getMetaTileEntity()).bIgnoreNBT = (!((GT_MetaTileEntity_Filter)this.mTileEntity.getMetaTileEntity()).bIgnoreNBT); +/* 123:101 */ if (((GT_MetaTileEntity_Filter)this.mTileEntity.getMetaTileEntity()).bIgnoreNBT) { +/* 124:102 */ GT_Utility.sendChatToPlayer(aPlayer, "Ignore NBT"); +/* 125: */ } else { +/* 126:104 */ GT_Utility.sendChatToPlayer(aPlayer, "NBT has to match"); +/* 127: */ } +/* 128:105 */ return null; +/* 129: */ } +/* 130: */ } +/* 131:108 */ return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); +/* 132: */ } +/* 133: */ +/* 134: */ @Override +public int getSlotCount() +/* 135: */ { +/* 136:113 */ return 9; +/* 137: */ } +/* 138: */ +/* 139: */ @Override +public int getShiftClickSlotCount() +/* 140: */ { +/* 141:118 */ return 9; +/* 142: */ } +/* 143: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.gui.GT_Container_Filter + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/gui/GT_Container_QuantumChest.java b/src/main/java/gregtech/common/gui/GT_Container_QuantumChest.java new file mode 100644 index 0000000..cceca54 --- /dev/null +++ b/src/main/java/gregtech/common/gui/GT_Container_QuantumChest.java @@ -0,0 +1,68 @@ +package gregtech.common.gui; + +import java.util.Iterator; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.gui.GT_ContainerMetaTile_Machine; +import gregtech.api.gui.GT_Slot_Output; +import gregtech.api.gui.GT_Slot_Render; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.common.tileentities.storage.GT_MetaTileEntity_QuantumChest; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.Slot; + +public class GT_Container_QuantumChest extends GT_ContainerMetaTile_Machine { + + public GT_Container_QuantumChest(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { + super(aInventoryPlayer, aTileEntity); + } + + @Override + public void addSlots(InventoryPlayer aInventoryPlayer) { + addSlotToContainer(new Slot(mTileEntity, 0, 80, 17)); + addSlotToContainer(new GT_Slot_Output(mTileEntity, 1, 80, 53)); + addSlotToContainer(new GT_Slot_Render(mTileEntity, 2, 59, 42)); + } + + public int mContent = 0; + + @Override + public void detectAndSendChanges() { + super.detectAndSendChanges(); + + if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) return; + if (mTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_QuantumChest){ + mContent = ((GT_MetaTileEntity_QuantumChest)mTileEntity.getMetaTileEntity()).mItemCount; + }else{ + mContent = 0;} + + Iterator var2 = this.crafters.iterator(); + while (var2.hasNext()) { + ICrafting var1 = (ICrafting)var2.next(); + var1.sendProgressBarUpdate(this, 100, mContent & 65535); + var1.sendProgressBarUpdate(this, 101, mContent >>> 16); + } + } + + @Override + @SideOnly(Side.CLIENT) + public void updateProgressBar(int par1, int par2) { + super.updateProgressBar(par1, par2); + switch (par1) { + case 100: mContent = mContent & -65536 | par2; break; + case 101: mContent = mContent & 65535 | par2 << 16; break; + } + } + + @Override + public int getSlotCount() { + return 2; + } + + @Override + public int getShiftClickSlotCount() { + return 1; + } +} diff --git a/src/main/java/gregtech/common/gui/GT_Container_Regulator.java b/src/main/java/gregtech/common/gui/GT_Container_Regulator.java new file mode 100644 index 0000000..cad11df --- /dev/null +++ b/src/main/java/gregtech/common/gui/GT_Container_Regulator.java @@ -0,0 +1,186 @@ +/* 1: */ package gregtech.common.gui; +/* 10: */ import java.util.Iterator; + +/* 2: */ +/* 3: */ import cpw.mods.fml.relauncher.Side; +/* 4: */ import cpw.mods.fml.relauncher.SideOnly; +/* 5: */ import gregtech.api.gui.GT_ContainerMetaTile_Machine; +/* 6: */ import gregtech.api.gui.GT_Slot_Holo; +/* 7: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 8: */ import gregtech.api.util.GT_Utility; +/* 9: */ import gregtech.common.tileentities.automation.GT_MetaTileEntity_Regulator; +/* 12: */ import net.minecraft.entity.player.EntityPlayer; +/* 13: */ import net.minecraft.entity.player.InventoryPlayer; +/* 14: */ import net.minecraft.inventory.ICrafting; +/* 15: */ import net.minecraft.inventory.Slot; +/* 16: */ import net.minecraft.item.ItemStack; +/* 17: */ +/* 18: */ public class GT_Container_Regulator +/* 19: */ extends GT_ContainerMetaTile_Machine +/* 20: */ { +/* 21: */ public GT_Container_Regulator(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) +/* 22: */ { +/* 23: 22 */ super(aInventoryPlayer, aTileEntity); +/* 24: */ } +/* 25: */ +/* 26: */ @Override +public void addSlots(InventoryPlayer aInventoryPlayer) +/* 27: */ { +/* 28: 27 */ this.mTargetSlots = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0 }; +/* 29: */ +/* 30: 29 */ addSlotToContainer(new Slot(this.mTileEntity, 0, 8, 6)); +/* 31: 30 */ addSlotToContainer(new Slot(this.mTileEntity, 1, 26, 6)); +/* 32: 31 */ addSlotToContainer(new Slot(this.mTileEntity, 2, 44, 6)); +/* 33: 32 */ addSlotToContainer(new Slot(this.mTileEntity, 3, 8, 24)); +/* 34: 33 */ addSlotToContainer(new Slot(this.mTileEntity, 4, 26, 24)); +/* 35: 34 */ addSlotToContainer(new Slot(this.mTileEntity, 5, 44, 24)); +/* 36: 35 */ addSlotToContainer(new Slot(this.mTileEntity, 6, 8, 42)); +/* 37: 36 */ addSlotToContainer(new Slot(this.mTileEntity, 7, 26, 42)); +/* 38: 37 */ addSlotToContainer(new Slot(this.mTileEntity, 8, 44, 42)); +/* 39: */ +/* 40: 39 */ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 9, 64, 7, false, true, 1)); +/* 41: 40 */ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 10, 81, 7, false, true, 1)); +/* 42: 41 */ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 11, 98, 7, false, true, 1)); +/* 43: 42 */ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 12, 64, 24, false, true, 1)); +/* 44: 43 */ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 13, 81, 24, false, true, 1)); +/* 45: 44 */ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 14, 98, 24, false, true, 1)); +/* 46: 45 */ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 15, 64, 41, false, true, 1)); +/* 47: 46 */ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 16, 81, 41, false, true, 1)); +/* 48: 47 */ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 17, 98, 41, false, true, 1)); +/* 49: */ +/* 50: 49 */ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 18, 119, 7, false, true, 1)); +/* 51: 50 */ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 18, 136, 7, false, true, 1)); +/* 52: 51 */ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 18, 153, 7, false, true, 1)); +/* 53: 52 */ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 18, 119, 24, false, true, 1)); +/* 54: 53 */ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 18, 136, 24, false, true, 1)); +/* 55: 54 */ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 18, 153, 24, false, true, 1)); +/* 56: 55 */ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 18, 119, 41, false, true, 1)); +/* 57: 56 */ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 18, 136, 41, false, true, 1)); +/* 58: 57 */ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 18, 153, 41, false, true, 1)); +/* 59: */ +/* 60: 59 */ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 18, 8, 63, false, true, 1)); +/* 61: */ } +/* 62: */ +/* 63: */ @Override +public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) +/* 64: */ { +/* 65: 66 */ if (aSlotIndex < 9) { +/* 66: 66 */ return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); +/* 67: */ } +/* 68: 67 */ Slot tSlot = (Slot)this.inventorySlots.get(aSlotIndex); +/* 69: 68 */ if (tSlot != null) +/* 70: */ { +/* 71: 69 */ if (this.mTileEntity.getMetaTileEntity() == null) { +/* 72: 69 */ return null; +/* 73: */ } +/* 74: 70 */ if (aSlotIndex == 27) +/* 75: */ { +/* 76: 71 */ ((GT_MetaTileEntity_Regulator)this.mTileEntity.getMetaTileEntity()).bOutput = (!((GT_MetaTileEntity_Regulator)this.mTileEntity.getMetaTileEntity()).bOutput); +/* 77: 72 */ if (((GT_MetaTileEntity_Regulator)this.mTileEntity.getMetaTileEntity()).bOutput) { +/* 78: 73 */ GT_Utility.sendChatToPlayer(aPlayer, "Emit Energy to Outputside"); +/* 79: */ } else { +/* 80: 75 */ GT_Utility.sendChatToPlayer(aPlayer, "Don't emit Energy"); +/* 81: */ } +/* 82: 76 */ return null; +/* 83: */ } +/* 84: 77 */ if ((aSlotIndex >= 9) && (aSlotIndex < 18)) +/* 85: */ { +/* 86: 78 */ ItemStack tStack = aPlayer.inventory.getItemStack(); +/* 87: 79 */ if (tStack != null) { +/* 88: 80 */ tSlot.putStack(GT_Utility.copy(new Object[] { tStack })); +/* 89: 82 */ } else if (tSlot.getStack() != null) { +/* 90: 83 */ if (aMouseclick == 0) +/* 91: */ { +/* 92: 84 */ tSlot.getStack().stackSize -= (aShifthold == 1 ? 8 : 1); +/* 93: 85 */ if (tSlot.getStack().stackSize <= 0) { +/* 94: 86 */ tSlot.putStack(null); +/* 95: */ } +/* 96: */ } +/* 97: */ else +/* 98: */ { +/* 99: 89 */ tSlot.getStack().stackSize += (aShifthold == 1 ? 8 : 1); +/* 100: 90 */ if (tSlot.getStack().stackSize > tSlot.getStack().getMaxStackSize()) { +/* 101: 91 */ tSlot.getStack().stackSize = tSlot.getStack().getMaxStackSize(); +/* 102: */ } +/* 103: */ } +/* 104: */ } +/* 105: 96 */ return null; +/* 106: */ } +/* 107: 97 */ if ((aSlotIndex >= 18) && (aSlotIndex < 27)) +/* 108: */ { +/* 109: 98 */ ((GT_MetaTileEntity_Regulator)this.mTileEntity.getMetaTileEntity()).mTargetSlots[(aSlotIndex - 18)] = Math.min(99, Math.max(0, ((GT_MetaTileEntity_Regulator)this.mTileEntity.getMetaTileEntity()).mTargetSlots[(aSlotIndex - 18)] + (aMouseclick == 0 ? -1 : 1) * (aShifthold == 0 ? 1 : 16))); +/* 110: 99 */ return null; +/* 111: */ } +/* 112: */ } +/* 113:102 */ return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); +/* 114: */ } +/* 115: */ +/* 116:105 */ public int[] mTargetSlots = { 0, 0, 0, 0, 0, 0, 0, 0, 0 }; +/* 117: */ +/* 118: */ @Override +public void detectAndSendChanges() +/* 119: */ { +/* 120:109 */ super.detectAndSendChanges(); +/* 121:110 */ if ((this.mTileEntity.isClientSide()) || (this.mTileEntity.getMetaTileEntity() == null)) { +/* 122:110 */ return; +/* 123: */ } +/* 124:111 */ this.mTargetSlots = new int[9]; +/* 125:112 */ for (int i = 0; i < 9; i++) { +/* 126:112 */ this.mTargetSlots[i] = ((GT_MetaTileEntity_Regulator)this.mTileEntity.getMetaTileEntity()).mTargetSlots[i]; +/* 127: */ } +/* 128:114 */ Iterator var2 = this.crafters.iterator(); +/* 129:115 */ while (var2.hasNext()) +/* 130: */ { +/* 131:116 */ ICrafting var1 = (ICrafting)var2.next(); +/* 132:117 */ for (int i = 0; i < 9; i++) { +/* 133:117 */ var1.sendProgressBarUpdate(this, 100 + i, this.mTargetSlots[i]); +/* 134: */ } +/* 135: */ } +/* 136: */ } +/* 137: */ +/* 138: */ @Override +@SideOnly(Side.CLIENT) +/* 139: */ public void updateProgressBar(int par1, int par2) +/* 140: */ { +/* 141:124 */ super.updateProgressBar(par1, par2); +/* 142:125 */ switch (par1) +/* 143: */ { +/* 144: */ case 100: +/* 145:126 */ this.mTargetSlots[0] = par2; break; +/* 146: */ case 101: +/* 147:127 */ this.mTargetSlots[1] = par2; break; +/* 148: */ case 102: +/* 149:128 */ this.mTargetSlots[2] = par2; break; +/* 150: */ case 103: +/* 151:129 */ this.mTargetSlots[3] = par2; break; +/* 152: */ case 104: +/* 153:130 */ this.mTargetSlots[4] = par2; break; +/* 154: */ case 105: +/* 155:131 */ this.mTargetSlots[5] = par2; break; +/* 156: */ case 106: +/* 157:132 */ this.mTargetSlots[6] = par2; break; +/* 158: */ case 107: +/* 159:133 */ this.mTargetSlots[7] = par2; break; +/* 160: */ case 108: +/* 161:134 */ this.mTargetSlots[8] = par2; +/* 162: */ } +/* 163: */ } +/* 164: */ +/* 165: */ @Override +public int getSlotCount() +/* 166: */ { +/* 167:140 */ return 9; +/* 168: */ } +/* 169: */ +/* 170: */ @Override +public int getShiftClickSlotCount() +/* 171: */ { +/* 172:145 */ return 9; +/* 173: */ } +/* 174: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.gui.GT_Container_Regulator + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/gui/GT_Container_SuperBuffer.java b/src/main/java/gregtech/common/gui/GT_Container_SuperBuffer.java new file mode 100644 index 0000000..83af424 --- /dev/null +++ b/src/main/java/gregtech/common/gui/GT_Container_SuperBuffer.java @@ -0,0 +1,92 @@ +/* 1: */ package gregtech.common.gui; +/* 2: */ +/* 3: */ import gregtech.api.gui.GT_ContainerMetaTile_Machine; +/* 4: */ import gregtech.api.gui.GT_Slot_Holo; +/* 5: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 6: */ import gregtech.api.util.GT_Utility; +/* 7: */ import gregtech.common.tileentities.automation.GT_MetaTileEntity_ChestBuffer; +/* 9: */ import net.minecraft.entity.player.EntityPlayer; +/* 10: */ import net.minecraft.entity.player.InventoryPlayer; +/* 11: */ import net.minecraft.inventory.Slot; +/* 12: */ import net.minecraft.item.ItemStack; +/* 13: */ +/* 14: */ public class GT_Container_SuperBuffer +/* 15: */ extends GT_ContainerMetaTile_Machine +/* 16: */ { +/* 17: */ public GT_Container_SuperBuffer(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) +/* 18: */ { +/* 19:16 */ super(aInventoryPlayer, aTileEntity); +/* 20: */ } +/* 21: */ +/* 22: */ @Override +public void addSlots(InventoryPlayer aInventoryPlayer) +/* 23: */ { +/* 24:21 */ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 256, 8, 63, false, true, 1)); +/* 25:22 */ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 256, 26, 63, false, true, 1)); +/* 26:23 */ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 256, 44, 63, false, true, 1)); +/* 27: */ } +/* 28: */ +/* 29: */ @Override +public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) +/* 30: */ { +/* 31:28 */ if (aSlotIndex < 0) { +/* 32:28 */ return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); +/* 33: */ } +/* 34:30 */ Slot tSlot = (Slot)this.inventorySlots.get(aSlotIndex); +/* 35:31 */ if (tSlot != null) +/* 36: */ { +/* 37:32 */ if (this.mTileEntity.getMetaTileEntity() == null) { +/* 38:32 */ return null; +/* 39: */ } +/* 40:33 */ if (aSlotIndex == 0) +/* 41: */ { +/* 42:34 */ ((GT_MetaTileEntity_ChestBuffer)this.mTileEntity.getMetaTileEntity()).bOutput = (!((GT_MetaTileEntity_ChestBuffer)this.mTileEntity.getMetaTileEntity()).bOutput); +/* 43:35 */ if (((GT_MetaTileEntity_ChestBuffer)this.mTileEntity.getMetaTileEntity()).bOutput) { +/* 44:36 */ GT_Utility.sendChatToPlayer(aPlayer, "Emit Energy to Outputside"); +/* 45: */ } else { +/* 46:38 */ GT_Utility.sendChatToPlayer(aPlayer, "Don't emit Energy"); +/* 47: */ } +/* 48:39 */ return null; +/* 49: */ } +/* 50:40 */ if (aSlotIndex == 1) +/* 51: */ { +/* 52:41 */ ((GT_MetaTileEntity_ChestBuffer)this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull = (!((GT_MetaTileEntity_ChestBuffer)this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull); +/* 53:42 */ if (((GT_MetaTileEntity_ChestBuffer)this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull) { +/* 54:43 */ GT_Utility.sendChatToPlayer(aPlayer, "Emit Redstone if no Slot is free"); +/* 55: */ } else { +/* 56:45 */ GT_Utility.sendChatToPlayer(aPlayer, "Don't emit Redstone"); +/* 57: */ } +/* 58:46 */ return null; +/* 59: */ } +/* 60:47 */ if (aSlotIndex == 2) +/* 61: */ { +/* 62:48 */ ((GT_MetaTileEntity_ChestBuffer)this.mTileEntity.getMetaTileEntity()).bInvert = (!((GT_MetaTileEntity_ChestBuffer)this.mTileEntity.getMetaTileEntity()).bInvert); +/* 63:49 */ if (((GT_MetaTileEntity_ChestBuffer)this.mTileEntity.getMetaTileEntity()).bInvert) { +/* 64:50 */ GT_Utility.sendChatToPlayer(aPlayer, "Invert Redstone"); +/* 65: */ } else { +/* 66:52 */ GT_Utility.sendChatToPlayer(aPlayer, "Don't invert Redstone"); +/* 67: */ } +/* 68:53 */ return null; +/* 69: */ } +/* 70: */ } +/* 71:57 */ return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); +/* 72: */ } +/* 73: */ +/* 74: */ @Override +public int getSlotCount() +/* 75: */ { +/* 76:62 */ return 0; +/* 77: */ } +/* 78: */ +/* 79: */ @Override +public int getShiftClickSlotCount() +/* 80: */ { +/* 81:67 */ return 0; +/* 82: */ } +/* 83: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.gui.GT_Container_SuperBuffer + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/gui/GT_Container_TypeFilter.java b/src/main/java/gregtech/common/gui/GT_Container_TypeFilter.java new file mode 100644 index 0000000..f547a3b --- /dev/null +++ b/src/main/java/gregtech/common/gui/GT_Container_TypeFilter.java @@ -0,0 +1,132 @@ +/* 1: */ package gregtech.common.gui; +/* 2: */ +/* 3: */ import gregtech.api.gui.GT_ContainerMetaTile_Machine; +/* 4: */ import gregtech.api.gui.GT_Slot_Holo; +/* 5: */ import gregtech.api.gui.GT_Slot_Render; +/* 6: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 7: */ import gregtech.api.util.GT_Utility; +/* 8: */ import gregtech.common.tileentities.automation.GT_MetaTileEntity_TypeFilter; +/* 10: */ import net.minecraft.entity.player.EntityPlayer; +/* 11: */ import net.minecraft.entity.player.InventoryPlayer; +/* 12: */ import net.minecraft.inventory.Slot; +/* 13: */ import net.minecraft.item.ItemStack; +/* 14: */ +/* 15: */ public class GT_Container_TypeFilter +/* 16: */ extends GT_ContainerMetaTile_Machine +/* 17: */ { +/* 18: */ public GT_Container_TypeFilter(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) +/* 19: */ { +/* 20:17 */ super(aInventoryPlayer, aTileEntity); +/* 21: */ } +/* 22: */ +/* 23: */ @Override +public void addSlots(InventoryPlayer aInventoryPlayer) +/* 24: */ { +/* 25:22 */ addSlotToContainer(new Slot(this.mTileEntity, 0, 98, 5)); +/* 26:23 */ addSlotToContainer(new Slot(this.mTileEntity, 1, 116, 5)); +/* 27:24 */ addSlotToContainer(new Slot(this.mTileEntity, 2, 134, 5)); +/* 28:25 */ addSlotToContainer(new Slot(this.mTileEntity, 3, 98, 23)); +/* 29:26 */ addSlotToContainer(new Slot(this.mTileEntity, 4, 116, 23)); +/* 30:27 */ addSlotToContainer(new Slot(this.mTileEntity, 5, 134, 23)); +/* 31:28 */ addSlotToContainer(new Slot(this.mTileEntity, 6, 98, 41)); +/* 32:29 */ addSlotToContainer(new Slot(this.mTileEntity, 7, 116, 41)); +/* 33:30 */ addSlotToContainer(new Slot(this.mTileEntity, 8, 134, 41)); +/* 34: */ +/* 35:32 */ addSlotToContainer(new GT_Slot_Render(this.mTileEntity, 9, 35, 23)); +/* 36: */ +/* 37:34 */ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 10, 8, 63, false, true, 1)); +/* 38:35 */ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 10, 26, 63, false, true, 1)); +/* 39:36 */ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 10, 44, 63, false, true, 1)); +/* 40:37 */ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 10, 62, 63, false, true, 1)); +/* 41:38 */ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 10, 80, 63, false, true, 1)); +/* 42: */ } +/* 43: */ +/* 44: */ @Override +public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) +/* 45: */ { +/* 46:43 */ if (aSlotIndex < 9) { +/* 47:43 */ return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); +/* 48: */ } +/* 49:45 */ Slot tSlot = (Slot)this.inventorySlots.get(aSlotIndex); +/* 50:46 */ if (tSlot != null) +/* 51: */ { +/* 52:47 */ if (this.mTileEntity.getMetaTileEntity() == null) { +/* 53:47 */ return null; +/* 54: */ } +/* 55:48 */ if (aSlotIndex == 9) +/* 56: */ { +/* 57:49 */ ((GT_MetaTileEntity_TypeFilter)this.mTileEntity.getMetaTileEntity()).clickTypeIcon(aMouseclick != 0); +/* 58:50 */ return null; +/* 59: */ } +/* 60:51 */ if (aSlotIndex == 10) +/* 61: */ { +/* 62:52 */ ((GT_MetaTileEntity_TypeFilter)this.mTileEntity.getMetaTileEntity()).bOutput = (!((GT_MetaTileEntity_TypeFilter)this.mTileEntity.getMetaTileEntity()).bOutput); +/* 63:53 */ if (((GT_MetaTileEntity_TypeFilter)this.mTileEntity.getMetaTileEntity()).bOutput) { +/* 64:54 */ GT_Utility.sendChatToPlayer(aPlayer, "Emit Energy to Outputside"); +/* 65: */ } else { +/* 66:56 */ GT_Utility.sendChatToPlayer(aPlayer, "Don't emit Energy"); +/* 67: */ } +/* 68:57 */ return null; +/* 69: */ } +/* 70:58 */ if (aSlotIndex == 11) +/* 71: */ { +/* 72:59 */ ((GT_MetaTileEntity_TypeFilter)this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull = (!((GT_MetaTileEntity_TypeFilter)this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull); +/* 73:60 */ if (((GT_MetaTileEntity_TypeFilter)this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull) { +/* 74:61 */ GT_Utility.sendChatToPlayer(aPlayer, "Emit Redstone if slots contain something"); +/* 75: */ } else { +/* 76:63 */ GT_Utility.sendChatToPlayer(aPlayer, "Don't emit Redstone"); +/* 77: */ } +/* 78:64 */ return null; +/* 79: */ } +/* 80:65 */ if (aSlotIndex == 12) +/* 81: */ { +/* 82:66 */ ((GT_MetaTileEntity_TypeFilter)this.mTileEntity.getMetaTileEntity()).bInvert = (!((GT_MetaTileEntity_TypeFilter)this.mTileEntity.getMetaTileEntity()).bInvert); +/* 83:67 */ if (((GT_MetaTileEntity_TypeFilter)this.mTileEntity.getMetaTileEntity()).bInvert) { +/* 84:68 */ GT_Utility.sendChatToPlayer(aPlayer, "Invert Redstone"); +/* 85: */ } else { +/* 86:70 */ GT_Utility.sendChatToPlayer(aPlayer, "Don't invert Redstone"); +/* 87: */ } +/* 88:71 */ return null; +/* 89: */ } +/* 90:72 */ if (aSlotIndex == 13) +/* 91: */ { +/* 92:73 */ ((GT_MetaTileEntity_TypeFilter)this.mTileEntity.getMetaTileEntity()).bInvertFilter = (!((GT_MetaTileEntity_TypeFilter)this.mTileEntity.getMetaTileEntity()).bInvertFilter); +/* 93:74 */ if (((GT_MetaTileEntity_TypeFilter)this.mTileEntity.getMetaTileEntity()).bInvertFilter) { +/* 94:75 */ GT_Utility.sendChatToPlayer(aPlayer, "Invert Filter"); +/* 95: */ } else { +/* 96:77 */ GT_Utility.sendChatToPlayer(aPlayer, "Don't invert Filter"); +/* 97: */ } +/* 98:78 */ return null; +/* 99: */ } +/* :0:79 */ if (aSlotIndex == 14) +/* :1: */ { +/* :2:80 */ ((GT_MetaTileEntity_TypeFilter)this.mTileEntity.getMetaTileEntity()).bNBTAllowed = (!((GT_MetaTileEntity_TypeFilter)this.mTileEntity.getMetaTileEntity()).bNBTAllowed); +/* :3:81 */ if (((GT_MetaTileEntity_TypeFilter)this.mTileEntity.getMetaTileEntity()).bNBTAllowed) { +/* :4:82 */ GT_Utility.sendChatToPlayer(aPlayer, "Allow Items with NBT"); +/* :5: */ } else { +/* :6:84 */ GT_Utility.sendChatToPlayer(aPlayer, "Don't allow Items with NBT"); +/* :7: */ } +/* :8:85 */ return null; +/* :9: */ } +/* ;0: */ } +/* ;1:88 */ return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); +/* ;2: */ } +/* ;3: */ +/* ;4: */ @Override +public int getSlotCount() +/* ;5: */ { +/* ;6:93 */ return 9; +/* ;7: */ } +/* ;8: */ +/* ;9: */ @Override +public int getShiftClickSlotCount() +/* <0: */ { +/* <1:98 */ return 9; +/* <2: */ } +/* <3: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.gui.GT_Container_TypeFilter + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/gui/GT_GUIContainer_Boiler.java b/src/main/java/gregtech/common/gui/GT_GUIContainer_Boiler.java new file mode 100644 index 0000000..275cd63 --- /dev/null +++ b/src/main/java/gregtech/common/gui/GT_GUIContainer_Boiler.java @@ -0,0 +1,54 @@ +/* 1: */ package gregtech.common.gui; +/* 2: */ +/* 3: */ import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; +/* 4: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 6: */ import net.minecraft.entity.player.InventoryPlayer; +/* 7: */ +/* 8: */ public class GT_GUIContainer_Boiler +/* 9: */ extends GT_GUIContainerMetaTile_Machine +/* 10: */ { +/* 11: */ public GT_GUIContainer_Boiler(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aTextureName, int aSteamCapacity) +/* 12: */ { +/* 13:10 */ super(new GT_Container_Boiler(aInventoryPlayer, aTileEntity, aSteamCapacity), "gregtech:textures/gui/" + aTextureName); +/* 14: */ } +/* 15: */ +/* 16: */ @Override +protected void drawGuiContainerForegroundLayer(int par1, int par2) +/* 17: */ { +/* 18:15 */ this.fontRendererObj.drawString("Boiler", 8, 4, 4210752); +/* 19: */ } +/* 20: */ +/* 21: */ @Override +protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) +/* 22: */ { +/* 23:20 */ super.drawGuiContainerBackgroundLayer(par1, par2, par3); +/* 24:21 */ int x = (this.width - this.xSize) / 2; +/* 25:22 */ int y = (this.height - this.ySize) / 2; +/* 26:23 */ drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize); +/* 27:25 */ if (this.mContainer != null) +/* 28: */ { +/* 29:27 */ int tScale = ((GT_Container_Boiler)this.mContainer).mSteamAmount; +/* 30:28 */ if (tScale > 0) { +/* 31:28 */ drawTexturedModalRect(x + 70, y + 25 + 54 - tScale, 194, 54 - tScale, 10, tScale); +/* 32: */ } +/* 33:29 */ tScale = ((GT_Container_Boiler)this.mContainer).mWaterAmount; +/* 34:30 */ if (tScale > 0) { +/* 35:30 */ drawTexturedModalRect(x + 83, y + 25 + 54 - tScale, 204, 54 - tScale, 10, tScale); +/* 36: */ } +/* 37:31 */ tScale = ((GT_Container_Boiler)this.mContainer).mTemperature; +/* 38:32 */ if (tScale > 0) { +/* 39:32 */ drawTexturedModalRect(x + 96, y + 25 + 54 - tScale, 214, 54 - tScale, 10, tScale); +/* 40: */ } +/* 41:33 */ tScale = ((GT_Container_Boiler)this.mContainer).mProcessingEnergy; +/* 42:34 */ if (tScale > 0) { +/* 43:34 */ drawTexturedModalRect(x + 117, y + 44 + 14 - tScale, 177, 14 - tScale, 15, tScale + 1); +/* 44: */ } +/* 45: */ } +/* 46: */ } +/* 47: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.gui.GT_GUIContainer_Boiler + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/gui/GT_GUIContainer_BronzeBlastFurnace.java b/src/main/java/gregtech/common/gui/GT_GUIContainer_BronzeBlastFurnace.java new file mode 100644 index 0000000..9a61f87 --- /dev/null +++ b/src/main/java/gregtech/common/gui/GT_GUIContainer_BronzeBlastFurnace.java @@ -0,0 +1,38 @@ +/* 1: */ package gregtech.common.gui; +/* 4: */ import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; +/* 5: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 7: */ import net.minecraft.entity.player.InventoryPlayer; +/* 8: */ +/* 9: */ public class GT_GUIContainer_BronzeBlastFurnace +/* 10: */ extends GT_GUIContainerMetaTile_Machine +/* 11: */ { +/* 12: */ public GT_GUIContainer_BronzeBlastFurnace(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) +/* 13: */ { +/* 14:11 */ super(new GT_Container_BronzeBlastFurnace(aInventoryPlayer, aTileEntity), "gregtech:textures/gui/BronzeBlastFurnace.png"); +/* 15: */ } +/* 16: */ +/* 17: */ @Override +protected void drawGuiContainerForegroundLayer(int par1, int par2) +/* 18: */ { +/* 19:16 */ this.fontRendererObj.drawString("Bronze Blast Furnace", 8, 4, 4210752); +/* 20: */ } +/* 21: */ +/* 22: */ @Override +protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) +/* 23: */ { +/* 24:21 */ super.drawGuiContainerBackgroundLayer(par1, par2, par3); +/* 25:22 */ int x = (this.width - this.xSize) / 2; +/* 26:23 */ int y = (this.height - this.ySize) / 2; +/* 27:24 */ drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize); +/* 28:26 */ if ((this.mContainer != null) && +/* 29:27 */ (this.mContainer.mProgressTime > 0)) { +/* 30:27 */ drawTexturedModalRect(x + 58, y + 28, 176, 0, Math.max(0, Math.min(20, (this.mContainer.mProgressTime > 0 ? 1 : 0) + this.mContainer.mProgressTime * 20 / (this.mContainer.mMaxProgressTime < 1 ? 1 : this.mContainer.mMaxProgressTime))), 11); +/* 31: */ } +/* 32: */ } +/* 33: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.gui.GT_GUIContainer_BronzeBlastFurnace + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/gui/GT_GUIContainer_ChestBuffer.java b/src/main/java/gregtech/common/gui/GT_GUIContainer_ChestBuffer.java new file mode 100644 index 0000000..1891ff8 --- /dev/null +++ b/src/main/java/gregtech/common/gui/GT_GUIContainer_ChestBuffer.java @@ -0,0 +1,29 @@ +/* 1: */ package gregtech.common.gui; +/* 2: */ +/* 3: */ import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; +/* 4: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 5: */ import net.minecraft.entity.player.InventoryPlayer; +/* 6: */ +/* 7: */ public class GT_GUIContainer_ChestBuffer +/* 8: */ extends GT_GUIContainerMetaTile_Machine +/* 9: */ { +/* 10: */ public GT_GUIContainer_ChestBuffer(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) +/* 11: */ { +/* 12:11 */ super(new GT_Container_ChestBuffer(aInventoryPlayer, aTileEntity), "gregtech:textures/gui/ChestBuffer.png"); +/* 13: */ } +/* 14: */ +/* 15: */ @Override +protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) +/* 16: */ { +/* 17:16 */ super.drawGuiContainerBackgroundLayer(par1, par2, par3); +/* 18:17 */ int x = (this.width - this.xSize) / 2; +/* 19:18 */ int y = (this.height - this.ySize) / 2; +/* 20:19 */ drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize); +/* 21: */ } +/* 22: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.gui.GT_GUIContainer_ChestBuffer + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/gui/GT_GUIContainer_Filter.java b/src/main/java/gregtech/common/gui/GT_GUIContainer_Filter.java new file mode 100644 index 0000000..1122762 --- /dev/null +++ b/src/main/java/gregtech/common/gui/GT_GUIContainer_Filter.java @@ -0,0 +1,29 @@ +/* 1: */ package gregtech.common.gui; +/* 2: */ +/* 3: */ import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; +/* 4: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 5: */ import net.minecraft.entity.player.InventoryPlayer; +/* 6: */ +/* 7: */ public class GT_GUIContainer_Filter +/* 8: */ extends GT_GUIContainerMetaTile_Machine +/* 9: */ { +/* 10: */ public GT_GUIContainer_Filter(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) +/* 11: */ { +/* 12:10 */ super(new GT_Container_Filter(aInventoryPlayer, aTileEntity), "gregtech:textures/gui/Filter.png"); +/* 13: */ } +/* 14: */ +/* 15: */ @Override +protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) +/* 16: */ { +/* 17:15 */ super.drawGuiContainerBackgroundLayer(par1, par2, par3); +/* 18:16 */ int x = (this.width - this.xSize) / 2; +/* 19:17 */ int y = (this.height - this.ySize) / 2; +/* 20:18 */ drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize); +/* 21: */ } +/* 22: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.gui.GT_GUIContainer_Filter + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/gui/GT_GUIContainer_FusionReactor.java b/src/main/java/gregtech/common/gui/GT_GUIContainer_FusionReactor.java new file mode 100644 index 0000000..db092ff --- /dev/null +++ b/src/main/java/gregtech/common/gui/GT_GUIContainer_FusionReactor.java @@ -0,0 +1,52 @@ +package gregtech.common.gui; + +import static gregtech.api.enums.GT_Values.RES_PATH_GUI; + +import gregtech.api.gui.GT_Container_MultiMachine; +import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.util.GT_Utility; +import net.minecraft.entity.player.InventoryPlayer; + +public class GT_GUIContainer_FusionReactor extends GT_GUIContainerMetaTile_Machine { + + String mName = ""; + + public GT_GUIContainer_FusionReactor(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aTextureFile) { + super(new GT_Container_MultiMachine(aInventoryPlayer, aTileEntity, false), RES_PATH_GUI + "multimachines/" + (aTextureFile==null?"MultiblockDisplay":aTextureFile)); + mName = aName; + } + + @Override + protected void drawGuiContainerForegroundLayer(int par1, int par2) { + fontRendererObj.drawString(mName, 8, -10, 16448255); + + if (mContainer != null) { + if ((((GT_Container_MultiMachine)mContainer).mDisplayErrorCode & 64) != 0) fontRendererObj.drawString("Incomplete Structure.", 10, 8, 16448255); + + if (((GT_Container_MultiMachine)mContainer).mDisplayErrorCode == 0) { + if (((GT_Container_MultiMachine)mContainer).mActive == 0) { + fontRendererObj.drawString("Hit with Soft Hammer to (re-)start the Machine if it doesn't start.", -70, 170, 16448255); + } else { + fontRendererObj.drawString("Running perfectly.", 10, 170, 16448255); + } + } + if(this.mContainer!=null){ + fontRendererObj.drawString(GT_Utility.formatNumbers(this.mContainer.mEnergy)+" EU", 50, 155, 0x00b0b000); + } + } + } + + @Override + protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { + super.drawGuiContainerBackgroundLayer(par1, par2, par3); + int x = (width - xSize) / 2; + int y = (height - ySize) / 2; + drawTexturedModalRect(x, y, 0, 0, xSize, ySize); + if (this.mContainer != null) + { + double tScale = (double) this.mContainer.mEnergy / (double)this.mContainer.mStorage; + drawTexturedModalRect(x + 5, y + 156, 0, 251,Math.min(147, (int)(tScale*148)), 5); + } + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/common/gui/GT_GUIContainer_QuantumChest.java b/src/main/java/gregtech/common/gui/GT_GUIContainer_QuantumChest.java new file mode 100644 index 0000000..e6498fa --- /dev/null +++ b/src/main/java/gregtech/common/gui/GT_GUIContainer_QuantumChest.java @@ -0,0 +1,37 @@ +package gregtech.common.gui; + +import static gregtech.api.enums.GT_Values.RES_PATH_GUI; + +import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.util.GT_Utility; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.util.StatCollector; + +public class GT_GUIContainer_QuantumChest extends GT_GUIContainerMetaTile_Machine { + + private final String mName; + + public GT_GUIContainer_QuantumChest(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) { + super(new GT_Container_QuantumChest(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "BasicTank.png"); + mName = aName; + } + + @Override + protected void drawGuiContainerForegroundLayer(int par1, int par2) { + fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 8, ySize - 96 + 2, 4210752); + fontRendererObj.drawString(mName, 8, 6, 4210752); + if (mContainer != null) { + fontRendererObj.drawString("Item Amount", 10, 20, 16448255); + fontRendererObj.drawString(GT_Utility.parseNumberToString(((GT_Container_QuantumChest)mContainer).mContent), 10, 30, 16448255); + } + } + + @Override + protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { + super.drawGuiContainerBackgroundLayer(par1, par2, par3); + int x = (width - xSize) / 2; + int y = (height - ySize) / 2; + drawTexturedModalRect(x, y, 0, 0, xSize, ySize); + } +} diff --git a/src/main/java/gregtech/common/gui/GT_GUIContainer_Regulator.java b/src/main/java/gregtech/common/gui/GT_GUIContainer_Regulator.java new file mode 100644 index 0000000..57d9d02 --- /dev/null +++ b/src/main/java/gregtech/common/gui/GT_GUIContainer_Regulator.java @@ -0,0 +1,43 @@ +/* 1: */ package gregtech.common.gui; +/* 2: */ +/* 3: */ import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; +/* 4: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 6: */ import net.minecraft.entity.player.InventoryPlayer; +/* 7: */ +/* 8: */ public class GT_GUIContainer_Regulator +/* 9: */ extends GT_GUIContainerMetaTile_Machine +/* 10: */ { +/* 11: */ public GT_GUIContainer_Regulator(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) +/* 12: */ { +/* 13:11 */ super(new GT_Container_Regulator(aInventoryPlayer, aTileEntity), "gregtech:textures/gui/Regulator.png"); +/* 14: */ } +/* 15: */ +/* 16: */ @Override +protected void drawGuiContainerForegroundLayer(int par1, int par2) +/* 17: */ { +/* 18:16 */ this.fontRendererObj.drawString("" + ((GT_Container_Regulator)this.mContainer).mTargetSlots[0], 120, 9, 16448255); +/* 19:17 */ this.fontRendererObj.drawString("" + ((GT_Container_Regulator)this.mContainer).mTargetSlots[1], 137, 9, 16448255); +/* 20:18 */ this.fontRendererObj.drawString("" + ((GT_Container_Regulator)this.mContainer).mTargetSlots[2], 155, 9, 16448255); +/* 21:19 */ this.fontRendererObj.drawString("" + ((GT_Container_Regulator)this.mContainer).mTargetSlots[3], 120, 26, 16448255); +/* 22:20 */ this.fontRendererObj.drawString("" + ((GT_Container_Regulator)this.mContainer).mTargetSlots[4], 137, 26, 16448255); +/* 23:21 */ this.fontRendererObj.drawString("" + ((GT_Container_Regulator)this.mContainer).mTargetSlots[5], 155, 26, 16448255); +/* 24:22 */ this.fontRendererObj.drawString("" + ((GT_Container_Regulator)this.mContainer).mTargetSlots[6], 120, 43, 16448255); +/* 25:23 */ this.fontRendererObj.drawString("" + ((GT_Container_Regulator)this.mContainer).mTargetSlots[7], 137, 43, 16448255); +/* 26:24 */ this.fontRendererObj.drawString("" + ((GT_Container_Regulator)this.mContainer).mTargetSlots[8], 155, 43, 16448255); +/* 27: */ } +/* 28: */ +/* 29: */ @Override +protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) +/* 30: */ { +/* 31:29 */ super.drawGuiContainerBackgroundLayer(par1, par2, par3); +/* 32:30 */ int x = (this.width - this.xSize) / 2; +/* 33:31 */ int y = (this.height - this.ySize) / 2; +/* 34:32 */ drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize); +/* 35: */ } +/* 36: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.gui.GT_GUIContainer_Regulator + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/gui/GT_GUIContainer_SuperBuffer.java b/src/main/java/gregtech/common/gui/GT_GUIContainer_SuperBuffer.java new file mode 100644 index 0000000..e684d3e --- /dev/null +++ b/src/main/java/gregtech/common/gui/GT_GUIContainer_SuperBuffer.java @@ -0,0 +1,29 @@ +/* 1: */ package gregtech.common.gui; +/* 2: */ +/* 3: */ import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; +/* 4: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 5: */ import net.minecraft.entity.player.InventoryPlayer; +/* 6: */ +/* 7: */ public class GT_GUIContainer_SuperBuffer +/* 8: */ extends GT_GUIContainerMetaTile_Machine +/* 9: */ { +/* 10: */ public GT_GUIContainer_SuperBuffer(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) +/* 11: */ { +/* 12:11 */ super(new GT_Container_SuperBuffer(aInventoryPlayer, aTileEntity), "gregtech:textures/gui/SuperBuffer.png"); +/* 13: */ } +/* 14: */ +/* 15: */ @Override +protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) +/* 16: */ { +/* 17:16 */ super.drawGuiContainerBackgroundLayer(par1, par2, par3); +/* 18:17 */ int x = (this.width - this.xSize) / 2; +/* 19:18 */ int y = (this.height - this.ySize) / 2; +/* 20:19 */ drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize); +/* 21: */ } +/* 22: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.gui.GT_GUIContainer_SuperBuffer + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/gui/GT_GUIContainer_TypeFilter.java b/src/main/java/gregtech/common/gui/GT_GUIContainer_TypeFilter.java new file mode 100644 index 0000000..d620e82 --- /dev/null +++ b/src/main/java/gregtech/common/gui/GT_GUIContainer_TypeFilter.java @@ -0,0 +1,29 @@ +/* 1: */ package gregtech.common.gui; +/* 2: */ +/* 3: */ import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; +/* 4: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 5: */ import net.minecraft.entity.player.InventoryPlayer; +/* 6: */ +/* 7: */ public class GT_GUIContainer_TypeFilter +/* 8: */ extends GT_GUIContainerMetaTile_Machine +/* 9: */ { +/* 10: */ public GT_GUIContainer_TypeFilter(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) +/* 11: */ { +/* 12:10 */ super(new GT_Container_TypeFilter(aInventoryPlayer, aTileEntity), "gregtech:textures/gui/TypeFilter.png"); +/* 13: */ } +/* 14: */ +/* 15: */ @Override +protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) +/* 16: */ { +/* 17:15 */ super.drawGuiContainerBackgroundLayer(par1, par2, par3); +/* 18:16 */ int x = (this.width - this.xSize) / 2; +/* 19:17 */ int y = (this.height - this.ySize) / 2; +/* 20:18 */ drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize); +/* 21: */ } +/* 22: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.gui.GT_GUIContainer_TypeFilter + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_BasicLogic.java b/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_BasicLogic.java new file mode 100644 index 0000000..56e15c0 --- /dev/null +++ b/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_BasicLogic.java @@ -0,0 +1,121 @@ +/* 1: */ package gregtech.common.redstonecircuits; +/* 2: */ +/* 3: */ import gregtech.api.interfaces.IRedstoneCircuitBlock; +/* 4: */ import gregtech.api.util.GT_CircuitryBehavior; +/* 5: */ +/* 6: */ public class GT_Circuit_BasicLogic +/* 7: */ extends GT_CircuitryBehavior +/* 8: */ { +/* 9: */ public GT_Circuit_BasicLogic(int aIndex) +/* 10: */ { +/* 11: 9 */ super(aIndex); +/* 12: */ } +/* 13: */ +/* 14: */ @Override +public void initParameters(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) +/* 15: */ { +/* 16:14 */ aCircuitData[0] = 0; +/* 17: */ } +/* 18: */ +/* 19: */ @Override +public void validateParameters(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) +/* 20: */ { +/* 21:19 */ if (aCircuitData[0] < 0) { +/* 22:19 */ aCircuitData[0] = 0; +/* 23: */ } +/* 24:20 */ if (aCircuitData[0] > 13) { +/* 25:20 */ aCircuitData[0] = 13; +/* 26: */ } +/* 27: */ } +/* 28: */ +/* 29: */ @Override +public void onTick(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) +/* 30: */ { +/* 31:25 */ if (aCircuitData[0] < 2) { +/* 32:26 */ aRedstoneCircuitBlock.setRedstone((byte)(aCircuitData[0] % 2 == (getAnyRedstone(aRedstoneCircuitBlock) ? 0 : 1) ? 15 : 0), aRedstoneCircuitBlock.getOutputFacing()); +/* 33:27 */ } else if (aCircuitData[0] < 4) { +/* 34:28 */ aRedstoneCircuitBlock.setRedstone((byte)(aCircuitData[0] % 2 == (getOneRedstone(aRedstoneCircuitBlock) ? 0 : 1) ? 15 : 0), aRedstoneCircuitBlock.getOutputFacing()); +/* 35:29 */ } else if (aCircuitData[0] < 6) { +/* 36:30 */ aRedstoneCircuitBlock.setRedstone((byte)(aCircuitData[0] % 2 == (getAllRedstone(aRedstoneCircuitBlock) ? 0 : 1) ? 15 : 0), aRedstoneCircuitBlock.getOutputFacing()); +/* 37:31 */ } else if (aCircuitData[0] < 7) { +/* 38:32 */ aRedstoneCircuitBlock.setRedstone((byte)(15 - getStrongestRedstone(aRedstoneCircuitBlock)), aRedstoneCircuitBlock.getOutputFacing()); +/* 39:33 */ } else if (aCircuitData[0] < 9) { +/* 40:34 */ aRedstoneCircuitBlock.setRedstone((byte)((aCircuitData[0] % 2 == 0 ? 15 : 0) ^ (getStrongestRedstone(aRedstoneCircuitBlock) | getWeakestRedstone(aRedstoneCircuitBlock))), aRedstoneCircuitBlock.getOutputFacing()); +/* 41:35 */ } else if (aCircuitData[0] < 11) { +/* 42:36 */ aRedstoneCircuitBlock.setRedstone((byte)((aCircuitData[0] % 2 == 0 ? 15 : 0) ^ getStrongestRedstone(aRedstoneCircuitBlock) ^ getWeakestRedstone(aRedstoneCircuitBlock)), aRedstoneCircuitBlock.getOutputFacing()); +/* 43:37 */ } else if (aCircuitData[0] < 13) { +/* 44:38 */ aRedstoneCircuitBlock.setRedstone((byte)((aCircuitData[0] % 2 == 0 ? 15 : 0) ^ getStrongestRedstone(aRedstoneCircuitBlock) & getWeakestRedstone(aRedstoneCircuitBlock)), aRedstoneCircuitBlock.getOutputFacing()); +/* 45:39 */ } else if (aCircuitData[0] < 14) { +/* 46:40 */ aRedstoneCircuitBlock.setRedstone((byte)(getStrongestRedstone(aRedstoneCircuitBlock) ^ 0xF), aRedstoneCircuitBlock.getOutputFacing()); +/* 47: */ } +/* 48: */ } +/* 49: */ +/* 50: */ @Override +public String getName() +/* 51: */ { +/* 52:46 */ return "Basic Logic"; +/* 53: */ } +/* 54: */ +/* 55: */ @Override +public String getDescription() +/* 56: */ { +/* 57:51 */ return "Regular Logic Gates"; +/* 58: */ } +/* 59: */ +/* 60: */ @Override +public String getDataDescription(int[] aCircuitData, int aCircuitDataIndex) +/* 61: */ { +/* 62:56 */ if (aCircuitDataIndex == 0) { +/* 63:57 */ switch (aCircuitData[0]) +/* 64: */ { +/* 65: */ case 0: +/* 66:58 */ return "OR"; +/* 67: */ case 1: +/* 68:59 */ return "NOR"; +/* 69: */ case 2: +/* 70:60 */ return "XOR"; +/* 71: */ case 3: +/* 72:61 */ return "XNOR"; +/* 73: */ case 4: +/* 74:62 */ return "AND"; +/* 75: */ case 5: +/* 76:63 */ return "NAND"; +/* 77: */ case 6: +/* 78:64 */ return "INVERT"; +/* 79: */ case 7: +/* 80:65 */ return "BIT_OR"; +/* 81: */ case 8: +/* 82:66 */ return "BIT_NOR"; +/* 83: */ case 9: +/* 84:67 */ return "BIT_XOR"; +/* 85: */ case 10: +/* 86:68 */ return "BIT_XNOR"; +/* 87: */ case 11: +/* 88:69 */ return "BIT_AND"; +/* 89: */ case 12: +/* 90:70 */ return "BIT_NAND"; +/* 91: */ case 13: +/* 92:71 */ return "BIT_INVERT"; +/* 93: */ } +/* 94: */ } +/* 95:74 */ return ""; +/* 96: */ } +/* 97: */ +/* 98: */ @Override +public boolean displayItemStack(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock, int aIndex) +/* 99: */ { +/* :0:79 */ return false; +/* :1: */ } +/* :2: */ +/* :3: */ @Override +public String getDataDisplay(int[] aCircuitData, int aCircuitDataIndex) +/* :4: */ { +/* :5:84 */ return ""; +/* :6: */ } +/* :7: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.redstonecircuits.GT_Circuit_BasicLogic + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_BitAnd.java b/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_BitAnd.java new file mode 100644 index 0000000..65c5b40 --- /dev/null +++ b/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_BitAnd.java @@ -0,0 +1,93 @@ +/* 1: */ package gregtech.common.redstonecircuits; +/* 2: */ +/* 3: */ import gregtech.api.interfaces.IRedstoneCircuitBlock; +/* 4: */ import gregtech.api.util.GT_CircuitryBehavior; +/* 5: */ +/* 6: */ public class GT_Circuit_BitAnd +/* 7: */ extends GT_CircuitryBehavior +/* 8: */ { +/* 9: */ public GT_Circuit_BitAnd(int aIndex) +/* 10: */ { +/* 11: 9 */ super(aIndex); +/* 12: */ } +/* 13: */ +/* 14: */ @Override +public void initParameters(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) +/* 15: */ { +/* 16:14 */ aCircuitData[0] = 0; +/* 17:15 */ aCircuitData[1] = 0; +/* 18:16 */ aCircuitData[2] = 0; +/* 19:17 */ aCircuitData[3] = 0; +/* 20: */ } +/* 21: */ +/* 22: */ @Override +public void validateParameters(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) +/* 23: */ { +/* 24:22 */ if (aCircuitData[0] < 0) { +/* 25:22 */ aCircuitData[0] = 0; +/* 26: */ } +/* 27:23 */ if (aCircuitData[1] < 0) { +/* 28:23 */ aCircuitData[1] = 0; +/* 29: */ } +/* 30:24 */ if (aCircuitData[2] < 0) { +/* 31:24 */ aCircuitData[2] = 0; +/* 32: */ } +/* 33:25 */ if (aCircuitData[3] < 0) { +/* 34:25 */ aCircuitData[3] = 0; +/* 35: */ } +/* 36:26 */ if (aCircuitData[0] > 1) { +/* 37:26 */ aCircuitData[0] = 1; +/* 38: */ } +/* 39:27 */ if (aCircuitData[1] > 1) { +/* 40:27 */ aCircuitData[1] = 1; +/* 41: */ } +/* 42:28 */ if (aCircuitData[2] > 1) { +/* 43:28 */ aCircuitData[2] = 1; +/* 44: */ } +/* 45:29 */ if (aCircuitData[3] > 1) { +/* 46:29 */ aCircuitData[3] = 1; +/* 47: */ } +/* 48: */ } +/* 49: */ +/* 50: */ @Override +public void onTick(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) +/* 51: */ { +/* 52:34 */ aRedstoneCircuitBlock.setRedstone((byte)((getStrongestRedstone(aRedstoneCircuitBlock) & (aCircuitData[0] | aCircuitData[1] << 1 | aCircuitData[2] << 2 | aCircuitData[3] << 3)) != 0 ? 15 : 0), aRedstoneCircuitBlock.getOutputFacing()); +/* 53: */ } +/* 54: */ +/* 55: */ @Override +public String getName() +/* 56: */ { +/* 57:39 */ return "Hardcode Bit-AND"; +/* 58: */ } +/* 59: */ +/* 60: */ @Override +public String getDescription() +/* 61: */ { +/* 62:44 */ return "( signal & this ) != 0"; +/* 63: */ } +/* 64: */ +/* 65: */ @Override +public String getDataDescription(int[] aCircuitData, int aCircuitDataIndex) +/* 66: */ { +/* 67:49 */ return "Bit " + aCircuitDataIndex + ":"; +/* 68: */ } +/* 69: */ +/* 70: */ @Override +public boolean displayItemStack(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock, int aIndex) +/* 71: */ { +/* 72:54 */ return false; +/* 73: */ } +/* 74: */ +/* 75: */ @Override +public String getDataDisplay(int[] aCircuitData, int aCircuitDataIndex) +/* 76: */ { +/* 77:59 */ return aCircuitData[aCircuitDataIndex] == 0 ? "OFF" : "ON"; +/* 78: */ } +/* 79: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.redstonecircuits.GT_Circuit_BitAnd + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_CombinationLock.java b/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_CombinationLock.java new file mode 100644 index 0000000..66dbc3e --- /dev/null +++ b/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_CombinationLock.java @@ -0,0 +1,131 @@ +/* 1: */ package gregtech.common.redstonecircuits; +/* 2: */ +/* 3: */ import gregtech.api.interfaces.IRedstoneCircuitBlock; +/* 4: */ import gregtech.api.util.GT_CircuitryBehavior; +/* 5: */ +/* 6: */ public class GT_Circuit_CombinationLock +/* 7: */ extends GT_CircuitryBehavior +/* 8: */ { +/* 9: */ public GT_Circuit_CombinationLock(int aIndex) +/* 10: */ { +/* 11: 9 */ super(aIndex); +/* 12: */ } +/* 13: */ +/* 14: */ @Override +public void initParameters(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) +/* 15: */ { +/* 16:14 */ aCircuitData[0] = 1; +/* 17:15 */ aCircuitData[1] = 0; +/* 18:16 */ aCircuitData[2] = 0; +/* 19:17 */ aCircuitData[3] = 0; +/* 20:18 */ aCircuitData[4] = 0; +/* 21:19 */ aCircuitData[5] = 0; +/* 22: */ } +/* 23: */ +/* 24: */ @Override +public void validateParameters(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) +/* 25: */ { +/* 26:24 */ if (aCircuitData[0] < 1) { +/* 27:24 */ aCircuitData[0] = 1; +/* 28: */ } +/* 29:25 */ if (aCircuitData[1] < 0) { +/* 30:25 */ aCircuitData[1] = 0; +/* 31: */ } +/* 32:26 */ if (aCircuitData[2] < 0) { +/* 33:26 */ aCircuitData[2] = 0; +/* 34: */ } +/* 35:27 */ if (aCircuitData[3] < 0) { +/* 36:27 */ aCircuitData[3] = 0; +/* 37: */ } +/* 38:28 */ if (aCircuitData[0] > 15) { +/* 39:28 */ aCircuitData[0] = 15; +/* 40: */ } +/* 41:29 */ if (aCircuitData[1] > 15) { +/* 42:29 */ aCircuitData[1] = 15; +/* 43: */ } +/* 44:30 */ if (aCircuitData[2] > 15) { +/* 45:30 */ aCircuitData[2] = 15; +/* 46: */ } +/* 47:31 */ if (aCircuitData[3] > 15) { +/* 48:31 */ aCircuitData[3] = 15; +/* 49: */ } +/* 50:32 */ if (aCircuitData[4] < 0) { +/* 51:32 */ aCircuitData[4] = 0; +/* 52: */ } +/* 53:33 */ if (aCircuitData[4] > 3) { +/* 54:33 */ aCircuitData[4] = 3; +/* 55: */ } +/* 56:34 */ if (aCircuitData[5] < 0) { +/* 57:34 */ aCircuitData[5] = 0; +/* 58: */ } +/* 59: */ } +/* 60: */ +/* 61: */ @Override +public void onTick(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) +/* 62: */ { +/* 63:39 */ while ((aCircuitData[aCircuitData[4]] == 0) && (aCircuitData[4] < 4)) { +/* 64:39 */ aCircuitData[4] += 1; +/* 65: */ } +/* 66:40 */ if (aCircuitData[4] < 4) +/* 67: */ { +/* 68:41 */ int tRedstone = getStrongestRedstone(aRedstoneCircuitBlock); +/* 69:42 */ if (tRedstone > 0) +/* 70: */ { +/* 71:43 */ if (aCircuitData[5] == 0) { +/* 72:44 */ if (tRedstone == aCircuitData[aCircuitData[4]]) { +/* 73:45 */ aCircuitData[4] += 1; +/* 74: */ } else { +/* 75:47 */ aCircuitData[4] = 0; +/* 76: */ } +/* 77: */ } +/* 78:50 */ aCircuitData[5] = 1; +/* 79: */ } +/* 80: */ else +/* 81: */ { +/* 82:52 */ aCircuitData[5] = 0; +/* 83: */ } +/* 84:54 */ aRedstoneCircuitBlock.setRedstone((byte)0, aRedstoneCircuitBlock.getOutputFacing()); +/* 85: */ } +/* 86: */ else +/* 87: */ { +/* 88:56 */ aRedstoneCircuitBlock.setRedstone((byte)15, aRedstoneCircuitBlock.getOutputFacing()); +/* 89:57 */ aCircuitData[4] = 0; +/* 90: */ } +/* 91: */ } +/* 92: */ +/* 93: */ @Override +public String getName() +/* 94: */ { +/* 95:63 */ return "Combination Lock"; +/* 96: */ } +/* 97: */ +/* 98: */ @Override +public String getDescription() +/* 99: */ { +/* :0:68 */ return "Checks Combinations"; +/* :1: */ } +/* :2: */ +/* :3: */ @Override +public String getDataDescription(int[] aCircuitData, int aCircuitDataIndex) +/* :4: */ { +/* :5:73 */ return "Power " + aCircuitDataIndex; +/* :6: */ } +/* :7: */ +/* :8: */ @Override +public boolean displayItemStack(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock, int aIndex) +/* :9: */ { +/* ;0:78 */ return false; +/* ;1: */ } +/* ;2: */ +/* ;3: */ @Override +public String getDataDisplay(int[] aCircuitData, int aCircuitDataIndex) +/* ;4: */ { +/* ;5:83 */ return null; +/* ;6: */ } +/* ;7: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.redstonecircuits.GT_Circuit_CombinationLock + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_Equals.java b/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_Equals.java new file mode 100644 index 0000000..cbc3b24 --- /dev/null +++ b/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_Equals.java @@ -0,0 +1,89 @@ +/* 1: */ package gregtech.common.redstonecircuits; +/* 2: */ +/* 3: */ import gregtech.api.interfaces.IRedstoneCircuitBlock; +/* 4: */ import gregtech.api.util.GT_CircuitryBehavior; +/* 5: */ +/* 6: */ public class GT_Circuit_Equals +/* 7: */ extends GT_CircuitryBehavior +/* 8: */ { +/* 9: */ public GT_Circuit_Equals(int aIndex) +/* 10: */ { +/* 11: 9 */ super(aIndex); +/* 12: */ } +/* 13: */ +/* 14: */ @Override +public void initParameters(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) +/* 15: */ { +/* 16:14 */ aCircuitData[0] = 0; +/* 17:15 */ aCircuitData[1] = 0; +/* 18: */ } +/* 19: */ +/* 20: */ @Override +public void validateParameters(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) +/* 21: */ { +/* 22:20 */ if (aCircuitData[0] < 0) { +/* 23:20 */ aCircuitData[0] = 0; +/* 24: */ } +/* 25:21 */ if (aCircuitData[0] > 15) { +/* 26:21 */ aCircuitData[0] = 15; +/* 27: */ } +/* 28:22 */ if (aCircuitData[1] < 0) { +/* 29:22 */ aCircuitData[3] = 0; +/* 30: */ } +/* 31:23 */ if (aCircuitData[1] > 1) { +/* 32:23 */ aCircuitData[3] = 1; +/* 33: */ } +/* 34: */ } +/* 35: */ +/* 36: */ @Override +public void onTick(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) +/* 37: */ { + aRedstoneCircuitBlock.setRedstone(((byte)((aCircuitData[1] != 0 ? getStrongestRedstone(aRedstoneCircuitBlock) == aCircuitData[0] : getStrongestRedstone(aRedstoneCircuitBlock) != aCircuitData[0]) ? 0 : 15)), aRedstoneCircuitBlock.getOutputFacing()); +} +/* 46: */ +/* 47: */ @Override +public String getName() +/* 48: */ { +/* 49:33 */ return "Equals"; +/* 50: */ } +/* 51: */ +/* 52: */ @Override +public String getDescription() +/* 53: */ { +/* 54:38 */ return "signal == this"; +/* 55: */ } +/* 56: */ +/* 57: */ @Override +public String getDataDescription(int[] aCircuitData, int aCircuitDataIndex) +/* 58: */ { +/* 59:43 */ switch (aCircuitDataIndex) +/* 60: */ { +/* 61: */ case 0: +/* 62:44 */ return "Signal"; +/* 63: */ case 1: +/* 64:45 */ return aCircuitData[1] == 0 ? "Equal" : "Unequal"; +/* 65: */ } +/* 66:47 */ return ""; +/* 67: */ } +/* 68: */ +/* 69: */ @Override +public boolean displayItemStack(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock, int aIndex) +/* 70: */ { +/* 71:52 */ return false; +/* 72: */ } +/* 73: */ +/* 74: */ @Override +public String getDataDisplay(int[] aCircuitData, int aCircuitDataIndex) +/* 75: */ { +/* 76:57 */ if (aCircuitDataIndex > 0) { +/* 77:57 */ return ""; +/* 78: */ } +/* 79:58 */ return null; +/* 80: */ } +/* 81: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.redstonecircuits.GT_Circuit_Equals + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_Pulser.java b/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_Pulser.java new file mode 100644 index 0000000..58c38c9 --- /dev/null +++ b/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_Pulser.java @@ -0,0 +1,107 @@ +/* 1: */ package gregtech.common.redstonecircuits; +/* 2: */ +/* 3: */ import gregtech.api.interfaces.IRedstoneCircuitBlock; +/* 4: */ import gregtech.api.util.GT_CircuitryBehavior; +/* 5: */ +/* 6: */ public class GT_Circuit_Pulser +/* 7: */ extends GT_CircuitryBehavior +/* 8: */ { +/* 9: */ public GT_Circuit_Pulser(int aIndex) +/* 10: */ { +/* 11: 9 */ super(aIndex); +/* 12: */ } +/* 13: */ +/* 14: */ @Override +public void initParameters(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) +/* 15: */ { +/* 16:14 */ aCircuitData[0] = 1; +/* 17:15 */ aCircuitData[1] = 16; +/* 18:16 */ aCircuitData[4] = 0; +/* 19: */ } +/* 20: */ +/* 21: */ @Override +public void validateParameters(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) +/* 22: */ { +/* 23:21 */ if (aCircuitData[0] < 1) { +/* 24:21 */ aCircuitData[0] = 1; +/* 25: */ } +/* 26:22 */ if (aCircuitData[1] < 0) { +/* 27:22 */ aCircuitData[1] = 0; +/* 28: */ } +/* 29:23 */ if (aCircuitData[1] > 16) { +/* 30:23 */ aCircuitData[1] = 16; +/* 31: */ } +/* 32:24 */ if (aCircuitData[4] < 0) { +/* 33:24 */ aCircuitData[4] = 0; +/* 34: */ } +/* 35: */ } +/* 36: */ +/* 37: */ @Override +public void onTick(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) +/* 38: */ { +/* 39:29 */ byte tRedstone = aCircuitData[1] == 0 ? getWeakestNonZeroRedstone(aRedstoneCircuitBlock) : getStrongestRedstone(aRedstoneCircuitBlock); +/* 40:30 */ if (aCircuitData[4] == 0) { +/* 41:30 */ aCircuitData[5] = tRedstone; +/* 42: */ } +/* 43:31 */ if ((tRedstone > 0) || (aCircuitData[4] > 0)) +/* 44: */ { +/* 45:31 */ int tmp40_39 = 4; int[] tmp40_38 = aCircuitData; int tmp42_41 = tmp40_38[tmp40_39];tmp40_38[tmp40_39] = (tmp42_41 + 1); +/* 46:31 */ if ((tmp42_41 >= aCircuitData[0]) && (tRedstone <= 0)) { +/* 47:31 */ aCircuitData[4] = 0; +/* 48: */ } +/* 49: */ } +/* 50:32 */ aRedstoneCircuitBlock.setRedstone((aCircuitData[4] > 0) && (aCircuitData[4] <= aCircuitData[0]) ? (byte)aCircuitData[1] : (aCircuitData[1] <= 0) || (aCircuitData[1] > 15) ? (byte)aCircuitData[5] : 0, aRedstoneCircuitBlock.getOutputFacing()); +/* 51: */ } +/* 52: */ +/* 53: */ @Override +public String getName() +/* 54: */ { +/* 55:37 */ return "Pulser"; +/* 56: */ } +/* 57: */ +/* 58: */ @Override +public String getDescription() +/* 59: */ { +/* 60:42 */ return "Limits&Enlengths"; +/* 61: */ } +/* 62: */ +/* 63: */ @Override +public String getDataDescription(int[] aCircuitData, int aCircuitDataIndex) +/* 64: */ { +/* 65:47 */ switch (aCircuitDataIndex) +/* 66: */ { +/* 67: */ case 0: +/* 68:48 */ return "Length"; +/* 69: */ case 1: +/* 70:49 */ return "RS Out"; +/* 71: */ } +/* 72:51 */ return ""; +/* 73: */ } +/* 74: */ +/* 75: */ @Override +public boolean displayItemStack(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock, int aIndex) +/* 76: */ { +/* 77:56 */ return false; +/* 78: */ } +/* 79: */ +/* 80: */ @Override +public String getDataDisplay(int[] aCircuitData, int aCircuitDataIndex) +/* 81: */ { +/* 82:61 */ if (aCircuitDataIndex == 1) +/* 83: */ { +/* 84:62 */ if (aCircuitData[aCircuitDataIndex] == 16) { +/* 85:62 */ return "HIGHEST"; +/* 86: */ } +/* 87:63 */ if (aCircuitData[aCircuitDataIndex] == 0) { +/* 88:63 */ return "LOWEST"; +/* 89: */ } +/* 90: */ } +/* 91:65 */ return aCircuitDataIndex > 1 ? "" : null; +/* 92: */ } +/* 93: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.redstonecircuits.GT_Circuit_Pulser + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_Randomizer.java b/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_Randomizer.java new file mode 100644 index 0000000..ebddd1e --- /dev/null +++ b/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_Randomizer.java @@ -0,0 +1,108 @@ +/* 1: */ package gregtech.common.redstonecircuits; +/* 2: */ +/* 3: */ import gregtech.api.interfaces.IRedstoneCircuitBlock; +/* 4: */ import gregtech.api.util.GT_CircuitryBehavior; +/* 5: */ +/* 6: */ public class GT_Circuit_Randomizer +/* 7: */ extends GT_CircuitryBehavior +/* 8: */ { +/* 9: */ public GT_Circuit_Randomizer(int aIndex) +/* 10: */ { +/* 11: 9 */ super(aIndex); +/* 12: */ } +/* 13: */ +/* 14: */ @Override +public void initParameters(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) +/* 15: */ { +/* 16:14 */ aCircuitData[0] = 1; +/* 17:15 */ aCircuitData[4] = 0; +/* 18: */ } +/* 19: */ +/* 20: */ @Override +public void validateParameters(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) +/* 21: */ { +/* 22:20 */ if (aCircuitData[0] < 1) { +/* 23:20 */ aCircuitData[0] = 1; +/* 24: */ } +/* 25:21 */ if (aCircuitData[3] < 0) { +/* 26:21 */ aCircuitData[3] = 0; +/* 27: */ } +/* 28:22 */ if (aCircuitData[3] > 1) { +/* 29:22 */ aCircuitData[3] = 1; +/* 30: */ } +/* 31:23 */ if (aCircuitData[4] < 0) { +/* 32:23 */ aCircuitData[4] = 0; +/* 33: */ } +/* 34: */ } +/* 35: */ +/* 36: */ @Override +public void onTick(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) +/* 37: */ { +/* 38:28 */ if (aCircuitData[3] == 1) +/* 39: */ { +/* 40:29 */ if (getAnyRedstone(aRedstoneCircuitBlock)) { +/* 41:30 */ aCircuitData[4] += 1; +/* 42: */ } else { +/* 43:32 */ aCircuitData[4] = 0; +/* 44: */ } +/* 45: */ } +/* 46:35 */ else if (getAnyRedstone(aRedstoneCircuitBlock)) { +/* 47:36 */ aCircuitData[4] = 0; +/* 48: */ } else { +/* 49:38 */ aCircuitData[4] += 1; +/* 50: */ } +/* 51:42 */ if (aCircuitData[4] >= aCircuitData[0]) +/* 52: */ { +/* 53:43 */ aCircuitData[4] = 0; +/* 54:44 */ aRedstoneCircuitBlock.setRedstone((byte)aRedstoneCircuitBlock.getRandom(16), aRedstoneCircuitBlock.getOutputFacing()); +/* 55: */ } +/* 56: */ } +/* 57: */ +/* 58: */ @Override +public String getName() +/* 59: */ { +/* 60:50 */ return "Randomizer"; +/* 61: */ } +/* 62: */ +/* 63: */ @Override +public String getDescription() +/* 64: */ { +/* 65:55 */ return "Randomizes Redstone"; +/* 66: */ } +/* 67: */ +/* 68: */ @Override +public String getDataDescription(int[] aCircuitData, int aCircuitDataIndex) +/* 69: */ { +/* 70:60 */ switch (aCircuitDataIndex) +/* 71: */ { +/* 72: */ case 0: +/* 73:61 */ return "Delay"; +/* 74: */ case 3: +/* 75:62 */ return aCircuitData[aCircuitDataIndex] == 1 ? "RS => ON" : "RS => OFF"; +/* 76: */ case 4: +/* 77:63 */ return "Status"; +/* 78: */ } +/* 79:65 */ return ""; +/* 80: */ } +/* 81: */ +/* 82: */ @Override +public boolean displayItemStack(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock, int aIndex) +/* 83: */ { +/* 84:70 */ return false; +/* 85: */ } +/* 86: */ +/* 87: */ @Override +public String getDataDisplay(int[] aCircuitData, int aCircuitDataIndex) +/* 88: */ { +/* 89:75 */ if (aCircuitDataIndex != 0) { +/* 90:75 */ return ""; +/* 91: */ } +/* 92:76 */ return null; +/* 93: */ } +/* 94: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.redstonecircuits.GT_Circuit_Randomizer + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_RedstoneMeter.java b/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_RedstoneMeter.java new file mode 100644 index 0000000..f1d4967 --- /dev/null +++ b/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_RedstoneMeter.java @@ -0,0 +1,111 @@ +/* 1: */ package gregtech.common.redstonecircuits; +/* 2: */ +/* 3: */ import gregtech.api.interfaces.IRedstoneCircuitBlock; +/* 4: */ import gregtech.api.util.GT_CircuitryBehavior; +/* 5: */ +/* 6: */ public class GT_Circuit_RedstoneMeter +/* 7: */ extends GT_CircuitryBehavior +/* 8: */ { +/* 9: */ public GT_Circuit_RedstoneMeter(int aIndex) +/* 10: */ { +/* 11: 8 */ super(aIndex); +/* 12: */ } +/* 13: */ +/* 14: */ @Override +public void initParameters(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) +/* 15: */ { +/* 16:13 */ aCircuitData[0] = 1; +/* 17:14 */ aCircuitData[1] = 15; +/* 18:15 */ aCircuitData[2] = 0; +/* 19:16 */ aCircuitData[3] = 15; +/* 20: */ } +/* 21: */ +/* 22: */ @Override +public void validateParameters(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) +/* 23: */ { +/* 24:21 */ if (aCircuitData[0] < 0) { +/* 25:21 */ aCircuitData[0] = 0; +/* 26: */ } +/* 27:22 */ if (aCircuitData[0] > 15) { +/* 28:22 */ aCircuitData[0] = 15; +/* 29: */ } +/* 30:23 */ if (aCircuitData[1] < 0) { +/* 31:23 */ aCircuitData[1] = 0; +/* 32: */ } +/* 33:24 */ if (aCircuitData[1] > 15) { +/* 34:24 */ aCircuitData[1] = 15; +/* 35: */ } +/* 36:25 */ if (aCircuitData[1] < aCircuitData[0]) { +/* 37:25 */ aCircuitData[1] = aCircuitData[0]; +/* 38: */ } +/* 39:26 */ if (aCircuitData[2] < 0) { +/* 40:26 */ aCircuitData[2] = 0; +/* 41: */ } +/* 42:27 */ if (aCircuitData[2] > 1) { +/* 43:27 */ aCircuitData[2] = 1; +/* 44: */ } +/* 45:28 */ if (aCircuitData[3] < 0) { +/* 46:28 */ aCircuitData[3] = 0; +/* 47: */ } +/* 48:29 */ if (aCircuitData[3] > 15) { +/* 49:29 */ aCircuitData[3] = 15; +/* 50: */ } +/* 51: */ } +/* 52: */ +/* 53: */ @Override +public void onTick(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) +/* 54: */ { +/* 55:34 */ byte tRedstone = getStrongestRedstone(aRedstoneCircuitBlock); +/* 56:35 */ aRedstoneCircuitBlock.setRedstone(((tRedstone >= aCircuitData[0]) && (tRedstone <= aCircuitData[1]) ? 1 : 0) != (aCircuitData[2] != 0 ? 1 : 0) ? (byte)aCircuitData[3] : 0, aRedstoneCircuitBlock.getOutputFacing()); +/* 57: */ } +/* 58: */ +/* 59: */ @Override +public String getName() +/* 60: */ { +/* 61:40 */ return "Redstone Meter"; +/* 62: */ } +/* 63: */ +/* 64: */ @Override +public String getDescription() +/* 65: */ { +/* 66:45 */ return "Checks Boundaries"; +/* 67: */ } +/* 68: */ +/* 69: */ @Override +public String getDataDescription(int[] aCircuitData, int aCircuitDataIndex) +/* 70: */ { +/* 71:50 */ switch (aCircuitDataIndex) +/* 72: */ { +/* 73: */ case 0: +/* 74:51 */ return "Lower"; +/* 75: */ case 1: +/* 76:52 */ return "Upper"; +/* 77: */ case 2: +/* 78:53 */ return "Invert:"; +/* 79: */ case 3: +/* 80:54 */ return "RS Out:"; +/* 81: */ } +/* 82:56 */ return ""; +/* 83: */ } +/* 84: */ +/* 85: */ @Override +public boolean displayItemStack(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock, int aIndex) +/* 86: */ { +/* 87:61 */ return false; +/* 88: */ } +/* 89: */ +/* 90: */ @Override +public String getDataDisplay(int[] aCircuitData, int aCircuitDataIndex) +/* 91: */ { +/* 92:66 */ if (aCircuitDataIndex == 2) { +/* 93:66 */ return aCircuitData[2] == 0 ? "OFF" : "ON"; +/* 94: */ } +/* 95:67 */ return null; +/* 96: */ } +/* 97: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.redstonecircuits.GT_Circuit_RedstoneMeter + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_Repeater.java b/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_Repeater.java new file mode 100644 index 0000000..904526a --- /dev/null +++ b/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_Repeater.java @@ -0,0 +1,111 @@ +/* 1: */ package gregtech.common.redstonecircuits; +/* 2: */ +/* 3: */ import gregtech.api.interfaces.IRedstoneCircuitBlock; +/* 4: */ import gregtech.api.util.GT_CircuitryBehavior; +/* 5: */ +/* 6: */ public class GT_Circuit_Repeater +/* 7: */ extends GT_CircuitryBehavior +/* 8: */ { +/* 9: */ public GT_Circuit_Repeater(int aIndex) +/* 10: */ { +/* 11: 9 */ super(aIndex); +/* 12: */ } +/* 13: */ +/* 14: */ @Override +public void initParameters(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) +/* 15: */ { +/* 16:14 */ aCircuitData[0] = 1; +/* 17:15 */ aCircuitData[4] = 0; +/* 18:16 */ aCircuitData[5] = -1; +/* 19: */ } +/* 20: */ +/* 21: */ @Override +public void validateParameters(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) +/* 22: */ { +/* 23:21 */ if (aCircuitData[0] < 1) { +/* 24:21 */ aCircuitData[0] = 1; +/* 25: */ } +/* 26:22 */ if (aCircuitData[4] < 0) { +/* 27:22 */ aCircuitData[4] = 0; +/* 28: */ } +/* 29:23 */ if (aCircuitData[5] < -1) { +/* 30:23 */ aCircuitData[5] = -1; +/* 31: */ } +/* 32: */ } +/* 33: */ +/* 34: */ @Override +public void onTick(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) +/* 35: */ { +/* 36:28 */ if (getAnyRedstone(aRedstoneCircuitBlock)) +/* 37: */ { +/* 38:29 */ aCircuitData[4] += 1; +/* 39:30 */ if (aCircuitData[5] < 0) { +/* 40:31 */ aCircuitData[5] = 0; +/* 41: */ } +/* 42: */ } +/* 43:34 */ if ((aCircuitData[5] >= 0) && (aCircuitData[5] < aCircuitData[0])) { +/* 44:35 */ aCircuitData[5] += 1; +/* 45: */ } +/* 46:37 */ if (aCircuitData[4] > 0) +/* 47: */ { +/* 48:38 */ if (aCircuitData[5] >= aCircuitData[0]) +/* 49: */ { +/* 50:39 */ aCircuitData[4] -= 1; +/* 51:40 */ aRedstoneCircuitBlock.setRedstone((byte)15, aRedstoneCircuitBlock.getOutputFacing()); +/* 52: */ } +/* 53: */ else +/* 54: */ { +/* 55:42 */ aRedstoneCircuitBlock.setRedstone((byte)0, aRedstoneCircuitBlock.getOutputFacing()); +/* 56: */ } +/* 57: */ } +/* 58: */ else +/* 59: */ { +/* 60:45 */ aRedstoneCircuitBlock.setRedstone((byte)0, aRedstoneCircuitBlock.getOutputFacing()); +/* 61:46 */ aCircuitData[5] = -1; +/* 62: */ } +/* 63: */ } +/* 64: */ +/* 65: */ @Override +public String getName() +/* 66: */ { +/* 67:52 */ return "Repeater"; +/* 68: */ } +/* 69: */ +/* 70: */ @Override +public String getDescription() +/* 71: */ { +/* 72:57 */ return "Delays RS-Signal"; +/* 73: */ } +/* 74: */ +/* 75: */ @Override +public String getDataDescription(int[] aCircuitData, int aCircuitDataIndex) +/* 76: */ { +/* 77:62 */ switch (aCircuitDataIndex) +/* 78: */ { +/* 79: */ case 0: +/* 80:63 */ return "Delay"; +/* 81: */ } +/* 82:65 */ return ""; +/* 83: */ } +/* 84: */ +/* 85: */ @Override +public boolean displayItemStack(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock, int aIndex) +/* 86: */ { +/* 87:70 */ return false; +/* 88: */ } +/* 89: */ +/* 90: */ @Override +public String getDataDisplay(int[] aCircuitData, int aCircuitDataIndex) +/* 91: */ { +/* 92:75 */ if (aCircuitDataIndex > 0) { +/* 93:75 */ return ""; +/* 94: */ } +/* 95:76 */ return null; +/* 96: */ } +/* 97: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.redstonecircuits.GT_Circuit_Repeater + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_Timer.java b/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_Timer.java new file mode 100644 index 0000000..201d009 --- /dev/null +++ b/src/main/java/gregtech/common/redstonecircuits/GT_Circuit_Timer.java @@ -0,0 +1,138 @@ +/* 1: */ package gregtech.common.redstonecircuits; +/* 2: */ +/* 3: */ import gregtech.api.interfaces.IRedstoneCircuitBlock; +/* 4: */ import gregtech.api.util.GT_CircuitryBehavior; +/* 5: */ +/* 6: */ public class GT_Circuit_Timer +/* 7: */ extends GT_CircuitryBehavior +/* 8: */ { +/* 9: */ public GT_Circuit_Timer(int aIndex) +/* 10: */ { +/* 11: 9 */ super(aIndex); +/* 12: */ } +/* 13: */ +/* 14: */ @Override +public void initParameters(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) +/* 15: */ { +/* 16:14 */ aCircuitData[0] = 2; +/* 17:15 */ aCircuitData[1] = 1; +/* 18:16 */ aCircuitData[2] = 2; +/* 19:17 */ aCircuitData[4] = 0; +/* 20: */ } +/* 21: */ +/* 22: */ @Override +public void validateParameters(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) +/* 23: */ { +/* 24:22 */ if (aCircuitData[0] < 2) { +/* 25:22 */ aCircuitData[0] = 2; +/* 26: */ } +/* 27:23 */ if (aCircuitData[1] < 1) { +/* 28:23 */ aCircuitData[1] = 1; +/* 29: */ } +/* 30:24 */ if (aCircuitData[2] < 2) { +/* 31:24 */ aCircuitData[2] = 2; +/* 32: */ } +/* 33:25 */ if (aCircuitData[3] < 0) { +/* 34:25 */ aCircuitData[3] = 0; +/* 35: */ } +/* 36:26 */ if (aCircuitData[3] > 1) { +/* 37:26 */ aCircuitData[3] = 1; +/* 38: */ } +/* 39:27 */ if (aCircuitData[4] < 0) { +/* 40:27 */ aCircuitData[4] = 0; +/* 41: */ } +/* 42: */ } +/* 43: */ +/* 44: */ @Override +public void onTick(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock) +/* 45: */ { +/* 46:32 */ if (aCircuitData[3] == 1) +/* 47: */ { +/* 48:33 */ if (getAnyRedstone(aRedstoneCircuitBlock)) { +/* 49:34 */ aCircuitData[4] += 1; +/* 50: */ } else { +/* 51:36 */ aCircuitData[4] = 0; +/* 52: */ } +/* 53: */ } +/* 54:39 */ else if (getAnyRedstone(aRedstoneCircuitBlock)) { +/* 55:40 */ aCircuitData[4] = 0; +/* 56: */ } else { +/* 57:42 */ aCircuitData[4] += 1; +/* 58: */ } +/* 59:46 */ if (aCircuitData[4] >= aCircuitData[0]) +/* 60: */ { +/* 61:47 */ if (aCircuitData[1] > 1) +/* 62: */ { +/* 63:48 */ if (aCircuitData[4] >= aCircuitData[0] + (aCircuitData[1] - 1) * aCircuitData[2]) +/* 64: */ { +/* 65:49 */ aRedstoneCircuitBlock.setRedstone((byte)15, aRedstoneCircuitBlock.getOutputFacing()); +/* 66:50 */ aCircuitData[4] = 0; +/* 67: */ } +/* 68: */ else +/* 69: */ { +/* 70:52 */ aRedstoneCircuitBlock.setRedstone((byte)((aCircuitData[4] - aCircuitData[0]) % aCircuitData[2] == 0 ? 15 : 0), aRedstoneCircuitBlock.getOutputFacing()); +/* 71: */ } +/* 72: */ } +/* 73: */ else +/* 74: */ { +/* 75:55 */ aRedstoneCircuitBlock.setRedstone((byte)15, aRedstoneCircuitBlock.getOutputFacing()); +/* 76:56 */ aCircuitData[4] = 0; +/* 77: */ } +/* 78: */ } +/* 79: */ else { +/* 80:59 */ aRedstoneCircuitBlock.setRedstone((byte)0, aRedstoneCircuitBlock.getOutputFacing()); +/* 81: */ } +/* 82: */ } +/* 83: */ +/* 84: */ @Override +public String getName() +/* 85: */ { +/* 86:65 */ return "Timer"; +/* 87: */ } +/* 88: */ +/* 89: */ @Override +public String getDescription() +/* 90: */ { +/* 91:70 */ return "Pulses Redstone"; +/* 92: */ } +/* 93: */ +/* 94: */ @Override +public String getDataDescription(int[] aCircuitData, int aCircuitDataIndex) +/* 95: */ { +/* 96:75 */ switch (aCircuitDataIndex) +/* 97: */ { +/* 98: */ case 0: +/* 99:76 */ return "Delay"; +/* :0: */ case 1: +/* :1:77 */ return "Pulses"; +/* :2: */ case 2: +/* :3:78 */ return "Length"; +/* :4: */ case 3: +/* :5:79 */ return aCircuitData[aCircuitDataIndex] == 1 ? "RS => ON" : "RS => OFF"; +/* :6: */ case 4: +/* :7:80 */ return "Time"; +/* :8: */ } +/* :9:82 */ return ""; +/* ;0: */ } +/* ;1: */ +/* ;2: */ @Override +public boolean displayItemStack(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock, int aIndex) +/* ;3: */ { +/* ;4:87 */ return false; +/* ;5: */ } +/* ;6: */ +/* ;7: */ @Override +public String getDataDisplay(int[] aCircuitData, int aCircuitDataIndex) +/* ;8: */ { +/* ;9:92 */ if (aCircuitDataIndex == 3) { +/* <0:92 */ return ""; +/* <1: */ } +/* <2:93 */ return null; +/* <3: */ } +/* <4: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.redstonecircuits.GT_Circuit_Timer + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ChestBuffer.java b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ChestBuffer.java new file mode 100644 index 0000000..b31f32d --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ChestBuffer.java @@ -0,0 +1,86 @@ +/* 1: */ package gregtech.common.tileentities.automation; +/* 2: */ +/* 3: */ import gregtech.api.enums.Textures; +/* 4: */ import gregtech.api.interfaces.ITexture; +/* 5: */ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +/* 6: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 7: */ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Buffer; +/* 8: */ import gregtech.api.objects.GT_RenderedTexture; +/* 9: */ import gregtech.api.util.GT_Utility; +/* 10: */ import gregtech.common.gui.GT_Container_ChestBuffer; +/* 11: */ import gregtech.common.gui.GT_GUIContainer_ChestBuffer; +/* 12: */ import net.minecraft.entity.player.InventoryPlayer; +/* 13: */ +/* 14: */ public class GT_MetaTileEntity_ChestBuffer +/* 15: */ extends GT_MetaTileEntity_Buffer +/* 16: */ { +/* 17: */ public GT_MetaTileEntity_ChestBuffer(int aID, String aName, String aNameRegional, int aTier) +/* 18: */ { +/* 19:16 */ super(aID, aName, aNameRegional, aTier, 28, "Buffering lots of incoming Items"); +/* 20: */ } +/* 21: */ +/* 22: */ public GT_MetaTileEntity_ChestBuffer(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String aDescription) +/* 23: */ { +/* 24:20 */ super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription); +/* 25: */ } +/* 26: */ +/* 27: */ public GT_MetaTileEntity_ChestBuffer(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) +/* 28: */ { +/* 29:24 */ super(aName, aTier, aInvSlotCount, aDescription, aTextures); +/* 30: */ } +/* 31: */ +/* 32: */ @Override +public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) +/* 33: */ { +/* 34:29 */ return new GT_MetaTileEntity_ChestBuffer(this.mName, this.mTier, this.mInventory.length, this.mDescription, this.mTextures); +/* 35: */ } +/* 36: */ +/* 37: */ @Override +public ITexture getOverlayIcon() +/* 38: */ { +/* 39:34 */ return new GT_RenderedTexture(Textures.BlockIcons.AUTOMATION_CHESTBUFFER); +/* 40: */ } +/* 41: */ +/* 42: */ @Override +public boolean isValidSlot(int aIndex) +/* 43: */ { +/* 44:37 */ return aIndex < this.mInventory.length - 1; +/* 45: */ } +/* 46: */ +/* 47: */ @Override +protected void moveItems(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) +/* 48: */ { +/* 49:41 */ fillStacksIntoFirstSlots(); +/* 50:42 */ super.moveItems(aBaseMetaTileEntity, aTimer); +/* 51:43 */ fillStacksIntoFirstSlots(); +/* 52: */ } +/* 53: */ +/* 54: */ protected void fillStacksIntoFirstSlots() +/* 55: */ { +/* 56:47 */ for (int i = 0; i < this.mInventory.length - 1; i++) { +/* 57:47 */ for (int j = i + 1; j < this.mInventory.length - 1; j++) { +/* 58:47 */ if ((this.mInventory[j] != null) && ((this.mInventory[i] == null) || (GT_Utility.areStacksEqual(this.mInventory[i], this.mInventory[j])))) { +/* 59:48 */ GT_Utility.moveStackFromSlotAToSlotB(getBaseMetaTileEntity(), getBaseMetaTileEntity(), j, i, (byte)64, (byte)1, (byte)64, (byte)1); +/* 60: */ } +/* 61: */ } +/* 62: */ } +/* 63: */ } +/* 64: */ +/* 65: */ @Override +public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) +/* 66: */ { +/* 67:54 */ return new GT_Container_ChestBuffer(aPlayerInventory, aBaseMetaTileEntity); +/* 68: */ } +/* 69: */ +/* 70: */ @Override +public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) +/* 71: */ { +/* 72:59 */ return new GT_GUIContainer_ChestBuffer(aPlayerInventory, aBaseMetaTileEntity); +/* 73: */ } +/* 74: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.tileentities.automation.GT_MetaTileEntity_ChestBuffer + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Filter.java b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Filter.java new file mode 100644 index 0000000..6e6fcdc --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Filter.java @@ -0,0 +1,101 @@ +/* 1: */ package gregtech.common.tileentities.automation; +/* 2: */ +/* 3: */ import gregtech.api.enums.Textures; +/* 4: */ import gregtech.api.interfaces.ITexture; +/* 5: */ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +/* 6: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 7: */ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Buffer; +/* 8: */ import gregtech.api.objects.GT_RenderedTexture; +/* 9: */ import gregtech.api.util.GT_Utility; +/* 10: */ import gregtech.common.gui.GT_Container_Filter; +/* 11: */ import gregtech.common.gui.GT_GUIContainer_Filter; +/* 12: */ import net.minecraft.entity.player.InventoryPlayer; +/* 13: */ import net.minecraft.item.ItemStack; +/* 14: */ import net.minecraft.nbt.NBTTagCompound; +/* 15: */ +/* 16: */ public class GT_MetaTileEntity_Filter +/* 17: */ extends GT_MetaTileEntity_Buffer +/* 18: */ { +/* 19:17 */ public boolean bIgnoreNBT = false; +/* 20:17 */ public boolean bInvertFilter = false; +/* 21: */ +/* 22: */ public GT_MetaTileEntity_Filter(int aID, String aName, String aNameRegional, int aTier) +/* 23: */ { +/* 24:20 */ super(aID, aName, aNameRegional, aTier, 19, "Filtering incoming Items"); +/* 25: */ } +/* 26: */ +/* 27: */ public GT_MetaTileEntity_Filter(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) +/* 28: */ { +/* 29:24 */ super(aName, aTier, aInvSlotCount, aDescription, aTextures); +/* 30: */ } +/* 31: */ +/* 32: */ @Override +public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) +/* 33: */ { +/* 34:29 */ return new GT_MetaTileEntity_Filter(this.mName, this.mTier, this.mInventory.length, this.mDescription, this.mTextures); +/* 35: */ } +/* 36: */ +/* 37: */ @Override +public ITexture getOverlayIcon() +/* 38: */ { +/* 39:34 */ return new GT_RenderedTexture(Textures.BlockIcons.AUTOMATION_FILTER); +/* 40: */ } +/* 41: */ +/* 42: */ @Override +public boolean isValidSlot(int aIndex) +/* 43: */ { +/* 44:37 */ return aIndex < 9; +/* 45: */ } +/* 46: */ +/* 47: */ @Override +public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) +/* 48: */ { +/* 49:41 */ return new GT_Container_Filter(aPlayerInventory, aBaseMetaTileEntity); +/* 50: */ } +/* 51: */ +/* 52: */ @Override +public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) +/* 53: */ { +/* 54:46 */ return new GT_GUIContainer_Filter(aPlayerInventory, aBaseMetaTileEntity); +/* 55: */ } +/* 56: */ +/* 57: */ @Override +public void saveNBTData(NBTTagCompound aNBT) +/* 58: */ { +/* 59:51 */ super.saveNBTData(aNBT); +/* 60:52 */ aNBT.setBoolean("bInvertFilter", this.bInvertFilter); +/* 61:53 */ aNBT.setBoolean("bIgnoreNBT", this.bIgnoreNBT); +/* 62: */ } +/* 63: */ +/* 64: */ @Override +public void loadNBTData(NBTTagCompound aNBT) +/* 65: */ { +/* 66:58 */ super.loadNBTData(aNBT); +/* 67:59 */ this.bInvertFilter = aNBT.getBoolean("bInvertFilter"); +/* 68:60 */ this.bIgnoreNBT = aNBT.getBoolean("bIgnoreNBT"); +/* 69: */ } +/* 70: */ +/* 71: */ @Override +public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) +/* 72: */ { +/* 73:65 */ if (!super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) { +/* 74:65 */ return false; +/* 75: */ } +/* 76:66 */ if (this.bInvertFilter) +/* 77: */ { +/* 78:67 */ for (byte i = 9; i < 18; i = (byte)(i + 1)) { +/* 79:67 */ if (GT_Utility.areStacksEqual(this.mInventory[i], aStack, this.bIgnoreNBT)) { +/* 80:67 */ return false; +/* 81: */ } +/* 82: */ } +/* 83:68 */ return true; +/* 84: */ } +/* 85:70 */ return GT_Utility.areStacksEqual(this.mInventory[(aIndex + 9)], aStack, this.bIgnoreNBT); +/* 86: */ } +/* 87: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.tileentities.automation.GT_MetaTileEntity_Filter + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Regulator.java b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Regulator.java new file mode 100644 index 0000000..c03c2e1 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Regulator.java @@ -0,0 +1,120 @@ +/* 1: */ package gregtech.common.tileentities.automation; +/* 12: */ import java.util.Arrays; + +/* 2: */ +/* 3: */ import gregtech.api.enums.Textures; +/* 4: */ import gregtech.api.interfaces.ITexture; +/* 5: */ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +/* 6: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 7: */ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Buffer; +/* 8: */ import gregtech.api.objects.GT_RenderedTexture; +/* 9: */ import gregtech.api.util.GT_Utility; +/* 10: */ import gregtech.common.gui.GT_Container_Regulator; +/* 11: */ import gregtech.common.gui.GT_GUIContainer_Regulator; +/* 13: */ import net.minecraft.entity.player.InventoryPlayer; +/* 14: */ import net.minecraft.item.ItemStack; +/* 15: */ import net.minecraft.nbt.NBTTagCompound; +/* 16: */ +/* 17: */ public class GT_MetaTileEntity_Regulator +/* 18: */ extends GT_MetaTileEntity_Buffer +/* 19: */ { +/* 20:20 */ public int[] mTargetSlots = { 0, 0, 0, 0, 0, 0, 0, 0, 0 }; +/* 21: */ +/* 22: */ public GT_MetaTileEntity_Regulator(int aID, String aName, String aNameRegional, int aTier) +/* 23: */ { +/* 24:23 */ super(aID, aName, aNameRegional, aTier, 19, "Regulating incoming Items"); +/* 25: */ } +/* 26: */ +/* 27: */ public GT_MetaTileEntity_Regulator(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) +/* 28: */ { +/* 29:27 */ super(aName, aTier, aInvSlotCount, aDescription, aTextures); +/* 30: */ } +/* 31: */ +/* 32: */ @Override +public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) +/* 33: */ { +/* 34:32 */ return new GT_MetaTileEntity_Regulator(this.mName, this.mTier, this.mInventory.length, this.mDescription, this.mTextures); +/* 35: */ } +/* 36: */ +/* 37: */ @Override +public ITexture getOverlayIcon() +/* 38: */ { +/* 39:37 */ return new GT_RenderedTexture(Textures.BlockIcons.AUTOMATION_REGULATOR); +/* 40: */ } +/* 41: */ +/* 42: */ @Override +public boolean isValidSlot(int aIndex) +/* 43: */ { +/* 44:40 */ return aIndex < 9; +/* 45: */ } +/* 46: */ +/* 47: */ @Override +public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) +/* 48: */ { +/* 49:44 */ return new GT_Container_Regulator(aPlayerInventory, aBaseMetaTileEntity); +/* 50: */ } +/* 51: */ +/* 52: */ @Override +public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) +/* 53: */ { +/* 54:49 */ return new GT_GUIContainer_Regulator(aPlayerInventory, aBaseMetaTileEntity); +/* 55: */ } +/* 56: */ +/* 57: */ @Override +public void saveNBTData(NBTTagCompound aNBT) +/* 58: */ { +/* 59:54 */ super.saveNBTData(aNBT); +/* 60:55 */ aNBT.setInteger("mTargetSlot1", this.mTargetSlots[0]); +/* 61:56 */ aNBT.setInteger("mTargetSlot2", this.mTargetSlots[1]); +/* 62:57 */ aNBT.setInteger("mTargetSlot3", this.mTargetSlots[2]); +/* 63:58 */ aNBT.setInteger("mTargetSlot4", this.mTargetSlots[3]); +/* 64:59 */ aNBT.setInteger("mTargetSlot5", this.mTargetSlots[4]); +/* 65:60 */ aNBT.setInteger("mTargetSlot6", this.mTargetSlots[5]); +/* 66:61 */ aNBT.setInteger("mTargetSlot7", this.mTargetSlots[6]); +/* 67:62 */ aNBT.setInteger("mTargetSlot8", this.mTargetSlots[7]); +/* 68:63 */ aNBT.setInteger("mTargetSlot9", this.mTargetSlots[8]); +/* 69: */ } +/* 70: */ +/* 71: */ @Override +public void loadNBTData(NBTTagCompound aNBT) +/* 72: */ { +/* 73:68 */ super.loadNBTData(aNBT); +/* 74:69 */ this.mTargetSlots[0] = aNBT.getInteger("mTargetSlot1"); +/* 75:70 */ this.mTargetSlots[1] = aNBT.getInteger("mTargetSlot2"); +/* 76:71 */ this.mTargetSlots[2] = aNBT.getInteger("mTargetSlot3"); +/* 77:72 */ this.mTargetSlots[3] = aNBT.getInteger("mTargetSlot4"); +/* 78:73 */ this.mTargetSlots[4] = aNBT.getInteger("mTargetSlot5"); +/* 79:74 */ this.mTargetSlots[5] = aNBT.getInteger("mTargetSlot6"); +/* 80:75 */ this.mTargetSlots[6] = aNBT.getInteger("mTargetSlot7"); +/* 81:76 */ this.mTargetSlots[7] = aNBT.getInteger("mTargetSlot8"); +/* 82:77 */ this.mTargetSlots[8] = aNBT.getInteger("mTargetSlot9"); +/* 83: */ } +/* 84: */ +/* 85: */ @Override +public void moveItems(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) +/* 86: */ { +/* 87:82 */ int i = 0; +/* 88:82 */ for (int tCosts = 0; i < 9; i++) { +/* 89:82 */ if (this.mInventory[(i + 9)] != null) +/* 90: */ { +/* 91:83 */ tCosts = GT_Utility.moveOneItemStackIntoSlot(getBaseMetaTileEntity(), getBaseMetaTileEntity().getTileEntityAtSide(getBaseMetaTileEntity().getBackFacing()), getBaseMetaTileEntity().getBackFacing(), this.mTargetSlots[i], Arrays.asList(new ItemStack[] { this.mInventory[(i + 9)] }), false, (byte)this.mInventory[(i + 9)].stackSize, (byte)this.mInventory[(i + 9)].stackSize, (byte)64, (byte)1) * 3; +/* 92:84 */ if (tCosts > 0) +/* 93: */ { +/* 94:84 */ this.mSuccess = 50;getBaseMetaTileEntity().decreaseStoredEnergyUnits(tCosts, true); break; +/* 95: */ } +/* 96: */ } +/* 97: */ } +/* 98: */ } +/* 99: */ +/* :0: */ @Override +public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) +/* :1: */ { +/* :2:90 */ return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (GT_Utility.areStacksEqual(aStack, this.mInventory[(aIndex + 9)])); +/* :3: */ } +/* :4: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.tileentities.automation.GT_MetaTileEntity_Regulator + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_SuperBuffer.java b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_SuperBuffer.java new file mode 100644 index 0000000..c5fc5a2 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_SuperBuffer.java @@ -0,0 +1,54 @@ +/* 1: */ package gregtech.common.tileentities.automation; +/* 2: */ +/* 3: */ import gregtech.api.enums.Textures; +/* 4: */ import gregtech.api.interfaces.ITexture; +/* 5: */ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +/* 6: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 7: */ import gregtech.api.objects.GT_RenderedTexture; +/* 8: */ import gregtech.common.gui.GT_Container_SuperBuffer; +/* 9: */ import gregtech.common.gui.GT_GUIContainer_SuperBuffer; +/* 10: */ import net.minecraft.entity.player.InventoryPlayer; +/* 11: */ +/* 12: */ public class GT_MetaTileEntity_SuperBuffer +/* 13: */ extends GT_MetaTileEntity_ChestBuffer +/* 14: */ { +/* 15: */ public GT_MetaTileEntity_SuperBuffer(int aID, String aName, String aNameRegional, int aTier) +/* 16: */ { +/* 17:14 */ super(aID, aName, aNameRegional, aTier, 257, "Buffering up to 256 Stacks"); +/* 18: */ } +/* 19: */ +/* 20: */ public GT_MetaTileEntity_SuperBuffer(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) +/* 21: */ { +/* 22:18 */ super(aName, aTier, aInvSlotCount, aDescription, aTextures); +/* 23: */ } +/* 24: */ +/* 25: */ @Override +public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) +/* 26: */ { +/* 27:23 */ return new GT_MetaTileEntity_SuperBuffer(this.mName, this.mTier, this.mInventory.length, this.mDescription, this.mTextures); +/* 28: */ } +/* 29: */ +/* 30: */ @Override +public ITexture getOverlayIcon() +/* 31: */ { +/* 32:28 */ return new GT_RenderedTexture(Textures.BlockIcons.AUTOMATION_SUPERBUFFER); +/* 33: */ } +/* 34: */ +/* 35: */ @Override +public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) +/* 36: */ { +/* 37:33 */ return new GT_Container_SuperBuffer(aPlayerInventory, aBaseMetaTileEntity); +/* 38: */ } +/* 39: */ +/* 40: */ @Override +public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) +/* 41: */ { +/* 42:38 */ return new GT_GUIContainer_SuperBuffer(aPlayerInventory, aBaseMetaTileEntity); +/* 43: */ } +/* 44: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.tileentities.automation.GT_MetaTileEntity_SuperBuffer + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_TypeFilter.java b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_TypeFilter.java new file mode 100644 index 0000000..8c42649 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_TypeFilter.java @@ -0,0 +1,145 @@ +/* 1: */ package gregtech.common.tileentities.automation; +/* 2: */ +/* 3: */ import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.Textures; +/* 5: */ import gregtech.api.interfaces.ITexture; +/* 6: */ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +/* 7: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 8: */ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Buffer; +/* 9: */ import gregtech.api.objects.GT_RenderedTexture; +/* 10: */ import gregtech.api.util.GT_Utility; +/* 11: */ import gregtech.common.gui.GT_Container_TypeFilter; +/* 12: */ import gregtech.common.gui.GT_GUIContainer_TypeFilter; +/* 14: */ import net.minecraft.entity.player.InventoryPlayer; +/* 15: */ import net.minecraft.item.ItemStack; +/* 16: */ import net.minecraft.nbt.NBTTagCompound; +/* 17: */ +/* 18: */ public class GT_MetaTileEntity_TypeFilter +/* 19: */ extends GT_MetaTileEntity_Buffer +/* 20: */ { +/* 21: 19 */ public boolean bNBTAllowed = false; +/* 22: 19 */ public boolean bInvertFilter = false; +/* 23: 20 */ public int mRotationIndex = 0; +/* 24: 21 */ public OrePrefixes mPrefix = OrePrefixes.ore; +/* 25: */ +/* 26: */ public GT_MetaTileEntity_TypeFilter(int aID, String aName, String aNameRegional, int aTier) +/* 27: */ { +/* 28: 24 */ super(aID, aName, aNameRegional, aTier, 11, "Filtering incoming Items by Type"); +/* 29: */ } +/* 30: */ +/* 31: */ public GT_MetaTileEntity_TypeFilter(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) +/* 32: */ { +/* 33: 28 */ super(aName, aTier, aInvSlotCount, aDescription, aTextures); +/* 34: */ } +/* 35: */ +/* 36: */ @Override +public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) +/* 37: */ { +/* 38: 33 */ return new GT_MetaTileEntity_TypeFilter(this.mName, this.mTier, this.mInventory.length, this.mDescription, this.mTextures); +/* 39: */ } +/* 40: */ +/* 41: */ @Override +public ITexture getOverlayIcon() +/* 42: */ { +/* 43: 38 */ return new GT_RenderedTexture(Textures.BlockIcons.AUTOMATION_TYPEFILTER); +/* 44: */ } +/* 45: */ +/* 46: */ @Override +public boolean isValidSlot(int aIndex) +/* 47: */ { +/* 48: 41 */ return aIndex < 9; +/* 49: */ } +/* 50: */ +/* 51: */ @Override +public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) +/* 52: */ { +/* 53: 45 */ return new GT_Container_TypeFilter(aPlayerInventory, aBaseMetaTileEntity); +/* 54: */ } +/* 55: */ +/* 56: */ @Override +public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) +/* 57: */ { +/* 58: 50 */ return new GT_GUIContainer_TypeFilter(aPlayerInventory, aBaseMetaTileEntity); +/* 59: */ } +/* 60: */ +/* 61: */ public void clickTypeIcon(boolean aRightClick) +/* 62: */ { +/* 63: 54 */ if (getBaseMetaTileEntity().isServerSide()) +/* 64: */ { +/* 65: 55 */ for (int i = 0; i < OrePrefixes.values().length; i++) { +/* 66: 56 */ if (this.mPrefix == OrePrefixes.values()[i]) { +/* 67: 57 */ for (this.mPrefix = null; this.mPrefix == null; this.mPrefix = OrePrefixes.values()[i]) +/* 68: */ { +/* 70: 59 */ if (aRightClick) +/* 71: */ { +/* 72: 60 */ i--; +/* 73: 60 */ if (i < 0) { +/* 74: 60 */ i = OrePrefixes.values().length - 1; +/* 75: */ } +/* 76: */ } +/* 77: */ else +/* 78: */ { +/* 79: 62 */ i++; +/* 80: 62 */ if (i >= OrePrefixes.values().length) { +/* 81: 62 */ i = 0; +/* 82: */ } +/* 83: */ } +/* 84: 64 */ if(!OrePrefixes.values()[i].mPrefixedItems.isEmpty() && OrePrefixes.values()[i].mPrefixInto == OrePrefixes.values()[i]) + mPrefix = OrePrefixes.values()[i]; +/* 87: */ } +/* 88: */ } +/* 89: */ } +/* 90: 69 */ this.mRotationIndex = 0; +/* 91: */ } +/* 92: */ } +/* 93: */ +/* 94: */ @Override +public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) +/* 95: */ { +/* 96: 75 */ super.onPreTick(aBaseMetaTileEntity, aTick); +/* 97: 76 */ if ((getBaseMetaTileEntity().isServerSide()) && (aTick % 8L == 0L)) { +/* 98: 77 */ if (this.mPrefix.mPrefixedItems.isEmpty()) +/* 99: */ { +/* 100: 78 */ this.mInventory[9] = null; +/* 101: */ } +/* 102: */ else +/* 103: */ { +/* 104: 80 */ Object[] tmp63_60 = new Object[1]; int tmp90_89 = ((this.mRotationIndex + 1) % this.mPrefix.mPrefixedItems.size());this.mRotationIndex = tmp90_89;tmp63_60[0] = this.mPrefix.mPrefixedItems.get(tmp90_89);this.mInventory[9] = GT_Utility.copyAmount(1L, tmp63_60); +/* 105: 81 */ if (this.mInventory[9].getItemDamage() == 32767) { +/* 106: 81 */ this.mInventory[9].setItemDamage(0); +/* 107: */ } +/* 108: 82 */ this.mInventory[9].setStackDisplayName(this.mPrefix.toString()); +/* 109: */ } +/* 110: */ } +/* 111: */ } +/* 112: */ +/* 113: */ @Override +public void saveNBTData(NBTTagCompound aNBT) +/* 114: */ { +/* 115: 89 */ super.saveNBTData(aNBT); +/* 116: 90 */ aNBT.setString("mPrefix", this.mPrefix.toString()); +/* 117: 91 */ aNBT.setBoolean("bInvertFilter", this.bInvertFilter); +/* 118: 92 */ aNBT.setBoolean("bNBTAllowed", this.bNBTAllowed); +/* 119: */ } +/* 120: */ +/* 121: */ @Override +public void loadNBTData(NBTTagCompound aNBT) +/* 122: */ { +/* 123: 97 */ super.loadNBTData(aNBT); +/* 124: 98 */ this.mPrefix = OrePrefixes.getPrefix(aNBT.getString("mPrefix"), this.mPrefix); +/* 125: 99 */ this.bInvertFilter = aNBT.getBoolean("bInvertFilter"); +/* 126:100 */ this.bNBTAllowed = aNBT.getBoolean("bNBTAllowed"); +/* 127: */ } +/* 128: */ +/* 129: */ @Override +public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) +/* 130: */ { +/* 131:105 */ return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && ((this.bNBTAllowed) || (!aStack.hasTagCompound())) && (this.mPrefix.contains(aStack) != this.bInvertFilter); +/* 132: */ } +/* 133: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.tileentities.automation.GT_MetaTileEntity_TypeFilter + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler.java new file mode 100644 index 0000000..8fce193 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler.java @@ -0,0 +1,356 @@ +package gregtech.common.tileentities.boilers; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank; +import gregtech.api.objects.GT_ItemStack; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Utility; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.IFluidHandler; + +public abstract class GT_MetaTileEntity_Boiler + extends GT_MetaTileEntity_BasicTank +{ + public int mTemperature = 20; + public int mProcessingEnergy = 0; + public int mLossTimer = 0; + public FluidStack mSteam = null; + public boolean mHadNoWater = false; + + public GT_MetaTileEntity_Boiler(int aID, String aName, String aNameRegional, String aDescription, ITexture... aTextures) + { + super(aID, aName, aNameRegional, 0, 4, aDescription, aTextures); + } + + public GT_MetaTileEntity_Boiler(String aName, int aTier, String aDescription, ITexture[][][] aTextures) + { + super(aName, aTier, 4, aDescription, aTextures); + } + + @Override +public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) + { + ITexture[] tmp = mTextures[aSide >= 2 ? aSide != aFacing ? 2 : ((byte)(aActive ? 4 : 3)) : aSide][aColorIndex + 1]; + //mTextures[(aSide==aFacing?(aActive?4:3):aSide==GT_Utility.getOppositeSide(aFacing)?2:aSide==0?0:aSide==1?1:2)][aColorIndex+1]; + if(aSide!=aFacing&&tmp.length==2){ + tmp = new ITexture[]{tmp[0]}; + } + return tmp; + } + + @Override +public boolean isElectric() + { + return false; + } + + @Override +public boolean isPneumatic() + { + return false; + } + + @Override +public boolean isSteampowered() + { + return false; + } + + @Override +public boolean isSimpleMachine() + { + return false; + } + + @Override +public boolean isFacingValid(byte aFacing) + { + return aFacing > 1; + } + + @Override +public boolean isAccessAllowed(EntityPlayer aPlayer) + { + return true; + } + + @Override +public boolean isValidSlot(int aIndex) + { + return true; + } + + @Override +public int getProgresstime() + { + return this.mTemperature; + } + + @Override +public int maxProgresstime() + { + return 500; + } + + @Override +public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) + { + if (aBaseMetaTileEntity.isClientSide()) { + return true; + } + if (aPlayer != null) { + if (GT_Utility.areStacksEqual(aPlayer.getCurrentEquippedItem(), new ItemStack(Items.water_bucket, 1))) + { + fill(Materials.Water.getFluid(1000 * aPlayer.getCurrentEquippedItem().stackSize), true); + aPlayer.getCurrentEquippedItem().func_150996_a(Items.bucket); + } + else + { + aBaseMetaTileEntity.openGUI(aPlayer); + } + } + return true; + } + + @Override +public boolean doesFillContainers() + { + return true; + } + + @Override +public boolean doesEmptyContainers() + { + return true; + } + + @Override +public boolean canTankBeFilled() + { + return true; + } + + @Override +public boolean canTankBeEmptied() + { + return true; + } + + @Override +public boolean displaysItemStack() + { + return false; + } + + @Override +public boolean displaysStackSize() + { + return false; + } + + @Override +public boolean isFluidInputAllowed(FluidStack aFluid) + { + return GT_ModHandler.isWater(aFluid); + } + + @Override +public FluidStack getDrainableStack() + { + return this.mSteam; + } + + @Override +public FluidStack setDrainableStack(FluidStack aFluid) + { + this.mSteam = aFluid;return this.mSteam; + } + + @Override +public boolean allowCoverOnSide(byte aSide, GT_ItemStack aCover) + { + return GregTech_API.getCoverBehavior(aCover.toStack()).isSimpleCover(); + } + + @Override +public void saveNBTData(NBTTagCompound aNBT) + { + super.saveNBTData(aNBT); + aNBT.setInteger("mLossTimer", this.mLossTimer); + aNBT.setInteger("mTemperature", this.mTemperature); + aNBT.setInteger("mProcessingEnergy", this.mProcessingEnergy); + if (this.mSteam != null) { + try + { + aNBT.setTag("mSteam", this.mSteam.writeToNBT(new NBTTagCompound())); + } + catch (Throwable e) {} + } + } + + @Override +public void loadNBTData(NBTTagCompound aNBT) + { + super.loadNBTData(aNBT); + this.mLossTimer = aNBT.getInteger("mLossTimer"); + this.mTemperature = aNBT.getInteger("mTemperature"); + this.mProcessingEnergy = aNBT.getInteger("mProcessingEnergy"); + this.mSteam = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mSteam")); + } + + @Override +public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) + { + if ((aBaseMetaTileEntity.isServerSide()) && (aTick > 20L)) + { + if (this.mTemperature <= 20) + { + this.mTemperature = 20; + this.mLossTimer = 0; + } + if (++this.mLossTimer > 40) + { + this.mTemperature -= 1; + this.mLossTimer = 0; + } + for (byte i = 1; (this.mSteam != null) && (i < 6); i = (byte)(i + 1)) { + if (i != aBaseMetaTileEntity.getFrontFacing()) + { + IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide(i); + if (tTileEntity != null) + { + FluidStack tDrained = aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), Math.max(1, this.mSteam.amount / 2), false); + if (tDrained != null) + { + int tFilledAmount = tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), tDrained, false); + if (tFilledAmount > 0) { + tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), tFilledAmount, true), true); + } + } + } + } + } + if (aTick % 10L == 0L) { + if (this.mTemperature > 100) + { + if ((this.mFluid == null) || (!GT_ModHandler.isWater(this.mFluid)) || (this.mFluid.amount <= 0)) + { + this.mHadNoWater = true; + } + else + { + if (this.mHadNoWater) + { + aBaseMetaTileEntity.doExplosion(2048L); + return; + } + this.mFluid.amount -= 1; + if (this.mSteam == null) { + this.mSteam = GT_ModHandler.getSteam(150L); + } else if (GT_ModHandler.isSteam(this.mSteam)) { + this.mSteam.amount += 150; + } else { + this.mSteam = GT_ModHandler.getSteam(150L); + } + } + } + else { + this.mHadNoWater = false; + } + } + if ((this.mSteam != null) && + (this.mSteam.amount > 32000)) + { + sendSound((byte)1); + this.mSteam.amount = 24000; + } + if ((this.mProcessingEnergy <= 0) && (aBaseMetaTileEntity.isAllowedToWork()) && + (this.mInventory[2] != null)) { + if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.gem.get(Materials.Coal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dust.get(Materials.Coal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dustImpure.get(Materials.Coal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.crushed.get(Materials.Coal)))) + { + this.mProcessingEnergy += 160; + aBaseMetaTileEntity.decrStackSize(2, 1); + if (aBaseMetaTileEntity.getRandomNumber(3) == 0) { + aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 1L)); + } + } + else if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.gem.get(Materials.Charcoal))) + { + this.mProcessingEnergy += 160; + aBaseMetaTileEntity.decrStackSize(2, 1); + if (aBaseMetaTileEntity.getRandomNumber(3) == 0) { + aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 1L)); + } + } + else if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelCoke")) + { + this.mProcessingEnergy += 640; + aBaseMetaTileEntity.decrStackSize(2, 1); + if (aBaseMetaTileEntity.getRandomNumber(2) == 0) { + aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 1L)); + } + } + else if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.gem.get(Materials.Lignite))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dust.get(Materials.Lignite))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dustImpure.get(Materials.Lignite))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.crushed.get(Materials.Lignite)))) + { + this.mProcessingEnergy += 40; + aBaseMetaTileEntity.decrStackSize(2, 1); + if (aBaseMetaTileEntity.getRandomNumber(8) == 0) { + aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 1L)); + } + } + } + if ((this.mTemperature < 1000) && (this.mProcessingEnergy > 0) && (aTick % 12L == 0L)) + { + this.mProcessingEnergy -= 2; + this.mTemperature += 1; + } + aBaseMetaTileEntity.setActive(this.mProcessingEnergy > 0); + } + } + + @Override +public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) + { + return (aIndex == 1) || (aIndex == 3); + } + + @Override +public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) + { + return aIndex == 2; + } + + @Override +public void doSound(byte aIndex, double aX, double aY, double aZ) + { + if (aIndex == 1) + { + GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(Integer.valueOf(4)), 2, 1.0F, aX, aY, aZ); + for (int l = 0; l < 8; l++) { + getBaseMetaTileEntity().getWorld().spawnParticle("largesmoke", aX - 0.5D + Math.random(), aY, aZ - 0.5D + Math.random(), 0.0D, 0.0D, 0.0D); + } + } + } + + @Override +public int getCapacity() + { + return 16000; + } + + @Override +public int getTankPressure() + { + return 100; + } +} diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java new file mode 100644 index 0000000..c0ef2e3 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java @@ -0,0 +1,181 @@ +package gregtech.common.tileentities.boilers; + +import gregtech.api.enums.Dyes; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.common.gui.GT_Container_Boiler; +import gregtech.common.gui.GT_GUIContainer_Boiler; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.IFluidHandler; + +public class GT_MetaTileEntity_Boiler_Bronze + extends GT_MetaTileEntity_Boiler +{ + public GT_MetaTileEntity_Boiler_Bronze(int aID, String aName, String aNameRegional) + { + super(aID, aName, aNameRegional, "An early way to get Steam Power", new ITexture[0]); + } + + public GT_MetaTileEntity_Boiler_Bronze(String aName, int aTier, String aDescription, ITexture[][][] aTextures) + { + super(aName, aTier, aDescription, aTextures); + } + + @Override +public ITexture[][][] getTextureSet(ITexture[] aTextures) + { + ITexture[][][] rTextures = new ITexture[5][17][]; + for (byte i = -1; i < 16; i++) + { + rTextures[0][(i + 1)] = new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; + rTextures[1][(i + 1)] = new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE) }; + rTextures[2][(i + 1)] = new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE) }; + rTextures[3][(i + 1)] = new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT) }; + rTextures[4][(i + 1)] = new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT_ACTIVE) }; + } + return rTextures; + } + + @Override +public int maxProgresstime() + { + return 500; + } + + @Override +public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) + { + return new GT_Container_Boiler(aPlayerInventory, aBaseMetaTileEntity, 16000); + } + + @Override +public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) + { + return new GT_GUIContainer_Boiler(aPlayerInventory, aBaseMetaTileEntity, "BronzeBoiler.png", 16000); + } + + @Override +public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) + { + return new GT_MetaTileEntity_Boiler_Bronze(this.mName, this.mTier, this.mDescription, this.mTextures); + } + + @Override +public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) + { + if ((aBaseMetaTileEntity.isServerSide()) && (aTick > 20L)) + { + if (this.mTemperature <= 20) + { + this.mTemperature = 20; + this.mLossTimer = 0; + } + if (++this.mLossTimer > 45) + { + this.mTemperature -= 1; + this.mLossTimer = 0; + } + for (byte i = 1; (this.mSteam != null) && (i < 6); i = (byte)(i + 1)) { + if (i != aBaseMetaTileEntity.getFrontFacing()) + { + IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide(i); + if (tTileEntity != null) + { + FluidStack tDrained = aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), Math.max(1, this.mSteam.amount / 2), false); + if (tDrained != null) + { + int tFilledAmount = tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), tDrained, false); + if (tFilledAmount > 0) { + tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), tFilledAmount, true), true); + } + } + } + } + } + if (aTick % 25L == 0L) { + if (this.mTemperature > 100) + { + if ((this.mFluid == null) || (!GT_ModHandler.isWater(this.mFluid)) || (this.mFluid.amount <= 0)) + { + this.mHadNoWater = true; + } + else + { + if (this.mHadNoWater) + { + aBaseMetaTileEntity.doExplosion(2048L); + return; + } + this.mFluid.amount -= 1; + if (this.mSteam == null) { + this.mSteam = GT_ModHandler.getSteam(150L); + } else if (GT_ModHandler.isSteam(this.mSteam)) { + this.mSteam.amount += 150; + } else { + this.mSteam = GT_ModHandler.getSteam(150L); + } + } + } + else { + this.mHadNoWater = false; + } + } + if ((this.mSteam != null) && + (this.mSteam.amount > 16000)) + { + sendSound((byte)1); + this.mSteam.amount = 12000; + } + if ((this.mProcessingEnergy <= 0) && (aBaseMetaTileEntity.isAllowedToWork()) && + (this.mInventory[2] != null)) { + if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.gem.get(Materials.Coal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dust.get(Materials.Coal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dustImpure.get(Materials.Coal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.crushed.get(Materials.Coal)))) + { + this.mProcessingEnergy += 160; + aBaseMetaTileEntity.decrStackSize(2, 1); + if (aBaseMetaTileEntity.getRandomNumber(3) == 0) { + aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 1L)); + } + } + else if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.gem.get(Materials.Charcoal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dust.get(Materials.Charcoal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dustImpure.get(Materials.Charcoal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.crushed.get(Materials.Charcoal)))) + { + this.mProcessingEnergy += 160; + aBaseMetaTileEntity.decrStackSize(2, 1); + if (aBaseMetaTileEntity.getRandomNumber(3) == 0) { + aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 1L)); + } + } + else if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelCoke")) + { + this.mProcessingEnergy += 640; + aBaseMetaTileEntity.decrStackSize(2, 1); + if (aBaseMetaTileEntity.getRandomNumber(2) == 0) { + aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 1L)); + } + } + else if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.gem.get(Materials.Lignite))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dust.get(Materials.Lignite))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dustImpure.get(Materials.Lignite))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.crushed.get(Materials.Lignite)))) + { + this.mProcessingEnergy += 40; + aBaseMetaTileEntity.decrStackSize(2, 1); + if (aBaseMetaTileEntity.getRandomNumber(8) == 0) { + aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 1L)); + } + } + } + if ((this.mTemperature < 500) && (this.mProcessingEnergy > 0) && (aTick % 12L == 0L)) + { + this.mProcessingEnergy -= 1; + this.mTemperature += 1; + } + aBaseMetaTileEntity.setActive(this.mProcessingEnergy > 0); + } + } +} diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Lava.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Lava.java new file mode 100644 index 0000000..e9c654f --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Lava.java @@ -0,0 +1,172 @@ +/* 1: */ package gregtech.common.tileentities.boilers; +/* 2: */ +/* 3: */ import gregtech.api.enums.Dyes; +/* 4: */ import gregtech.api.enums.Materials; +/* 5: */ import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.Textures; +/* 7: */ import gregtech.api.interfaces.ITexture; +/* 8: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 9: */ import gregtech.api.metatileentity.MetaTileEntity; +/* 10: */ import gregtech.api.objects.GT_RenderedTexture; +/* 11: */ import gregtech.api.util.GT_ModHandler; +/* 12: */ import gregtech.api.util.GT_OreDictUnificator; +/* 13: */ import gregtech.common.gui.GT_Container_Boiler; +/* 14: */ import gregtech.common.gui.GT_GUIContainer_Boiler; +/* 15: */ import net.minecraft.entity.player.InventoryPlayer; +/* 16: */ import net.minecraftforge.common.util.ForgeDirection; +/* 17: */ import net.minecraftforge.fluids.FluidStack; +/* 18: */ import net.minecraftforge.fluids.IFluidHandler; +/* 19: */ +/* 20: */ public class GT_MetaTileEntity_Boiler_Lava +/* 21: */ extends GT_MetaTileEntity_Boiler +/* 22: */ { +/* 23: */ public GT_MetaTileEntity_Boiler_Lava(int aID, String aName, String aNameRegional) +/* 24: */ { +/* 25: 22 */ super(aID, aName, aNameRegional, "A Boiler running off Lava", new ITexture[0]); +/* 26: */ } +/* 27: */ +/* 28: */ public GT_MetaTileEntity_Boiler_Lava(String aName, int aTier, String aDescription, ITexture[][][] aTextures) +/* 29: */ { +/* 30: 26 */ super(aName, aTier, aDescription, aTextures); +/* 31: */ } +/* 32: */ +/* 33: */ @Override +public ITexture[][][] getTextureSet(ITexture[] aTextures) +/* 34: */ { +/* 35: 31 */ ITexture[][][] rTextures = new ITexture[5][17][]; +/* 36: 32 */ for (byte i = -1; i < 16; i++){ +/* 38: 33 */ rTextures[0][(i + 1)] = new ITexture [] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; +/* 39: 34 */ rTextures[1][(i + 1)] = new ITexture [] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE) }; +/* 40: 35 */ rTextures[2][(i + 1)] = new ITexture [] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE) }; +/* 41: 36 */ rTextures[3][(i + 1)] = new ITexture [] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.BOILER_LAVA_FRONT) }; +/* 42: 37 */ rTextures[4][(i + 1)] = new ITexture [] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.BOILER_LAVA_FRONT_ACTIVE) }; +/* 43: */ } +/* 44: 39 */ return rTextures; +/* 45: */ } +/* 46: */ +/* 47: */ @Override +public int maxProgresstime() +/* 48: */ { +/* 49: 42 */ return 1000; +/* 50: */ } +/* 51: */ +/* 52: */ @Override +public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) +/* 53: */ { +/* 54: 46 */ return new GT_Container_Boiler(aPlayerInventory, aBaseMetaTileEntity, 32000); +/* 55: */ } +/* 56: */ +/* 57: */ @Override +public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) +/* 58: */ { +/* 59: 51 */ return new GT_GUIContainer_Boiler(aPlayerInventory, aBaseMetaTileEntity, "SteelBoiler.png", 32000); +/* 60: */ } +/* 61: */ +/* 62: */ @Override +public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) +/* 63: */ { +/* 64: 56 */ return new GT_MetaTileEntity_Boiler_Lava(this.mName, this.mTier, this.mDescription, this.mTextures); +/* 65: */ } +/* 66: */ +/* 67: */ @Override +public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) +/* 68: */ { +/* 69: 61 */ if ((aBaseMetaTileEntity.isServerSide()) && (aTick > 20L)) +/* 70: */ { +/* 71: 62 */ if (this.mTemperature <= 20) +/* 72: */ { +/* 73: 63 */ this.mTemperature = 20; +/* 74: 64 */ this.mLossTimer = 0; +/* 75: */ } +/* 76: 67 */ if (++this.mLossTimer > 20) +/* 77: */ { +/* 78: 68 */ this.mTemperature -= 1; +/* 79: 69 */ this.mLossTimer = 0; +/* 80: */ } +/* 81: 72 */ for (byte i = 1; (this.mSteam != null) && (i < 6); i = (byte)(i + 1)) { +/* 82: 72 */ if (i != aBaseMetaTileEntity.getFrontFacing()) +/* 83: */ { +/* 84: 73 */ IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide(i); +/* 85: 74 */ if (tTileEntity != null) +/* 86: */ { +/* 87: 75 */ FluidStack tDrained = aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), Math.max(1, this.mSteam.amount / 2), false); +/* 88: 76 */ if (tDrained != null) +/* 89: */ { +/* 90: 77 */ int tFilledAmount = tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), tDrained, false); +/* 91: 78 */ if (tFilledAmount > 0) { +/* 92: 79 */ tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), tFilledAmount, true), true); +/* 93: */ } +/* 94: */ } +/* 95: */ } +/* 96: */ } +/* 97: */ } +/* 98: 85 */ if (aTick % 10L == 0L) { +/* 99: 86 */ if (this.mTemperature > 100) +/* 100: */ { +/* 101: 87 */ if ((this.mFluid == null) || (!GT_ModHandler.isWater(this.mFluid)) || (this.mFluid.amount <= 0)) +/* 102: */ { +/* 103: 88 */ this.mHadNoWater = true; +/* 104: */ } +/* 105: */ else +/* 106: */ { +/* 107: 90 */ if (this.mHadNoWater) +/* 108: */ { +/* 109: 91 */ aBaseMetaTileEntity.doExplosion(2048L); +/* 110: 92 */ return; +/* 111: */ } +/* 112: 94 */ this.mFluid.amount -= 1; +/* 113: 95 */ if (this.mSteam == null) { +/* 114: 96 */ this.mSteam = GT_ModHandler.getSteam(300L); +/* 115: 98 */ } else if (GT_ModHandler.isSteam(this.mSteam)) { +/* 116: 99 */ this.mSteam.amount += 300; +/* 117: */ } else { +/* 118:101 */ this.mSteam = GT_ModHandler.getSteam(300L); +/* 119: */ } +/* 120: */ } +/* 121: */ } +/* 122: */ else { +/* 123:106 */ this.mHadNoWater = false; +/* 124: */ } +/* 125: */ } +/* 126:110 */ if ((this.mSteam != null) && +/* 127:111 */ (this.mSteam.amount > 32000)) +/* 128: */ { +/* 129:112 */ sendSound((byte)1); +/* 130:113 */ this.mSteam.amount = 24000; +/* 131: */ } +/* 132:117 */ if ((this.mProcessingEnergy <= 0) && (aBaseMetaTileEntity.isAllowedToWork()) && +/* 133:118 */ (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.bucket.get(Materials.Lava)))) +/* 134: */ { +/* 135:119 */ this.mProcessingEnergy += 1000; +/* 136:120 */ aBaseMetaTileEntity.decrStackSize(2, 1); +/* 137:121 */ aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.bucket, Materials.Empty, 1L)); +/* 138: */ } +/* 139:125 */ if ((this.mTemperature < 1000) && (this.mProcessingEnergy > 0) && (aTick % 8L == 0L)) +/* 140: */ { +/* 141:126 */ this.mProcessingEnergy -= 2; +/* 142:127 */ this.mTemperature += 1; +/* 143: */ } +/* 144:130 */ aBaseMetaTileEntity.setActive(this.mProcessingEnergy > 0); +/* 145: */ } +/* 146: */ } +/* 147: */ +/* 148: */ @Override +public final int fill(FluidStack aFluid, boolean doFill) +/* 149: */ { +/* 150:136 */ if ((GT_ModHandler.isLava(aFluid)) && (this.mProcessingEnergy < 50)) +/* 151: */ { +/* 152:137 */ int tFilledAmount = Math.min(50, aFluid.amount); +/* 153:138 */ if (doFill) { +/* 154:138 */ this.mProcessingEnergy += tFilledAmount; +/* 155: */ } +/* 156:139 */ return tFilledAmount; +/* 157: */ } +/* 158:141 */ return super.fill(aFluid, doFill); +/* 159: */ } +/* 160: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.tileentities.boilers.GT_MetaTileEntity_Boiler_Lava + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar.java new file mode 100644 index 0000000..392951a --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar.java @@ -0,0 +1,161 @@ +/* 1: */ package gregtech.common.tileentities.boilers; +/* 2: */ +/* 3: */ import gregtech.api.enums.Dyes; +import gregtech.api.enums.Textures; +/* 5: */ import gregtech.api.interfaces.ITexture; +/* 6: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 7: */ import gregtech.api.metatileentity.MetaTileEntity; +/* 8: */ import gregtech.api.objects.GT_RenderedTexture; +/* 9: */ import gregtech.api.util.GT_ModHandler; +/* 10: */ import gregtech.common.gui.GT_Container_Boiler; +/* 11: */ import gregtech.common.gui.GT_GUIContainer_Boiler; +/* 12: */ import net.minecraft.entity.player.InventoryPlayer; +/* 15: */ import net.minecraftforge.common.util.ForgeDirection; +/* 16: */ import net.minecraftforge.fluids.FluidStack; +/* 17: */ import net.minecraftforge.fluids.IFluidHandler; +/* 18: */ +/* 19: */ public class GT_MetaTileEntity_Boiler_Solar +/* 20: */ extends GT_MetaTileEntity_Boiler +/* 21: */ { +/* 22: */ public GT_MetaTileEntity_Boiler_Solar(int aID, String aName, String aNameRegional) +/* 23: */ { +/* 24: 19 */ super(aID, aName, aNameRegional, "Steam Power by the Sun", new ITexture[0]); +/* 25: */ } +/* 26: */ +/* 27: */ public GT_MetaTileEntity_Boiler_Solar(String aName, int aTier, String aDescription, ITexture[][][] aTextures) +/* 28: */ { +/* 29: 23 */ super(aName, aTier, aDescription, aTextures); +/* 30: */ } +/* 31: */ +/* 32: */ @Override +public ITexture[][][] getTextureSet(ITexture[] aTextures) +/* 33: */ { +/* 34: 28 */ ITexture[][][] rTextures = new ITexture[4][17][]; +/* 35: 29 */ for (byte i = -1; i < 16; i = (byte)(i + 1)) +/* 36: */ {ITexture[] tmp0 ={ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; +/* 37: 30 */ rTextures[0][(i + 1)] = tmp0; +/* 38: 31 */ ITexture[] tmp1 ={ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.BOILER_SOLAR) }; + rTextures[1][(i + 1)] = tmp1; +/* 39: 32 */ ITexture[] tmp2 ={ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; + rTextures[2][(i + 1)] = tmp2; +/* 40: 33 */ ITexture[] tmp3 ={ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE) }; + rTextures[3][(i + 1)] = tmp3; +/* 41: */ } +/* 42: 35 */ return rTextures; +/* 43: */ } +/* 44: */ +/* 45: */ @Override +public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) +/* 46: */ { + return mTextures[aSide >= 2 ? ((byte)(aSide != aFacing ? 2 : 3)) : aSide][aColorIndex + 1]; +/* 48: */ } +/* 49: */ +/* 50: */ @Override +public int maxProgresstime() +/* 51: */ { +/* 52: 43 */ return 500; +/* 53: */ } +/* 54: */ +/* 55: */ @Override +public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) +/* 56: */ { +/* 57: 47 */ return new GT_Container_Boiler(aPlayerInventory, aBaseMetaTileEntity, 16000); +/* 58: */ } +/* 59: */ +/* 60: */ @Override +public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) +/* 61: */ { +/* 62: 52 */ return new GT_GUIContainer_Boiler(aPlayerInventory, aBaseMetaTileEntity, "SolarBoiler.png", 16000); +/* 63: */ } +/* 64: */ +/* 65: */ @Override +public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) +/* 66: */ { +/* 67: 57 */ return new GT_MetaTileEntity_Boiler_Solar(this.mName, this.mTier, this.mDescription, this.mTextures); +/* 68: */ } +/* 69: */ +/* 70: */ @Override +public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) +/* 71: */ { +/* 72: 62 */ if ((aBaseMetaTileEntity.isServerSide()) && (aTick > 20L)) +/* 73: */ { +/* 74: 63 */ if (this.mTemperature <= 20) +/* 75: */ { +/* 76: 64 */ this.mTemperature = 20; +/* 77: 65 */ this.mLossTimer = 0; +/* 78: */ } +/* 79: 68 */ if (++this.mLossTimer > 45) +/* 80: */ { +/* 81: 69 */ this.mTemperature -= 1; +/* 82: 70 */ this.mLossTimer = 0; +/* 83: */ } +/* 84: 73 */ if (this.mSteam != null) +/* 85: */ { +/* 86: 74 */ byte i = aBaseMetaTileEntity.getFrontFacing(); +/* 87: 75 */ IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide(i); +/* 88: 76 */ if (tTileEntity != null) +/* 89: */ { +/* 90: 77 */ FluidStack tDrained = aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), Math.max(1, this.mSteam.amount / 2), false); +/* 91: 78 */ if (tDrained != null) +/* 92: */ { +/* 93: 79 */ int tFilledAmount = tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), tDrained, false); +/* 94: 80 */ if (tFilledAmount > 0) { +/* 95: 81 */ tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), tFilledAmount, true), true); +/* 96: */ } +/* 97: */ } +/* 98: */ } +/* 99: */ } +/* 100: 87 */ if (aTick % 25L == 0L) { +/* 101: 88 */ if (this.mTemperature > 100) +/* 102: */ { +/* 103: 89 */ if ((this.mFluid == null) || (!GT_ModHandler.isWater(this.mFluid)) || (this.mFluid.amount <= 0)) +/* 104: */ { +/* 105: 90 */ this.mHadNoWater = true; +/* 106: */ } +/* 107: */ else +/* 108: */ { +/* 109: 92 */ if (this.mHadNoWater) +/* 110: */ { +/* 111: 93 */ aBaseMetaTileEntity.doExplosion(2048L); +/* 112: 94 */ return; +/* 113: */ } +/* 114: 96 */ this.mFluid.amount -= 1; +/* 115: 97 */ if (this.mSteam == null) { +/* 116: 98 */ this.mSteam = GT_ModHandler.getSteam(150L); +/* 117:100 */ } else if (GT_ModHandler.isSteam(this.mSteam)) { +/* 118:101 */ this.mSteam.amount += 150; +/* 119: */ } else { +/* 120:103 */ this.mSteam = GT_ModHandler.getSteam(150L); +/* 121: */ } +/* 122: */ } +/* 123: */ } +/* 124: */ else { +/* 125:108 */ this.mHadNoWater = false; +/* 126: */ } +/* 127: */ } +/* 128:112 */ if ((this.mSteam != null) && +/* 129:113 */ (this.mSteam.amount > 16000)) +/* 130: */ { +/* 131:114 */ sendSound((byte)1); +/* 132:115 */ this.mSteam.amount = 12000; +/* 133: */ } +/* 134:119 */ if ((this.mProcessingEnergy <= 0) && (aBaseMetaTileEntity.isAllowedToWork()) && (aTick % 256L == 0L) && (!aBaseMetaTileEntity.getWorld().isThundering())) +/* 135: */ { +/* 136:120 */ boolean bRain = (aBaseMetaTileEntity.getWorld().isRaining()) && (aBaseMetaTileEntity.getBiome().rainfall > 0.0F); +/* 137:121 */ this.mProcessingEnergy += (((!bRain) || (aBaseMetaTileEntity.getWorld().skylightSubtracted < 4)) && (aBaseMetaTileEntity.getSkyAtSide((byte)1)) ? 8 : (bRain) || (!aBaseMetaTileEntity.getWorld().isDaytime()) ? 1 : 0); +/* 138: */ } +/* 139:124 */ if ((this.mTemperature < 500) && (this.mProcessingEnergy > 0) && (aTick % 12L == 0L)) +/* 140: */ { +/* 141:125 */ this.mProcessingEnergy -= 1; +/* 142:126 */ this.mTemperature += 1; +/* 143: */ } +/* 144:129 */ aBaseMetaTileEntity.setActive(this.mProcessingEnergy > 0); +/* 145: */ } +/* 146: */ } +/* 147: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.tileentities.boilers.GT_MetaTileEntity_Boiler_Solar + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Steel.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Steel.java new file mode 100644 index 0000000..938577e --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Steel.java @@ -0,0 +1,191 @@ +/* 1: */ package gregtech.common.tileentities.boilers; +/* 2: */ +/* 3: */ import gregtech.api.enums.Dyes; +/* 4: */ import gregtech.api.enums.Materials; +/* 5: */ import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.Textures; +/* 7: */ import gregtech.api.interfaces.ITexture; +/* 8: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 9: */ import gregtech.api.metatileentity.MetaTileEntity; +/* 10: */ import gregtech.api.objects.GT_RenderedTexture; +/* 11: */ import gregtech.api.util.GT_ModHandler; +/* 12: */ import gregtech.api.util.GT_OreDictUnificator; +/* 13: */ import gregtech.common.gui.GT_Container_Boiler; +/* 14: */ import gregtech.common.gui.GT_GUIContainer_Boiler; +/* 15: */ import net.minecraft.entity.player.InventoryPlayer; +/* 16: */ import net.minecraftforge.common.util.ForgeDirection; +/* 17: */ import net.minecraftforge.fluids.FluidStack; +/* 18: */ import net.minecraftforge.fluids.IFluidHandler; +/* 19: */ +/* 20: */ public class GT_MetaTileEntity_Boiler_Steel +/* 21: */ extends GT_MetaTileEntity_Boiler +/* 22: */ { +/* 23: */ public GT_MetaTileEntity_Boiler_Steel(int aID, String aName, String aNameRegional) +/* 24: */ { +/* 25: 22 */ super(aID, aName, aNameRegional, "Faster than the Bronze Boiler", new ITexture[0]); +/* 26: */ } +/* 27: */ +/* 28: */ public GT_MetaTileEntity_Boiler_Steel(String aName, int aTier, String aDescription, ITexture[][][] aTextures) +/* 29: */ { +/* 30: 26 */ super(aName, aTier, aDescription, aTextures); +/* 31: */ } +/* 32: */ +/* 33: */ @Override +public ITexture[][][] getTextureSet(ITexture[] aTextures) +/* 34: */ { +/* 35: 31 */ ITexture[][][] rTextures = new ITexture[5][17][]; +/* 36: 32 */ for (byte i = -1; i < 16; i = (byte)(i + 1)) +/* 37: */ {ITexture[] tmp0 ={ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; +/* 38: 33 */ rTextures[0][(i + 1)] = tmp0; +/* 39: 34 */ ITexture[] tmp1 ={ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE) }; +rTextures[1][(i + 1)] = tmp1; +/* 40: 35 */ ITexture[] tmp2 ={ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE) }; +rTextures[2][(i + 1)] = tmp2; +/* 41: 36 */ ITexture[] tmp4 ={ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT) }; +rTextures[3][(i + 1)] = tmp4; +/* 42: 37 */ ITexture[] tmp5 ={ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT_ACTIVE) }; +rTextures[4][(i + 1)] = tmp5; +/* 43: */ } +/* 44: 39 */ return rTextures; +/* 45: */ } +/* 46: */ +/* 47: */ @Override +public int maxProgresstime() +/* 48: */ { +/* 49: 42 */ return 1000; +/* 50: */ } +/* 51: */ +/* 52: */ @Override +public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) +/* 53: */ { +/* 54: 46 */ return new GT_Container_Boiler(aPlayerInventory, aBaseMetaTileEntity, 32000); +/* 55: */ } +/* 56: */ +/* 57: */ @Override +public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) +/* 58: */ { +/* 59: 51 */ return new GT_GUIContainer_Boiler(aPlayerInventory, aBaseMetaTileEntity, "SteelBoiler.png", 32000); +/* 60: */ } +/* 61: */ +/* 62: */ @Override +public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) +/* 63: */ { +/* 64: 56 */ return new GT_MetaTileEntity_Boiler_Steel(this.mName, this.mTier, this.mDescription, this.mTextures); +/* 65: */ } +/* 66: */ +/* 67: */ @Override +public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) +/* 68: */ { +/* 69: 61 */ if ((aBaseMetaTileEntity.isServerSide()) && (aTick > 20L)) +/* 70: */ { +/* 71: 62 */ if (this.mTemperature <= 20) +/* 72: */ { +/* 73: 63 */ this.mTemperature = 20; +/* 74: 64 */ this.mLossTimer = 0; +/* 75: */ } +/* 76: 67 */ if (++this.mLossTimer > 40) +/* 77: */ { +/* 78: 68 */ this.mTemperature -= 1; +/* 79: 69 */ this.mLossTimer = 0; +/* 80: */ } +/* 81: 72 */ for (byte i = 1; (this.mSteam != null) && (i < 6); i = (byte)(i + 1)) { +/* 82: 72 */ if (i != aBaseMetaTileEntity.getFrontFacing()) +/* 83: */ { +/* 84: 73 */ IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide(i); +/* 85: 74 */ if (tTileEntity != null) +/* 86: */ { +/* 87: 75 */ FluidStack tDrained = aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), Math.max(1, this.mSteam.amount / 2), false); +/* 88: 76 */ if (tDrained != null) +/* 89: */ { +/* 90: 77 */ int tFilledAmount = tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), tDrained, false); +/* 91: 78 */ if (tFilledAmount > 0) { +/* 92: 79 */ tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), tFilledAmount, true), true); +/* 93: */ } +/* 94: */ } +/* 95: */ } +/* 96: */ } +/* 97: */ } +/* 98: 85 */ if (aTick % 10L == 0L) { +/* 99: 86 */ if (this.mTemperature > 100) +/* 100: */ { +/* 101: 87 */ if ((this.mFluid == null) || (!GT_ModHandler.isWater(this.mFluid)) || (this.mFluid.amount <= 0)) +/* 102: */ { +/* 103: 88 */ this.mHadNoWater = true; +/* 104: */ } +/* 105: */ else +/* 106: */ { +/* 107: 90 */ if (this.mHadNoWater) +/* 108: */ { +/* 109: 91 */ aBaseMetaTileEntity.doExplosion(2048L); +/* 110: 92 */ return; +/* 111: */ } +/* 112: 94 */ this.mFluid.amount -= 1; +/* 113: 95 */ if (this.mSteam == null) { +/* 114: 96 */ this.mSteam = GT_ModHandler.getSteam(150L); +/* 115: 98 */ } else if (GT_ModHandler.isSteam(this.mSteam)) { +/* 116: 99 */ this.mSteam.amount += 150; +/* 117: */ } else { +/* 118:101 */ this.mSteam = GT_ModHandler.getSteam(150L); +/* 119: */ } +/* 120: */ } +/* 121: */ } +/* 122: */ else { +/* 123:106 */ this.mHadNoWater = false; +/* 124: */ } +/* 125: */ } +/* 126:110 */ if ((this.mSteam != null) && +/* 127:111 */ (this.mSteam.amount > 32000)) +/* 128: */ { +/* 129:112 */ sendSound((byte)1); +/* 130:113 */ this.mSteam.amount = 24000; +/* 131: */ } +/* 132:117 */ if ((this.mProcessingEnergy <= 0) && (aBaseMetaTileEntity.isAllowedToWork()) && +/* 133:118 */ (this.mInventory[2] != null)) { +/* 134:119 */ if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.gem.get(Materials.Coal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dust.get(Materials.Coal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dustImpure.get(Materials.Coal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.crushed.get(Materials.Coal)))) +/* 135: */ { +/* 136:123 */ this.mProcessingEnergy += 160; +/* 137:124 */ aBaseMetaTileEntity.decrStackSize(2, 1); +/* 138:125 */ if (aBaseMetaTileEntity.getRandomNumber(3) == 0) { +/* 139:126 */ aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 1L)); +/* 140: */ } +/* 141: */ } +/* 142:129 */ else if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.gem.get(Materials.Charcoal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dust.get(Materials.Charcoal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dustImpure.get(Materials.Charcoal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.crushed.get(Materials.Charcoal)))) +/* 143: */ { +/* 144:133 */ this.mProcessingEnergy += 160; +/* 145:134 */ aBaseMetaTileEntity.decrStackSize(2, 1); +/* 146:135 */ if (aBaseMetaTileEntity.getRandomNumber(3) == 0) { +/* 147:136 */ aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 1L)); +/* 148: */ } +/* 149: */ } +/* 150:138 */ else if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelCoke")) +/* 151: */ { +/* 152:139 */ this.mProcessingEnergy += 640; +/* 153:140 */ aBaseMetaTileEntity.decrStackSize(2, 1); +/* 154:141 */ if (aBaseMetaTileEntity.getRandomNumber(2) == 0) { +/* 155:142 */ aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 1L)); +/* 156: */ } +/* 157: */ } +/* 158:144 */ else if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.gem.get(Materials.Lignite))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dust.get(Materials.Lignite))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dustImpure.get(Materials.Lignite))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.crushed.get(Materials.Lignite)))) +/* 159: */ { +/* 160:148 */ this.mProcessingEnergy += 40; +/* 161:149 */ aBaseMetaTileEntity.decrStackSize(2, 1); +/* 162:150 */ if (aBaseMetaTileEntity.getRandomNumber(8) == 0) { +/* 163:151 */ aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 1L)); +/* 164: */ } +/* 165: */ } +/* 166: */ } +/* 167:157 */ if ((this.mTemperature < 1000) && (this.mProcessingEnergy > 0) && (aTick % 12L == 0L)) +/* 168: */ { +/* 169:158 */ this.mProcessingEnergy -= 2; +/* 170:159 */ this.mTemperature += 1; +/* 171: */ } +/* 172:162 */ aBaseMetaTileEntity.setActive(this.mProcessingEnergy > 0); +/* 173: */ } +/* 174: */ } +/* 175: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.tileentities.boilers.GT_MetaTileEntity_Boiler_Steel + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java new file mode 100644 index 0000000..6f10baf --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java @@ -0,0 +1,145 @@ +/* 1: */ package gregtech.common.tileentities.generators; +/* 2: */ +/* 3: */ import cpw.mods.fml.common.registry.GameRegistry; +import gregtech.api.GregTech_API; +import gregtech.api.enums.ConfigCategories; +/* 4: */ import gregtech.api.enums.ItemList; +import gregtech.api.enums.Textures; +/* 6: */ import gregtech.api.interfaces.ITexture; +/* 7: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 8: */ import gregtech.api.metatileentity.MetaTileEntity; +/* 9: */ +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator; +/* 10: */ import gregtech.api.objects.GT_RenderedTexture; +/* 11: */ import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Recipe; +/* 13: */ import net.minecraft.item.ItemStack; +/* 14: */ +/* 15: */ public class GT_MetaTileEntity_DieselGenerator +/* 16: */ extends GT_MetaTileEntity_BasicGenerator +/* 17: */ { + + public int mEfficiency; +/* 18: */ @Override +public boolean isOutputFacing(byte aSide) +/* 19: */ { +/* 20:16 */ return aSide == getBaseMetaTileEntity().getFrontFacing(); +/* 21: */ } +/* 22: */ +/* 23: */ public GT_MetaTileEntity_DieselGenerator(int aID, String aName, String aNameRegional, int aTier) +/* 24: */ { +/* 25:19 */ super(aID, aName, aNameRegional, aTier, "Requires liquid Fuel", new ITexture[0]); + onConfigLoad(); +/* 26: */ } +/* 27: */ +/* 28: */ public GT_MetaTileEntity_DieselGenerator(String aName, int aTier, String aDescription, ITexture[][][] aTextures) +/* 29: */ { +/* 30:23 */ super(aName, aTier, aDescription, aTextures); + onConfigLoad(); +/* 31: */ } +/* 32: */ +/* 33: */ @Override +public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) +/* 34: */ { +/* 35:28 */ return new GT_MetaTileEntity_DieselGenerator(this.mName, this.mTier, this.mDescription, this.mTextures); +/* 36: */ } +/* 37: */ +/* 38: */ @Override +public GT_Recipe.GT_Recipe_Map getRecipes() +/* 39: */ { +/* 40:33 */ return GT_Recipe.GT_Recipe_Map.sDieselFuels; +/* 41: */ } +/* 42: */ +/* 43: */ @Override +public int getCapacity() +/* 44: */ { +/* 45:38 */ return 16000; +/* 46: */ } + +/* 47: */ public void onConfigLoad() +/* 39: */ { + this.mEfficiency =GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "DieselGenerator.efficiency.tier."+this.mTier, (100 - this.mTier * 10)); +} + +/* 48: */ @Override +public int getEfficiency() +/* 49: */ { +/* 50:43 */ return this.mEfficiency; +/* 51: */ } +/* 52: */ +/* 53: */ @Override +public int getFuelValue(ItemStack aStack) +/* 54: */ { +/* 55:48 */ int rValue = Math.max(GT_ModHandler.getFuelCanValue(aStack) * 6 / 5, super.getFuelValue(aStack)); +/* 56:49 */ if (ItemList.Fuel_Can_Plastic_Filled.isStackEqual(aStack, false, true)) { +/* 57:49 */ rValue = Math.max(rValue, GameRegistry.getFuelValue(aStack) * 3); +/* 58: */ } +/* 59:50 */ return rValue; +/* 60: */ } +/* 61: */ +/* 62: */ @Override +public ITexture[] getFront(byte aColor) +/* 63: */ { +/* 64:53 */ return new ITexture[] { super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_FRONT), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] }; +/* 65: */ } +/* 66: */ +/* 67: */ @Override +public ITexture[] getBack(byte aColor) +/* 68: */ { +/* 69:54 */ return new ITexture[] { super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BACK) }; +/* 70: */ } +/* 71: */ +/* 72: */ @Override +public ITexture[] getBottom(byte aColor) +/* 73: */ { +/* 74:55 */ return new ITexture[] { super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BOTTOM) }; +/* 75: */ } +/* 76: */ +/* 77: */ @Override +public ITexture[] getTop(byte aColor) +/* 78: */ { +/* 79:56 */ return new ITexture[] { super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_TOP) }; +/* 80: */ } +/* 81: */ +/* 82: */ @Override +public ITexture[] getSides(byte aColor) +/* 83: */ { +/* 84:57 */ return new ITexture[] { super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE) }; +/* 85: */ } +/* 86: */ +/* 87: */ @Override +public ITexture[] getFrontActive(byte aColor) +/* 88: */ { +/* 89:58 */ return new ITexture[] { super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_FRONT_ACTIVE), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] }; +/* 90: */ } +/* 91: */ +/* 92: */ @Override +public ITexture[] getBackActive(byte aColor) +/* 93: */ { +/* 94:59 */ return new ITexture[] { super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BACK_ACTIVE) }; +/* 95: */ } +/* 96: */ +/* 97: */ @Override +public ITexture[] getBottomActive(byte aColor) +/* 98: */ { +/* 99:60 */ return new ITexture[] { super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BOTTOM_ACTIVE) }; +/* :0: */ } +/* :1: */ +/* :2: */ @Override +public ITexture[] getTopActive(byte aColor) +/* :3: */ { +/* :4:61 */ return new ITexture[] { super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_TOP_ACTIVE) }; +/* :5: */ } +/* :6: */ +/* :7: */ @Override +public ITexture[] getSidesActive(byte aColor) +/* :8: */ { +/* :9:62 */ return new ITexture[] { super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE_ACTIVE) }; +/* ;0: */ } +/* ;1: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.tileentities.generators.GT_MetaTileEntity_DieselGenerator + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_FluidNaquadahReactor.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_FluidNaquadahReactor.java new file mode 100644 index 0000000..294abdf --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_FluidNaquadahReactor.java @@ -0,0 +1,119 @@ +/* 1: */ package gregtech.common.tileentities.generators; +/* 2: */ +/* 3: */ import gregtech.api.enums.Textures; +/* 4: */ import gregtech.api.interfaces.ITexture; +/* 5: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 6: */ import gregtech.api.metatileentity.MetaTileEntity; +/* 7: */ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator; +/* 8: */ import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Recipe; +/* 10: */ +/* 11: */ public class GT_MetaTileEntity_FluidNaquadahReactor +/* 12: */ extends GT_MetaTileEntity_BasicGenerator +/* 13: */ { +/* 14: */ @Override +public boolean isOutputFacing(byte aSide) +/* 15: */ { +/* 16:12 */ return (aSide > 1) && (aSide != getBaseMetaTileEntity().getFrontFacing()) && (aSide != getBaseMetaTileEntity().getBackFacing()); +/* 17: */ } +/* 18: */ +/* 19: */ public GT_MetaTileEntity_FluidNaquadahReactor(int aID, String aName, String aNameRegional, int aTier) +/* 20: */ { +/* 21:15 */ super(aID, aName, aNameRegional, aTier, "Requires Fluid Heavy Naquadah", new ITexture[0]); +/* 22: */ } +/* 23: */ +/* 24: */ public GT_MetaTileEntity_FluidNaquadahReactor(String aName, int aTier, String aDescription, ITexture[][][] aTextures) +/* 25: */ { +/* 26:19 */ super(aName, aTier, aDescription, aTextures); +/* 27: */ } +/* 28: */ +/* 29: */ @Override +public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) +/* 30: */ { +/* 31:24 */ return new GT_MetaTileEntity_FluidNaquadahReactor(this.mName, this.mTier, this.mDescription, this.mTextures); +/* 32: */ } +/* 33: */ +/* 34: */ @Override +public GT_Recipe.GT_Recipe_Map getRecipes() +/* 35: */ { +/* 36:29 */ return GT_Recipe.GT_Recipe_Map.sFluidNaquadahReactorFuels; +/* 37: */ } +/* 38: */ +/* 39: */ @Override +public int getCapacity() +/* 40: */ { +/* 41:34 */ return 16000; +/* 42: */ } +/* 43: */ +/* 44: */ @Override +public int getEfficiency() +/* 45: */ { +/* 46:39 */ return 100; +/* 47: */ } +/* 48: */ +/* 49: */ @Override +public ITexture[] getFront(byte aColor) +/* 50: */ { +/* 51:42 */ return new ITexture[] { super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_FRONT) }; +/* 52: */ } +/* 53: */ +/* 54: */ @Override +public ITexture[] getBack(byte aColor) +/* 55: */ { +/* 56:43 */ return new ITexture[] { super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_BACK) }; +/* 57: */ } +/* 58: */ +/* 59: */ @Override +public ITexture[] getBottom(byte aColor) +/* 60: */ { +/* 61:44 */ return new ITexture[] { super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_BOTTOM) }; +/* 62: */ } +/* 63: */ +/* 64: */ @Override +public ITexture[] getTop(byte aColor) +/* 65: */ { +/* 66:45 */ return new ITexture[] { super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_TOP) }; +/* 67: */ } +/* 68: */ +/* 69: */ @Override +public ITexture[] getSides(byte aColor) +/* 70: */ { +/* 71:46 */ return new ITexture[] { super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_SIDE) }; +/* 72: */ } +/* 73: */ +/* 74: */ @Override +public ITexture[] getFrontActive(byte aColor) +/* 75: */ { +/* 76:47 */ return new ITexture[] { super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_FRONT_ACTIVE) }; +/* 77: */ } +/* 78: */ +/* 79: */ @Override +public ITexture[] getBackActive(byte aColor) +/* 80: */ { +/* 81:48 */ return new ITexture[] { super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_BACK_ACTIVE) }; +/* 82: */ } +/* 83: */ +/* 84: */ @Override +public ITexture[] getBottomActive(byte aColor) +/* 85: */ { +/* 86:49 */ return new ITexture[] { super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_BOTTOM_ACTIVE) }; +/* 87: */ } +/* 88: */ +/* 89: */ @Override +public ITexture[] getTopActive(byte aColor) +/* 90: */ { +/* 91:50 */ return new ITexture[] { super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_TOP_ACTIVE) }; +/* 92: */ } +/* 93: */ +/* 94: */ @Override +public ITexture[] getSidesActive(byte aColor) +/* 95: */ { +/* 96:51 */ return new ITexture[] { super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_SIDE_ACTIVE) }; +/* 97: */ } +/* 98: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.tileentities.generators.GT_MetaTileEntity_FluidNaquadahReactor + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java new file mode 100644 index 0000000..f8683a0 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java @@ -0,0 +1,131 @@ +/* 1: */ package gregtech.common.tileentities.generators; +/* 2: */ +/* 3: */ import gregtech.api.GregTech_API; +import gregtech.api.enums.ConfigCategories; +import gregtech.api.enums.Textures; +/* 4: */ import gregtech.api.interfaces.ITexture; +/* 5: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 6: */ import gregtech.api.metatileentity.MetaTileEntity; +/* 7: */ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator; +/* 8: */ import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Recipe; +/* 10: */ +/* 11: */ public class GT_MetaTileEntity_GasTurbine +/* 12: */ extends GT_MetaTileEntity_BasicGenerator +/* 13: */ { + + public int mEfficiency; +/* 14: */ @Override +public boolean isOutputFacing(byte aSide) +/* 15: */ { +/* 16:12 */ return aSide == getBaseMetaTileEntity().getFrontFacing(); +/* 17: */ } +/* 18: */ +/* 19: */ public GT_MetaTileEntity_GasTurbine(int aID, String aName, String aNameRegional, int aTier) +/* 20: */ { +/* 21:15 */ super(aID, aName, aNameRegional, aTier, "Requires flammable Gasses", new ITexture[0]); +onConfigLoad(); +/* 22: */ } +/* 23: */ +/* 24: */ public GT_MetaTileEntity_GasTurbine(String aName, int aTier, String aDescription, ITexture[][][] aTextures) +/* 25: */ { +/* 26:19 */ super(aName, aTier, aDescription, aTextures); +onConfigLoad(); +/* 27: */ } +/* 28: */ +/* 29: */ @Override +public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) +/* 30: */ { +/* 31:24 */ return new GT_MetaTileEntity_GasTurbine(this.mName, this.mTier, this.mDescription, this.mTextures); +/* 32: */ } +/* 33: */ +/* 34: */ @Override +public GT_Recipe.GT_Recipe_Map getRecipes() +/* 35: */ { +/* 36:29 */ return GT_Recipe.GT_Recipe_Map.sTurbineFuels; +/* 37: */ } +/* 38: */ +/* 39: */ @Override +public int getCapacity() +/* 40: */ { +/* 41:34 */ return 16000; +/* 42: */ } + +public void onConfigLoad() +/* 39: */ { + this.mEfficiency =GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "GasTurbine.efficiency.tier."+this.mTier, (100 - this.mTier * 10)); +} + +/* 43: */ +/* 44: */ @Override +public int getEfficiency() +/* 45: */ { +/* 46:39 */ return this.mEfficiency; +/* 47: */ } +/* 48: */ +/* 49: */ @Override +public ITexture[] getFront(byte aColor) +/* 50: */ { +/* 51:42 */ return new ITexture[] { super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_FRONT), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] }; +/* 52: */ } +/* 53: */ +/* 54: */ @Override +public ITexture[] getBack(byte aColor) +/* 55: */ { +/* 56:43 */ return new ITexture[] { super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_BACK) }; +/* 57: */ } +/* 58: */ +/* 59: */ @Override +public ITexture[] getBottom(byte aColor) +/* 60: */ { +/* 61:44 */ return new ITexture[] { super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_BOTTOM) }; +/* 62: */ } +/* 63: */ +/* 64: */ @Override +public ITexture[] getTop(byte aColor) +/* 65: */ { +/* 66:45 */ return new ITexture[] { super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_TOP) }; +/* 67: */ } +/* 68: */ +/* 69: */ @Override +public ITexture[] getSides(byte aColor) +/* 70: */ { +/* 71:46 */ return new ITexture[] { super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_SIDE) }; +/* 72: */ } +/* 73: */ +/* 74: */ @Override +public ITexture[] getFrontActive(byte aColor) +/* 75: */ { +/* 76:47 */ return new ITexture[] { super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_FRONT_ACTIVE), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] }; +/* 77: */ } +/* 78: */ +/* 79: */ @Override +public ITexture[] getBackActive(byte aColor) +/* 80: */ { +/* 81:48 */ return new ITexture[] { super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_BACK_ACTIVE) }; +/* 82: */ } +/* 83: */ +/* 84: */ @Override +public ITexture[] getBottomActive(byte aColor) +/* 85: */ { +/* 86:49 */ return new ITexture[] { super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_BOTTOM_ACTIVE) }; +/* 87: */ } +/* 88: */ +/* 89: */ @Override +public ITexture[] getTopActive(byte aColor) +/* 90: */ { +/* 91:50 */ return new ITexture[] { super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_TOP_ACTIVE) }; +/* 92: */ } +/* 93: */ +/* 94: */ @Override +public ITexture[] getSidesActive(byte aColor) +/* 95: */ { +/* 96:51 */ return new ITexture[] { super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_SIDE_ACTIVE) }; +/* 97: */ } +/* 98: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.tileentities.generators.GT_MetaTileEntity_GasTurbine + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicEnergyConverter.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicEnergyConverter.java new file mode 100644 index 0000000..342b2ce --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicEnergyConverter.java @@ -0,0 +1,125 @@ +package gregtech.common.tileentities.generators; + +/* 3: */ import gregtech.api.GregTech_API; +import gregtech.api.enums.ConfigCategories; +import gregtech.api.enums.Textures; +/* 4: */ import gregtech.api.interfaces.ITexture; +/* 5: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 6: */ import gregtech.api.metatileentity.MetaTileEntity; +/* 7: */ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator; +/* 8: */ import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Recipe; +/* 10: */ +/* 11: */ public class GT_MetaTileEntity_MagicEnergyConverter +/* 12: */ extends GT_MetaTileEntity_BasicGenerator +/* 13: */ { + + public int mEfficiency; +/* 14: */ @Override +public boolean isOutputFacing(byte aSide) +/* 15: */ { +/* 16:12 */ return aSide == getBaseMetaTileEntity().getFrontFacing(); +/* 17: */ } +/* 18: */ +/* 19: */ public GT_MetaTileEntity_MagicEnergyConverter(int aID, String aName, String aNameRegional, int aTier) +/* 20: */ { +/* 21:15 */ super(aID, aName, aNameRegional, aTier, "Put your strange stuff in here", new ITexture[0]); +onConfigLoad(); +/* 22: */ } +/* 23: */ +/* 24: */ public GT_MetaTileEntity_MagicEnergyConverter(String aName, int aTier, String aDescription, ITexture[][][] aTextures) +/* 25: */ { +/* 26:19 */ super(aName, aTier, aDescription, aTextures); +onConfigLoad(); +/* 27: */ } +/* 28: */ +/* 29: */ @Override +public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) +/* 30: */ { +/* 31:24 */ return new GT_MetaTileEntity_MagicEnergyConverter(this.mName, this.mTier, this.mDescription, this.mTextures); +/* 32: */ } +/* 33: */ +/* 34: */ @Override +public GT_Recipe.GT_Recipe_Map getRecipes() +/* 35: */ { +/* 36:29 */ return GT_Recipe.GT_Recipe_Map.sMagicFuels; +/* 37: */ } +/* 38: */ +/* 39: */ @Override +public int getCapacity() +/* 40: */ { +/* 41:34 */ return 16000; +/* 42: */ } + +public void onConfigLoad() +/* 39: */ { + this.mEfficiency =GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MagicEnergyConverter.efficiency.tier."+this.mTier, 100-this.mTier*10); +} + +/* 43: */ +/* 44: */ @Override +public int getEfficiency() +/* 45: */ { +/* 46:39 */ return this.mEfficiency; +/* 47: */ } +/* 48: */ +/* 49: */ @Override +public ITexture[] getFront(byte aColor) +/* 50: */ { +/* 51:42 */ return new ITexture[] { super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] }; +/* 52: */ } +/* 53: */ +/* 54: */ @Override +public ITexture[] getBack(byte aColor) +/* 55: */ { +/* 56:43 */ return new ITexture[] { super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_FRONT) }; +/* 57: */ } +/* 58: */ +/* 59: */ @Override +public ITexture[] getBottom(byte aColor) +/* 60: */ { +/* 61:44 */ return new ITexture[] { super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC) }; +/* 62: */ } +/* 63: */ +/* 64: */ @Override +public ITexture[] getTop(byte aColor) +/* 65: */ { +/* 66:45 */ return new ITexture[] { super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC) }; +/* 67: */ } +/* 68: */ +/* 69: */ @Override +public ITexture[] getSides(byte aColor) +/* 70: */ { +/* 71:46 */ return new ITexture[] { super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC) }; +/* 72: */ } +/* 73: */ +/* 74: */ @Override +public ITexture[] getFrontActive(byte aColor) +/* 75: */ { +/* 76:47 */ return new ITexture[] { super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] }; +/* 77: */ } +/* 78: */ +/* 79: */ @Override +public ITexture[] getBackActive(byte aColor) +/* 80: */ { +/* 81:48 */ return new ITexture[] { super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_FRONT_ACTIVE) }; +/* 82: */ } +/* 83: */ +/* 84: */ @Override +public ITexture[] getBottomActive(byte aColor) +/* 85: */ { +/* 86:49 */ return new ITexture[] { super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE) }; +/* 87: */ } +/* 88: */ +/* 89: */ @Override +public ITexture[] getTopActive(byte aColor) +/* 90: */ { +/* 91:50 */ return new ITexture[] { super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE) }; +/* 92: */ } +/* 93: */ +/* 94: */ @Override +public ITexture[] getSidesActive(byte aColor) +/* 95: */ { +/* 96:51 */ return new ITexture[] { super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE) }; +/* 97: */ } +/* 98: */ } \ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java new file mode 100644 index 0000000..9718dc1 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java @@ -0,0 +1,264 @@ +package gregtech.common.tileentities.generators; + +/* 3: */ import java.util.ArrayList; + +import cpw.mods.fml.common.Loader; +import gregtech.api.GregTech_API; +import gregtech.api.enums.ConfigCategories; +import gregtech.api.enums.Textures; +/* 4: */ import gregtech.api.interfaces.ITexture; +/* 5: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 6: */ import gregtech.api.metatileentity.MetaTileEntity; +/* 7: */ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator; +/* 8: */ import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Recipe; +import net.minecraft.block.Block; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.entity.item.EntityEnderCrystal; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemEnchantedBook; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.AxisAlignedBB; +/* 10: */ +/* 11: */ public class GT_MetaTileEntity_MagicalEnergyAbsorber +/* 12: */ extends GT_MetaTileEntity_BasicGenerator +/* 13: */ { + + public int mEfficiency; + public static boolean sAllowMultipleEggs = true; + public static GT_MetaTileEntity_MagicalEnergyAbsorber mActiveSiphon = null; + public static int sEnergyPerEnderCrystal = 32; + public static int sEnergyFromVis = 12800; + public static final ArrayList sUsedDragonCrystalList = new ArrayList(); + public EntityEnderCrystal mTargetedCrystal; + public static int sDragonEggEnergyPerTick = 128; + public static boolean isThaumcraftLoaded; + +/* 14: */ @Override +public boolean isOutputFacing(byte aSide) +/* 15: */ { +/* 16:12 */ return aSide == getBaseMetaTileEntity().getFrontFacing(); +/* 17: */ } +/* 18: */ +/* 19: */ public GT_MetaTileEntity_MagicalEnergyAbsorber(int aID, String aName, String aNameRegional, int aTier) +/* 20: */ { +/* 21:15 */ super(aID, aName, aNameRegional, aTier, "Feasts on magic close to it", new ITexture[0]); + onConfigLoad(); +/* 22: */ } +/* 23: */ +/* 24: */ public GT_MetaTileEntity_MagicalEnergyAbsorber(String aName, int aTier, String aDescription, ITexture[][][] aTextures) +/* 25: */ { +/* 26:19 */ super(aName, aTier, aDescription, aTextures); + onConfigLoad(); +/* 27: */ } +/* 28: */ +/* 29: */ @Override +public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) +/* 30: */ { +/* 31:24 */ return new GT_MetaTileEntity_MagicalEnergyAbsorber(this.mName, this.mTier, this.mDescription, this.mTextures); +/* 32: */ } +/* 33: */ +/* 34: */ @Override +public GT_Recipe.GT_Recipe_Map getRecipes() +/* 35: */ { +/* 36:29 */ return GT_Recipe.GT_Recipe_Map.sMagicFuels; +/* 37: */ } +/* 38: */ +/* 39: */ @Override +public int getCapacity() +/* 40: */ { +/* 41:34 */ return 16000; +/* 42: */ } + + public void onConfigLoad() +/* 39: */ { + this.mEfficiency =GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MagicEnergyAbsorber.efficiency.tier."+this.mTier, 100-this.mTier*10); + GT_MetaTileEntity_MagicalEnergyAbsorber.sAllowMultipleEggs = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MagicEnergyAbsorber.AllowMultipleEggs", false); + GT_MetaTileEntity_MagicalEnergyAbsorber.sEnergyPerEnderCrystal = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MagicEnergyAbsorber.EnergyPerTick.EnderCrystal", 32); + GT_MetaTileEntity_MagicalEnergyAbsorber.sEnergyFromVis = (GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MagicEnergyAbsorber.EnergyPerVisDivisor", 2500)*10); + GT_MetaTileEntity_MagicalEnergyAbsorber.sDragonEggEnergyPerTick = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MagicEnergyAbsorber.EnergyPerTick", 2048); + GT_MetaTileEntity_MagicalEnergyAbsorber.isThaumcraftLoaded = Loader.isModLoaded("Thaumcraft"); + } + + @SuppressWarnings("unchecked") + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isAllowedToWork() && aBaseMetaTileEntity.getUniversalEnergyStored() < maxEUOutput() + aBaseMetaTileEntity.getEUCapacity()) { + //Dragon Egg + if(hasEgg()&&aTick%10==0){ + getBaseMetaTileEntity().increaseStoredEnergyUnits(sDragonEggEnergyPerTick*getEfficiency()*10, false); + if ((mActiveSiphon != this) && (!sAllowMultipleEggs)) { + if ((mActiveSiphon == null) || (mActiveSiphon.getBaseMetaTileEntity() == null) || (mActiveSiphon.getBaseMetaTileEntity().isInvalidTileEntity()) || (!mActiveSiphon.hasEgg())) { + mActiveSiphon = this; + } else { + getBaseMetaTileEntity().doExplosion(Integer.MAX_VALUE); + } + } + } + //Energyzed node + //EnderCrystal + + if (sEnergyPerEnderCrystal > 0) { + if (this.mTargetedCrystal == null) + { + ArrayList tList = (ArrayList)getBaseMetaTileEntity().getWorld().getEntitiesWithinAABB(EntityEnderCrystal.class, AxisAlignedBB.getBoundingBox(getBaseMetaTileEntity().getXCoord() - 64, getBaseMetaTileEntity().getYCoord() - 64, getBaseMetaTileEntity().getZCoord() - 64, getBaseMetaTileEntity().getXCoord() + 64, getBaseMetaTileEntity().getYCoord() + 64, getBaseMetaTileEntity().getZCoord() + 64)); + if ((tList != null) && (!tList.isEmpty())) + { + tList.removeAll(sUsedDragonCrystalList); + if (tList.size() > 0) + { + this.mTargetedCrystal = (tList.get(0)); + if (this.mTargetedCrystal != null) { + sUsedDragonCrystalList.add(this.mTargetedCrystal); + } + } + } + } + else if (this.mTargetedCrystal.isEntityAlive()) + { + getBaseMetaTileEntity().increaseStoredEnergyUnits(sEnergyPerEnderCrystal * 10, false); + } + else + { + sUsedDragonCrystalList.remove(this.mTargetedCrystal); + this.mTargetedCrystal = null; + } + } + + //Absorb entchantments + + try + { + if ((this.mInventory[0] != null) && (this.mInventory[1] == null)) + { + if ((this.mInventory[0].isItemEnchanted()) && (this.mInventory[0].getItem().getItemEnchantability() > 0)) + { + NBTTagList tEnchantments = this.mInventory[0].getEnchantmentTagList(); + if (tEnchantments != null) + { + for (int i = 0; i < tEnchantments.tagCount(); i++) + { + short tID = tEnchantments.getCompoundTagAt(i).getShort("id"); + short tLevel = tEnchantments.getCompoundTagAt(i).getShort("lvl"); + if ((tID > -1) && (tID < Enchantment.enchantmentsList.length)) + { + Enchantment tEnchantment = Enchantment.enchantmentsList[tID]; + if (tEnchantment != null) { + getBaseMetaTileEntity().increaseStoredEnergyUnits(1000000 * tLevel / (tEnchantment.getMaxLevel() * tEnchantment.getWeight()), true); + } + } + } + this.mInventory[0].stackTagCompound.removeTag("ench"); + } + } + else if ((this.mInventory[0].getItem() instanceof ItemEnchantedBook)) + { + NBTTagList tEnchantments = ((ItemEnchantedBook)this.mInventory[0].getItem()).func_92110_g(this.mInventory[0]); + if (tEnchantments != null) + { + for (int i = 0; i < tEnchantments.tagCount(); i++) + { + short tID = tEnchantments.getCompoundTagAt(i).getShort("id"); + short tLevel = tEnchantments.getCompoundTagAt(i).getShort("lvl"); + if ((tID > -1) && (tID < Enchantment.enchantmentsBookList.length)) + { + Enchantment tEnchantment = Enchantment.enchantmentsBookList[tID]; + if (tEnchantment != null) { + getBaseMetaTileEntity().increaseStoredEnergyUnits(1000000 * tLevel / (tEnchantment.getMaxLevel() * tEnchantment.getWeight()), true); + } + } + } + this.mInventory[0] = new ItemStack(Items.book, 1); + } + } + this.mInventory[1] = this.mInventory[0]; + this.mInventory[0] = null; + } + } + catch (Throwable e){} + } + } + + @Override + public void inValidate() + { + if (mActiveSiphon == this) { + mActiveSiphon = null; + } + } + + public boolean hasEgg() + { + Block above = getBaseMetaTileEntity().getBlockOffset(0, 1, 0); + if(above==null||Blocks.air==above){return false;} + return Blocks.dragon_egg == above || above.getUnlocalizedName().equals("tile.dragonEgg"); + } +/* 43: */ +/* 44: */ @Override +public int getEfficiency() +/* 45: */ { +/* 46:39 */ return this.mEfficiency; +/* 47: */ } +/* 48: */ +/* 49: */ @Override +public ITexture[] getFront(byte aColor) +/* 50: */ { +/* 51:42 */ return new ITexture[] { super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] }; +/* 52: */ } +/* 53: */ +/* 54: */ @Override +public ITexture[] getBack(byte aColor) +/* 55: */ { +/* 56:43 */ return new ITexture[] { super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_FRONT) }; +/* 57: */ } +/* 58: */ +/* 59: */ @Override +public ITexture[] getBottom(byte aColor) +/* 60: */ { +/* 61:44 */ return new ITexture[] { super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC) }; +/* 62: */ } +/* 63: */ +/* 64: */ @Override +public ITexture[] getTop(byte aColor) +/* 65: */ { +/* 66:45 */ return new ITexture[] { super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_DRAGONEGG) }; +/* 67: */ } +/* 68: */ +/* 69: */ @Override +public ITexture[] getSides(byte aColor) +/* 70: */ { +/* 71:46 */ return new ITexture[] { super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC) }; +/* 72: */ } +/* 73: */ +/* 74: */ @Override +public ITexture[] getFrontActive(byte aColor) +/* 75: */ { +/* 76:47 */ return new ITexture[] { super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] }; +/* 77: */ } +/* 78: */ +/* 79: */ @Override +public ITexture[] getBackActive(byte aColor) +/* 80: */ { +/* 81:48 */ return new ITexture[] { super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_FRONT_ACTIVE) }; +/* 82: */ } +/* 83: */ +/* 84: */ @Override +public ITexture[] getBottomActive(byte aColor) +/* 85: */ { +/* 86:49 */ return new ITexture[] { super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE) }; +/* 87: */ } +/* 88: */ +/* 89: */ @Override +public ITexture[] getTopActive(byte aColor) +/* 90: */ { +/* 91:50 */ return new ITexture[] { super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_DRAGONEGG) }; +/* 92: */ } +/* 93: */ +/* 94: */ @Override +public ITexture[] getSidesActive(byte aColor) +/* 95: */ { +/* 96:51 */ return new ITexture[] { super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE) }; +/* 97: */ } +/* 98: */ } \ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_PlasmaGenerator.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_PlasmaGenerator.java new file mode 100644 index 0000000..26cd32f --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_PlasmaGenerator.java @@ -0,0 +1,125 @@ +package gregtech.common.tileentities.generators; + +/* 3: */ import gregtech.api.GregTech_API; +import gregtech.api.enums.ConfigCategories; +import gregtech.api.enums.Textures; +/* 4: */ import gregtech.api.interfaces.ITexture; +/* 5: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 6: */ import gregtech.api.metatileentity.MetaTileEntity; +/* 7: */ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator; +/* 8: */ import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Recipe; +/* 10: */ +/* 11: */ public class GT_MetaTileEntity_PlasmaGenerator +/* 12: */ extends GT_MetaTileEntity_BasicGenerator +/* 13: */ { + + public int mEfficiency; +/* 14: */ @Override +public boolean isOutputFacing(byte aSide) +/* 15: */ { +/* 16:12 */ return aSide == getBaseMetaTileEntity().getFrontFacing(); +/* 17: */ } +/* 18: */ +/* 19: */ public GT_MetaTileEntity_PlasmaGenerator(int aID, String aName, String aNameRegional, int aTier) +/* 20: */ { +/* 21:15 */ super(aID, aName, aNameRegional, aTier, "Plasma into energy", new ITexture[0]); +onConfigLoad(); +/* 22: */ } +/* 23: */ +/* 24: */ public GT_MetaTileEntity_PlasmaGenerator(String aName, int aTier, String aDescription, ITexture[][][] aTextures) +/* 25: */ { +/* 26:19 */ super(aName, aTier, aDescription, aTextures); +onConfigLoad(); +/* 27: */ } +/* 28: */ +/* 29: */ @Override +public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) +/* 30: */ { +/* 31:24 */ return new GT_MetaTileEntity_PlasmaGenerator(this.mName, this.mTier, this.mDescription, this.mTextures); +/* 32: */ } +/* 33: */ +/* 34: */ @Override +public GT_Recipe.GT_Recipe_Map getRecipes() +/* 35: */ { +/* 36:29 */ return GT_Recipe.GT_Recipe_Map.sPlasmaFuels; +/* 37: */ } +/* 38: */ +/* 39: */ @Override +public int getCapacity() +/* 40: */ { +/* 41:34 */ return 16000; +/* 42: */ } + +public void onConfigLoad() +/* 39: */ { + this.mEfficiency =GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "PlasmaGenerator.efficiency.tier."+this.mTier, (10 + (this.mTier * 10))); +} + +/* 43: */ +/* 44: */ @Override +public int getEfficiency() +/* 45: */ { +/* 46:39 */ return this.mEfficiency; +/* 47: */ } +/* 48: */ +/* 49: */ @Override +public ITexture[] getFront(byte aColor) +/* 50: */ { +/* 51:42 */ return new ITexture[] { super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] }; +/* 52: */ } +/* 53: */ +/* 54: */ @Override +public ITexture[] getBack(byte aColor) +/* 55: */ { +/* 56:43 */ return new ITexture[] { super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS) }; +/* 57: */ } +/* 58: */ +/* 59: */ @Override +public ITexture[] getBottom(byte aColor) +/* 60: */ { +/* 61:44 */ return new ITexture[] { super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS) }; +/* 62: */ } +/* 63: */ +/* 64: */ @Override +public ITexture[] getTop(byte aColor) +/* 65: */ { +/* 66:45 */ return new ITexture[] { super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS) }; +/* 67: */ } +/* 68: */ +/* 69: */ @Override +public ITexture[] getSides(byte aColor) +/* 70: */ { +/* 71:46 */ return new ITexture[] { super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS) }; +/* 72: */ } +/* 73: */ +/* 74: */ @Override +public ITexture[] getFrontActive(byte aColor) +/* 75: */ { +/* 76:47 */ return new ITexture[] { super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] }; +/* 77: */ } +/* 78: */ +/* 79: */ @Override +public ITexture[] getBackActive(byte aColor) +/* 80: */ { +/* 81:48 */ return new ITexture[] { super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW) }; +/* 82: */ } +/* 83: */ +/* 84: */ @Override +public ITexture[] getBottomActive(byte aColor) +/* 85: */ { +/* 86:49 */ return new ITexture[] { super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW) }; +/* 87: */ } +/* 88: */ +/* 89: */ @Override +public ITexture[] getTopActive(byte aColor) +/* 90: */ { +/* 91:50 */ return new ITexture[] { super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW) }; +/* 92: */ } +/* 93: */ +/* 94: */ @Override +public ITexture[] getSidesActive(byte aColor) +/* 95: */ { +/* 96:51 */ return new ITexture[] { super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW) }; +/* 97: */ } +/* 98: */ } \ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SolidNaquadahReactor.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SolidNaquadahReactor.java new file mode 100644 index 0000000..666c16f --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SolidNaquadahReactor.java @@ -0,0 +1,119 @@ +/* 1: */ package gregtech.common.tileentities.generators; +/* 2: */ +/* 3: */ import gregtech.api.enums.Textures; +/* 4: */ import gregtech.api.interfaces.ITexture; +/* 5: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 6: */ import gregtech.api.metatileentity.MetaTileEntity; +/* 7: */ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator; +/* 8: */ import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Recipe; +/* 10: */ +/* 11: */ public class GT_MetaTileEntity_SolidNaquadahReactor +/* 12: */ extends GT_MetaTileEntity_BasicGenerator +/* 13: */ { +/* 14: */ @Override +public boolean isOutputFacing(byte aSide) +/* 15: */ { +/* 16:12 */ return (aSide > 1) && (aSide != getBaseMetaTileEntity().getFrontFacing()) && (aSide != getBaseMetaTileEntity().getBackFacing()); +/* 17: */ } +/* 18: */ +/* 19: */ public GT_MetaTileEntity_SolidNaquadahReactor(int aID, String aName, String aNameRegional, int aTier) +/* 20: */ { +/* 21:15 */ super(aID, aName, aNameRegional, aTier, "Requires Enriched Naquadah Bolts", new ITexture[0]); +/* 22: */ } +/* 23: */ +/* 24: */ public GT_MetaTileEntity_SolidNaquadahReactor(String aName, int aTier, String aDescription, ITexture[][][] aTextures) +/* 25: */ { +/* 26:19 */ super(aName, aTier, aDescription, aTextures); +/* 27: */ } +/* 28: */ +/* 29: */ @Override +public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) +/* 30: */ { +/* 31:24 */ return new GT_MetaTileEntity_SolidNaquadahReactor(this.mName, this.mTier, this.mDescription, this.mTextures); +/* 32: */ } +/* 33: */ +/* 34: */ @Override +public GT_Recipe.GT_Recipe_Map getRecipes() +/* 35: */ { +/* 36:29 */ return GT_Recipe.GT_Recipe_Map.sSmallNaquadahReactorFuels; +/* 37: */ } +/* 38: */ +/* 39: */ @Override +public int getCapacity() +/* 40: */ { +/* 41:34 */ return 0; +/* 42: */ } +/* 43: */ +/* 44: */ @Override +public int getEfficiency() +/* 45: */ { +/* 46:39 */ return 80; +/* 47: */ } +/* 48: */ +/* 49: */ @Override +public ITexture[] getFront(byte aColor) +/* 50: */ { +/* 51:42 */ return new ITexture[] { super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_FRONT) }; +/* 52: */ } +/* 53: */ +/* 54: */ @Override +public ITexture[] getBack(byte aColor) +/* 55: */ { +/* 56:43 */ return new ITexture[] { super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_BACK) }; +/* 57: */ } +/* 58: */ +/* 59: */ @Override +public ITexture[] getBottom(byte aColor) +/* 60: */ { +/* 61:44 */ return new ITexture[] { super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_BOTTOM) }; +/* 62: */ } +/* 63: */ +/* 64: */ @Override +public ITexture[] getTop(byte aColor) +/* 65: */ { +/* 66:45 */ return new ITexture[] { super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP) }; +/* 67: */ } +/* 68: */ +/* 69: */ @Override +public ITexture[] getSides(byte aColor) +/* 70: */ { +/* 71:46 */ return new ITexture[] { super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_SIDE) }; +/* 72: */ } +/* 73: */ +/* 74: */ @Override +public ITexture[] getFrontActive(byte aColor) +/* 75: */ { +/* 76:47 */ return new ITexture[] { super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_FRONT_ACTIVE) }; +/* 77: */ } +/* 78: */ +/* 79: */ @Override +public ITexture[] getBackActive(byte aColor) +/* 80: */ { +/* 81:48 */ return new ITexture[] { super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_BACK_ACTIVE) }; +/* 82: */ } +/* 83: */ +/* 84: */ @Override +public ITexture[] getBottomActive(byte aColor) +/* 85: */ { +/* 86:49 */ return new ITexture[] { super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_BOTTOM_ACTIVE) }; +/* 87: */ } +/* 88: */ +/* 89: */ @Override +public ITexture[] getTopActive(byte aColor) +/* 90: */ { +/* 91:50 */ return new ITexture[] { super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP_ACTIVE) }; +/* 92: */ } +/* 93: */ +/* 94: */ @Override +public ITexture[] getSidesActive(byte aColor) +/* 95: */ { +/* 96:51 */ return new ITexture[] { super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_SIDE_ACTIVE) }; +/* 97: */ } +/* 98: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.tileentities.generators.GT_MetaTileEntity_SolidNaquadahReactor + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SteamTurbine.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SteamTurbine.java new file mode 100644 index 0000000..45aaa61 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SteamTurbine.java @@ -0,0 +1,144 @@ +/* 1: */ package gregtech.common.tileentities.generators; +/* 2: */ +/* 3: */ import gregtech.api.GregTech_API; +import gregtech.api.enums.ConfigCategories; +import gregtech.api.enums.Textures; +/* 4: */ import gregtech.api.interfaces.ITexture; +/* 5: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 6: */ import gregtech.api.metatileentity.MetaTileEntity; +/* 7: */ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator; +/* 8: */ import gregtech.api.objects.GT_RenderedTexture; +/* 9: */ import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Recipe; +/* 11: */ import net.minecraftforge.fluids.FluidStack; +/* 12: */ +/* 13: */ public class GT_MetaTileEntity_SteamTurbine +/* 14: */ extends GT_MetaTileEntity_BasicGenerator +/* 15: */ { + + public int mEfficiency; +/* 16: */ @Override +public boolean isOutputFacing(byte aSide) +/* 17: */ { +/* 18:14 */ return aSide == getBaseMetaTileEntity().getFrontFacing(); +/* 19: */ } +/* 20: */ +/* 21: */ public GT_MetaTileEntity_SteamTurbine(int aID, String aName, String aNameRegional, int aTier) +/* 22: */ { +/* 23:17 */ super(aID, aName, aNameRegional, aTier, "Requires Steam to run", new ITexture[0]); +onConfigLoad(); +/* 24: */ } +/* 25: */ +/* 26: */ public GT_MetaTileEntity_SteamTurbine(String aName, int aTier, String aDescription, ITexture[][][] aTextures) +/* 27: */ { +/* 28:21 */ super(aName, aTier, aDescription, aTextures); +onConfigLoad(); +/* 29: */ } +/* 30: */ +/* 31: */ @Override +public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) +/* 32: */ { +/* 33:26 */ return new GT_MetaTileEntity_SteamTurbine(this.mName, this.mTier, this.mDescription, this.mTextures); +/* 34: */ } +/* 35: */ +/* 36: */ @Override +public GT_Recipe.GT_Recipe_Map getRecipes() +/* 37: */ { +/* 38:31 */ return null; +/* 39: */ } +/* 40: */ +/* 41: */ @Override +public int getCapacity() +/* 42: */ { +/* 43:36 */ return 24000 * this.mTier; +/* 44: */ } + +public void onConfigLoad() +/* 39: */ { + this.mEfficiency =GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "SteamTurbine.efficiency.tier."+this.mTier, (200 / consumedFluidPerOperation(GT_ModHandler.getSteam(1L)))); +} +/* 45: */ +/* 46: */ @Override +public int getEfficiency() +/* 47: */ { +/* 48:41 */ return this.mEfficiency; +/* 49: */ } +/* 50: */ +/* 51: */ @Override +public int getFuelValue(FluidStack aLiquid) +/* 52: */ { +/* 53:46 */ return GT_ModHandler.isSteam(aLiquid) ? 1 : 0; +/* 54: */ } +/* 55: */ +/* 56: */ @Override +public int consumedFluidPerOperation(FluidStack aLiquid) +/* 57: */ { +/* 58:51 */ return 2 + this.mTier; +/* 59: */ } +/* 60: */ +/* 61: */ @Override +public ITexture[] getFront(byte aColor) +/* 62: */ { +/* 63:54 */ return new ITexture[] { super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_FRONT), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] }; +/* 64: */ } +/* 65: */ +/* 66: */ @Override +public ITexture[] getBack(byte aColor) +/* 67: */ { +/* 68:55 */ return new ITexture[] { super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_BACK) }; +/* 69: */ } +/* 70: */ +/* 71: */ @Override +public ITexture[] getBottom(byte aColor) +/* 72: */ { +/* 73:56 */ return new ITexture[] { super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_BOTTOM) }; +/* 74: */ } +/* 75: */ +/* 76: */ @Override +public ITexture[] getTop(byte aColor) +/* 77: */ { +/* 78:57 */ return new ITexture[] { super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_TOP) }; +/* 79: */ } +/* 80: */ +/* 81: */ @Override +public ITexture[] getSides(byte aColor) +/* 82: */ { +/* 83:58 */ return new ITexture[] { super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_SIDE) }; +/* 84: */ } +/* 85: */ +/* 86: */ @Override +public ITexture[] getFrontActive(byte aColor) +/* 87: */ { +/* 88:59 */ return new ITexture[] { super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_FRONT_ACTIVE), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] }; +/* 89: */ } +/* 90: */ +/* 91: */ @Override +public ITexture[] getBackActive(byte aColor) +/* 92: */ { +/* 93:60 */ return new ITexture[] { super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_BACK_ACTIVE) }; +/* 94: */ } +/* 95: */ +/* 96: */ @Override +public ITexture[] getBottomActive(byte aColor) +/* 97: */ { +/* 98:61 */ return new ITexture[] { super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_BOTTOM_ACTIVE) }; +/* 99: */ } +/* :0: */ +/* :1: */ @Override +public ITexture[] getTopActive(byte aColor) +/* :2: */ { +/* :3:62 */ return new ITexture[] { super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_TOP_ACTIVE) }; +/* :4: */ } +/* :5: */ +/* :6: */ @Override +public ITexture[] getSidesActive(byte aColor) +/* :7: */ { +/* :8:63 */ return new ITexture[] { super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_SIDE_ACTIVE) }; +/* :9: */ } +/* ;0: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.tileentities.generators.GT_MetaTileEntity_SteamTurbine + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Bronze.java new file mode 100644 index 0000000..b8f74d6 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Bronze.java @@ -0,0 +1,48 @@ +/* 1: */ package gregtech.common.tileentities.machines; +/* 2: */ +/* 3: */ import gregtech.api.enums.Dyes; +import gregtech.api.enums.Textures; +/* 5: */ import gregtech.api.interfaces.ITexture; +/* 6: */ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +/* 7: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 8: */ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicHull_NonElectric; +/* 9: */ import gregtech.api.objects.GT_RenderedTexture; +/* 10: */ +/* 11: */ public class GT_MetaTileEntity_BasicHull_Bronze +/* 12: */ extends GT_MetaTileEntity_BasicHull_NonElectric +/* 13: */ { +/* 14: */ public GT_MetaTileEntity_BasicHull_Bronze(int aID, String aName, String aNameRegional, int aTier, String aDescription) +/* 15: */ { +/* 16:13 */ super(aID, aName, aNameRegional, aTier, aDescription); +/* 17: */ } +/* 18: */ +/* 19: */ public GT_MetaTileEntity_BasicHull_Bronze(String aName, int aTier, String aDescription, ITexture[][][] aTextures) +/* 20: */ { +/* 21:17 */ super(aName, aTier, aDescription, aTextures); +/* 22: */ } +/* 23: */ +/* 24: */ @Override +public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) +/* 25: */ { +/* 26:22 */ return new GT_MetaTileEntity_BasicHull_Bronze(this.mName, this.mTier, this.mDescription, this.mTextures); +/* 27: */ } +/* 28: */ +/* 29: */ @Override +public ITexture[][][] getTextureSet(ITexture[] aTextures) +/* 30: */ { +/* 31:27 */ ITexture[][][] rTextures = new ITexture[3][17][]; +/* 32:28 */ for (byte i = -1; i < 16; i = (byte)(i + 1)) +/* 33: */ { +/* 34:29 */ rTextures[0][(i + 1)] = new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZE_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; +/* 35:30 */ rTextures[1][(i + 1)] = new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZE_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; +/* 36:31 */ rTextures[2][(i + 1)] = new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZE_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; +/* 37: */ } +/* 38:33 */ return rTextures; +/* 39: */ } +/* 40: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.tileentities.machines.GT_MetaTileEntity_BasicHull_Bronze + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_BronzeBricks.java b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_BronzeBricks.java new file mode 100644 index 0000000..a952594 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_BronzeBricks.java @@ -0,0 +1,51 @@ +/* 1: */ package gregtech.common.tileentities.machines; +/* 2: */ +/* 3: */ +import gregtech.api.enums.Dyes; +import gregtech.api.enums.Textures; +/* 5: */ import gregtech.api.interfaces.ITexture; +/* 6: */ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +/* 7: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 8: */ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicHull_NonElectric; +/* 9: */ import gregtech.api.objects.GT_RenderedTexture; +/* 10: */ +/* 11: */ public class GT_MetaTileEntity_BasicHull_BronzeBricks +/* 12: */ extends GT_MetaTileEntity_BasicHull_NonElectric +/* 13: */ { +/* 14: */ public GT_MetaTileEntity_BasicHull_BronzeBricks(int aID, String aName, String aNameRegional, int aTier, String aDescription) +/* 15: */ { +/* 16:13 */ super(aID, aName, aNameRegional, aTier, aDescription); +/* 17: */ } +/* 18: */ +/* 19: */ public GT_MetaTileEntity_BasicHull_BronzeBricks(String aName, int aTier, String aDescription, ITexture[][][] aTextures) +/* 20: */ { +/* 21:17 */ super(aName, aTier, aDescription, aTextures); +/* 22: */ } +/* 23: */ +/* 24: */ @Override +public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) +/* 25: */ { +/* 26:22 */ return new GT_MetaTileEntity_BasicHull_BronzeBricks(this.mName, this.mTier, this.mDescription, this.mTextures); +/* 27: */ } +/* 28: */ +/* 29: */ @Override +public ITexture[][][] getTextureSet(ITexture[] aTextures) +/* 30: */ { +/* 31:27 */ ITexture[][][] rTextures = new ITexture[3][17][]; +/* 32:28 */ for (byte i = -1; i < 16; i = (byte)(i + 1)) +/* 33: */ {ITexture[] tmp0 ={ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; +/* 34:29 */ rTextures[0][(i + 1)] = tmp0; +/* 35:30 */ ITexture[] tmp1 = { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; +rTextures[1][(i + 1)] =tmp1; +/* 36:31 */ ITexture[] tmp2 ={ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; +rTextures[2][(i + 1)] = tmp2; +/* 37: */ } +/* 38:33 */ return rTextures; +/* 39: */ } +/* 40: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.tileentities.machines.GT_MetaTileEntity_BasicHull_BronzeBricks + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Steel.java b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Steel.java new file mode 100644 index 0000000..f923ace --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Steel.java @@ -0,0 +1,50 @@ +/* 1: */ package gregtech.common.tileentities.machines; +/* 2: */ +/* 3: */ import gregtech.api.enums.Dyes; +import gregtech.api.enums.Textures; +/* 5: */ import gregtech.api.interfaces.ITexture; +/* 6: */ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +/* 7: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 8: */ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicHull_NonElectric; +/* 9: */ import gregtech.api.objects.GT_RenderedTexture; +/* 10: */ +/* 11: */ public class GT_MetaTileEntity_BasicHull_Steel +/* 12: */ extends GT_MetaTileEntity_BasicHull_NonElectric +/* 13: */ { +/* 14: */ public GT_MetaTileEntity_BasicHull_Steel(int aID, String aName, String aNameRegional, int aTier, String aDescription) +/* 15: */ { +/* 16:13 */ super(aID, aName, aNameRegional, aTier, aDescription); +/* 17: */ } +/* 18: */ +/* 19: */ public GT_MetaTileEntity_BasicHull_Steel(String aName, int aTier, String aDescription, ITexture[][][] aTextures) +/* 20: */ { +/* 21:17 */ super(aName, aTier, aDescription, aTextures); +/* 22: */ } +/* 23: */ +/* 24: */ @Override +public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) +/* 25: */ { +/* 26:22 */ return new GT_MetaTileEntity_BasicHull_Steel(this.mName, this.mTier, this.mDescription, this.mTextures); +/* 27: */ } +/* 28: */ +/* 29: */ @Override +public ITexture[][][] getTextureSet(ITexture[] aTextures) +/* 30: */ { +/* 31:27 */ ITexture[][][] rTextures = new ITexture[3][17][]; +/* 32:28 */ for (byte i = -1; i < 16; i = (byte)(i + 1)) +/* 33: */ {ITexture[] tmp0 ={ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEEL_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; +/* 34:29 */ rTextures[0][(i + 1)] = tmp0; +/* 35:30 */ ITexture[] tmp1 ={ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEEL_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; +rTextures[1][(i + 1)] = tmp1; +/* 36:31 */ ITexture[] tmp2 = { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEEL_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; +rTextures[2][(i + 1)] =tmp2; +/* 37: */ } +/* 38:33 */ return rTextures; +/* 39: */ } +/* 40: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.tileentities.machines.GT_MetaTileEntity_BasicHull_Steel + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_SteelBricks.java b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_SteelBricks.java new file mode 100644 index 0000000..a4cb828 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_SteelBricks.java @@ -0,0 +1,50 @@ +/* 1: */ package gregtech.common.tileentities.machines; +/* 2: */ +/* 3: */ import gregtech.api.enums.Dyes; +import gregtech.api.enums.Textures; +/* 5: */ import gregtech.api.interfaces.ITexture; +/* 6: */ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +/* 7: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 8: */ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicHull_NonElectric; +/* 9: */ import gregtech.api.objects.GT_RenderedTexture; +/* 10: */ +/* 11: */ public class GT_MetaTileEntity_BasicHull_SteelBricks +/* 12: */ extends GT_MetaTileEntity_BasicHull_NonElectric +/* 13: */ { +/* 14: */ public GT_MetaTileEntity_BasicHull_SteelBricks(int aID, String aName, String aNameRegional, int aTier, String aDescription) +/* 15: */ { +/* 16:13 */ super(aID, aName, aNameRegional, aTier, aDescription); +/* 17: */ } +/* 18: */ +/* 19: */ public GT_MetaTileEntity_BasicHull_SteelBricks(String aName, int aTier, String aDescription, ITexture[][][] aTextures) +/* 20: */ { +/* 21:17 */ super(aName, aTier, aDescription, aTextures); +/* 22: */ } +/* 23: */ +/* 24: */ @Override +public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) +/* 25: */ { +/* 26:22 */ return new GT_MetaTileEntity_BasicHull_SteelBricks(this.mName, this.mTier, this.mDescription, this.mTextures); +/* 27: */ } +/* 28: */ +/* 29: */ @Override +public ITexture[][][] getTextureSet(ITexture[] aTextures) +/* 30: */ { +/* 31:27 */ ITexture[][][] rTextures = new ITexture[3][17][]; +/* 32:28 */ for (byte i = -1; i < 16; i = (byte)(i + 1)) +/* 33: */ {ITexture[] tmp0 ={ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; +/* 34:29 */ rTextures[0][(i + 1)] = tmp0; +/* 35:30 */ ITexture[] tmp1 ={ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; +rTextures[1][(i + 1)] = tmp1; +/* 36:31 */ ITexture[] tmp2 ={ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; +rTextures[2][(i + 1)] = tmp2; +/* 37: */ } +/* 38:33 */ return rTextures; +/* 39: */ } +/* 40: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.tileentities.machines.GT_MetaTileEntity_BasicHull_SteelBricks + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Bronze.java new file mode 100644 index 0000000..8576411 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Bronze.java @@ -0,0 +1,130 @@ +/* 1: */ package gregtech.common.tileentities.machines.steam; +/* 2: */ +/* 3: */ import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +/* 5: */ import gregtech.api.gui.GT_GUIContainer_BasicMachine; +/* 6: */ import gregtech.api.interfaces.ITexture; +/* 7: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 8: */ import gregtech.api.metatileentity.MetaTileEntity; +/* 9: */ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_Bronze; +/* 10: */ import gregtech.api.objects.GT_RenderedTexture; +/* 11: */ import gregtech.api.util.GT_Recipe; +/* 13: */ import gregtech.api.util.GT_Utility; +/* 15: */ import net.minecraft.entity.player.InventoryPlayer; +/* 16: */ +/* 17: */ public class GT_MetaTileEntity_AlloySmelter_Bronze +/* 18: */ extends GT_MetaTileEntity_BasicMachine_Bronze +/* 19: */ { +/* 20: */ public GT_MetaTileEntity_AlloySmelter_Bronze(int aID, String aName, String aNameRegional) +/* 21: */ { +/* 22: 19 */ super(aID, aName, aNameRegional, "Combination Smelter", 2, 1, true); +/* 23: */ } +/* 24: */ +/* 25: */ public GT_MetaTileEntity_AlloySmelter_Bronze(String aName, String aDescription, ITexture[][][] aTextures) +/* 26: */ { +/* 27: 23 */ super(aName, aDescription, aTextures, 2, 1, true); +/* 28: */ } +/* 29: */ +/* 30: */ @Override +public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) +/* 31: */ { +/* 32: 28 */ return new GT_MetaTileEntity_AlloySmelter_Bronze(this.mName, this.mDescription, this.mTextures); +/* 33: */ } +/* 34: */ +/* 35: */ @Override +public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) +/* 36: */ { +/* 37: 33 */ return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "BronzeAlloySmelter.png", GT_Recipe.GT_Recipe_Map.sAlloySmelterRecipes.mUnlocalizedName); +/* 38: */ } +/* 39: */ +/* 40: */ @Override +public int checkRecipe() +/* 41: */ { +/* 42: 38 */ GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sAlloySmelterRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[1], null, getAllInputs()); +/* 43: 39 */ if ((tRecipe != null) && (canOutput(tRecipe.mOutputs)) && (tRecipe.isRecipeInputEqual(true, null, getAllInputs()))) +/* 44: */ { +/* 45: 40 */ this.mOutputItems[0] = tRecipe.getOutput(0); +/* 46: 41 */ if (tRecipe.mEUt <= 16) +/* 47: */ { +/* 48: 42 */ this.mEUt = tRecipe.mEUt; +/* 49: 43 */ this.mMaxProgresstime = (tRecipe.mDuration * 2); +/* 50: */ } +/* 51: */ else +/* 52: */ { +/* 53: 45 */ this.mEUt = tRecipe.mEUt; +/* 54: 46 */ this.mMaxProgresstime = (tRecipe.mDuration * 2); +/* 55: */ } +/* 56: 48 */ return 2; +/* 57: */ } +/* 58: 50 */ return 0; +/* 59: */ } +/* 60: */ +/* 61: */ @Override +public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) +/* 62: */ { +/* 63: 55 */ super.startSoundLoop(aIndex, aX, aY, aZ); +/* 64: 56 */ if (aIndex == 1) { +/* 65: 56 */ GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(Integer.valueOf(208)), 10, 1.0F, aX, aY, aZ); +/* 66: */ } +/* 67: */ } +/* 68: */ +/* 69: */ @Override +public void startProcess() +/* 70: */ { +/* 71: 61 */ sendLoopStart((byte)1); +/* 72: */ } +/* 73: */ +/* 74: */ @Override +public ITexture[] getSideFacingActive(byte aColor) +/* 75: */ { +/* 76: 66 */ return new ITexture[] { super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_ALLOY_SMELTER_ACTIVE) }; +/* 77: */ } +/* 78: */ +/* 79: */ @Override +public ITexture[] getSideFacingInactive(byte aColor) +/* 80: */ { +/* 81: 71 */ return new ITexture[] { super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_ALLOY_SMELTER) }; +/* 82: */ } +/* 83: */ +/* 84: */ @Override +public ITexture[] getFrontFacingActive(byte aColor) +/* 85: */ { +/* 86: 76 */ return new ITexture[] { super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_ALLOY_SMELTER_ACTIVE) }; +/* 87: */ } +/* 88: */ +/* 89: */ @Override +public ITexture[] getFrontFacingInactive(byte aColor) +/* 90: */ { +/* 91: 81 */ return new ITexture[] { super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_ALLOY_SMELTER) }; +/* 92: */ } +/* 93: */ +/* 94: */ @Override +public ITexture[] getTopFacingActive(byte aColor) +/* 95: */ { +/* 96: 86 */ return new ITexture[] { super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_ALLOY_SMELTER_ACTIVE) }; +/* 97: */ } +/* 98: */ +/* 99: */ @Override +public ITexture[] getTopFacingInactive(byte aColor) +/* 100: */ { +/* 101: 91 */ return new ITexture[] { super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_ALLOY_SMELTER) }; +/* 102: */ } +/* 103: */ +/* 104: */ @Override +public ITexture[] getBottomFacingActive(byte aColor) +/* 105: */ { +/* 106: 96 */ return new ITexture[] { super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER_ACTIVE) }; +/* 107: */ } +/* 108: */ +/* 109: */ @Override +public ITexture[] getBottomFacingInactive(byte aColor) +/* 110: */ { +/* 111:101 */ return new ITexture[] { super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER) }; +/* 112: */ } +/* 113: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.tileentities.machines.steam.GT_MetaTileEntity_AlloySmelter_Bronze + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Steel.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Steel.java new file mode 100644 index 0000000..9d44c8b --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Steel.java @@ -0,0 +1,130 @@ +/* 1: */ package gregtech.common.tileentities.machines.steam; +/* 2: */ +/* 3: */ import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +/* 5: */ import gregtech.api.gui.GT_GUIContainer_BasicMachine; +/* 6: */ import gregtech.api.interfaces.ITexture; +/* 7: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 8: */ import gregtech.api.metatileentity.MetaTileEntity; +/* 9: */ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_Steel; +/* 10: */ import gregtech.api.objects.GT_RenderedTexture; +/* 11: */ import gregtech.api.util.GT_Recipe; +/* 13: */ import gregtech.api.util.GT_Utility; +/* 15: */ import net.minecraft.entity.player.InventoryPlayer; +/* 16: */ +/* 17: */ public class GT_MetaTileEntity_AlloySmelter_Steel +/* 18: */ extends GT_MetaTileEntity_BasicMachine_Steel +/* 19: */ { +/* 20: */ public GT_MetaTileEntity_AlloySmelter_Steel(int aID, String aName, String aNameRegional) +/* 21: */ { +/* 22: 19 */ super(aID, aName, aNameRegional, "Combination Smelter", 2, 1, true); +/* 23: */ } +/* 24: */ +/* 25: */ public GT_MetaTileEntity_AlloySmelter_Steel(String aName, String aDescription, ITexture[][][] aTextures) +/* 26: */ { +/* 27: 23 */ super(aName, aDescription, aTextures, 2, 1, true); +/* 28: */ } +/* 29: */ +/* 30: */ @Override +public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) +/* 31: */ { +/* 32: 28 */ return new GT_MetaTileEntity_AlloySmelter_Steel(this.mName, this.mDescription, this.mTextures); +/* 33: */ } +/* 34: */ +/* 35: */ @Override +public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) +/* 36: */ { +/* 37: 33 */ return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "SteelAlloySmelter.png", GT_Recipe.GT_Recipe_Map.sAlloySmelterRecipes.mUnlocalizedName); +/* 38: */ } +/* 39: */ +/* 40: */ @Override +public int checkRecipe() +/* 41: */ { +/* 42: 38 */ GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sAlloySmelterRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[2], null, getAllInputs()); +/* 43: 39 */ if ((tRecipe != null) && (canOutput(tRecipe.mOutputs)) && (tRecipe.isRecipeInputEqual(true, null, getAllInputs()))) +/* 44: */ { +/* 45: 40 */ this.mOutputItems[0] = tRecipe.getOutput(0); +/* 46: 41 */ if (tRecipe.mEUt <= 16) +/* 47: */ { +/* 48: 42 */ this.mEUt = (tRecipe.mEUt * 3); +/* 49: 43 */ this.mMaxProgresstime = tRecipe.mDuration; +/* 50: */ } +/* 51: */ else +/* 52: */ { +/* 53: 45 */ this.mEUt = (tRecipe.mEUt * 3); +/* 54: 46 */ this.mMaxProgresstime = tRecipe.mDuration; +/* 55: */ } +/* 56: 48 */ return 2; +/* 57: */ } +/* 58: 50 */ return 0; +/* 59: */ } +/* 60: */ +/* 61: */ @Override +public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) +/* 62: */ { +/* 63: 55 */ super.startSoundLoop(aIndex, aX, aY, aZ); +/* 64: 56 */ if (aIndex == 1) { +/* 65: 56 */ GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(Integer.valueOf(208)), 10, 1.0F, aX, aY, aZ); +/* 66: */ } +/* 67: */ } +/* 68: */ +/* 69: */ @Override +public void startProcess() +/* 70: */ { +/* 71: 61 */ sendLoopStart((byte)1); +/* 72: */ } +/* 73: */ +/* 74: */ @Override +public ITexture[] getSideFacingActive(byte aColor) +/* 75: */ { +/* 76: 66 */ return new ITexture[] { super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_ALLOY_SMELTER_ACTIVE) }; +/* 77: */ } +/* 78: */ +/* 79: */ @Override +public ITexture[] getSideFacingInactive(byte aColor) +/* 80: */ { +/* 81: 71 */ return new ITexture[] { super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_ALLOY_SMELTER) }; +/* 82: */ } +/* 83: */ +/* 84: */ @Override +public ITexture[] getFrontFacingActive(byte aColor) +/* 85: */ { +/* 86: 76 */ return new ITexture[] { super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_ALLOY_SMELTER_ACTIVE) }; +/* 87: */ } +/* 88: */ +/* 89: */ @Override +public ITexture[] getFrontFacingInactive(byte aColor) +/* 90: */ { +/* 91: 81 */ return new ITexture[] { super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_ALLOY_SMELTER) }; +/* 92: */ } +/* 93: */ +/* 94: */ @Override +public ITexture[] getTopFacingActive(byte aColor) +/* 95: */ { +/* 96: 86 */ return new ITexture[] { super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_ALLOY_SMELTER_ACTIVE) }; +/* 97: */ } +/* 98: */ +/* 99: */ @Override +public ITexture[] getTopFacingInactive(byte aColor) +/* 100: */ { +/* 101: 91 */ return new ITexture[] { super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_ALLOY_SMELTER) }; +/* 102: */ } +/* 103: */ +/* 104: */ @Override +public ITexture[] getBottomFacingActive(byte aColor) +/* 105: */ { +/* 106: 96 */ return new ITexture[] { super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER_ACTIVE) }; +/* 107: */ } +/* 108: */ +/* 109: */ @Override +public ITexture[] getBottomFacingInactive(byte aColor) +/* 110: */ { +/* 111:101 */ return new ITexture[] { super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER) }; +/* 112: */ } +/* 113: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.tileentities.machines.steam.GT_MetaTileEntity_AlloySmelter_Steel + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Bronze.java new file mode 100644 index 0000000..a728fd9 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Bronze.java @@ -0,0 +1,128 @@ +/* 1: */ package gregtech.common.tileentities.machines.steam; +/* 2: */ +/* 3: */ import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +/* 5: */ import gregtech.api.gui.GT_GUIContainer_BasicMachine; +/* 6: */ import gregtech.api.interfaces.ITexture; +/* 7: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 8: */ import gregtech.api.metatileentity.MetaTileEntity; +/* 9: */ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_Bronze; +/* 10: */ import gregtech.api.objects.GT_RenderedTexture; +/* 11: */ import gregtech.api.util.GT_ModHandler; +/* 12: */ import gregtech.api.util.GT_Utility; +/* 14: */ import net.minecraft.entity.player.InventoryPlayer; +/* 15: */ import net.minecraft.item.ItemStack; +/* 16: */ +/* 17: */ public class GT_MetaTileEntity_Compressor_Bronze +/* 18: */ extends GT_MetaTileEntity_BasicMachine_Bronze +/* 19: */ { +/* 20: */ public GT_MetaTileEntity_Compressor_Bronze(int aID, String aName, String aNameRegional) +/* 21: */ { +/* 22:18 */ super(aID, aName, aNameRegional, "Compressing Items", 1, 1, false); +/* 23: */ } +/* 24: */ +/* 25: */ public GT_MetaTileEntity_Compressor_Bronze(String aName, String aDescription, ITexture[][][] aTextures) +/* 26: */ { +/* 27:22 */ super(aName, aDescription, aTextures, 1, 1, false); +/* 28: */ } +/* 29: */ +/* 30: */ @Override +public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) +/* 31: */ { +/* 32:27 */ return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "BronzeCompressor.png", "ic2.compressor"); +/* 33: */ } +/* 34: */ +/* 35: */ @Override +public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) +/* 36: */ { +/* 37:32 */ return new GT_MetaTileEntity_Compressor_Bronze(this.mName, this.mDescription, this.mTextures); +/* 38: */ } +/* 39: */ +/* 40: */ @Override +public int checkRecipe() +/* 41: */ { +/* 42:37 */ if (null != (this.mOutputItems[0] = GT_ModHandler.getCompressorOutput(getInputAt(0), true, getOutputAt(0)))) +/* 43: */ { +/* 44:38 */ this.mEUt = 2; +/* 45:39 */ this.mMaxProgresstime = 800; +/* 46:40 */ return 2; +/* 47: */ } +/* 48:42 */ return 0; +/* 49: */ } +/* 50: */ +/* 51: */ @Override +public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) +/* 52: */ { + if (!super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) {return false;} +/* 54:47 */ return GT_ModHandler.getCompressorOutput(GT_Utility.copyAmount(64L, new Object[] { aStack }), false, null) != null; +/* 55: */ } +/* 56: */ +/* 57: */ @Override +public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) +/* 58: */ { +/* 59:52 */ super.startSoundLoop(aIndex, aX, aY, aZ); +/* 60:53 */ if (aIndex == 1) { +/* 61:53 */ GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(Integer.valueOf(203)), 10, 1.0F, aX, aY, aZ); +/* 62: */ } +/* 63: */ } +/* 64: */ +/* 65: */ @Override +public void startProcess() +/* 66: */ { +/* 67:58 */ sendLoopStart((byte)1); +/* 68: */ } +/* 69: */ +/* 70: */ @Override +public ITexture[] getSideFacingActive(byte aColor) +/* 71: */ { +/* 72:63 */ return new ITexture[] { super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_COMPRESSOR_ACTIVE) }; +/* 73: */ } +/* 74: */ +/* 75: */ @Override +public ITexture[] getSideFacingInactive(byte aColor) +/* 76: */ { +/* 77:68 */ return new ITexture[] { super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_COMPRESSOR) }; +/* 78: */ } +/* 79: */ +/* 80: */ @Override +public ITexture[] getFrontFacingActive(byte aColor) +/* 81: */ { +/* 82:73 */ return new ITexture[] { super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_COMPRESSOR_ACTIVE) }; +/* 83: */ } +/* 84: */ +/* 85: */ @Override +public ITexture[] getFrontFacingInactive(byte aColor) +/* 86: */ { +/* 87:78 */ return new ITexture[] { super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_COMPRESSOR) }; +/* 88: */ } +/* 89: */ +/* 90: */ @Override +public ITexture[] getTopFacingActive(byte aColor) +/* 91: */ { +/* 92:83 */ return new ITexture[] { super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_COMPRESSOR_ACTIVE) }; +/* 93: */ } +/* 94: */ +/* 95: */ @Override +public ITexture[] getTopFacingInactive(byte aColor) +/* 96: */ { +/* 97:88 */ return new ITexture[] { super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_COMPRESSOR) }; +/* 98: */ } +/* 99: */ +/* :0: */ @Override +public ITexture[] getBottomFacingActive(byte aColor) +/* :1: */ { +/* :2:93 */ return new ITexture[] { super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_COMPRESSOR_ACTIVE) }; +/* :3: */ } +/* :4: */ +/* :5: */ @Override +public ITexture[] getBottomFacingInactive(byte aColor) +/* :6: */ { +/* :7:98 */ return new ITexture[] { super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_COMPRESSOR) }; +/* :8: */ } +/* :9: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.tileentities.machines.steam.GT_MetaTileEntity_Compressor_Bronze + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Steel.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Steel.java new file mode 100644 index 0000000..00cf439 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Steel.java @@ -0,0 +1,128 @@ +/* 1: */ package gregtech.common.tileentities.machines.steam; +/* 2: */ +/* 3: */ import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +/* 5: */ import gregtech.api.gui.GT_GUIContainer_BasicMachine; +/* 6: */ import gregtech.api.interfaces.ITexture; +/* 7: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 8: */ import gregtech.api.metatileentity.MetaTileEntity; +/* 9: */ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_Steel; +/* 10: */ import gregtech.api.objects.GT_RenderedTexture; +/* 11: */ import gregtech.api.util.GT_ModHandler; +/* 12: */ import gregtech.api.util.GT_Utility; +/* 14: */ import net.minecraft.entity.player.InventoryPlayer; +/* 15: */ import net.minecraft.item.ItemStack; +/* 16: */ +/* 17: */ public class GT_MetaTileEntity_Compressor_Steel +/* 18: */ extends GT_MetaTileEntity_BasicMachine_Steel +/* 19: */ { +/* 20: */ public GT_MetaTileEntity_Compressor_Steel(int aID, String aName, String aNameRegional) +/* 21: */ { +/* 22:18 */ super(aID, aName, aNameRegional, "Compressing Items", 1, 1, false); +/* 23: */ } +/* 24: */ +/* 25: */ public GT_MetaTileEntity_Compressor_Steel(String aName, String aDescription, ITexture[][][] aTextures) +/* 26: */ { +/* 27:22 */ super(aName, aDescription, aTextures, 1, 1, false); +/* 28: */ } +/* 29: */ +/* 30: */ @Override +public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) +/* 31: */ { +/* 32:27 */ return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "SteelCompressor.png", "ic2.compressor"); +/* 33: */ } +/* 34: */ +/* 35: */ @Override +public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) +/* 36: */ { +/* 37:32 */ return new GT_MetaTileEntity_Compressor_Steel(this.mName, this.mDescription, this.mTextures); +/* 38: */ } +/* 39: */ +/* 40: */ @Override +public int checkRecipe() +/* 41: */ { +/* 42:37 */ if (null != (this.mOutputItems[0] = GT_ModHandler.getCompressorOutput(getInputAt(0), true, getOutputAt(0)))) +/* 43: */ { +/* 44:38 */ this.mEUt = 6; +/* 45:39 */ this.mMaxProgresstime = 400; +/* 46:40 */ return 2; +/* 47: */ } +/* 48:42 */ return 0; +/* 49: */ } +/* 50: */ +/* 51: */ @Override +public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) +/* 52: */ { + if (!super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) {return false;} +/* 54:47 */ return GT_ModHandler.getCompressorOutput(GT_Utility.copyAmount(64L, new Object[] { aStack }), false, null) != null; +/* 55: */ } +/* 56: */ +/* 57: */ @Override +public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) +/* 58: */ { +/* 59:52 */ super.startSoundLoop(aIndex, aX, aY, aZ); +/* 60:53 */ if (aIndex == 1) { +/* 61:53 */ GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(Integer.valueOf(203)), 10, 1.0F, aX, aY, aZ); +/* 62: */ } +/* 63: */ } +/* 64: */ +/* 65: */ @Override +public void startProcess() +/* 66: */ { +/* 67:58 */ sendLoopStart((byte)1); +/* 68: */ } +/* 69: */ +/* 70: */ @Override +public ITexture[] getSideFacingActive(byte aColor) +/* 71: */ { +/* 72:63 */ return new ITexture[] { super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_COMPRESSOR_ACTIVE) }; +/* 73: */ } +/* 74: */ +/* 75: */ @Override +public ITexture[] getSideFacingInactive(byte aColor) +/* 76: */ { +/* 77:68 */ return new ITexture[] { super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_COMPRESSOR) }; +/* 78: */ } +/* 79: */ +/* 80: */ @Override +public ITexture[] getFrontFacingActive(byte aColor) +/* 81: */ { +/* 82:73 */ return new ITexture[] { super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_COMPRESSOR_ACTIVE) }; +/* 83: */ } +/* 84: */ +/* 85: */ @Override +public ITexture[] getFrontFacingInactive(byte aColor) +/* 86: */ { +/* 87:78 */ return new ITexture[] { super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_COMPRESSOR) }; +/* 88: */ } +/* 89: */ +/* 90: */ @Override +public ITexture[] getTopFacingActive(byte aColor) +/* 91: */ { +/* 92:83 */ return new ITexture[] { super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_COMPRESSOR_ACTIVE) }; +/* 93: */ } +/* 94: */ +/* 95: */ @Override +public ITexture[] getTopFacingInactive(byte aColor) +/* 96: */ { +/* 97:88 */ return new ITexture[] { super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_COMPRESSOR) }; +/* 98: */ } +/* 99: */ +/* :0: */ @Override +public ITexture[] getBottomFacingActive(byte aColor) +/* :1: */ { +/* :2:93 */ return new ITexture[] { super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_COMPRESSOR_ACTIVE) }; +/* :3: */ } +/* :4: */ +/* :5: */ @Override +public ITexture[] getBottomFacingInactive(byte aColor) +/* :6: */ { +/* :7:98 */ return new ITexture[] { super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_COMPRESSOR) }; +/* :8: */ } +/* :9: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.tileentities.machines.steam.GT_MetaTileEntity_Compressor_Steel + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Bronze.java new file mode 100644 index 0000000..e74a25f --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Bronze.java @@ -0,0 +1,128 @@ +/* 1: */ package gregtech.common.tileentities.machines.steam; +/* 2: */ +/* 3: */ import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +/* 5: */ import gregtech.api.gui.GT_GUIContainer_BasicMachine; +/* 6: */ import gregtech.api.interfaces.ITexture; +/* 7: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 8: */ import gregtech.api.metatileentity.MetaTileEntity; +/* 9: */ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_Bronze; +/* 10: */ import gregtech.api.objects.GT_RenderedTexture; +/* 11: */ import gregtech.api.util.GT_ModHandler; +/* 12: */ import gregtech.api.util.GT_Utility; +/* 14: */ import net.minecraft.entity.player.InventoryPlayer; +/* 15: */ import net.minecraft.item.ItemStack; +/* 16: */ +/* 17: */ public class GT_MetaTileEntity_Extractor_Bronze +/* 18: */ extends GT_MetaTileEntity_BasicMachine_Bronze +/* 19: */ { +/* 20: */ public GT_MetaTileEntity_Extractor_Bronze(int aID, String aName, String aNameRegional) +/* 21: */ { +/* 22:18 */ super(aID, aName, aNameRegional, "Extracting your first Rubber", 1, 1, false); +/* 23: */ } +/* 24: */ +/* 25: */ public GT_MetaTileEntity_Extractor_Bronze(String aName, String aDescription, ITexture[][][] aTextures) +/* 26: */ { +/* 27:22 */ super(aName, aDescription, aTextures, 1, 1, false); +/* 28: */ } +/* 29: */ +/* 30: */ @Override +public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) +/* 31: */ { +/* 32:27 */ return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "BronzeExtractor.png", "ic2.extractor"); +/* 33: */ } +/* 34: */ +/* 35: */ @Override +public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) +/* 36: */ { +/* 37:32 */ return new GT_MetaTileEntity_Extractor_Bronze(this.mName, this.mDescription, this.mTextures); +/* 38: */ } +/* 39: */ +/* 40: */ @Override +public int checkRecipe() +/* 41: */ { +/* 42:37 */ if (null != (this.mOutputItems[0] = GT_ModHandler.getExtractorOutput(getInputAt(0), true, getOutputAt(0)))) +/* 43: */ { +/* 44:38 */ this.mEUt = 2; +/* 45:39 */ this.mMaxProgresstime = 800; +/* 46:40 */ return 2; +/* 47: */ } +/* 48:42 */ return 0; +/* 49: */ } +/* 50: */ +/* 51: */ @Override +public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) +/* 52: */ { + if (!super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) {return false;} +/* 54:47 */ return GT_ModHandler.getExtractorOutput(GT_Utility.copyAmount(64L, new Object[] { aStack }), false, null) != null; +/* 55: */ } +/* 56: */ +/* 57: */ @Override +public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) +/* 58: */ { +/* 59:52 */ super.startSoundLoop(aIndex, aX, aY, aZ); +/* 60:53 */ if (aIndex == 1) { +/* 61:53 */ GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(Integer.valueOf(200)), 10, 1.0F, aX, aY, aZ); +/* 62: */ } +/* 63: */ } +/* 64: */ +/* 65: */ @Override +public void startProcess() +/* 66: */ { +/* 67:58 */ sendLoopStart((byte)1); +/* 68: */ } +/* 69: */ +/* 70: */ @Override +public ITexture[] getSideFacingActive(byte aColor) +/* 71: */ { +/* 72:63 */ return new ITexture[] { super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_EXTRACTOR_ACTIVE) }; +/* 73: */ } +/* 74: */ +/* 75: */ @Override +public ITexture[] getSideFacingInactive(byte aColor) +/* 76: */ { +/* 77:68 */ return new ITexture[] { super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_EXTRACTOR) }; +/* 78: */ } +/* 79: */ +/* 80: */ @Override +public ITexture[] getFrontFacingActive(byte aColor) +/* 81: */ { +/* 82:73 */ return new ITexture[] { super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_EXTRACTOR_ACTIVE) }; +/* 83: */ } +/* 84: */ +/* 85: */ @Override +public ITexture[] getFrontFacingInactive(byte aColor) +/* 86: */ { +/* 87:78 */ return new ITexture[] { super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_EXTRACTOR) }; +/* 88: */ } +/* 89: */ +/* 90: */ @Override +public ITexture[] getTopFacingActive(byte aColor) +/* 91: */ { +/* 92:83 */ return new ITexture[] { super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_EXTRACTOR_ACTIVE) }; +/* 93: */ } +/* 94: */ +/* 95: */ @Override +public ITexture[] getTopFacingInactive(byte aColor) +/* 96: */ { +/* 97:88 */ return new ITexture[] { super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_EXTRACTOR) }; +/* 98: */ } +/* 99: */ +/* :0: */ @Override +public ITexture[] getBottomFacingActive(byte aColor) +/* :1: */ { +/* :2:93 */ return new ITexture[] { super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_EXTRACTOR_ACTIVE) }; +/* :3: */ } +/* :4: */ +/* :5: */ @Override +public ITexture[] getBottomFacingInactive(byte aColor) +/* :6: */ { +/* :7:98 */ return new ITexture[] { super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_EXTRACTOR) }; +/* :8: */ } +/* :9: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.tileentities.machines.steam.GT_MetaTileEntity_Extractor_Bronze + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Steel.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Steel.java new file mode 100644 index 0000000..43272cf --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Steel.java @@ -0,0 +1,128 @@ +/* 1: */ package gregtech.common.tileentities.machines.steam; +/* 2: */ +/* 3: */ import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +/* 5: */ import gregtech.api.gui.GT_GUIContainer_BasicMachine; +/* 6: */ import gregtech.api.interfaces.ITexture; +/* 7: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 8: */ import gregtech.api.metatileentity.MetaTileEntity; +/* 9: */ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_Steel; +/* 10: */ import gregtech.api.objects.GT_RenderedTexture; +/* 11: */ import gregtech.api.util.GT_ModHandler; +/* 12: */ import gregtech.api.util.GT_Utility; +/* 14: */ import net.minecraft.entity.player.InventoryPlayer; +/* 15: */ import net.minecraft.item.ItemStack; +/* 16: */ +/* 17: */ public class GT_MetaTileEntity_Extractor_Steel +/* 18: */ extends GT_MetaTileEntity_BasicMachine_Steel +/* 19: */ { +/* 20: */ public GT_MetaTileEntity_Extractor_Steel(int aID, String aName, String aNameRegional) +/* 21: */ { +/* 22:18 */ super(aID, aName, aNameRegional, "Extracting your first Rubber", 1, 1, false); +/* 23: */ } +/* 24: */ +/* 25: */ public GT_MetaTileEntity_Extractor_Steel(String aName, String aDescription, ITexture[][][] aTextures) +/* 26: */ { +/* 27:22 */ super(aName, aDescription, aTextures, 1, 1, false); +/* 28: */ } +/* 29: */ +/* 30: */ @Override +public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) +/* 31: */ { +/* 32:27 */ return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "SteelExtractor.png", "ic2.extractor"); +/* 33: */ } +/* 34: */ +/* 35: */ @Override +public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) +/* 36: */ { +/* 37:32 */ return new GT_MetaTileEntity_Extractor_Steel(this.mName, this.mDescription, this.mTextures); +/* 38: */ } +/* 39: */ +/* 40: */ @Override +public int checkRecipe() +/* 41: */ { +/* 42:37 */ if (null != (this.mOutputItems[0] = GT_ModHandler.getExtractorOutput(getInputAt(0), true, getOutputAt(0)))) +/* 43: */ { +/* 44:38 */ this.mEUt = 6; +/* 45:39 */ this.mMaxProgresstime = 400; +/* 46:40 */ return 2; +/* 47: */ } +/* 48:42 */ return 0; +/* 49: */ } +/* 50: */ +/* 51: */ @Override +public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) +/* 52: */ { + if (!super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) {return false;} +/* 54:47 */ return GT_ModHandler.getExtractorOutput(GT_Utility.copyAmount(64L, new Object[] { aStack }), false, null) != null; +/* 55: */ } +/* 56: */ +/* 57: */ @Override +public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) +/* 58: */ { +/* 59:52 */ super.startSoundLoop(aIndex, aX, aY, aZ); +/* 60:53 */ if (aIndex == 1) { +/* 61:53 */ GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(Integer.valueOf(200)), 10, 1.0F, aX, aY, aZ); +/* 62: */ } +/* 63: */ } +/* 64: */ +/* 65: */ @Override +public void startProcess() +/* 66: */ { +/* 67:58 */ sendLoopStart((byte)1); +/* 68: */ } +/* 69: */ +/* 70: */ @Override +public ITexture[] getSideFacingActive(byte aColor) +/* 71: */ { +/* 72:63 */ return new ITexture[] { super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_EXTRACTOR_ACTIVE) }; +/* 73: */ } +/* 74: */ +/* 75: */ @Override +public ITexture[] getSideFacingInactive(byte aColor) +/* 76: */ { +/* 77:68 */ return new ITexture[] { super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_EXTRACTOR) }; +/* 78: */ } +/* 79: */ +/* 80: */ @Override +public ITexture[] getFrontFacingActive(byte aColor) +/* 81: */ { +/* 82:73 */ return new ITexture[] { super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_EXTRACTOR_ACTIVE) }; +/* 83: */ } +/* 84: */ +/* 85: */ @Override +public ITexture[] getFrontFacingInactive(byte aColor) +/* 86: */ { +/* 87:78 */ return new ITexture[] { super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_EXTRACTOR) }; +/* 88: */ } +/* 89: */ +/* 90: */ @Override +public ITexture[] getTopFacingActive(byte aColor) +/* 91: */ { +/* 92:83 */ return new ITexture[] { super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_EXTRACTOR_ACTIVE) }; +/* 93: */ } +/* 94: */ +/* 95: */ @Override +public ITexture[] getTopFacingInactive(byte aColor) +/* 96: */ { +/* 97:88 */ return new ITexture[] { super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_EXTRACTOR) }; +/* 98: */ } +/* 99: */ +/* :0: */ @Override +public ITexture[] getBottomFacingActive(byte aColor) +/* :1: */ { +/* :2:93 */ return new ITexture[] { super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_EXTRACTOR_ACTIVE) }; +/* :3: */ } +/* :4: */ +/* :5: */ @Override +public ITexture[] getBottomFacingInactive(byte aColor) +/* :6: */ { +/* :7:98 */ return new ITexture[] { super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_EXTRACTOR) }; +/* :8: */ } +/* :9: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.tileentities.machines.steam.GT_MetaTileEntity_Extractor_Steel + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Bronze.java new file mode 100644 index 0000000..58eba4c --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Bronze.java @@ -0,0 +1,130 @@ +/* 1: */ package gregtech.common.tileentities.machines.steam; +/* 2: */ +/* 3: */ import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +/* 5: */ import gregtech.api.gui.GT_GUIContainer_BasicMachine; +/* 6: */ import gregtech.api.interfaces.ITexture; +/* 7: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 8: */ import gregtech.api.metatileentity.MetaTileEntity; +/* 9: */ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_Bronze; +/* 10: */ import gregtech.api.objects.GT_RenderedTexture; +/* 11: */ import gregtech.api.util.GT_Recipe; +/* 13: */ import gregtech.api.util.GT_Utility; +/* 15: */ import net.minecraft.entity.player.InventoryPlayer; +/* 16: */ +/* 17: */ public class GT_MetaTileEntity_ForgeHammer_Bronze +/* 18: */ extends GT_MetaTileEntity_BasicMachine_Bronze +/* 19: */ { +/* 20: */ public GT_MetaTileEntity_ForgeHammer_Bronze(int aID, String aName, String aNameRegional) +/* 21: */ { +/* 22: 19 */ super(aID, aName, aNameRegional, "Forge Hammer", 1, 1, false); +/* 23: */ } +/* 24: */ +/* 25: */ public GT_MetaTileEntity_ForgeHammer_Bronze(String aName, String aDescription, ITexture[][][] aTextures) +/* 26: */ { +/* 27: 23 */ super(aName, aDescription, aTextures, 1, 1, false); +/* 28: */ } +/* 29: */ +/* 30: */ @Override +public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) +/* 31: */ { +/* 32: 28 */ return new GT_MetaTileEntity_ForgeHammer_Bronze(this.mName, this.mDescription, this.mTextures); +/* 33: */ } +/* 34: */ +/* 35: */ @Override +public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) +/* 36: */ { +/* 37: 33 */ return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "BronzeHammer.png", GT_Recipe.GT_Recipe_Map.sHammerRecipes.mUnlocalizedName, (byte)6, (byte)3); +/* 38: */ } +/* 39: */ +/* 40: */ @Override +public int checkRecipe() +/* 41: */ { +/* 42: 38 */ GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[1], null, getAllInputs()); +/* 43: 39 */ if ((tRecipe != null) && (canOutput(tRecipe.mOutputs)) && (tRecipe.isRecipeInputEqual(true, null, getAllInputs()))) +/* 44: */ { +/* 45: 40 */ this.mOutputItems[0] = tRecipe.getOutput(0); +/* 46: 41 */ if (tRecipe.mEUt <= 16) +/* 47: */ { +/* 48: 42 */ this.mEUt = tRecipe.mEUt; +/* 49: 43 */ this.mMaxProgresstime = (tRecipe.mDuration * 2); +/* 50: */ } +/* 51: */ else +/* 52: */ { +/* 53: 45 */ this.mEUt = tRecipe.mEUt; +/* 54: 46 */ this.mMaxProgresstime = (tRecipe.mDuration * 2); +/* 55: */ } +/* 56: 48 */ return 2; +/* 57: */ } +/* 58: 50 */ return 0; +/* 59: */ } +/* 60: */ +/* 61: */ @Override +public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) +/* 62: */ { +/* 63: 55 */ super.startSoundLoop(aIndex, aX, aY, aZ); +/* 64: 56 */ if (aIndex == 1) { +/* 65: 56 */ GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(Integer.valueOf(1)), 10, 1.0F, aX, aY, aZ); +/* 66: */ } +/* 67: */ } +/* 68: */ +/* 69: */ @Override +public void startProcess() +/* 70: */ { +/* 71: 61 */ sendLoopStart((byte)1); +/* 72: */ } +/* 73: */ +/* 74: */ @Override +public ITexture[] getSideFacingActive(byte aColor) +/* 75: */ { +/* 76: 66 */ return new ITexture[] { super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_HAMMER_ACTIVE) }; +/* 77: */ } +/* 78: */ +/* 79: */ @Override +public ITexture[] getSideFacingInactive(byte aColor) +/* 80: */ { +/* 81: 71 */ return new ITexture[] { super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_HAMMER) }; +/* 82: */ } +/* 83: */ +/* 84: */ @Override +public ITexture[] getFrontFacingActive(byte aColor) +/* 85: */ { +/* 86: 76 */ return new ITexture[] { super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_HAMMER_ACTIVE) }; +/* 87: */ } +/* 88: */ +/* 89: */ @Override +public ITexture[] getFrontFacingInactive(byte aColor) +/* 90: */ { +/* 91: 81 */ return new ITexture[] { super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_HAMMER) }; +/* 92: */ } +/* 93: */ +/* 94: */ @Override +public ITexture[] getTopFacingActive(byte aColor) +/* 95: */ { +/* 96: 86 */ return new ITexture[] { super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_HAMMER_ACTIVE) }; +/* 97: */ } +/* 98: */ +/* 99: */ @Override +public ITexture[] getTopFacingInactive(byte aColor) +/* 100: */ { +/* 101: 91 */ return new ITexture[] { super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_HAMMER) }; +/* 102: */ } +/* 103: */ +/* 104: */ @Override +public ITexture[] getBottomFacingActive(byte aColor) +/* 105: */ { +/* 106: 96 */ return new ITexture[] { super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_HAMMER_ACTIVE) }; +/* 107: */ } +/* 108: */ +/* 109: */ @Override +public ITexture[] getBottomFacingInactive(byte aColor) +/* 110: */ { +/* 111:101 */ return new ITexture[] { super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_HAMMER) }; +/* 112: */ } +/* 113: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.tileentities.machines.steam.GT_MetaTileEntity_ForgeHammer_Bronze + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Steel.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Steel.java new file mode 100644 index 0000000..8bd9ed7 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Steel.java @@ -0,0 +1,130 @@ +/* 1: */ package gregtech.common.tileentities.machines.steam; +/* 2: */ +/* 3: */ import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +/* 5: */ import gregtech.api.gui.GT_GUIContainer_BasicMachine; +/* 6: */ import gregtech.api.interfaces.ITexture; +/* 7: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 8: */ import gregtech.api.metatileentity.MetaTileEntity; +/* 9: */ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_Steel; +/* 10: */ import gregtech.api.objects.GT_RenderedTexture; +/* 11: */ import gregtech.api.util.GT_Recipe; +/* 13: */ import gregtech.api.util.GT_Utility; +/* 15: */ import net.minecraft.entity.player.InventoryPlayer; +/* 16: */ +/* 17: */ public class GT_MetaTileEntity_ForgeHammer_Steel +/* 18: */ extends GT_MetaTileEntity_BasicMachine_Steel +/* 19: */ { +/* 20: */ public GT_MetaTileEntity_ForgeHammer_Steel(int aID, String aName, String aNameRegional) +/* 21: */ { +/* 22: 19 */ super(aID, aName, aNameRegional, "Forge Hammer", 1, 1, false); +/* 23: */ } +/* 24: */ +/* 25: */ public GT_MetaTileEntity_ForgeHammer_Steel(String aName, String aDescription, ITexture[][][] aTextures) +/* 26: */ { +/* 27: 23 */ super(aName, aDescription, aTextures, 1, 1, false); +/* 28: */ } +/* 29: */ +/* 30: */ @Override +public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) +/* 31: */ { +/* 32: 28 */ return new GT_MetaTileEntity_ForgeHammer_Steel(this.mName, this.mDescription, this.mTextures); +/* 33: */ } +/* 34: */ +/* 35: */ @Override +public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) +/* 36: */ { +/* 37: 33 */ return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "SteelHammer.png", GT_Recipe.GT_Recipe_Map.sHammerRecipes.mUnlocalizedName, (byte)6, (byte)3); +/* 38: */ } +/* 39: */ +/* 40: */ @Override +public int checkRecipe() +/* 41: */ { +/* 42: 38 */ GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[2], null, getAllInputs()); +/* 43: 39 */ if ((tRecipe != null) && (canOutput(tRecipe.mOutputs)) && (tRecipe.isRecipeInputEqual(true, null, getAllInputs()))) +/* 44: */ { +/* 45: 40 */ this.mOutputItems[0] = tRecipe.getOutput(0); +/* 46: 41 */ if (tRecipe.mEUt <= 16) +/* 47: */ { +/* 48: 42 */ this.mEUt = (tRecipe.mEUt * 3); +/* 49: 43 */ this.mMaxProgresstime = tRecipe.mDuration; +/* 50: */ } +/* 51: */ else +/* 52: */ { +/* 53: 45 */ this.mEUt = (tRecipe.mEUt * 3); +/* 54: 46 */ this.mMaxProgresstime = tRecipe.mDuration; +/* 55: */ } +/* 56: 48 */ return 2; +/* 57: */ } +/* 58: 50 */ return 0; +/* 59: */ } +/* 60: */ +/* 61: */ @Override +public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) +/* 62: */ { +/* 63: 55 */ super.startSoundLoop(aIndex, aX, aY, aZ); +/* 64: 56 */ if (aIndex == 1) { +/* 65: 56 */ GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(Integer.valueOf(1)), 10, 1.0F, aX, aY, aZ); +/* 66: */ } +/* 67: */ } +/* 68: */ +/* 69: */ @Override +public void startProcess() +/* 70: */ { +/* 71: 61 */ sendLoopStart((byte)1); +/* 72: */ } +/* 73: */ +/* 74: */ @Override +public ITexture[] getSideFacingActive(byte aColor) +/* 75: */ { +/* 76: 66 */ return new ITexture[] { super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_HAMMER_ACTIVE) }; +/* 77: */ } +/* 78: */ +/* 79: */ @Override +public ITexture[] getSideFacingInactive(byte aColor) +/* 80: */ { +/* 81: 71 */ return new ITexture[] { super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_HAMMER) }; +/* 82: */ } +/* 83: */ +/* 84: */ @Override +public ITexture[] getFrontFacingActive(byte aColor) +/* 85: */ { +/* 86: 76 */ return new ITexture[] { super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_HAMMER_ACTIVE) }; +/* 87: */ } +/* 88: */ +/* 89: */ @Override +public ITexture[] getFrontFacingInactive(byte aColor) +/* 90: */ { +/* 91: 81 */ return new ITexture[] { super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_HAMMER) }; +/* 92: */ } +/* 93: */ +/* 94: */ @Override +public ITexture[] getTopFacingActive(byte aColor) +/* 95: */ { +/* 96: 86 */ return new ITexture[] { super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_HAMMER_ACTIVE) }; +/* 97: */ } +/* 98: */ +/* 99: */ @Override +public ITexture[] getTopFacingInactive(byte aColor) +/* 100: */ { +/* 101: 91 */ return new ITexture[] { super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_HAMMER) }; +/* 102: */ } +/* 103: */ +/* 104: */ @Override +public ITexture[] getBottomFacingActive(byte aColor) +/* 105: */ { +/* 106: 96 */ return new ITexture[] { super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_HAMMER_ACTIVE) }; +/* 107: */ } +/* 108: */ +/* 109: */ @Override +public ITexture[] getBottomFacingInactive(byte aColor) +/* 110: */ { +/* 111:101 */ return new ITexture[] { super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_HAMMER) }; +/* 112: */ } +/* 113: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.tileentities.machines.steam.GT_MetaTileEntity_ForgeHammer_Steel + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Bronze.java new file mode 100644 index 0000000..d961830 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Bronze.java @@ -0,0 +1,128 @@ +/* 1: */ package gregtech.common.tileentities.machines.steam; +/* 2: */ +/* 3: */ import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +/* 5: */ import gregtech.api.gui.GT_GUIContainer_BasicMachine; +/* 6: */ import gregtech.api.interfaces.ITexture; +/* 7: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 8: */ import gregtech.api.metatileentity.MetaTileEntity; +/* 9: */ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_Bronze; +/* 10: */ import gregtech.api.objects.GT_RenderedTexture; +/* 11: */ import gregtech.api.util.GT_ModHandler; +/* 12: */ import gregtech.api.util.GT_Utility; +/* 14: */ import net.minecraft.entity.player.InventoryPlayer; +/* 15: */ import net.minecraft.item.ItemStack; +/* 16: */ +/* 17: */ public class GT_MetaTileEntity_Furnace_Bronze +/* 18: */ extends GT_MetaTileEntity_BasicMachine_Bronze +/* 19: */ { +/* 20: */ public GT_MetaTileEntity_Furnace_Bronze(int aID, String aName, String aNameRegional) +/* 21: */ { +/* 22:18 */ super(aID, aName, aNameRegional, "Smelting things with compressed Steam", 1, 1, true); +/* 23: */ } +/* 24: */ +/* 25: */ public GT_MetaTileEntity_Furnace_Bronze(String aName, String aDescription, ITexture[][][] aTextures) +/* 26: */ { +/* 27:22 */ super(aName, aDescription, aTextures, 1, 1, true); +/* 28: */ } +/* 29: */ +/* 30: */ @Override +public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) +/* 31: */ { +/* 32:27 */ return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "BronzeFurnace.png", "smelting"); +/* 33: */ } +/* 34: */ +/* 35: */ @Override +public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) +/* 36: */ { +/* 37:32 */ return new GT_MetaTileEntity_Furnace_Bronze(this.mName, this.mDescription, this.mTextures); +/* 38: */ } +/* 39: */ +/* 40: */ @Override +public int checkRecipe() +/* 41: */ { +/* 42:37 */ if (null != (this.mOutputItems[0] = GT_ModHandler.getSmeltingOutput(getInputAt(0), true, getOutputAt(0)))) +/* 43: */ { +/* 44:38 */ this.mEUt = 4; +/* 45:39 */ this.mMaxProgresstime = 256; +/* 46:40 */ return 2; +/* 47: */ } +/* 48:42 */ return 0; +/* 49: */ } +/* 50: */ +/* 51: */ @Override +public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) +/* 52: */ { + if (!super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) {return false;} +/* 54:47 */ return GT_ModHandler.getSmeltingOutput(GT_Utility.copyAmount(64L, new Object[] { aStack }), false, null) != null; +/* 55: */ } +/* 56: */ +/* 57: */ @Override +public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) +/* 58: */ { +/* 59:52 */ super.startSoundLoop(aIndex, aX, aY, aZ); +/* 60:53 */ if (aIndex == 1) { +/* 61:53 */ GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(Integer.valueOf(207)), 10, 1.0F, aX, aY, aZ); +/* 62: */ } +/* 63: */ } +/* 64: */ +/* 65: */ @Override +public void startProcess() +/* 66: */ { +/* 67:58 */ sendLoopStart((byte)1); +/* 68: */ } +/* 69: */ +/* 70: */ @Override +public ITexture[] getSideFacingActive(byte aColor) +/* 71: */ { +/* 72:63 */ return new ITexture[] { super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_FURNACE_ACTIVE) }; +/* 73: */ } +/* 74: */ +/* 75: */ @Override +public ITexture[] getSideFacingInactive(byte aColor) +/* 76: */ { +/* 77:68 */ return new ITexture[] { super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_FURNACE) }; +/* 78: */ } +/* 79: */ +/* 80: */ @Override +public ITexture[] getFrontFacingActive(byte aColor) +/* 81: */ { +/* 82:73 */ return new ITexture[] { super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_FURNACE_ACTIVE) }; +/* 83: */ } +/* 84: */ +/* 85: */ @Override +public ITexture[] getFrontFacingInactive(byte aColor) +/* 86: */ { +/* 87:78 */ return new ITexture[] { super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_FURNACE) }; +/* 88: */ } +/* 89: */ +/* 90: */ @Override +public ITexture[] getTopFacingActive(byte aColor) +/* 91: */ { +/* 92:83 */ return new ITexture[] { super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_FURNACE_ACTIVE) }; +/* 93: */ } +/* 94: */ +/* 95: */ @Override +public ITexture[] getTopFacingInactive(byte aColor) +/* 96: */ { +/* 97:88 */ return new ITexture[] { super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_FURNACE) }; +/* 98: */ } +/* 99: */ +/* :0: */ @Override +public ITexture[] getBottomFacingActive(byte aColor) +/* :1: */ { +/* :2:93 */ return new ITexture[] { super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_FURNACE_ACTIVE) }; +/* :3: */ } +/* :4: */ +/* :5: */ @Override +public ITexture[] getBottomFacingInactive(byte aColor) +/* :6: */ { +/* :7:98 */ return new ITexture[] { super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_FURNACE) }; +/* :8: */ } +/* :9: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.tileentities.machines.steam.GT_MetaTileEntity_Furnace_Bronze + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Steel.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Steel.java new file mode 100644 index 0000000..c286c19 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Steel.java @@ -0,0 +1,128 @@ +/* 1: */ package gregtech.common.tileentities.machines.steam; +/* 2: */ +/* 3: */ import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +/* 5: */ import gregtech.api.gui.GT_GUIContainer_BasicMachine; +/* 6: */ import gregtech.api.interfaces.ITexture; +/* 7: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 8: */ import gregtech.api.metatileentity.MetaTileEntity; +/* 9: */ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_Steel; +/* 10: */ import gregtech.api.objects.GT_RenderedTexture; +/* 11: */ import gregtech.api.util.GT_ModHandler; +/* 12: */ import gregtech.api.util.GT_Utility; +/* 14: */ import net.minecraft.entity.player.InventoryPlayer; +/* 15: */ import net.minecraft.item.ItemStack; +/* 16: */ +/* 17: */ public class GT_MetaTileEntity_Furnace_Steel +/* 18: */ extends GT_MetaTileEntity_BasicMachine_Steel +/* 19: */ { +/* 20: */ public GT_MetaTileEntity_Furnace_Steel(int aID, String aName, String aNameRegional) +/* 21: */ { +/* 22:18 */ super(aID, aName, aNameRegional, "Smelting things with compressed Steam", 1, 1, true); +/* 23: */ } +/* 24: */ +/* 25: */ public GT_MetaTileEntity_Furnace_Steel(String aName, String aDescription, ITexture[][][] aTextures) +/* 26: */ { +/* 27:22 */ super(aName, aDescription, aTextures, 1, 1, true); +/* 28: */ } +/* 29: */ +/* 30: */ @Override +public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) +/* 31: */ { +/* 32:27 */ return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "SteelFurnace.png", "smelting"); +/* 33: */ } +/* 34: */ +/* 35: */ @Override +public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) +/* 36: */ { +/* 37:32 */ return new GT_MetaTileEntity_Furnace_Steel(this.mName, this.mDescription, this.mTextures); +/* 38: */ } +/* 39: */ +/* 40: */ @Override +public int checkRecipe() +/* 41: */ { +/* 42:37 */ if (null != (this.mOutputItems[0] = GT_ModHandler.getSmeltingOutput(getInputAt(0), true, getOutputAt(0)))) +/* 43: */ { +/* 44:38 */ this.mEUt = 12; +/* 45:39 */ this.mMaxProgresstime = 128; +/* 46:40 */ return 2; +/* 47: */ } +/* 48:42 */ return 0; +/* 49: */ } +/* 50: */ +/* 51: */ @Override +public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) +/* 52: */ { + if (!super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) {return false;} +/* 54:47 */ return GT_ModHandler.getSmeltingOutput(GT_Utility.copyAmount(64L, new Object[] { aStack }), false, null) != null; +/* 55: */ } +/* 56: */ +/* 57: */ @Override +public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) +/* 58: */ { +/* 59:52 */ super.startSoundLoop(aIndex, aX, aY, aZ); +/* 60:53 */ if (aIndex == 1) { +/* 61:53 */ GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(Integer.valueOf(207)), 10, 1.0F, aX, aY, aZ); +/* 62: */ } +/* 63: */ } +/* 64: */ +/* 65: */ @Override +public void startProcess() +/* 66: */ { +/* 67:58 */ sendLoopStart((byte)1); +/* 68: */ } +/* 69: */ +/* 70: */ @Override +public ITexture[] getSideFacingActive(byte aColor) +/* 71: */ { +/* 72:63 */ return new ITexture[] { super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_FURNACE_ACTIVE) }; +/* 73: */ } +/* 74: */ +/* 75: */ @Override +public ITexture[] getSideFacingInactive(byte aColor) +/* 76: */ { +/* 77:68 */ return new ITexture[] { super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_FURNACE) }; +/* 78: */ } +/* 79: */ +/* 80: */ @Override +public ITexture[] getFrontFacingActive(byte aColor) +/* 81: */ { +/* 82:73 */ return new ITexture[] { super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_FURNACE_ACTIVE) }; +/* 83: */ } +/* 84: */ +/* 85: */ @Override +public ITexture[] getFrontFacingInactive(byte aColor) +/* 86: */ { +/* 87:78 */ return new ITexture[] { super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_FURNACE) }; +/* 88: */ } +/* 89: */ +/* 90: */ @Override +public ITexture[] getTopFacingActive(byte aColor) +/* 91: */ { +/* 92:83 */ return new ITexture[] { super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_FURNACE_ACTIVE) }; +/* 93: */ } +/* 94: */ +/* 95: */ @Override +public ITexture[] getTopFacingInactive(byte aColor) +/* 96: */ { +/* 97:88 */ return new ITexture[] { super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_FURNACE) }; +/* 98: */ } +/* 99: */ +/* :0: */ @Override +public ITexture[] getBottomFacingActive(byte aColor) +/* :1: */ { +/* :2:93 */ return new ITexture[] { super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_FURNACE_ACTIVE) }; +/* :3: */ } +/* :4: */ +/* :5: */ @Override +public ITexture[] getBottomFacingInactive(byte aColor) +/* :6: */ { +/* :7:98 */ return new ITexture[] { super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_FURNACE) }; +/* :8: */ } +/* :9: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.tileentities.machines.steam.GT_MetaTileEntity_Furnace_Steel + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Bronze.java new file mode 100644 index 0000000..d2e7772 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Bronze.java @@ -0,0 +1,135 @@ +package gregtech.common.tileentities.machines.steam; + +import java.util.Random; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +import gregtech.api.gui.GT_GUIContainer_BasicMachine; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_Bronze; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Utility; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; + +public class GT_MetaTileEntity_Macerator_Bronze + extends GT_MetaTileEntity_BasicMachine_Bronze +{ + public GT_MetaTileEntity_Macerator_Bronze(int aID, String aName, String aNameRegional) + { + super(aID, aName, aNameRegional, "Macerating your Ores", 1, 1, false); + } + + public GT_MetaTileEntity_Macerator_Bronze(String aName, String aDescription, ITexture[][][] aTextures) + { + super(aName, aDescription, aTextures, 1, 1, false); + } + + @Override +public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) + { + return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "BronzeMacerator.png", "ic2.macerator"); + } + + @Override +public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) + { + return new GT_MetaTileEntity_Macerator_Bronze(this.mName, this.mDescription, this.mTextures); + } + + @Override +public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) + { + super.onPreTick(aBaseMetaTileEntity, aTick); + if ((aBaseMetaTileEntity.isClientSide()) && (aBaseMetaTileEntity.isActive()) && (aBaseMetaTileEntity.getFrontFacing() != 1) && (aBaseMetaTileEntity.getCoverIDAtSide((byte)1) == 0) && (!aBaseMetaTileEntity.getOpacityAtSide((byte)1))) + { + Random tRandom = aBaseMetaTileEntity.getWorld().rand; + aBaseMetaTileEntity.getWorld().spawnParticle("smoke", aBaseMetaTileEntity.getXCoord() + 0.8F - tRandom.nextFloat() * 0.6F, aBaseMetaTileEntity.getYCoord() + 0.9F + tRandom.nextFloat() * 0.2F, aBaseMetaTileEntity.getZCoord() + 0.8F - tRandom.nextFloat() * 0.6F, 0.0D, 0.0D, 0.0D); + } + } + + @Override +public int checkRecipe() + { + if (null != (this.mOutputItems[0] = GT_ModHandler.getMaceratorOutput(getInputAt(0), true, getOutputAt(0)))) + { + this.mEUt = 2; + this.mMaxProgresstime = 800; + return 2; + } + return 0; + } + + @Override +public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) + { + if (!super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) {return false;} + return GT_ModHandler.getMaceratorOutput(GT_Utility.copyAmount(64L, new Object[] { aStack }), false, null) != null; + } + + @Override +public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) + { + super.startSoundLoop(aIndex, aX, aY, aZ); + if (aIndex == 1) { + GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(Integer.valueOf(201)), 10, 1.0F, aX, aY, aZ); + } + } + + @Override +public void startProcess() + { + sendLoopStart((byte)1); + } + + @Override +public ITexture[] getSideFacingActive(byte aColor) + { + return new ITexture[] { super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_MACERATOR_ACTIVE) }; + } + + @Override +public ITexture[] getSideFacingInactive(byte aColor) + { + return new ITexture[] { super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_MACERATOR) }; + } + + @Override +public ITexture[] getFrontFacingActive(byte aColor) + { + return new ITexture[] { super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_MACERATOR_ACTIVE) }; + } + + @Override +public ITexture[] getFrontFacingInactive(byte aColor) + { + return new ITexture[] { super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_MACERATOR) }; + } + + @Override +public ITexture[] getTopFacingActive(byte aColor) + { + return new ITexture[] { super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_MACERATOR_ACTIVE) }; + } + + @Override +public ITexture[] getTopFacingInactive(byte aColor) + { + return new ITexture[] { super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_MACERATOR) }; + } + + @Override +public ITexture[] getBottomFacingActive(byte aColor) + { + return new ITexture[] { super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_MACERATOR_ACTIVE) }; + } + + @Override +public ITexture[] getBottomFacingInactive(byte aColor) + { + return new ITexture[] { super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_MACERATOR) }; + } +} diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Steel.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Steel.java new file mode 100644 index 0000000..427a40c --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Steel.java @@ -0,0 +1,141 @@ +/* 1: */ package gregtech.common.tileentities.machines.steam; +/* 14: */ import java.util.Random; + +/* 2: */ +/* 3: */ import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +/* 5: */ import gregtech.api.gui.GT_GUIContainer_BasicMachine; +/* 6: */ import gregtech.api.interfaces.ITexture; +/* 7: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 8: */ import gregtech.api.metatileentity.MetaTileEntity; +/* 9: */ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_Steel; +/* 10: */ import gregtech.api.objects.GT_RenderedTexture; +/* 11: */ import gregtech.api.util.GT_ModHandler; +/* 12: */ import gregtech.api.util.GT_Utility; +/* 15: */ import net.minecraft.entity.player.InventoryPlayer; +/* 16: */ import net.minecraft.item.ItemStack; +/* 18: */ +/* 19: */ public class GT_MetaTileEntity_Macerator_Steel +/* 20: */ extends GT_MetaTileEntity_BasicMachine_Steel +/* 21: */ { +/* 22: */ public GT_MetaTileEntity_Macerator_Steel(int aID, String aName, String aNameRegional) +/* 23: */ { +/* 24: 21 */ super(aID, aName, aNameRegional, "Macerating your Ores", 1, 1, false); +/* 25: */ } +/* 26: */ +/* 27: */ public GT_MetaTileEntity_Macerator_Steel(String aName, String aDescription, ITexture[][][] aTextures) +/* 28: */ { +/* 29: 25 */ super(aName, aDescription, aTextures, 1, 1, false); +/* 30: */ } +/* 31: */ +/* 32: */ @Override +public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) +/* 33: */ { +/* 34: 30 */ return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "SteelMacerator.png", "ic2.macerator"); +/* 35: */ } +/* 36: */ +/* 37: */ @Override +public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) +/* 38: */ { +/* 39: 35 */ return new GT_MetaTileEntity_Macerator_Steel(this.mName, this.mDescription, this.mTextures); +/* 40: */ } +/* 41: */ +/* 42: */ @Override +public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) +/* 43: */ { +/* 44: 40 */ super.onPreTick(aBaseMetaTileEntity, aTick); +/* 45: 41 */ if ((aBaseMetaTileEntity.isClientSide()) && (aBaseMetaTileEntity.isActive()) && (aBaseMetaTileEntity.getFrontFacing() != 1) && (aBaseMetaTileEntity.getCoverIDAtSide((byte)1) == 0) && (!aBaseMetaTileEntity.getOpacityAtSide((byte)1))) +/* 46: */ { +/* 47: 42 */ Random tRandom = aBaseMetaTileEntity.getWorld().rand; +/* 48: 43 */ aBaseMetaTileEntity.getWorld().spawnParticle("smoke", aBaseMetaTileEntity.getXCoord() + 0.8F - tRandom.nextFloat() * 0.6F, aBaseMetaTileEntity.getYCoord() + 0.9F + tRandom.nextFloat() * 0.2F, aBaseMetaTileEntity.getZCoord() + 0.8F - tRandom.nextFloat() * 0.6F, 0.0D, 0.0D, 0.0D); +/* 49: */ } +/* 50: */ } +/* 51: */ +/* 52: */ @Override +public int checkRecipe() +/* 53: */ { +/* 54: 49 */ if (null != (this.mOutputItems[0] = GT_ModHandler.getMaceratorOutput(getInputAt(0), true, getOutputAt(0)))) +/* 55: */ { +/* 56: 50 */ this.mEUt = 6; +/* 57: 51 */ this.mMaxProgresstime = 400; +/* 58: 52 */ return 2; +/* 59: */ } +/* 60: 54 */ return 0; +/* 61: */ } +/* 62: */ +/* 63: */ @Override +public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) +/* 64: */ { + if (!super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) {return false;} +/* 66: 59 */ return GT_ModHandler.getMaceratorOutput(GT_Utility.copyAmount(64L, new Object[] { aStack }), false, null) != null; +/* 67: */ } +/* 68: */ +/* 69: */ @Override +public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) +/* 70: */ { +/* 71: 64 */ super.startSoundLoop(aIndex, aX, aY, aZ); +/* 72: 65 */ if (aIndex == 1) { +/* 73: 65 */ GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(Integer.valueOf(201)), 10, 1.0F, aX, aY, aZ); +/* 74: */ } +/* 75: */ } +/* 76: */ +/* 77: */ @Override +public void startProcess() +/* 78: */ { +/* 79: 70 */ sendLoopStart((byte)1); +/* 80: */ } +/* 81: */ +/* 82: */ @Override +public ITexture[] getSideFacingActive(byte aColor) +/* 83: */ { +/* 84: 75 */ return new ITexture[] { super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_MACERATOR_ACTIVE) }; +/* 85: */ } +/* 86: */ +/* 87: */ @Override +public ITexture[] getSideFacingInactive(byte aColor) +/* 88: */ { +/* 89: 80 */ return new ITexture[] { super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_MACERATOR) }; +/* 90: */ } +/* 91: */ +/* 92: */ @Override +public ITexture[] getFrontFacingActive(byte aColor) +/* 93: */ { +/* 94: 85 */ return new ITexture[] { super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_MACERATOR_ACTIVE) }; +/* 95: */ } +/* 96: */ +/* 97: */ @Override +public ITexture[] getFrontFacingInactive(byte aColor) +/* 98: */ { +/* 99: 90 */ return new ITexture[] { super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_MACERATOR) }; +/* 100: */ } +/* 101: */ +/* 102: */ @Override +public ITexture[] getTopFacingActive(byte aColor) +/* 103: */ { +/* 104: 95 */ return new ITexture[] { super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_MACERATOR_ACTIVE) }; +/* 105: */ } +/* 106: */ +/* 107: */ @Override +public ITexture[] getTopFacingInactive(byte aColor) +/* 108: */ { +/* 109:100 */ return new ITexture[] { super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_MACERATOR) }; +/* 110: */ } +/* 111: */ +/* 112: */ @Override +public ITexture[] getBottomFacingActive(byte aColor) +/* 113: */ { +/* 114:105 */ return new ITexture[] { super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_MACERATOR_ACTIVE) }; +/* 115: */ } +/* 116: */ +/* 117: */ @Override +public ITexture[] getBottomFacingInactive(byte aColor) +/* 118: */ { +/* 119:110 */ return new ITexture[] { super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_MACERATOR) }; +/* 120: */ } +/* 121: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.tileentities.machines.steam.GT_MetaTileEntity_Macerator_Steel + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_Locker.java b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_Locker.java new file mode 100644 index 0000000..9cc60ce --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_Locker.java @@ -0,0 +1,225 @@ +/* 1: */ package gregtech.common.tileentities.storage; +/* 2: */ +/* 3: */ import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +/* 5: */ import gregtech.api.interfaces.ITexture; +/* 6: */ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +/* 7: */ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +/* 8: */ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; +/* 9: */ import gregtech.api.objects.GT_ItemStack; +/* 10: */ import gregtech.api.objects.GT_RenderedTexture; +/* 11: */ import gregtech.api.util.GT_Utility; +/* 13: */ import net.minecraft.entity.player.EntityPlayer; +/* 15: */ import net.minecraft.item.ItemStack; +/* 16: */ import net.minecraft.nbt.NBTTagCompound; +/* 17: */ +/* 18: */ public class GT_MetaTileEntity_Locker +/* 19: */ extends GT_MetaTileEntity_TieredMachineBlock +/* 20: */ { +/* 21: 24 */ public byte mType = 0; +/* 22: */ +/* 23: */ public GT_MetaTileEntity_Locker(int aID, String aName, String aNameRegional, int aTier) +/* 24: */ { +/* 25: 27 */ super(aID, aName, aNameRegional, aTier, 4, "Stores and recharges Armor", new ITexture[0]); +/* 26: */ } +/* 27: */ +/* 28: */ public GT_MetaTileEntity_Locker(String aName, int aTier, String aDescription, ITexture[][][] aTextures) +/* 29: */ { +/* 30: 31 */ super(aName, aTier, 4, aDescription, aTextures); +/* 31: */ } +/* 32: */ +/* 33: */ @Override +public String[] getDescription() +/* 34: */ { +/* 35: 36 */ return new String[] { this.mDescription, "Click with Screwdriver to change Style" }; +/* 36: */ } +/* 37: */ +/* 38: */ @Override +public ITexture[][][] getTextureSet(ITexture[] aTextures) +/* 39: */ { +/* 40: 41 */ ITexture[][][] rTextures = new ITexture[3][17][]; +/* 41: 42 */ for (byte i = -1; i < 16; i = (byte)(i + 1)) +/* 42: */ {ITexture[] tmp0 ={ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][(i + 1)] }; +/* 43: 43 */ rTextures[0][(i + 1)] = tmp0; +/* 44: 44 */ ITexture[] tmp1 ={ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][(i + 1)], Textures.BlockIcons.OVERLAYS_ENERGY_IN[this.mTier] }; +rTextures[1][(i + 1)] = tmp1; +/* 45: 45 */ ITexture[] tmp2 = { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][(i + 1)], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_LOCKER) }; +rTextures[2][(i + 1)] =tmp2; +/* 46: */ } +/* 47: 47 */ return rTextures; +/* 48: */ } +/* 49: */ +/* 50: */ @Override +public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) +/* 51: */ { +/* 52: 52 */ if (aSide == aFacing) { +/* 53: 52 */ return new ITexture[] { this.mTextures[2][(aColorIndex + 1)][0], this.mTextures[2][(aColorIndex + 1)][1], Textures.BlockIcons.LOCKERS[java.lang.Math.abs(this.mType % Textures.BlockIcons.LOCKERS.length)] }; +/* 54: */ } +/* 55: 53 */ return this.mTextures[0][(aColorIndex + 1)]; +/* 56: */ } +/* 57: */ +/* 58: */ @Override +public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) +/* 59: */ { +/* 60: 58 */ return new GT_MetaTileEntity_Locker(this.mName, this.mTier, this.mDescription, this.mTextures); +/* 61: */ } +/* 62: */ +/* 63: */ @Override +public boolean isSimpleMachine() +/* 64: */ { +/* 65: 61 */ return false; +/* 66: */ } +/* 67: */ +/* 68: */ @Override +public boolean isElectric() +/* 69: */ { +/* 70: 62 */ return true; +/* 71: */ } +/* 72: */ +/* 73: */ @Override +public boolean isValidSlot(int aIndex) +/* 74: */ { +/* 75: 63 */ return true; +/* 76: */ } +/* 77: */ +/* 78: */ @Override +public boolean isFacingValid(byte aFacing) +/* 79: */ { +/* 80: 64 */ return aFacing > 1; +/* 81: */ } +/* 82: */ +/* 83: */ @Override +public boolean isEnetInput() +/* 84: */ { +/* 85: 65 */ return true; +/* 86: */ } +/* 87: */ +/* 88: */ @Override +public boolean isInputFacing(byte aSide) +/* 89: */ { +/* 90: 66 */ return aSide == getBaseMetaTileEntity().getBackFacing(); +/* 91: */ } +/* 92: */ +/* 93: */ @Override +public boolean isTeleporterCompatible() +/* 94: */ { +/* 95: 67 */ return false; +/* 96: */ } +/* 97: */ +/* 98: */ @Override +public long maxEUStore() +/* 99: */ { +/* 100: 68 */ return gregtech.api.enums.GT_Values.V[this.mTier] * maxAmperesIn(); +/* 101: */ } +/* 102: */ +/* 103: */ @Override +public long maxEUInput() +/* 104: */ { +/* 105: 69 */ return gregtech.api.enums.GT_Values.V[this.mTier]; +/* 106: */ } +/* 107: */ +/* 108: */ @Override +public long maxAmperesIn() +/* 109: */ { +/* 110: 70 */ return this.mInventory.length * 2; +/* 111: */ } +/* 112: */ +/* 113: */ @Override +public int rechargerSlotStartIndex() +/* 114: */ { +/* 115: 71 */ return 0; +/* 116: */ } +/* 117: */ +/* 118: */ @Override +public int rechargerSlotCount() +/* 119: */ { +/* 120: 72 */ return getBaseMetaTileEntity().isAllowedToWork() ? this.mInventory.length : 0; +/* 121: */ } +/* 122: */ +/* 123: */ @Override +public boolean isAccessAllowed(EntityPlayer aPlayer) +/* 124: */ { +/* 125: 73 */ return true; +/* 126: */ } +/* 127: */ +/* 128: */ @Override +public void saveNBTData(NBTTagCompound aNBT) +/* 129: */ { +/* 130: 77 */ aNBT.setByte("mType", this.mType); +/* 131: */ } +/* 132: */ +/* 133: */ @Override +public void loadNBTData(NBTTagCompound aNBT) +/* 134: */ { +/* 135: 82 */ this.mType = aNBT.getByte("mType"); +/* 136: */ } +/* 137: */ +/* 138: */ @Override +public void onValueUpdate(byte aValue) +/* 139: */ { +/* 140: 87 */ this.mType = aValue; +/* 141: */ } +/* 142: */ +/* 143: */ @Override +public byte getUpdateData() +/* 144: */ { +/* 145: 92 */ return this.mType; +/* 146: */ } +/* 147: */ +/* 148: */ @Override +public void doSound(byte aIndex, double aX, double aY, double aZ) +/* 149: */ { +/* 150: 97 */ if (aIndex == 16) { +/* 151: 97 */ GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(Integer.valueOf(3)), 1, 1.0F); +/* 152: */ } +/* 153: */ } +/* 154: */ +/* 155: */ @Override +public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) +/* 156: */ { +/* 157:102 */ if (aSide == getBaseMetaTileEntity().getFrontFacing()) { +/* 158:102 */ this.mType = ((byte)(this.mType + 1)); +/* 159: */ } +/* 160: */ } +/* 161: */ +/* 162: */ @Override +public boolean allowCoverOnSide(byte aSide, GT_ItemStack aStack) +/* 163: */ { +/* 164:107 */ return aSide != getBaseMetaTileEntity().getFrontFacing(); +/* 165: */ } +/* 166: */ +/* 167: */ @Override +public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) +/* 168: */ { +/* 169:112 */ if ((aBaseMetaTileEntity.isServerSide()) && (aSide == aBaseMetaTileEntity.getFrontFacing())) +/* 170: */ { +/* 171:113 */ for (int i = 0; i < 4; i++) +/* 172: */ { +/* 173:114 */ ItemStack tSwapStack = this.mInventory[i]; +/* 174:115 */ this.mInventory[i] = aPlayer.inventory.armorInventory[i]; +/* 175:116 */ aPlayer.inventory.armorInventory[i] = tSwapStack; +/* 176: */ } +/* 177:118 */ aPlayer.inventoryContainer.detectAndSendChanges(); +/* 178:119 */ sendSound((byte)16); +/* 179: */ } +/* 180:121 */ return true; +/* 181: */ } +/* 182: */ +/* 183: */ @Override +public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) +/* 184: */ { +/* 185:126 */ return false; +/* 186: */ } +/* 187: */ +/* 188: */ @Override +public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) +/* 189: */ { +/* 190:131 */ return false; +/* 191: */ } +/* 192: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.common.tileentities.storage.GT_MetaTileEntity_Locker + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumChest.java b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumChest.java new file mode 100644 index 0000000..18a9bd3 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumChest.java @@ -0,0 +1,202 @@ +package gregtech.common.tileentities.storage; + +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Utility; +import gregtech.common.gui.GT_Container_QuantumChest; +import gregtech.common.gui.GT_GUIContainer_QuantumChest; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +public class GT_MetaTileEntity_QuantumChest extends GT_MetaTileEntity_TieredMachineBlock { + public GT_MetaTileEntity_QuantumChest(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, 3, "This Chest stores "+((int)((Math.pow(6, aTier))*270000))+" Blocks"); + } + + + public int mItemCount = 0; + public ItemStack mItemStack = null; + + public GT_MetaTileEntity_QuantumChest(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, 3, aDescription, aTextures); + } + + @Override public boolean isSimpleMachine() {return true;} + @Override public boolean isFacingValid(byte aFacing) {return true;} + @Override public boolean isAccessAllowed(EntityPlayer aPlayer) {return true;} + @Override public boolean isValidSlot(int aIndex) {return true;} + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_QuantumChest(mName, mTier, mDescription, mTextures); + } + + @Override + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { + if (aBaseMetaTileEntity.isClientSide()) return true; + aBaseMetaTileEntity.openGUI(aPlayer); + return true; + } + +// public void onRightclick(EntityPlayer aPlayer) +// { +// ItemStack tPlayerItem = aPlayer.inventory.getCurrentItem(); +// if (tPlayerItem == null) +// { +// if (this.mItemID > 0) +// { +// for (int i = 0; (this.mItemCount < getMaxItemCount()) && (i < aPlayer.field_71071_by.func_70302_i_()); i++) +// { +// if ((aPlayer.field_71071_by.func_70301_a(i) != null) && (aPlayer.field_71071_by.func_70301_a(i).field_77993_c == this.mItemID) && (aPlayer.field_71071_by.func_70301_a(i).func_77960_j() == this.mItemMeta) && (!aPlayer.field_71071_by.func_70301_a(i).func_77942_o())) +// { +// this.mItemCount += aPlayer.field_71071_by.func_70301_a(i).field_77994_a; +// if (aPlayer.field_71071_by.func_70301_a(i).field_77994_a == 111) +// { +// this.mItemCount = (getMaxItemCount() + 192 - (this.mItemCount + (this.mInventory[0] == null ? 0 : this.mInventory[0].field_77994_a) + (this.mInventory[1] == null ? 0 : this.mInventory[1].field_77994_a) + (this.mInventory[2] == null ? 0 : this.mInventory[2].field_77994_a))); +// } +// else if (this.mItemCount > getMaxItemCount()) +// { +// aPlayer.field_71071_by.func_70301_a(i).field_77994_a = (this.mItemCount - getMaxItemCount()); +// this.mItemCount = getMaxItemCount(); +// } +// else +// { +// aPlayer.field_71071_by.func_70301_a(i).field_77994_a = 0; +// } +// } +// if ((aPlayer.field_71071_by.func_70301_a(i) != null) && (aPlayer.field_71071_by.func_70301_a(i).field_77994_a <= 0)) { +// aPlayer.field_71071_by.func_70299_a(i, null); +// } +// } +// GT_Utility.sendChatToPlayer(aPlayer, this.mItemCount + (this.mInventory[0] == null ? 0 : this.mInventory[0].field_77994_a) + (this.mInventory[1] == null ? 0 : this.mInventory[1].field_77994_a) + (this.mInventory[2] == null ? 0 : this.mInventory[2].field_77994_a) + " of " + new ItemStack(this.mItemID, 1, this.mItemMeta).func_82833_r()); +// } +// } +// if (aPlayer.field_71069_bz != null) { +// aPlayer.field_71069_bz.func_75142_b(); +// } +// } + + @Override + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_Container_QuantumChest(aPlayerInventory, aBaseMetaTileEntity); + } + + @Override + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_QuantumChest(aPlayerInventory, aBaseMetaTileEntity, getLocalName()); + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) { + + if (getBaseMetaTileEntity().isServerSide()&& getBaseMetaTileEntity().isAllowedToWork()) + { + if ((getItemCount() <= 0) ){ + this.mItemStack = null; + this.mItemCount = 0; + } + if (this.mItemStack == null&&this.mInventory[0]!=null) + { + this.mItemStack = mInventory[0].copy(); + } + if ((this.mInventory[0]!=null)&&(this.mItemCount < getMaxItemCount()) && GT_Utility.areStacksEqual(this.mInventory[0],this.mItemStack)) + { + this.mItemCount += this.mInventory[0].stackSize; + if (this.mItemCount > getMaxItemCount()) + { + this.mInventory[0].stackSize = (this.mItemCount - getMaxItemCount()); + this.mItemCount = getMaxItemCount(); + } + else + { + this.mInventory[0] = null; + } + } + if (this.mInventory[1] == null&&mItemStack!=null) + { + this.mInventory[1] = mItemStack.copy(); + this.mInventory[1].stackSize = Math.min(mItemStack.getMaxStackSize(), this.mItemCount); + this.mItemCount -= this.mInventory[1].stackSize; + } + else if ((this.mItemCount > 0) && GT_Utility.areStacksEqual(this.mInventory[1],this.mItemStack)&&this.mInventory[1].getMaxStackSize()>this.mInventory[1].stackSize) + { + int tmp = Math.min(this.mItemCount, this.mInventory[1].getMaxStackSize()-this.mInventory[1].stackSize); + this.mInventory[1].stackSize += tmp; + this.mItemCount -= tmp; + } + if(this.mItemStack!=null){ + this.mInventory[2]= this.mItemStack.copy(); + }else{this.mInventory[2]=null;} + } + } + + private int getItemCount() + { + return this.mItemCount; + } + + @Override + public int getProgresstime() + { + return this.mItemCount + (this.mInventory[0] == null ? 0 : this.mInventory[0].stackSize) + (this.mInventory[1] == null ? 0 : this.mInventory[1].stackSize); + } + + @Override + public int maxProgresstime() + { + return getMaxItemCount(); + } + + @Override + public int getMaxItemCount() + { + return (int) (((Math.pow(6, mTier))*270000) - 128); + } + + @Override + public void setItemCount(int aCount) + { + this.mItemCount = aCount; + } + + @Override + public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return true; + } + + @Override + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return true; + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + aNBT.setInteger("mItemCount", this.mItemCount); + if(this.mItemStack!=null) + aNBT.setTag("mItemStack", this.mItemStack.writeToNBT(new NBTTagCompound())); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + if(aNBT.hasKey("mItemCount")) + this.mItemCount = aNBT.getInteger("mItemCount"); + if(aNBT.hasKey("mItemStack")) + this.mItemStack = ItemStack.loadItemStackFromNBT((NBTTagCompound) aNBT.getTag("mItemStack")); + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity,byte aSide, byte aFacing, byte aColorIndex, boolean aActive,boolean aRedstone) { + return aSide == aBaseMetaTileEntity.getFrontFacing() ? new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex+1],new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SCREEN)} :new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex+1]};//aSide != aFacing ? mMachineBlock != 0 ? new ITexture[] {Textures.BlockIcons.CASING_BLOCKS[mMachineBlock]} : new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex+1]} : mMachineBlock != 0 ? aActive ? getTexturesActive(Textures.BlockIcons.CASING_BLOCKS[mMachineBlock]) : getTexturesInactive(Textures.BlockIcons.CASING_BLOCKS[mMachineBlock]) : aActive ? getTexturesActive(Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex+1]) : getTexturesInactive(Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex+1]); + } + + @Override + public ITexture[][][] getTextureSet(ITexture[] aTextures) { + return new ITexture[0][0][0]; + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumTank.java b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumTank.java new file mode 100644 index 0000000..599da17 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumTank.java @@ -0,0 +1,104 @@ +package gregtech.common.tileentities.storage; + +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank; +import gregtech.api.objects.GT_RenderedTexture; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; + +public class GT_MetaTileEntity_QuantumTank + extends GT_MetaTileEntity_BasicTank +{ + public GT_MetaTileEntity_QuantumTank(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, 3, "Stores "+((int)(Math.pow(6, aTier)*267000))+"L of fluid"); + } + + public GT_MetaTileEntity_QuantumTank(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, 3, aDescription, aTextures); + } + + @Override + public ITexture[][][] getTextureSet(ITexture[] aTextures) { + return new ITexture[0][0][0]; + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + return aSide ==1 ? new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex+1],new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SCREEN)} :new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex+1]}; + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + super.saveNBTData(aNBT); + } + + @Override + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { + if (aBaseMetaTileEntity.isClientSide()) return true; + aBaseMetaTileEntity.openGUI(aPlayer); + return true; + } + + @Override public boolean isSimpleMachine() {return true;} + @Override public boolean isFacingValid(byte aFacing) {return true;} + @Override public boolean isAccessAllowed(EntityPlayer aPlayer) {return true;} + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + super.loadNBTData(aNBT); + } + + @Override + public final byte getUpdateData() { + return 0x00; + } + + @Override + public boolean doesFillContainers() { + return true; + } + + @Override + public boolean doesEmptyContainers() { + return true; + } + + @Override + public boolean canTankBeFilled() { + return true; + } + + @Override + public boolean canTankBeEmptied() { + return true; + } + + @Override + public boolean displaysItemStack() { + return true; + } + + @Override + public boolean displaysStackSize() { + return false; + } + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_QuantumTank(mName, mTier, mDescription, mTextures); + } + + @Override + public int getCapacity() { + return (int) (Math.pow(6, mTier)*267000); + } + + @Override + public int getTankPressure() { + return 100; + } + +} \ No newline at end of file diff --git a/src/main/java/gregtech/nei/GT_NEI_DefaultHandler.java b/src/main/java/gregtech/nei/GT_NEI_DefaultHandler.java new file mode 100644 index 0000000..84bae6f --- /dev/null +++ b/src/main/java/gregtech/nei/GT_NEI_DefaultHandler.java @@ -0,0 +1,868 @@ +/* 1: */ package gregtech.nei; +/* 26: */ import java.awt.Point; +/* 27: */ import java.awt.Rectangle; +/* 28: */ import java.util.ArrayList; +/* 30: */ import java.util.Iterator; +/* 32: */ import java.util.List; + +/* 41: */ import org.lwjgl.opengl.GL11; + +/* 2: */ +/* 3: */ import codechicken.lib.gui.GuiDraw; +/* 4: */ import codechicken.nei.PositionedStack; +/* 5: */ import codechicken.nei.guihook.GuiContainerManager; +/* 6: */ import codechicken.nei.guihook.IContainerInputHandler; +/* 7: */ import codechicken.nei.guihook.IContainerTooltipHandler; +/* 8: */ import codechicken.nei.recipe.GuiCraftingRecipe; +/* 9: */ import codechicken.nei.recipe.GuiRecipe; +/* 10: */ import codechicken.nei.recipe.GuiUsageRecipe; +/* 11: */ import codechicken.nei.recipe.TemplateRecipeHandler; +/* 15: */ import cpw.mods.fml.common.event.FMLInterModComms; +/* 16: */ import gregtech.api.enums.GT_Values; +/* 17: */ import gregtech.api.enums.OrePrefixes; +/* 18: */ import gregtech.api.gui.GT_GUIContainer_BasicMachine; +/* 19: */ import gregtech.api.objects.ItemData; +/* 21: */ import gregtech.api.util.GT_LanguageManager; +/* 22: */ import gregtech.api.util.GT_OreDictUnificator; +/* 23: */ import gregtech.api.util.GT_Recipe; +/* 25: */ import gregtech.api.util.GT_Utility; +/* 33: */ import net.minecraft.client.Minecraft; +/* 35: */ import net.minecraft.client.gui.inventory.GuiContainer; +/* 36: */ import net.minecraft.init.Blocks; +/* 37: */ import net.minecraft.item.ItemStack; +/* 38: */ import net.minecraftforge.fluids.FluidContainerRegistry; +/* 40: */ import net.minecraftforge.fluids.FluidStack; +/* 42: */ +/* 43: */ public class GT_NEI_DefaultHandler +/* 44: */ extends TemplateRecipeHandler +/* 45: */ { +/* 46: */ protected final GT_Recipe.GT_Recipe_Map mRecipeMap; +/* 47: */ public static final int sOffsetX = 5; +/* 48: */ public static final int sOffsetY = 11; +/* 49: */ +/* 50: */ public GT_NEI_DefaultHandler(GT_Recipe.GT_Recipe_Map aRecipeMap) +/* 51: */ { +/* 52: 43 */ this.mRecipeMap = aRecipeMap; +/* 53: 44 */ this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(65, 13, 36, 18), getOverlayIdentifier(), new Object[0])); +/* 54: 46 */ if (!NEI_GT_Config.sIsAdded) +/* 55: */ { +/* 56: 47 */ FMLInterModComms.sendRuntimeMessage(GT_Values.GT, "NEIPlugins", "register-crafting-handler", "gregtech@" + getRecipeName() + "@" + getOverlayIdentifier()); +/* 57: 48 */ GuiCraftingRecipe.craftinghandlers.add(this); +/* 58: 49 */ GuiUsageRecipe.usagehandlers.add(this); +/* 59: */ } +/* 60: */ } +/* 61: */ +/* 62: */ @Override +public TemplateRecipeHandler newInstance() +/* 63: */ { +/* 64: 55 */ return new GT_NEI_DefaultHandler(this.mRecipeMap); +/* 65: */ } +/* 66: */ +/* 67: */ public class FixedPositionedStack +/* 68: */ extends PositionedStack +/* 69: */ { +/* 70: 59 */ public boolean permutated = false; +/* 71: */ public final int mChance; +/* 72: */ +/* 73: */ public FixedPositionedStack(Object object, int x, int y) +/* 74: */ { +/* 75: 63 */ this(object, x, y, 0); +/* 76: */ } +/* 77: */ +/* 78: */ public FixedPositionedStack(Object object, int x, int y, int aChance) +/* 79: */ { +/* 80: 67 */ super(object,x, y, true); +/* 81: 68 */ this.mChance = aChance; +/* 82: */ } +/* 83: */ +/* 84: */ @Override +public void generatePermutations() +/* 85: */ { +/* 86: 73 */ if (this.permutated) { +/* 87: 73 */ return; +/* 88: */ } +/* 89: 75 */ ArrayList tDisplayStacks = new ArrayList(); +/* 90: 76 */ for (ItemStack tStack : this.items) { +/* 91: 76 */ if (GT_Utility.isStackValid(tStack)) { +/* 92: 77 */ if (tStack.getItemDamage() == 32767) +/* 93: */ { +/* 94: 78 */ List permutations = codechicken.nei.ItemList.itemMap.get(tStack.getItem()); +/* 95: 79 */ if (!permutations.isEmpty()) +/* 96: */ { +/* 97: */ ItemStack stack; +/* 98: 80 */ for (Iterator i$ = permutations.iterator(); i$.hasNext(); tDisplayStacks.add(GT_Utility.copyAmount(tStack.stackSize, new Object[] { stack }))) { +/* 99: 80 */ stack = (ItemStack)i$.next(); +/* 100: */ } +/* 101: */ } +/* 102: */ else +/* 103: */ { +/* 104: 82 */ ItemStack base = new ItemStack(tStack.getItem(), tStack.stackSize); +/* 105: 83 */ base.stackTagCompound = tStack.stackTagCompound; +/* 106: 84 */ tDisplayStacks.add(base); +/* 107: */ } +/* 108: */ } +/* 109: */ else +/* 110: */ { +/* 111: 87 */ tDisplayStacks.add(GT_Utility.copy(new Object[] { tStack })); +/* 112: */ } +/* 113: */ } +/* 114: */ } +/* 115: 91 */ this.items = (tDisplayStacks.toArray(new ItemStack[0])); +/* 116: 92 */ if (this.items.length == 0) { +/* 117: 92 */ this.items = new ItemStack[] { new ItemStack(Blocks.fire) }; +/* 118: */ } +/* 119: 93 */ this.permutated = true; +/* 120: 94 */ setPermutationToRender(0); +/* 121: */ } +/* 122: */ } +/* 123: */ +/* 124: */ public class CachedDefaultRecipe +/* 125: */ extends TemplateRecipeHandler.CachedRecipe +/* 126: */ { +/* 127: */ public final GT_Recipe mRecipe; +/* 128:101 */ public final List mOutputs = new ArrayList(); +/* 129:102 */ public final List mInputs = new ArrayList(); +/* 130: */ +/* 131: */ @Override +public List getIngredients() +/* 132: */ { +/* 133:106 */ return getCycledIngredients(GT_NEI_DefaultHandler.this.cycleticks / 10, this.mInputs); +/* 134: */ } +/* 135: */ +/* 136: */ @Override +public PositionedStack getResult() +/* 137: */ { +/* 138:111 */ return null; +/* 139: */ } +/* 140: */ +/* 141: */ @Override +public List getOtherStacks() +/* 142: */ { +/* 143:116 */ return this.mOutputs; +/* 144: */ } +/* 145: */ +/* 146: */ public CachedDefaultRecipe(GT_Recipe aRecipe) +/* 147: */ { +/* 148:119 */ super(); +/* 149:120 */ this.mRecipe = aRecipe; +/* 150: */ +/* 151:122 */ int tStartIndex = 0; +/* 152:124 */ switch (GT_NEI_DefaultHandler.this.mRecipeMap.mUsualInputCount) +/* 153: */ { +/* 154: */ case 0: +/* 155: */ break; +/* 156: */ case 1: +/* 157:128 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) { +/* 158:128 */ this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 14)); +/* 159: */ } +/* 160:128 */ tStartIndex++; +/* 161:129 */ break; +/* 162: */ case 2: +/* 163:131 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) { +/* 164:131 */ this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 14)); +/* 165: */ } +/* 166:131 */ tStartIndex++; +/* 167:132 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) { +/* 168:132 */ this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 14)); +/* 169: */ } +/* 170:132 */ tStartIndex++; +/* 171:133 */ break; +/* 172: */ case 3: +/* 173:135 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) { +/* 174:135 */ this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 14)); +/* 175: */ } +/* 176:135 */ tStartIndex++; +/* 177:136 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) { +/* 178:136 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 30, 14)); +/* 179: */ } +/* 180:136 */ tStartIndex++; +/* 181:137 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) { +/* 182:137 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 48, 14)); +/* 183: */ } +/* 184:137 */ tStartIndex++; +/* 185:138 */ break; +/* 186: */ case 4: +/* 187:140 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) { +/* 188:140 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 30, 5)); +/* 189: */ } +/* 190:140 */ tStartIndex++; +/* 191:141 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) { +/* 192:141 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 48, 5)); +/* 193: */ } +/* 194:141 */ tStartIndex++; +/* 195:142 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) { +/* 196:142 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 30, 23)); +/* 197: */ } +/* 198:142 */ tStartIndex++; +/* 199:143 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) { +/* 200:143 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 48, 23)); +/* 201: */ } +/* 202:143 */ tStartIndex++; +/* 203:144 */ break; +/* 204: */ case 5: +/* 205:146 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) { +/* 206:146 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 12, 5)); +/* 207: */ } +/* 208:146 */ tStartIndex++; +/* 209:147 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) { +/* 210:147 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 30, 5)); +/* 211: */ } +/* 212:147 */ tStartIndex++; +/* 213:148 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) { +/* 214:148 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 48, 5)); +/* 215: */ } +/* 216:148 */ tStartIndex++; +/* 217:149 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) { +/* 218:149 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 30, 23)); +/* 219: */ } +/* 220:149 */ tStartIndex++; +/* 221:150 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) { +/* 222:150 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 48, 23)); +/* 223: */ } +/* 224:150 */ tStartIndex++; +/* 225:151 */ break; +/* 226: */ case 6: +/* 227:153 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) { +/* 228:153 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 12, 5)); +/* 229: */ } +/* 230:153 */ tStartIndex++; +/* 231:154 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) { +/* 232:154 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 30, 5)); +/* 233: */ } +/* 234:154 */ tStartIndex++; +/* 235:155 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) { +/* 236:155 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 48, 5)); +/* 237: */ } +/* 238:155 */ tStartIndex++; +/* 239:156 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) { +/* 240:156 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 12, 23)); +/* 241: */ } +/* 242:156 */ tStartIndex++; +/* 243:157 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) { +/* 244:157 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 30, 23)); +/* 245: */ } +/* 246:157 */ tStartIndex++; +/* 247:158 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) { +/* 248:158 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 48, 23)); +/* 249: */ } +/* 250:158 */ tStartIndex++; +/* 251:159 */ break; +/* 252: */ case 7: +/* 253:161 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) { +/* 254:161 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 12, -4)); +/* 255: */ } +/* 256:161 */ tStartIndex++; +/* 257:162 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) { +/* 258:162 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 30, -4)); +/* 259: */ } +/* 260:162 */ tStartIndex++; +/* 261:163 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) { +/* 262:163 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 48, -4)); +/* 263: */ } +/* 264:163 */ tStartIndex++; +/* 265:164 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) { +/* 266:164 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 12, 14)); +/* 267: */ } +/* 268:164 */ tStartIndex++; +/* 269:165 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) { +/* 270:165 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 30, 14)); +/* 271: */ } +/* 272:165 */ tStartIndex++; +/* 273:166 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) { +/* 274:166 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 48, 14)); +/* 275: */ } +/* 276:166 */ tStartIndex++; +/* 277:167 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) { +/* 278:167 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 12, 32)); +/* 279: */ } +/* 280:167 */ tStartIndex++; +/* 281:168 */ break; +/* 282: */ case 8: +/* 283:170 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) { +/* 284:170 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 12, -4)); +/* 285: */ } +/* 286:170 */ tStartIndex++; +/* 287:171 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) { +/* 288:171 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 30, -4)); +/* 289: */ } +/* 290:171 */ tStartIndex++; +/* 291:172 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) { +/* 292:172 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 48, -4)); +/* 293: */ } +/* 294:172 */ tStartIndex++; +/* 295:173 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) { +/* 296:173 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 12, 14)); +/* 297: */ } +/* 298:173 */ tStartIndex++; +/* 299:174 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) { +/* 300:174 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 30, 14)); +/* 301: */ } +/* 302:174 */ tStartIndex++; +/* 303:175 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) { +/* 304:175 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 48, 14)); +/* 305: */ } +/* 306:175 */ tStartIndex++; +/* 307:176 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) { +/* 308:176 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 12, 32)); +/* 309: */ } +/* 310:176 */ tStartIndex++; +/* 311:177 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) { +/* 312:177 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 30, 32)); +/* 313: */ } +/* 314:177 */ tStartIndex++; +/* 315:178 */ break; +/* 316: */ default: +/* 317:180 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) { +/* 318:180 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 12, -4)); +/* 319: */ } +/* 320:180 */ tStartIndex++; +/* 321:181 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) { +/* 322:181 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 30, -4)); +/* 323: */ } +/* 324:181 */ tStartIndex++; +/* 325:182 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) { +/* 326:182 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 48, -4)); +/* 327: */ } +/* 328:182 */ tStartIndex++; +/* 329:183 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) { +/* 330:183 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 12, 14)); +/* 331: */ } +/* 332:183 */ tStartIndex++; +/* 333:184 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) { +/* 334:184 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 30, 14)); +/* 335: */ } +/* 336:184 */ tStartIndex++; +/* 337:185 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) { +/* 338:185 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 48, 14)); +/* 339: */ } +/* 340:185 */ tStartIndex++; +/* 341:186 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) { +/* 342:186 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 12, 32)); +/* 343: */ } +/* 344:186 */ tStartIndex++; +/* 345:187 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) { +/* 346:187 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 30, 32)); +/* 347: */ } +/* 348:187 */ tStartIndex++; +/* 349:188 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) { +/* 350:188 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 48, 32)); +/* 351: */ } +/* 352:188 */ tStartIndex++; +/* 353: */ } +/* 354:192 */ if (aRecipe.mSpecialItems != null) { +/* 355:192 */ this.mInputs.add(new FixedPositionedStack( aRecipe.mSpecialItems, 120, 52)); +/* 356: */ } +/* 357:194 */ tStartIndex = 0; +/* 358:196 */ switch (GT_NEI_DefaultHandler.this.mRecipeMap.mUsualOutputCount) +/* 359: */ { +/* 360: */ case 0: +/* 361: */ break; +/* 362: */ case 1: +/* 363:200 */ if (aRecipe.getOutput(tStartIndex) != null) { +/* 364:200 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 102, 14, aRecipe.getOutputChance(tStartIndex))); +/* 365: */ } +/* 366:200 */ tStartIndex++; +/* 367:201 */ break; +/* 368: */ case 2: +/* 369:203 */ if (aRecipe.getOutput(tStartIndex) != null) { +/* 370:203 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 102, 14, aRecipe.getOutputChance(tStartIndex))); +/* 371: */ } +/* 372:203 */ tStartIndex++; +/* 373:204 */ if (aRecipe.getOutput(tStartIndex) != null) { +/* 374:204 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 120, 14, aRecipe.getOutputChance(tStartIndex))); +/* 375: */ } +/* 376:204 */ tStartIndex++; +/* 377:205 */ break; +/* 378: */ case 3: +/* 379:207 */ if (aRecipe.getOutput(tStartIndex) != null) { +/* 380:207 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 102, 14, aRecipe.getOutputChance(tStartIndex))); +/* 381: */ } +/* 382:207 */ tStartIndex++; +/* 383:208 */ if (aRecipe.getOutput(tStartIndex) != null) { +/* 384:208 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 120, 14, aRecipe.getOutputChance(tStartIndex))); +/* 385: */ } +/* 386:208 */ tStartIndex++; +/* 387:209 */ if (aRecipe.getOutput(tStartIndex) != null) { +/* 388:209 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 138, 14, aRecipe.getOutputChance(tStartIndex))); +/* 389: */ } +/* 390:209 */ tStartIndex++; +/* 391:210 */ break; +/* 392: */ case 4: +/* 393:212 */ if (aRecipe.getOutput(tStartIndex) != null) { +/* 394:212 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 102, 5, aRecipe.getOutputChance(tStartIndex))); +/* 395: */ } +/* 396:212 */ tStartIndex++; +/* 397:213 */ if (aRecipe.getOutput(tStartIndex) != null) { +/* 398:213 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 120, 5, aRecipe.getOutputChance(tStartIndex))); +/* 399: */ } +/* 400:213 */ tStartIndex++; +/* 401:214 */ if (aRecipe.getOutput(tStartIndex) != null) { +/* 402:214 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 102, 23, aRecipe.getOutputChance(tStartIndex))); +/* 403: */ } +/* 404:214 */ tStartIndex++; +/* 405:215 */ if (aRecipe.getOutput(tStartIndex) != null) { +/* 406:215 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 120, 23, aRecipe.getOutputChance(tStartIndex))); +/* 407: */ } +/* 408:215 */ tStartIndex++; +/* 409:216 */ break; +/* 410: */ case 5: +/* 411:218 */ if (aRecipe.getOutput(tStartIndex) != null) { +/* 412:218 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 102, 5, aRecipe.getOutputChance(tStartIndex))); +/* 413: */ } +/* 414:218 */ tStartIndex++; +/* 415:219 */ if (aRecipe.getOutput(tStartIndex) != null) { +/* 416:219 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 120, 5, aRecipe.getOutputChance(tStartIndex))); +/* 417: */ } +/* 418:219 */ tStartIndex++; +/* 419:220 */ if (aRecipe.getOutput(tStartIndex) != null) { +/* 420:220 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 138, 5, aRecipe.getOutputChance(tStartIndex))); +/* 421: */ } +/* 422:220 */ tStartIndex++; +/* 423:221 */ if (aRecipe.getOutput(tStartIndex) != null) { +/* 424:221 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 102, 23, aRecipe.getOutputChance(tStartIndex))); +/* 425: */ } +/* 426:221 */ tStartIndex++; +/* 427:222 */ if (aRecipe.getOutput(tStartIndex) != null) { +/* 428:222 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 120, 23, aRecipe.getOutputChance(tStartIndex))); +/* 429: */ } +/* 430:222 */ tStartIndex++; +/* 431:223 */ break; +/* 432: */ case 6: +/* 433:225 */ if (aRecipe.getOutput(tStartIndex) != null) { +/* 434:225 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 102, 5, aRecipe.getOutputChance(tStartIndex))); +/* 435: */ } +/* 436:225 */ tStartIndex++; +/* 437:226 */ if (aRecipe.getOutput(tStartIndex) != null) { +/* 438:226 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 120, 5, aRecipe.getOutputChance(tStartIndex))); +/* 439: */ } +/* 440:226 */ tStartIndex++; +/* 441:227 */ if (aRecipe.getOutput(tStartIndex) != null) { +/* 442:227 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 138, 5, aRecipe.getOutputChance(tStartIndex))); +/* 443: */ } +/* 444:227 */ tStartIndex++; +/* 445:228 */ if (aRecipe.getOutput(tStartIndex) != null) { +/* 446:228 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 102, 23, aRecipe.getOutputChance(tStartIndex))); +/* 447: */ } +/* 448:228 */ tStartIndex++; +/* 449:229 */ if (aRecipe.getOutput(tStartIndex) != null) { +/* 450:229 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 120, 23, aRecipe.getOutputChance(tStartIndex))); +/* 451: */ } +/* 452:229 */ tStartIndex++; +/* 453:230 */ if (aRecipe.getOutput(tStartIndex) != null) { +/* 454:230 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 138, 23, aRecipe.getOutputChance(tStartIndex))); +/* 455: */ } +/* 456:230 */ tStartIndex++; +/* 457:231 */ break; +/* 458: */ case 7: +/* 459:233 */ if (aRecipe.getOutput(tStartIndex) != null) { +/* 460:233 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 102, -4, aRecipe.getOutputChance(tStartIndex))); +/* 461: */ } +/* 462:233 */ tStartIndex++; +/* 463:234 */ if (aRecipe.getOutput(tStartIndex) != null) { +/* 464:234 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 120, -4, aRecipe.getOutputChance(tStartIndex))); +/* 465: */ } +/* 466:234 */ tStartIndex++; +/* 467:235 */ if (aRecipe.getOutput(tStartIndex) != null) { +/* 468:235 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 138, -4, aRecipe.getOutputChance(tStartIndex))); +/* 469: */ } +/* 470:235 */ tStartIndex++; +/* 471:236 */ if (aRecipe.getOutput(tStartIndex) != null) { +/* 472:236 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 102, 14, aRecipe.getOutputChance(tStartIndex))); +/* 473: */ } +/* 474:236 */ tStartIndex++; +/* 475:237 */ if (aRecipe.getOutput(tStartIndex) != null) { +/* 476:237 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 120, 14, aRecipe.getOutputChance(tStartIndex))); +/* 477: */ } +/* 478:237 */ tStartIndex++; +/* 479:238 */ if (aRecipe.getOutput(tStartIndex) != null) { +/* 480:238 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 138, 14, aRecipe.getOutputChance(tStartIndex))); +/* 481: */ } +/* 482:238 */ tStartIndex++; +/* 483:239 */ if (aRecipe.getOutput(tStartIndex) != null) { +/* 484:239 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 102, 32, aRecipe.getOutputChance(tStartIndex))); +/* 485: */ } +/* 486:239 */ tStartIndex++; +/* 487:240 */ break; +/* 488: */ case 8: +/* 489:242 */ if (aRecipe.getOutput(tStartIndex) != null) { +/* 490:242 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 102, -4, aRecipe.getOutputChance(tStartIndex))); +/* 491: */ } +/* 492:242 */ tStartIndex++; +/* 493:243 */ if (aRecipe.getOutput(tStartIndex) != null) { +/* 494:243 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 120, -4, aRecipe.getOutputChance(tStartIndex))); +/* 495: */ } +/* 496:243 */ tStartIndex++; +/* 497:244 */ if (aRecipe.getOutput(tStartIndex) != null) { +/* 498:244 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 138, -4, aRecipe.getOutputChance(tStartIndex))); +/* 499: */ } +/* 500:244 */ tStartIndex++; +/* 501:245 */ if (aRecipe.getOutput(tStartIndex) != null) { +/* 502:245 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 102, 14, aRecipe.getOutputChance(tStartIndex))); +/* 503: */ } +/* 504:245 */ tStartIndex++; +/* 505:246 */ if (aRecipe.getOutput(tStartIndex) != null) { +/* 506:246 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 120, 14, aRecipe.getOutputChance(tStartIndex))); +/* 507: */ } +/* 508:246 */ tStartIndex++; +/* 509:247 */ if (aRecipe.getOutput(tStartIndex) != null) { +/* 510:247 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 138, 14, aRecipe.getOutputChance(tStartIndex))); +/* 511: */ } +/* 512:247 */ tStartIndex++; +/* 513:248 */ if (aRecipe.getOutput(tStartIndex) != null) { +/* 514:248 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 102, 32, aRecipe.getOutputChance(tStartIndex))); +/* 515: */ } +/* 516:248 */ tStartIndex++; +/* 517:249 */ if (aRecipe.getOutput(tStartIndex) != null) { +/* 518:249 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 120, 32, aRecipe.getOutputChance(tStartIndex))); +/* 519: */ } +/* 520:249 */ tStartIndex++; +/* 521:250 */ break; +/* 522: */ default: +/* 523:252 */ if (aRecipe.getOutput(tStartIndex) != null) { +/* 524:252 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 102, -4, aRecipe.getOutputChance(tStartIndex))); +/* 525: */ } +/* 526:252 */ tStartIndex++; +/* 527:253 */ if (aRecipe.getOutput(tStartIndex) != null) { +/* 528:253 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 120, -4, aRecipe.getOutputChance(tStartIndex))); +/* 529: */ } +/* 530:253 */ tStartIndex++; +/* 531:254 */ if (aRecipe.getOutput(tStartIndex) != null) { +/* 532:254 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 138, -4, aRecipe.getOutputChance(tStartIndex))); +/* 533: */ } +/* 534:254 */ tStartIndex++; +/* 535:255 */ if (aRecipe.getOutput(tStartIndex) != null) { +/* 536:255 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 102, 14, aRecipe.getOutputChance(tStartIndex))); +/* 537: */ } +/* 538:255 */ tStartIndex++; +/* 539:256 */ if (aRecipe.getOutput(tStartIndex) != null) { +/* 540:256 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 120, 14, aRecipe.getOutputChance(tStartIndex))); +/* 541: */ } +/* 542:256 */ tStartIndex++; +/* 543:257 */ if (aRecipe.getOutput(tStartIndex) != null) { +/* 544:257 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 138, 14, aRecipe.getOutputChance(tStartIndex))); +/* 545: */ } +/* 546:257 */ tStartIndex++; +/* 547:258 */ if (aRecipe.getOutput(tStartIndex) != null) { +/* 548:258 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 102, 32, aRecipe.getOutputChance(tStartIndex))); +/* 549: */ } +/* 550:258 */ tStartIndex++; +/* 551:259 */ if (aRecipe.getOutput(tStartIndex) != null) { +/* 552:259 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 120, 32, aRecipe.getOutputChance(tStartIndex))); +/* 553: */ } +/* 554:259 */ tStartIndex++; +/* 555:260 */ if (aRecipe.getOutput(tStartIndex) != null) { +/* 556:260 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 138, 32, aRecipe.getOutputChance(tStartIndex))); +/* 557: */ } +/* 558:260 */ tStartIndex++; +/* 559: */ } +/* 560:264 */ if ((aRecipe.mFluidInputs.length > 0) && (aRecipe.mFluidInputs[0] != null) && (aRecipe.mFluidInputs[0].getFluid() != null)) { +/* 561:264 */ this.mInputs.add(new FixedPositionedStack( GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[0], true), 48, 52)); + if((aRecipe.mFluidInputs.length > 1) && (aRecipe.mFluidInputs[1] != null) && (aRecipe.mFluidInputs[1].getFluid() != null)){ + this.mInputs.add(new FixedPositionedStack( GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[1], true), 30, 52)); + } +/* 562: */ } + if(aRecipe.mFluidOutputs.length>1){ + if(aRecipe.mFluidOutputs[0]!=null && (aRecipe.mFluidOutputs[0].getFluid() != null)){ + this.mOutputs.add(new FixedPositionedStack( GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[0], true), 120, 5)); + } + if(aRecipe.mFluidOutputs[1]!=null && (aRecipe.mFluidOutputs[1].getFluid() != null)){ + this.mOutputs.add(new FixedPositionedStack( GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[1], true), 138, 5)); + } + if(aRecipe.mFluidOutputs.length>2&&aRecipe.mFluidOutputs[2]!=null && (aRecipe.mFluidOutputs[2].getFluid() != null)){ + this.mOutputs.add(new FixedPositionedStack( GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[2], true), 102, 23)); + } + if(aRecipe.mFluidOutputs.length>3&&aRecipe.mFluidOutputs[3]!=null && (aRecipe.mFluidOutputs[3].getFluid() != null)){ + this.mOutputs.add(new FixedPositionedStack( GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[3], true), 120, 23)); + } + if(aRecipe.mFluidOutputs.length>4&&aRecipe.mFluidOutputs[4]!=null && (aRecipe.mFluidOutputs[4].getFluid() != null)){ + this.mOutputs.add(new FixedPositionedStack( GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[4], true), 138, 23)); + } + }else if ((aRecipe.mFluidOutputs.length > 0) && (aRecipe.mFluidOutputs[0] != null) && (aRecipe.mFluidOutputs[0].getFluid() != null)) { +/* 564:265 */ this.mOutputs.add(new FixedPositionedStack( GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[0], true), 102, 52)); +/* 565: */ } +/* 566: */ } +/* 567: */ } +/* 568: */ +/* 569: */ static +/* 570: */ { +/* 571:270 */ GuiContainerManager.addInputHandler(new GT_RectHandler()); +/* 572:271 */ GuiContainerManager.addTooltipHandler(new GT_RectHandler()); +/* 573: */ } +/* 574: */ +/* 575: */ public static class GT_RectHandler +/* 576: */ implements IContainerInputHandler, IContainerTooltipHandler +/* 577: */ { +/* 578: */ @Override +public boolean mouseClicked(GuiContainer gui, int mousex, int mousey, int button) +/* 579: */ { +/* 580:277 */ if (canHandle(gui)) +/* 581: */ { +/* 582:278 */ if (button == 0) { +/* 583:278 */ return transferRect(gui, false); +/* 584: */ } +/* 585:279 */ if (button == 1) { +/* 586:279 */ return transferRect(gui, true); +/* 587: */ } +/* 588: */ } +/* 589:281 */ return false; +/* 590: */ } +/* 591: */ +/* 592: */ @Override +public boolean lastKeyTyped(GuiContainer gui, char keyChar, int keyCode) +/* 593: */ { +/* 594:286 */ return false; +/* 595: */ } +/* 596: */ +/* 597: */ public boolean canHandle(GuiContainer gui) +/* 598: */ { +/* 599:290 */ return ((gui instanceof GT_GUIContainer_BasicMachine)) && (GT_Utility.isStringValid(((GT_GUIContainer_BasicMachine)gui).mNEI)); +/* 600: */ } +/* 601: */ +/* 602: */ @Override +public List handleTooltip(GuiContainer gui, int mousex, int mousey, List currenttip) +/* 603: */ { +/* 604:295 */ if ((canHandle(gui)) && (currenttip.isEmpty()) && (new Rectangle(65, 13, 36, 18).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_BasicMachine)gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_BasicMachine)gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1])))) { +/* 605:295 */ currenttip.add("Recipes"); +/* 606: */ } +/* 607:296 */ return currenttip; +/* 608: */ } +/* 609: */ +/* 610: */ private boolean transferRect(GuiContainer gui, boolean usage) +/* 611: */ { +/* 612:300 */ return (canHandle(gui)) && (new Rectangle(65, 13, 36, 18).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_BasicMachine)gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_BasicMachine)gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) && (usage ? GuiUsageRecipe.openRecipeGui(((GT_GUIContainer_BasicMachine)gui).mNEI, new Object[0]) : GuiCraftingRecipe.openRecipeGui(((GT_GUIContainer_BasicMachine)gui).mNEI, new Object[0])); +/* 613: */ } +/* 614: */ +/* 615: */ @Override +public List handleItemDisplayName(GuiContainer gui, ItemStack itemstack, List currenttip) +/* 616: */ { +/* 617:305 */ return currenttip; +/* 618: */ } +/* 619: */ +/* 620: */ @Override +public List handleItemTooltip(GuiContainer gui, ItemStack itemstack, int mousex, int mousey, List currenttip) +/* 621: */ { +/* 622:310 */ return currenttip; +/* 623: */ } +/* 624: */ +/* 625: */ @Override +public boolean keyTyped(GuiContainer gui, char keyChar, int keyCode) +/* 626: */ { +/* 627:315 */ return false; +/* 628: */ } +/* 629: */ +/* 630: */ @Override +public void onKeyTyped(GuiContainer gui, char keyChar, int keyID) {} +/* 631: */ +/* 632: */ @Override +public void onMouseClicked(GuiContainer gui, int mousex, int mousey, int button) {} +/* 633: */ +/* 634: */ @Override +public void onMouseUp(GuiContainer gui, int mousex, int mousey, int button) {} +/* 635: */ +/* 636: */ @Override +public boolean mouseScrolled(GuiContainer gui, int mousex, int mousey, int scrolled) +/* 637: */ { +/* 638:335 */ return false; +/* 639: */ } +/* 640: */ +/* 641: */ @Override +public void onMouseScrolled(GuiContainer gui, int mousex, int mousey, int scrolled) {} +/* 642: */ +/* 643: */ @Override +public void onMouseDragged(GuiContainer gui, int mousex, int mousey, int button, long heldTime) {} +/* 644: */ } +/* 645: */ +/* 646: */ @Override +public void loadCraftingRecipes(String outputId, Object... results) +/* 647: */ { +/* 648:351 */ if (outputId.equals(getOverlayIdentifier())) { +/* 649:352 */ for (GT_Recipe tRecipe : this.mRecipeMap.mRecipeList) { +/* 650:352 */ if (!tRecipe.mHidden) { +/* 651:352 */ this.arecipes.add(new CachedDefaultRecipe(tRecipe)); +/* 652: */ } +/* 653: */ } +/* 654: */ } else { +/* 655:354 */ super.loadCraftingRecipes(outputId, results); +/* 656: */ } +/* 657: */ } +/* 658: */ +/* 659: */ @Override +public void loadCraftingRecipes(ItemStack aResult) +/* 660: */ { +/* 661:360 */ ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aResult); +/* 662: */ +/* 663:362 */ ArrayList tResults = new ArrayList(); +/* 664:363 */ tResults.add(aResult); +/* 665:364 */ tResults.add(GT_OreDictUnificator.get(true, aResult)); +/* 666:366 */ if ((tPrefixMaterial != null) && (!tPrefixMaterial.mBlackListed) && (!tPrefixMaterial.mPrefix.mFamiliarPrefixes.isEmpty())) { +/* 667:367 */ for (OrePrefixes tPrefix : tPrefixMaterial.mPrefix.mFamiliarPrefixes) { +/* 668:368 */ tResults.add(GT_OreDictUnificator.get(tPrefix, tPrefixMaterial.mMaterial.mMaterial, 1L)); +/* 669: */ } +/* 670: */ } +/* 671:372 */ FluidStack tFluid = GT_Utility.getFluidForFilledItem(aResult, true); +/* 672:373 */ if (tFluid != null) +/* 673: */ { +/* 674:374 */ tResults.add(GT_Utility.getFluidDisplayStack(tFluid, false)); +/* 675:375 */ for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) { +/* 676:376 */ if (tData.fluid.isFluidEqual(tFluid)) { +/* 677:376 */ tResults.add(GT_Utility.copy(new Object[] { tData.filledContainer })); +/* 678: */ } +/* 679: */ } +/* 680: */ } +/* 681:380 */ for (GT_Recipe tRecipe : this.mRecipeMap.mRecipeList) { +/* 682:380 */ if (!tRecipe.mHidden) +/* 683: */ { +/* 684:381 */ CachedDefaultRecipe tNEIRecipe = new CachedDefaultRecipe(tRecipe); +/* 685:382 */ for (ItemStack tStack : tResults) { +/* 686:382 */ if (tNEIRecipe.contains(tNEIRecipe.mOutputs, tStack)) +/* 687: */ { +/* 688:383 */ this.arecipes.add(tNEIRecipe); +/* 689:384 */ break; +/* 690: */ } +/* 691: */ } +/* 692: */ } +/* 693: */ } +/* 694: */ CachedDefaultRecipe tNEIRecipe; +/* 695: */ } +/* 696: */ +/* 697: */ @Override +public void loadUsageRecipes(ItemStack aInput) +/* 698: */ { +/* 699:391 */ ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aInput); +/* 700: */ +/* 701:393 */ ArrayList tInputs = new ArrayList(); +/* 702:394 */ tInputs.add(aInput); +/* 703:395 */ tInputs.add(GT_OreDictUnificator.get(false, aInput)); +/* 704:397 */ if ((tPrefixMaterial != null) && (!tPrefixMaterial.mPrefix.mFamiliarPrefixes.isEmpty())) { +/* 705:398 */ for (OrePrefixes tPrefix : tPrefixMaterial.mPrefix.mFamiliarPrefixes) { +/* 706:399 */ tInputs.add(GT_OreDictUnificator.get(tPrefix, tPrefixMaterial.mMaterial.mMaterial, 1L)); +/* 707: */ } +/* 708: */ } +/* 709:403 */ FluidStack tFluid = GT_Utility.getFluidForFilledItem(aInput, true); +/* 710:404 */ if (tFluid != null) +/* 711: */ { +/* 712:405 */ tInputs.add(GT_Utility.getFluidDisplayStack(tFluid, false)); +/* 713:406 */ for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) { +/* 714:407 */ if (tData.fluid.isFluidEqual(tFluid)) { +/* 715:407 */ tInputs.add(GT_Utility.copy(new Object[] { tData.filledContainer })); +/* 716: */ } +/* 717: */ } +/* 718: */ } +/* 719:411 */ for (GT_Recipe tRecipe : this.mRecipeMap.mRecipeList) { +/* 720:411 */ if (!tRecipe.mHidden) +/* 721: */ { +/* 722:412 */ CachedDefaultRecipe tNEIRecipe = new CachedDefaultRecipe(tRecipe); +/* 723:413 */ for (ItemStack tStack : tInputs) { +/* 724:413 */ if (tNEIRecipe.contains(tNEIRecipe.mInputs, tStack)) +/* 725: */ { +/* 726:414 */ this.arecipes.add(tNEIRecipe); +/* 727:415 */ break; +/* 728: */ } +/* 729: */ } +/* 730: */ } +/* 731: */ } +/* 732: */ CachedDefaultRecipe tNEIRecipe; +/* 733: */ } +/* 734: */ +/* 735: */ @Override +public String getOverlayIdentifier() +/* 736: */ { +/* 737:422 */ return this.mRecipeMap.mNEIName; +/* 738: */ } +/* 739: */ +/* 740: */ @Override +public void drawBackground(int recipe) +/* 741: */ { +/* 742:427 */ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); +/* 743:428 */ GuiDraw.changeTexture(getGuiTexture()); +/* 744:429 */ GuiDraw.drawTexturedModalRect(-4, -8, 1, 3, 174, 78); +/* 745: */ } +/* 746: */ +/* 747: */ public static void drawText(int aX, int aY, String aString, int aColor) +/* 748: */ { +/* 749:433 */ Minecraft.getMinecraft().fontRenderer.drawString(aString, aX, aY, aColor); +/* 750: */ } +/* 751: */ +/* 752: */ @Override +public int recipiesPerPage() +/* 753: */ { +/* 754:438 */ return 1; +/* 755: */ } +/* 756: */ +/* 757: */ @Override +public String getRecipeName() +/* 758: */ { +/* 759:443 */ return GT_LanguageManager.getTranslation(this.mRecipeMap.mUnlocalizedName); +/* 760: */ } +/* 761: */ +/* 762: */ @Override +public String getGuiTexture() +/* 763: */ { +///* 764:448 */ return "gregtech:textures/gui/" + this.mRecipeMap.mUnlocalizedName + ".png"; + return this.mRecipeMap.mNEIGUIPath; +/* 765: */ } +/* 766: */ +/* 767: */ @Override +public List handleItemTooltip(GuiRecipe gui, ItemStack aStack, List currenttip, int aRecipeIndex) +/* 768: */ { +/* 769:453 */ TemplateRecipeHandler.CachedRecipe tObject = this.arecipes.get(aRecipeIndex); +/* 770:454 */ if ((tObject instanceof CachedDefaultRecipe)) +/* 771: */ { +/* 772:455 */ CachedDefaultRecipe tRecipe = (CachedDefaultRecipe)tObject; +/* 773:456 */ for (PositionedStack tStack : tRecipe.mOutputs) { +/* 774:456 */ if (aStack == tStack.item) +/* 775: */ { +/* 776:457 */ if ((!(tStack instanceof FixedPositionedStack)) || (((FixedPositionedStack)tStack).mChance <= 0) || (((FixedPositionedStack)tStack).mChance == 10000)) { +/* 777: */ break; +/* 778: */ } +/* 779:458 */ currenttip.add("Chance: " + ((FixedPositionedStack)tStack).mChance / 100 + "." + (((FixedPositionedStack)tStack).mChance % 100 < 10 ? "0" + ((FixedPositionedStack)tStack).mChance % 100 : Integer.valueOf(((FixedPositionedStack)tStack).mChance % 100)) + "%"); break; +/* 780: */ } +/* 781: */ } +/* 782:462 */ for (PositionedStack tStack : tRecipe.mInputs) { +/* 783:462 */ if (aStack == tStack.item) +/* 784: */ { +/* 785:463 */ if ((gregtech.api.enums.ItemList.Display_Fluid.isStackEqual(tStack.item, true, true)) || +/* 786:464 */ (tStack.item.stackSize != 0)) { +/* 787: */ break; +/* 788: */ } +/* 789:464 */ currenttip.add("Does not get consumed in the process"); break; +/* 790: */ } +/* 791: */ } +/* 792: */ } +/* 793:469 */ return currenttip; +/* 794: */ } +/* 795: */ +/* 796: */ @Override +public void drawExtras(int aRecipeIndex) +/* 797: */ { +/* 798:474 */ int tEUt = ((CachedDefaultRecipe)this.arecipes.get(aRecipeIndex)).mRecipe.mEUt; +/* 799:475 */ int tDuration = ((CachedDefaultRecipe)this.arecipes.get(aRecipeIndex)).mRecipe.mDuration; +/* 800:476 */ if (tEUt != 0) +/* 801: */ { +/* 802:477 */ drawText(10, 73, "Total: " + tDuration * tEUt + " EU", -16777216); +/* 803:478 */ drawText(10, 83, "Usage: " + tEUt + " EU/t", -16777216); +/* 804:479 */ if (this.mRecipeMap.mShowVoltageAmperageInNEI) +/* 805: */ { +/* 806:480 */ drawText(10, 93, "Voltage: " + tEUt / this.mRecipeMap.mAmperage + " EU", -16777216); +/* 807:481 */ drawText(10, 103, "Amperage: " + this.mRecipeMap.mAmperage, -16777216); +/* 808: */ } +/* 809: */ else +/* 810: */ { +/* 811:483 */ drawText(10, 93, "Voltage: unspecified", -16777216); +/* 812:484 */ drawText(10, 103, "Amperage: unspecified", -16777216); +/* 813: */ } +/* 814: */ } +/* 815:487 */ if (tDuration > 0) { +/* 816:488 */ drawText(10, 113, "Time: " + (tDuration < 20 ? "< 1" : Integer.valueOf(tDuration / 20)) + " secs", -16777216); +/* 817: */ } +/* 818:489 */ if ((GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePre)) || (GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePost))) { +/* 819:490 */ drawText(10, 123, this.mRecipeMap.mNEISpecialValuePre + ((CachedDefaultRecipe)this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue * this.mRecipeMap.mNEISpecialValueMultiplier + this.mRecipeMap.mNEISpecialValuePost, -16777216); +/* 820: */ } +/* 821: */ } +/* 822: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.nei.GT_NEI_DefaultHandler + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/gregtech/nei/NEI_GT_Config.java b/src/main/java/gregtech/nei/NEI_GT_Config.java new file mode 100644 index 0000000..b5787f2 --- /dev/null +++ b/src/main/java/gregtech/nei/NEI_GT_Config.java @@ -0,0 +1,33 @@ +/* 1: */ package gregtech.nei; +/* 2: */ +/* 3: */ import codechicken.nei.api.IConfigureNEI; +/* 5: */ +/* 6: */ public class NEI_GT_Config +/* 7: */ implements IConfigureNEI +/* 8: */ { +/* 9: 8 */ public static boolean sIsAdded = true; +/* 10: */ +/* 11: */ @Override +public void loadConfig() +/* 12: */ { +/* 19:26 */ sIsAdded = true; +/* 20: */ } +/* 21: */ +/* 22: */ @Override +public String getName() +/* 23: */ { +/* 24:31 */ return "GregTech NEI Plugin"; +/* 25: */ } +/* 26: */ +/* 27: */ @Override +public String getVersion() +/* 28: */ { +/* 29:37 */ return "(5.03a)"; +/* 30: */ } +/* 31: */ } + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + * Qualified Name: gregtech.nei.NEI_GT_Config + * JD-Core Version: 0.7.0.1 + */ \ No newline at end of file diff --git a/src/main/java/ihl/ClientProxy.java b/src/main/java/ihl/ClientProxy.java new file mode 100644 index 0000000..12bccbe --- /dev/null +++ b/src/main/java/ihl/ClientProxy.java @@ -0,0 +1,496 @@ +package ihl; + +import java.io.File; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +import javax.xml.parsers.ParserConfigurationException; + +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.FMLNetworkEvent; +import cpw.mods.fml.common.network.NetworkRegistry; +import cpw.mods.fml.common.network.internal.FMLProxyPacket; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ihl.crop_harvestors.BlobEntityFX; +import ihl.crop_harvestors.BlobEntityFX.FluidType; +import ihl.crop_harvestors.BlobRenderFX; +import ihl.crop_harvestors.SackRender; +import ihl.crop_harvestors.SackTileEntity; +import ihl.enviroment.MirrorRender; +import ihl.enviroment.MirrorTileEntity; +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.IronWorkbenchRender; +import ihl.flexible_cable.IronWorkbenchTileEntity; +import ihl.flexible_cable.NodeEntity; +import ihl.flexible_cable.NodeRender; +import ihl.flexible_cable.RectifierTransformerUnitTileEntity; +import ihl.interfaces.INetworkListener; +import ihl.interfaces.ISelectionBoxSpecialRenderer; +import ihl.items_blocks.FlexibleCableItem; +import ihl.items_blocks.IHLTool; +import ihl.items_blocks.MachineBaseBlock.MachineType; +import ihl.model.CableHolderSelectionBoxSpecialRenderer; +import ihl.model.FlexibleCableItemRender; +import ihl.model.IHLBlockRenderer; +import ihl.model.IHLToolRenderer; +import ihl.model.ImpregnatingMachineBlockRender; +import ihl.model.IronWorkbenchBlockRender; +import ihl.model.RectifierTransformerUnitBlockRender; +import ihl.model.RectifierTransformerUnitSelectionBoxSpecialRenderer; +import ihl.model.RefluxCondenserBlockRender; +import ihl.model.UniversalTileRender; +import ihl.processing.chemistry.ElectrolysisBathModel; +import ihl.processing.chemistry.ElectrolysisBathTileEntity; +import ihl.processing.chemistry.FractionatorBottomModel; +import ihl.processing.chemistry.FractionatorBottomTileEntity; +import ihl.processing.chemistry.FractionatorCoverModel; +import ihl.processing.chemistry.FractionatorCoverTileEntity; +import ihl.processing.chemistry.FractionatorSectionModel; +import ihl.processing.chemistry.FractionatorSectionTileEntity; +import ihl.processing.chemistry.GaedesMercuryRotaryPumpModel; +import ihl.processing.chemistry.GaedesMercuryRotaryPumpTileEntity; +import ihl.processing.chemistry.LoomModel; +import ihl.processing.chemistry.LoomTileEntity; +import ihl.processing.chemistry.RefluxCondenserModel; +import ihl.processing.chemistry.RefluxCondenserTileEntity; +import ihl.processing.chemistry.SolarEvaporatorTileEntity; +import ihl.processing.metallurgy.CoilerModel; +import ihl.processing.metallurgy.CoilerRender; +import ihl.processing.metallurgy.CoilerTileEntity; +import ihl.processing.metallurgy.DetonationSprayingMachineModel; +import ihl.processing.metallurgy.DetonationSprayingMachineRender; +import ihl.processing.metallurgy.DetonationSprayingMachineTileEntity; +import ihl.processing.metallurgy.ExtruderModel; +import ihl.processing.metallurgy.ExtruderTileEntity; +import ihl.processing.metallurgy.GasWeldingStationModel; +import ihl.processing.metallurgy.GasWeldingStationTileEntity; +import ihl.processing.metallurgy.ImpregnatingMachineRender; +import ihl.processing.metallurgy.ImpregnatingMachineTileEntity; +import ihl.processing.metallurgy.LathePart1Model; +import ihl.processing.metallurgy.LathePart1TileEntity; +import ihl.processing.metallurgy.LathePart2Model; +import ihl.processing.metallurgy.LathePart2TileEntity; +import ihl.processing.metallurgy.RollingMachinePart1Model; +import ihl.processing.metallurgy.RollingMachinePart1TileEntity; +import ihl.processing.metallurgy.RollingMachinePart2Model; +import ihl.processing.metallurgy.RollingMachinePart2TileEntity; +import ihl.processing.metallurgy.RollingMachineRender; +import ihl.processing.metallurgy.VulcanizationExtrudingMoldModel; +import ihl.processing.metallurgy.VulcanizationExtrudingMoldTileEntity; +import ihl.processing.metallurgy.WoodenRollingMachinePart1TileEntity; +import ihl.processing.metallurgy.WoodenRollingMachinePart2Model; +import ihl.processing.metallurgy.WoodenRollingMachinePart2TileEntity; +import ihl.processing.metallurgy.WoodenRollingMachineRender; +import ihl.servitor.FlameEntityFX; +import ihl.servitor.FlameRenderFX; +import ihl.servitor.LostHeadEntity; +import ihl.servitor.LostHeadRender; +import ihl.servitor.SkullItemRender; +import ihl.utils.BlockItemRender; +import ihl.utils.IHLRenderUtils; +import ihl.utils.IHLUtils; +import ihl.worldgen.ores.IHLFluid; +import io.netty.buffer.ByteBuf; +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; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import net.minecraftforge.client.MinecraftForgeClient; +import net.minecraftforge.client.event.TextureStitchEvent; +import net.minecraftforge.common.MinecraftForge; + +@SideOnly(value = Side.CLIENT) +public class ClientProxy extends ServerProxy { + + public boolean loadMirrorRender = true; + public IHLRenderUtils renderUtils; + public Map sharedBlockRenders = new HashMap(); + public Map, ISelectionBoxSpecialRenderer> selectionBoxSpecialRendererRegistry = new HashMap, ISelectionBoxSpecialRenderer>(); + + public ClientProxy() { + } + + @Override + public void load() throws ParserConfigurationException { + if (channel == null) { + channel = NetworkRegistry.INSTANCE.newEventDrivenChannel(IHLModInfo.MODID); + channel.register(this); + } + this.renderUtils = new IHLRenderUtils(); + MinecraftForge.EVENT_BUS.register(this.renderUtils); + registerBlockHandler(new ImpregnatingMachineBlockRender(), MachineType.BronzeTub); + registerBlockHandler(new ImpregnatingMachineBlockRender(), MachineType.SolarEvaporator); + registerBlockHandler(new RefluxCondenserBlockRender(), MachineType.RefluxCondenser); + 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(IHLEntityFallingPile.class, new IHLEntityFallingPileRender()); + ClientRegistry.bindTileEntitySpecialRenderer(SackTileEntity.class, new SackRender()); + ClientRegistry.bindTileEntitySpecialRenderer(LathePart1TileEntity.class, new UniversalTileRender( + new LathePart1Model(), new ResourceLocation(IHLModInfo.MODID + ":textures/blocks/coiler.png"))); + ClientRegistry.bindTileEntitySpecialRenderer(LathePart2TileEntity.class, new UniversalTileRender( + new LathePart2Model(), new ResourceLocation(IHLModInfo.MODID + ":textures/blocks/coiler.png"))); + ClientRegistry.bindTileEntitySpecialRenderer(LoomTileEntity.class, new UniversalTileRender(new LoomModel(), + new ResourceLocation(IHLModInfo.MODID + ":textures/blocks/detonationSprayingMachine.png"))); + ClientRegistry.bindTileEntitySpecialRenderer(ImpregnatingMachineTileEntity.class, + new ImpregnatingMachineRender(900f)); + ClientRegistry.bindTileEntitySpecialRenderer(SolarEvaporatorTileEntity.class, + new ImpregnatingMachineRender(900f)); + ClientRegistry.bindTileEntitySpecialRenderer(DetonationSprayingMachineTileEntity.class, + new DetonationSprayingMachineRender()); + ClientRegistry.bindTileEntitySpecialRenderer(CoilerTileEntity.class, new CoilerRender()); + ClientRegistry.bindTileEntitySpecialRenderer(IronWorkbenchTileEntity.class, new IronWorkbenchRender()); + ClientRegistry.bindTileEntitySpecialRenderer(RollingMachinePart1TileEntity.class, new RollingMachineRender()); + ClientRegistry.bindTileEntitySpecialRenderer(RollingMachinePart2TileEntity.class, + new UniversalTileRender(new RollingMachinePart2Model(), + new ResourceLocation(IHLModInfo.MODID + ":textures/blocks/coiler.png"))); + ClientRegistry.bindTileEntitySpecialRenderer(VulcanizationExtrudingMoldTileEntity.class, + new UniversalTileRender(new VulcanizationExtrudingMoldModel(), + new ResourceLocation(IHLModInfo.MODID + ":textures/blocks/coiler.png"))); + ClientRegistry.bindTileEntitySpecialRenderer(ExtruderTileEntity.class, new UniversalTileRender( + new ExtruderModel(), new ResourceLocation(IHLModInfo.MODID + ":textures/blocks/coiler.png"))); + ClientRegistry.bindTileEntitySpecialRenderer(WoodenRollingMachinePart1TileEntity.class, + new WoodenRollingMachineRender()); + ClientRegistry.bindTileEntitySpecialRenderer(WoodenRollingMachinePart2TileEntity.class, + new UniversalTileRender(new WoodenRollingMachinePart2Model(), + new ResourceLocation(IHLModInfo.MODID + ":textures/blocks/woodenRollingMachine.png"))); + ClientRegistry.bindTileEntitySpecialRenderer(GasWeldingStationTileEntity.class, + new UniversalTileRender(new GasWeldingStationModel(), + new ResourceLocation(IHLModInfo.MODID + ":textures/blocks/gasWeldingStation.png"))); + ClientRegistry.bindTileEntitySpecialRenderer(GaedesMercuryRotaryPumpTileEntity.class, + new UniversalTileRender(new GaedesMercuryRotaryPumpModel(), + new ResourceLocation(IHLModInfo.MODID + ":textures/blocks/extruder.png"))); + ClientRegistry.bindTileEntitySpecialRenderer(FractionatorBottomTileEntity.class, + new UniversalTileRender(new FractionatorBottomModel(), + new ResourceLocation(IHLModInfo.MODID + ":textures/blocks/splitInjectionMold.png"))); + ClientRegistry.bindTileEntitySpecialRenderer(FractionatorSectionTileEntity.class, + new UniversalTileRender(new FractionatorSectionModel(), + new ResourceLocation(IHLModInfo.MODID + ":textures/blocks/splitInjectionMold.png"))); + ClientRegistry.bindTileEntitySpecialRenderer(FractionatorCoverTileEntity.class, + new UniversalTileRender(new FractionatorCoverModel(), + new ResourceLocation(IHLModInfo.MODID + ":textures/blocks/splitInjectionMold.png"))); + ClientRegistry.bindTileEntitySpecialRenderer(RefluxCondenserTileEntity.class, + new UniversalTileRender(new RefluxCondenserModel(), + new ResourceLocation(IHLModInfo.MODID + ":textures/blocks/splitInjectionMold.png"))); + ClientRegistry.bindTileEntitySpecialRenderer(BatterySwitchUnitTileEntity.class, + new UniversalTileRender(new BatterySwitchUnitModel(), + new ResourceLocation(IHLModInfo.MODID + ":textures/blocks/batterySwitchUnit.png"))); + ClientRegistry.bindTileEntitySpecialRenderer(ElectrolysisBathTileEntity.class, + new UniversalTileRender(new ElectrolysisBathModel(), + new ResourceLocation(IHLModInfo.MODID + ":textures/blocks/electrolysisBath.png"))); + if (loadMirrorRender && IHLMod.config.mirrorReflectionRange > 0) { + ClientRegistry.bindTileEntitySpecialRenderer(MirrorTileEntity.class, new MirrorRender()); + } + selectionBoxSpecialRendererRegistry.put(AnchorTileEntity.class, new CableHolderSelectionBoxSpecialRenderer()); + selectionBoxSpecialRendererRegistry.put(RectifierTransformerUnitTileEntity.class, + new RectifierTransformerUnitSelectionBoxSpecialRenderer()); + MinecraftForgeClient.registerItemRenderer(IHLUtils.getThisModItem("cannonBronze"), + new BlockItemRender(new DetonationSprayingMachineModel(), + new ResourceLocation(IHLModInfo.MODID + ":textures/blocks/detonationSprayingMachine.png"), 0, 0, + 0.0F, 0.0F)); + MinecraftForgeClient.registerItemRenderer(IHLUtils.getThisModItem("lathePart1"), + new BlockItemRender(new LathePart1Model(), + new ResourceLocation(IHLModInfo.MODID + ":textures/blocks/coiler.png"), 0, 0, 0.0F, 0.0F)); + MinecraftForgeClient.registerItemRenderer(IHLUtils.getThisModItem("lathePart2"), + new BlockItemRender(new LathePart2Model(), + new ResourceLocation(IHLModInfo.MODID + ":textures/blocks/coiler.png"), 0, 0, 0.0F, 0.0F)); + MinecraftForgeClient.registerItemRenderer(IHLUtils.getThisModItem("rollingMachinePart1"), + new BlockItemRender(new RollingMachinePart1Model(), + new ResourceLocation(IHLModInfo.MODID + ":textures/blocks/coiler.png"), 0, 5, 0.0F, 0.0F)); + MinecraftForgeClient.registerItemRenderer(IHLUtils.getThisModItem("rollingMachinePart2"), + new BlockItemRender(new RollingMachinePart2Model(), + new ResourceLocation(IHLModInfo.MODID + ":textures/blocks/coiler.png"), 0, 0, 0.0F, 0.0F)); + MinecraftForgeClient.registerItemRenderer(IHLUtils.getThisModItem("coiler"), + new BlockItemRender(new CoilerModel(), + new ResourceLocation(IHLModInfo.MODID + ":textures/blocks/coiler.png"), 0, 6, 0.0F, 0.0F)); + MinecraftForgeClient.registerItemRenderer(IHLUtils.getThisModItem("loom"), + new BlockItemRender(new LoomModel(), + new ResourceLocation(IHLModInfo.MODID + ":textures/blocks/detonationSprayingMachine.png"), 0, 0, + 0.0F, 0.0F)); + MinecraftForgeClient.registerItemRenderer(IHLUtils.getThisModItem("vulcanizationExtrudingMold"), + new BlockItemRender(new VulcanizationExtrudingMoldModel(), + new ResourceLocation(IHLModInfo.MODID + ":textures/blocks/coiler.png"), 0, 0, 0.0F, 0.0F)); + MinecraftForgeClient.registerItemRenderer(IHLUtils.getThisModItem("extruder"), + new BlockItemRender(new ExtruderModel(), + new ResourceLocation(IHLModInfo.MODID + ":textures/blocks/coiler.png"), 0, 0, 0.0F, 0.0F)); + MinecraftForgeClient.registerItemRenderer(IHLUtils.getThisModItem("woodenRollingMachinePart1"), + new BlockItemRender(new WoodenRollingMachinePart2Model(), + new ResourceLocation(IHLModInfo.MODID + ":textures/blocks/woodenRollingMachine.png"), 0, 0, + 0.0F, 0.0F)); + MinecraftForgeClient.registerItemRenderer(IHLUtils.getThisModItem("woodenRollingMachinePart2"), + new BlockItemRender(new WoodenRollingMachinePart2Model(), + new ResourceLocation(IHLModInfo.MODID + ":textures/blocks/woodenRollingMachine.png"), 0, 0, + 0.0F, 0.0F)); + MinecraftForgeClient.registerItemRenderer(IHLUtils.getThisModItem("gasWeldingStation"), + new BlockItemRender(new GasWeldingStationModel(), + new ResourceLocation(IHLModInfo.MODID + ":textures/blocks/gasWeldingStation.png"), 0, 0, 0.0F, + 0.0F)); + MinecraftForgeClient.registerItemRenderer(IHLUtils.getThisModItem("gaedesMercuryRotaryPump"), + new BlockItemRender(new GaedesMercuryRotaryPumpModel(), + new ResourceLocation(IHLModInfo.MODID + ":textures/blocks/extruder.png"), 0, 0, 0.0F, 0.0F)); + MinecraftForgeClient.registerItemRenderer(IHLMod.ihlSkull, new SkullItemRender()); + MinecraftForgeClient.registerItemRenderer(IHLUtils.getThisModItem("fractionatorBottom"), + new BlockItemRender(new FractionatorBottomModel(), + new ResourceLocation(IHLModInfo.MODID + ":textures/blocks/splitInjectionMold.png"), 0, 0, 0.0F, + 0.0F)); + MinecraftForgeClient.registerItemRenderer(IHLUtils.getThisModItem("fractionatorSection"), + new BlockItemRender(new FractionatorSectionModel(), + new ResourceLocation(IHLModInfo.MODID + ":textures/blocks/splitInjectionMold.png"), 0, 0, 0.0F, + 0.0F)); + MinecraftForgeClient.registerItemRenderer(IHLUtils.getThisModItem("fractionatorCover"), + new BlockItemRender(new FractionatorCoverModel(), + new ResourceLocation(IHLModInfo.MODID + ":textures/blocks/splitInjectionMold.png"), 0, 0, 0.0F, + 0.0F)); + MinecraftForgeClient.registerItemRenderer(IHLUtils.getThisModItem("refluxCondenser"), + new BlockItemRender(new RefluxCondenserModel(), + new ResourceLocation(IHLModInfo.MODID + ":textures/blocks/splitInjectionMold.png"), 0, 0, 0.0F, + 0.0F)); + MinecraftForgeClient.registerItemRenderer(IHLUtils.getThisModItem("batterySwitchUnit"), + new BlockItemRender(new BatterySwitchUnitModel(), + new ResourceLocation(IHLModInfo.MODID + ":textures/blocks/batterySwitchUnit.png"), 0, 0, 0.0F, + 0.0F)); + MinecraftForgeClient.registerItemRenderer(IHLUtils.getThisModItem("electrolysisBath"), + new BlockItemRender(new ElectrolysisBathModel(), + new ResourceLocation(IHLModInfo.MODID + ":textures/blocks/electrolysisBath.png"), 0, 0, 0.0F, + 0.0F)); + MinecraftForgeClient.registerItemRenderer(IHLTool.instance, new IHLToolRenderer()); + MinecraftForgeClient.registerItemRenderer(FlexibleCableItem.instance, new FlexibleCableItemRender()); + RenderingRegistry.registerEntityRenderingHandler(LostHeadEntity.class, new LostHeadRender()); + 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()); + } + + @Override + public void spawnParticle(int particle, World world, double x, double y, double z, double mx, double my, double mz, + float particleScale) { + switch (particle) { + case 0: + FlameEntityFX flamePEFX1 = new FlameEntityFX(world, x, y, z, mx, my, mz, particleScale); + world.spawnEntityInWorld(flamePEFX1); + break; + case 1: + BlobEntityFX blob = new BlobEntityFX(world, x, y, z, mx, my, mz, particleScale, FluidType.RESIN); + world.spawnEntityInWorld(blob); + break; + case 2: + BlobEntityFX blob2 = new BlobEntityFX(world, x, y, z, mx, my, mz, particleScale, FluidType.SAP); + world.spawnEntityInWorld(blob2); + break; + case 3: + 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); + break; + } + } + + @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 + public void registerIcons(TextureStitchEvent.Pre event) { + if (event.map.getTextureType() == 0) { + IHLFluid.registerIcons(event.map); + } + } + + @Override + public Render getRenderForEntityClass(Class entityClass) { + return (Render) RenderManager.instance.entityRenderMap.get(entityClass); + } + + @Override + public void initBlockRenderer() { + new IHLBlockRenderer(); + } + + @Override + public int getGLDisplayList() { + return GLAllocation.generateDisplayLists(1); + } + + @Override + public File getMinecraftDir() { + return Minecraft.getMinecraft().mcDataDir; + } + + @Override + public int shareBlockRendererByMachineType(MachineType type) { + return sharedBlockRenders.get(type); + } + + public void registerBlockHandler(ISimpleBlockRenderingHandler handler, MachineType... types) { + RenderingRegistry.registerBlockHandler(handler); + for (MachineType type : types) { + sharedBlockRenders.put(type, handler.getRenderId()); + } + } + + @SubscribeEvent + public void onPacketFromServerToClient(FMLNetworkEvent.ClientCustomPacketEvent event) throws IOException { + WorldClient world = Minecraft.getMinecraft().theWorld; + ByteBuf data = event.packet.payload(); + ByteBufInputStream byteBufInputStream = new ByteBufInputStream(data); + switch (byteBufInputStream.read()) { + case 0: + int particleId = byteBufInputStream.read(); + float x = byteBufInputStream.readFloat(); + float y = byteBufInputStream.readFloat(); + float z = byteBufInputStream.readFloat(); + float mx = byteBufInputStream.readFloat(); + float my = byteBufInputStream.readFloat(); + float mz = byteBufInputStream.readFloat(); + float particleScale = byteBufInputStream.readFloat(); + this.spawnParticle(particleId, world, x, y, z, mx, my, mz, particleScale); + break; + case 1: + int entityId = byteBufInputStream.readInt(); + INetworkListener listener = (INetworkListener) world.getEntityByID(entityId); + if (listener != null) { + listener.recieveData(byteBufInputStream); + IHLMod.log.debug("Data delivered to client"); + } else { + delayedEntityDataPacket.put(entityId, data); + 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(world, soundId, x, y, z, volume, pitch); + break; + } + byteBufInputStream.close(); + } + + 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()); + if (ssbr != null) { + ssbr.drawSelectionBox(player, currentItem, target, partialTicks); + return true; + } else { + return false; + } + } + + @Override + public void sendItemStackNBTTagFromClientToServerPlayer(EntityPlayer player, int slotNumber, String fieldName, + int fieldValue) { + ByteBuf bb = Unpooled.buffer(36); + ByteBufOutputStream byteBufOutputStream = new ByteBufOutputStream(bb); + try { + byteBufOutputStream.write(0); + byteBufOutputStream.writeInt(player.getEntityId()); + byteBufOutputStream.writeInt(player.worldObj.provider.dimensionId); + byteBufOutputStream.writeInt(slotNumber); + byteBufOutputStream.writeInt(fieldValue); + byteBufOutputStream.writeUTF(fieldName); + channel.sendToServer(new FMLProxyPacket(byteBufOutputStream.buffer(), IHLModInfo.MODID)); + byteBufOutputStream.close(); + } catch (IOException e) { + 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(); + } + } + + public void sendIntegerFieldValueFromClientToServer(int value, String fieldName, TileEntity tileEntity) { + ByteBuf bb = Unpooled.buffer(64); + ByteBufOutputStream byteBufOutputStream = new ByteBufOutputStream(bb); + try { + byteBufOutputStream.write(2); + byteBufOutputStream.writeInt(tileEntity.getWorldObj().provider.dimensionId); + byteBufOutputStream.writeInt(tileEntity.xCoord); + byteBufOutputStream.writeInt(tileEntity.yCoord); + byteBufOutputStream.writeInt(tileEntity.zCoord); + byteBufOutputStream.writeInt(value); + byteBufOutputStream.writeUTF(fieldName); + channel.sendToServer(new FMLProxyPacket(byteBufOutputStream.buffer(), IHLModInfo.MODID)); + byteBufOutputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + +} diff --git a/src/main/java/ihl/IHLCreativeTab.java b/src/main/java/ihl/IHLCreativeTab.java new file mode 100644 index 0000000..ddccc5b --- /dev/null +++ b/src/main/java/ihl/IHLCreativeTab.java @@ -0,0 +1,35 @@ +package ihl; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +public class IHLCreativeTab extends CreativeTabs { + + private static ItemStack ic2_handpump; + public static final CreativeTabs tab = new IHLCreativeTab(); + + public IHLCreativeTab() + { + super("IHL"); + } + + @Override + public ItemStack getIconItemStack() + { + ic2_handpump = new ItemStack(IHLMod.ic2_handpump); + return ic2_handpump; + } + + @Override + public Item getTabIconItem() + { + return null; + } + + @Override + public String getTranslatedTabLabel() + { + return "IHL"; + } +} \ No newline at end of file diff --git a/src/main/java/ihl/IHLMod.java b/src/main/java/ihl/IHLMod.java new file mode 100644 index 0000000..17f48c5 --- /dev/null +++ b/src/main/java/ihl/IHLMod.java @@ -0,0 +1,2318 @@ +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; + +import org.apache.logging.log4j.Logger; + +import codechicken.nei.NEIModContainer; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.IFuelHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.Mod; +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.registry.EntityRegistry; +import cpw.mods.fml.common.registry.GameRegistry; +import gregapi.data.IL; +import gregapi.data.MT; +import gregapi.data.OP; +import gregapi.oredict.OreDictManager; +import gregapi.recipes.GT_ModHandler; +import gregapi.recipes.Recipe; +import gregtech.api.GregTech_API; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_OreDictUnificator; +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.api.recipe.Recipes; +import ic2.core.Ic2Items; +import ic2.core.util.StackUtil; +import ihl.crop_harvestors.RubberTreeBlock; +import ihl.crop_harvestors.SackBlock; +import ihl.crop_harvestors.SackTileEntity; +import ihl.enviroment.LaserHitMirrorEventHandler; +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; +import ihl.flexible_cable.IronWorkbenchTileEntity; +import ihl.flexible_cable.NodeEntity; +import ihl.flexible_cable.PowerCableNodeEntity; +import ihl.handpump.AdvancedHandPump; +import ihl.handpump.IHLHandPump; +import ihl.items_blocks.FiberItem; +import ihl.items_blocks.FlexibleCableItem; +import ihl.items_blocks.FlexiblePipeItem; +import ihl.items_blocks.IHLBucketHandler; +import ihl.items_blocks.IHLTool; +import ihl.items_blocks.ItemSubstance; +import ihl.items_blocks.MachineBaseBlock; +import ihl.items_blocks.RecipeInputs; +import ihl.metallurgy.constants.ElectricConductor; +import ihl.nei_integration.NEIIHLConfig; +import ihl.processing.chemistry.BatteryItem; +import ihl.processing.chemistry.ChemicalReactorTileEntity; +import ihl.processing.chemistry.CryogenicDistillerTileEntity; +import ihl.processing.chemistry.ElectricEvaporatorBlock; +import ihl.processing.chemistry.ElectricEvaporatorTileEntity; +import ihl.processing.chemistry.ElectrolysisBathTileEntity; +import ihl.processing.chemistry.EvaporatorBlock; +import ihl.processing.chemistry.EvaporatorTileEntity; +import ihl.processing.chemistry.FluidizedBedReactorTileEntity; +import ihl.processing.chemistry.FractionatorBottomTileEntity; +import ihl.processing.chemistry.LabElectrolyzerTileEntity; +import ihl.processing.chemistry.LeadOvenTileEntity; +import ihl.processing.chemistry.LoomTileEntity; +import ihl.processing.chemistry.PaperMachineTileEntity; +import ihl.processing.metallurgy.AchesonFurnanceTileEntity; +import ihl.processing.metallurgy.Crucible; +import ihl.processing.metallurgy.DetonationSprayingMachineTileEntity; +import ihl.processing.metallurgy.ElectricEngineItem; +import ihl.processing.metallurgy.ExtruderTileEntity; +import ihl.processing.metallurgy.GasWeldingStationTileEntity; +import ihl.processing.metallurgy.ImpregnatingMachineTileEntity; +import ihl.processing.metallurgy.InjectionMoldBlock; +import ihl.processing.metallurgy.MuffleFurnanceTileEntity; +import ihl.processing.metallurgy.RollingMachinePart1TileEntity; +import ihl.processing.metallurgy.VulcanizationExtrudingMoldTileEntity; +import ihl.processing.metallurgy.WireMillTileEntity; +import ihl.processing.metallurgy.WoodenRollingMachinePart1TileEntity; +import ihl.recipes.IronWorkbenchRecipe; +import ihl.recipes.RecipeInputDetonator; +import ihl.recipes.RecipeInputDie; +import ihl.recipes.RecipeInputOreDictionaryList; +import ihl.recipes.RecipeInputWire; +import ihl.recipes.RecipeOutputItemStack; +import ihl.recipes.UniversalRecipeInput; +import ihl.recipes.UniversalRecipeOutput; +import ihl.servitor.BoneBlock; +import ihl.servitor.LostHeadEntity; +import ihl.trans_dimensional_item_teleporter.TDITBlock; +import ihl.trans_dimensional_item_teleporter.TDITFrequencyTransmitter; +import ihl.trans_dimensional_item_teleporter.TDITTileEntity; +import ihl.utils.EntityDropEventHandler; +import ihl.utils.FluidDictionary; +import ihl.utils.IHLUtils; +import ihl.worldgen.IHLWorldGenerator; +import ihl.worldgen.ores.BlockOre; +import ihl.worldgen.ores.DebugScannerBlock; +import ihl.worldgen.ores.DebugScannerTileEntity; +import ihl.worldgen.ores.IHLFluid; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.FurnaceRecipes; +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.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.oredict.OreDictionary; + +@Mod(modid = IHLModInfo.MODID, name = IHLModInfo.MODNAME, version = IHLModInfo.MODVERSION, dependencies = "required-after:IC2@[2.2.767-experimental,)") +public class IHLMod implements IFuelHandler { + + @SidedProxy(clientSide = "ihl.ClientProxy", serverSide = "ihl.ServerProxy") + public static ServerProxy proxy; + public static IHLModConfig config; + public static IHLENet enet; + // This used to determine if GregTech mod presented on server and load + // GregTech recipes. + public static boolean isGregTechModLoaded = false; + public static boolean isGT_API_Version_5 = false; + public static Block cableAnchorBlock; + public static Block sackBlock; + public static Block rubberTreeBlock; + public static Block spruceTreeBlock; + public static Block evaporatorBlock; + public static Block electricEvaporatorBlock; + public static Block boneBlock = (new BoneBlock(Material.coral)).setBlockName("boneBlock").setHardness(2.0F) + .setResistance(2.0F); + public static Item ic2_handpump; + public static Item ic2_advanced_handpump; + public static Item ihlSkull = (new Item()).setUnlocalizedName("skull").setFull3D() + .setCreativeTab(CreativeTabs.tabMisc).setTextureName(IHLModInfo.MODID + ":skull"); + public static Block ic2Leaves; + public static Block ic2Wood; + public static Block tditBlock = (new TDITBlock(Material.glass)).setBlockName("tditBlock") + .setBlockTextureName(IHLModInfo.MODID + ":tditRight").setHardness(0.5F).setResistance(0.5F); + public static Item tditft; + public static Block ds = new DebugScannerBlock(Material.ice).setBlockName("debugScanner") + .setBlockTextureName(IHLModInfo.MODID + ":tditTop"); + public static Item crucible; + public static Logger log; + private ItemStack pfaalimestone; + private ItemStack pfaacobblelimestone; + public static FluidDictionary fluidDictionary; + public static Map moltenAmounts = new HashMap(); + public static ExplosionVectorBlockV2 explosionHandler; + + @EventHandler + public void preInit(FMLPreInitializationEvent evt) throws IOException, ParserConfigurationException { + fluidDictionary = new FluidDictionary(); + log = evt.getModLog(); + IHLMod.config = new IHLModConfig(evt); + rubberTreeBlock = (new RubberTreeBlock(RubberTreeBlock.TreeType.RUBBERTREE)).setBlockName("rubberTreeBlock") + .setBlockTextureName(IHLModInfo.MODID + ":blockRubWoodFront").setHardness(2.0F).setResistance(5.0F); + spruceTreeBlock = (new RubberTreeBlock(RubberTreeBlock.TreeType.SPRUCE)).setBlockName("spruceBlock") + .setBlockTextureName(IHLModInfo.MODID + ":blockSpruceFront").setHardness(2.0F).setResistance(5.0F) + .setCreativeTab(IHLCreativeTab.tab); + GameRegistry.registerFuelHandler(this); + FiberItem.init(); + FlexiblePipeItem.init(); + InjectionMoldBlock.init(); + ElectricEngineItem.init(); + BlockOre.init(); + IHLFluid.init(); + GameRegistry.registerWorldGenerator(new IHLWorldGenerator(), 0); + ItemSubstance.init(); + BatteryItem.init(); + IHLTool.init(); + MirrorBlock.init(); + MachineBaseBlock.init();// must be first + IHLMod.enet = new IHLENet(); + MinecraftForge.EVENT_BUS.register(new EntityDropEventHandler()); + MinecraftForge.EVENT_BUS.register(new LaserHitMirrorEventHandler()); + MinecraftForge.EVENT_BUS.register(new IHLBucketHandler()); + MinecraftForge.EVENT_BUS.register(proxy); + FMLCommonHandler.instance().bus().register(proxy); + GameRegistry.registerBlock(ds, "debugScanner"); + GameRegistry.registerTileEntity(DebugScannerTileEntity.class, "DebugScanner"); + cableAnchorBlock = new AnchorBlock("cableAnchor"); + List info1 = new ArrayList(); + info1.add("non vulcanized rubber insulated"); + GroundRemoverItem.init(); + FlexibleCableItem.init(); + ExplosiveBlock.init(); + PileBlock.init(); + GameRegistry.registerTileEntity(AnchorTileEntity.class, "anchorTileEntity"); + + crucible = new Crucible(); + + ic2_handpump = new IHLHandPump().setUnlocalizedName("handpump"); + ic2_advanced_handpump = new AdvancedHandPump().setUnlocalizedName("advanced_handpump"); + tditft = new TDITFrequencyTransmitter().setUnlocalizedName("tditFrequencyTransmitter"); + + evaporatorBlock = (new EvaporatorBlock(Material.iron)).setBlockName("evaporatorBlock") + .setBlockTextureName(IHLModInfo.MODID + ":solidFuelEvaporatorFrontActive").setHardness(5.0F) + .setResistance(5.0F); + electricEvaporatorBlock = (new ElectricEvaporatorBlock(Material.iron)).setBlockName("electricEvaporatorBlock") + .setBlockTextureName(IHLModInfo.MODID + ":electricEvaporatorFrontActive").setHardness(5.0F) + .setResistance(5.0F); + sackBlock = (new SackBlock(Material.iron)).setBlockName("sackBlock") + .setBlockTextureName(IHLModInfo.MODID + ":sackItem").setHardness(0.5F).setResistance(0.5F); + + GameRegistry.registerBlock(boneBlock, "boneBlock"); + + GameRegistry.registerItem(ic2_handpump, "Handpump"); + GameRegistry.registerItem(ic2_advanced_handpump, ic2_advanced_handpump.getUnlocalizedName()); + GameRegistry.registerItem(ihlSkull, "skull"); + + GameRegistry.registerBlock(rubberTreeBlock, "rubberTreeBlock"); + GameRegistry.registerBlock(spruceTreeBlock, "spruceTreeBlock"); + GameRegistry.registerBlock(sackBlock, "sackBlock"); + GameRegistry.registerTileEntity(SackTileEntity.class, "sackTileEntity"); + GameRegistry.registerBlock(evaporatorBlock, "evaporatorBlock"); + GameRegistry.registerBlock(electricEvaporatorBlock, "electricEvaporatorBlock"); + GameRegistry.registerTileEntity(EvaporatorTileEntity.class, "evaporatorTileEntity"); + GameRegistry.registerTileEntity(ElectricEvaporatorTileEntity.class, "electricEvaporatorTileEntity"); + + GameRegistry.registerBlock(tditBlock, "tditBlock"); + GameRegistry.registerTileEntity(TDITTileEntity.class, "tditTileEntity"); + GameRegistry.registerItem(tditft, "tditftItem"); + MinecraftForge.EVENT_BUS.register(new ChunkAndWorldLoadEventHandler()); + IHLMod.log.info("IHL precalculating explosion."); + IHLMod.explosionHandler = new ExplosionVectorBlockV2(); + IHLMod.log.info("Explosion calculated."); + proxy.load(); + registerEntities(); + OreDictionary.registerOre("ingotBrick", Items.brick); + OreDictionary.registerOre("dustGunpowder", Items.gunpowder); + OreDictionary.registerOre("toolLighter", new ItemStack(Items.flint_and_steel, 1, OreDictionary.WILDCARD_VALUE)); + OreDictionary.registerOre("charcoal", new ItemStack(Items.coal, 1, 1)); + 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")); + } + + @EventHandler + public void postInit(FMLPostInitializationEvent evt) throws IOException { + ic2Leaves = StackUtil.getBlock(IC2Items.getItem("rubberLeaves")); + ic2Wood = StackUtil.getBlock(IC2Items.getItem("rubberWood")); + 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 }); + Recipes.advRecipes.addRecipe(new ItemStack(evaporatorBlock, 1), + new Object[] { " B ", " I ", " ", Character.valueOf('B'), Items.bucket, + Character.valueOf('I'), IC2Items.getItem("ironFurnace") }); + EvaporatorTileEntity.init(); + } + if (IHLMod.config.enableTDIT) { + Recipes.advRecipes.addRecipe(new ItemStack(tditBlock, 1), + new Object[] { "AAA", "CMC", "ATA", Character.valueOf('A'), IC2Items.getItem("advancedAlloy"), + Character.valueOf('C'), new ItemStack(Blocks.chest, 1), Character.valueOf('M'), + IC2Items.getItem("advancedMachine"), Character.valueOf('T'), + IC2Items.getItem("teleporter") }); + Recipes.advRecipes.addRecipe(new ItemStack(tditft, 1), + new Object[] { " CC", "IAI", " ", Character.valueOf('I'), IC2Items.getItem("casingiron"), + Character.valueOf('C'), IC2Items.getItem("copperCableItem"), Character.valueOf('A'), + IC2Items.getItem("advancedCircuit") }); + } + GameRegistry.addRecipe(new ItemStack(boneBlock, 1), + new Object[] { "XXX", "XYX", "XXX", 'X', Items.bone, 'Y', Items.iron_ingot }); + GameRegistry.addRecipe(new ItemStack(boneBlock, 1), + new Object[] { "XZX", "XYX", "XZX", 'X', Items.bone, 'Y', Items.iron_ingot, 'Z', ihlSkull }); + GameRegistry.addShapelessRecipe(new ItemStack(Items.dye, 2, 15), new Object[] { ihlSkull }); + FurnaceRecipes.smelting().func_151394_a(IHLUtils.getThisModItemStack("bucket_SpruceResin"), + IHLUtils.getThisModItemStack("bucket_tarPitch"), 20F); + 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, 1); + pfaacobblelimestone = IHLUtils.getOtherModItemStackWithDamage("PFAAGeologica", "mediumCobble", 0, 1); + isGregTechModLoaded = Loader.isModLoaded("gregtech"); + if (isGregTechModLoaded) { + try { + Class.forName("gregapi.GT_API"); + } catch (ClassNotFoundException e) { + isGT_API_Version_5 = true; + } + if (isGT_API_Version_5) { + this.loadGT5Recipes(); + } else { + this.loadGT6Recipes(); + } + } else { + this.loadIC2Recipes(); + } + IHLUtils.addIC2RollingRecipe("ingotTungsten", IHLUtils.getOreDictItemStack("plateTungsten")); + IHLUtils.addIC2CentrifugeRecipe("crushedGyubnera", IHLUtils.getThisModItemStack("crushedPurifiedGyubnera"), + IHLUtils.getThisModItemStack("dustPotassiumFeldspar")); + IHLUtils.addIC2CentrifugeRecipe("crushedCinnabar", IHLUtils.getThisModItemStack("crushedPurifiedCinnabar"), + IHLUtils.getThisModItemStack("dustPotassiumFeldspar")); + 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)); + IHLUtils.addIC2MaceratorRecipe("oreGypsum", IHLUtils.getOreDictItemStack("dustGypsum")); + IHLUtils.addIC2MaceratorRecipe("orePotassiumFeldspar", + IHLUtils.getOreDictItemStack("dustPotassiumFeldspar")); + IHLUtils.addIC2MaceratorRecipe("oreLimestone", IHLUtils.getOreDictItemStackWithSize("dustCalcite", 4)); + IHLUtils.addIC2MaceratorRecipe("oreSaltpeter", IHLUtils.getOreDictItemStackWithSize("dustSaltpeter", 4)); + IHLUtils.addIC2MaceratorRecipe("oreGyubnera", IHLUtils.getThisModItemStackWithSize("crushedGyubnera", 2)); + IHLUtils.addIC2MaceratorRecipe("oreCinnabar", IHLUtils.getThisModItemStackWithSize("crushedCinnabar", 2)); + IHLUtils.addIC2MaceratorRecipe("oreBauxite", IHLUtils.getThisModItemStackWithSize("crushedBauxite", 2)); + IHLUtils.addIC2MaceratorRecipe("crushedPurifiedBauxite", IHLUtils.getThisModItemStack("dustBauxite")); + IHLUtils.addIC2MaceratorRecipe("oreStibnite", IHLUtils.getThisModItemStackWithSize("crushedStibnite", 2)); + IHLUtils.addIC2MaceratorRecipe("crushedPurifiedStibnite", IHLUtils.getThisModItemStack("dustStibnite")); + IHLUtils.addIC2MaceratorRecipe("blockGlass", IHLUtils.getOreDictItemStackWithSize("dustGlass", 1)); + IHLUtils.addIC2MaceratorRecipe("stickGraphite", 2, IHLUtils.getThisModItemStack("dustGraphite")); + IHLUtils.addIC2MaceratorRecipe("oreMica", IHLUtils.getThisModItemStackWithSize("dustMica", 4)); + IHLUtils.addIC2MaceratorRecipe("oreTrona", IHLUtils.getThisModItemStackWithSize("dustTrona", 4)); + IHLUtils.addIC2MaceratorRecipe(Ic2Items.iridiumOre, IHLUtils.getThisModItemStack("dustIridium")); + IHLUtils.addIC2MaceratorRecipe("oreDatolite", IHLUtils.getThisModItemStackWithSize("dustDatolite", 4)); + IHLUtils.addIC2MaceratorRecipe("oreBischofite", IHLUtils.getThisModItemStackWithSize("dustBischofite", 4)); + IHLUtils.addIC2MaceratorRecipe("ingotBrick", IHLUtils.getOreDictItemStackWithSize("dustBrick", 1)); + 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") }); + Recipes.advRecipes.addShapelessRecipe(IHLUtils.getThisModItemStack("sharpenedCarvingKnifeBronze"), + new Object[] { IHLUtils.getThisModItemStack("grindstone"), + IHLUtils.getThisModItemStack("carvingKnifeBronze") }); + Recipes.advRecipes.addRecipe(IHLUtils.getThisModItemStack("hammer"), + new Object[] { "H ", "SC ", " ", Character.valueOf('H'), + IHLUtils.getThisModItemStack("toolHeadHammerSmallSteel"), Character.valueOf('S'), + new ItemStack(Items.stick), Character.valueOf('C'), + new RecipeInputOreDict("craftingToolKnife") }); + Recipes.advRecipes.addRecipe(IHLUtils.getThisModItemStackWithSize("grindstone", 2), + new Object[] { " H ", " Q ", " ", Character.valueOf('H'), + new RecipeInputOreDict("craftingToolForgeHammer"), Character.valueOf('Q'), + new RecipeInputOreDict("blockQuartz") }); + Recipes.advRecipes.addRecipe(IHLUtils.getThisModItemStackWithSize("grindstone", 2), + new Object[] { " H ", " Q ", " ", Character.valueOf('H'), + new RecipeInputOreDict("craftingToolHardHammer"), Character.valueOf('Q'), + new RecipeInputOreDict("blockQuartz") }); + Recipes.advRecipes.addRecipe(IHLUtils.getThisModItemStackWithSize("blankNeedleFileSteel", 64), + new Object[] { " H ", " C ", " P ", Character.valueOf('H'), + new RecipeInputOreDict("craftingToolForgeHammer"), Character.valueOf('C'), + new RecipeInputOreDict("craftingToolChisel"), Character.valueOf('P'), + IHLUtils.getThisModItemStack("plateHotSteel") }); + Recipes.metalformerExtruding.addRecipe(new RecipeInputOreDict("dustIrongraphite"), null, + IHLUtils.getThisModItemStackWithSize("linerIronGraphite", 4)); + Recipes.compressor.addRecipe(new RecipeInputOreDict("foilMica", 4), null, + IHLUtils.getThisModItemStack("plateMica")); + Recipes.metalformerExtruding.addRecipe(new RecipeInputOreDict("dustBoronCarbide"), null, + IHLUtils.getThisModItemStackWithSize("stickBoronCarbide", 2)); + Recipes.metalformerRolling.addRecipe( + new RecipeInputItemStack(IHLUtils.getThisModItemStack("dustCoalElectrodePremix")), null, + IHLUtils.getThisModItemStack("plateRawCoal")); + Recipes.metalformerExtruding.addRecipe( + new RecipeInputItemStack(IHLUtils.getThisModItemStack("foilRubberWithSulfur")), null, + IHLUtils.getThisModItemStack("batteryCellsEbonite")); + GameRegistry.addShapelessRecipe(IHLUtils.getThisModItemStack("dustAntimony"), new Object[] { + IHLUtils.getThisModItemStack("dustTinyAntimony"), IHLUtils.getThisModItemStack("dustTinyAntimony"), + IHLUtils.getThisModItemStack("dustTinyAntimony"), IHLUtils.getThisModItemStack("dustTinyAntimony"), + IHLUtils.getThisModItemStack("dustTinyAntimony"), IHLUtils.getThisModItemStack("dustTinyAntimony"), + IHLUtils.getThisModItemStack("dustTinyAntimony"), IHLUtils.getThisModItemStack("dustTinyAntimony"), + IHLUtils.getThisModItemStack("dustTinyAntimony") }); + GameRegistry.addShapelessRecipe(IHLUtils.getThisModItemStackWithSize("dustTinyAntimony", 9), + new Object[] { IHLUtils.getThisModItemStack("dustAntimony") }); + GameRegistry.addShapelessRecipe(IHLUtils.getThisModItemStack("dustSilicon"), new Object[] { + IHLUtils.getThisModItemStack("dustTinySilicon"), IHLUtils.getThisModItemStack("dustTinySilicon"), + IHLUtils.getThisModItemStack("dustTinySilicon"), IHLUtils.getThisModItemStack("dustTinySilicon"), + IHLUtils.getThisModItemStack("dustTinySilicon"), IHLUtils.getThisModItemStack("dustTinySilicon"), + IHLUtils.getThisModItemStack("dustTinySilicon"), IHLUtils.getThisModItemStack("dustTinySilicon"), + IHLUtils.getThisModItemStack("dustTinySilicon") }); + GameRegistry.addShapelessRecipe(IHLUtils.getThisModItemStackWithSize("dustTinySilicon", 9), + new Object[] { IHLUtils.getThisModItemStack("dustSilicon") }); + GameRegistry.addShapelessRecipe(IHLUtils.getThisModItemStack("dustSolderingAlloy"), new Object[] { + IHLUtils.getOreDictItemStack("dustTin"), IHLUtils.getThisModItemStack("dustTinyAntimony") }); + Recipes.advRecipes.addRecipe(IHLUtils.getThisModItemStack("achesonFurnance"), + new Object[] { "BPB", "S S", "B B", Character.valueOf('B'), new RecipeInputOreDict("ingotBrick"), + Character.valueOf('P'), new RecipeInputOreDict("plateSteel"), Character.valueOf('S'), + new RecipeInputOreDict("stickCoal") }); + Recipes.advRecipes.addRecipe(IHLUtils.getThisModItemStack("muffleFurnance"), + new Object[] { "BCB", "SDP", "BSB", Character.valueOf('B'), new RecipeInputOreDict("ingotBrick"), + Character.valueOf('P'), new RecipeInputOreDict("plateSteel"), Character.valueOf('C'), + IHLUtils.getThisModItemStack("crucibleMixture"), Character.valueOf('S'), + new RecipeInputOreDict("stickGraphite"), Character.valueOf('D'), + new RecipeInputOreDict("dustCarborundum") }); + + Recipes.advRecipes.addRecipe(IHLUtils.getThisModItemStackWithSize("nutM10x1Steel", 64), + new Object[] { "VFS", "DR ", "WT ", Character.valueOf('V'), + new RecipeInputItemStack(IHLUtils.getThisModItemStack("viseSteel")), Character.valueOf('F'), + new RecipeInputOreDict("craftingToolFile"), Character.valueOf('S'), + new RecipeInputOreDict("stickSteel"), Character.valueOf('D'), + new RecipeInputItemStack(IHLUtils.getThisModItemStack("handDrillBronze")), + Character.valueOf('R'), + new RecipeInputItemStack(IHLUtils.getThisModItemStack("drillSteelHardened")), + Character.valueOf('W'), new RecipeInputOreDict("craftingToolSaw"), Character.valueOf('T'), + new RecipeInputItemStack(IHLUtils.getThisModItemStack("tapM10x1SteelHardened")) }); + + Recipes.advRecipes.addRecipe(IHLUtils.getThisModItemStackWithSize("boltM10x1Steel", 8), + new Object[] { "VFS", "DR ", "W ", Character.valueOf('V'), + new RecipeInputItemStack(IHLUtils.getThisModItemStack("viseSteel")), Character.valueOf('F'), + new RecipeInputOreDict("craftingToolFile"), Character.valueOf('S'), + new RecipeInputItemStack(IHLUtils.getThisModItemStack("barD10Steel")), + 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(); + crystal.setItemDamage(OreDictionary.WILDCARD_VALUE); + advBattery.setItemDamage(OreDictionary.WILDCARD_VALUE); + chargedReBattery.setItemDamage(OreDictionary.WILDCARD_VALUE); + + if (IHLMod.config.enableHandpump) { + Recipes.advRecipes.addRecipe(((IHLHandPump) ic2_handpump).getItemStack(0), + new Object[] { "T ", " C ", " P", Character.valueOf('T'), IC2Items.getItem("treetap"), + Character.valueOf('C'), IC2Items.getItem("cell"), Character.valueOf('P'), + IC2Items.getItem("powerunitsmall") }); + 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, 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 }); + } + if (forestryCandle != null) { + Recipes.advRecipes.addRecipe(forestryCandle, + new Object[] { " S ", " I ", " ", Character.valueOf('S'), new ItemStack(Items.string), + Character.valueOf('I'), IHLUtils.getThisModItemStack("ingotStearin") }); + } + if (forestryWaxCast != null) { + Recipes.advRecipes.addRecipe(forestryWaxCast, + new Object[] { "BSS", "S S", "SSB", Character.valueOf('S'), + IHLUtils.getThisModItemStack("ingotStearin"), Character.valueOf('B'), + forestryBeesWax }); + } + Iterator odi = OreDictionary.getOres("dustGypsum").iterator(); + while (odi.hasNext()) { + ItemStack stack = odi.next().copy(); + stack.stackSize = 2; + FurnaceRecipes.smelting().func_151394_a(stack, IHLUtils.getThisModItemStack("dustDehydratedGypsum"), + 20F); + } + Recipes.FluidHeatGenerator.addFluid("oleicacid", 10, 16); + Recipes.FluidHeatGenerator.addFluid("mineraloil", 10, 16); + Recipes.FluidHeatGenerator.addFluid("acetylene", 10, 64); + Recipes.FluidHeatGenerator.addFluid("glycerol", 10, 16); + Recipes.FluidHeatGenerator.addFluid("turpentine", 10, 16); + Recipes.FluidHeatGenerator.addFluid("fueloil", 10, 32); + Recipes.FluidHeatGenerator.addFluid("crackinggas", 10, 32); + Recipes.semiFluidGenerator.addFluid("hydrogen", 10, 32); + Recipes.semiFluidGenerator.addFluid("crackinggas", 10, 32); + Recipes.advRecipes.addShapelessRecipe(IHLUtils.getThisModItemStackWithSize("breadWithLard", 4), + new Object[] { new ItemStack(Items.bread), IHLUtils.getThisModItemStack("muttonLard") }); + Recipes.advRecipes.addShapelessRecipe(IHLUtils.getThisModItemStack("dustCoalElectrodePremix"), + new Object[] { Ic2Items.coalDust, IHLUtils.getOreDictItemStack("nuggetTarPitch") }); + Recipes.metalformerExtruding.addRecipe( + new RecipeInputItemStack(IHLUtils.getThisModItemStack("dustCoalElectrodePremix")), null, + IHLUtils.getThisModItemStack("stickCoalElectrodePremix")); + 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))); + 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") }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(null, materialList3, Arrays + .asList(new ItemStack[] { InjectionMoldBlock.instance.getSandInjectionMoldForResult("tub") }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(null, materialList3, Arrays.asList( + new ItemStack[] { InjectionMoldBlock.instance.getSandInjectionMoldForResult("blankChisel") }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(null, materialList3, Arrays.asList( + new ItemStack[] { InjectionMoldBlock.instance.getSandInjectionMoldForResult("carvingKnife") }))); + IronWorkbenchTileEntity + .addRecipe(new IronWorkbenchRecipe(null, materialList3, Arrays.asList(new ItemStack[] { + InjectionMoldBlock.instance.getSandInjectionMoldForResult("toolHeadHammerSmall") }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(null, materialList3, Arrays + .asList(new ItemStack[] { InjectionMoldBlock.instance.getSandInjectionMoldForResult("barD10") }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(null, materialList3, Arrays + .asList(new ItemStack[] { InjectionMoldBlock.instance.getSandInjectionMoldForResult("stick") }))); + IronWorkbenchTileEntity + .addRecipe(new IronWorkbenchRecipe(null, materialList3, Arrays.asList(new ItemStack[] { + InjectionMoldBlock.instance.getSandInjectionMoldForResult("setOfPartsForLVElemotor") }))); + IronWorkbenchTileEntity + .addRecipe(new IronWorkbenchRecipe(null, materialList3, Arrays.asList(new ItemStack[] { + InjectionMoldBlock.instance.getSandInjectionMoldForResult("pipelineAccessories") }))); + IronWorkbenchTileEntity + .addRecipe(new IronWorkbenchRecipe(null, materialList3, Arrays.asList(new ItemStack[] { + InjectionMoldBlock.instance.getSandInjectionMoldForResult("highPressureVessel") }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(null, materialList3, Arrays + .asList(new ItemStack[] { InjectionMoldBlock.instance.getSandInjectionMoldForResult("gasJet") }))); + 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 IRecipeInput[] { new RecipeInputItemStack(IHLUtils.getThisModItemStack("ingotStearin")), + new RecipeInputFluidContainer(FluidRegistry.getFluid("liquidglass"), 1), + new RecipeInputOreDict("dustSiliconDioxide"), + new RecipeInputItemStack(new ItemStack(Blocks.sand)) }); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe( + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("sharpenedCarvingKnifeBronze") }), + materialsForPrecisionMold, Arrays.asList(new ItemStack[] { InjectionMoldBlock.instance + .getGypsumInjectionMoldForResult("rollingMachineSetOfMoldedParts") }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe( + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("sharpenedCarvingKnifeBronze") }), + materialsForPrecisionMold, Arrays.asList(new ItemStack[] { + InjectionMoldBlock.instance.getGypsumInjectionMoldForResult("polishingPucks") }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe( + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("sharpenedCarvingKnifeBronze") }), + materialsForPrecisionMold, Arrays.asList(new ItemStack[] { InjectionMoldBlock.instance + .getGypsumInjectionMoldForResult("turboCompressorSetOfMoldedParts") }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe( + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("sharpenedCarvingKnifeBronze") }), + materialsForPrecisionMold, Arrays.asList(new ItemStack[] { InjectionMoldBlock.instance + .getGypsumInjectionMoldForResult("extruderSetOfMoldedParts") }))); + // Precision molds recipe section end + 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") }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(Arrays.asList(new ItemStack[] { + IHLUtils.getThisModItemStack("viseSteel"), IHLUtils.getThisModItemStack("setOfFilesSteel"), + IHLUtils.getThisModItemStack("handDrillBronze"), IHLUtils.getThisModItemStack("hackSawSteel"), + IHLUtils.getThisModItemStack("drillSteelHardened"), + IHLUtils.getThisModItemStack("tapM10x1SteelHardened") }), + Arrays.asList(new ItemStack[] { IHLUtils.getOreDictItemStack("stickSteel") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStackWithSize("diceM10x1Steel", 16) }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe( + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("viseSteel"), + IHLUtils.getThisModItemStack("setOfFilesSteel"), IHLUtils.getThisModItemStack("needleFile"), + IHLUtils.getThisModItemStack("hackSawSteel") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("barD10Steel") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStackWithSize("tapM10x1Steel", 2) }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe( + Arrays.asList(new IRecipeInput[] {new RecipeInputOreDict("craftingToolSaw") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("tubBronze") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("solarEvaporator") }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(Arrays.asList(new ItemStack[] { + IHLUtils.getThisModItemStack("handDrillBronze"), IHLUtils.getThisModItemStack("hackSawSteel"), + IHLUtils.getThisModItemStack("drillSteelHardened"), + IHLUtils.getThisModItemStack("diceM10x1SteelHardened"), + IHLUtils.getThisModItemStack("tapM10x1SteelHardened"), IHLUtils.getThisModItemStack("viseSteel"), + IHLUtils.getThisModItemStack("setOfFilesSteel") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStackWithSize("boltM10x1Steel", 16), + IHLUtils.getThisModItemStackWithSize("nutM10x1Steel", 12), + IHLUtils.getThisModItemStackWithSize("barD10Steel", 16), + IHLUtils.getOreDictItemStackWithSize("plateSteel", 4), + IHLUtils.getOreDictItemStack("stickSteel"), new ItemStack(Items.leather), + new ItemStack(Items.string) }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("lathePart1"), + IHLUtils.getThisModItemStack("lathePart2") }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(Arrays.asList(new ItemStack[] { + IHLUtils.getThisModItemStack("handDrillBronze"), IHLUtils.getThisModItemStack("hackSawSteel"), + IHLUtils.getThisModItemStack("drillSteelHardened"), + IHLUtils.getThisModItemStack("tapM10x1SteelHardened"), IHLUtils.getThisModItemStack("viseSteel"), + IHLUtils.getThisModItemStack("setOfFilesSteel") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStackWithSize("boltM10x1Steel", 16), + IHLUtils.getOreDictItemStack("plateSteel"), + IHLUtils.getThisModItemStack("extruderSetOfMoldedPartsSteel"), + IHLUtils.getThisModItemStack("meshGlass"), IHLUtils.getThisModItemStack("dustCarborundum"), + new ItemStack(Items.leather), new ItemStack(Items.string) }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("extruder"), + IHLUtils.getThisModItemStack("vulcanizationExtrudingMold") }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(Arrays.asList( + new ItemStack[] { IHLUtils.getThisModItemStack("chisel"), IHLUtils.getThisModItemStack("hammer") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("barD10SteelHot") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStackWithSize("nailSteel", 8) }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(Arrays.asList(new ItemStack[] { + IHLUtils.getThisModItemStack("hammer"), IHLUtils.getThisModItemStack("handDrillBronze"), + IHLUtils.getThisModItemStack("drillSteelHardened"), IHLUtils.getThisModItemStack("hackSawSteel") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("barD10Steel"), + IHLUtils.getThisModItemStackWithSize("nailSteel", 16), new ItemStack(Blocks.planks), + new ItemStack(Items.leather), new ItemStack(Items.string), + IHLUtils.getThisModItemStackWithSize("boltM10x1Steel", 8), + IHLUtils.getOreDictItemStack("plateSteel") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("coiler") }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe( + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("viseSteel"), + IHLUtils.getThisModItemStack("setOfFilesSteel"), IHLUtils.getThisModItemStack("hammer"), + IHLUtils.getThisModItemStack("diceM10x1SteelHardened"), + IHLUtils.getThisModItemStack("hackSawSteel") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("barD10Steel") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStackWithSize("boltM10x1Steel", 8) }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe( + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("viseSteel"), + IHLUtils.getThisModItemStack("setOfFilesSteel") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("handDrillSetOfMoldedPartsBronze"), + new ItemStack(Items.stick) }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("handDrillBronze") }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe( + Arrays.asList(new RecipeInputOreDict[] { new RecipeInputOreDict("craftingToolFile") }), + Arrays.asList(new IRecipeInput[] { + new RecipeInputItemStack(IHLUtils.getThisModItemStack("boltM10x1Steel"), 16), + new RecipeInputOreDict("dustCarborundum"), + new RecipeInputItemStack(IHLUtils.getThisModItemStack("crucibleMixture")), + new RecipeInputOreDict("stickGraphite"), new RecipeInputOreDict("plateSteel"), + new RecipeInputOreDict("stickSteel", 4), + new RecipeInputItemStack( + IHLUtils.getThisModItemStackWithSize("linerIronGraphiteGreased", 16)) }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("wireMill") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("lathePart1") }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe( + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("hackSawSteel"), + IHLUtils.getThisModItemStack("setOfFilesSteel") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("setOfPartsForLVElemotorSteel"), + IHLUtils.getThisModItemStack("ingotStearin"), IHLUtils.getUninsulatedWire("Copper", 4, 15), + new ItemStack(Items.paper), new ItemStack(Blocks.planks), + IHLUtils.getThisModItemStackWithSize("linerIronGraphiteGreased", 2) }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("electricMotorLVLEDC") }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe( + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("hackSawSteel"), + IHLUtils.getThisModItemStack("setOfFilesSteel") }), + Arrays.asList(new IRecipeInput[] { + new RecipeInputItemStack(IHLUtils.getThisModItemStack("setOfPartsForLVElemotorSteel")), + new RecipeInputFluidContainer(FluidRegistry.getFluid("spruceresin"), 1), + new RecipeInputWire("Copper", 4, 15), new RecipeInputItemStack(new ItemStack(Items.paper)), + new RecipeInputItemStack(new ItemStack(Blocks.planks, 1, OreDictionary.WILDCARD_VALUE)), + new RecipeInputItemStack(IHLUtils.getThisModItemStack("linerIronGraphiteGreased"), 2) }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("electricMotorLVLEDC") }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(null, + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("linerIronGraphiteHot"), + IHLUtils.getThisModItemStack("muttonLard") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("linerIronGraphiteGreased") }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(null, + Arrays.asList( + new IRecipeInput[] { new RecipeInputOreDict("dustBrick", 7), + new RecipeInputOreDict("dustClay", 3), new RecipeInputOreDict("dustGraphite", 2), + new RecipeInputFluidContainer(FluidRegistry.WATER, 1) }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStackWithSize("crucibleMixture", 12) }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(null, + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("crucibleMixture") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("crucible") }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(Arrays.asList(new ItemStack[] { + IHLUtils.getThisModItemStack("viseSteel"), IHLUtils.getThisModItemStack("setOfFilesSteel"), + IHLUtils.getThisModItemStack("handDrillBronze"), IHLUtils.getThisModItemStack("hackSawSteel"), + IHLUtils.getThisModItemStack("drillSteelHardened"), + IHLUtils.getThisModItemStack("tapM10x1SteelHardened") }), + Arrays.asList(new ItemStack[] { IHLUtils.getOreDictItemStack("stickSteel") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStackWithSize("nutM10x1Steel", 64) }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(Arrays.asList(new ItemStack[] { + IHLUtils.getThisModItemStack("hammer"), IHLUtils.getThisModItemStack("handDrillBronze"), + IHLUtils.getThisModItemStack("hackSawSteel"), IHLUtils.getThisModItemStack("drillSteelHardened"), + IHLUtils.getThisModItemStack("diceM10x1SteelHardened") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStackWithSize("barD10Steel", 4), + IHLUtils.getThisModItemStackWithSize("nutM10x1Steel", 8), new ItemStack(Items.leather), + new ItemStack(Items.stick, 8), IHLUtils.getThisModItemStackWithSize("nailSteel", 8) }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("loom") }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe( + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("hammer") }), + Arrays.asList(new ItemStack[] { + IHLUtils.getThisModItemStack("detonationSprayingMachineSetOfMoldedPartsBronze"), + new ItemStack(Blocks.planks), IHLUtils.getThisModItemStackWithSize("nailSteel", 8) }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("cannonBronze") }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(Arrays.asList(new ItemStack[] { + IHLUtils.getThisModItemStack("hammer"), lathingTool, + IHLUtils.getThisModItemStack("setOfFilesSteel"), IHLUtils.getThisModItemStack("tinSnipsSteel"), + IHLUtils.getThisModItemStack("handDrillBronze"), IHLUtils.getThisModItemStack("drillSteelHardened"), + IHLUtils.getThisModItemStack("diceM10x1SteelHardened"), + IHLUtils.getThisModItemStack("tapM10x1SteelHardened") }), + Arrays.asList(new ItemStack[] { IHLUtils.getOreDictItemStack("ingotHotSteel"), + IHLUtils.getThisModItemStack("foilRubber"), IHLUtils.getThisModItemStack("springSteel"), + IHLUtils.getThisModItemStack("barD10Steel"), + IHLUtils.getThisModItemStackWithSize("nutM10x1Steel", 6), + IHLUtils.getThisModItemStackWithSize("boltM10x1Steel", 6) }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("gasReducerSteel") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("lathePart1") }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe( + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("hammer"), lathingTool }), + Arrays.asList(new ItemStack[] { IHLUtils.getOreDictItemStack("ingotHotSteel") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("pistonCylinderSteel") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("lathePart1") }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe( + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("setOfFilesSteel") }), + Arrays.asList(new ItemStack[] { IHLUtils.getUninsulatedWire("Steel", 1, 240), + new ItemStack(Items.stick) }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStackWithSize("springSteel", 4) }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe( + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("setOfFilesSteel"), + IHLUtils.getThisModItemStack("hammer"), IHLUtils.getThisModItemStack("handDrillBronze"), + IHLUtils.getThisModItemStack("hackSawSteel"), + IHLUtils.getThisModItemStack("drillSteelHardened") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStackWithSize("barD10SteelHot", 2), + IHLUtils.getThisModItemStack("springSteel") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("tinSnipsSteel") }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(Arrays.asList(new ItemStack[] { + IHLUtils.getThisModItemStack("hammer"), IHLUtils.getThisModItemStack("tinSnipsSteel"), + IHLUtils.getThisModItemStack("handDrillBronze"), IHLUtils.getThisModItemStack("drillSteelHardened"), + IHLUtils.getThisModItemStack("diceM10x1SteelHardened"), + IHLUtils.getThisModItemStack("tapM10x1SteelHardened") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("foilRubber"), + IHLUtils.getThisModItemStackWithSize("gasReducerSteel", 2), + IHLUtils.getThisModItemStack("gasJetSteel"), + IHLUtils.getThisModItemStackWithSize("barD10Steel", 10), + IHLUtils.getThisModItemStackWithSize("highPressureVesselSteel", 2), + IHLUtils.getThisModItemStackWithSize("nutM10x1Steel", 32), + IHLUtils.getThisModItemStackWithSize("boltM10x1Steel", 32), + IHLUtils.getThisModItemStack("pipeVulcanizedRubber") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("gasWeldingStation") }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe( + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("setOfFilesSteel"), + IHLUtils.getThisModItemStack("tinSnipsSteel"), IHLUtils.getThisModItemStack("hackSawSteel"), + IHLUtils.getThisModItemStack("handDrillBronze"), + IHLUtils.getThisModItemStack("drillSteelHardened"), lathingTool }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("pistonCylinderSteel"), + IHLUtils.getOreDictItemStackWithSize("plateSteel", 2), + IHLUtils.getThisModItemStack("pipelineAccessoriesSteel"), + IHLUtils.getThisModItemStack("foilRubber"), + IHLUtils.getThisModItemStackWithSize("stickSteel", 2), + IHLUtils.getThisModItemStackWithSize("linerIronGraphiteGreased", 4), + IHLUtils.getThisModItemStackWithSize("highPressureVesselSteel", 2) }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("cryogenicDistiller") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("lathePart1") }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe( + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("setOfFilesSteel"), + IHLUtils.getThisModItemStack("tinSnipsSteel") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("meshGlass"), + IHLUtils.getThisModItemStack("dustCarborundum"), + IHLUtils.getThisModItemStack("pipelineAccessoriesSteel"), + IHLUtils.getThisModItemStack("foilRubber"), + IHLUtils.getThisModItemStack("highPressureVesselSteel"), + IHLUtils.getOreDictItemStack("stickSteel"), IHLUtils.getOreDictItemStack("plateSteel"), + IHLUtils.getThisModItemStackWithSize("barD10Steel", 4) }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("chemicalReactor") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("gasWeldingStation") }))); + IronWorkbenchTileEntity.addRecipe( + new IronWorkbenchRecipe( + Arrays.asList( + new IRecipeInput[] { + new RecipeInputItemStack(IHLUtils.getThisModItemStack("handDrillBronze")), + new RecipeInputItemStack( + IHLUtils.getThisModItemStack("drillSteelHardened")) }), + Arrays.asList(new IRecipeInput[] { + new RecipeInputItemStack(IHLUtils.getThisModItemStack("electricMotorLVLEDC")), + new RecipeInputItemStack(IHLUtils.getThisModItemStack("pipelineAccessoriesSteel")), + new RecipeInputOreDict("foilRubber"), + new RecipeInputItemStack(IHLUtils.getThisModItemStack("highPressureVesselSteel")), + new RecipeInputItemStack(IHLUtils.getThisModItemStack("pistonCylinderSteel")), + new RecipeInputItemStack(IHLUtils.getThisModItemStackWithSize("boltM10x1Steel", 8)), + new RecipeInputItemStack( + IHLUtils.getThisModItemStackWithSize("nutM10x1Steel", 8)) }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("dosingPump") }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(Arrays.asList(new ItemStack[] { + IHLUtils.getThisModItemStack("hammer"), IHLUtils.getThisModItemStack("handDrillBronze"), + IHLUtils.getThisModItemStack("hackSawSteel"), IHLUtils.getThisModItemStack("drillSteelHardened"), + IHLUtils.getThisModItemStack("diceM10x1SteelHardened") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStackWithSize("barD10SteelHot", 7), + IHLUtils.getOreDictItemStack("plateSteel"), new ItemStack(Items.leather), + IHLUtils.getThisModItemStackWithSize("nailSteel", 8), new ItemStack(Blocks.log) }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("woodenRollingMachinePart1"), + IHLUtils.getThisModItemStack("woodenRollingMachinePart2") }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe( + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("handDrillBronze"), + IHLUtils.getThisModItemStack("drillSteelHardened") }), + Arrays.asList(new ItemStack[] { IHLUtils.getOreDictItemStack("plateSteel") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("fiberGlassDieSteel") }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe( + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("handDrillBronze"), + IHLUtils.getThisModItemStack("hackSawSteel"), + IHLUtils.getThisModItemStack("drillSteelHardened"), + IHLUtils.getThisModItemStack("setOfFilesSteel") }), + Arrays.asList(new ItemStack[] { IHLUtils.getOreDictItemStack("plateSteel") }), + Arrays.asList(new ItemStack[] { + IHLUtils.getItemStackWithTag("setOfDies1_5sqmm", "transverseSection", 240) }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe( + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("handDrillBronze"), + IHLUtils.getThisModItemStack("hackSawSteel"), + IHLUtils.getThisModItemStack("drillSteelHardened"), + IHLUtils.getThisModItemStack("setOfFilesSteel") }), + Arrays.asList(new ItemStack[] { IHLUtils.getOreDictItemStack("plateSteel") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("setOfDies1_5sqmm") }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe( + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("handDrillBronze"), + IHLUtils.getThisModItemStack("hackSawSteel"), + IHLUtils.getThisModItemStack("drillSteelHardened"), + IHLUtils.getThisModItemStack("tapM10x1SteelHardened"), + IHLUtils.getThisModItemStack("setOfFilesSteel") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStackWithSize("boltM10x1Steel", 8), + IHLUtils.getOreDictItemStackWithSize("plateSteel", 4), + IHLUtils.getThisModItemStackWithSize("barD10Steel", 4), + IHLUtils.getThisModItemStack("rollingMachineSetOfMoldedPartsSteel"), + IHLUtils.getThisModItemStackWithSize("linerIronGraphiteGreased", 4) }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("rollingMachinePart1") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("gasWeldingStation") }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe( + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("handDrillBronze"), + IHLUtils.getThisModItemStack("hackSawSteel"), + IHLUtils.getThisModItemStack("drillSteelHardened"), + IHLUtils.getThisModItemStack("tapM10x1SteelHardened"), + IHLUtils.getThisModItemStack("setOfFilesSteel") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStackWithSize("boltM10x1Steel", 8), + IHLUtils.getOreDictItemStackWithSize("plateSteel", 4), + IHLUtils.getThisModItemStackWithSize("barD10Steel", 4) }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("rollingMachinePart2") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("gasWeldingStation") }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(null, + Arrays.asList(new IRecipeInput[] { new RecipeInputFluidContainer(FluidRegistry.WATER, 1), + new RecipeInputOreDict("dustPorcelain") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("electrolysisBathRawPorcelain") }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(null, + Arrays.asList(new IRecipeInput[] { new RecipeInputFluidContainer(FluidRegistry.WATER, 1), + new RecipeInputOreDict("dustPorcelain") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("ovenRawPorcelain") }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(null, + Arrays.asList(new IRecipeInput[] { new RecipeInputFluidContainer(FluidRegistry.WATER, 1), + new RecipeInputOreDict("dustPorcelain") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("gaedesPumpBarrelRawPorcelain") }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(null, + Arrays.asList(new IRecipeInput[] { new RecipeInputFluidContainer(FluidRegistry.WATER, 1), + new RecipeInputOreDict("dustPorcelain") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStackWithSize("ringRawPorcelain", 4) }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(null, + Arrays.asList(new IRecipeInput[] { new RecipeInputFluidContainer(FluidRegistry.WATER, 1), + new RecipeInputOreDict("dustPorcelain") }), + Arrays.asList( + new ItemStack[] { IHLUtils.getThisModItemStackWithSize("lampHolderRawPorcelain", 4) }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(null, + Arrays.asList(new IRecipeInput[] { new RecipeInputFluidContainer(FluidRegistry.WATER, 1), + new RecipeInputOreDict("dustPorcelain") }), + Arrays.asList( + new ItemStack[] { IHLUtils.getThisModItemStackWithSize("insulatorRawPorcelain", 4) }))); + // Raw porcelain recipes section end + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe( + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("setOfFilesSteel"), + IHLUtils.getThisModItemStack("tinSnipsSteel"), IHLUtils.getThisModItemStack("hackSawSteel"), + IHLUtils.getThisModItemStack("handDrillBronze"), + IHLUtils.getThisModItemStack("drillSteelHardened") }), + Arrays.asList(new ItemStack[] { IHLUtils.getOreDictItemStackWithSize("foilSteel", 4), + IHLUtils.getThisModItemStackWithSize("barD10Steel", 4), + IHLUtils.getThisModItemStack("pipelineAccessoriesSteel"), + IHLUtils.getThisModItemStack("foilRubber"), IHLUtils.getOreDictItemStack("plateSteel"), + IHLUtils.getThisModItemStack("turboCompressorSetOfMoldedPartsBronze"), + IHLUtils.getThisModItemStack("highPressureVesselSteel") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("fluidizedBedReactor") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("gasWeldingStation") }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe( + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("setOfFilesSteel"), + IHLUtils.getThisModItemStack("tinSnipsSteel"), IHLUtils.getThisModItemStack("hackSawSteel"), + IHLUtils.getThisModItemStack("handDrillBronze"), + IHLUtils.getThisModItemStack("drillSteelHardened") }), + Arrays.asList(new IRecipeInput[] { + new RecipeInputItemStack(IHLUtils.getThisModItemStackWithSize("pistonCylinderSteel", 2)), + new RecipeInputOreDict("foilSteel"), + new RecipeInputItemStack(IHLUtils.getThisModItemStack("pipelineAccessoriesSteel")), + new RecipeInputOreDict("foilRubber"), new RecipeInputOreDict("plateSteel"), + new RecipeInputItemStack( + IHLUtils.getThisModItemStackWithSize("highPressureVesselSteel", 2)), + new RecipeInputItemStack(IHLUtils.getThisModItemStack("electrolysisBathPorcelain")), + new RecipeInputOreDict("stickGraphite", 2) }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("labElectrolyzer") }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe( + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("tinSnipsSteel"), + IHLUtils.getThisModItemStack("glassBlowingTubeSteel") }), + Arrays.asList(new IRecipeInput[] { new RecipeInputOreDict("foilSteel"), + new RecipeInputOreDict("foilTungsten"), new RecipeInputOreDict("dustQuicklime"), + new RecipeInputOreDict("dustGlass"), new RecipeInputOreDict("stickGraphite"), + new RecipeInputItemStack(IHLUtils.getThisModItemStack("barD10Steel")) }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStackWithSize("gu-81m", 4) }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("gasWeldingStation"), + IHLUtils.getThisModItemStack("gaedesMercuryRotaryPump") }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe( + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("tinSnipsSteel"), + IHLUtils.getThisModItemStack("handDrillBronze"), + IHLUtils.getThisModItemStack("drillSteelHardened") }), + Arrays.asList(new ItemStack[] { IHLUtils.getOreDictItemStack("foilSteel"), + IHLUtils.getThisModItemStack("barD10Steel"), new ItemStack(Items.stick) }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("glassBlowingTubeSteel") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("gasWeldingStation") }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe( + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("tinSnipsSteel"), + IHLUtils.getThisModItemStack("handDrillBronze"), + IHLUtils.getThisModItemStack("drillSteelHardened") }), + Arrays.asList(new IRecipeInput[] { new RecipeInputOreDict("foilSteel"), + new RecipeInputOreDict("plateSteel"), + new RecipeInputItemStack(IHLUtils.getThisModItemStack("barD10Steel"), 4), + new RecipeInputOreDict("foilRubber"), + new RecipeInputItemStack(IHLUtils.getThisModItemStack("gaedesPumpBarrelPorcelain")), + new RecipeInputFluidContainer(FluidRegistry.getFluid("mercury"), 1) }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("gaedesMercuryRotaryPump") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("gasWeldingStation") }))); + IronWorkbenchTileEntity + .addRecipe(new IronWorkbenchRecipe( + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("tinSnipsSteel") }), + Arrays.asList(new IRecipeInput[] { + new RecipeInputFluidContainer(FluidRegistry.getFluid("mineraloil"), 1), + new RecipeInputOreDict("foilMica"), new RecipeInputOreDict("foilCopper"), + new RecipeInputOreDict("foilSteel") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("highVoltageCapacitor") }))); + IronWorkbenchTileEntity + .addRecipe(new IronWorkbenchRecipe( + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("tinSnipsSteel") }), + Arrays.asList(new IRecipeInput[] { + new RecipeInputFluidContainer(FluidRegistry.getFluid("mineraloil"), 1), + new RecipeInputOreDict("foilMica"), new RecipeInputOreDict("foilGold"), + new RecipeInputOreDict("foilSteel") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("highVoltageCapacitor") }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe( + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("tinSnipsSteel"), + IHLUtils.getThisModItemStack("handDrillBronze"), + IHLUtils.getThisModItemStack("drillSteelHardened") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStackWithSize("ringPorcelain", 64), + IHLUtils.getThisModItemStackWithSize("boltM10x1Steel", 6), + IHLUtils.getThisModItemStackWithSize("nutM10x1Steel", 6), + IHLUtils.getOreDictItemStack("foilSteel"), + IHLUtils.getThisModItemStackWithSize("barD10Steel", 4) }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("fractionatorSection") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("gasWeldingStation") }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe( + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("tinSnipsSteel"), + IHLUtils.getThisModItemStack("handDrillBronze"), + IHLUtils.getThisModItemStack("drillSteelHardened") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStackWithSize("stickSteel", 4), + IHLUtils.getOreDictItemStackWithSize("plateSteel", 2), + IHLUtils.getThisModItemStackWithSize("boltM10x1Steel", 6), + IHLUtils.getThisModItemStackWithSize("nutM10x1Steel", 6), + IHLUtils.getOreDictItemStack("foilSteel"), + IHLUtils.getThisModItemStackWithSize("barD10Steel", 4) }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("fractionatorBottom") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("gasWeldingStation") }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe( + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("tinSnipsSteel"), + IHLUtils.getThisModItemStack("handDrillBronze"), + IHLUtils.getThisModItemStack("drillSteelHardened") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStackWithSize("boltM10x1Steel", 6), + IHLUtils.getThisModItemStackWithSize("nutM10x1Steel", 6), + IHLUtils.getOreDictItemStack("foilSteel"), + IHLUtils.getThisModItemStackWithSize("barD10Steel", 4) }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("fractionatorCover") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("gasWeldingStation") }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe( + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("tinSnipsSteel"), + IHLUtils.getThisModItemStack("handDrillBronze"), + IHLUtils.getThisModItemStack("drillSteelHardened") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStackWithSize("boltM10x1Steel", 6), + IHLUtils.getThisModItemStackWithSize("nutM10x1Steel", 6), + IHLUtils.getOreDictItemStack("foilSteel"), + IHLUtils.getThisModItemStackWithSize("barD10Steel", 4) }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("refluxCondenser") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("gasWeldingStation") }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(null, + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("dustFerrite"), + IHLUtils.getThisModItemStack("ingotStearin") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStackWithSize("ringRawFerrite", 4) }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe( + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("tinSnipsSteel"), + IHLUtils.getThisModItemStack("glassBlowingTubeSteel") }), + Arrays.asList(new IRecipeInput[] { new RecipeInputOreDict("foilSteel"), + new RecipeInputFluidContainer(FluidRegistry.getFluid("mercury"), 1), + new RecipeInputOreDict("stickBoronCarbide"), new RecipeInputOreDict("dustGlass"), + new RecipeInputOreDict("stickGraphite"), + new RecipeInputItemStack(IHLUtils.getThisModItemStack("barD10Steel")) }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStackWithSize("ignitron", 6) }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("gasWeldingStation"), + IHLUtils.getThisModItemStack("gaedesMercuryRotaryPump") }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe( + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("tinSnipsSteel"), + IHLUtils.getThisModItemStack("glassBlowingTubeSteel") }), + Arrays.asList(new IRecipeInput[] { new RecipeInputOreDict("foilSteel"), + new RecipeInputOreDict("foilTungsten"), new RecipeInputOreDict("dustQuicklime"), + new RecipeInputOreDict("dustGlass"), new RecipeInputOreDict("stickGraphite"), + new RecipeInputItemStack(IHLUtils.getThisModItemStack("barD10Steel")) }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStackWithSize("valveTube1C21P", 6) }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("gasWeldingStation"), + IHLUtils.getThisModItemStack("gaedesMercuryRotaryPump") }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe( + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("tinSnipsSteel"), + IHLUtils.getThisModItemStack("glassBlowingTubeSteel") }), + Arrays.asList( + new IRecipeInput[] { new RecipeInputOreDict("foilGold"), new RecipeInputOreDict("foilMica"), + new RecipeInputFluidContainer(FluidRegistry.getFluid("cablingcolophony"), 1), + new RecipeInputOreDict("dustGlass"), new RecipeInputOreDict("foilSteel"), + new RecipeInputItemStack(IHLUtils.getThisModItemStack("springSteel")) }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStackWithSize("vacuumSwitch", 16) }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("gasWeldingStation"), + IHLUtils.getThisModItemStack("gaedesMercuryRotaryPump") }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe( + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("tinSnipsSteel") }), + Arrays.asList(new IRecipeInput[] { + new RecipeInputItemStack(IHLUtils.getThisModItemStack("insulatorPorcelain"), 8), + new RecipeInputOreDict("plateMica", 2), + new RecipeInputItemStack(IHLUtils.getThisModItemStack("highVoltageCapacitor"), 3), + new RecipeInputFluidContainer(FluidRegistry.getFluid("cablingcolophony"), 1), + new RecipeInputOreDict("dustSolderingAlloy"), new RecipeInputOreDict("foilMica"), + new RecipeInputItemStack(IHLUtils.getThisModItemStack("gu-81m"), 4), + new RecipeInputOreDict("foilSteel", 8), + new RecipeInputWire(IHLUtils.getUninsulatedWire("Copper", 288, 15)), + new RecipeInputFluidContainer(FluidRegistry.getFluid("mineraloil"), 1000), + new RecipeInputItemStack(IHLUtils.getThisModItemStack("ignitron"), 6), + new RecipeInputItemStack(IHLUtils.getThisModItemStack("valveTube1C21P"), 6) }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("rectifierTransformerUnit") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("gasWeldingStation") }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe( + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("tinSnipsSteel") }), + Arrays.asList(new IRecipeInput[] { new RecipeInputOreDict("foilCopper"), + new RecipeInputFluidContainer(FluidRegistry.getFluid("cablingcolophony"), 1), + new RecipeInputOreDict("dustSolderingAlloy"), new RecipeInputOreDict("ringFerrite", 8), + new RecipeInputOreDict("foilMica") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStackWithSize("hallSensor", 8) }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("gasWeldingStation") }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe( + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("tinSnipsSteel") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStackWithSize("insulatorPorcelain", 4), + IHLUtils.getUninsulatedWire("Copper", 4, 15), IHLUtils.getThisModItemStack("foilMica"), + IHLUtils.getThisModItemStack("leadAcidBattery"), + IHLUtils.getThisModItemStack("dustSolderingAlloy"), + IHLUtils.getThisModItemStack("vacuumSwitch"), + IHLUtils.getThisModItemStackWithSize("hallSensor", 2), + IHLUtils.getThisModItemStackWithSize("valveTube1C21P", 2) }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("batterySwitchUnit") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("gasWeldingStation") }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe( + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("tinSnipsSteel") }), + Arrays.asList(new IRecipeInput[] { new RecipeInputOreDict("foilGold"), + new RecipeInputItemStack(IHLUtils.getThisModItemStack("foilRubberWithSulfur")), + new RecipeInputOreDict("foilLead"), + new RecipeInputFluidContainer(FluidRegistry.getFluid("sulfuricacid"), 1), + new RecipeInputFluidContainer(FluidRegistry.getFluid("ic2distilledwater"), 1), + new RecipeInputOreDict("dustSolderingAlloy"), new RecipeInputOreDict("dustLeadPlumbate"), + new RecipeInputItemStack(IHLUtils.getThisModItemStack("batteryCellsEbonite"), 8) }), + Arrays.asList( + new ItemStack[] { BatteryItem.getFullyChargedItemStackWithSize("leadAcidBattery", 8) }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("gasWeldingStation") }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe( + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("tinSnipsSteel") }), + Arrays.asList(new IRecipeInput[] { new RecipeInputOreDict("foilSteel"), + new RecipeInputOreDict("plateGraphite", 5), + new RecipeInputItemStack(IHLUtils.getThisModItemStackWithSize("barD10Steel", 4)), + new RecipeInputOreDict("stickGraphite"), + new RecipeInputItemStack(IHLUtils.getThisModItemStack("dustCoalElectrodePremix")), + new RecipeInputOreDict("foilRubber") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("electrolysisBath") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("gasWeldingStation") }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(null, + Arrays.asList(new IRecipeInput[] { new RecipeInputOreDict("dustTin"), + new RecipeInputItemStack(new ItemStack(Blocks.glass_pane), 16), + new RecipeInputFluidContainer(FluidRegistry.getFluid("mercury"), 1), + new RecipeInputFluidContainer(FluidRegistry.getFluid("turpentine"), 1), + new RecipeInputItemStack(IHLUtils.getThisModItemStack("fabric")) }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStackWithSize("mirror", 16) }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(null, + Arrays.asList(new IRecipeInput[] { new RecipeInputOreDict("dustTin"), + new RecipeInputItemStack(new ItemStack(Blocks.glass_pane), 16), + new RecipeInputFluidContainer(FluidRegistry.getFluid("mercury"), 1), + new RecipeInputFluidContainer(FluidRegistry.getFluid("turpentine"), 1), + new RecipeInputItemStack(new ItemStack(Blocks.wool)) }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStackWithSize("mirror", 16), }))); + if (FluidRegistry.isFluidRegistered("ethanol")) { + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(null, + Arrays.asList(new IRecipeInput[] { new RecipeInputOreDict("dustTin"), + new RecipeInputItemStack(new ItemStack(Blocks.glass_pane), 16), + new RecipeInputFluidContainer(FluidRegistry.getFluid("mercury"), 1), + new RecipeInputFluidContainer(FluidRegistry.getFluid("ethanol"), 1), + new RecipeInputItemStack(IHLUtils.getThisModItemStack("fabric")) }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStackWithSize("mirror", 16) }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(null, + Arrays.asList(new IRecipeInput[] { new RecipeInputOreDict("dustTin"), + new RecipeInputItemStack(new ItemStack(Blocks.glass_pane), 16), + new RecipeInputFluidContainer(FluidRegistry.getFluid("mercury"), 1), + new RecipeInputFluidContainer(FluidRegistry.getFluid("ethanol"), 1), + new RecipeInputItemStack(new ItemStack(Blocks.wool)) }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStackWithSize("mirror", 16) }))); + } + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(Arrays.asList( + new IRecipeInput[] { RecipeInputs.cutter, RecipeInputs.saw, RecipeInputs.vise, RecipeInputs.file }), + Arrays.asList(new IRecipeInput[] { new RecipeInputOreDict("plateSteel", 2), + new RecipeInputOreDict("foilSteel", 2), RecipeInputs.get("boltM10x1Steel", 8), + RecipeInputs.get("nutM10x1Steel", 8), RecipeInputs.get("barD10Steel", 16), + RecipeInputs.get("rollingMachineSetOfMoldedPartsSteel"), + RecipeInputs.get("linerIronGraphiteGreased", 4), + RecipeInputs.get("turboCompressorSetOfMoldedPartsBronze"), + RecipeInputs.get("foilRubber") }), + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("paperMachine") }), + 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("catalystRawIronOxide", 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) { + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(null, + Arrays.asList(new ItemStack[] { IHLUtils.getUninsulatedWire("Copper", 1, 15), + IHLUtils.getOreDictItemStack("dustRawRubber") }), + Arrays.asList( + new ItemStack[] { IHLUtils.getInsulatedWire("Copper", 1, 15, "RawRubber", 100) }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(null, + Arrays.asList(new ItemStack[] { IHLUtils.getUninsulatedWire("Copper", 1, 240), + IHLUtils.getOreDictItemStack("dustRawRubber") }), + Arrays.asList( + new ItemStack[] { IHLUtils.getInsulatedWire("Copper", 1, 240, "RawRubber", 100) }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(null, + Arrays.asList(new ItemStack[] { IHLUtils.getUninsulatedWire("Steel", 1, 15), + IHLUtils.getOreDictItemStack("dustRawRubber") }), + Arrays.asList( + new ItemStack[] { IHLUtils.getInsulatedWire("Steel", 1, 15, "RawRubber", 100) }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(null, + Arrays.asList(new ItemStack[] { IHLUtils.getUninsulatedWire("Steel", 1, 240), + IHLUtils.getOreDictItemStack("dustRawRubber") }), + Arrays.asList( + new ItemStack[] { IHLUtils.getInsulatedWire("Steel", 1, 240, "RawRubber", 100) }))); + + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe( + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("sharpenedCarvingKnifeBronze") }), + Arrays.asList(new ItemStack[] { IHLUtils.getInsulatedWire("Copper", 1, 15, "RawRubber", 100) }), + Arrays.asList(new ItemStack[] { IHLUtils.getUninsulatedWire("Copper", 1, 15), + IHLUtils.getOreDictItemStack("dustRawRubber") }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe( + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("sharpenedCarvingKnifeBronze") }), + Arrays.asList( + new ItemStack[] { IHLUtils.getInsulatedWire("Copper", 1, 240, "RawRubber", 100) }), + Arrays.asList(new ItemStack[] { IHLUtils.getUninsulatedWire("Copper", 1, 240), + IHLUtils.getOreDictItemStack("dustRawRubber") }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe( + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("sharpenedCarvingKnifeBronze") }), + Arrays.asList(new ItemStack[] { IHLUtils.getInsulatedWire("Steel", 1, 15, "RawRubber", 100) }), + Arrays.asList(new ItemStack[] { IHLUtils.getUninsulatedWire("Steel", 1, 15), + IHLUtils.getOreDictItemStack("dustRawRubber") }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe( + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("sharpenedCarvingKnifeBronze") }), + Arrays.asList(new ItemStack[] { IHLUtils.getInsulatedWire("Steel", 1, 240, "RawRubber", 100) }), + Arrays.asList(new ItemStack[] { IHLUtils.getUninsulatedWire("Steel", 1, 240), + IHLUtils.getOreDictItemStack("dustRawRubber") }))); + } else { + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(null, + Arrays.asList( + new ItemStack[] { IHLUtils.getUninsulatedWire("Copper", 1, 15), Ic2Items.rubber }), + Arrays.asList( + new ItemStack[] { IHLUtils.getInsulatedWire("Copper", 1, 15, "RawRubber", 100) }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(null, + Arrays.asList( + new ItemStack[] { IHLUtils.getUninsulatedWire("Copper", 1, 240), Ic2Items.rubber }), + Arrays.asList( + new ItemStack[] { IHLUtils.getInsulatedWire("Copper", 1, 240, "RawRubber", 100) }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(null, + Arrays.asList(new ItemStack[] { IHLUtils.getUninsulatedWire("Steel", 1, 15), Ic2Items.rubber }), + Arrays.asList( + new ItemStack[] { IHLUtils.getInsulatedWire("Steel", 1, 15, "RawRubber", 100) }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(null, + Arrays.asList( + new ItemStack[] { IHLUtils.getUninsulatedWire("Steel", 1, 240), Ic2Items.rubber }), + Arrays.asList( + new ItemStack[] { IHLUtils.getInsulatedWire("Steel", 1, 240, "RawRubber", 100) }))); + + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe( + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("sharpenedCarvingKnifeBronze") }), + Arrays.asList(new ItemStack[] { IHLUtils.getInsulatedWire("Copper", 1, 15, "RawRubber", 100) }), + Arrays.asList( + new ItemStack[] { IHLUtils.getUninsulatedWire("Copper", 1, 15), Ic2Items.rubber }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe( + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("sharpenedCarvingKnifeBronze") }), + Arrays.asList( + new ItemStack[] { IHLUtils.getInsulatedWire("Copper", 1, 240, "RawRubber", 100) }), + Arrays.asList( + new ItemStack[] { IHLUtils.getUninsulatedWire("Copper", 1, 240), Ic2Items.rubber }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe( + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("sharpenedCarvingKnifeBronze") }), + Arrays.asList(new ItemStack[] { IHLUtils.getInsulatedWire("Steel", 1, 15, "RawRubber", 100) }), + Arrays.asList( + new ItemStack[] { IHLUtils.getUninsulatedWire("Steel", 1, 15), Ic2Items.rubber }))); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe( + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("sharpenedCarvingKnifeBronze") }), + Arrays.asList(new ItemStack[] { IHLUtils.getInsulatedWire("Steel", 1, 240, "RawRubber", 100) }), + Arrays.asList( + new ItemStack[] { IHLUtils.getUninsulatedWire("Steel", 1, 240), Ic2Items.rubber }))); + } + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe( + Arrays.asList(new ItemStack[] { IHLUtils.getThisModItemStack("sharpenedCarvingKnifeBronze") }), + Arrays.asList(new ItemStack[] { IHLUtils.getInsulatedWire("Copper", 1, 15, "Rubber", 100) }), + Arrays.asList(new ItemStack[] { IHLUtils.getUninsulatedWire("Copper", 1, 15) }))); + 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) }))); + 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 RecipeInputOreDictionaryList( + new String[] { "dustPentaerythritolTetranitrate", "dustMercuryFulminate" }, 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", 4), + new RecipeInputOreDict("ingotTarPitch", 1), new RecipeInputDetonator(detonator) }), + Arrays.asList(new ItemStack[] { IHLUtils.getItemStackWithTag("ihlExplosive", "explosionPower", + 15 * config.explosionPowerBase) }), + null)); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(null, + Arrays.asList(new IRecipeInput[] { new RecipeInputOreDict("platePaper", 2), + new RecipeInputOreDict("dustWood", 4), + new RecipeInputFluidContainer(FluidRegistry.getFluid("nitroglycerin"), 1), + new RecipeInputOreDict("ingotTarPitch", 1), new RecipeInputDetonator(detonator) }), + Arrays.asList(new ItemStack[] { IHLUtils.getItemStackWithTag("ihlExplosive", "explosionPower", + 10 * config.explosionPowerBase) }), + null)); + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(null, + Arrays.asList(new IRecipeInput[] { new RecipeInputOreDict("platePaper", 2), + new RecipeInputOreDict("dustGunpowder", 8), new RecipeInputOreDict("ingotTarPitch", 1), + new RecipeInputDetonator(detonator) }), + Arrays.asList(new ItemStack[] { IHLUtils.getItemStackWithTag("ihlExplosive", "explosionPower", + 3 * config.explosionPowerBase) }), + 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"); + LeadOvenTileEntity.addRecipe( + new UniversalRecipeInput(new FluidStack[] { IHLUtils.getFluidStackWithSize("water", 400) }, + new IRecipeInput[] { new RecipeInputOreDict("dustSulfur"), + new RecipeInputOreDict("dustSaltpeter") }), + IHLUtils.getFluidStackWithSize("sulfuricacid", 100)); + LeadOvenTileEntity.addRecipe( + new UniversalRecipeInput(new FluidStack[] { IHLUtils.getFluidStackWithSize("water", 100) }, + new IRecipeInput[] { new RecipeInputOreDict("crushedPurifiedCinnabar") }), + IHLUtils.getFluidStackWithSize("mercury", 36)); + LeadOvenTileEntity.addRecipe(new RecipeInputOreDict("dustStibnite", 1), + IHLUtils.getThisModItemStack("dustAntimonyOxide")); + LeadOvenTileEntity.addRecipe(new RecipeInputOreDict("dustSodiumHydrogenSulfate", 2), + IHLUtils.getFluidStackWithSize("sulfuricacid", 20), + IHLUtils.getOreDictItemStack("dustSodiumSulfate")); + LeadOvenTileEntity.addRecipe(new RecipeInputOreDict("dustSodiumZeoliteCoked", 2), + IHLUtils.getThisModItemStack("dustSodiumZeolite")); + 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("glycerol", 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")); + ItemStack drill = Ic2Items.miningDrill.copy(); + drill.setItemDamage(OreDictionary.WILDCARD_VALUE); + DetonationSprayingMachineTileEntity.addRecipe(drill, Ic2Items.diamondDrill.copy()); + MuffleFurnanceTileEntity.addRecipe(new RecipeInputOreDict("plateSteel", 1), + IHLUtils.getThisModItemStack("plateHotSteel")); + MuffleFurnanceTileEntity.addRecipe(new RecipeInputOreDict("ingotSteel", 1), + IHLUtils.getOreDictItemStack("ingotHotSteel")); + MuffleFurnanceTileEntity.addRecipe(new RecipeInputOreDict("plateTungsten", 1), + IHLUtils.getThisModItemStack("plateHotTungsten")); + MuffleFurnanceTileEntity.addRecipe( + new RecipeInputItemStack(IHLUtils.getThisModItemStack("gaedesPumpBarrelRawPorcelain"), 1), + IHLUtils.getThisModItemStack("gaedesPumpBarrelPorcelain")); + MuffleFurnanceTileEntity.addRecipe( + new RecipeInputItemStack(new ItemStack(IHLMod.crucible, 1, OreDictionary.WILDCARD_VALUE), 1), + new ItemStack(IHLMod.crucible, 1, 1)); + MuffleFurnanceTileEntity.addRecipe( + new RecipeInputItemStack(IHLUtils.getThisModItemStackWithSize("injectionMold", 1), 1), + IHLUtils.getThisModItemStackWithSize("injectionMold", 1)); + MuffleFurnanceTileEntity.addRecipe( + new RecipeInputItemStack(IHLUtils.getThisModItemStack("sawBladeSteel"), 1), + IHLUtils.getThisModItemStack("sawBladeSteelHot")); + MuffleFurnanceTileEntity.addRecipe(new RecipeInputItemStack(IHLUtils.getThisModItemStack("barD10Steel"), 1), + IHLUtils.getThisModItemStack("barD10SteelHot")); + MuffleFurnanceTileEntity.addRecipe( + new RecipeInputItemStack(IHLUtils.getThisModItemStack("linerIronGraphite"), 1), + IHLUtils.getThisModItemStack("linerIronGraphiteHot")); + MuffleFurnanceTileEntity.addRecipe( + new UniversalRecipeInput(null, + new IRecipeInput[] { new RecipeInputOreDict("dustIronOxide", 1), + new RecipeInputOreDict("dustLithiumOxide", 1) }), + new UniversalRecipeOutput(null, + new RecipeOutputItemStack[] { + new RecipeOutputItemStack(IHLUtils.getOreDictItemStackWithSize("dustFerrite", 2)) }, + 200)); + MuffleFurnanceTileEntity.addRecipe( + new UniversalRecipeInput(null, + new IRecipeInput[] { new RecipeInputOreDict("dustBauxite"), + new RecipeInputOreDict("dustSodiumHydroxide") }), + new UniversalRecipeOutput(null, + new RecipeOutputItemStack[] { + new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustSodiumAluminate")) }, + 200)); + MuffleFurnanceTileEntity.addRecipe(new RecipeInputItemStack(IHLUtils.getThisModItemStack("drillSteel")), + IHLUtils.getThisModItemStack("drillSteelHot")); + MuffleFurnanceTileEntity.addRecipe(new RecipeInputItemStack(IHLUtils.getThisModItemStack("tapM10x1Steel")), + IHLUtils.getThisModItemStack("tapM10x1SteelHot")); + MuffleFurnanceTileEntity.addRecipe(new RecipeInputItemStack(IHLUtils.getThisModItemStack("diceM10x1Steel")), + IHLUtils.getThisModItemStack("diceM10x1SteelHot")); + LoomTileEntity.addRecipe(IHLUtils.getThisModWireItemStackWithLength("fiberGlass", 1024), + IHLUtils.getThisModItemStack("meshGlass")); + LoomTileEntity.addRecipe(new ItemStack(Items.string, 4), IHLUtils.getThisModItemStack("fabric")); + RollingMachinePart1TileEntity.addRecipe(IHLUtils.getThisModItemStack("plateHotSteel"), + IHLUtils.getOreDictItemStackWithSize("foilSteel", 4)); + RollingMachinePart1TileEntity.addRecipe(IHLUtils.getThisModItemStack("plateHotTungsten"), + IHLUtils.getOreDictItemStackWithSize("foilTungsten", 4)); + RollingMachinePart1TileEntity.addRecipe(IHLUtils.getOreDictItemStack("plateGold"), + IHLUtils.getOreDictItemStackWithSize("foilGold", 4)); + RollingMachinePart1TileEntity.addRecipe(IHLUtils.getOreDictItemStack("plateCopper"), + IHLUtils.getOreDictItemStackWithSize("foilCopper", 4)); + RollingMachinePart1TileEntity.addRecipe(IHLUtils.getOreDictItemStack("plateLead"), + IHLUtils.getOreDictItemStackWithSize("foilLead", 4)); + ImpregnatingMachineTileEntity.addQuenchingRecipe("diceM10x1SteelHot", "diceM10x1SteelHardened"); + ImpregnatingMachineTileEntity.addQuenchingRecipe("tapM10x1SteelHot", "tapM10x1SteelHardened"); + ImpregnatingMachineTileEntity.addQuenchingRecipe("drillSteelHot", "drillSteelHardened"); + ImpregnatingMachineTileEntity.addQuenchingRecipe("sawBladeSteelHot", "sawBladeSteelHardened"); + 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( + new RecipeInputItemStack(IHLUtils.getThisModItemStack("foilRubberWithSulfur")), + IHLUtils.getThisModItemStack("foilRubber")); + 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)); + 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)); + ChemicalReactorTileEntity.addRecipe( + new UniversalRecipeInput((new FluidStack[] { IHLUtils.getFluidStackWithSize("spruceresin", 1000), + IHLUtils.getFluidStackWithSize("glycerol", 50) }), 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((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( + (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( + (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(new RecipeInputOreDict("dustTungsticAcid", 2), + IHLUtils.getOreDictItemStack("dustTungstenOxide"), 1.14f); + MuffleFurnanceTileEntity.addRecipe( + new RecipeInputItemStack(IHLUtils.getThisModItemStack("electrolysisBathRawPorcelain")), + IHLUtils.getThisModItemStack("electrolysisBathPorcelain")); + MuffleFurnanceTileEntity.addRecipe( + new RecipeInputItemStack(IHLUtils.getThisModItemStack("ovenRawPorcelain")), + IHLUtils.getThisModItemStack("leadOven")); + MuffleFurnanceTileEntity.addRecipe( + new RecipeInputItemStack(IHLUtils.getThisModItemStack("ringRawPorcelain")), + IHLUtils.getThisModItemStack("ringPorcelain")); + MuffleFurnanceTileEntity.addRecipe(new RecipeInputItemStack(IHLUtils.getThisModItemStack("ringRawFerrite")), + IHLUtils.getThisModItemStack("ringFerrite")); + MuffleFurnanceTileEntity.addRecipe( + new RecipeInputItemStack(IHLUtils.getThisModItemStack("insulatorRawPorcelain")), + IHLUtils.getThisModItemStack("insulatorPorcelain")); + MuffleFurnanceTileEntity.addRecipe( + new RecipeInputItemStack(IHLUtils.getThisModItemStack("lampHolderRawPorcelain")), + IHLUtils.getThisModItemStack("lampHolderPorcelain")); + LabElectrolyzerTileEntity.addRecipe(IHLUtils.getFluidStackWithSize("water", 300), + IHLUtils.getFluidStackWithSize("hydrogen", 200), IHLUtils.getFluidStackWithSize("oxygen", 100), + null); + LabElectrolyzerTileEntity.addRecipe(IHLUtils.getFluidStackWithSize("saltwater", 1000), + IHLUtils.getFluidStackWithSize("solution.natriumhydroxide", 875), + IHLUtils.getFluidStackWithSize("chlorine", 100), null); + if (IHLUtils.hasOreDictionaryEntry("dustSilicon")) + FluidizedBedReactorTileEntity.addRecipe(IHLUtils.getFluidStackWithSize("hydrogen", 1333), + IHLUtils.getOreDictItemStackWithSize("dustSiliconDioxide", 1), + IHLUtils.getFluidStackWithSize("water", 2000), + IHLUtils.getOreDictItemStackWithSize("dustTinySilicon", 3)); + if (IHLUtils.hasOreDictionaryEntry("dustManganese")) + FluidizedBedReactorTileEntity.addRecipe(IHLUtils.getFluidStackWithSize("hydrogen", 2000), + IHLUtils.getOreDictItemStackWithSize("dustManganeseOxide", 2), + IHLUtils.getFluidStackWithSize("water", 3000), + IHLUtils.getOreDictItemStack("dustManganese")); + FluidizedBedReactorTileEntity.addRecipe(IHLUtils.getFluidStackWithSize("hydrogen", 1200), + IHLUtils.getOreDictItemStack("dustIronOxide"), + IHLUtils.getFluidStackWithSize("water", 1800), + new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustTinyIron"), 3.6f)); + FluidizedBedReactorTileEntity.addRecipe(IHLUtils.getFluidStackWithSize("hydrogen", 1500), + IHLUtils.getOreDictItemStack("dustTungstenOxide"), + IHLUtils.getFluidStackWithSize("water", 2250), + new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustTinyTungsten"), 2.25f)); + FluidizedBedReactorTileEntity.addRecipe(IHLUtils.getFluidStackWithSize("hydrogen", 4000), + IHLUtils.getOreDictItemStackWithSize("dustSodiumSulfate", 3), + IHLUtils.getFluidStackWithSize("water", 6000), + IHLUtils.getOreDictItemStack("dustSodiumSulfide")); + FluidizedBedReactorTileEntity.addRecipe(IHLUtils.getFluidStackWithSize("hydrogen", 1200), + IHLUtils.getOreDictItemStack("dustAntimonyOxide"), + IHLUtils.getFluidStackWithSize("water", 1800), + new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustTinyAntimony"), 3.6f)); + FluidizedBedReactorTileEntity.addRecipe(IHLUtils.getFluidStackWithSize("oxygen", 1500), + IHLUtils.getOreDictItemStack("dustIron"), null, + new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustIronOxide"), 2.5f)); + 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( + (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)); + if (FluidRegistry.isFluidRegistered("bioethanol")) { + ChemicalReactorTileEntity.addRecipe( + new UniversalRecipeInput(new FluidStack[] { IHLUtils.getFluidStackWithSize("bioethanol", 450), + IHLUtils.getFluidStackWithSize("mercury", 144), + IHLUtils.getFluidStackWithSize("nitricacid", 300) }, null), + new UniversalRecipeOutput( + new FluidStack[] { IHLUtils.getFluidStackWithSize("acetaldehyde", 300) }, + new RecipeOutputItemStack[] { new RecipeOutputItemStack( + IHLUtils.getOreDictItemStack("dustMercuryFulminate"), 1f) }, + 200)); + } + ChemicalReactorTileEntity.addRecipe( + new UniversalRecipeInput(new FluidStack[] { IHLUtils.getFluidStackWithSize("glycerol", 100), + IHLUtils.getFluidStackWithSize("nitricacid", 300) }, null), + new UniversalRecipeOutput(new FluidStack[] { IHLUtils.getFluidStackWithSize("nitroglycerin", 400) }, + null, 200)); + + Crucible.addRecipe("ingotSteel", IHLUtils.getFluidStackWithSize("molten.steel", 144)); + Crucible.addRecipe("ingotBronze", IHLUtils.getFluidStackWithSize("molten.bronze", 144)); + Crucible.addRecipe("ingotGold", IHLUtils.getFluidStackWithSize("molten.gold", 144)); + Crucible.addRecipe("ingotMagnesium", IHLUtils.getFluidStackWithSize("molten.magnesium", 144)); + 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)); + if (FluidRegistry.isFluidRegistered("liquid_light_oil")) + FractionatorBottomTileEntity.addRecipe(IHLUtils.getFluidStackWithSize("liquid_light_oil", 100), + IHLUtils.getFluidStackWithSize("fueloil", 40), IHLUtils.getFluidStackWithSize("fuel", 60)); + 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( + (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)); + fluidDictionary.registerFluidStack("lubricant", IHLUtils.getFluidStackWithSize("seedoil", 1000)); + fluidDictionary.registerFluidStack("lubricant", IHLUtils.getFluidStackWithSize("oleicacid", 1000)); + fluidDictionary.registerFluidStack("lubricant", IHLUtils.getFluidStackWithSize("mineraloil", 1000)); + if (FluidRegistry.isFluidRegistered("lubricant")) + fluidDictionary.registerFluidStack("lubricant", IHLUtils.getFluidStackWithSize("lubricant", 1000)); + WireMillTileEntity.addRecipe(IHLUtils.getFluidStackWithSize("molten.glass", 1), + new RecipeInputItemStack(IHLUtils.getThisModItemStack("fiberGlassDieSteel"), 0), + IHLUtils.getThisModWireItemStackWithLength("fiberGlass", 64)); + WireMillTileEntity.addRecipe("dustGlass", IHLUtils.getFluidStackWithSize("molten.glass", 144)); + for (ElectricConductor ec : ElectricConductor.values()) { + String fluidName = "molten." + ec.toString().toLowerCase(); + if (FluidRegistry.isFluidRegistered(fluidName)) { + WireMillTileEntity.addRecipe(IHLUtils.getFluidStackWithSize(fluidName, 1), + new RecipeInputDie("setOfDies1_5sqmm", 15), + IHLUtils.getUninsulatedWire(ec.toString(), 1, 15)); + log.debug("added recipe for " + fluidName); + if (ec.meltingPoint < 500) { + WireMillTileEntity.addRecipe("ingot" + ec.toString(), + IHLUtils.getFluidStackWithSize(fluidName, 144)); + } + } + } + VulcanizationExtrudingMoldTileEntity.addRecipe(IHLUtils.getFluidStackWithSize("molten.rubber", 32), + IHLUtils.getUninsulatedWire("Copper", 1, 15), + IHLUtils.getInsulatedWire("Copper", 1, 15, "Rubber", 100)); + IHLMod.config.loadRecipeModificators(); + } + if (Loader.isModLoaded("NotEnoughItems")) { + NEIModContainer.plugins.add(new NEIIHLConfig()); + } + IHLMod.proxy.initBlockRenderer(); + IHLMod.log.info("IHL loaded."); + } + + private void registerEntities() { + 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) { + BiomeGenBase[] biomes = BiomeDictionary.getBiomesForType(Type.END); + for (int i = 0; i < biomes.length; i++) { + if (biomes[i].biomeName.equals("Sky")) { + EntityRegistry.addSpawn(LostHeadEntity.class, 50, 1, 10, EnumCreatureType.monster, biomes[i]); + } + } + } + } + + @Override + public int getBurnTime(ItemStack stack) { + if (IHLUtils.getFirstOreDictName(stack) == "ingotTarPitch") { + return 2000; + } + if (IHLUtils.getFirstOreDictName(stack) == "dustSodiumZeoliteCoked") { + return 500; + } else if (IHLUtils.getFirstOreDictName(stack) == "nuggetTarPitch") { + return 222; + } else if (IHLUtils.getFirstOreDictName(stack) == "dustSulfur") { + return 160; + } + return 0; + } + + @SuppressWarnings("deprecation") + private void loadGT5Recipes() { + ItemStack battery_mv_c = ItemList.Battery_RE_MV_Cadmium.get(1L, new Object[] { null }); + ItemStack battery_mv_l = ItemList.Battery_RE_MV_Lithium.get(1L, new Object[] { null }); + ItemStack battery_mv_s = ItemList.Battery_RE_MV_Sodium.get(1L, new Object[] { null }); + ItemStack energy_crystal = gregtech.api.util.GT_ModHandler.getIC2Item("energyCrystal", 1L, 32767); + ItemStack pump = ItemList.Electric_Pump_MV.get(1L, new Object[] { null }); + ItemStack pump_hv = ItemList.Electric_Pump_HV.get(1L, new Object[] { null }); + int[] gypsumOreList1; + int[] oreListIterator1; + + if (config.enableRubberTreeSack) { + gypsumOreList1 = new int[] { 10000, 2000, 2000, 1000, 100, 0 }; + oreListIterator1 = new int[] { 10000, 10000, 10000, 5000, 500, 10000 }; + GregTech_API.sRecipeAdder.addCentrifugeRecipe((ItemStack) null, (ItemStack) null, + new FluidStack(FluidRegistry.getFluid("fluidrubbertreesap"), 200), + new FluidStack(FluidRegistry.WATER, 120), ItemList.IC2_Resin.get(1L, new Object[] { null }), + IHLUtils.getOreDictItemStack("dustRawRubber"), new ItemStack(Items.sugar, 1), + GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Wood, 2L), (ItemStack) null, + (ItemStack) null, gypsumOreList1, 500, 5); + GregTech_API.sRecipeAdder.addCentrifugeRecipe(IHLFluid.getCell("fluidrubbertreesap"), (ItemStack) null, + new FluidStack(FluidRegistry.getFluid("fluidrubbertreesap"), 200), + new FluidStack(FluidRegistry.WATER, 600), ItemList.IC2_Resin.get(5L, new Object[] { null }), + IHLUtils.getOreDictItemStack("dustRawRubber"), new ItemStack(Items.sugar, 1), + GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Wood, 1L), + ItemList.Cell_Empty.get(1L, new Object[] { null }), (ItemStack) null, oreListIterator1, 2500, 5); + } + + if (config.enableHandpump) { + gregtech.api.util.GT_ModHandler.addCraftingRecipe(((IHLHandPump) ic2_handpump).getItemStack(0), + new Object[] { "T ", " P ", " B", 'T', OrePrefixes.pipeSmall.get(Materials.Steel), 'P', pump, 'B', + battery_mv_c }); + gregtech.api.util.GT_ModHandler.addCraftingRecipe(((IHLHandPump) ic2_handpump).getItemStack(0), + new Object[] { "T ", " P ", " B", 'T', OrePrefixes.pipeSmall.get(Materials.Steel), 'P', pump, 'B', + battery_mv_l }); + gregtech.api.util.GT_ModHandler.addCraftingRecipe(((IHLHandPump) ic2_handpump).getItemStack(0), + new Object[] { "T ", " P ", " B", 'T', OrePrefixes.pipeSmall.get(Materials.Steel), 'P', pump, 'B', + battery_mv_s }); + gregtech.api.util.GT_ModHandler.addCraftingRecipe( + ((AdvancedHandPump) ic2_advanced_handpump).getItemStack(0), new Object[] { "T ", " P ", " B", 'T', + OrePrefixes.pipeSmall.get(Materials.TungstenSteel), 'P', pump_hv, 'B', energy_crystal }); + } + + if (config.enableFlexibleCablesCrafting) { + gregtech.api.util.GT_ModHandler.addCraftingRecipe(IHLUtils.getThisModItemStack("ironWorkbench"), + new Object[] { "PPS", "RRh", "RRd", 'P', OrePrefixes.plate.get(Materials.Iron), 'S', + OrePrefixes.screw.get(Materials.Iron), 'R', OrePrefixes.stick.get(Materials.Iron) }); + gregtech.api.util.GT_ModHandler.addCraftingRecipe(IHLUtils.getThisModItemStack("setOfDies1_5sqmm"), + new Object[] { " ", "fPs", " ", 'P', OrePrefixes.plate.get(Materials.Steel) }); + gregtech.api.util.GT_ModHandler.addCraftingRecipe( + IHLUtils.getItemStackWithTag("setOfDies1_5sqmm", "transverseSection", 240), + new Object[] { " f ", " P ", " s ", 'P', OrePrefixes.plate.get(Materials.Steel) }); + } + if (pfaalimestone != null) { + GregTech_API.sRecipeAdder.addPulveriserRecipe(pfaalimestone, + new ItemStack[] { IHLUtils.getOreDictItemStackWithSize("dustCalcite", 4) }, new int[] { 10000 }, + 600, 30); + } + + if (pfaacobblelimestone != null) { + 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(); + while (oreListIterator3.hasNext()) { + 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); + GregTech_API.sRecipeAdder.addPulveriserRecipe(IHLUtils.getThisModItemStack("oreSaltpeter"), + new ItemStack[] { IHLUtils.getOreDictItemStackWithSize("dustSaltpeter", 4) }, new int[] { 10000 }, 600, + 30); + GregTech_API.sRecipeAdder.addPulveriserRecipe(IHLUtils.getThisModItemStackWithSize("stickGraphite", 2), + new ItemStack[] { IHLUtils.getOreDictItemStack("dustGraphite") }, new int[] { 10000 }, 600, 30); + GregTech_API.sRecipeAdder.addPulveriserRecipe(new ItemStack(Items.brick), + new ItemStack[] { IHLUtils.getOreDictItemStack("dustBrick") }, new int[] { 10000 }, 600, 30); + GregTech_API.sRecipeAdder.addChemicalRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 1L), + GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L), + new FluidStack(FluidRegistry.WATER, 1500), + FluidRegistry.getFluidStack("solution.natriumhydroxide", 1000), + GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 1L), 950); + GregTech_API.sRecipeAdder.addChemicalRecipe( + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 1L), + GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 2L), + FluidRegistry.getFluidStack("solution.natriumhydroxide", 1000), (FluidStack) null, + GT_OreDictUnificator.get(OrePrefixes.cell, "LiquidGlass", 2L), 950); + gregtech.api.util.GT_ModHandler.addShapelessCraftingRecipe( + IHLUtils.getThisModItemStack("dustCoalElectrodePremix"), + new Object[] { GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Coal, 1L), + IHLUtils.getOreDictItemStack("nuggetTarPitch") }); + gregtech.api.util.GT_ModHandler.addShapelessCraftingRecipe( + IHLUtils.getThisModItemStackWithSize("dustIrongraphite", 2), + new Object[] { GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Iron, 1L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Graphite, 1L) }); + gregtech.api.util.GT_ModHandler.addSmeltingRecipe(IHLUtils.getThisModItemStack("stickCoalElectrodePremix"), + GT_OreDictUnificator.get(OrePrefixes.stick, Materials.Coal, 1L)); + gregtech.api.util.GT_ModHandler.addSmeltingRecipe( + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Calcite, 1L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Quicklime, 1L)); + GregTech_API.sRecipeAdder.addFormingPressRecipe(IHLUtils.getThisModItemStack("dustIrongraphite"), + ItemList.Shape_Mold_Cylinder.get(0L, new Object[0]), + IHLUtils.getThisModItemStackWithSize("linerIronGraphite", 4), 950, 30); + GregTech_API.sRecipeAdder.addFormingPressRecipe(IHLUtils.getThisModItemStack("dustCoalElectrodePremix"), + ItemList.Shape_Extruder_Rod.get(0L, new Object[0]), + IHLUtils.getThisModItemStack("stickCoalElectrodePremix"), 950, 30); + GregTech_API.sRecipeAdder.addDistilleryRecipe( + ItemList.Circuit_Integrated.getWithDamage(0, 0, new Object[] { null }), + IHLUtils.getFluidStackWithSize("spruceresin", 1000), IHLUtils.getFluidStackWithSize("turpentine", 50), + 3000, 30, false); + ExtruderTileEntity.addRecipe(IHLUtils.getOreDictItemStackWithSize("dustRawRubber", 5), + IHLUtils.getOreDictItemStackWithSize("dustTinySulfur", 1), + IHLUtils.getFluidStackWithSize("molten.rubber", 144 * 5)); + ExtruderTileEntity.addRecipe(IHLUtils.getOreDictItemStackWithSize("dustRawRubber", 20), + IHLUtils.getOreDictItemStackWithSize("dustSulfur", 1), + IHLUtils.getFluidStackWithSize("molten.rubber", 144 * 20)); + WoodenRollingMachinePart1TileEntity.addRecipe(new RecipeInputOreDict("dustRawRubber", 5), + new RecipeInputOreDict("dustTinySulfur", 1), + IHLUtils.getThisModItemStackWithSize("foilRubberWithSulfur", 20)); + WoodenRollingMachinePart1TileEntity.addRecipe(new RecipeInputOreDict("dustRawRubber", 20), + new RecipeInputOreDict("dustSulfur", 1), + IHLUtils.getThisModItemStackWithSize("foilRubberWithSulfur", 80)); + WoodenRollingMachinePart1TileEntity.addRecipe( + new RecipeInputItemStack(IHLUtils.getThisModItemStackWithSize("foilRubberWithSulfur", 16)), + new RecipeInputItemStack(IHLUtils.getThisModItemStackWithSize("fabric", 8)), + new RecipeInputOreDict("dustGraphite"), + IHLUtils.getThisModItemStack("pipeRubberWithSulfur")); + } + + @SuppressWarnings("deprecation") + private void loadGT6Recipes() { + ItemStack battery_mv_c = IL.Battery_RE_MV_Cadmium.get(1); + ItemStack battery_mv_l = IL.Battery_RE_MV_Lithium.get(1); + ItemStack battery_mv_s = IL.Battery_RE_MV_Sodium.get(1); + ItemStack energy_crystal = IC2Items.getItem("energyCrystal"); + ItemStack pump = IL.Electric_Pump_MV.get(1, (Object) null); + ItemStack pump_hv = IL.Electric_Pump_HV.get(1, (Object) null); + + OreDictionary.registerOre("toolLighter", IL.Tool_Lighter_Invar_Full.get(1)); + OreDictionary.registerOre("toolLighter", IL.Tool_Lighter_Invar_Used.get(1)); + OreDictionary.registerOre("toolLighter", IL.Tool_Lighter_Plastic_Full.get(1)); + OreDictionary.registerOre("toolLighter", IL.Tool_Lighter_Plastic_Used.get(1)); + OreDictionary.registerOre("toolLighter", IL.Tool_Lighter_Platinum_Full.get(1)); + OreDictionary.registerOre("toolLighter", IL.Tool_Lighter_Platinum_Used.get(1)); + OreDictionary.registerOre("toolLighter", IL.Tool_MatchBox_Full.get(1)); + OreDictionary.registerOre("toolLighter", IL.Tool_MatchBox_Used.get(1)); + OreDictionary.registerOre("toolLighter", IL.Tool_Matches.get(1)); + OreDictionary.registerOre("toolLighter", IL.Tool_Fire_Starter.get(1)); + + gregapi.util.UT.Crafting.shaped( + IHLUtils.getThisModItemStack(MachineBaseBlock.MachineType.ChemicalReactor.unlocalizedName), + new Object[] { " R ", "PVP", " Mw", Character.valueOf('R'), + gregapi.data.OP.stick.dat(gregapi.data.MT.StainlessSteel), Character.valueOf('V'), + gregapi.data.OP.rotor.dat(gregapi.data.MT.StainlessSteel), Character.valueOf('P'), + gregapi.data.OP.plateCurved.dat(gregapi.data.MT.StainlessSteel), Character.valueOf('M'), + gregapi.data.OP.casingMachine.dat(gregapi.data.MT.Steel) }); + + gregapi.util.UT.Crafting.shaped( + IHLUtils.getThisModItemStack(MachineBaseBlock.MachineType.CryogenicDistiller.unlocalizedName), + new Object[] { " R ", "P P", " Mw", Character.valueOf('R'), + gregapi.data.OP.pipeTiny.dat(gregapi.data.MT.Copper), Character.valueOf('P'), + gregapi.data.OP.plateCurved.dat(gregapi.data.MT.Copper), Character.valueOf('M'), + gregapi.data.OP.casingMachine.dat(gregapi.data.MT.Steel) }); + + gregapi.util.UT.Crafting.shaped( + IHLUtils.getThisModItemStack(MachineBaseBlock.MachineType.FluidizedBedReactor.unlocalizedName), + new Object[] { " ", "RPR", "VMw", Character.valueOf('R'), + gregapi.data.OP.pipeTiny.dat(gregapi.data.MT.Titanium), Character.valueOf('P'), + gregapi.data.OP.pipeHuge.dat(gregapi.data.MT.Titanium), Character.valueOf('V'), + gregapi.data.OP.rotor.dat(gregapi.data.MT.Titanium), Character.valueOf('M'), + gregapi.data.OP.casingMachine.dat(gregapi.data.MT.Steel) }); + + 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 }; + Recipe.RecipeMap.sCoagulatorRecipes.addRecipe(true, new ItemStack[] {}, + new ItemStack[] { OreDictManager.INSTANCE.getStack(OP.nugget, MT.Rubber, 1) }, null, chances, + new FluidStack[] { new FluidStack(FluidRegistry.getFluid("fluidrubbertreesap"), 500) }, + new FluidStack[] {}, 64, 0, 0); + } + + if (IHLMod.config.enableHandpump) { + gregapi.util.UT.Crafting.shaped(((IHLHandPump) ic2_handpump).getItemStack(0), + new Object[] { "T ", " P ", " B", Character.valueOf('T'), OP.pipeSmall.get(MT.Steel), + Character.valueOf('P'), pump, Character.valueOf('B'), battery_mv_c }); + gregapi.util.UT.Crafting.shaped(((IHLHandPump) ic2_handpump).getItemStack(0), + new Object[] { "T ", " P ", " B", Character.valueOf('T'), OP.pipeSmall.get(MT.Steel), + Character.valueOf('P'), pump, Character.valueOf('B'), battery_mv_l }); + gregapi.util.UT.Crafting.shaped(((IHLHandPump) ic2_handpump).getItemStack(0), + new Object[] { "T ", " P ", " B", Character.valueOf('T'), OP.pipeSmall.get(MT.Steel), + Character.valueOf('P'), pump, Character.valueOf('B'), battery_mv_s }); + gregapi.util.UT.Crafting.shaped(((AdvancedHandPump) ic2_advanced_handpump).getItemStack(0), + new Object[] { "T ", " P ", " B", Character.valueOf('T'), OP.pipeSmall.get(MT.TungstenSteel), + Character.valueOf('P'), pump_hv, Character.valueOf('B'), energy_crystal }); + } + if (IHLMod.config.enableFlexibleCablesCrafting) { + gregapi.util.UT.Crafting.shaped(IHLUtils.getThisModItemStack("ironWorkbench"), + new Object[] { "PPS", "RRh", "RRd", Character.valueOf('P'), OP.plate.get(MT.Iron), + Character.valueOf('S'), OP.screw.get(MT.Iron), Character.valueOf('R'), + OP.stick.get(MT.Iron) }); + gregapi.util.UT.Crafting.shaped(IHLUtils.getThisModItemStack("setOfDies1_5sqmm"), + new Object[] { " ", "fPs", " ", Character.valueOf('P'), OP.plate.get(MT.Steel) }); + gregapi.util.UT.Crafting.shaped(IHLUtils.getItemStackWithTag("setOfDies1_5sqmm", "transverseSection", 240), + new Object[] { " f ", " P ", " s ", Character.valueOf('P'), OP.plate.get(MT.Steel) }); + } + if (pfaalimestone != null) { + Recipe.RecipeMap.sMaceratorRecipes.addRecipe(true, new ItemStack[] { pfaalimestone }, + new ItemStack[] { IHLUtils.getOreDictItemStackWithSize("dustCalcite", 4) }, null, + new long[] { 10000 }, new FluidStack[] {}, new FluidStack[] {}, 600, 30, 0); + } + if (pfaacobblelimestone != null) { + Recipe.RecipeMap.sMaceratorRecipes.addRecipe(true, new ItemStack[] { pfaacobblelimestone }, + new ItemStack[] { IHLUtils.getOreDictItemStackWithSize("dustCalcite", 4) }, null, + new long[] { 10000 }, new FluidStack[] {}, new FluidStack[] {}, 600, 30, 0); + } + List gypsumOreList = IHLUtils.getEntryListForOre("oreGypsum"); + Iterator oreListIterator = gypsumOreList.iterator(); + while (oreListIterator.hasNext()) { + Recipe.RecipeMap.sMaceratorRecipes.addRecipe(true, new ItemStack[] { oreListIterator.next().copy() }, + new ItemStack[] { IHLUtils.getOreDictItemStack("dustGypsum") }, null, new long[] { 10000 }, + new FluidStack[] {}, new FluidStack[] {}, 600, 30, 0); + } + + Recipe.RecipeMap.sMaceratorRecipes.addRecipe(true, + new ItemStack[] { IHLUtils.getThisModItemStack("orePotassiumFeldspar") }, + new ItemStack[] { IHLUtils.getOreDictItemStack("dustPotassiumFeldspar") }, null, new long[] { 10000 }, + new FluidStack[] {}, new FluidStack[] {}, 600, 30, 0); + + Recipe.RecipeMap.sMaceratorRecipes.addRecipe(true, + new ItemStack[] { IHLUtils.getThisModItemStack("oreLimestone") }, + new ItemStack[] { IHLUtils.getOreDictItemStack("dustCalcite") }, null, new long[] { 10000 }, + new FluidStack[] {}, new FluidStack[] {}, 600, 30, 0); + Recipe.RecipeMap.sMaceratorRecipes.addRecipe(true, + new ItemStack[] { IHLUtils.getThisModItemStack("oreSaltpeter") }, + new ItemStack[] { IHLUtils.getOreDictItemStack("dustSaltpeter") }, null, new long[] { 10000 }, + new FluidStack[] {}, new FluidStack[] {}, 600, 30, 0); + Recipe.RecipeMap.sMaceratorRecipes.addRecipe(true, new ItemStack[] { new ItemStack(Items.brick) }, + new ItemStack[] { IHLUtils.getOreDictItemStack("dustBrick") }, null, new long[] { 10000 }, + new FluidStack[] {}, new FluidStack[] {}, 600, 30, 0); + Recipe.RecipeMap.sShredderRecipes.addRecipe(true, new ItemStack[] { new ItemStack(Items.brick) }, + new ItemStack[] { IHLUtils.getOreDictItemStack("dustBrick") }, null, new long[] { 10000 }, + new FluidStack[] {}, new FluidStack[] {}, 600, 30, 0); + Recipe.RecipeMap.sMaceratorRecipes.addRecipe(true, + new ItemStack[] { IHLUtils.getOreDictItemStack("stickGraphite") }, + new ItemStack[] { IHLUtils.getOreDictItemStack("dustSmallGraphite") }, null, new long[] { 10000 }, + new FluidStack[] {}, new FluidStack[] {}, 600, 30, 0); + GT_ModHandler.addShapelessCraftingRecipe(IHLUtils.getThisModItemStack("dustCoalElectrodePremix"), + new Object[] { OreDictManager.INSTANCE.getStack(OP.dust, MT.Coal, 1), + IHLUtils.getOreDictItemStack("nuggetTarPitch") }); + GT_ModHandler.addShapelessCraftingRecipe(IHLUtils.getThisModItemStackWithSize("dustIrongraphite", 2), + new Object[] { OreDictManager.INSTANCE.getStack(OP.dust, MT.Iron, 1), + OreDictManager.INSTANCE.getStack(OP.dust, MT.Graphite, 1) }); + GT_ModHandler.addSmeltingRecipe(IHLUtils.getThisModItemStack("stickCoalElectrodePremix"), + OreDictManager.INSTANCE.getStack(OP.stick, MT.Coal, 1)); + GT_ModHandler.addSmeltingRecipe(OreDictManager.INSTANCE.getStack(OP.dust, MT.Calcite, 1), + OreDictManager.INSTANCE.getStack("dustQuicklime", 1)); + Recipe.RecipeMap.sPressRecipes.addRecipe(true, + new ItemStack[] { OreDictManager.INSTANCE.getStack(OP.dust, MT.Iron, 1), + OreDictManager.INSTANCE.getStack(OP.dust, MT.Graphite, 1) }, + new ItemStack[] { IHLUtils.getThisModItemStackWithSize("linerIronGraphite", 4) }, null, + new long[] { 10000 }, new FluidStack[] {}, new FluidStack[] {}, 950, 30, 0); + Recipe.RecipeMap.sPressRecipes.addRecipe(true, + new ItemStack[] { IHLUtils.getThisModItemStack("dustCoalElectrodePremix"), + IL.Shape_Extruder_Rod.get(0) }, + new ItemStack[] { IHLUtils.getThisModItemStack("stickCoalElectrodePremix") }, null, + new long[] { 10000 }, new FluidStack[] {}, new FluidStack[] {}, 950, 30, 0); + Recipe.RecipeMap.sPressRecipes.addRecipe(true, + new ItemStack[] { IHLUtils.getThisModItemStack("foilRubberWithSulfur"), + IL.Shape_Extruder_Casing.get(0) }, + new ItemStack[] { IHLUtils.getThisModItemStack("batteryCellsEbonite") }, null, new long[] { 10000 }, + new FluidStack[] {}, new FluidStack[] {}, 950, 30, 0); + Recipe.RecipeMap.sCompressorRecipes.addRecipe(true, + new ItemStack[] { IHLUtils.getThisModItemStackWithSize("foilMica", 4) }, + new ItemStack[] { IHLUtils.getThisModItemStack("plateMica") }, null, new long[] { 10000 }, + new FluidStack[] {}, new FluidStack[] {}, 950, 30, 0); + Recipe.RecipeMap.sMaceratorRecipes.addRecipe(true, + new ItemStack[] { IHLUtils.getOreDictItemStack("oreGyubnera") }, + new ItemStack[] { IHLUtils.getOreDictItemStack("crushedGyubnera") }, null, new long[] { 10000 }, + new FluidStack[] {}, new FluidStack[] {}, 600, 30, 0); + Recipe.RecipeMap.sCentrifugeRecipes.addRecipe(true, + new ItemStack[] { IHLUtils.getOreDictItemStack("crushedGyubnera") }, + new ItemStack[] { IHLUtils.getOreDictItemStack("crushedPurifiedGyubnera"), + IHLUtils.getOreDictItemStack("dustPotassiumFeldspar") }, + null, new long[] { 10000 }, new FluidStack[] {}, new FluidStack[] {}, 600, 30, 0); + Recipe.RecipeMap.sCentrifugeRecipes.addRecipe(true, new ItemStack[] {}, + new ItemStack[] { Ic2Items.resin.copy(), IHLUtils.getOreDictItemStack("dustTinyWood") }, null, + new long[] { 5000, 10000 }, + new FluidStack[] { new FluidStack(FluidRegistry.getFluid("fluidrubbertreesap"), 569) }, + new FluidStack[] { new FluidStack(FluidRegistry.getFluid("molten.latex"), 140), + new FluidStack(FluidRegistry.getFluid("glue"), 240), + new FluidStack(FluidRegistry.getFluid("water"), 100) }, + 64, 32, 0); + + ExtruderTileEntity.addRecipe(IHLUtils.getOreDictItemStackWithSize("dustRubber", 5), + IHLUtils.getOreDictItemStackWithSize("dustTinySulfur", 1), + IHLUtils.getFluidStackWithSize("molten.rubber", 144 * 5)); + ExtruderTileEntity.addRecipe(IHLUtils.getOreDictItemStackWithSize("dustRubber", 20), + IHLUtils.getOreDictItemStackWithSize("dustSulfur", 1), + IHLUtils.getFluidStackWithSize("molten.rubber", 144 * 20)); + WoodenRollingMachinePart1TileEntity.addRecipe(new RecipeInputOreDict("dustRubber", 5), + new RecipeInputOreDict("dustTinySulfur", 1), + IHLUtils.getThisModItemStackWithSize("foilRubberWithSulfur", 20)); + WoodenRollingMachinePart1TileEntity.addRecipe(new RecipeInputOreDict("dustRubber", 20), + new RecipeInputOreDict("dustSulfur", 1), + IHLUtils.getThisModItemStackWithSize("foilRubberWithSulfur", 80)); + WoodenRollingMachinePart1TileEntity.addRecipe( + new RecipeInputItemStack(IHLUtils.getThisModItemStackWithSize("foilRubberWithSulfur", 16)), + new RecipeInputItemStack(IHLUtils.getThisModItemStackWithSize("fabric", 8)), + new RecipeInputOreDict("dustGraphite"), + IHLUtils.getThisModItemStack("pipeRubberWithSulfur")); + } + + private void loadIC2Recipes() { + ItemStack crystal = IC2Items.getItem("lapotronCrystal").copy(); + ItemStack advBattery = IC2Items.getItem("advBattery").copy(); + ItemStack chargedReBattery = IC2Items.getItem("chargedReBattery").copy(); + crystal.setItemDamage(OreDictionary.WILDCARD_VALUE); + advBattery.setItemDamage(OreDictionary.WILDCARD_VALUE); + chargedReBattery.setItemDamage(OreDictionary.WILDCARD_VALUE); + Recipes.advRecipes.addRecipe(new ItemStack(electricEvaporatorBlock, 1), + new Object[] { "CCC", "CCC", " F ", Character.valueOf('C'), IC2Items.getItem("platecopper"), + Character.valueOf('F'), IC2Items.getItem("electroFurnace") }); + Recipes.advRecipes.addRecipe(new ItemStack(electricEvaporatorBlock, 1), + new Object[] { " ", " C ", " F ", Character.valueOf('C'), Ic2Items.electronicCircuit.copy(), + Character.valueOf('F'), new ItemStack(evaporatorBlock, 1) }); + if (IHLMod.config.enableFlexibleCablesCrafting) { + ItemStack cutter = Ic2Items.cutter.copy(); + cutter.setItemDamage(OreDictionary.WILDCARD_VALUE); + ItemStack forgeHammer = Ic2Items.ForgeHammer.copy(); + forgeHammer.setItemDamage(OreDictionary.WILDCARD_VALUE); + Recipes.advRecipes.addRecipe(IHLUtils.getThisModItemStack("setOfDies1_5sqmm"), new Object[] { " ", " PC", + " ", Character.valueOf('P'), Ic2Items.plateadviron, Character.valueOf('C'), cutter }); + Recipes.advRecipes.addRecipe(IHLUtils.getItemStackWithTag("setOfDies1_5sqmm", "transverseSection", 240), + new Object[] { " C ", " P ", " ", Character.valueOf('P'), Ic2Items.plateadviron, + Character.valueOf('C'), cutter }); + Recipes.advRecipes.addRecipe(IHLUtils.getThisModItemStack("ironWorkbench"), new Object[] { "P ", "P ", + "P H", Character.valueOf('P'), Ic2Items.plateadviron, Character.valueOf('H'), forgeHammer }); + } + ExtruderTileEntity.addRecipe(IHLUtils.getOreDictItemStackWithSize("itemRubber", 5), + IHLUtils.getOreDictItemStackWithSize("dustTinySulfur", 1), + IHLUtils.getFluidStackWithSize("molten.rubber", 144 * 5)); + ExtruderTileEntity.addRecipe(IHLUtils.getOreDictItemStackWithSize("itemRubber", 20), + IHLUtils.getOreDictItemStackWithSize("dustSulfur", 1), + IHLUtils.getFluidStackWithSize("molten.rubber", 144 * 20)); + WoodenRollingMachinePart1TileEntity.addRecipe(new RecipeInputOreDict("itemRubber", 5), + new RecipeInputOreDict("dustTinySulfur", 1), + IHLUtils.getThisModItemStackWithSize("foilRubberWithSulfur", 20)); + WoodenRollingMachinePart1TileEntity.addRecipe(new RecipeInputOreDict("itemRubber", 20), + new RecipeInputOreDict("dustSulfur", 1), + IHLUtils.getThisModItemStackWithSize("foilRubberWithSulfur", 80)); + WoodenRollingMachinePart1TileEntity.addRecipe( + new RecipeInputItemStack(IHLUtils.getThisModItemStackWithSize("foilRubberWithSulfur", 16)), + new RecipeInputItemStack(IHLUtils.getThisModItemStackWithSize("fabric", 8)), + new RecipeInputOreDict("dustGraphite"), + IHLUtils.getThisModItemStack("pipeRubberWithSulfur")); + } +} diff --git a/src/main/java/ihl/IHLModConfig.java b/src/main/java/ihl/IHLModConfig.java new file mode 100644 index 0000000..6beddfe --- /dev/null +++ b/src/main/java/ihl/IHLModConfig.java @@ -0,0 +1,562 @@ +package ihl; + +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileInputStream; +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.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Map.Entry; + +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import ic2.api.recipe.IRecipeInput; +import ic2.api.recipe.RecipeInputFluidContainer; +import ic2.api.recipe.RecipeInputItemStack; +import ic2.api.recipe.RecipeInputOreDict; +import ihl.flexible_cable.IronWorkbenchTileEntity; +import ihl.recipes.IronWorkbenchRecipe; +import ihl.recipes.RecipeInputDie; +import ihl.recipes.RecipeInputWire; +import ihl.recipes.RecipeOutputItemStack; +import ihl.recipes.UniversalRecipeInput; +import ihl.recipes.UniversalRecipeManager; +import ihl.recipes.UniversalRecipeOutput; +import ihl.utils.IHLUtils; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.config.Configuration; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; + +public class IHLModConfig +{ + public int explosionVectorSizeBits=7; + public int explosionPowerBase=100; + + public int handpumpTier=1; + public int handpumpMaxCharge=30000; + public int handpumpOperationEUCost=180; + + public int advancedHandpumpTier=3; + public int advancedHandpumpMaxCharge=1000000; + public int advancedHandpumpOperationEUCost=10000; + + public int tditTier=4; + public int tditMaxEnergyStorage=12000; + public int tditEnergyConsumePerStack=12000; + + public boolean enableHandpump=true; + public boolean enableRubberTreeSack=true; + public boolean enableWailers=true; + public boolean enableTDIT=true; + + public boolean enableFlexibleCablesCrafting=true; + public boolean enableFlexibleCablesGridPowerLossCalculations=true; + public boolean generateApatiteOre=true; + public boolean generateSaltpeterOre=true; + public boolean generateLimestone=true; + public boolean generateGypsum=true; + public boolean generatePotassiumFeldspar=true; + public boolean generateTrona=true; + public boolean generateRocksalt=true; + public boolean generateCinnabar=true; + public boolean generateGyubnera=true; + public boolean generateBauxite=true; + public boolean generateChromite=true; + public boolean generateMuscovite=true; + public boolean generateOil=true; + public boolean generateDatolite=true; + public boolean generateSaltwater=true; + public boolean generateBischofite=true; + public int chanceOreWillNotBeGenerated = 100; + public int mirrorReflectionRange=14; + public int mirrorReflectionUpdateSpeed=128; + public String preventMachineBlockRegistrationName="null"; + public boolean skipRecipeLoad=false; + public int machineryEnergyConsume=100; + public int maxCatalystUses = 1000; + + public IHLModConfig(FMLPreInitializationEvent evt) throws IOException + { + Configuration config = new Configuration(evt.getSuggestedConfigurationFile()); + config.load(); + skipRecipeLoad = config.get(Configuration.CATEGORY_GENERAL, "skipRecipeLoad", skipRecipeLoad).getBoolean(skipRecipeLoad); + preventMachineBlockRegistrationName = config.get(Configuration.CATEGORY_GENERAL, "preventMachineBlockRegistrationName", preventMachineBlockRegistrationName).getString(); + enableHandpump = config.get(Configuration.CATEGORY_GENERAL, "enableHandpump", enableHandpump).getBoolean(enableHandpump); + enableRubberTreeSack = config.get(Configuration.CATEGORY_GENERAL, "enableRubberTreeSack", enableRubberTreeSack).getBoolean(enableRubberTreeSack); + enableWailers = config.get(Configuration.CATEGORY_GENERAL, "enableWailers", enableWailers).getBoolean(enableWailers); + enableTDIT = config.get(Configuration.CATEGORY_GENERAL, "enableTDIT", enableTDIT).getBoolean(enableTDIT); + + generateApatiteOre = config.get(Configuration.CATEGORY_GENERAL, "generateApatiteOre", generateApatiteOre).getBoolean(generateApatiteOre); + generateSaltpeterOre = config.get(Configuration.CATEGORY_GENERAL, "generateSaltpeterOre", generateSaltpeterOre).getBoolean(generateSaltpeterOre); + generateLimestone = config.get(Configuration.CATEGORY_GENERAL, "generateLimestone", generateLimestone).getBoolean(generateLimestone); + generateGypsum = config.get(Configuration.CATEGORY_GENERAL, "generateGypsum", generateGypsum).getBoolean(generateGypsum); + generatePotassiumFeldspar = config.get(Configuration.CATEGORY_GENERAL, "generatePotassiumFeldspar", generatePotassiumFeldspar).getBoolean(generatePotassiumFeldspar); + generateTrona = config.get(Configuration.CATEGORY_GENERAL, "generateTrona", generateTrona).getBoolean(generateTrona); + generateRocksalt = config.get(Configuration.CATEGORY_GENERAL, "generateRocksalt", generateRocksalt).getBoolean(generateRocksalt); + generateCinnabar = config.get(Configuration.CATEGORY_GENERAL, "generateCinnabar", generateCinnabar).getBoolean(generateCinnabar); + generateGyubnera = config.get(Configuration.CATEGORY_GENERAL, "generateGyubnera", generateGyubnera).getBoolean(generateGyubnera); + generateBauxite = config.get(Configuration.CATEGORY_GENERAL, "generateBauxite", generateBauxite).getBoolean(generateBauxite); + generateChromite = config.get(Configuration.CATEGORY_GENERAL, "generateChromite", generateChromite).getBoolean(generateChromite); + generateMuscovite = config.get(Configuration.CATEGORY_GENERAL, "generateMuscovite", generateMuscovite).getBoolean(generateMuscovite); + generateOil = config.get(Configuration.CATEGORY_GENERAL, "generateOil", generateOil).getBoolean(generateOil); + generateDatolite = config.get(Configuration.CATEGORY_GENERAL, "generateDatolite", generateDatolite).getBoolean(generateDatolite); + generateSaltwater = config.get(Configuration.CATEGORY_GENERAL, "generateSaltwater", generateSaltwater).getBoolean(generateSaltwater); + generateBischofite = config.get(Configuration.CATEGORY_GENERAL, "generateBischofite", generateBischofite).getBoolean(generateBischofite); + + handpumpTier = config.get(Configuration.CATEGORY_GENERAL, "handpumpTier", handpumpTier).getInt(); + handpumpMaxCharge = config.get(Configuration.CATEGORY_GENERAL, "handpumpMaxCharge", handpumpMaxCharge).getInt(); + handpumpOperationEUCost = config.get(Configuration.CATEGORY_GENERAL, "handpumpOperationEUCost", handpumpOperationEUCost).getInt(); + advancedHandpumpTier = config.get(Configuration.CATEGORY_GENERAL, "advancedHandpumpTier", advancedHandpumpTier).getInt(); + advancedHandpumpMaxCharge = config.get(Configuration.CATEGORY_GENERAL, "advancedHandpumpMaxCharge", advancedHandpumpMaxCharge).getInt(); + advancedHandpumpOperationEUCost = config.get(Configuration.CATEGORY_GENERAL, "advancedHandpumpOperationEUCost", advancedHandpumpOperationEUCost).getInt(); + + tditTier = config.get(Configuration.CATEGORY_GENERAL, "tditTier", tditTier).getInt(); + tditMaxEnergyStorage = config.get(Configuration.CATEGORY_GENERAL, "tditMaxEnergyStorage", tditMaxEnergyStorage).getInt(); + tditEnergyConsumePerStack = config.get(Configuration.CATEGORY_GENERAL, "tditEnergyConsumePerStack", tditEnergyConsumePerStack).getInt(); + + enableFlexibleCablesGridPowerLossCalculations = config.get(Configuration.CATEGORY_GENERAL, "enableFlexibleCablesGridPowerLossCalculations", enableFlexibleCablesGridPowerLossCalculations).getBoolean(enableFlexibleCablesGridPowerLossCalculations); + enableFlexibleCablesCrafting = config.get(Configuration.CATEGORY_GENERAL, "enableFlexibleCablesCrafting", enableFlexibleCablesCrafting).getBoolean(enableFlexibleCablesCrafting); + mirrorReflectionRange = config.get(Configuration.CATEGORY_GENERAL, "mirrorReflectionRange", mirrorReflectionRange).getInt(); + mirrorReflectionUpdateSpeed = config.get(Configuration.CATEGORY_GENERAL, "mirrorReflectionUpdateSpeed", mirrorReflectionUpdateSpeed).getInt(); + + explosionVectorSizeBits = config.get(Configuration.CATEGORY_GENERAL, "explosionVectorSizeBits", explosionVectorSizeBits).getInt(); + explosionPowerBase = config.get(Configuration.CATEGORY_GENERAL, "explosionPowerBase", explosionPowerBase).getInt(); + chanceOreWillNotBeGenerated = config.get(Configuration.CATEGORY_GENERAL, "chanceOreWillNotBeGenerated", chanceOreWillNotBeGenerated).getInt(); + + maxCatalystUses = config.get(Configuration.CATEGORY_GENERAL, "maxCatalystUses", maxCatalystUses).getInt(); + machineryEnergyConsume = config.get(Configuration.CATEGORY_GENERAL, "machineryEnergyConsume", machineryEnergyConsume).getInt(); + config.save(); + } + + private void loadRecipeConfig(InputStream resourceAsStream, boolean rewriteConfig) throws IOException + { + OutputStreamWriter osWriter = null; + BufferedWriter writer = null; + if(rewriteConfig) + { + osWriter = new OutputStreamWriter(new FileOutputStream(getFile()), "UTF-8"); + writer = new BufferedWriter(osWriter); + } + InputStreamReader isReader = new InputStreamReader(resourceAsStream, "UTF-8"); + LineNumberReader reader = new LineNumberReader(isReader); + String line; + StringBuffer currentModificator = new StringBuffer(""); + int bracketCounter=0; + boolean modificatorStart=false; + while ((line = reader.readLine()) != null) + { + if(osWriter!=null) + { + writer.newLine(); + writer.append(line); + } + line = IHLUtils.trim(line); + if (!line.isEmpty() && !line.startsWith("//") && !line.startsWith(";")) + { + currentModificator.append(line); + for(int i=0;i> urmi = UniversalRecipeManager.machineRecipeManagers.entrySet().iterator(); + while(urmi.hasNext()) + { + writer.newLine(); + writer.append("//"+urmi.next().getKey()); + } + writer.close(); + osWriter.close(); + } + } + + private void processModificator(String string) + { + String action = null; + String machineName = null; + String recipeInput = null; + String recipeOutput = null; + UniversalRecipeInput uRecipeInput = null; + UniversalRecipeOutput uRecipeOutput = null; + String[] functionAndParameters = extractFunctionAndParameters(string); + action=functionAndParameters[0].toLowerCase(); + List parameters = splitParameters(functionAndParameters[1]); + Iterator parametersi=parameters.iterator(); + while(parametersi.hasNext()) + { + String parameter = parametersi.next(); + if(parameter.equalsIgnoreCase("ironworkbench")) + { + machineName=parameter; + } + else if(UniversalRecipeManager.machineRecipeManagers.containsKey(parameter)) + { + machineName=parameter; + } + else if(parameter.startsWith("recipeinput")) + { + recipeInput=parameter; + } + else if(parameter.startsWith("recipeoutput")) + { + recipeOutput=parameter; + } + } + List recipeInputsItems = new ArrayList(); + List recipeInputsTools = new ArrayList(); + List recipeInputsMachines = new ArrayList(); + if(recipeInput!=null) + { + List recipeInputsFluids = new ArrayList(); + String[] rifunctionAndParameters = extractFunctionAndParameters(recipeInput); + List riparameters = splitParameters(rifunctionAndParameters[1]); + Iterator riparametersi=riparameters.iterator(); + while(riparametersi.hasNext()) + { + String parameter = riparametersi.next(); + String[] riItemFunctionAndParameters = extractFunctionAndParameters(parameter); + if(riItemFunctionAndParameters[0].startsWith("itemstack")) + { + List riItemStackparameters = splitParameters(riItemFunctionAndParameters[1]); + String[] modAndItemName = riItemStackparameters.get(0).split(":"); + 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")) + { + List riItemStackparameters = splitParameters(riItemFunctionAndParameters[1]); + recipeInputsItems.add(new RecipeInputDie("setOfDies1_5sqmm", Integer.parseInt(riItemStackparameters.get(0)))); + } + else if(riItemFunctionAndParameters[0].startsWith("fiber")) + { + List riItemStackparameters = splitParameters(riItemFunctionAndParameters[1]); + ItemStack stack = IHLUtils.getThisModWireItemStackWithLength(riItemStackparameters.get(0), Integer.parseInt(riItemStackparameters.get(1))); + recipeInputsItems.add(new RecipeInputWire(stack, Integer.parseInt(riItemStackparameters.get(1)))); + } + else if(riItemFunctionAndParameters[0].startsWith("wire")) + { + List riItemStackparameters = splitParameters(riItemFunctionAndParameters[1]); + recipeInputsItems.add(new RecipeInputWire(riItemStackparameters.get(0), Integer.parseInt(riItemStackparameters.get(1)), Integer.parseInt(riItemStackparameters.get(2)))); + } + else if(riItemFunctionAndParameters[0].startsWith("cable")) + { + List riItemStackparameters = splitParameters(riItemFunctionAndParameters[1]); + recipeInputsItems.add(new RecipeInputWire(riItemStackparameters.get(0), Integer.parseInt(riItemStackparameters.get(1)), Integer.parseInt(riItemStackparameters.get(2)),riItemStackparameters.get(3),Integer.parseInt(riItemStackparameters.get(4)),Integer.parseInt(riItemStackparameters.get(5)))); + } + else if(riItemFunctionAndParameters[0].startsWith("oredict")) + { + 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)), 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")) + { + recipeInputsTools.add(new RecipeInputOreDict(splitParameters(riItemFunctionAndParameters[1]).get(0))); + + } + else if(riItemFunctionAndParameters[0].startsWith("machine")) + { + List riItemStackparameters = splitParameters(riItemFunctionAndParameters[1]); + String[] modAndItemName = riItemStackparameters.get(0).split(":"); + recipeInputsMachines.add(IHLUtils.getThisModItemStack(modAndItemName[1])); + } + else if(riItemFunctionAndParameters[0].startsWith("fluidstack")) + { + List riFluidStackparameters = splitParameters(riItemFunctionAndParameters[1]); + recipeInputsFluids.add(IHLUtils.getFluidStackWithSize(riFluidStackparameters.get(0),Integer.parseInt(riFluidStackparameters.get(1)))); + } + } + uRecipeInput = new UniversalRecipeInput(recipeInputsFluids.toArray(),recipeInputsItems.toArray()); + } + List recipeOutputsItems = new ArrayList(); + List recipeOutputsRecipeOut = new ArrayList(); + if(recipeOutput!=null) + { + List recipeOutputsFluids = new ArrayList(); + String[] rifunctionAndParameters = extractFunctionAndParameters(recipeOutput); + List riparameters = splitParameters(rifunctionAndParameters[1]); + Iterator riparametersi=riparameters.iterator(); + while(riparametersi.hasNext()) + { + String parameter = riparametersi.next(); + String[] riItemFunctionAndParameters = extractFunctionAndParameters(parameter); + if(riItemFunctionAndParameters[0].startsWith("itemstack")) + { + List riItemStackparameters = splitParameters(riItemFunctionAndParameters[1]); + String[] modAndItemName = riItemStackparameters.get(0).split(":"); + 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.copy(),Float.parseFloat(riItemStackparameters.get(1)))); + } + else if(riItemFunctionAndParameters[0].startsWith("fiber")) + { + List riItemStackparameters = splitParameters(riItemFunctionAndParameters[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]); + 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]); + 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")) + { + List riFluidStackparameters = splitParameters(riItemFunctionAndParameters[1]); + recipeOutputsFluids.add(IHLUtils.getFluidStackWithSize(riFluidStackparameters.get(0),Integer.parseInt(riFluidStackparameters.get(1)))); + } + } + uRecipeOutput = new UniversalRecipeOutput(recipeOutputsFluids,recipeOutputsRecipeOut, 200); + } + if(action.equalsIgnoreCase("addrecipe")) + { + if(machineName.equalsIgnoreCase("ironworkbench")) + { + IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(recipeInputsTools,recipeInputsItems, recipeOutputsItems, recipeInputsMachines)); + } + else + { + 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")) + { + if(recipeInputsTools.isEmpty() && recipeInputsItems.isEmpty() && recipeInputsMachines.isEmpty()) + { + IronWorkbenchTileEntity.removeRecipeByOutput(recipeOutputsItems); + } + else + { + IronWorkbenchTileEntity.removeRecipeByInput(recipeInputsTools,recipeInputsItems, recipeInputsMachines); + } + } + else + { + if(uRecipeInput==null) + { + UniversalRecipeManager.machineRecipeManagers.get(machineName).removeRecipeByOutput(uRecipeOutput); + } + else + { + UniversalRecipeManager.machineRecipeManagers.get(machineName).removeRecipeByInput(uRecipeInput); + } + } + } + } + + 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; + 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>(); + + public ServerProxy() {} + + public void load() throws ParserConfigurationException + { + if(channel==null) + { + channel = NetworkRegistry.INSTANCE.newEventDrivenChannel(IHLModInfo.MODID); + channel.register(this); + } + } + public void spawnParticle(int particle, World world, double x, double y, double z, double mx, double my, double mz, float paticleScale){} + + public void spawnParticleFromServer(int particle, World world, double x, double y, double z, double mx, double my, double mz, float paticleScale) + { + ByteBuf bb = Unpooled.buffer(36); + ByteBufOutputStream byteBufOutputStream = new ByteBufOutputStream(bb); + try + { + byteBufOutputStream.write(0); + byteBufOutputStream.write(particle); + byteBufOutputStream.writeFloat((float) x); + byteBufOutputStream.writeFloat((float) y); + byteBufOutputStream.writeFloat((float) z); + byteBufOutputStream.writeFloat((float) mx); + byteBufOutputStream.writeFloat((float) my); + byteBufOutputStream.writeFloat((float) mz); + byteBufOutputStream.writeFloat(paticleScale); + channel.sendToAllAround(new FMLProxyPacket(byteBufOutputStream.buffer(),IHLModInfo.MODID), new TargetPoint(world.provider.dimensionId, x, y, z, 32d)); + byteBufOutputStream.close(); + } + catch (IOException e) + { + e.printStackTrace(); + } + } + + 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) + { + return null; + } + public int getGLDisplayList() {return -1;} + + public File getMinecraftDir() + { + return new File("."); + } + public int shareBlockRendererByMachineType(MachineType type) + { + return 0; + } + + public void addEntityToList(INetworkListener entity) + { + this.entityList.put(entity.getId(), entity); + } + + public void recieveDelayedDataPacket(INetworkListener listener) + { + ByteBuf data = delayedEntityDataPacket.remove(listener.getId()); + if(data!=null) + { + ByteBufInputStream byteBufInputStream = new ByteBufInputStream(data); + try + { + //byteBufInputStream.skipBytes(5); + listener.recieveData(byteBufInputStream); + byteBufInputStream.close(); + IHLMod.log.debug("Delayed data read."); + } + catch (IOException e) + { + e.printStackTrace(); + } + } + else + { + IHLMod.log.debug("Delayed data is null. Entity ID="+listener.getId()); + } + } + + public void sendFromServerToAll(FMLProxyPacket fmlProxyPacket) + { + channel.sendToAll(fmlProxyPacket); + } + + public void sendFromServerToPlayer(FMLProxyPacket fmlProxyPacket, EntityPlayerMP player) + { + channel.sendTo(fmlProxyPacket, player); + } + + @SubscribeEvent + public void onPacketFromClientToServer(FMLNetworkEvent.ServerCustomPacketEvent event) throws IOException, NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException + { + ByteBuf data = event.packet.payload(); + ByteBufInputStream byteBufInputStream = new ByteBufInputStream(data); + switch(byteBufInputStream.read()) + { + case 0: + int playerEntityId = byteBufInputStream.readInt(); + int worldDimensionId = byteBufInputStream.readInt(); + int containerSlotNumber = byteBufInputStream.readInt(); + int fieldValue = byteBufInputStream.readInt(); + String fieldName = byteBufInputStream.readUTF(); + EntityPlayerMP player = (EntityPlayerMP) MinecraftServer.getServer().worldServerForDimension(worldDimensionId).getEntityByID(playerEntityId); + ItemStack stack = ((Slot)player.openContainer.inventorySlots.get(containerSlotNumber)).getStack(); + stack.stackTagCompound.setInteger(fieldName, fieldValue); + player.openContainer.detectAndSendChanges(); + 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; + case 2: + worldDimensionId = byteBufInputStream.readInt(); + x = byteBufInputStream.readInt(); + y = byteBufInputStream.readInt(); + z = byteBufInputStream.readInt(); + world = MinecraftServer.getServer().worldServerForDimension(worldDimensionId); + te = world.getTileEntity(x, y, z); + if(te!=null && !te.isInvalid()) + { + int value = byteBufInputStream.readInt(); + fieldName = byteBufInputStream.readUTF(); + te.getClass().getDeclaredField(fieldName).set(te, value); + } + break; + } + + byteBufInputStream.close(); + + } + + @SubscribeEvent + public void onPlayerConnectedToServer(PlayerLoggedInEvent event) + { + IHLMod.log.debug("player connected"); + Iterator inli=this.entityServerList.iterator(); + while(inli.hasNext()) + { + INetworkListener inl = inli.next(); + if(inl.isInvalid()) + { + inli.remove(); + } + else if(event.player instanceof EntityPlayerMP) + { + inl.registerAndSendData((EntityPlayerMP)event.player); + } + } + } + + @SubscribeEvent + public void onPlayerTeleport(PlayerChangedDimensionEvent event) + { + FlexibleCableItem.instance.onPlayerTeleport(event); + Iterator inli=this.entityServerList.iterator(); + while(inli.hasNext()) + { + INetworkListener inl = inli.next(); + if(inl.isInvalid()) + { + inli.remove(); + } + else if(event.player instanceof EntityPlayerMP) + { + inl.registerAndSendData((EntityPlayerMP)event.player); + } + } + } + @SubscribeEvent + public void onBlockBreak(BreakEvent event) { + int x = event.x; + int y = event.y; + int z = event.z; + ByteBuf bb = Unpooled.buffer(20); + ByteBufOutputStream byteBufOutputStream = new ByteBufOutputStream(bb); + try + { + byteBufOutputStream.write(4); + byteBufOutputStream.writeInt(x); + byteBufOutputStream.writeInt(y); + byteBufOutputStream.writeInt(z); + channel.sendToAllAround(new FMLProxyPacket(byteBufOutputStream.buffer(),IHLModInfo.MODID), new TargetPoint(event.world.provider.dimensionId, x, y, z, 256d)); + byteBufOutputStream.close(); + } + catch (IOException e) + { + e.printStackTrace(); + } + } + + @SubscribeEvent + public void onBlockPlace(PlaceEvent event) { + int x = event.x; + int y = event.y; + int z = event.z; + ByteBuf bb = Unpooled.buffer(20); + ByteBufOutputStream byteBufOutputStream = new ByteBufOutputStream(bb); + try + { + byteBufOutputStream.write(5); + byteBufOutputStream.writeInt(x); + byteBufOutputStream.writeInt(y); + byteBufOutputStream.writeInt(z); + channel.sendToAllAround(new FMLProxyPacket(byteBufOutputStream.buffer(),IHLModInfo.MODID), new TargetPoint(event.world.provider.dimensionId, x, y, z, 256d)); + byteBufOutputStream.close(); + } + catch (IOException e) + { + e.printStackTrace(); + } + } + + + public void addEntityToServerList(INetworkListener entity) + { + this.entityServerList.add(entity); + } + + public boolean renderTESpecialSelectionBox(TileEntity te, EntityPlayer player, ItemStack currentItem, MovingObjectPosition target, float partialTicks) { + return false; + } + + 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){} + +} diff --git a/src/main/java/ihl/crop_harvestors/BlobEntityFX.java b/src/main/java/ihl/crop_harvestors/BlobEntityFX.java new file mode 100644 index 0000000..60a3ad9 --- /dev/null +++ b/src/main/java/ihl/crop_harvestors/BlobEntityFX.java @@ -0,0 +1,84 @@ +package ihl.crop_harvestors; + +import net.minecraft.client.particle.EntityFX; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.world.World; + +public class BlobEntityFX extends EntityFX { + + public FluidType fluid = FluidType.RESIN; + + public BlobEntityFX(World world, double x, double y, double z) + { + super(world, x, y, z); + this.noClip = true; + } + + public BlobEntityFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12, float par14, FluidType fluid1) + { + super(par1World, par2, par4, par6, 0.0D, 0.0D, 0.0D); + this.motionX *= 0.1D; + this.motionY *= 0.1D; + this.motionZ *= 0.1D; + this.motionX += par8; + this.motionY += par10; + this.motionZ += par12; + this.particleScale *= par14; + this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D)); + this.noClip = true; + fluid=fluid1; + } + + @Override + public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) + { + float var8 = ((float)this.particleAge) / (float)this.particleMaxAge * 32.0F; + + if (var8 < 0.0F) + { + var8 = 0.0F; + } + + if (var8 > 1.0F) + { + var8 = 1.0F; + } + this.renderParticle2(par1Tessellator, par2, par3, par4, par5, par6, par7); + } + + public void renderParticle2(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) + { + float var12 = 0.1F * this.particleScale; + float var13 = (float)(this.prevPosX + (this.posX - this.prevPosX) * par2 - interpPosX); + float var14 = (float)(this.prevPosY + (this.posY - this.prevPosY) * par2 - interpPosY); + float var15 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * par2 - interpPosZ); + par1Tessellator.addVertexWithUV(var13 - par3 * var12 - par6 * var12, var14 - par4 * var12, var15 - par5 * var12 - par7 * var12, 1D, 1D); + par1Tessellator.addVertexWithUV(var13 - par3 * var12 + par6 * var12, var14 + par4 * var12, var15 - par5 * var12 + par7 * var12, 1D, 0D); + par1Tessellator.addVertexWithUV(var13 + par3 * var12 + par6 * var12, var14 + par4 * var12, var15 + par5 * var12 + par7 * var12, 0D, 0D); + par1Tessellator.addVertexWithUV(var13 + par3 * var12 - par6 * var12, var14 - par4 * var12, var15 + par5 * var12 - par7 * var12, 0D, 1D); + } + + @Override + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if (this.particleAge++ >= this.particleMaxAge) + { + this.setDead(); + } + this.motionX *= 0.5D; + this.motionZ *= 0.5D; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionY -= 0.001D; + this.motionY *= 0.96D; + } + + public enum FluidType + { + SAP, + RESIN + } +} diff --git a/src/main/java/ihl/crop_harvestors/BlobRenderFX.java b/src/main/java/ihl/crop_harvestors/BlobRenderFX.java new file mode 100644 index 0000000..ed54869 --- /dev/null +++ b/src/main/java/ihl/crop_harvestors/BlobRenderFX.java @@ -0,0 +1,64 @@ +package ihl.crop_harvestors; + +import org.lwjgl.opengl.GL11; + +import ihl.IHLModInfo; +import net.minecraft.client.particle.EntityFX; +import net.minecraft.client.renderer.ActiveRenderInfo; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.entity.Entity; +import net.minecraft.util.ResourceLocation; + +public class BlobRenderFX extends Render{ + private ResourceLocation tex, tex2; + +public BlobRenderFX() +{ + super(); + tex = new ResourceLocation(IHLModInfo.MODID+":textures/particles/blob.png"); + tex2 = new ResourceLocation(IHLModInfo.MODID+":textures/particles/blobOfResin.png"); +} + +@Override +public void doRender(Entity entity, double x, double y, double z, + float arg4, float arg5) +{ + float var3 = ActiveRenderInfo.rotationX; + float var4 = ActiveRenderInfo.rotationZ; + float var5 = ActiveRenderInfo.rotationYZ; + float var6 = ActiveRenderInfo.rotationXY; + float var7 = ActiveRenderInfo.rotationXZ; + EntityFX.interpPosX = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * arg4; + EntityFX.interpPosY = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * arg4; + EntityFX.interpPosZ = entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * arg4; + if(((BlobEntityFX)entity).fluid==BlobEntityFX.FluidType.RESIN) + { + this.renderManager.renderEngine.bindTexture(tex); + } + else + { + this.renderManager.renderEngine.bindTexture(tex2); + } + GL11.glPushMatrix(); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glTranslatef((float)x, (float)y, (float)z); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GL11.glAlphaFunc(GL11.GL_GREATER, 0.003921569F); + Tessellator var9 = Tessellator.instance; + var9.startDrawingQuads(); + EntityFX var11 = (EntityFX) entity; + var11.renderParticle(var9, arg4, var3, var7, var4, var5, var6); + var9.draw(); + GL11.glDisable(GL11.GL_BLEND); + GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); + GL11.glPopMatrix(); +} + + @Override + protected ResourceLocation getEntityTexture(Entity arg0) + { + return tex; + } +} \ No newline at end of file diff --git a/src/main/java/ihl/crop_harvestors/RubberTreeBlock.java b/src/main/java/ihl/crop_harvestors/RubberTreeBlock.java new file mode 100644 index 0000000..9cfdea1 --- /dev/null +++ b/src/main/java/ihl/crop_harvestors/RubberTreeBlock.java @@ -0,0 +1,165 @@ +package ihl.crop_harvestors; + +import java.util.Random; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ic2.api.item.IC2Items; +import ihl.IHLModInfo; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +public class RubberTreeBlock extends Block{ + + IIcon textureSide, textureTop; + TreeType type; + + public RubberTreeBlock(TreeType type1) + { + super(Material.wood); + type=type1; + } + + @Override + public Item getItemDropped(int var1, Random rnd, int var2) + { + switch(type) + { + case RUBBERTREE: + return IC2Items.getItem("rubberWood").getItem(); + case SPRUCE: + return Blocks.log.getItemDropped(var1, rnd, var2); + default: + return IC2Items.getItem("rubberWood").getItem(); + } + + } + + @Override + public boolean canSustainLeaves(IBlockAccess blockAccess, int x, int y, int z) + { + return true; + } + + @Override + public void dropBlockAsItemWithChance(World world, int x, int y, int z, int meta, float chance, int flag) + { + ItemStack result; + switch(type) + { + case RUBBERTREE: + result = IC2Items.getItem("rubberWood").copy(); + case SPRUCE: + result = new ItemStack(Blocks.log,1,1); + default: + result = IC2Items.getItem("rubberWood").copy(); + } + this.dropBlockAsItem(world, x, y, z, result); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister par1IconRegister) + { + switch(type) + { + case RUBBERTREE: + this.blockIcon = par1IconRegister.registerIcon(IHLModInfo.MODID + ":blockRubWoodFront"); + this.textureTop = par1IconRegister.registerIcon(IHLModInfo.MODID + ":blockRubWoodTop"); + this.textureSide = par1IconRegister.registerIcon(IHLModInfo.MODID + ":blockRubWoodSide"); + case SPRUCE: + this.blockIcon = par1IconRegister.registerIcon(IHLModInfo.MODID + ":blockSpruceFront"); + this.textureTop = par1IconRegister.registerIcon("minecraft:log_spruce_top"); + this.textureSide = par1IconRegister.registerIcon("minecraft:log_spruce"); + } + } + + @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, + 3,2,0,1,4,5, + 2,3,1,0,4,5, + 2,3,5,4,0,1, + 2,3,4,5,1,0 + }; + facing=world.getBlockMetadata(x, y, z); + switch (mask[facing*6+side]) + { + case 0: + return this.textureSide; + case 1: + return this.blockIcon; + case 2: + return this.textureTop; + case 3: + return this.textureTop; + case 4: + return this.textureSide; + case 5: + return this.textureSide; + default: + return this.textureSide; + } + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + switch (side) + { + case 0: + return this.textureTop; + case 1: + return this.textureTop; + case 2: + return this.blockIcon; + case 3: + return this.textureSide; + case 4: + return this.textureSide; + case 5: + return this.textureSide; + default: + return this.textureSide; + } + } + + public enum TreeType + { + RUBBERTREE, + SPRUCE + } + + @Override + public boolean isWood(IBlockAccess world, int x, int y, int z) + { + return true; + } + + @Override + public int getFireSpreadSpeed(IBlockAccess world, int x, int y, int z, ForgeDirection face) + { + return 4; + } + + @Override + public int getFlammability(IBlockAccess world, int x, int y, int z, ForgeDirection face) + { + return 20; + } + +} diff --git a/src/main/java/ihl/crop_harvestors/SackBlock.java b/src/main/java/ihl/crop_harvestors/SackBlock.java new file mode 100644 index 0000000..7972dc1 --- /dev/null +++ b/src/main/java/ihl/crop_harvestors/SackBlock.java @@ -0,0 +1,169 @@ +package ihl.crop_harvestors; + +import java.util.List; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ihl.IHLCreativeTab; +import ihl.IHLModInfo; +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.Entity; +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.MathHelper; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.IFluidContainerItem; + +public class SackBlock extends Block implements ITileEntityProvider{ + + public SackBlock(Material material) + { + super(material); + this.setCreativeTab(IHLCreativeTab.tab); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) { + return new SackTileEntity(); + } + + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister par1IconRegister) + { + 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) + { + this.setBlockBounds(0.2F, 0.0F, 0.2F, 0.8F, 0.1F, 0.8F); + super.addCollisionBoxesToList(world, x, y, z, aabb, list, entity); + this.setBlockBounds(0.2F, 0.0F, 0.2F, 0.21F, 1.0F, 0.8F); + super.addCollisionBoxesToList(world, x, y, z, aabb, list, entity); + this.setBlockBounds(0.2F, 0.0F, 0.2F, 0.8F, 1.0F, 0.21F); + super.addCollisionBoxesToList(world, x, y, z, aabb, list, entity); + this.setBlockBounds(0.79F, 0.0F, 0.0F, 0.8F, 1.0F, 0.8F); + super.addCollisionBoxesToList(world, x, y, z, aabb, list, entity); + this.setBlockBounds(0.0F, 0.0F, 0.79F, 0.8F, 1.0F, 0.8F); + 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 boolean hasTileEntity(int metadata) + { + return true; + } + + @Override + public boolean onBlockActivated(World world,int x,int y,int z,EntityPlayer entityPlayer,int i,float pos_x,float pos_y,float pos_z){ + TileEntity te = world.getTileEntity(x,y,z); + if(!world.isRemote && te instanceof SackTileEntity) + { + SackTileEntity ste = (SackTileEntity)te; + if (ste == null || entityPlayer.isSneaking()) { + return false; + } + else + { + if(ste.fluidTank.getFluid()!=null) + { + if(entityPlayer.inventory.getCurrentItem()!=null) + { + if(entityPlayer.inventory.getCurrentItem().getItem() instanceof IFluidContainerItem) + { + return false; + } + FluidStack drainFS = ste.drain(ForgeDirection.UNKNOWN, ste.fluidTank.getCapacity(), false); + ItemStack stackToAdd = FluidContainerRegistry.fillFluidContainer(drainFS, entityPlayer.inventory.getCurrentItem()); + if(stackToAdd!=null) + { + if (entityPlayer.inventory.addItemStackToInventory(stackToAdd)) + { + entityPlayer.inventory.getCurrentItem().stackSize--; + entityPlayer.inventoryContainer.detectAndSendChanges(); + ste.drain(ForgeDirection.UNKNOWN, FluidContainerRegistry.getContainerCapacity(stackToAdd),true); + } + } + } + } + } + } + return false; + } + + /** + * The type of render function that is called for this block + */ + @Override + public int getRenderType() + { + return -2; + } + + /** + * 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. + */ + @Override + public boolean isOpaqueCube() + { + return false; + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) + { + int var7 = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; + TileEntity t = world.getTileEntity(x, y, z); + if(t!=null && t instanceof SackTileEntity) + { + SackTileEntity te = (SackTileEntity)t; + switch(var7) + { + case 0: + te.setFacing((short) 3); + break; + case 1: + te.setFacing((short) 4); + break; + case 2: + te.setFacing((short) 2); + break; + case 3: + te.setFacing((short) 5); + break; + default: + break; + } + + } + } +} diff --git a/src/main/java/ihl/crop_harvestors/SackModel.java b/src/main/java/ihl/crop_harvestors/SackModel.java new file mode 100644 index 0000000..a0fe780 --- /dev/null +++ b/src/main/java/ihl/crop_harvestors/SackModel.java @@ -0,0 +1,103 @@ +package ihl.crop_harvestors; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; + +public class SackModel extends ModelBase { + //fields + ModelRenderer Base; + ModelRenderer Top; + ModelRenderer Liquid; + ModelRenderer Liquid_overflow; + ModelRenderer Liquid2; + ModelRenderer Liquid2_overflow; + ModelRenderer Rope1; + ModelRenderer Rope2; + + public SackModel() + { + textureWidth = 64; + textureHeight = 64; + setTextureOffset("Base.Shape1", 0, 0); + setTextureOffset("Base.Shape2", 0, 0); + setTextureOffset("Base.Shape3", 0, 0); + setTextureOffset("Base.Shape4", 0, 0); + setTextureOffset("Base.Shape5", 0, 0); + setTextureOffset("Top.Shape6", 0, 0); + setTextureOffset("Top.Shape7", 0, 0); + setTextureOffset("Top.Shape8", 0, 0); + setTextureOffset("Liquid.Shape9", 20, 20); + setTextureOffset("Liquid_overflow.Shape12", 46, 25); + setTextureOffset("Rope1.Shape12", 56, 17); + setTextureOffset("Rope2.Shape13", 48, 17); + + setTextureOffset("Liquid2.Shape14", 0, 32); + setTextureOffset("Liquid2_overflow.Shape15", 46, 57); + + Base = new ModelRenderer(this, "Base"); + Base.setRotationPoint(0F, 8F, 0F); + setRotation(Base, 0F, 0F, 0F); + Base.mirror = true; + Base.addBox("Shape1", -6F, 15F, -4F, 12, 1, 12); + Base.addBox("Shape2", -6F, 2F, -4F, 12, 13, 1); + Base.addBox("Shape3", -6F, 2F, -3F, 1, 13, 10); + Base.addBox("Shape4", 5F, 2F, -3F, 1, 13, 10); + Base.addBox("Shape5", -6F, 0F, 7F, 12, 15, 1); + Top = new ModelRenderer(this, "Top"); + Top.setRotationPoint(0F, 9F, 0F); + setRotation(Top, 0.05F, 0F, 0F); + Top.mirror = true; + Top.addBox("Shape6", -6.2F, -0.5F, -4.4F, 1, 2, 12); + Top.addBox("Shape7", 5.2F, -0.5F, -4.4F, 1, 2, 12); + Top.addBox("Shape8", -6F, -0.4F, -4.5F, 12, 2, 1); + Liquid = new ModelRenderer(this, "Liquid"); + Liquid.setRotationPoint(0F, 8F, 0F); + setRotation(Liquid, 0F, 0F, 0F); + Liquid.mirror = true; + Liquid.addBox("Shape9", -5.5F, 0.5F, -3.5F, 11, 1, 11); + Liquid_overflow = new ModelRenderer(this, "Liquid_overflow"); + Liquid_overflow.setRotationPoint(0F, 8F, 0F); + setRotation(Liquid_overflow, 0.051F, 0F, 0.01F); + Liquid_overflow.mirror = true; + Liquid_overflow.addBox("Shape12", -4F, 0.55F, -4.4F, 8, 2, 2); + + Liquid2 = new ModelRenderer(this, "Liquid2"); + Liquid2.setRotationPoint(0F, 8F, 0F); + setRotation(Liquid2, 0F, 0F, 0F); + Liquid2.mirror = true; + Liquid2.addBox("Shape14", -5.5F, 0.5F, -3.5F, 11, 1, 11); + Liquid2_overflow = new ModelRenderer(this, "Liquid2_overflow"); + Liquid2_overflow.setRotationPoint(0F, 8F, 0F); + setRotation(Liquid2_overflow, 0.051F, 0F, 0.01F); + Liquid2_overflow.mirror = true; + Liquid2_overflow.addBox("Shape15", -4F, 0.55F, -4.4F, 8, 2, 2); + + + Rope1 = new ModelRenderer(this, "Rope1"); + Rope1.setRotationPoint(0F, 8F, 0F); + setRotation(Rope1, 0F, 0F, -0.2F); + Rope1.mirror = true; + Rope1.addBox("Shape12", 5F, 0.7F, 7.9F, 3, 1, 1); + Rope2 = new ModelRenderer(this, "Rope2"); + Rope2.setRotationPoint(0F, 8F, 0F); + setRotation(Rope2, 0F, 0F, 0.2F); + Rope2.mirror = true; + Rope2.addBox("Shape13", -8F, 0.7F, 7.9F, 3, 1, 1); + } + + 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) + { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + } +} + + diff --git a/src/main/java/ihl/crop_harvestors/SackRender.java b/src/main/java/ihl/crop_harvestors/SackRender.java new file mode 100644 index 0000000..31798b4 --- /dev/null +++ b/src/main/java/ihl/crop_harvestors/SackRender.java @@ -0,0 +1,95 @@ +package ihl.crop_harvestors; +import org.lwjgl.opengl.GL11; + +import ihl.IHLModInfo; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.fluids.FluidRegistry; + +public class SackRender extends TileEntitySpecialRenderer{ +private SackModel model = new SackModel(); +private ResourceLocation tex = new ResourceLocation(IHLModInfo.MODID+":textures/blocks/sack.png"); +private final float maxRenderLiquidLevel=0.5F; +private final float minRenderLiquidLevel=14.5F; +private final float scale=1F/16F; +private float overflow=0F; + + +public SackRender(){} + +public void renderAModelAt(SackTileEntity tile, double d, double d1, double d2, float f) { +int rotation = 0; +if(tile.getWorldObj() != null) +{ + switch (tile.getFacing()) + { + case 2: + rotation = 0; + break; + case 5: + rotation = 1; + break; + case 3: + rotation = 2; + break; + case 4: + rotation = 3; + break; + default: + rotation = 0; + } +} +bindTexture(tex); //texture +GL11.glPushMatrix(); +GL11.glTranslatef((float)d + 0.5F, (float)d1 + 1.5F, (float)d2 + 0.5F); +GL11.glScalef(1.0F, -1F, -1F); +GL11.glRotatef(rotation*90, 0.0F, 1.0F, 0.0F); +model.Base.render(scale); +model.Top.render(scale); +model.Rope1.render(scale); +model.Rope2.render(scale); +GL11.glEnable(GL11.GL_BLEND); +GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); +GL11.glColor4f(1f,1f,1f,1f); +model.Liquid2.offsetY=model.Liquid.offsetY=(minRenderLiquidLevel-(minRenderLiquidLevel-maxRenderLiquidLevel)*tile.getRenderLiquidLevel())*scale; +if(tile.getRenderLiquidLevel()>0) +{ + if(tile.visibleFluidId!=-1) + { + if(tile.visibleFluidId==FluidRegistry.getFluid("fluidrubbertreesap").getID()) + { + model.Liquid.render(scale); + } + else if(tile.visibleFluidId==FluidRegistry.getFluid("spruceresin").getID()) + { + model.Liquid2.render(scale); + } + } +} +if(tile.getRenderLiquidLevel()>0.98F) +{ + if(overflow<0.5F)overflow+=0.001F; + model.Liquid2_overflow.offsetZ=model.Liquid_overflow.offsetZ=-overflow*scale; + if(tile.visibleFluidId!=-1) + { + if(tile.visibleFluidId==FluidRegistry.getFluid("fluidrubbertreesap").getID()) + { + model.Liquid_overflow.render(scale); + } + else if(tile.visibleFluidId==FluidRegistry.getFluid("spruceresin").getID()) + { + model.Liquid2_overflow.render(scale); + } + } +} +GL11.glDisable(GL11.GL_BLEND); +GL11.glPopMatrix(); //end +} + + @Override + public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8) + { + this.renderAModelAt((SackTileEntity)par1TileEntity, par2, par4, par6, par8); + } +} \ No newline at end of file diff --git a/src/main/java/ihl/crop_harvestors/SackTileEntity.java b/src/main/java/ihl/crop_harvestors/SackTileEntity.java new file mode 100644 index 0000000..800b2c5 --- /dev/null +++ b/src/main/java/ihl/crop_harvestors/SackTileEntity.java @@ -0,0 +1,569 @@ +package ihl.crop_harvestors; + +import java.util.List; +import java.util.Random; + +import ic2.core.IC2; +import ic2.core.block.TileEntityInventory; +import ihl.IHLMod; +import ihl.utils.IHLFluidTank; +import ihl.utils.IHLUtils; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +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.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidHandler; + +public class SackTileEntity extends TileEntityInventory implements IFluidHandler +{ + private final int maxLeavesHeight=12; + private final int maxLeavesWidth=5; + public float leavesCounter=0F; + private int updateCounter=1100; + private Random rand=new Random(); + private int blobTimer=20; + public byte currentTree = RUBBERTREE; + public final int blobCapacity = 1; + private final static byte RUBBERTREE=0; + private final static byte SPRUCE=1; + public final IHLFluidTank fluidTank = new IHLFluidTank(8000); + public int visibleFluidId = -1; + public int visibleFluidAmount = 1; + + public SackTileEntity() { + super(); + } + + @Override + public List getNetworkedFields() + { + List fields = super.getNetworkedFields(); + fields.add("visibleFluidId"); + fields.add("visibleFluidAmount"); + fields.add("leavesCounter"); + fields.add("currentTree"); + return fields; + } + + @Override + public void readFromNBT(NBTTagCompound nbttagcompound) + { + super.readFromNBT(nbttagcompound); + this.fluidTank.readFromNBT(nbttagcompound.getCompoundTag("fluidTank")); + } + + @Override + public void writeToNBT(NBTTagCompound nbttagcompound) + { + super.writeToNBT(nbttagcompound); + NBTTagCompound fluidTankTag = new NBTTagCompound(); + this.fluidTank.writeToNBT(fluidTankTag); + nbttagcompound.setTag("fluidTank", fluidTankTag); + } + + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { + return false; + } + + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { + return new ItemStack(IHLMod.sackBlock,1); + } + + public boolean enableUpdateEntity() + { + return true; + } + + + @Override + public void updateEntityClient() + { + super.updateEntityClient(); + if(IHLMod.ic2Leaves!=null && IHLMod.ic2Wood!=null) + { + if(this.blobTimer<=0) + { + if(IC2.platform.isRendering()) + { + switch(this.currentTree) + { + case RUBBERTREE: + IHLMod.proxy.spawnParticle(1,worldObj, xCoord+0.5D+mX()*0.5D,yCoord+1.05D,zCoord+0.5D+mZ()*0.5D,-(double)mX()*0.1D,-0.03D,-(double)mZ()*0.1D,0.1F); + break; + case SPRUCE: + IHLMod.proxy.spawnParticle(2,worldObj, xCoord+0.5D+mX()*0.5D,yCoord+1.05D,zCoord+0.5D+mZ()*0.5D,-(double)mX()*0.1D,-0.03D,-(double)mZ()*0.1D,0.1F); + break; + } + } + if(this.fluidTank.getFluidAmount()>=this.fluidTank.getCapacity()) + { + if(IC2.platform.isRendering()) + { + switch(this.currentTree) + { + case RUBBERTREE: + IHLMod.proxy.spawnParticle(1,worldObj, xCoord+0.5D-mX()*0.3D+(rand.nextDouble()-0.5D)*mZ()*0.6D,yCoord+0.8D,zCoord+0.5D-mZ()*0.3D+(rand.nextDouble()-0.5D)*mX()*0.6D,0D,-0.05D,0D,0.1F); + break; + case SPRUCE: + IHLMod.proxy.spawnParticle(2,worldObj, xCoord+0.5D-mX()*0.3D+(rand.nextDouble()-0.5D)*mZ()*0.6D,yCoord+0.8D,zCoord+0.5D-mZ()*0.3D+(rand.nextDouble()-0.5D)*mX()*0.6D,0D,-0.05D,0D,0.1F); + break; + } + } + } + if(this.leavesCounter>1F) + { + this.blobTimer=Math.round(4000F/this.leavesCounter); + } + else + { + this.blobTimer=200; + } + } + else + { + if(this.leavesCounter>1F) + { + this.blobTimer--; + } + } + if(this.updateCounter<1200) + { + this.updateCounter++; + } + } + + } + + + @Override + public void updateEntityServer() + { + super.updateEntityServer(); + if(IHLMod.ic2Leaves!=null && IHLMod.ic2Wood!=null) + { + if(this.blobTimer<=0) + { + { + if(IC2.platform.isSimulating()) + { + switch(this.currentTree) + { + case RUBBERTREE: + this.fluidTank.fill(new FluidStack(FluidRegistry.getFluid("fluidrubbertreesap"), blobCapacity), true); + break; + case SPRUCE: + this.fluidTank.fill(new FluidStack(FluidRegistry.getFluid("spruceresin"), blobCapacity), true); + break; + } + } + } + if(this.leavesCounter>1F) + { + this.blobTimer=Math.round(4000F/this.leavesCounter); + } + else + { + this.blobTimer=200; + } + } + else + { + if(this.leavesCounter>1F) + { + this.blobTimer--; + } + } + if(this.updateCounter<1200) + { + this.updateCounter++; + } + else + { + if(IC2.platform.isSimulating()) + { + this.updateCounter=rand.nextInt(600); + if(checkCorrectPlacing()) + { + countRubberTreeLeaves(); + } + else + { + leavesCounter=0F; + } + IC2.network.get().updateTileEntityField(this, "currentTree"); + IC2.network.get().updateTileEntityField(this, "leavesCounter"); + if(this.fluidTank.getFluid()!=null) + { + + TileEntity te = worldObj.getTileEntity(xCoord, yCoord-1, zCoord); + if(te!=null && te instanceof IFluidHandler) + { + IFluidHandler fte = (IFluidHandler) te; + FluidStack fStack = this.fluidTank.drain(Integer.MAX_VALUE, false); + if(fte.canFill(ForgeDirection.UP, fStack.getFluid())) + { + if(fte.fill(ForgeDirection.UP, fStack, false)>0) + { + int amount = fte.fill(ForgeDirection.UP, fStack, true); + this.fluidTank.drain(amount, true); + } + } + } + } + } + } + if(this.fluidTank.getFluid()!=null && (visibleFluidId!=this.fluidTank.getFluid().getFluid().getID() || Math.abs(visibleFluidAmount-this.fluidTank.getFluidAmount())>20)) + { + visibleFluidId = this.fluidTank.getFluid().getFluid().getID(); + visibleFluidAmount = this.fluidTank.getFluidAmount(); + IC2.network.get().updateTileEntityField(this, "visibleFluidId"); + IC2.network.get().updateTileEntityField(this, "visibleFluidAmount"); + } + else if(this.fluidTank.getFluid()==null && visibleFluidId!=-1) + { + visibleFluidId=-1; + IC2.network.get().updateTileEntityField(this, "visibleFluidId"); + } + } + } + + private boolean checkCorrectPlacing() + { + int xz[]={0,1,0,-1,0}; + Block block, block2; + int meta,meta2; + for(int i =0;i<=3;i++) + { + block=worldObj.getBlock(xCoord+xz[i], yCoord, zCoord+xz[i+1]); + meta=worldObj.getBlockMetadata(xCoord+xz[i], yCoord, zCoord+xz[i+1]); + block2=worldObj.getBlock(xCoord+xz[i], yCoord+1, zCoord+xz[i+1]); + meta2=worldObj.getBlockMetadata(xCoord+xz[i], yCoord+1, zCoord+xz[i+1]); + if( + meta>0 && + meta2>0 && + (block==IHLMod.ic2Wood||block==IHLMod.rubberTreeBlock) && + (block2==IHLMod.ic2Wood||block2==IHLMod.rubberTreeBlock) + ) + { + short newFacing = this.getFacingFromXZ(xz[i], xz[i+1]); + this.setFacing(newFacing); + if(block2==IHLMod.ic2Wood) + { + worldObj.setBlock(xCoord+xz[i], yCoord+1, zCoord+xz[i+1],IHLMod.rubberTreeBlock,newFacing,3); + } + else + { + if(newFacing!=meta2) + { + return false; + } + } + this.currentTree=RUBBERTREE; + return checkGround(); + } + else if( + ((block==Blocks.log && meta==1) || + (block==IHLMod.spruceTreeBlock && meta>0)) && + ((block2==Blocks.log && meta2==1) || + (block2==IHLMod.spruceTreeBlock && meta2>0)) + ) + { + short newFacing = this.getFacingFromXZ(xz[i], xz[i+1]); + this.setFacing(newFacing); + if(block2==Blocks.log) + { + worldObj.setBlock(xCoord+xz[i], yCoord+1, zCoord+xz[i+1],IHLMod.spruceTreeBlock,newFacing,3); + } + else + { + if(newFacing!=meta2) + { + return false; + } + } + this.currentTree=SPRUCE; + return checkGround(); + } + } + return false; + } + + private boolean checkGround() + { + Block block; + int meta; + for(int h=0; h<=this.maxLeavesHeight; h++) + { + block=worldObj.getBlock(xCoord+mX(), yCoord-h, zCoord+mZ()); + meta=worldObj.getBlockMetadata(xCoord+mX(), yCoord-h, zCoord+mZ()); + if(!isLogBlock(block, meta)) + { + if(IHLUtils.isBlockRegisteredInOreDictionaryAs(block, "blockDirt")) + { + return true; + } + else + { + return false; + } + } + else if(meta<=0) + { + return false; + } + } + return false; + } + + private boolean isLogBlock(Block block, int meta) + { + switch(this.currentTree) + { + case RUBBERTREE: + return block==IHLMod.ic2Wood || block==IHLMod.rubberTreeBlock; + case SPRUCE: + return (block==Blocks.log && meta==1) || (block==IHLMod.spruceTreeBlock && meta>0); + } + return false; + } + + private boolean isLeavesBlock(Block block) + { + switch(this.currentTree) + { + case RUBBERTREE: + return block==IHLMod.ic2Leaves; + case SPRUCE: + return block==Blocks.leaves; + } + return false; + } + + private boolean isIncisedLog(Block block) + { + switch(this.currentTree) + { + case RUBBERTREE: + return block==IHLMod.rubberTreeBlock; + case SPRUCE: + return block==IHLMod.spruceTreeBlock; + } + return false; + } + + private void countRubberTreeLeaves() + { + this.leavesCounter=0; + int[][][] leavesMatrix=new int[this.maxLeavesWidth][this.maxLeavesWidth][this.maxLeavesHeight]; + for(int iy=1;iy=2) + { + break; + } + for(int sign=1;sign>=-1;sign-=2) + { + for(int ix=1;ix<=2;ix++) + { + + block=worldObj.getBlock(xCoord+mX()+ix*sign, yCoord+iy, zCoord+mZ()); + if(isLeavesBlock(block)) + { + this.leavesCounter+=worldObj.getLightBrightness(xCoord+mX()+ix*sign, yCoord+iy, zCoord+mZ()); + leavesMatrix[2+ix*sign][2][iy-1]=1; + } + else + { + break; + } + } + for(int iz=1;iz<=2;iz++) + { + block=worldObj.getBlock(xCoord+mX(), yCoord+iy, zCoord+mZ()+iz*sign); + if(isLeavesBlock(block)) + { + this.leavesCounter+=worldObj.getLightBrightness(xCoord+mX(), yCoord+iy, zCoord+mZ()+iz*sign); + leavesMatrix[2][2+iz*sign][iy-1]=1; + } + else + { + break; + } + } + } + for(int signx=1;signx>=-1;signx-=2) + { + for(int signz=1;signz>=-1;signz-=2) + { + if(leavesMatrix[2][2+signz][iy-1]==1||leavesMatrix[2+signx][2][iy-1]==1) + { + block=worldObj.getBlock(xCoord+mX()+signx, yCoord+iy, zCoord+mZ()+signz); + if(isLeavesBlock(block)) + { + this.leavesCounter+=worldObj.getLightBrightness(xCoord+mX()+signx, yCoord+iy, zCoord+mZ()+signz); + leavesMatrix[2+signx][2+signz][iy-1]=1; + } + } + if(leavesMatrix[2+signx*2][2][iy-1]==1||leavesMatrix[2+signx][2+signz][iy-1]==1) + { + block=worldObj.getBlock(xCoord+mX()+signx*2, yCoord+iy, zCoord+mZ()+signz); + if(block==IHLMod.ic2Leaves) + { + this.leavesCounter+=worldObj.getLightBrightness(xCoord+mX()+signx*2, yCoord+iy, zCoord+mZ()+signz); + leavesMatrix[2+signx*2][2+signz][iy-1]=1; + } + } + if(leavesMatrix[2][2+signz*2][iy-1]==1||leavesMatrix[2+signx][2+signz][iy-1]==1) + { + block=worldObj.getBlock(xCoord+mX()+signx, yCoord+iy, zCoord+mZ()+signz*2); + if(isLeavesBlock(block)) + { + this.leavesCounter+=worldObj.getLightBrightness(xCoord+mX()+signx, yCoord+iy, zCoord+mZ()+signz*2); + leavesMatrix[2+signx][2+signz*2][iy-1]=1; + } + } + if(leavesMatrix[2+signx*2][2+signz][iy-1]==1||leavesMatrix[2+signx][2+signz*2][iy-1]==1) + { + block=worldObj.getBlock(xCoord+mX()+signx*2, yCoord+iy, zCoord+mZ()+signz*2); + if(isLeavesBlock(block)) + { + this.leavesCounter+=worldObj.getLightBrightness(xCoord+mX()+signx*2, yCoord+iy, zCoord+mZ()+signz*2); + } + } + } + } + } + else + { + break; + } + } + } + + //1.7.10 API + @Override + public boolean canDrain(ForgeDirection arg0, Fluid arg1) { + return true; + } + + @Override + public boolean canFill(ForgeDirection arg0, Fluid arg1) { + return false; + } + + @Override + public String getInventoryName() { + return "sack"; + } + + 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(); + } + + @Override + public boolean shouldRenderInPass(int pass) + { + return pass==0; + } + + @Override + public FluidStack drain(ForgeDirection arg0, FluidStack arg1, boolean arg2) + { + if(this.canDrain(arg0, arg1.getFluid())) + { + FluidStack fStack = fluidTank.drain(arg1, arg2); + return fStack; + } + return null; + } + + @Override + public FluidStack drain(ForgeDirection arg0, int arg1, boolean arg2) + { + if(this.canDrain(arg0, null)) + { + FluidStack fStack = fluidTank.drain(arg1, arg2); + return fStack; + } + return null; + } + + @Override + public int fill(ForgeDirection arg0, FluidStack arg1, boolean arg2) { + return 0; + } + + @Override + public FluidTankInfo[] getTankInfo(ForgeDirection arg0) { + return new FluidTankInfo[]{this.fluidTank.getInfo()}; + } +} \ No newline at end of file diff --git a/src/main/java/ihl/enviroment/LaserHitMirrorEventHandler.java b/src/main/java/ihl/enviroment/LaserHitMirrorEventHandler.java new file mode 100644 index 0000000..6cd61fc --- /dev/null +++ b/src/main/java/ihl/enviroment/LaserHitMirrorEventHandler.java @@ -0,0 +1,48 @@ +package ihl.enviroment; + +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import ic2.api.event.LaserEvent; +import ic2.core.item.tool.EntityMiningLaser; +import net.minecraft.entity.Entity; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + +public class LaserHitMirrorEventHandler +{ + public LaserHitMirrorEventHandler(){} + + @SubscribeEvent + public void onLaserHit(LaserEvent.LaserHitsBlockEvent event) + { + TileEntity te = event.world.getTileEntity(event.x, event.y, event.z); + if(te instanceof MirrorTileEntity) + { + ForgeDirection mirrorDirection = ForgeDirection.getOrientation(((MirrorTileEntity)te).getFacing()); + Entity ls = event.lasershot; + if((ls.motionX*mirrorDirection.offsetX+ls.motionY*mirrorDirection.offsetY+ls.motionZ*mirrorDirection.offsetZ)<0) + { + if(mirrorDirection.offsetX!=0) + { + ls.motionX=-ls.motionX; + } + if(mirrorDirection.offsetY!=0) + { + ls.motionY=-ls.motionY; + } + if(mirrorDirection.offsetZ!=0) + { + ls.motionZ=-ls.motionZ; + } + if(!event.world.isRemote) + { + EntityMiningLaser tLaser = new EntityMiningLaser(event.world, event.owner, event.range, event.power, event.blockBreaks, event.explosive, 0, 0, ls.posY); + tLaser.setPosition(ls.posX, ls.posY, ls.posZ); + tLaser.setLaserHeading(ls.motionX, ls.motionY, ls.motionZ, 1d); + ls.setDead(); + event.world.spawnEntityInWorld(tLaser); + } + event.setCanceled(true); + } + } + } +} diff --git a/src/main/java/ihl/enviroment/MirrorBlock.java b/src/main/java/ihl/enviroment/MirrorBlock.java new file mode 100644 index 0000000..e996876 --- /dev/null +++ b/src/main/java/ihl/enviroment/MirrorBlock.java @@ -0,0 +1,200 @@ +package ihl.enviroment; +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ihl.IHLCreativeTab; +import ihl.IHLModInfo; +import ihl.utils.IHLUtils; +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.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class MirrorBlock extends Block implements ITileEntityProvider { + + public MirrorBlock(String unlocalizedName1) + { + super(Material.glass); + this.setBlockName(unlocalizedName1); + GameRegistry.registerBlock(this, unlocalizedName1); + this.setCreativeTab(IHLCreativeTab.tab); + this.setHardness(0.3f); + this.setResistance(0.3f); + this.setBlockTextureName("clay"); + } + + public static void init() + { + new MirrorBlock("mirror"); + GameRegistry.registerTileEntity(MirrorTileEntity.class, "mirror"); + } + + @Override + public TileEntity createNewTileEntity(World arg0, int arg1) { + return new MirrorTileEntity(); + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public void setBlockBoundsBasedOnState(IBlockAccess iBlockAccess, int x, int y, int z) + { + TileEntity te = iBlockAccess.getTileEntity(x, y, z); + if(te!=null && te instanceof MirrorTileEntity) + { + MirrorTileEntity ate = (MirrorTileEntity) te; + setBlockBoundsBasedOnFacing(ate.getFacing()); + } + } + + @Override + public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) + { + TileEntity te = world.getTileEntity(x, y, z); + if(te!=null && te instanceof MirrorTileEntity) + { + MirrorTileEntity ate = (MirrorTileEntity) te; + int var2 = ate.getFacing() & 7; + float var6 = 0.5F; + float var7 = 0.09F; + if (var2 == 0) + { + return AxisAlignedBB.getBoundingBox(x+0.5F - var6,y+1.0F - var7,z+ 0.5F - var6, x+0.5F + var6, y+1.0F, z+0.5F + var6); + } + else if (var2 == 1) + { + return AxisAlignedBB.getBoundingBox(x+0.5F - var6,y+ 0.0F,z+ 0.5F - var6, x+0.5F + var6, y+var7, z+0.5F + var6); + } + else if (var2 == 2) + { + return AxisAlignedBB.getBoundingBox(x+0.5F - var6,y+ 0.5F - var6,z+ 1.0F - var7, x+0.5F + var6, y+0.5F + var6, z+1.0F); + } + else if (var2 == 3) + { + return AxisAlignedBB.getBoundingBox(x+0.5F - var6,y+ 0.5F - var6,z+ 0.0F, x+0.5F + var6, y+0.5F + var6, z+var7); + } + else if (var2 == 4) + { + return AxisAlignedBB.getBoundingBox(x+1.0F - var7,y+ 0.5F - var6,z+0.5F - var6, x+1.0F, y+0.5F + var6, z+0.5F + var6); + } + else if (var2 == 5) + { + return AxisAlignedBB.getBoundingBox(x+0.0F,y+ 0.5F - var6, z+0.5F - var6, x+var7, y+0.5F + var6, z+0.5F + var6); + } + } + return null; + } + + private void setBlockBoundsBasedOnFacing(int facing) + { + int var2 = facing & 7; + float var6 = 0.5F; + float var7 = 0.09F; + if (var2 == 0) + { + this.setBlockBounds(0.5F - var6, 1.0F - var7, 0.5F - var6, 0.5F + var6, 1.0F, 0.5F + var6); + } + else if (var2 == 1) + { + this.setBlockBounds(0.5F - var6, 0.0F, 0.5F - var6, 0.5F + var6, var7, 0.5F + var6); + } + else if (var2 == 2) + { + this.setBlockBounds(0.5F - var6, 0.5F - var6, 1.0F - var7, 0.5F + var6, 0.5F + var6, 1.0F); + } + else if (var2 == 3) + { + this.setBlockBounds(0.5F - var6, 0.5F - var6, 0.0F, 0.5F + var6, 0.5F + var6, var7); + } + else if (var2 == 4) + { + this.setBlockBounds(1.0F - var7, 0.5F - var6, 0.5F - var6, 1.0F, 0.5F + var6, 0.5F + var6); + } + else if (var2 == 5) + { + this.setBlockBounds(0.0F, 0.5F - var6, 0.5F - var6, var7, 0.5F + var6, 0.5F + var6); + } + } + + /** + * Sets the block's bounds for rendering it as an item + */ + @Override + public void setBlockBoundsForItemRender() + { + float var1 = 0.5F; + float var2 = 0.5F; + float var3 = 0.05F; + this.setBlockBounds(0.5F - var1, 0.5F - var2, 0.5F - var3, 0.5F + var1, 0.5F + var2, 0.5F + var3); + } + + @Override + public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) + { + int var6 = MathHelper.floor_double(player.rotationPitch * 4.0F / 360.0F + 0.5D) & 3; + int var7 = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; + TileEntity t = world.getTileEntity(x, y, z); + if(t!=null && t instanceof MirrorTileEntity) + { + MirrorTileEntity te = (MirrorTileEntity)t; + if(var6==1) + { + te.setFacing((short) 1); + } + else if(var6==3) + { + te.setFacing((short) 0); + } + else + { + switch(var7) + { + case 0: + te.setFacing((short) 2); + break; + case 1: + te.setFacing((short) 5); + break; + case 2: + te.setFacing((short) 3); + break; + case 3: + te.setFacing((short) 4); + break; + default: + break; + } + } + } + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister par1IconRegister) + { + this.blockIcon = par1IconRegister.registerIcon(IHLModInfo.MODID + ":mirror"); + } + + @Override + public void dropBlockAsItemWithChance(World world, int x, int y, int z, int meta, float chance, int flag) + { + this.dropBlockAsItem(world, x, y, z, IHLUtils.getThisModItemStack("dustGlass")); + } +} diff --git a/src/main/java/ihl/enviroment/MirrorRender.java b/src/main/java/ihl/enviroment/MirrorRender.java new file mode 100644 index 0000000..60bc501 --- /dev/null +++ b/src/main/java/ihl/enviroment/MirrorRender.java @@ -0,0 +1,416 @@ +package ihl.enviroment; + +import java.nio.IntBuffer; +import java.util.Iterator; + +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 org.lwjgl.util.glu.Project; + +import ihl.IHLMod; +import ihl.model.IHLBlockRenderer; +import ihl.utils.IHLRenderUtils; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GLAllocation; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.tileentity.TileEntity; + +public class MirrorRender extends TileEntitySpecialRenderer{ +private int texture=-1; +private int fb=-1; +private static final IntBuffer textureIDBuffer = BufferUtils.createIntBuffer(1); +private static final float zNear = 1.5f;//1.5f +private static final float zFar = 0.1f;//0.1f +private final int textureWidth=512; +private final int textureHeight=512; +private final int[] xdepth; +private final int[] ydepth; +private final int[] textureU; +private final int[] textureV; +private final Minecraft mc; + +public MirrorRender() +{ + xdepth=new int[] {0,0,1,1}; + ydepth=new int[] {0,1,1,0}; + textureU=new int[] {0,0,1,1}; + textureV=new int[]{0,1,1,0}; + mc=Minecraft.getMinecraft(); +} + +public void renderAModelAt(MirrorTileEntity tile, double x, double y, double z, float f) { + float[] mAxis = tile.getMirrorAxis(); + if(texture==-1) + { + GL11.glGenTextures(textureIDBuffer); + texture=textureIDBuffer.get(0); + fb=GL30.glGenFramebuffers(); + GL30.glBindFramebuffer(GL30.GL_FRAMEBUFFER, fb); + GL11.glBindTexture(GL11.GL_TEXTURE_2D, texture); + 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_LINEAR); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR); + int depthBuffer = GL30.glGenRenderbuffers(); + GL30.glBindRenderbuffer(GL30.GL_RENDERBUFFER, depthBuffer); + 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); + 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!"); + } + } + //Show reflection when: + //x>-1 when offsetX==-1 + //x<0 when offsetX==1 + if(tile.shouldReflect && + ((x>-0.8D && mAxis[3]==-1)|| + (x<-0.2 && mAxis[3]==1)|| + (y>-0.8D && mAxis[4]==-1)|| + (y<-0.2D && mAxis[4]==1)|| + (z>-0.8D && mAxis[5]==-1)|| + (z<-0.2D && mAxis[5]==1))) + { + GL30.glBindFramebuffer(GL30.GL_FRAMEBUFFER, fb); + drawReflection(tile, x, y, z, f); + mc.entityRenderer.setupCameraTransform(f, 0); + Minecraft.getMinecraft().getFramebuffer().bindFramebuffer(false); + GL11.glPushMatrix(); + GL11.glTranslatef((float) x, (float) y , (float) z); + defineMeshAndTextureCoordinates(tile); + IHLRenderUtils.instance.enableAmbientLighting(); + drawMirrorFrame(tile); + IHLRenderUtils.instance.disableAmbientLighting(); + RenderHelper.enableStandardItemLighting(); + GL11.glPopMatrix(); + } +} + + @Override + public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8) + { + this.renderAModelAt((MirrorTileEntity)par1TileEntity, par2, par4, par6, par8); + } + + private void drawReflection(MirrorTileEntity tile, double x, double y, double z, float f) + { + GL11.glViewport(0, 0, textureWidth, textureHeight); + GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT); + GL11.glColor4f(1f, 1f, 1f, 1f); + setMirrorView(tile, x, y, z); + IHLRenderUtils.instance.enableAmbientLighting(); + mc.renderGlobal.renderSky(f); + mc.renderGlobal.renderClouds(f); + IHLRenderUtils.instance.disableAmbientLighting(); + setMirrorView(tile, x, y, z); + GL11.glColor4f(1f, 1f, 1f, 1f); + bindTexture(TextureMap.locationBlocksTexture); + GL11.glTranslatef((-tile.xCoord), (-tile.yCoord), (-tile.zCoord)); + if (tile.displayListCache != -1) + { + GL11.glCallList(tile.displayListCache); + if(tile.needRenderUpdate) + { + IHLBlockRenderer.instance.refreshDisplayLists(tile.displayListCache, tile.bwc, tile.chunkCache); + tile.needRenderUpdate=false; + } + } + else if(tile.chunkCache!=null) + { + tile.displayListCache=GLAllocation.generateDisplayLists(1); + IHLBlockRenderer.instance.refreshDisplayLists(tile.displayListCache, tile.bwc, tile.chunkCache); + } + Iterator ientity = tile.reflectedEntity.iterator(); + while(ientity.hasNext()) + { + Entity centity = ientity.next(); + Render render = (Render) IHLMod.proxy.getRenderForEntityClass(centity.getClass()); + if(render!=null) + { + render.doRender(centity, centity.prevPosX, centity.prevPosY, centity.prevPosZ, 1f, f); + GL11.glEnable(GL11.GL_COLOR_MATERIAL); + GL11.glColor4f(1f, 1f, 1f, 1f); + } + } + Iterator itentity = tile.reflectedTileEntity.iterator(); + while(itentity.hasNext()) + { + TileEntity te = itentity.next(); + if(TileEntityRendererDispatcher.instance.hasSpecialRenderer(te)) + { + TileEntitySpecialRenderer specialRenderer = TileEntityRendererDispatcher.instance.getSpecialRenderer(te); + specialRenderer.renderTileEntityAt(te, te.xCoord, te.yCoord, te.zCoord, f); + GL11.glEnable(GL11.GL_COLOR_MATERIAL); + } + } + GL11.glViewport(0, 0, Display.getWidth(), Display.getHeight()); + } + + private void defineMeshAndTextureCoordinates(MirrorTileEntity tile) + { + switch (tile.getFacing()) + { + case 0://up + xdepth[0]=1+tile.reflectExtensionRight; + xdepth[1]=1+tile.reflectExtensionRight; + xdepth[2]=0; + xdepth[3]=0; + ydepth[0]=0; + ydepth[1]=1+tile.reflectExtensionTop; + ydepth[2]=1+tile.reflectExtensionTop; + ydepth[3]=0; + textureU[0]=0; + textureU[1]=0; + textureU[2]=1; + textureU[3]=1; + textureV[0]=0; + textureV[1]=1; + textureV[2]=1; + textureV[3]=0; + break; + case 1://down + xdepth[0]=-tile.reflectExtensionRight; + xdepth[1]=-tile.reflectExtensionRight; + xdepth[2]=1; + xdepth[3]=1; + ydepth[0]=-tile.reflectExtensionTop; + ydepth[1]=1; + ydepth[2]=1; + ydepth[3]=-tile.reflectExtensionTop; + textureU[0]=0; + textureU[1]=0; + textureU[2]=1; + textureU[3]=1; + textureV[0]=0; + textureV[1]=1; + textureV[2]=1; + textureV[3]=0; + break; + case 2: + xdepth[0]=0; + xdepth[1]=0; + xdepth[2]=1+tile.reflectExtensionRight; + xdepth[3]=1+tile.reflectExtensionRight; + ydepth[0]=0; + ydepth[1]=1+tile.reflectExtensionTop; + ydepth[2]=1+tile.reflectExtensionTop; + ydepth[3]=0; + textureU[0]=0; + textureU[1]=0; + textureU[2]=1; + textureU[3]=1; + textureV[0]=0; + textureV[1]=1; + textureV[2]=1; + textureV[3]=0; + break; + case 3: + xdepth[0]=-tile.reflectExtensionRight; + xdepth[1]=1; + xdepth[2]=1; + xdepth[3]=-tile.reflectExtensionRight; + ydepth[0]=0; + ydepth[1]=0; + ydepth[2]=1+tile.reflectExtensionTop; + ydepth[3]=1+tile.reflectExtensionTop; + textureU[0]=1; + textureU[1]=0; + textureU[2]=0; + textureU[3]=1; + textureV[0]=0; + textureV[1]=0; + textureV[2]=1; + textureV[3]=1; + break; + case 4: + xdepth[0]=-tile.reflectExtensionRight; + xdepth[1]=1; + xdepth[2]=1; + xdepth[3]=-tile.reflectExtensionRight; + ydepth[0]=0; + ydepth[1]=0; + ydepth[2]=1+tile.reflectExtensionTop; + ydepth[3]=1+tile.reflectExtensionTop; + textureU[0]=1; + textureU[1]=0; + textureU[2]=0; + textureU[3]=1; + textureV[0]=0; + textureV[1]=0; + textureV[2]=1; + textureV[3]=1; + break; + case 5: + xdepth[0]=0; + xdepth[1]=0; + xdepth[2]=1+tile.reflectExtensionRight; + xdepth[3]=1+tile.reflectExtensionRight; + ydepth[0]=0; + ydepth[1]=1+tile.reflectExtensionTop; + ydepth[2]=1+tile.reflectExtensionTop; + ydepth[3]=0; + textureU[0]=0; + textureU[1]=0; + textureU[2]=1; + textureU[3]=1; + textureV[0]=0; + textureV[1]=1; + textureV[2]=1; + textureV[3]=0; + break; + default: + } + + } + + private void drawMirrorFrame(MirrorTileEntity tile) + { + GL11.glBindTexture(GL11.GL_TEXTURE_2D, texture); + GL11.glColor4f(1f, 1f, 1f, 1f); + GL11.glDisable(GL11.GL_BLEND); + Tessellator tessellator=Tessellator.instance; + tessellator.startDrawingQuads(); + for(int i=0;i bwc = new ArrayList(); + public final List reflectedEntity = new ArrayList(); + public final List reflectedTileEntity = new ArrayList(); + private int bwcListPos=0; + private int reflectedTileEntityListPos=0; + private int reflectionVolumePos=0; + boolean firstTick=true; + public int dnx,dpx,dny,dpy,dnz,dpz; + boolean shouldReflect=true; + int reflectExtensionRight=0; + int reflectExtensionTop=0; + int timer=0; + int blockReflectionUpdateTimer=0; + int reflectionVolumeSize=-1; + AxisAlignedBB reflectionArea; + int displayListCache=-1; + public ChunkCache chunkCache; + public boolean needRenderUpdate=false; + private int minX; + private int maxX; + private int minY; + private int maxY; + private int minZ; + private int maxZ; + private int lastBWCSize; + + public MirrorTileEntity() + {} + + @SuppressWarnings("unchecked") + @Override + public void updateEntityClient() + { + super.updateEntityClient(); + if(this.shouldReflect) + { + int i=0; + for(i=0;i20) + { + boolean isFirst=true; + TileEntity t = worldObj.getTileEntity(xCoord-mXT(),yCoord-mYT(), zCoord-mZT()); + if(t instanceof MirrorTileEntity) + { + if(((MirrorTileEntity)t).getFacing()==this.getFacing()) + { + isFirst=false; + } + } + t = worldObj.getTileEntity(xCoord-mXR(),yCoord-mYR(), zCoord-mZR()); + if(t instanceof MirrorTileEntity) + { + if(((MirrorTileEntity)t).getFacing()==this.getFacing()) + { + isFirst=false; + } + } + if(isFirst) + { + this.shouldReflect=true; + this.reflectExtensionTop=0; + this.reflectExtensionRight=0; + for(int i=1;i<=IHLMod.config.mirrorReflectionRange+2;i++) + { + t = worldObj.getTileEntity(xCoord+mXT()*i,yCoord+mYT()*i, zCoord+mZT()*i); + if(t instanceof MirrorTileEntity && ((MirrorTileEntity)t).getFacing()==this.getFacing()) + { + MirrorTileEntity te = (MirrorTileEntity) t; + te.shouldReflect=false; + this.reflectExtensionTop=i; + } + else + { + break; + } + } + a:for(int i0=1;i0<=IHLMod.config.mirrorReflectionRange+2;i0++) + { + for(int i=0;i<=this.reflectExtensionTop;i++) + { + t = worldObj.getTileEntity(xCoord+mXT()*i+mXR()*i0,yCoord+mYT()*i+mYR()*i0, zCoord+mZT()*i+mZR()*i0); + if(t instanceof MirrorTileEntity && ((MirrorTileEntity)t).getFacing()==this.getFacing()) + { + MirrorTileEntity te = (MirrorTileEntity) t; + te.shouldReflect=false; + } + else + { + break a; + } + } + this.reflectExtensionRight=i0; + } + } + if(this.reflectionArea!=null) + { + this.reflectedEntity.clear(); + this.reflectedEntity.addAll(worldObj.getEntitiesWithinAABB(EntityLivingBase.class, this.reflectionArea)); + this.reflectedEntity.addAll(worldObj.getEntitiesWithinAABB(EntityBoat.class, this.reflectionArea)); + this.reflectedEntity.addAll(worldObj.getEntitiesWithinAABB(EntityItem.class, this.reflectionArea)); + this.reflectedEntity.addAll(worldObj.getEntitiesWithinAABB(EntityMinecart.class, this.reflectionArea)); + } + timer=0; + } + if(firstTick && this.shouldReflect) + { + int ix,iy,iz; + int range=IHLMod.config.mirrorReflectionRange; + ForgeDirection direction = ForgeDirection.getOrientation(this.getFacing()); + bwc.clear(); + { + dpx = direction.offsetX==-1?0:1; + dnx = direction.offsetX==1?0:1; + dpy = direction.offsetY==-1?0:1; + dny = direction.offsetY==1?0:1; + dpz = direction.offsetZ==-1?0:1; + dnz = direction.offsetZ==1?0:1; + reflectionVolumeSize=(range*dnx+range*dpx+dnx)*(range*dny+range*dpy+dny)*(range*dnz+range*dpz+dnz); + reflectionArea = AxisAlignedBB.getBoundingBox(xCoord-range*dnx-1d, yCoord-range*dny-1d, zCoord-range*dnz-1d, xCoord+range*dpx+dnx+1d, yCoord+range*dpy+dny+1d, zCoord+range*dpz+dnz+1d); + minX = xCoord-range*dnx; + maxX = xCoord+range*dpx+dnx; + minY = Math.max(yCoord-range*dny,0); + maxY = Math.min(yCoord+range*dpy+dny,this.worldObj.getActualHeight()); + minZ = zCoord-range*dnz; + maxZ = zCoord+range*dpz+dnz; + chunkCache = new ChunkCache(worldObj, minX, minY, minZ, maxX, maxY, maxZ, 16); + for(ix=minX;ix=0) + { + bwc.add(new BlockWithCoordinates(block, ix, iy, iz, worldObj.getBlockMetadata(ix, iy, iz))); + } + } + + } + } + } + } + lastBWCSize=bwc.size(); + firstTick=false; + } + } + + private boolean isBlockVisible(Block block, int x, int y, int z) + { + if(block instanceof MirrorBlock) + { + ForgeDirection direction = ForgeDirection.getOrientation(this.getFacing()); + int x1=x*direction.offsetX; + int y1=y*direction.offsetY; + int z1=z*direction.offsetZ; + int x2=xCoord*direction.offsetX; + int y2=yCoord*direction.offsetY; + int z2=zCoord*direction.offsetZ; + return !(x1==x2 && y1==y2 && z1==z2); + } + if(block.shouldSideBeRendered(worldObj, x, y-1, z, 0)) + { + return true; + } + if(block.shouldSideBeRendered(worldObj, x, y+1, z, 1)) + { + return true; + } + if(block.shouldSideBeRendered(worldObj, x, y, z-1, 2)) + { + return true; + } + if(block.shouldSideBeRendered(worldObj, x, y, z+1, 3)) + { + return true; + } + if(block.shouldSideBeRendered(worldObj, x-1, y, z, 4)) + { + return true; + } + if(block.shouldSideBeRendered(worldObj, x+1, y, z, 5)) + { + return true; + } + return false; + } + + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { + return false; + } + + @Override + public boolean wrenchCanRemove(EntityPlayer entityPlayer) { + return true; + } + + @Override + public void setFacing(short side) + { + super.setFacing(side); + this.bwc.clear(); + this.firstTick=true; + } + + @Override + public float getWrenchDropRate() { + return 1F; + } + + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { + return IHLUtils.getThisModItemStack("mirror"); + } + + public float[] getMirrorAxis() + { + ForgeDirection direction = ForgeDirection.getOrientation(this.getFacing()); + int mx = direction.offsetX!=0?-1:1; + int my = direction.offsetY!=0?-1:1; + int mz = direction.offsetZ!=0?-1:1; + return new float[] {mx,my,mz,direction.offsetX,direction.offsetY,direction.offsetZ}; + } + + private void checkBWCList() + { + if(++this.bwcListPos>=bwc.size()) + { + this.bwcListPos=0; + } + if(!bwc.isEmpty()) + { + BlockWithCoordinates bwcEntry = bwc.get(bwcListPos); + if(bwcEntry.block!=worldObj.getBlock(bwcEntry.x, bwcEntry.y, bwcEntry.z)) + { + bwc.remove(bwcListPos); + } + } + } + + private void checkTileEntityList() + { + if(++this.reflectedTileEntityListPos>=reflectedTileEntity.size()) + { + this.reflectedTileEntityListPos=0; + } + if(!reflectedTileEntity.isEmpty()) + { + TileEntity entry = reflectedTileEntity.get(reflectedTileEntityListPos); + if(entry==null || entry.isInvalid() || entry!=worldObj.getTileEntity(entry.xCoord, entry.yCoord, entry.zCoord)) + { + reflectedTileEntity.remove(reflectedTileEntityListPos); + } + } + } + + private void checkReflectionVolume() + { + if(++this.reflectionVolumePos>=reflectionVolumeSize) + { + this.reflectionVolumePos=0; + if(lastBWCSize!=bwc.size()) + { + this.needRenderUpdate=true; + lastBWCSize=bwc.size(); + } + } + if(reflectionVolumeSize>0) + { + //reflectionVolumePos = x+y*maxX+z*maxX*maxY; + int z = reflectionVolumePos / (maxX-minX) / (maxY-minY); + int y = (reflectionVolumePos % ((maxX-minX) * (maxY-minY)))/ (maxX-minX); + int x = reflectionVolumePos - y * (maxX-minX) - z * (maxX-minX) * (maxY-minY); + //for example position is 69 volume is 4*5*5=100, therefore z will be 69 / (4*5)=3 + //y will be (69 % (4*5))/4=9/4=2 + //x will be 69 - 2*4 - 3*4*5 = 69-8-60=1 + //for check 1+2*4+3*4*5=1+8+60 + int ix = minX+x; + int iy = minY+y; + int iz = minZ+z; + Block block = worldObj.getBlock(ix, iy, iz); + if(block!=null && !block.isAir(worldObj, ix, iy, iz) && isBlockVisible(block,ix,iy,iz)) + { + TileEntity te = worldObj.getTileEntity(ix, iy, iz); + if(te!=null && !te.isInvalid() && !reflectedTileEntity.contains(te) && TileEntityRendererDispatcher.instance.hasSpecialRenderer(te) && !(te instanceof MirrorTileEntity)) + { + reflectedTileEntity.add(te); + } + if(block.getRenderType()>=0) + { + BlockWithCoordinates bwc1 = new BlockWithCoordinates(block, ix, iy, iz, worldObj.getBlockMetadata(ix, iy, iz)); + if(!bwc.contains(bwc1)) + { + bwc.add(bwc1); + } + } + } + } + } + + private int mXR() + { + switch(this.getFacing()) + { + case 0: + return 1; + case 1: + return -1; + case 2: + return 1; + case 3: + return -1; + default: + return 0; + } + } + + private int mYR() + { + return 0; + } + + private int mZR() + { + switch(this.getFacing()) + { + case 4: + return -1; + case 5: + return 1; + default: + return 0; + } + } + + private int mXT() + { + return 0; + } + + private int mYT() + { + switch(this.getFacing()) + { + case 2: + return 1; + case 3: + return 1; + case 4: + return 1; + case 5: + return 1; + default: + return 0; + } + } + + private int mZT() + { + switch(this.getFacing()) + { + case 0: + return 1; + case 1: + return -1; + default: + return 0; + } + } + + @Override + public AxisAlignedBB getRenderBoundingBox() + { + double xMinD=(double)this.xCoord-this.reflectExtensionRight*Math.abs(this.mXR())-this.reflectExtensionTop*Math.abs(this.mXT()); + double xMaxD=(double)this.xCoord+this.reflectExtensionRight*Math.abs(this.mXR())+this.reflectExtensionTop*Math.abs(this.mXT())+1d; + double yMinD=(double)this.yCoord-this.reflectExtensionRight*Math.abs(this.mYR())-this.reflectExtensionTop*Math.abs(this.mYT()); + double yMaxD=(double)this.yCoord+this.reflectExtensionRight*Math.abs(this.mYR())+this.reflectExtensionTop*Math.abs(this.mYT())+1d; + double zMinD=(double)this.zCoord-this.reflectExtensionRight*Math.abs(this.mZR())-this.reflectExtensionTop*Math.abs(this.mZT()); + double zMaxD=(double)this.zCoord+this.reflectExtensionRight*Math.abs(this.mZR())+this.reflectExtensionTop*Math.abs(this.mZT())+1d; + return AxisAlignedBB.getBoundingBox(xMinD, yMinD, zMinD, xMaxD, yMaxD, zMaxD); + } + + @Override + public boolean shouldRenderInPass(int pass) + { + return pass==0; + } +} \ No newline at end of file diff --git a/src/main/java/ihl/explosion/ChunkAndWorldLoadEventHandler.java b/src/main/java/ihl/explosion/ChunkAndWorldLoadEventHandler.java new file mode 100644 index 0000000..c2f7e0b --- /dev/null +++ b/src/main/java/ihl/explosion/ChunkAndWorldLoadEventHandler.java @@ -0,0 +1,59 @@ +package ihl.explosion; + +import java.util.Iterator; +import java.util.Set; + +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import ihl.IHLMod; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.Explosion; + +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[] directionMask = new int[3]; + Iterator bwArrayI = bwArraySet.iterator(); + Integer[] bwArray = null; + while (bwArrayI.hasNext()) { + bwArray = bwArrayI.next(); + directionMask[0] = bwArray[5]; + directionMask[1] = bwArray[6]; + directionMask[2] = bwArray[7]; + Explosion explosion = new Explosion(event.world, null, bwArray[1], bwArray[2], bwArray[3], 100f); + IHLMod.explosionHandler.breakBlocksAndGetDescendants(event.world, bwArray[1], bwArray[2], + bwArray[3], explosion, bwArray[0], bwArray[4], directionMask); + } + } + } + } + + @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/src/main/java/ihl/explosion/DetonatorMiniGUI.java b/src/main/java/ihl/explosion/DetonatorMiniGUI.java new file mode 100644 index 0000000..4a93050 --- /dev/null +++ b/src/main/java/ihl/explosion/DetonatorMiniGUI.java @@ -0,0 +1,82 @@ +package ihl.explosion; + +import java.awt.event.KeyEvent; + +import org.lwjgl.opengl.GL11; + +import ihl.IHLMod; +import ihl.interfaces.ItemMiniGUI; +import ihl.utils.IHLUtils; +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; + +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 + TEXT_BOX_POSX, + yPos + TEXT_BOX_POSY, TEXT_BOX_WIDTH, 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, HEIGHT); + int runnerXPos = xPos + 5 + 114 * detonator_delay / 1350; + this.guiBase.drawTexturedModalRect(runnerXPos, yPos + 34, 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 + UNITS_LABEL_POSX, yPos + 18, + 0xFFCC00); + } + + @Override + public boolean handleMouseClick(int mouseX, int mouseY, int mouseButton) { + if (mouseX >= xPos + 5 && mouseX <= xPos + 119 && mouseY >= yPos + RUNNER_POSY - 1 && mouseY <= yPos + HEIGHT) { + this.detonator_delay = Math.max(1, Math.min(1350, (mouseX - xPos - 5) * 1350 / 114)); + this.detonatorDelayTextField.setText(Integer.toString(detonator_delay)); + } + if (mouseX >= xPos + TEXT_BOX_POSX && mouseX <= xPos + TEXT_BOX_POSX + TEXT_BOX_WIDTH && mouseY >= yPos + 3 + && mouseY <= yPos + 3 + 11) { + this.detonatorDelayTextField.setFocused(true); + } + return mouseX >= xPos && mouseX <= xPos + 202 && mouseY >= yPos && mouseY <= yPos + HEIGHT; + } + + @Override + public boolean handleKeyTyped(char characterTyped, int keyIndex) { + this.detonatorDelayTextField.textboxKeyTyped(characterTyped, keyIndex); + // 28 - enter; 156 - numpad enter + if (keyIndex == KeyEvent.VK_ACCEPT || keyIndex == KeyEvent.VK_ENTER || keyIndex == 28 || keyIndex == 156) { + 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/src/main/java/ihl/explosion/ExplosionEntityFX.java b/src/main/java/ihl/explosion/ExplosionEntityFX.java new file mode 100644 index 0000000..ffa91fa --- /dev/null +++ b/src/main/java/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 = Math.min((int)(r2*radius/32)+64,512); + 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 startVectors = new HashSet(); + public final int[][] directionMasks = new int[8][3]; + public final int bits = IHLMod.config.explosionVectorSizeBits; + private final int maxValue = (1 << bits) - 1; + public final int halfValue = (1 << bits - 1) - 1; + private final int maxArraySize = 1 << bits * 3; +// public final int[][] vectors = new int[maxArraySize][2]; + public final int[][] vectors = new int[maxArraySize][0]; + private final Set chunksToUpdate = new HashSet(64); + private final Map cachedDrops = new HashMap(128); + final Map blastWaveByDimensionId = new HashMap(); + private final Map cachedEntities = new HashMap(); + private final Random random = new Random(); + + public ExplosionVectorBlockV2() { + this.precalculateExplosion(); + startVectors.add(0); + 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 }; + } + + public int encodeXYZ(int x, int y, int z) { + return x << bits * 2 | y << bits | z; + } + + public int[] decodeXYZ(int l) { + return new int[] { l >> bits * 2, l >> bits & maxValue, l & maxValue }; + } + + public void precalculateExplosion() { + for (int levelRadius = 1; levelRadius <= this.maxValue; levelRadius++) + for (int ix = 0; ix <= levelRadius; ix++) + for (int iy = 0; iy <= levelRadius; iy++) { + for (int iz = (ix == levelRadius || iy == levelRadius) ? 0 : levelRadius; iz <= levelRadius; iz++) { + int vxyz = encodeXYZ(ix, iy, iz); + int[] prevXYZ = new int[] { ix, iy, iz }; + reduceCoordinate(prevXYZ, levelRadius); + int pvxyz = encodeXYZ(prevXYZ[0], prevXYZ[1], prevXYZ[2]); + findFreeSpace(pvxyz, vxyz); + } + } + } + + private void findFreeSpace(int pvxyz, int vxyz) { + int[] nV = new int[vectors[pvxyz].length+1]; + for(int i=0;i=pxyz[0] && y>=pxyz[1] && z>=pxyz[2]){ + x-=rx; + y-=ry; + z-=rz; + } + pxyz[0]=x<0?0:(int)x; + pxyz[1]=y<0?0:(int)y; + pxyz[2]=z<0?0:(int)z; + } + + public void breakBlocksAndGetDescendants(World world, int sourceX, int sourceY, int sourceZ, Explosion explosion, + int ev, int power, int[] directionMask) { + power = this.getNewPowerAndProcessBlocks(world, ev, sourceX, sourceY, sourceZ, explosion, power, directionMask); + power = (int) (power * 0.94) - 1; + if (power > 1) { + if (this.vectors[ev].length==0) { + int[] xyz = decodeXYZ(ev); + int xb = xyz[0] >> bits - 1; + int yb = xyz[1] >> bits - 1; + int zb = xyz[2] >> bits - 1; + int hashb = xb << 2 | yb << 1 | zb; + xyz[0] -= xb * halfValue; + xyz[1] -= yb * halfValue; + xyz[2] -= zb * halfValue; + if (hashb == 0 || xb > 1 || yb > 1 || zb > 1) { + throw new ArithmeticException("End vectors shall be higher than half value"); + } + int ev2 = encodeXYZ(xyz[0], xyz[1], xyz[2]); + breakBlocksAndGetDescendants(world, sourceX + xb * halfValue * directionMask[0], + sourceY + yb * halfValue * directionMask[1], sourceZ + zb * halfValue * directionMask[2], + explosion, ev2, power, directionMask); + } else { + for (int d1 : this.vectors[ev]) { + breakBlocksAndGetDescendants(world, sourceX, sourceY, sourceZ, explosion, d1, power, + directionMask); + } + } + } + } + + 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 remainingPower = this.tryDestroyBlock(world, absX, absY, absZ, sourceX, sourceY, sourceZ, power1, + explosion); + return remainingPower; + } 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 tryDestroyBlock(World world, int absX, int absY, int absZ, int sourceX, int sourceY, int sourceZ, + int power, Explosion explosion) { + Chunk chunk = world.getChunkProvider().provideChunk(absX >> 4, absZ >> 4); + ExtendedBlockStorage ebs = this.getEBS(chunk, absX, absY, absZ); + if (ebs == null) { + return power; + } else { + Block block = ebs.getBlockByExtId(absX & 15, absY & 15, absZ & 15); + if (block.getBlockHardness(world, absX, absY, absZ) < 0) { + return 0; + } else if (absX == sourceX && absY == sourceY && absZ == sourceZ) { + 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); + } + return power; + } else { + int remainingPower = power + - (int) (block.getExplosionResistance(null, world, absX, absY, absZ, sourceX, sourceY, sourceZ) + * 10f + 0.5f); + if (remainingPower >= 0) { + 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); + } + List dropsList = block.getDrops(world, absX, absY, absZ, + ebs.getExtBlockMetadata(absX & 15, absY & 15, absZ & 15), 0); + Iterator drops = dropsList.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[] entities = this.getFromOrCreateCache(world, ebs, absX, absY, absZ); + if (entities != null && entities[array_index] != null) { + entities[array_index].attackEntityFrom(DamageSource.setExplosionSource(explosion), power / 10f); + } + } else { + block.onNeighborBlockChange(world, absX, absY, absZ, block); + if (random.nextInt(8) == 0) { + if ((++absY & 15) != 0) { + 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)) { + this.placeDrops(world, absX, absY, absZ); + } + } + } + } + return remainingPower; + } + } + } + + public Entity[] getFromOrCreateCache(World world, ExtendedBlockStorage ebs, int absX, int absY, int absZ) { + Entity[] entities = this.cachedEntities.get(ebs); + if (entities == null) { + Chunk chunk = world.getChunkProvider().provideChunk(absX >> 4, absZ >> 4); + List eList = this.getEntityList(chunk, absX, absY, absZ); + if (eList != null && !eList.isEmpty()) { + entities = new Entity[4096]; + Iterator eListI = eList.iterator(); + this.cachedEntities.put(ebs, entities); + 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 & 15; + int ry = entityY & 15; + int rz = entityZ & 15; + int array_index = ry << 8 | rz << 4 | rx; + entities[array_index] = entity; + } + } + } + return entities; + } + + 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]; + } + + private void placeDrops(World world, int x, int y, int z) { + Iterator> di = this.cachedDrops.entrySet().iterator(); + if (di.hasNext()) { + Entry cde = di.next(); + while (di.hasNext()) { + cde = di.next(); + } + 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(); + } 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) { + Iterator ci = this.chunksToUpdate.iterator(); + while (ci.hasNext()) { + Chunk chunk = ci.next(); + chunk.generateSkylightMap(); + Arrays.fill(chunk.updateSkylightColumns, true); + chunk.func_150804_b(false); + } + 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)); + } + } + this.chunksToUpdate.clear(); + } + + public void doExplosion(World world, int sourceX, int sourceY, int sourceZ, final Set startVectors1, + int startPower, int[] directionMask, Explosion explosion) { + for (int sv : startVectors1) { + this.breakBlocksAndGetDescendants(world, sourceX - (directionMask[0] < 0 ? 1 : 0), + sourceY - (directionMask[1] < 0 ? 1 : 0), sourceZ - (directionMask[2] < 0 ? 1 : 0), explosion, sv, + startPower, directionMask); + } + // Free and clean resources + this.cachedEntities.clear(); + } + + public void doExplosion(World world, int sourceX, int sourceY, int sourceZ, final Set startVectors1, + int startPower) { + IHLMod.log.info("Starting explosion server"); + Explosion explosion = new Explosion(world, null, sourceX, sourceY, sourceZ, 100f); + if (!MinecraftForge.EVENT_BUS.post(new ExplosionEvent.Start(world, explosion))) { + for (int[] directionMask : directionMasks) { + this.doExplosion(world, sourceX, sourceY, sourceZ, startVectors1, startPower, directionMask, explosion); + } + sendChunkUpdateToPlayersInExplosionAffectedZone(world, sourceX, sourceY, sourceZ); + for (Entry entry : this.cachedDrops.entrySet()) { + IHLEntityFallingPile fallingPile = new IHLEntityFallingPile(world); + fallingPile.setPosition(sourceX + 0.5d, sourceY + 0.5d, sourceZ + 0.5d); + fallingPile.setEntityItemStack(entry.getValue()); + fallingPile.setVelocity(random.nextDouble() - 0.5d, random.nextDouble() * 2, + random.nextDouble() - 0.5d); + world.spawnEntityInWorld(fallingPile); + } + this.cachedDrops.clear(); + } + } +} \ No newline at end of file diff --git a/src/main/java/ihl/explosion/ExplosiveBlock.java b/src/main/java/ihl/explosion/ExplosiveBlock.java new file mode 100644 index 0000000..d6b1c71 --- /dev/null +++ b/src/main/java/ihl/explosion/ExplosiveBlock.java @@ -0,0 +1,252 @@ +package ihl.explosion; + +import java.util.List; + +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ic2.core.IC2; +import ihl.IHLCreativeTab; +import ihl.IHLModInfo; +import ihl.items_blocks.IHLItemBlock; +import ihl.processing.metallurgy.MuffleFurnanceTileEntity; +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.Blocks; +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.Explosion; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class ExplosiveBlock extends Block implements ITileEntityProvider{ + + IIcon[] textures = new IIcon[6]; + + public ExplosiveBlock() + { + super(Material.tnt); + this.setCreativeTab(IHLCreativeTab.tab); + this.setBlockName("ihlExplosive"); + this.setHardness(2F); + this.setResistance(1F); + } + + @Override + @SuppressWarnings({ "rawtypes", "unchecked" }) + public void getSubBlocks(Item item, CreativeTabs par2CreativeTabs, List itemList) + { + ItemStack result = new ItemStack(item); + result.stackTagCompound=new NBTTagCompound(); + result.stackTagCompound.setInteger("explosionType", 1);//0 - IC2; 1- IHL + result.stackTagCompound.setInteger("explosionPower", 31000); + 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 + @SuppressWarnings("rawtypes") + 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); + } + + public static void init() + { + GameRegistry.registerBlock(new ExplosiveBlock(), IHLItemBlock.class,"ihlExplosive"); + GameRegistry.registerTileEntity(ExplosiveTileEntity.class, "explosiveTileEntity"); + } + + @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 + ":explosiveBlockSide"); + this.textures[0] = par1IconRegister.registerIcon(IHLModInfo.MODID + ":explosiveBlockBottom"); + this.textures[1] = par1IconRegister.registerIcon(IHLModInfo.MODID + ":explosiveBlockTop"); + this.textures[2] = this.textures[3] = this.textures[4] = this.textures[5] = this.blockIcon; + } + + @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) + { + return ((ExplosiveTileEntity)te).ignite(player); + } + return false; + } + + @Override + public void onNeighborBlockChange(World world, int x, int y, int z, Block block) + { + TileEntity te = world.getTileEntity(x,y,z); + if(IC2.platform.isSimulating() && te instanceof ExplosiveTileEntity) + { + int[] xyz = {0,0,1,0,0,-1,0,0}; + for(int i=2;i 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/src/main/java/ihl/explosion/ExplosiveTileEntity.java b/src/main/java/ihl/explosion/ExplosiveTileEntity.java new file mode 100644 index 0000000..b211d3b --- /dev/null +++ b/src/main/java/ihl/explosion/ExplosiveTileEntity.java @@ -0,0 +1,78 @@ +package ihl.explosion; + +import ic2.core.IC2; +import ihl.IHLMod; +import ihl.utils.IHLMathUtils; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.oredict.OreDictionary; + +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.doExplosion(worldObj, xCoord, yCoord, zCoord, IHLMod.explosionHandler.startVectors, + power); + 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) { + for (int oid : OreDictionary.getOreIDs(player.getCurrentEquippedItem())) { + if (OreDictionary.getOreName(oid).matches("toolLighter")) { + ignite(); + return false; + } + } + } + return true; + } + + 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/src/main/java/ihl/explosion/GroundRemoverItem.java b/src/main/java/ihl/explosion/GroundRemoverItem.java new file mode 100644 index 0000000..ddbc884 --- /dev/null +++ b/src/main/java/ihl/explosion/GroundRemoverItem.java @@ -0,0 +1,105 @@ +package ihl.explosion; + +import java.util.HashSet; +import java.util.List; +import java.util.Random; +import java.util.Set; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ihl.IHLCreativeTab; +import ihl.IHLMod; +import ihl.IHLModInfo; +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; + +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/src/main/java/ihl/explosion/IHLEntityFallingPile.java b/src/main/java/ihl/explosion/IHLEntityFallingPile.java new file mode 100644 index 0000000..79973d8 --- /dev/null +++ b/src/main/java/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 getDrops(World world, int x, int y, int z, int meta, int fortune) { + return new ArrayList(); + } +} diff --git a/src/main/java/ihl/explosion/PileBlockRender.java b/src/main/java/ihl/explosion/PileBlockRender.java new file mode 100644 index 0000000..c5c8060 --- /dev/null +++ b/src/main/java/ihl/explosion/PileBlockRender.java @@ -0,0 +1,285 @@ +package ihl.explosion; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; +import cpw.mods.fml.client.registry.RenderingRegistry; +import ihl.utils.IHLMathUtils; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraftforge.common.util.ForgeDirection; + +public class PileBlockRender implements ISimpleBlockRenderingHandler { + public static int renderId; + public final PileTileEntityRender pileTileEntityRender; + + public PileBlockRender() { + renderId = RenderingRegistry.getNextAvailableRenderId(); + pileTileEntityRender = new PileTileEntityRender(this); + } + + @Override + public int getRenderId() { + return renderId; + } + + @Override + public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderblocks) { + Tessellator tessellator = Tessellator.instance; + block.setBlockBoundsForItemRender(); + renderblocks.setRenderBoundsFromBlock(block); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderblocks.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, + renderblocks.getBlockIconFromSideAndMetadata(block, 0, metadata)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderblocks.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, + renderblocks.getBlockIconFromSideAndMetadata(block, 1, metadata)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderblocks.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, + renderblocks.getBlockIconFromSideAndMetadata(block, 2, metadata)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderblocks.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, + renderblocks.getBlockIconFromSideAndMetadata(block, 3, metadata)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderblocks.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, + renderblocks.getBlockIconFromSideAndMetadata(block, 4, metadata)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderblocks.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, + renderblocks.getBlockIconFromSideAndMetadata(block, 5, metadata)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + + @Override + public boolean renderWorldBlock(IBlockAccess blockAccess, int x, int y, int z, Block block, int meta, + RenderBlocks blockRenderer) { + TileEntity te = blockAccess.getTileEntity(x, y, z); + if (te instanceof PileTileEntity) { + PileTileEntity pte = (PileTileEntity) te; + long itemHash = getItemStackHash(pte.content); + if (this.pileTileEntityRender.subIconIdMap.containsKey(itemHash)) { + Tessellator tessellator = Tessellator.instance; + int subIconId = this.pileTileEntityRender.subIconIdMap.get(itemHash); + int[][][] brightness = new int[3][3][3]; + this.generateBrightnessMatrix(blockAccess, x, y, z, brightness); + tessellator.setColorOpaque_F(1f, 1f, 1f); + boolean[] blocksViewAround = this.getBlocksViewAround(blockAccess, x, y, z); + if (blocksViewAround[0] && blocksViewAround[1] && blocksViewAround[2] && blocksViewAround[3]) { + this.addFlatTop(tessellator, x, y, z, brightness, subIconId); + } else if (!blocksViewAround[0] && blocksViewAround[1] && blocksViewAround[2] && blocksViewAround[3]) { + this.addSlope(tessellator, x, y, z, 0, brightness, subIconId); + } else if (blocksViewAround[0] && !blocksViewAround[1] && blocksViewAround[2] && blocksViewAround[3]) { + this.addSlope(tessellator, x, y, z, 1, brightness, subIconId); + } else if (blocksViewAround[0] && blocksViewAround[1] && !blocksViewAround[2] && blocksViewAround[3]) { + this.addSlope(tessellator, x, y, z, 2, brightness, subIconId); + } else if (blocksViewAround[0] && blocksViewAround[1] && blocksViewAround[2] && !blocksViewAround[3]) { + this.addSlope(tessellator, x, y, z, 3, brightness, subIconId); + } + // 2-sided piramid + else if (blocksViewAround[0] && blocksViewAround[1] && !blocksViewAround[2] && !blocksViewAround[3]) { + this.addTwoSidedPyramid(tessellator, x, y, z, 2, brightness, subIconId); + } else if (!blocksViewAround[0] && blocksViewAround[1] && blocksViewAround[2] && !blocksViewAround[3]) { + this.addTwoSidedPyramid(tessellator, x, y, z, 3, brightness, subIconId); + } else if (!blocksViewAround[0] && !blocksViewAround[1] && blocksViewAround[2] && blocksViewAround[3]) { + this.addTwoSidedPyramid(tessellator, x, y, z, 0, brightness, subIconId); + } else if (blocksViewAround[0] && !blocksViewAround[1] && !blocksViewAround[2] && blocksViewAround[3]) { + this.addTwoSidedPyramid(tessellator, x, y, z, 1, brightness, subIconId); + } else { + this.addPyramid(tessellator, x, y, z, brightness, subIconId); + } + if (!blockAccess.getBlock(x, y - 1, z).isOpaqueCube()) { + this.addBottom(tessellator, x, y, z, brightness, subIconId); + } + } + return true; + } else { + return false; + } + } + + private boolean[] getBlocksViewAround(IBlockAccess blockAccess, int x, int y, int z) { + // +Z + // ^ + // [ ][0][ ] + // [3][x][1] ->+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, int subIconId) { + double[][] quad1 = new double[4][3]; + quad1[0] = new double[] { 0D, 0D, 1D }; + quad1[1] = new double[] { 0D, 0D, 0D }; + quad1[2] = new double[] { 1D, 0D, 0D }; + quad1[3] = new double[] { 1D, 0D, 1D }; + this.addQuad(tessellator, quad1, x, y, z, ForgeDirection.UP, brightness, subIconId); + } + + private void addFlatTop(Tessellator tessellator, int x, int y, int z, int[][][] brightness, int subIconId) { + double[][] quad1 = new double[4][3]; + double height = 0.9D; + quad1[0] = new double[] { 1D, height, 0D }; + quad1[1] = new double[] { 0D, height, 0D }; + quad1[2] = new double[] { 0D, height, 1D }; + quad1[3] = new double[] { 1D, height, 1D }; + this.addQuad(tessellator, quad1, x, y, z, ForgeDirection.UP, brightness, subIconId); + } + + private void addSlope(Tessellator tessellator, int x, int y, int z, int rotation, + int[][][] brightness, int subIconId) { + double[][] quad = new double[4][3]; + quad[0] = new double[] { 1D,1D, 0D }; // +X -Z + quad[1] = new double[] { 0D, 1D, 0D }; // -X -Z + quad[2] = new double[] { 0D, 0D, 1D }; // -X +Z + quad[3] = new double[] { 1D, 0D, 1D }; + while (rotation-- > 0) { + rotateQuadByYAxis(quad); + } + this.addQuad(tessellator, quad, x, y, z, ForgeDirection.UP, brightness, subIconId); + } + + private void addTwoSidedPyramid(Tessellator tessellator, int x, int y, int z, int rotation, + int[][][] brightness, int subIconId) { + double[][] quad = new double[4][3]; + quad[0] = new double[] { 1D, 0D, 0D }; // +X -Z + quad[1] = new double[] { 0D, 1D, 0D }; // -X -Z + quad[2] = new double[] { 0D, 0D, 1D }; // -X +Z + quad[3] = new double[] { 1D, 0D, 1D }; + while (rotation-- > 0) { + rotateQuadByYAxis(quad); + } + this.addQuad(tessellator, quad, x, y, z, ForgeDirection.UP, brightness, subIconId); + } + + private void addPyramid(Tessellator tessellator, int x, int y, int z, int[][][] brightness, int subIconId) { + double[][] quad1 = new double[4][3]; + double[][] quad2 = new double[4][3]; + double pileHeight = 0.3D; + quad1[0] = new double[] { 1D, 0D, 1D }; + quad1[1] = new double[] { 1D, 0D, 0D }; + quad1[2] = new double[] { 0D, 0D, 0D }; + quad1[3] = new double[] { 0.5D, pileHeight, 0.5D }; + quad2 = copyAndRotateQuadByYAxis(quad1,2); + this.addQuad(tessellator, quad1, x, y, z, ForgeDirection.UP, brightness, subIconId); + this.addQuad(tessellator, quad2, x, y, z, ForgeDirection.UP, brightness, subIconId); + } + + private void rotateQuadByYAxis(double[][] quad) { + for (double[] v : quad) { + double newV2 = 1 - v[0]; + v[0] = v[2]; + v[2] = newV2; + } + } + + private double[][] copyAndRotateQuadByYAxis(double[][] quad, int rotation) { + double[][] quadOut = new double[4][3]; + for (int i = 0; i < quad.length * 3; i++) { + quadOut[i / 3][i % 3] = quad[i / 3][i % 3]; + } + + while (rotation-- > 0) { + rotateQuadByYAxis(quadOut); + } + return quadOut; + } + + private void addQuad(Tessellator tessellator, double[][] quad, int x, int y, int z, ForgeDirection uvmapping, + int[][][] brightness, int subIconId) { + int iu = 0; + int iv = 2; + if (uvmapping.offsetY == 0) { + iv = 1; + if (uvmapping.offsetZ == 0) { + iu = 2; + } + } + float[] normal = IHLMathUtils.get_triangle_normal(quad); + float minu = pileTileEntityRender.getSubIconMinU(subIconId); + float minv = pileTileEntityRender.getSubIconMinV(subIconId); + float du = pileTileEntityRender.getSubIconDU(subIconId); + float dv = pileTileEntityRender.getSubIconDV(subIconId); + + double u1 = minu + quad[0][iu] * du; + double u2 = minu + quad[1][iu] * du; + double u3 = minu + quad[2][iu] * du; + double u4 = minu + quad[3][iu] * du; + double v1 = minv + quad[0][iv] * dv; + double v2 = minv + quad[1][iv] * dv; + double v3 = minv + quad[2][iv] * dv; + double v4 = minv + quad[3][iv] * dv; + + tessellator.setNormal(normal[0], normal[1], normal[2]); + tessellator.setBrightness(this.getBrightness(quad[0], brightness)); + tessellator.addVertexWithUV(x + quad[0][0], y + quad[0][1], z + quad[0][2], u1, v1); + tessellator.setBrightness(this.getBrightness(quad[1], brightness)); + tessellator.addVertexWithUV(x + quad[1][0], y + quad[1][1], z + quad[1][2], u2, v2); + tessellator.setBrightness(this.getBrightness(quad[2], brightness)); + tessellator.addVertexWithUV(x + quad[2][0], y + quad[2][1], z + quad[2][2], u3, v3); + tessellator.setBrightness(this.getBrightness(quad[3], brightness)); + tessellator.addVertexWithUV(x + quad[3][0], y + quad[3][1], z + quad[3][2], u4, v4); + } + + 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; + } +} diff --git a/src/main/java/ihl/explosion/PileTileEntity.java b/src/main/java/ihl/explosion/PileTileEntity.java new file mode 100644 index 0000000..67f430a --- /dev/null +++ b/src/main/java/ihl/explosion/PileTileEntity.java @@ -0,0 +1,78 @@ +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()); + if (checkAndFall()) { + Minecraft.getMinecraft().renderGlobal.markBlockForRenderUpdate(xCoord, yCoord, zCoord); + } + } +} diff --git a/src/main/java/ihl/explosion/PileTileEntityRender.java b/src/main/java/ihl/explosion/PileTileEntityRender.java new file mode 100644 index 0000000..56fc72f --- /dev/null +++ b/src/main/java/ihl/explosion/PileTileEntityRender.java @@ -0,0 +1,187 @@ +package ihl.explosion; + +import java.util.HashMap; +import java.util.Map; +import java.util.Random; + +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; +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; + +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 subIconIdMap = new HashMap(); + 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 (!subIconIdMap.containsKey(hash)) { + + subIconIdMap.put(hash, ++nextAvailableId); + this.preparetexture(); + this.drawTexture(tile, nextAvailableId); + Minecraft.getMinecraft().entityRenderer.setupCameraTransform(f, 0); + Minecraft.getMinecraft().getFramebuffer().bindFramebuffer(false); + tile.updateBlockRender(); + } + } + } + + private void generateFrameBuffer() { + fb = GL30.glGenFramebuffers(); + this.preparetexture(); + 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() { + GL30.glBindFramebuffer(GL30.GL_FRAMEBUFFER, fb); + int texture = Minecraft.getMinecraft().renderEngine.getTexture(TextureMap.locationBlocksTexture) + .getGlTextureId(); + GL11.glBindTexture(GL11.GL_TEXTURE_2D, texture); + GL30.glFramebufferTexture2D(GL30.GL_FRAMEBUFFER, GL30.GL_COLOR_ATTACHMENT0, GL11.GL_TEXTURE_2D, texture, 0); + } + + private void drawTexture(PileTileEntity tile, int subIconId) { + IIcon picon = PileBlock.instance.getIcon(0, 0); + float minu = picon.getMinU(); + float minv = picon.getMinV(); + float maxu = picon.getMaxU(); + float maxv = picon.getMaxV(); + int iconwidth = picon.getIconWidth(); + int iconheight = picon.getIconHeight(); + float du = maxu - minu; + float dv = maxv - minv; + int iconNumU = picon.getIconWidth()/this.textureWidth; + int posu = (int) (minu * iconwidth / du) + subIconId % iconNumU * textureWidth; + int posv = (int) (minv * iconheight / dv) + subIconId / iconNumU * textureHeight; + + GL11.glViewport(posu, posv, textureWidth, textureHeight); + 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); + 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()); + } + + public float getSubIconMinU(int index) + { + IIcon picon = PileBlock.instance.getIcon(0, 0); + int iconNumU = picon.getIconWidth()/this.textureWidth; + float minu = picon.getMinU(); + float maxu = picon.getMaxU(); + float du = (maxu - minu)/iconNumU; + return minu + index%iconNumU*du; + } + + public float getSubIconMinV(int index) + { + IIcon picon = PileBlock.instance.getIcon(0, 0); + int iconNumU = picon.getIconWidth()/this.textureWidth; + int iconNumV = picon.getIconHeight()/this.textureHeight; + float minv = picon.getMinV(); + float maxv = picon.getMaxV(); + float dv = (maxv - minv)/iconNumV; + return minv + index/iconNumU*dv; + } + public float getSubIconDU(int index) + { + IIcon picon = PileBlock.instance.getIcon(0, 0); + int iconNumU = picon.getIconWidth()/this.textureWidth; + float minu = picon.getMinU(); + float maxu = picon.getMaxU(); + float du = (maxu - minu)/iconNumU; + return du; + } + + public float getSubIconDV(int index) + { + IIcon picon = PileBlock.instance.getIcon(0, 0); + int iconNumV = picon.getIconHeight()/this.textureHeight; + float minv = picon.getMinV(); + float maxv = picon.getMaxV(); + float dv = (maxv - minv)/iconNumV; + return dv; + } + + + + @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/src/main/java/ihl/explosion/WorldSavedDataBlastWave.java b/src/main/java/ihl/explosion/WorldSavedDataBlastWave.java new file mode 100644 index 0000000..73019b9 --- /dev/null +++ b/src/main/java/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/src/main/java/ihl/flexible_cable/AnchorBlock.java b/src/main/java/ihl/flexible_cable/AnchorBlock.java new file mode 100644 index 0000000..207173e --- /dev/null +++ b/src/main/java/ihl/flexible_cable/AnchorBlock.java @@ -0,0 +1,111 @@ +package ihl.flexible_cable; + +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ihl.IHLModInfo; +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.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class AnchorBlock extends Block implements ITileEntityProvider { + + public AnchorBlock(String unlocalizedName1) { + super(Material.circuits); + this.setBlockName(unlocalizedName1); + GameRegistry.registerBlock(this, unlocalizedName1); + } + + @Override + public boolean hasTileEntity(int metadata) { + return true; + } + + @Override + public void onBlockPreDestroy(World world, int x, int y, int z, int meta) { + if (!world.isRemote) { + TileEntity te = world.getTileEntity(x, y, z); + if (te != null && te instanceof AnchorTileEntity) { + AnchorTileEntity ate = (AnchorTileEntity) te; + ate.invalidate(); + for (short i = 0; i < 6; i++) { + ate.energyNetNodes[i].removeAttachedChains(); + } + } + } + super.onBlockPreDestroy(world, x, y, z, meta); + } + + @Override + public TileEntity createNewTileEntity(World arg0, int arg1) { + return new AnchorTileEntity(); + } + + @Override + public void dropBlockAsItemWithChance(World world, int x, int y, int z, int meta, float chance, int flag) { + } + + @Override + public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, + int p_149668_4_) { + return null; + } + + @Override + public boolean isOpaqueCube() { + return false; + } + + @Override + public boolean renderAsNormalBlock() { + return false; + } + + @Override + public int getRenderType() { + return -2; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister par1IconRegister) { + this.blockIcon = par1IconRegister.registerIcon(IHLModInfo.MODID + ":junctionBox"); + } + + @Override + public void setBlockBoundsBasedOnState(IBlockAccess iBlockAccess, int x, int y, int z) { + TileEntity te = iBlockAccess.getTileEntity(x, y, z); + if (te != null && te instanceof AnchorTileEntity) { + AnchorTileEntity ate = (AnchorTileEntity) te; + float portSize = 0.1f; + float bbMinX = 1f; + float bbMaxX = 0f; + float bbMinY = 1f; + float bbMaxY = 0f; + float bbMinZ = 1f; + float bbMaxZ = 0f; + for (short i = 0; i < 6; i++) { + if (ate.hasCableOnSide[i]) { + float pMinX = (float) (ate.energyNetNodes[i].getPortPos(null)[0] - portSize - x); + float pMaxX = (float) (ate.energyNetNodes[i].getPortPos(null)[0] + portSize - x); + float pMinY = (float) (ate.energyNetNodes[i].getPortPos(null)[1] - portSize - y); + float pMaxY = (float) (ate.energyNetNodes[i].getPortPos(null)[1] + portSize - y); + float pMinZ = (float) (ate.energyNetNodes[i].getPortPos(null)[2] - portSize - z); + float pMaxZ = (float) (ate.energyNetNodes[i].getPortPos(null)[2] + portSize - z); + bbMinX = Math.min(pMinX, bbMinX); + bbMaxX = Math.max(pMaxX, bbMaxX); + bbMinY = Math.min(pMinY, bbMinY); + bbMaxY = Math.max(pMaxY, bbMaxY); + bbMinZ = Math.min(pMinZ, bbMinZ); + bbMaxZ = Math.max(pMaxZ, bbMaxZ); + } + } + this.setBlockBounds(bbMinX, bbMinY, bbMinZ, bbMaxX, bbMaxY, bbMaxZ); + } + } +} diff --git a/src/main/java/ihl/flexible_cable/AnchorTileEntity.java b/src/main/java/ihl/flexible_cable/AnchorTileEntity.java new file mode 100644 index 0000000..488e89b --- /dev/null +++ b/src/main/java/ihl/flexible_cable/AnchorTileEntity.java @@ -0,0 +1,342 @@ +package ihl.flexible_cable; + +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; + +import ic2.api.energy.EnergyNet; +import ic2.api.energy.event.EnergyTileLoadEvent; +import ic2.api.energy.event.EnergyTileUnloadEvent; +import ic2.api.energy.tile.IEnergySink; +import ic2.api.energy.tile.IEnergySource; +import ic2.core.ExplosionIC2; +import ic2.core.IC2; +import ic2.core.block.TileEntityBlock; +import ihl.interfaces.IEnergyNetNode; +import ihl.interfaces.IMultiPowerCableHolder; +import ihl.utils.IHLUtils; +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.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.util.ForgeDirection; + +public class AnchorTileEntity extends TileEntityBlock implements IEnergySink, IEnergySource, IMultiPowerCableHolder { + public boolean addedToEnergyNet = false; + public final Set sacrifices = new HashSet(); + public SubAnchorEnergyNetNode[] energyNetNodes = new SubAnchorEnergyNetNode[6]; + public boolean[] hasCableOnSide = new boolean[] { false, false, false, false, false, false }; + public int checksum = -1; + public boolean checkCables = true; + + public AnchorTileEntity() { + super(); + for (short i = 0; i < 6; i++) { + energyNetNodes[i] = new SubAnchorEnergyNetNode(this, i); + } + } + + @Override + public List getNetworkedFields() { + List fields = super.getNetworkedFields(); + fields.add("hasCableOnSide"); + return fields; + } + + @Override + public void onLoaded() { + super.onLoaded(); + for (short i = 0; i < 6; i++) { + energyNetNodes[i].onLoaded(); + } + if (IC2.platform.isSimulating() && !this.addedToEnergyNet) { + MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this)); + this.addedToEnergyNet = true; + } + } + + @Override + public void onUnloaded() { + super.onUnloaded(); + if (IC2.platform.isSimulating()) { + if (this.addedToEnergyNet) { + MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this)); + this.addedToEnergyNet = false; + } + for (SubAnchorEnergyNetNode sen : energyNetNodes) { + sen.onUnloaded(); + } + + } + } + + @Override + public boolean wrenchCanRemove(EntityPlayer var1) { + return false; + } + + public boolean enableUpdateEntity() { + return IC2.platform.isSimulating(); + } + + @Override + public void updateEntityServer() { + if (!sacrifices.isEmpty()) { + Iterator victimIterator = sacrifices.iterator(); + while (victimIterator.hasNext()) { + TileEntity sacrifice = victimIterator.next(); + ExplosionIC2 explosion = new ExplosionIC2(this.worldObj, null, sacrifice.xCoord + 0.5D, + sacrifice.yCoord + 0.5D, sacrifice.zCoord + 0.5D, 3F, 0.3F, ExplosionIC2.Type.Normal, null, 0); + explosion.doExplosion(); + sacrifices.remove(sacrifice); + } + + } + int newchecksum = 0; + for (short i = 0; i < 6; i++) { + if (this.hasCableOnSide[i]) { + newchecksum++; + } + } + if (newchecksum != checksum) { + IC2.network.get().updateTileEntityField(this, "hasCableOnSide"); + checksum = newchecksum; + } + } + + @Override + public void writeToNBT(NBTTagCompound nbt) { + super.writeToNBT(nbt); + NBTTagList energyNetNodeNBTList = new NBTTagList(); + for (SubAnchorEnergyNetNode node : this.energyNetNodes) { + energyNetNodeNBTList.appendTag(node.writeToNBT()); + } + nbt.setTag("energyNetNodes", energyNetNodeNBTList); + nbt.setBoolean("checkCables", this.checkCables); + } + + @Override + public void readFromNBT(NBTTagCompound nbt) { + super.readFromNBT(nbt); + if (!nbt.hasKey("energyNetNodes")) { + short facing = nbt.getShort("facing"); + int gridID = nbt.getInteger("gridID"); + this.energyNetNodes[facing].setGrid(gridID); + NBTTagList cableNBTList = nbt.getTagList("cableList", 10); + for (int i = 0; i < cableNBTList.tagCount(); i++) { + this.energyNetNodes[facing].addCable(cableNBTList.getCompoundTagAt(i)); + } + } else { + NBTTagList energyNetNodeNBTList = nbt.getTagList("energyNetNodes", 10); + for (int i = 0; i < 6; i++) { + this.energyNetNodes[i].readFromNBT(energyNetNodeNBTList.getCompoundTagAt(i)); + } + } + this.checkCables = nbt.getBoolean("checkCables"); + } + + @Override + public void setFacing(short facing) { + this.energyNetNodes[facing].removeAttachedChains(); + boolean removeTE = true; + for (short i = 0; i < 6; i++) { + if (!energyNetNodes[i].getCableList().isEmpty()) { + removeTE = false; + } + } + if (removeTE) { + worldObj.setBlockToAir(xCoord, yCoord, zCoord); + } + } + + @Override + public boolean acceptsEnergyFrom(TileEntity emitter, ForgeDirection direction) { + if (direction != ForgeDirection.UNKNOWN) { + return this.energyNetNodes[direction.getOpposite().ordinal()].getGridID() != -1; + } + return false; + } + + @Override + public boolean emitsEnergyTo(TileEntity receiver, ForgeDirection direction) { + return this.acceptsEnergyFrom(receiver, direction); + } + + @Override + public double getOfferedEnergy() { + double offeredEnergy = 0d; + for (short i = 0; i < 6; i++) { + offeredEnergy += energyNetNodes[i].getEnergyOfferedByGrid(); + } + return offeredEnergy; + } + + @Override + public void drawEnergy(double amount) { + for (short i = 0; i < 6; i++) { + amount -= energyNetNodes[i].drawEnergyFromGrid(amount); + double voltage = energyNetNodes[i].getVoltage(); + if (voltage > 500D) { + Set teset = new HashSet(); + ForgeDirection direction = ForgeDirection.getOrientation(i).getOpposite(); + TileEntity te = EnergyNet.instance.getNeighbor(this, direction); + teset.add(te); + TileEntity te1 = this.getSink(te, teset); + if (te1 instanceof IEnergyNetNode) { + if (((IEnergyNetNode) te1).getMaxAllowableVoltage() >= voltage) { + return; + } + } + if (te1 != null) { + sacrifices.add(te1); + } + } + if (amount <= 0d) { + break; + } + } + } + + @Override + public int getSourceTier() { + return 4; + } + + @Override + public double getDemandedEnergy() { + double amount = 0d; + for (short i = 0; i < 6; i++) { + amount += energyNetNodes[i].getDemandedEnergy(); + } + return amount; + } + + @Override + public int getSinkTier() { + return 4; + } + + @Override + public double injectEnergy(ForgeDirection directionFrom, double amount, double voltage) { + if (directionFrom != ForgeDirection.UNKNOWN) { + return this.energyNetNodes[directionFrom.getOpposite().ordinal()].injectEnergyToGrid(amount); + } + return amount; + } + + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { + return null; + } + + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { + return !this.wrenchCanRemove(entityPlayer); + } + + public TileEntity getSink(TileEntity te, Set teset) { + teset.add(te); + while (te != null && !(te instanceof IEnergySink)) { + TileEntity te1 = EnergyNet.instance.getNeighbor(te, ForgeDirection.NORTH); + if (te1 == null || teset.contains(te1)) { + te1 = EnergyNet.instance.getNeighbor(te, ForgeDirection.SOUTH); + } else { + TileEntity te2 = this.getSink(te1, teset); + if (te2 != null) { + return te2; + } + } + if (te1 == null || teset.contains(te1)) { + te1 = EnergyNet.instance.getNeighbor(te, ForgeDirection.UP); + } else { + TileEntity te2 = this.getSink(te1, teset); + if (te2 != null) { + return te2; + } + } + if (te1 == null || teset.contains(te1)) { + te1 = EnergyNet.instance.getNeighbor(te, ForgeDirection.DOWN); + } else { + TileEntity te2 = this.getSink(te1, teset); + if (te2 != null) { + return te2; + } + } + if (te1 == null || teset.contains(te1)) { + te1 = EnergyNet.instance.getNeighbor(te, ForgeDirection.WEST); + } else { + TileEntity te2 = this.getSink(te1, teset); + if (te2 != null) { + return te2; + } + } + if (te1 == null || teset.contains(te1)) { + te1 = EnergyNet.instance.getNeighbor(te, ForgeDirection.EAST); + } else { + TileEntity te2 = this.getSink(te1, teset); + if (te2 != null) { + return te2; + } + } + if (te1 != null) { + teset.add(te1); + } + te = te1; + } + if (te instanceof IEnergySink) { + return te; + } else { + return null; + } + } + + public void checkIfNoCablesLeft() { + boolean noCables = true; + for (SubAnchorEnergyNetNode sen : energyNetNodes) { + if (!sen.getCableList().isEmpty()) { + noCables = false; + } + } + if (noCables) { + worldObj.setBlockToAir(xCoord, yCoord, zCoord); + } + } + + @Override + public boolean isCableRemoved(int chainUniqueID) { + if (!checkCables) { + return false; + } + for (SubAnchorEnergyNetNode sen : energyNetNodes) { + if (!sen.isCableRemoved(chainUniqueID)) { + return false; + } + } + return true; + } + + @Override + public IEnergyNetNode getEnergyNetNode(short facing) { + return energyNetNodes[facing]; + } + + @Override + public short getSide(EntityPlayer player) { + return IHLUtils.getFacingFromPlayerView(player, true); + } + + @Override + public void removeAttachedChains() { + for (short i = 0; i < 6; i++) { + energyNetNodes[i].removeAttachedChains(); + } + + } + + public boolean isTileEntityInvalid() { + return this.tileEntityInvalid; + } +} diff --git a/src/main/java/ihl/flexible_cable/BatterySwitchUnitModel.java b/src/main/java/ihl/flexible_cable/BatterySwitchUnitModel.java new file mode 100644 index 0000000..2d16ed4 --- /dev/null +++ b/src/main/java/ihl/flexible_cable/BatterySwitchUnitModel.java @@ -0,0 +1,48 @@ +package ihl.flexible_cable; + +import ihl.model.IHLModelRenderer; +import net.minecraft.client.model.ModelBase; +import net.minecraftforge.common.util.ForgeDirection; + +// Date: 07.04.2015 18:24:15 +// Template version 1.1 +// Java generated by Techne +// Keep in mind that you still need to fill in some blanks +// - ZeuX + +public class BatterySwitchUnitModel extends ModelBase +{ + //fields + IHLModelRenderer Piece1; + + public BatterySwitchUnitModel() + { + textureWidth = 64; + textureHeight = 32; + setTextureOffset("Piece1.Shape1", 0, 0); + setTextureOffset("Piece1.ConeUp01", 0, 0); + setTextureOffset("Piece1.PipeUp", 54, 0); + setTextureOffset("Piece1.ConeUp02", 0, 0); + setTextureOffset("Piece1.Shape27", 0, 0); + setTextureOffset("Piece1.ConeUp04", 0, 0); + + Piece1 = new IHLModelRenderer(this, "Piece1"); + Piece1.setRotationPoint(0F, 16F, 0F); + setRotation(Piece1, 0F, 0F, 0F); + Piece1.mirror = true; + Piece1.addBox("Shape1", -8F, -8F, -8F, 16, 16, 16); + Piece1.addTube("ConeUp01", -2F, -16F, -2F, 4, 2, 4, 0f, 0.5f, ForgeDirection.DOWN); + Piece1.addTube("PipeUp", -0.5F, -17F, -0.5F, 1, 1, 1, 0f, 1f, ForgeDirection.DOWN); + Piece1.addTube("ConeUp02", -2F, -14F, -2F, 4, 2, 4, 0f, 0.5f, ForgeDirection.DOWN); + Piece1.addTube("Shape27", -2F, -12F, -2F, 4, 2, 4, 0f, 0.5f, ForgeDirection.DOWN); + Piece1.addTube("ConeUp04", -2F, -10F, -2F, 4, 2, 4, 0f, 0.5f, ForgeDirection.DOWN); + } + + private void setRotation(IHLModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + +} diff --git a/src/main/java/ihl/flexible_cable/BatterySwitchUnitTileEntity.java b/src/main/java/ihl/flexible_cable/BatterySwitchUnitTileEntity.java new file mode 100644 index 0000000..f4fc6c1 --- /dev/null +++ b/src/main/java/ihl/flexible_cable/BatterySwitchUnitTileEntity.java @@ -0,0 +1,295 @@ +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 ihl.utils.IHLUtils; +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.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.util.ForgeDirection; + +public class BatterySwitchUnitTileEntity extends FlexibleCableHolderBaseTileEntity implements INetworkClientTileEntityEventListener, IEnergySource{ + + public short progress; + protected short operationLength=200; + public boolean isGuiScreenOpened=false; + protected final double energyConsume=128D; + public double energy; + public int maxStorage=65536; + private boolean addedToEnergyNet=false; + public byte mode = 0; + private Set batteryChain = new HashSet(); + private BatterySwitchUnitTileEntity batteryChainMaster; + private boolean chargingMode=true; + + public BatterySwitchUnitTileEntity() + { + super(); + } + + @Override + public void onLoaded() + { + super.onLoaded(); + if (IC2.platform.isSimulating()&&!this.addedToEnergyNet) + { + MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this)); + this.addedToEnergyNet = true; + } + } + + @Override + public void onUnloaded() + { + if (IC2.platform.isSimulating()&&this.addedToEnergyNet) + { + MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this)); + this.addedToEnergyNet = false; + } + super.onUnloaded(); + } + + @Override + public ItemStack getWrenchDrop(EntityPlayer player) + { + return IHLUtils.getThisModItemStack("batterySwitchUnit"); + } + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) + { + return this.getFacing()!=(short)side; + } + + + @Override + public void writeToNBT(NBTTagCompound nbt) { + super.writeToNBT(nbt); + nbt.setShort("progress", this.progress); + nbt.setDouble("energy", this.energy); + } + + @Override + public void readFromNBT(NBTTagCompound nbt) { + super.readFromNBT(nbt); + this.progress = nbt.getShort("progress"); + this.energy=nbt.getDouble("energy"); + } + + @Override + public void onNetworkEvent(EntityPlayer player, int event) + { + switch(event) + { + case 0: + this.isGuiScreenOpened=false; + break; + } + } + + @Override + public void updateEntityServer() + { + { + if(this.chargingMode && this.gridID!=-1 && this.energy0D) + { + if(this.getGrid().getSinkVoltage(this)/this.batteryChain.size()>410D) + { + this.energy+=energyConsume; + this.getGrid().drawEnergy(energyConsume, this); + if(this.getGrid().getSinkVoltage(this)/this.batteryChain.size()>500D) + { + this.createChainOfExplosions(); + } + } + } + } + if(this.chargingMode && this.batteryChainMaster!=null && this.gridID==-1) + { + if(this.batteryChainMaster.gridID!=-1 && this.batteryChainMaster.energy>0D && this.energy410D) + { + this.energy+=energyConsume; + this.batteryChainMaster.drawEnergy(energyConsume); + } + } + } + if(this.chargingMode && this.gridID!=-1 && MinecraftServer.getServer().getTickCounter() % 40==0) + { + this.checkBatteryChain(); + } + if(this.energy>=this.maxStorage) + { + this.chargingMode=false; + } + if(!this.chargingMode) + { + this.energy-=0.01D; + if(this.energy batteryChainIterator = this.batteryChain.iterator(); + while(batteryChainIterator.hasNext()) + { + BatterySwitchUnitTileEntity bsu = batteryChainIterator.next(); + ExplosionIC2 explosion = new ExplosionIC2(bsu.worldObj, null, bsu.xCoord+0.5D, bsu.yCoord+0.5D, bsu.zCoord+0.5D, 2F, 0.3F, ExplosionIC2.Type.Normal, null, 0); + explosion.doExplosion(); + } + } + + private boolean checkBatteryChain() + { + boolean allright=true; + if(!this.batteryChain.isEmpty()) + { + Iterator sectionsIterator = this.batteryChain.iterator(); + while(sectionsIterator.hasNext()) + { + BatterySwitchUnitTileEntity section = sectionsIterator.next(); + if(section==null || section.isInvalid()) + { + allright=false; + } + } + } + else + { + allright=false; + } + if(allright) + { + return true; + } + else + { + this.batteryChain.clear(); + boolean checking = true; + int x=xCoord; + int z=zCoord; + List xs = new ArrayList(); + List zs = new ArrayList(); + xs.add(xCoord); + zs.add(zCoord); + this.batteryChain.add(this); + while(checking) + { + if(!xs.isEmpty() && !zs.isEmpty()) + { + x=xs.remove(0); + z=zs.remove(0); + } + else + { + checking=false; + break; + } + int[] xz = new int[] {0,1,0,-1,0}; + for(int i=0;i500D) + { + this.createChainOfExplosions(); + } + } + +} diff --git a/src/main/java/ihl/flexible_cable/BlastEntityFX.java b/src/main/java/ihl/flexible_cable/BlastEntityFX.java new file mode 100644 index 0000000..49e2a36 --- /dev/null +++ b/src/main/java/ihl/flexible_cable/BlastEntityFX.java @@ -0,0 +1,68 @@ +package ihl.flexible_cable; + +import net.minecraft.client.particle.EntityFX; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.world.World; + +public class BlastEntityFX extends EntityFX { + + public BlastEntityFX(World world, double x, double y, double z) + { + super(world, x, y, z); + this.renderDistanceWeight = 5.0D; + } + + public BlastEntityFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12, float par14) + { + super(par1World, par2, par4, par6, 0.0D, 0.0D, 0.0D); + this.motionX *= 0.10000000149011612D; + this.motionY *= 0.10000000149011612D; + this.motionZ *= 0.10000000149011612D; + this.motionX += par8; + this.motionY += par10; + this.motionZ += par12; + this.particleScale *= par14; + this.particleMaxAge = 3; + this.particleAge=0; + this.noClip = false; + this.renderDistanceWeight = 6.0D; + } + + @Override + public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) + { + float var8 = this.particleTextureIndexX / 2.0F; + float var9 = var8 + 0.5f; + float var10 = this.particleTextureIndexY / 2.0F; + float var11 = var10 + 0.5f; + float var12 = 0.1F * this.particleScale; + float var13 = (float)(this.prevPosX + (this.posX - this.prevPosX) * par2 - interpPosX); + float var14 = (float)(this.prevPosY + (this.posY - this.prevPosY) * par2 - interpPosY); + float var15 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * par2 - interpPosZ); + par1Tessellator.addVertexWithUV(var13 - par3 * var12 - par6 * var12, var14 - par4 * var12, var15 - par5 * var12 - par7 * var12, var9, var11); + par1Tessellator.addVertexWithUV(var13 - par3 * var12 + par6 * var12, var14 + par4 * var12, var15 - par5 * var12 + par7 * var12, var9, var10); + par1Tessellator.addVertexWithUV(var13 + par3 * var12 + par6 * var12, var14 + par4 * var12, var15 + par5 * var12 + par7 * var12, var8, var10); + par1Tessellator.addVertexWithUV(var13 + par3 * var12 - par6 * var12, var14 - par4 * var12, var15 + par5 * var12 - par7 * var12, var8, var11); + } + + @Override + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + if (this.particleAge++ >= this.particleMaxAge) + { + this.setDead(); + } + this.setParticleTextureIndex(this.particleAge * 3 / this.particleMaxAge); + } + + @Override + public void setParticleTextureIndex(int par1) + { + this.particleTextureIndexX = par1 % 2; + this.particleTextureIndexY = par1 / 2; + } + +} diff --git a/src/main/java/ihl/flexible_cable/FlexibleCableHolderBaseTileEntity.java b/src/main/java/ihl/flexible_cable/FlexibleCableHolderBaseTileEntity.java new file mode 100644 index 0000000..919e130 --- /dev/null +++ b/src/main/java/ihl/flexible_cable/FlexibleCableHolderBaseTileEntity.java @@ -0,0 +1,237 @@ +package ihl.flexible_cable; + +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; + +import ic2.core.block.TileEntityInventory; +import ihl.IHLMod; +import ihl.interfaces.IEnergyNetNode; +import ihl.utils.IHLUtils; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.AxisAlignedBB; + +public abstract class FlexibleCableHolderBaseTileEntity extends TileEntityInventory implements IEnergyNetNode{ + + protected double connectionX; + protected double connectionY; + protected double connectionZ; + protected int gridID=-1; + protected final Set cableList; + public boolean checkCables=true; + + public FlexibleCableHolderBaseTileEntity() + { + super(); + cableList=new HashSet(); + } + + @Override + public void onLoaded() + { + super.onLoaded(); + if(gridID!=-1) + { + IHLGrid grid = IHLMod.enet.getGrid(gridID); + grid.add(this); + } + } + + @Override + public void onUnloaded() + { + super.onUnloaded(); + if(gridID!=-1) + { + IHLGrid grid = IHLMod.enet.getGrid(gridID); + grid.remove(this); + } + } + + + @SuppressWarnings("unchecked") + @Override + public void setFacing(short facing1) + { + short facing2 = (short) Math.max(facing1, 2); + double range = 2D; + AxisAlignedBB searchArea = AxisAlignedBB.getBoundingBox(connectionX-range,connectionY-range,connectionZ-range,connectionX+range,connectionY+range,connectionZ+range); + List nodeList = worldObj.getEntitiesWithinAABB(NodeEntity.class, searchArea); + super.setFacing(facing2); + setConnectionX(this.xCoord+0.5D); + setConnectionY(this.yCoord+1.5D); + setConnectionZ(this.zCoord+0.5D); + if(!nodeList.isEmpty()) + { + Iterator ei = nodeList.iterator(); + while(ei.hasNext()) + { + NodeEntity ne=(NodeEntity) ei.next(); + if((ne.prevAnchorEntity==null||ne.nextAnchorEntity==null) && this.cableListContains(ne.getChainUniqueID())) + { + ne.setVirtualNodePos(connectionX, connectionY, connectionZ); + } + } + } + } + + protected boolean cableListContains(int chainUniqueID) { + Iterator cli = this.getCableList().iterator(); + while(cli.hasNext()) + { + IHLCable c = cli.next(); + if(c.chainUID==chainUniqueID) + { + return true; + } + } + return false; + } + + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) + { + return this.getFacing()!=(short)side; + } + + + @Override + public void writeToNBT(NBTTagCompound nbt) { + super.writeToNBT(nbt); + NBTTagList cableNBTList = new NBTTagList(); + for(IHLCable cable:this.cableList) + { + cableNBTList.appendTag(cable.toNBT()); + } + nbt.setTag("cableList", cableNBTList); + nbt.setDouble("connectionX", this.connectionX); + nbt.setDouble("connectionY", this.connectionY); + nbt.setDouble("connectionZ", this.connectionZ); + nbt.setInteger("gridID", this.gridID); + nbt.setBoolean("checkCables", this.checkCables); + } + + @Override + public void readFromNBT(NBTTagCompound nbt) { + super.readFromNBT(nbt); + NBTTagList cableNBTList=nbt.getTagList("cableList", 10); + for(int i=0;i getCableList() { + return cableList; + } + + @Override + public void setGrid(int newGridID) + { + if(newGridID!=-1) + { + this.gridID=newGridID; + IHLMod.enet.getGrid(newGridID).add(this); + } + else + { + this.gridID=-1; + } + } + + @Override + public int getGridID() + { + return this.gridID; + } + + @Override + public IHLGrid getGrid() + { + return IHLMod.enet.getGrid(gridID); + } + + @Override + public boolean shouldRenderInPass(int pass) + { + return pass==0; + } + + @Override + public void remove(IHLCable cable) + { + if(this.cableList.remove(cable)) + { + IHLUtils.removeChain(cable, this); + } + } + + + @Override + public boolean isCableRemoved(int chainUniqueID) + { + if(!checkCables) + { + return false; + } + for(IHLCable cable:this.cableList) + { + if(cable.chainUID==chainUniqueID) + { + return false; + } + } + return true; + } + + @Override + public void setCableCheck(boolean b) + { + this.checkCables=b; + } + + @Override + public boolean isTileEntityBaseInvalid(){ + return this.tileEntityInvalid; + } +} diff --git a/src/main/java/ihl/flexible_cable/IHLCable.java b/src/main/java/ihl/flexible_cable/IHLCable.java new file mode 100644 index 0000000..e47621e --- /dev/null +++ b/src/main/java/ihl/flexible_cable/IHLCable.java @@ -0,0 +1,111 @@ +package ihl.flexible_cable; + +import ihl.metallurgy.constants.ElectricConductor; +import net.minecraft.nbt.NBTTagCompound; + +public class IHLCable { + + public final int chainUID; + public final int fullLength; + public final int length; + public final String material; + public final int transverseSection; + public final String insulationMaterial; + public final int insulationThickness; + public final int maxVoltage; + public final int connectorX1; + public final int connectorY1; + public final int connectorZ1; + public final int connectorDimensionId1; + public final short connectorFacing1; + public final int connectorX; + public final int connectorY; + public final int connectorZ; + public final int connectorDimensionId; + public final short connectorFacing; + + public IHLCable(int chainUIDIn, int fullLengthIn, int lengthIn, String materialIn, int transverseSectionIn, + String insulationMaterialIn, int insulationThicknessIn, int maxVoltageIn, int connectorX1In, + int connectorY1In, int connectorZ1In, int connectorDimensionId1In, short connectorFacing1In, + int connectorXIn, int connectorYIn, int connectorZIn, int connectorDimensionIdIn, short connectorFacingIn) { + chainUID = chainUIDIn; + fullLength = fullLengthIn; + length = lengthIn; + material = materialIn; + transverseSection = transverseSectionIn; + insulationMaterial = insulationMaterialIn; + insulationThickness = insulationThicknessIn; + maxVoltage = maxVoltageIn; + connectorX1 = connectorX1In; + connectorY1 = connectorY1In; + connectorZ1 = connectorZ1In; + connectorDimensionId1 = connectorDimensionId1In; + connectorFacing1 = connectorFacing1In; + connectorX = connectorXIn; + connectorY = connectorYIn; + connectorZ = connectorZIn; + connectorDimensionId = connectorDimensionIdIn; + connectorFacing = connectorFacingIn; + } + + public static IHLCable fromNBT(NBTTagCompound tag) { + return new IHLCable(tag.getInteger("chainUID"), + tag.getInteger("fullLength"), + tag.getInteger("length"), + tag.getString("material"), + tag.getInteger("transverseSection"), + tag.getString("insulationMaterial"), + tag.getInteger("insulationThickness"), + tag.getInteger("maxVoltage"), + tag.getInteger("connectorX1"), + tag.getInteger("connectorY1"), + tag.getInteger("connectorZ1"), + tag.getInteger("connectorDimensionId1"), + tag.getShort("connectorFacing1"), + tag.getInteger("connectorX"), + tag.getInteger("connectorY"), + tag.getInteger("connectorZ"), + tag.getInteger("connectorDimensionId"), + tag.getShort("connectorFacing")); + } + + public NBTTagCompound toNBT() { + NBTTagCompound tag = new NBTTagCompound(); + tag.setInteger("fullLength", fullLength); + tag.setInteger("length", length); + tag.setString("material", material); + tag.setInteger("transverseSection", transverseSection); + tag.setString("insulationMaterial", insulationMaterial); + tag.setInteger("insulationThickness", insulationThickness); + tag.setInteger("maxVoltage", maxVoltage); + tag.setInteger("connectorX1",connectorX1); + tag.setInteger("connectorY1",connectorY1); + tag.setInteger("connectorZ1",connectorZ1); + tag.setInteger("connectorDimensionId1",connectorDimensionId1); + tag.setShort("connectorFacing1",connectorFacing1); + tag.setInteger("connectorX",connectorX); + tag.setInteger("connectorY",connectorY); + tag.setInteger("connectorZ",connectorZ); + tag.setInteger("connectorDimensionId",connectorDimensionId); + tag.setShort("connectorFacing",connectorFacing); + return tag; + } + + @Override + public int hashCode() { + return chainUID; + } + + @Override + public boolean equals(Object o) { + if (!(o instanceof IHLCable)) + return false; + IHLCable otherCable = (IHLCable) o; + return otherCable.chainUID == this.chainUID; + } + + public long getResistance(){ + return ElectricConductor.getResistivity(material) * 100L / transverseSection; + } + +} diff --git a/src/main/java/ihl/flexible_cable/IHLENet.java b/src/main/java/ihl/flexible_cable/IHLENet.java new file mode 100644 index 0000000..de08204 --- /dev/null +++ b/src/main/java/ihl/flexible_cable/IHLENet.java @@ -0,0 +1,168 @@ +package ihl.flexible_cable; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; + +import ihl.IHLMod; +import ihl.interfaces.IEnergyNetNode; + +public class IHLENet { + + public Map grids = new HashMap(); + public Map cablesToGrids = new HashMap(); + + private int griduid=0; + + public IHLENet() + { + } + + public int getNewUniqueGridID() + { + for(int i=0;i tei = grids.get(gridID2).telist.iterator(); + while(tei.hasNext()) + { + IEnergyNetNode te = tei.next(); + te.setGrid(gridID); + } + grids.remove(gridID2); + return gridID; + } + return gridID2; + } + + + public IHLGrid getGrid(int gridID) + { + if(gridID==-1) + throw new IllegalArgumentException("Node should never ask grid with ID -1"); + if(this.grids.get(gridID)==null) + { + IHLGrid cgrid; + cgrid=new IHLGrid(); + grids.put(gridID, cgrid); + return cgrid; + } + else + { + return this.grids.get(gridID); + } + } + + public void splitGrids(int gridID, IEnergyNetNode exclude) + { + Set telist = this.grids.get(gridID).telist; + Set telist2 = new HashSet(); + telist.remove(exclude); + Iterator atei = telist.iterator(); + while(atei.hasNext()) + { + IEnergyNetNode cte = atei.next(); + atei.remove(); + telist2.add(cte); + cte.getCableList().removeAll(exclude.getCableList()); + cte.setGrid(-1); + } + Iterator atei2 = telist2.iterator(); + while(atei2.hasNext()) + { + IEnergyNetNode cte = atei2.next(); + if(cte.getGridID()==-1)//Warning! Potential future bugs are hidden here! + { + Iterator atei3 = telist2.iterator(); + while(atei3.hasNext()) + { + IEnergyNetNode cte2 = atei3.next(); + if(cte2!=cte && hasSame(cte.getCableList(),cte2.getCableList())) + { + int result=this.mergeGrids(cte.getGridID(), cte2.getGridID()); + cte.setGrid(result); + cte2.setGrid(result); + break; + } + } + } + } + } + + public void removeCableAndSplitGrids(int gridID, IHLCable cable) + { + this.grids.get(gridID).removeCableAndSplitGrids(cable); + } + + public boolean hasSame(Set set, Set set2) + { + Iterator i1 = set.iterator(); + while(i1.hasNext()) + { + IHLCable num1=i1.next(); + if(set2.contains(num1)) + { + return true; + } + } + return false; + } + + public void setOnFire(IHLCable cable) + { + Set cs = IHLMod.proxy.nodeEntityRegistry.get(cable.chainUID); + if(cs!=null) + { + for(NodeEntity ne:cs) + { + ne.setFire(10); + } + } + } + + public void removeCableEntities(IHLCable cable) + { + int uid = cable.chainUID; + Set cs = IHLMod.proxy.nodeEntityRegistry.get(uid); + if(cs!=null) + { + for(NodeEntity ne:cs) + { + if(ne!=null) + { + ne.setDead(); + } + } + } + cablesToGrids.remove(uid); + } +} \ No newline at end of file diff --git a/src/main/java/ihl/flexible_cable/IHLGrid.java b/src/main/java/ihl/flexible_cable/IHLGrid.java new file mode 100644 index 0000000..0a8178e --- /dev/null +++ b/src/main/java/ihl/flexible_cable/IHLGrid.java @@ -0,0 +1,291 @@ +package ihl.flexible_cable; + +import java.util.ArrayList; +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 ihl.IHLMod; +import ihl.interfaces.IEnergyNetNode; +import ihl.utils.IHLUtils; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.server.MinecraftServer; + +public class IHLGrid { + private static final double powerLossLimitPerMeter = 1.6D; + public final Set telist = new HashSet(); + public double energy = 0D; + private IEnergyNetNode sink; + private IEnergyNetNode source; + private double voltage = 400d; + 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(); + private double averageEUTransfered; + private double lastAverageEUTransfered = 0D; + + public void drawEnergy(double amount, IEnergyNetNode sink1) { + this.energy -= amount; + if (energyLossSinkMap.get(sink1) != null) { + this.energy -= energyLossSinkMap.get(sink1) * amount * amount; + } else { + this.telist.add(sink1); + } + this.sink = sink1; + } + + public void injectEnergy(double amount, double voltage1, IEnergyNetNode source1) { + this.energy += amount; + this.voltage = voltage1; + this.source = source1; + this.total20TicksEU += amount; + int tickCounter = MinecraftServer.getServer().getTickCounter(); + if (tickCounter - lastTickCounter < 0) { + lastTickCounter = tickCounter; + this.total20TicksEU = 0D; + } + Iterator i = telist.iterator(); + while (this.energy > 1d && i.hasNext()) { + IEnergyNetNode eNode = i.next(); + if (eNode.isTileEntityBaseInvalid()) { + if (!eNode.getCableList().isEmpty()) { + for (IHLCable cable : eNode.getCableList()) { + IHLMod.enet.cablesToGrids.remove(cable.chainUID); + } + } + IHLMod.log.error("Removing invalide TE " + eNode.getClass().getName()); + i.remove(); + continue; + } + else if(eNode.getGridID()==-1) { + eNode.removeAttachedChains(); + IHLMod.log.error("Removing TE with grid ID==-1 " + eNode.getClass().getName()+ " If it happened more than a single time, report that to mod author."); + i.remove(); + continue; + } + if (eNode.getEnergyAmountThisNodeWant() > 0d) { + double powerToInject = Math.min(energy, eNode.getEnergyAmountThisNodeWant()); + eNode.injectEnergyInThisNode(powerToInject, this.getSinkVoltage(eNode)); + this.energy -= powerToInject; + if (energyLossSinkMap.get(eNode) != null) { + this.energy -= energyLossSinkMap.get(eNode) * powerToInject * powerToInject; + } else { + this.sink = eNode; + } + } + } + int d = tickCounter - lastTickCounter; + if (d >= 40) { + this.averageEUTransfered = this.total20TicksEU / d; + lastTickCounter = tickCounter; + this.total20TicksEU = 0D; + if (IHLMod.config.enableFlexibleCablesGridPowerLossCalculations && isGridValid + && this.averageEUTransfered > 1D) { + this.telist.add(source1); + this.updateGrid(); + } + } + d = tickCounter - tickCounterFireStart; + if (d >= 40 && !this.cablesOnFire.isEmpty()) { + for (IHLCable cable : this.cablesOnFire) { + this.removeCableAndSplitGrids(cable); + } + this.cablesOnFire.clear(); + } + + } + + public void removeCableAndSplitGrids(IHLCable cable) { + IHLUtils.removeChain(cable, null); + Iterator atei = this.telist.iterator(); + Set telist2 = new HashSet(); + while (atei.hasNext()) { + IEnergyNetNode cte = atei.next(); + atei.remove(); + telist2.add(cte); + cte.setGrid(-1); + } + IHLMod.enet.removeCableEntities(cable); + Iterator atei2 = telist2.iterator(); + while (atei2.hasNext()) { + IEnergyNetNode cte = atei2.next(); + if (cte.getGridID() == -1) { + Iterator atei3 = telist2.iterator(); + while (atei3.hasNext()) { + IEnergyNetNode cte2 = atei3.next(); + if (cte2 != cte && IHLMod.enet.hasSame(cte.getCableList(), cte2.getCableList())) { + int result = IHLMod.enet.mergeGrids(cte.getGridID(), cte2.getGridID()); + cte.setGrid(result); + cte2.setGrid(result); + break; + } + } + + } + } + } + + private void updateGrid() { + Iterator atei2 = telist.iterator(); + while (atei2.hasNext()) { + IEnergyNetNode cte = atei2.next(); + if (cte.isTileEntityBaseInvalid()) { + if (!cte.getCableList().isEmpty()) { + for (IHLCable cable : cte.getCableList()) { + IHLMod.enet.cablesToGrids.remove(cable.chainUID); + } + } + atei2.remove(); + } + } + if (this.source != null && this.sink != null && this.source != this.sink && !this.sink.getCableList().isEmpty() + && !this.source.getCableList().isEmpty() + && (!this.calculatedSources.contains(this.source) || !this.calculatedSinks.contains(this.sink) + || this.averageEUTransfered > this.lastAverageEUTransfered + || this.voltage != this.lastVoltage)) { + IEnergyNetNode[] gridTEList = new IEnergyNetNode[this.telist.size()]; + if (gridTEList.length > 100) + IHLMod.log.error("Grid has " + gridTEList.length + + " nodes. If there is no such complex grids in game, report that to mod author."); + gridTEList = this.telist.toArray(gridTEList); + 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; + a: while (!templist.isEmpty()) { + if (threads++ > 1000) { + this.isGridValid = false; + return; + } + templist.removeAll(processlist); + templist2.clear(); + Iterator it1 = processlist.iterator(); + while (it1.hasNext()) { + if (threads++ > 1000) { + this.isGridValid = false; + return; + } + IEnergyNetNode ate1 = it1.next(); + Iterator it2 = templist.iterator(); + while (it2.hasNext()) { + if (threads++ > 1000) { + this.isGridValid = false; + return; + } + IEnergyNetNode ate2 = it2.next(); + if (ate1 != ate2) { + IHLCable cable = this.getSame(ate1.getCableList(), ate2.getCableList()); + if (cable != null) { + map.put(ate2, cable); + templist2.add(ate2); + if (ate2 == source) { + break a; + } + } + } + } + templist.removeAll(templist2); + } + processlist.clear(); + processlist.addAll(templist2); + } + IEnergyNetNode cursor = source; + { + double voltage1 = this.voltage; + double euTransfered = this.averageEUTransfered; + double voltageLossPerMeter = 0D; + double powerLossPerMeter = 0D; + double powerLossPerSquaredEU = 0D; + this.energyLossSinkMap.remove(sink); + this.voltageSinkMap.remove(sink); + while (cursor != sink) { + // System.out.println("cycle 4"); + IHLCable cable = map.get(cursor); + if (cable == null) { + IHLMod.log.error("One of a cables is null during grid update. Skipping update in this tick."); + return; + } + voltageLossPerMeter = cable.getResistance() / 1000D * euTransfered / voltage1; + powerLossPerMeter = voltageLossPerMeter * euTransfered / voltage1; + euTransfered -= powerLossPerMeter * cable.length; + voltage1 -= voltageLossPerMeter * cable.length; + powerLossPerSquaredEU += cable.getResistance() / 1000d * cable.length / voltage1 / voltage1; + if (!this.cablesOnFire.contains(cable) && (powerLossPerMeter > IHLGrid.powerLossLimitPerMeter)) { + IHLMod.enet.setOnFire(cable); + tickCounterFireStart = lastTickCounter; + this.cablesOnFire.add(cable); + } + cursor = this.getHasCable(cable, cursor, gridTEList); + } + this.energyLossSinkMap.put(sink, powerLossPerSquaredEU); + if (voltage1 < 1d) + voltage1 = 1d; + this.voltageSinkMap.put(sink, voltage1); + } + this.calculatedSources.add(this.source); + this.calculatedSinks.add(this.sink); + this.lastAverageEUTransfered = this.averageEUTransfered; + this.lastVoltage = this.voltage; + } + } + + private IHLCable getSame(Set set, Set set2) { + Iterator i1 = set.iterator(); + while (i1.hasNext()) { + IHLCable cable = i1.next(); + if (set2.contains(cable)) { + return cable; + } + } + return null; + } + + public double getSinkVoltage(IEnergyNetNode node) { + if (this.voltageSinkMap.containsKey(node)) { + return this.voltageSinkMap.get(node); + } else { + return this.voltage; + } + } + + private IEnergyNetNode getHasCable(IHLCable cable, IEnergyNetNode exclude, IEnergyNetNode[] gridTEList) { + for (IEnergyNetNode ate1 : gridTEList) { + if (ate1 != exclude && ate1.getCableList().contains(cable)) { + return ate1; + } + } + return null; + } + + public void add(IEnergyNetNode e) { + this.telist.add(e); + this.isGridValid = true; + if (!e.getCableList().isEmpty()) { + for (IHLCable cable : e.getCableList()) { + IHLMod.enet.cablesToGrids.put(cable.chainUID, this); + } + } + } + + public void remove(IEnergyNetNode e) { + this.telist.remove(e); + if (!e.getCableList().isEmpty()) { + for (IHLCable cable : e.getCableList()) { + IHLMod.enet.cablesToGrids.remove(cable.chainUID); + } + } + } +} diff --git a/src/main/java/ihl/flexible_cable/InvSlotOutputInProgress.java b/src/main/java/ihl/flexible_cable/InvSlotOutputInProgress.java new file mode 100644 index 0000000..da17e0f --- /dev/null +++ b/src/main/java/ihl/flexible_cable/InvSlotOutputInProgress.java @@ -0,0 +1,93 @@ +package ihl.flexible_cable; + +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +public class InvSlotOutputInProgress extends IronWorkbenchInvSlot{ + public short[] slotRecipe; + private int size; + public InvSlotOutputInProgress(IronWorkbenchTileEntity base1, String name1, int oldStartIndex1, int count) { + super(base1, name1, oldStartIndex1, Access.NONE, count); + slotRecipe = new short[count]; + size=count; + for(int i=0;i outputs) + { + short slot=this.getFirstEmptySlot(); + if(slot!=-1 && outputs!=null && !outputs.isEmpty() && slot<=this.size()-outputs.size()) + { + for(int i=0;i getRecipeOutputs(int currentSlot) + { + int slotRecipeIndex=this.slotRecipe[currentSlot]; + List list = new ArrayList(); + for(int i=0;i substract(List materials, int multiplier) + { + Set output = new HashSet(); + Iterator i1 = materials.iterator(); + while(i1.hasNext()) + { + IRecipeInput is1 = i1.next(); + for(int i=0;i materials) + { + int m = Integer.MAX_VALUE; + 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()) { + 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")) { + IHLUtils.damageItemViaNBTTag(is, 1); + } + } + if (is.stackSize <= 0) { + this.put(i, null); + } + } + } + } + } + } + + @Override + 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(); + } + } + + @Override + 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 < this.size(); i++) { + ItemStack is = this.get(i); + if (is != null && (is.getItem() == is1.getItem() || IHLUtils.isItemsHaveSameOreDictionaryEntry(is, is1))) { + return true; + } + } + return false; + } +} diff --git a/src/main/java/ihl/flexible_cable/InvSlotWorkspaceElement.java b/src/main/java/ihl/flexible_cable/InvSlotWorkspaceElement.java new file mode 100644 index 0000000..b9e65b2 --- /dev/null +++ b/src/main/java/ihl/flexible_cable/InvSlotWorkspaceElement.java @@ -0,0 +1,184 @@ +package ihl.flexible_cable; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import ihl.interfaces.IWorkspaceElement; +import ihl.utils.IHLUtils; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; + +public class InvSlotWorkspaceElement extends IronWorkbenchInvSlot { + + private final IWorkspaceElement[] workspaceElements; + public final boolean[] ready; + + public InvSlotWorkspaceElement(IronWorkbenchTileEntity base1, String name1, int oldStartIndex1, Access access1, int count) + { + super(base1, name1, oldStartIndex1, access1, count); + this.put(0, IHLUtils.getThisModItemStack("ironWorkbench")); + workspaceElements=new IWorkspaceElement[count]; + ready=new boolean[count]; + } + + @Override + public boolean accepts(ItemStack itemStack) + { + return false; + } + + @Override + public boolean getCanTakeStack() + { + return false; + } + + public boolean containsAndCanUse(List workspaceElements2) + { + Iterator iterator = workspaceElements2.iterator(); + while(iterator.hasNext()) + { + ItemStack rWorkspaceElementItemStack = iterator.next(); + boolean presence=false; + for(int i=1;i workspaceElements2) + { + Iterator iterator = workspaceElements2.iterator(); + while(iterator.hasNext()) + { + ItemStack rWorkspaceElementItemStack = iterator.next(); + for(int i=1;i 0) + { + int frameNum=0; + short slotRecipeNum=this.container.tileEntity.output.slotRecipe[0]; + for(int row = 0;row<6;row++) + { + for (int col = 0; col<3; ++col) + { + if(slotRecipeNum!=this.container.tileEntity.output.slotRecipe[col+row*3]) + { + frameNum++; + slotRecipeNum=this.container.tileEntity.output.slotRecipe[col+row*3]; + } + if(this.container.tileEntity.currentSlot==slotRecipeNum) + { + int i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(18),18); + this.drawTexturedModalRect(115+x+col*18, 7+y+row*18, 176, 72,i1,18); + this.drawTexturedModalRect(115+x+col*18, 7+y+row*18, 176+getFrameX(frameNum), getFrameY(frameNum),18,18); + } + } + } + } + else + { + int frameNum=0; + short slotRecipeNum=this.container.tileEntity.output.slotRecipe[0]; + for(int row = 0;row<6;row++) + { + for (int col = 0;col<3; ++col) + { + if(slotRecipeNum!=this.container.tileEntity.output.slotRecipe[col+row*3]) + { + frameNum++; + slotRecipeNum=this.container.tileEntity.output.slotRecipe[col+row*3]; + } + if(this.container.tileEntity.output.get(col+row*3)!=null) + { + this.drawTexturedModalRect(115+x+col*18, 7+y+row*18, 176+getFrameX(frameNum), getFrameY(frameNum),18,18); + } + } + } + } + for(int row = 1;row<6;row++) + { + if(!this.container.tileEntity.workspaceElements.ready[row]) + { + this.drawTexturedModalRect(20+x, 9+y+row*18, 194, 74,3,14); + } + } + } + + @Override + public void onGuiClosed() + { + super.onGuiClosed(); + this.container.tileEntity.isGuiScreenOpened=false; + IC2.network.get().initiateClientTileEntityEvent(this.container.tileEntity, 16); + } + + @Override + public void handleMouseClick(Slot slot,int slotNumber,int mouseButton/*0=left 1=right*/,int arg3) + { + if(miniGui==null && slot!=null && slot.slotNumber>=outputslotoffset && slot.slotNumber>2) & 3)*18; + } + +} \ No newline at end of file diff --git a/src/main/java/ihl/flexible_cable/IronWorkbenchInvSlot.java b/src/main/java/ihl/flexible_cable/IronWorkbenchInvSlot.java new file mode 100644 index 0000000..33821da --- /dev/null +++ b/src/main/java/ihl/flexible_cable/IronWorkbenchInvSlot.java @@ -0,0 +1,30 @@ +package ihl.flexible_cable; + +import java.util.ArrayList; +import java.util.List; + +import ic2.core.block.invslot.InvSlot; +import net.minecraft.item.ItemStack; + +public class IronWorkbenchInvSlot extends InvSlot { + + public IronWorkbenchInvSlot(IronWorkbenchTileEntity base1, String name1, + int oldStartIndex1, Access access1, int count) { + super(base1, name1, oldStartIndex1, access1, count); + } + + public List getItemStackList() + { + 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 * 1.5f; + 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/src/main/java/ihl/flexible_cable/IronWorkbenchTileEntity.java b/src/main/java/ihl/flexible_cable/IronWorkbenchTileEntity.java new file mode 100644 index 0000000..30f6fda --- /dev/null +++ b/src/main/java/ihl/flexible_cable/IronWorkbenchTileEntity.java @@ -0,0 +1,351 @@ +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; +import ic2.api.network.INetworkClientTileEntityEventListener; +import ic2.api.network.INetworkTileEntityEventListener; +import ic2.api.recipe.IRecipeInput; +import ic2.core.ContainerBase; +import ic2.core.IHasGui; +import ic2.core.block.TileEntityInventory; +import ic2.core.block.invslot.InvSlot.Access; +import ihl.IHLMod; +import ihl.interfaces.IWire; +import ihl.recipes.IronWorkbenchRecipe; +import ihl.recipes.RecipeInputDetonator; +import ihl.recipes.RecipeInputDie; +import ihl.recipes.RecipeInputObjectInstance; +import ihl.utils.IHLUtils; +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.network.NetworkManager; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; + +public class IronWorkbenchTileEntity extends TileEntityInventory + implements IHasGui, INetworkClientTileEntityEventListener, INetworkTileEntityEventListener { + + public static List 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(); + private boolean firstTick = true; + + 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 + @SideOnly(Side.CLIENT) + public void updateEntityClient() { + if (firstTick) { + IHLMod.proxy.requestTileEntityInitdataFromClientToServer(xCoord, yCoord, zCoord); + this.firstTick = false; + } + } + + @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); + } + } + 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); + this.startProcess = false; + } + } + } + for (int i = 0; i < this.inputMaterial.size(); i++) { + ItemStack stack = this.inputMaterial.get(i); + if (stack != null && stack.getItem() instanceof IWire) { + if (stack.stackTagCompound == null) { + stack.stackTagCompound = new NBTTagCompound(); + } + int fullLength = this.getFullLengthOfSameWires(stack); + List 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()) { + Set 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(); + if (stack.getItem() instanceof IWire) { + this.crafter.inventory.mainInventory[slot] = IHLUtils + .getWireItemStackCopyWithLengthMultiplied(stack, multiplier); + } else { + this.crafter.inventory.mainInventory[slot] = stack.copy(); + 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.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 Set getCrafterEmptyInventorySlotsList() { + Set list = new HashSet(4); + 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 < this.inputMaterial.size(); i++) { + ItemStack stack = this.inputMaterial.get(i); + if (stack != null && ((IWire) stack1.getItem()).isSameWire(stack1, stack)) { + list.add(new RecipeInputObjectInstance(stack)); + } + } + return list; + } + + private int getFullLengthOfSameWires(ItemStack stack1) { + int fullLength = 0; + for (int i = 0; i < this.inputMaterial.size(); i++) { + ItemStack stack = this.inputMaterial.get(i); + if (stack != null && ((IWire) stack1.getItem()).isSameWire(stack1, stack)) { + fullLength += IHLUtils.getWireLength(stack); + } + } + return fullLength; + } + + @Override + @SideOnly(Side.CLIENT) + public GuiScreen getGui(EntityPlayer player, boolean arg1) { + return new IronWorkbenchGui(new IronWorkbenchContainer(player, this)); + } + + @Override + public ContainerBase 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 < this.tools.size(); i++) { + if (this.tools.get(i) != null) + this.worldObj.spawnEntityInWorld( + new EntityItem(this.worldObj, this.xCoord, this.yCoord + 1, this.zCoord, this.tools.get(i))); + } + for (int i = 0; i < this.inputMaterial.size(); i++) { + if (this.inputMaterial.get(i) != null) + this.worldObj.spawnEntityInWorld(new EntityItem(this.worldObj, this.xCoord, this.yCoord + 1, + this.zCoord, this.inputMaterial.get(i))); + } + } + + @Override + public void onNetworkEvent(int event) { + + } + + public int gaugeProgressScaled(int i) { + return this.progress * i / this.maxProgress; + } + + @Override + public boolean shouldRenderInPass(int pass) { + return pass == 0; + } + + public static void removeRecipeByOutput(List 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(); + } + } + } + + @Override + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { + this.readFromNBT(pkt.func_148857_g()); + } + +} diff --git a/src/main/java/ihl/flexible_cable/NodeEntity.java b/src/main/java/ihl/flexible_cable/NodeEntity.java new file mode 100644 index 0000000..b734cd1 --- /dev/null +++ b/src/main/java/ihl/flexible_cable/NodeEntity.java @@ -0,0 +1,604 @@ +package ihl.flexible_cable; + +import java.io.IOException; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; + +import cpw.mods.fml.common.network.internal.FMLProxyPacket; +import ihl.IHLMod; +import ihl.IHLModInfo; +import ihl.interfaces.ICableHolder; +import ihl.interfaces.IMultiPowerCableHolder; +import ihl.interfaces.INetworkListener; +import ihl.items_blocks.FlexibleCableItem; +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.entity.Entity; +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.NBTTagCompound; +import net.minecraft.server.MinecraftServer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; + +public class NodeEntity extends Entity implements INetworkListener{ + + public NodeEntity prevAnchorEntity; + public Entity nextAnchorEntity; + private int anchorX; + private int anchorY; + private int anchorZ; + private short anchorFacing; + private int anchorDimensionId; + public boolean shouldFollowPlayer=false; + protected int chainUniqueID=-2; + public int chainArrangeNumber=-2; + protected int checkTimer=201; + public int colorIndex=16777215; + public int renderEvery=1; + public int type=1;//0 - uninsulated wire; 1 - insulated cable; 2 - data cable + public float dx0=0; + public float dy0=0; + public float dz0=0; + public final int n=48; + public final float[] rotationPitchArray = new float[n+1]; + public final float[] rotationYawArray = new float[n+1]; + public final float[] translationX = new float[n+1]; + public final float[] translationY = new float[n+1]; + public final float[] translationZ = new float[n+1]; + public double virtualNodePosX; + public double virtualNodePosY; + public double virtualNodePosZ; + public double renderPosX; + public double renderPosY; + public double renderPosZ; + public double lastTickRenderPosX; + public double lastTickRenderPosY; + public double lastTickRenderPosZ; + private boolean alreadyRegistered=false; + private boolean shouldUpdateRender=true; + + public NodeEntity(World world) + { + super(world); + if(world.isRemote) + { + IHLMod.proxy.addEntityToList(this); + this.setSize(2f, 0.2f); + } + else + { + IHLMod.proxy.addEntityToServerList(this); + this.setSize(0.5F, 0.1F); + } + this.renderDistanceWeight = 5.0D; + this.yOffset+=0.15F; + this.virtualNodePosX=this.posX; + this.virtualNodePosY=this.posY; + this.virtualNodePosZ=this.posZ; + this.motionX=0D; + this.motionY=0D; + this.motionZ=0D; + } + + @Override + public void setInPortal(){} + + @Override + public void travelToDimension(int dimensionId){} + + @Override + public void setSize(float width, float heigth) + { + super.setSize(width, heigth); + } + + public void setVirtualNodePos(double d,double e, double f) + { + virtualNodePosX=d; + virtualNodePosY=e; + virtualNodePosZ=f; + this.registerAndSendData(null); + } + + @Override + public void registerAndSendData(EntityPlayerMP player) + { + if(!worldObj.isRemote) + { + if(!alreadyRegistered) + { + Set nes; + if(IHLMod.proxy.nodeEntityRegistry.containsKey(this.getChainUniqueID())) + { + nes=IHLMod.proxy.nodeEntityRegistry.get(this.getChainUniqueID()); + } + else + { + nes=new HashSet(); + IHLMod.proxy.nodeEntityRegistry.put(this.getChainUniqueID(),nes); + } + nes.add(this); + alreadyRegistered=true; + } + ByteBuf bb = Unpooled.buffer(30); + ByteBufOutputStream byteBufOutputStream = new ByteBufOutputStream(bb); + try + { + byteBufOutputStream.write(1); + byteBufOutputStream.writeInt(this.getEntityId()); + byteBufOutputStream.writeInt(this.getChainUniqueID()); + byteBufOutputStream.writeInt(this.chainArrangeNumber); + byteBufOutputStream.writeByte(this.type); + byteBufOutputStream.writeInt(this.colorIndex); + byteBufOutputStream.writeDouble(this.virtualNodePosX); + byteBufOutputStream.writeDouble(this.virtualNodePosY); + byteBufOutputStream.writeDouble(this.virtualNodePosZ); + byteBufOutputStream.writeBoolean(this.shouldFollowPlayer); + if(player==null) + { + IHLMod.proxy.sendFromServerToAll(new FMLProxyPacket(byteBufOutputStream.buffer(), IHLModInfo.MODID)); + } + else + { + IHLMod.proxy.sendFromServerToPlayer(new FMLProxyPacket(byteBufOutputStream.buffer(), IHLModInfo.MODID),player); + } + byteBufOutputStream.close(); + } + catch (IOException e) + { + e.printStackTrace(); + } + } + } + + @SuppressWarnings("unchecked") + @Override + public void onUpdate() + { + super.onUpdate(); + if(this.checkTimer==201) + { + if(worldObj.isRemote) + { + IHLMod.proxy.recieveDelayedDataPacket(this); + } + else + { + this.registerAndSendData(null); + } + } + if(prevAnchorEntity==null||(nextAnchorEntity==null || nextAnchorEntity instanceof EntityPlayer || nextAnchorEntity instanceof EntityItem)) + { + double range = 16D; + AxisAlignedBB searchArea = AxisAlignedBB.getBoundingBox(this.posX-range,this.posY-range,this.posZ-range,this.posX+range,this.posY+range,this.posZ+range); + List eItemsList = this.worldObj.getEntitiesWithinAABB(NodeEntity.class, searchArea); + if(!eItemsList.isEmpty()) + { + Iterator ei = eItemsList.iterator(); + while(ei.hasNext()) + { + NodeEntity node=(NodeEntity) ei.next(); + if(node.getChainUniqueID()==this.getChainUniqueID()) + { + if(node.chainArrangeNumber==this.chainArrangeNumber-1) + { + this.prevAnchorEntity=node; + node.nextAnchorEntity=this; + node.shouldFollowPlayer=false; + } + else if(node.chainArrangeNumber==this.chainArrangeNumber+1) + { + this.nextAnchorEntity=node; + this.shouldFollowPlayer=false; + node.prevAnchorEntity=this; + } + } + if(prevAnchorEntity!=null && nextAnchorEntity!=null) + { + break; + } + } + } + } + if(this.shouldFollowPlayer && (this.nextAnchorEntity == null || this.nextAnchorEntity.isDead)) + { + double range = 16D; + AxisAlignedBB searchArea = AxisAlignedBB.getBoundingBox(this.posX-range,this.posY-range,this.posZ-range,this.posX+range,this.posY+range,this.posZ+range); + List eItemsList = this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, searchArea); + if(!eItemsList.isEmpty()) + { + Iterator ei = eItemsList.iterator(); + while(ei.hasNext()) + { + EntityPlayer player=(EntityPlayer) ei.next(); + if(this.playerHasItemStack(player)) + { + this.nextAnchorEntity=player; + } + + } + } + } + if(this.shouldFollowPlayer && this.nextAnchorEntity instanceof EntityPlayer) + { + EntityPlayer player = (EntityPlayer) this.nextAnchorEntity; + if(!this.playerHasItemStack(player)) + { + double range = 16D; + AxisAlignedBB searchArea = AxisAlignedBB.getBoundingBox(this.posX-range,this.posY-range,this.posZ-range,this.posX+range,this.posY+range,this.posZ+range); + List eItemsList = this.worldObj.getEntitiesWithinAABB(EntityItem.class, searchArea); + if(!eItemsList.isEmpty()) + { + Iterator ei = eItemsList.iterator(); + while(ei.hasNext()) + { + EntityItem eitem = ei.next(); + if(this.isItemHasSameChainId(eitem.getEntityItem())) + { + this.nextAnchorEntity=eitem; + break; + } + } + } + } + } + if(nextAnchorEntity!=null && this.getDistanceSqToEntity(nextAnchorEntity)>2D) + { + this.nextAnchorEntity.addVelocity((this.posX-this.nextAnchorEntity.posX)*0.02D, (this.posY-this.nextAnchorEntity.posY)*0.02D, (this.posZ-this.nextAnchorEntity.posZ)*0.02D); + } + if(!worldObj.isRemote) + { + double x0,x2,y0,y2,z0,z2; + x2=x0=this.virtualNodePosX; + y2=y0=this.virtualNodePosY; + z2=z0=this.virtualNodePosZ; + if(nextAnchorEntity!=null) + { + x2=nextAnchorEntity.posX; + y2=nextAnchorEntity.posY; + z2=nextAnchorEntity.posZ; + } + if(prevAnchorEntity!=null) + { + x0=prevAnchorEntity.posX; + y0=prevAnchorEntity.posY; + z0=prevAnchorEntity.posZ; + } + double d1 = (x0-x2)*(x0-x2)+(y0-y2)*(y0-y2)+(z0-z2)*(z0-z2); + if(d1>4D) + { + this.motionX+=(x0+x2)*0.05D-this.posX*0.1D; + this.motionY+=(y0+y2)*0.05D-this.posY*0.1D; + this.motionZ+=(z0+z2)*0.05D-this.posZ*0.1D; + } + else + { + double d2 = this.getDistanceSq(x2,y2,z2); + if(d2>1D) + { + this.motionX+=(x2-this.posX)*0.01D; + this.motionY+=(y2-this.posY)*0.01D; + this.motionZ+=(z2-this.posZ)*0.01D; + } + double d3 = this.getDistanceSq(x0,y0,z0); + if(d3>1D) + { + this.motionX+=(x0-this.posX)*0.01D; + this.motionY+=(y0-this.posY)*0.01D; + this.motionZ+=(z0-this.posZ)*0.01D; + } + } + this.motionY-=0.005D; + this.motionX*=0.8D; + this.motionY*=0.8D; + this.motionZ*=0.8D; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + } + if(this.onGround) + { + this.motionY *= -0.5D; + } + if(worldObj.isRemote) + { + this.lastTickRenderPosX=this.renderPosX; + this.lastTickRenderPosY=this.renderPosY; + this.lastTickRenderPosZ=this.renderPosZ; + this.renderPosX=(float) this.prevPosX; + this.renderPosY=(float) this.prevPosY; + this.renderPosZ=(float) this.prevPosZ; + shouldUpdateRender= + Math.abs(this.lastTickRenderPosX-this.renderPosX)+ + Math.abs(this.lastTickRenderPosY-this.renderPosY)+ + Math.abs(this.lastTickRenderPosZ-this.renderPosZ)>0.01f; + + float xi,yi,zi; + float x0=xi=(float)this.prevPosX; + float y0=yi=(float)this.prevPosY; + float z0=zi=(float)this.prevPosZ; + float dx0=this.dx0; + float dy0=this.dy0; + float dz0=this.dz0; + float dx1=(float) (this.virtualNodePosX-xi); + float dy1=(float) (this.virtualNodePosY-yi); + float dz1=(float) (this.virtualNodePosZ-zi); + if(this.nextAnchorEntity!=null) + { + dx1=(float) (this.nextAnchorEntity.prevPosX-xi); + dy1=(float) (this.nextAnchorEntity.prevPosY-yi); + dz1=(float) (this.nextAnchorEntity.prevPosZ-zi); + } + if(this.prevAnchorEntity==null) + { + this.renderPosX=this.virtualNodePosX; + this.renderPosY=this.virtualNodePosY; + this.renderPosZ=this.virtualNodePosZ; + x0=xi=(float) this.virtualNodePosX; + y0=yi=(float) this.virtualNodePosY; + z0=zi=(float) this.virtualNodePosZ; + } + if(this.nextAnchorEntity instanceof NodeEntity) + { + shouldUpdateRender=this.shouldUpdateRender || ((NodeEntity)this.nextAnchorEntity).shouldUpdateRender; + if(((NodeEntity)this.nextAnchorEntity).nextAnchorEntity!=null) + { + Entity nne = ((NodeEntity)this.nextAnchorEntity).nextAnchorEntity; + dx1=(float) (nne.prevPosX-xi); + dy1=(float) (nne.prevPosY-yi); + dz1=(float) (nne.prevPosZ-zi); + } + else + { + dx1=(float) (((NodeEntity) this.nextAnchorEntity).virtualNodePosX-xi); + dy1=(float) (((NodeEntity) this.nextAnchorEntity).virtualNodePosY-yi); + dz1=(float) (((NodeEntity) this.nextAnchorEntity).virtualNodePosZ-zi); + } + } + if(shouldUpdateRender) + { + float x1=(float) this.virtualNodePosX; + float y1=(float) this.virtualNodePosY; + float z1=(float) this.virtualNodePosZ; + if(this.nextAnchorEntity!=null) + { + if(nextAnchorEntity instanceof NodeEntity) + { + x1=(float) ((NodeEntity) nextAnchorEntity).renderPosX; + y1=(float) ((NodeEntity) nextAnchorEntity).renderPosY; + z1=(float) ((NodeEntity) nextAnchorEntity).renderPosZ; + } + else + { + x1=(float) nextAnchorEntity.posX; + y1=(float) nextAnchorEntity.posY; + z1=(float) nextAnchorEntity.posZ; + } + } + float d = (x0-x1)*(x0-x1)+(y0-y1)*(y0-y1)+(z0-z1)*(z0-z1); + if(d>2f) + { + renderEvery=1; + }/* + else if(d>0.5f) + { + renderEvery=2; + } + else + { + renderEvery=4; + }*/ + int i1=0; + for(float i=1f/n;i<=1f+1f/n;i+=((float)renderEvery)/n,i1+=renderEvery) + { + float dxi = xi; + float dyi = yi; + float dzi = zi; + 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; + dxi-=xi; + dyi-=yi; + dzi-=zi; + double var7 = MathHelper.sqrt_double(dxi * dxi + dzi * dzi); + float rotationPitch = (float) Math.atan2(dxi, dzi); + float rotationYaw = (float) (-Math.atan2(dyi, var7)); + rotationPitchArray[i1]=rotationPitch; + rotationYawArray[i1]=rotationYaw; + translationX[i1]=dxi; + translationY[i1]=dyi; + translationZ[i1]=dzi; + } + if(this.nextAnchorEntity instanceof NodeEntity) + { + NodeEntity next = (NodeEntity) this.nextAnchorEntity; + next.dx0=dx1; + next.dy0=dy1; + next.dz0=dz1; + } + } + } + if(--this.checkTimer<=0) + { + if(!worldObj.isRemote) + { + WorldServer world = MinecraftServer.getServer().worldServerForDimension(this.anchorDimensionId); + TileEntity te = world.getTileEntity(this.anchorX, this.anchorY, this.anchorZ); + if(te==null || !(te instanceof ICableHolder || te instanceof IMultiPowerCableHolder)) + { + this.setDead(); + } + else + { + if(te instanceof ICableHolder) + { + if(((ICableHolder)te).isCableRemoved(this.chainUniqueID)) + { + this.setDead(); + } + } + if(te instanceof IMultiPowerCableHolder) + { + if(((IMultiPowerCableHolder)te).isCableRemoved(this.chainUniqueID)) + { + this.setDead(); + } + } + } + } + this.checkTimer=200; + } + } + + @Override + protected void readEntityFromNBT(NBTTagCompound nbt) + { + this.setChainUniqueID(nbt.getInteger("chainUniqueID")); + this.chainArrangeNumber=nbt.getInteger("chainArrangeNumber"); + this.anchorX=nbt.getInteger("anchorX"); + this.anchorY=nbt.getInteger("anchorY"); + this.anchorZ=nbt.getInteger("anchorZ"); + this.anchorFacing=nbt.getShort("anchorFacing"); + this.anchorDimensionId=nbt.getInteger("anchorDimensionId"); + this.type=nbt.getInteger("type"); + this.colorIndex=nbt.getInteger("colorIndex"); + this.shouldFollowPlayer=nbt.getBoolean("shouldFollowPlayer"); + if(nbt.hasKey("width")) + { + this.setSize(nbt.getFloat("width"), nbt.getFloat("height")); + } + this.virtualNodePosX=nbt.getDouble("virtualNodePosX"); + this.virtualNodePosY=nbt.getDouble("virtualNodePosY"); + this.virtualNodePosZ=nbt.getDouble("virtualNodePosZ"); + } + + @Override + protected void writeEntityToNBT(NBTTagCompound nbt) + { + nbt.setFloat("width", this.width); + nbt.setFloat("height", this.height); + nbt.setInteger("chainUniqueID", this.getChainUniqueID()); + nbt.setInteger("chainArrangeNumber", this.chainArrangeNumber); + nbt.setInteger("anchorX", this.anchorX); + nbt.setInteger("anchorY", this.anchorY); + nbt.setInteger("anchorZ", this.anchorZ); + nbt.setShort("anchorFacing",this.anchorFacing); + nbt.setInteger("anchorDimensionId",this.anchorDimensionId); + nbt.setInteger("type", this.type); + nbt.setInteger("colorIndex", this.colorIndex); + nbt.setBoolean("shouldFollowPlayer",this.shouldFollowPlayer); + nbt.setDouble("virtualNodePosX",this.virtualNodePosX); + nbt.setDouble("virtualNodePosY",this.virtualNodePosY); + nbt.setDouble("virtualNodePosZ",this.virtualNodePosZ); + } + + public void setAnchor(int x, int y, int z, short facing, int dimensionId) + { + this.anchorX=x; + this.anchorY=y; + this.anchorZ=z; + this.anchorFacing=facing; + this.anchorDimensionId=dimensionId; + } + + public boolean playerHasItemStack(EntityPlayer player) + { + int var2; + for (var2 = 0; var2 < player.inventory.mainInventory.length; ++var2) + { + if(this.isItemHasSameChainId(player.inventory.mainInventory[var2])) + { + return true; + } + } + return false; + } + + private boolean isItemHasSameChainId(ItemStack itemStack) + { + if(itemStack!=null) + { + if(itemStack.getItem() instanceof FlexibleCableItem) + { + return itemStack.stackTagCompound.getInteger("chainUID") == this.chainUniqueID; + } + } + return false; + } + + public int getChainUniqueID() { + return chainUniqueID; + } + + public void setChainUniqueID(int chainUniqueID) { + this.chainUniqueID = chainUniqueID; + } + + @Override + public int getId() + { + return this.getEntityId(); + } + + @Override + public void recieveData(ByteBufInputStream byteBufInputStream) + { + try + { + this.setChainUniqueID(byteBufInputStream.readInt()); + this.chainArrangeNumber=byteBufInputStream.readInt(); + this.type=byteBufInputStream.readByte(); + this.colorIndex=byteBufInputStream.readInt(); + this.virtualNodePosX=byteBufInputStream.readDouble(); + this.virtualNodePosY=byteBufInputStream.readDouble(); + this.virtualNodePosZ=byteBufInputStream.readDouble(); + this.shouldFollowPlayer=byteBufInputStream.readBoolean(); + } + catch (IOException e) + { + e.printStackTrace(); + } + } + + @Override + protected void entityInit() {} + + @Override + public boolean isInvalid() + { + return this.isDead; + } + + public void setVirtualNodePosToNearestPortal() + { + int x0 = (int)this.posX; + int y0 = (int)this.posY; + int z0 = (int)this.posZ; + for(int xi=x0-2;xi<=x0+2;xi++) + { + for(int yi=y0-2;yi<=y0+2;yi++) + { + for(int zi=z0-2;zi<=z0+2;zi++) + { + Block block = worldObj.getBlock(xi, yi, zi); + if(block==Blocks.portal||block==Blocks.end_portal) + { + this.setVirtualNodePos(xi+0.5d, yi+0.5d, zi+0.5d); + return; + } + } + } + } + + } +} diff --git a/src/main/java/ihl/flexible_cable/NodeRender.java b/src/main/java/ihl/flexible_cable/NodeRender.java new file mode 100644 index 0000000..c27f11a --- /dev/null +++ b/src/main/java/ihl/flexible_cable/NodeRender.java @@ -0,0 +1,76 @@ +package ihl.flexible_cable; + +import org.lwjgl.opengl.GL11; + +import ihl.IHLModInfo; +import ihl.model.ModelTube; +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.ResourceLocation; +import net.minecraftforge.common.util.ForgeDirection; + +public class NodeRender extends Render +{ + + private ModelTube model; + private ModelTube modelThin; + private ResourceLocation tex; + private float scale; + + public NodeRender() + { + super(); + scale = 1F/16F; + model=new ModelTube(null, 0, 0, -4F, -4F, -3F, 8, 8, 6,0f, 0.5f,0.99f, ForgeDirection.NORTH); + modelThin=new ModelTube(null, 0, 0, -1F, -1F, -3F, 2, 2, 6,0f, 0f,0.99f, ForgeDirection.NORTH); + tex = new ResourceLocation(IHLModInfo.MODID+":textures/blocks/junctionBox.png"); + } + + @Override + public void doRender(Entity entity, double x1, double y1, double z1, float rotationYaw, float iFrame) + { + bindTexture(tex); + GL11.glPushMatrix(); + NodeEntity ne = (NodeEntity) entity; + float x = (float) (ne.lastTickRenderPosX + (ne.renderPosX-ne.lastTickRenderPosX)*iFrame-RenderManager.renderPosX); + float y = (float) (ne.lastTickRenderPosY + (ne.renderPosY-ne.lastTickRenderPosY)*iFrame-RenderManager.renderPosY); + float z = (float) (ne.lastTickRenderPosZ + (ne.renderPosZ-ne.lastTickRenderPosZ)*iFrame-RenderManager.renderPosZ); + GL11.glTranslatef(x, y, z); + GL11.glScalef(0.25F, -0.25F, -0.25F); + int red = ne.colorIndex>>16; + int green = (ne.colorIndex>>8) & 255; + int blue = ne.colorIndex & 255; + for(int i=0;i cableList; + private IHLCable cable; + private double soundRange=10d; + private final static float groundConductivity=0.005f; + private int lastCheckTimer=0; + + public PowerCableNodeEntity(World world) + { + super(world); + } + + @Override + public boolean canBeCollidedWith() + { + return !worldObj.isRemote && !this.noClip; + } + + @Override + public boolean canBePushed() + { + return !worldObj.isRemote && !this.noClip; + } + + @SuppressWarnings("unchecked") + @Override + public void onUpdate() + { + super.onUpdate(); + if(!worldObj.isRemote) + { + IHLGrid grid = IHLMod.enet.cablesToGrids.get(this.chainUniqueID); + if(grid!=null && grid.energy>0d) + { + double voltage = grid.getSinkVoltage(this); + if(this.onGround && voltage>=10d && this.getMaxAllowableVoltage() 10) + { + for(Object player:worldObj.getEntitiesWithinAABB(EntityPlayerMP.class, AxisAlignedBB.getBoundingBox(this.posX-soundRange,this.posY-soundRange,this.posZ-soundRange, this.posX+soundRange,this.posY+soundRange,this.posZ+soundRange))) + { + if(player instanceof EntityPlayerMP) + { + EntityPlayerMP playerMP = (EntityPlayerMP)player; + playerMP.playerNetServerHandler.sendPacket(new S2APacketParticles("largesmoke",(float)this.posX,(float)this.posY,(float)this.posZ,worldObj.rand.nextFloat()*0.1f-0.05f,0.1f,worldObj.rand.nextFloat()*0.1f-0.05f,0.1f,4)); + } + } + lastCheckTimer=checkTimer; + } + } + if(this.nextAnchorEntity!=null) + { + List entityList = worldObj.getEntitiesWithinAABB(EntityLivingBase.class, this.boundingBox.expand(4d, 4d,4d)); + for(EntityLivingBase elb:entityList) + { + if(elb.boundingBox!=null) + { + if(IHLUtils.isSegmentInsideAABB(elb.boundingBox,this.posX,this.posY,this.posZ,this.nextAnchorEntity.posX,this.nextAnchorEntity.posY,this.nextAnchorEntity.posZ)) + { + this.applyEntityCollision(elb); + } + } + } + } + } + } + } + + @Override + public AxisAlignedBB getCollisionBox(Entity entity) + { + return boundingBox; + } + + + @Override + public void applyEntityCollision(Entity entity) + { + super.applyEntityCollision(entity); + IHLGrid grid = IHLMod.enet.cablesToGrids.get(this.chainUniqueID); + if(entity instanceof EntityLivingBase && grid!=null && grid.energy>=1d) + { + double voltage = grid.getSinkVoltage(this); + if(this.getMaxAllowableVoltage()1000) + { + sendSound(); + IHLMod.proxy.spawnParticleFromServer(3,worldObj, (float)this.posX,(float)this.posY,(float)this.posZ,0f,0f,0f,10f); + } + } + } + } + } + + @Override + protected void readEntityFromNBT(NBTTagCompound nbt) + { + super.readEntityFromNBT(nbt); + if(nbt.hasKey("cable")) + { + this.addCable(nbt.getCompoundTag("cable")); + } + } + + @Override + protected void writeEntityToNBT(NBTTagCompound nbt) + { + super.writeEntityToNBT(nbt); + if(this.cable!=null) + { + nbt.setTag("cable",this.cable.toNBT()); + } + } + + @Override + public IHLGrid getGrid() + { + return IHLMod.enet.cablesToGrids.get(this.chainUniqueID); + } + + @Override + public int getGridID() + { + return 0; + } + + @Override + public void setGrid(int newGridID) {} + + @Override + public double getMaxAllowableVoltage() + { + if(this.cable!=null) + { + return this.cable.maxVoltage; + } + else + { + return Integer.MAX_VALUE; + } + } + + @Override + public boolean addCable(NBTTagCompound cable1) + { + this.cable=IHLCable.fromNBT(cable1); + return true; + } + + @Override + public Set getCableList() { + if(cableList==null) + { + cableList=new HashSet(1); + if(this.cable!=null) + { + cableList.add(this.cable); + } + } + return cableList; + } + + @Override + public void removeAttachedChains() {} + + public void sendSound() + { + for(Object player:worldObj.getEntitiesWithinAABB(EntityPlayerMP.class, AxisAlignedBB.getBoundingBox(this.posX-soundRange,this.posY-soundRange,this.posZ-soundRange, this.posX+soundRange,this.posY+soundRange,this.posZ+soundRange))) + { + if(player instanceof EntityPlayerMP) + { + EntityPlayerMP playerMP = (EntityPlayerMP)player; + playerMP.playerNetServerHandler.sendPacket(new S29PacketSoundEffect(IHLModInfo.MODID+":electrocution",this.posX,this.posY,this.posZ,1f,1f)); + } + } + } + + @Override + public double[] getPortPos(EntityLivingBase player) + { + return new double[3]; + } + + @Override + public void remove(IHLCable cable) + { + this.cableList.remove(cable); + } + + @Override + public boolean isCableRemoved(int chainUniqueID) + { + return false; + } + + @Override + public void setCableCheck(boolean b) {} + + @Override + public double getEnergyAmountThisNodeWant() + { + return 0; + } + + @Override + public void injectEnergyInThisNode(double amount, double voltage) {} + + @Override + public boolean isTileEntityBaseInvalid() { + return this.isDead; + } + +} diff --git a/src/main/java/ihl/flexible_cable/RectifierTransformerUnitTileEntity.java b/src/main/java/ihl/flexible_cable/RectifierTransformerUnitTileEntity.java new file mode 100644 index 0000000..60a5a76 --- /dev/null +++ b/src/main/java/ihl/flexible_cable/RectifierTransformerUnitTileEntity.java @@ -0,0 +1,336 @@ +package ihl.flexible_cable; + +import java.util.List; + +import ic2.api.energy.event.EnergyTileLoadEvent; +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.TileEntityInventory; +import ihl.interfaces.IEnergyNetNode; +import ihl.interfaces.IMultiPowerCableHolder; +import ihl.utils.IHLUtils; +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.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.util.ForgeDirection; + +public class RectifierTransformerUnitTileEntity extends TileEntityInventory implements INetworkClientTileEntityEventListener, IEnergySink, IMultiPowerCableHolder { + + public boolean addedToEnergyNet=false; + public SubRTUEnergyNetNode[] energyNetNodes = new SubRTUEnergyNetNode[2]; + public float mode = 1f; + public static float modeMultiplier = 2f; + public static float modeMax = 128f; + public static float modeMin = 1/modeMax; + public AxisAlignedBB aabb1;// Input zone "0" + public AxisAlignedBB aabb2;// Output zone "1" + public AxisAlignedBB aabb1_1; + public AxisAlignedBB aabb2_1; + public boolean checkCables=true; + + public RectifierTransformerUnitTileEntity() + { + super(); + for(short i=0;i<2;i++) + { + energyNetNodes[i] = new SubRTUEnergyNetNode(this, i); + } + aabb1 = AxisAlignedBB.getBoundingBox(this.xCoord, this.yCoord+1d, this.zCoord, this.xCoord+0.5d, this.yCoord+1.1d, this.zCoord+1d); + aabb2 = AxisAlignedBB.getBoundingBox(this.xCoord+0.5d, this.yCoord+1d, this.zCoord, this.xCoord+1d, this.yCoord+1.1d, this.zCoord+1d); + aabb1_1 = AxisAlignedBB.getBoundingBox(this.xCoord+0.2d, this.yCoord+1.4d, this.zCoord+0.45d, this.xCoord+0.3d, this.yCoord+1.5d, this.zCoord+0.55d); + aabb2_1 = AxisAlignedBB.getBoundingBox(this.xCoord+0.7d, this.yCoord+1.4d, this.zCoord+0.45d, this.xCoord+0.8d, this.yCoord+1.5d, this.zCoord+0.55d); + } + + @Override + public void onLoaded() + { + super.onLoaded(); + for(short i=0;i<2;i++) + { + energyNetNodes[i].onLoaded(); + } + if (IC2.platform.isSimulating()&&!this.addedToEnergyNet) + { + MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this)); + this.addedToEnergyNet = true; + } + this.setupInteractingSpots(this.getFacing()); + } + + @Override + public void onUnloaded() + { + for(short i=0;i<2;i++) + { + energyNetNodes[i].onUnloaded(); + } + if (IC2.platform.isSimulating() && this.addedToEnergyNet) + { + MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this)); + this.addedToEnergyNet = false; + } + super.onUnloaded(); + } + + @Override + public List getNetworkedFields() + { + List fields = super.getNetworkedFields(); + fields.add("mode"); + return fields; + } + + @Override + public void setFacing(short facing1) + { + this.removeAttachedChains(); + short facing2 = (short) Math.max(facing1, 2); + super.setFacing(facing2); + this.setupInteractingSpots(facing2); + } + + public void setupInteractingSpots(short facing2) + { + double yStart=this.yCoord+0.98d; + switch (facing2) + { + case 2: + aabb1 = AxisAlignedBB.getBoundingBox(this.xCoord, yStart, this.zCoord, this.xCoord+0.5d, this.yCoord+1.1d, this.zCoord+1d); + aabb2 = AxisAlignedBB.getBoundingBox(this.xCoord+0.5d, yStart, this.zCoord, this.xCoord+1d, this.yCoord+1.1d, this.zCoord+1d); + aabb1_1 = AxisAlignedBB.getBoundingBox(this.xCoord+0.2d, this.yCoord+1.4d, this.zCoord+0.45d, this.xCoord+0.3d, this.yCoord+1.5d, this.zCoord+0.55d); + aabb2_1 = AxisAlignedBB.getBoundingBox(this.xCoord+0.7d, this.yCoord+1.4d, this.zCoord+0.45d, this.xCoord+0.8d, this.yCoord+1.5d, this.zCoord+0.55d); + break; + case 5: + aabb1 = AxisAlignedBB.getBoundingBox(this.xCoord, yStart, this.zCoord, this.xCoord+1d, this.yCoord+1.1d, this.zCoord+0.5d); + aabb2 = AxisAlignedBB.getBoundingBox(this.xCoord, yStart, this.zCoord+0.5d, this.xCoord+1d, this.yCoord+1.1d, this.zCoord+1d); + aabb1_1 = AxisAlignedBB.getBoundingBox(this.xCoord+0.45d, this.yCoord+1.4d, this.zCoord+0.2d, this.xCoord+0.55d, this.yCoord+1.5d, this.zCoord+0.3d); + aabb2_1 = AxisAlignedBB.getBoundingBox(this.xCoord+0.45d, this.yCoord+1.4d, this.zCoord+0.7d, this.xCoord+0.55d, this.yCoord+1.5d, this.zCoord+0.8d); + break; + case 3: + aabb2 = AxisAlignedBB.getBoundingBox(this.xCoord, yStart, this.zCoord, this.xCoord+0.5d, this.yCoord+1.1d, this.zCoord+1d); + aabb1 = AxisAlignedBB.getBoundingBox(this.xCoord+0.5d, yStart, this.zCoord, this.xCoord+1d, this.yCoord+1.1d, this.zCoord+1d); + aabb2_1 = AxisAlignedBB.getBoundingBox(this.xCoord+0.2d, this.yCoord+1.4d, this.zCoord+0.45d, this.xCoord+0.3d, this.yCoord+1.5d, this.zCoord+0.55d); + aabb1_1 = AxisAlignedBB.getBoundingBox(this.xCoord+0.7d, this.yCoord+1.4d, this.zCoord+0.45d, this.xCoord+0.8d, this.yCoord+1.5d, this.zCoord+0.55d); + break; + case 4: + aabb2 = AxisAlignedBB.getBoundingBox(this.xCoord, yStart, this.zCoord, this.xCoord+1d, this.yCoord+1.1d, this.zCoord+0.5d); + aabb1 = AxisAlignedBB.getBoundingBox(this.xCoord, yStart, this.zCoord+0.5d, this.xCoord+1d, this.yCoord+1.1d, this.zCoord+1d); + aabb2_1 = AxisAlignedBB.getBoundingBox(this.xCoord+0.45d, this.yCoord+1.4d, this.zCoord+0.2d, this.xCoord+0.55d, this.yCoord+1.5d, this.zCoord+0.3d); + aabb1_1 = AxisAlignedBB.getBoundingBox(this.xCoord+0.45d, this.yCoord+1.4d, this.zCoord+0.7d, this.xCoord+0.55d, this.yCoord+1.5d, this.zCoord+0.8d); + break; + default: + aabb1 = AxisAlignedBB.getBoundingBox(this.xCoord, yStart, this.zCoord, this.xCoord+0.5d, this.yCoord+1.1d, this.zCoord+1d); + aabb2 = AxisAlignedBB.getBoundingBox(this.xCoord+0.5d, yStart, this.zCoord, this.xCoord+1d, this.yCoord+1.1d, this.zCoord+1d); + aabb1_1 = AxisAlignedBB.getBoundingBox(this.xCoord+0.2d, this.yCoord+1.4d, this.zCoord+0.45d, this.xCoord+0.3d, this.yCoord+1.5d, this.zCoord+0.55d); + aabb2_1 = AxisAlignedBB.getBoundingBox(this.xCoord+0.7d, this.yCoord+1.4d, this.zCoord+0.45d, this.xCoord+0.8d, this.yCoord+1.5d, this.zCoord+0.55d); + break; + } + } + + @Override + public ItemStack getWrenchDrop(EntityPlayer player) + { + return IHLUtils.getThisModItemStack("rectifierTransformerUnit"); + } + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) + { + return this.getFacing()!=(short)side; + } + + + @Override + public void writeToNBT(NBTTagCompound nbt) { + super.writeToNBT(nbt); + NBTTagList energyNetNodeNBTList = new NBTTagList(); + for(SubRTUEnergyNetNode node:this.energyNetNodes) + { + energyNetNodeNBTList.appendTag(node.writeToNBT()); + } + nbt.setTag("energyNetNodes", energyNetNodeNBTList); + nbt.setFloat("mode",this.mode); + } + + @Override + public void readFromNBT(NBTTagCompound nbt) { + super.readFromNBT(nbt); + NBTTagList energyNetNodeNBTList=nbt.getTagList("energyNetNodes", 10); + for(int i=0;i<2;i++) + { + this.energyNetNodes[i].readFromNBT(energyNetNodeNBTList.getCompoundTagAt(i)); + } + this.mode=nbt.getFloat("mode"); + this.mode=this.mode==0f?1f:this.mode; + } + + @Override + public void onNetworkEvent(EntityPlayer player, int event) + { + switch(event) + { + case 0: + break; + } + } + + public void switchModeUp() + { + if(this.mode=1d) + { + this.energyNetNodes[1].getGrid().injectEnergy(0, 400d*this.mode, this.energyNetNodes[1]); + } + } + IC2.network.get().updateTileEntityField(this, "mode"); + } + } + + public void switchModeDown() + { + if(this.mode>modeMin) + { + this.mode/=modeMultiplier;; + if(this.energyNetNodes[1].getGridID()!=-1) + { + if(this.energyNetNodes[0].getGridID()!=-1) + { + this.energyNetNodes[1].getGrid().injectEnergy(0, this.energyNetNodes[0].getGrid().getSinkVoltage(this.energyNetNodes[0])*this.mode, this.energyNetNodes[1]); + } + else if(this.energyNetNodes[1].getGrid().energy>=1d) + { + this.energyNetNodes[1].getGrid().injectEnergy(0, 400d*this.mode, this.energyNetNodes[1]); + } + } + IC2.network.get().updateTileEntityField(this, "mode"); + } + } + + @Override + public void onNetworkUpdate(String field) + { + if (field.equals("facing") && this.prevFacing != this.getFacing()) + { + this.setupInteractingSpots(this.getFacing()); + } + super.onNetworkUpdate(field); + } + + + @Override + public void updateEntityServer() + { + + } + + @Override + public String getInventoryName() + { + return "RTU"; + } + + @Override + public boolean acceptsEnergyFrom(TileEntity emitter,ForgeDirection direction) + { + return !direction.equals(ForgeDirection.UP); + } + + @Override + public double getDemandedEnergy() + { + if(this.energyNetNodes[1].getGridID()!=-1 && this.energyNetNodes[1].getGrid().energy<1D) + { + return Integer.MAX_VALUE; + } + else + { + return 0d; + } + } + + @Override + public int getSinkTier() + { + return 4; + } + + @Override + public double injectEnergy(ForgeDirection directionFrom, double amount, double voltage) + { + if(getDemandedEnergy()>0d) + { + this.energyNetNodes[1].getGrid().injectEnergy(amount, 400d*this.mode, this.energyNetNodes[1]); + return 0d; + } + return amount; + } + + @Override + public boolean isCableRemoved(int chainUniqueID) + { + if(!checkCables) + { + return false; + } + for(SubRTUEnergyNetNode sen:energyNetNodes) + { + if(!sen.isCableRemoved(chainUniqueID)) + { + return false; + } + } + return true; + } + + @Override + public IEnergyNetNode getEnergyNetNode(short facing) + { + return this.energyNetNodes[facing]; + } + + @Override + public short getSide(EntityPlayer player) + { + if(IHLUtils.isPlayerLookingAt(player, aabb1)) + { + return 0; + } + else if(IHLUtils.isPlayerLookingAt(player, aabb2)) + { + return 1; + } + else + { + return -1; + } + } + + @Override + public void removeAttachedChains() + { + for(short i=0;i<2;i++) + { + energyNetNodes[i].removeAttachedChains(); + } + + } + + public boolean isTileEntityInvalid() { + return this.tileEntityInvalid; + } + + +} diff --git a/src/main/java/ihl/flexible_cable/SetOfDiesMiniGUI.java b/src/main/java/ihl/flexible_cable/SetOfDiesMiniGUI.java new file mode 100644 index 0000000..c708da7 --- /dev/null +++ b/src/main/java/ihl/flexible_cable/SetOfDiesMiniGUI.java @@ -0,0 +1,81 @@ +package ihl.flexible_cable; + +import java.awt.event.KeyEvent; + +import org.lwjgl.opengl.GL11; + +import ihl.IHLMod; +import ihl.interfaces.ItemMiniGUI; +import ihl.utils.IHLUtils; +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; + +public class SetOfDiesMiniGUI extends ItemMiniGUI { + private static final ResourceLocation background = new ResourceLocation("ihl", "textures/gui/GUIIronWorkbench.png"); + private int transverseSectionValue; + private GuiTextField transverseSectionTextField; + private int xPos; + private int yPos; + + public SetOfDiesMiniGUI(GuiContainer gui, Slot slot) { + super(gui, slot); + transverseSectionValue = slot.getStack().stackTagCompound.getInteger("transverseSection"); + xPos = this.slotBase.xDisplayPosition - 18; + yPos = this.slotBase.yDisplayPosition + 18; + transverseSectionTextField = new GuiTextField(this.guiBase.mc.fontRenderer, xPos + TEXT_BOX_POSX, yPos + TEXT_BOX_POSY, TEXT_BOX_WIDTH, + 11); + transverseSectionTextField.setText(Float.toString(transverseSectionValue / 10f)); + transverseSectionTextField.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, HEIGHT); + int runnerXPos = xPos + 5 + 114 * transverseSectionValue / 1350; + this.guiBase.drawTexturedModalRect(runnerXPos, yPos + RUNNER_POSY, 126, 202, 3, 5); + this.guiBase.mc.fontRenderer.drawStringWithShadow(StatCollector.translateToLocal("ihl.transversesection"), + xPos + 3, yPos + 4, 0xFFCC00); + this.transverseSectionTextField.drawTextBox(); + this.guiBase.mc.fontRenderer.drawStringWithShadow(StatCollector.translateToLocal("mm\u00B2"), xPos + UNITS_LABEL_POSX, + yPos + 18, 0xFFCC00); + } + + @Override + public boolean handleMouseClick(int mouseX, int mouseY, int mouseButton) { + if (mouseX >= xPos + 5 && mouseX <= xPos + 119 && mouseY >= yPos + RUNNER_POSY - 1 && mouseY <= yPos + HEIGHT) { + this.transverseSectionValue = Math.max(1, Math.min(1350, (mouseX - xPos - 5) * 1350 / 114)); + this.transverseSectionTextField.setText(Float.toString(transverseSectionValue / 10f)); + } + if (mouseX >= xPos + TEXT_BOX_POSX && mouseX <= xPos + TEXT_BOX_POSX + TEXT_BOX_WIDTH && mouseY >= yPos + TEXT_BOX_POSY && mouseY <= yPos + TEXT_BOX_POSY + 11) { + this.transverseSectionTextField.setFocused(true); + } + return mouseX >= xPos && mouseX <= xPos + 202 && mouseY >= yPos && mouseY <= yPos + HEIGHT; + } + + @Override + public boolean handleKeyTyped(char characterTyped, int keyIndex) { + this.transverseSectionTextField.textboxKeyTyped(characterTyped, keyIndex); + // 28 - enter; 156 - numpad enter + if (keyIndex == KeyEvent.VK_ACCEPT || keyIndex == KeyEvent.VK_ENTER || keyIndex == 28 || keyIndex == 156) { + this.transverseSectionValue = Math.max(1, Math.min(1350, (int) (IHLUtils + .parseFloatSafe(this.transverseSectionTextField.getText(), this.transverseSectionValue) * 10f))); + this.transverseSectionTextField.setText(Float.toString(transverseSectionValue / 10f)); + this.transverseSectionTextField.setFocused(false); + return true; + } + return false; + } + + @Override + public void onGUIClosed() { + IHLMod.proxy.sendItemStackNBTTagFromClientToServerPlayer(this.guiBase.mc.thePlayer, this.slotBase.slotNumber, + "transverseSection", this.transverseSectionValue); + } + +} diff --git a/src/main/java/ihl/flexible_cable/SubAnchorEnergyNetNode.java b/src/main/java/ihl/flexible_cable/SubAnchorEnergyNetNode.java new file mode 100644 index 0000000..daada72 --- /dev/null +++ b/src/main/java/ihl/flexible_cable/SubAnchorEnergyNetNode.java @@ -0,0 +1,346 @@ +package ihl.flexible_cable; + +import java.util.HashSet; +import java.util.Set; + +import ic2.api.energy.EnergyNet; +import ic2.api.energy.event.EnergyTileLoadEvent; +import ic2.api.energy.event.EnergyTileUnloadEvent; +import ic2.api.energy.tile.IEnergySink; +import ic2.api.energy.tile.IEnergySource; +import ic2.core.IC2; +import ihl.IHLMod; +import ihl.interfaces.IEnergyNetNode; +import ihl.utils.IHLUtils; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.util.ForgeDirection; + +public class SubAnchorEnergyNetNode implements IEnergyNetNode{ + + private AnchorTileEntity base; + private short facing; + private int gridID=-1; + private Set cableList = new HashSet(); + + public SubAnchorEnergyNetNode(AnchorTileEntity base1, short facing1) + { + base=base1; + facing=facing1; + } + + @Override + public double[] getPortPos(EntityLivingBase player) + { + double d=0.5D; + double f=-0.05D; + switch(facing) + { + case 0: + return new double[]{ + (base.xCoord+d), + (base.yCoord+1D-f), + (base.zCoord+0.5D)}; + case 1: + return new double[]{ + (base.xCoord+d), + (base.yCoord+f), + (base.zCoord+0.5D)}; + case 2: + return new double[]{ + (base.xCoord+0.5D), + (base.yCoord+d), + (base.zCoord+1D-f)}; + case 3: + return new double[]{ + (base.xCoord+0.5D), + (base.yCoord+d), + (base.zCoord+f)}; + case 4: + return new double[]{ + (base.xCoord+1D-f), + (base.yCoord+d), + (base.zCoord+0.5D)}; + case 5: + return new double[]{ + (base.xCoord+f), + (base.yCoord+d), + (base.zCoord+0.5D)}; + default: + return new double[]{ + (base.xCoord+f), + (base.yCoord+d), + (base.zCoord+0.5D)}; + } + } + + @Override + public IHLGrid getGrid() + { + if(gridID!=-1) + { + return IHLMod.enet.getGrid(gridID); + } + else + { + return null; + } + } + + @Override + public int getGridID() + { + return gridID; + } + + @Override + public void setGrid(int newgridID) + { + if(IC2.platform.isSimulating()&& base.addedToEnergyNet && base.getWorldObj()!=null) + { + MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(base)); + base.addedToEnergyNet = false; + } + if(newgridID!=-1) + { + this.gridID=newgridID; + IHLMod.enet.getGrid(newgridID).add(this); + } + else + { + this.gridID=-1; + } + if (IC2.platform.isSimulating()&& !base.addedToEnergyNet && base.getWorldObj()!=null) + { + MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(base)); + base.addedToEnergyNet = true; + } + } + + @Override + public double getMaxAllowableVoltage() + { + return 64000d; + } + + @Override + public boolean addCable(NBTTagCompound cable) + { + base.hasCableOnSide[this.facing]=true; + return this.cableList.add(IHLCable.fromNBT(cable)); + } + + @Override + public Set getCableList() { + return cableList; + } + + @Override + public void removeAttachedChains() + { + IHLUtils.removeChains(this,this.base.getWorldObj()); + } + + public void onLoaded() + { + if(gridID!=-1) + { + IHLGrid grid = IHLMod.enet.getGrid(gridID); + grid.add(this); + } + } + + public void onUnloaded() + { + if(gridID!=-1) + { + IHLGrid grid = IHLMod.enet.getGrid(gridID); + grid.remove(this); + } + } + + public NBTTagCompound writeToNBT() + { + NBTTagCompound nbt = new NBTTagCompound(); + NBTTagList cableNBTList = new NBTTagList(); + for(IHLCable cable:this.cableList) + { + cableNBTList.appendTag(cable.toNBT()); + } + nbt.setTag("cableList", cableNBTList); + nbt.setInteger("gridID", this.gridID); + return nbt; + } + + public void readFromNBT(NBTTagCompound nbt) { + NBTTagList cableNBTList=nbt.getTagList("cableList", 10); + for(int i=0;i0d) + { + double drainedEnergy = Math.min(amount, this.getGrid().energy); + this.getGrid().drawEnergy(drainedEnergy, this); + return drainedEnergy; + } + return 0D; + } + + public double getVoltage() + { + if(this.gridID==-1) + { + return 0D; + } + else + { + return this.getGrid().getSinkVoltage(this); + } + } + + @Override + public void remove(IHLCable cable) + { + if(this.cableList.remove(cable)) + { + IHLUtils.removeChain(cable, this); + } + if(this.cableList.isEmpty()) + { + base.hasCableOnSide[this.facing]=false; + base.checkIfNoCablesLeft(); + } + } + + public double injectEnergyToGrid(double amount) + { + if(this.gridID==-1) + { + return amount; + } + else + { + this.getGrid().injectEnergy(amount, 400d, this); + return 0d; + } + } + + @Override + public boolean isCableRemoved(int chainUniqueID) { + for(IHLCable cable:this.cableList) + { + if(cable.chainUID==chainUniqueID) + { + return false; + } + } + return true; + } + + @Override + public void setCableCheck(boolean b) + { + base.checkCables=b; + } + + @Override + public double getEnergyAmountThisNodeWant() + { + Set teset = new HashSet(); + ForgeDirection direction = ForgeDirection.getOrientation(this.facing).getOpposite(); + TileEntity te = EnergyNet.instance.getNeighbor(this.base, direction); + teset.add(te); + TileEntity te1 = this.base.getSink(te, teset); + if(te1==this.base) + { + return 0d; + } + if(te instanceof IEnergySink) + { + return ((IEnergySink)te).acceptsEnergyFrom(this.base, ForgeDirection.getOrientation(this.facing))?((IEnergySink)te).getDemandedEnergy():0d; + } + return 0d; + } + + public double getEnergyOfferedByGrid() + { + if(this.gridID==-1) + { + return 0D; + } + else + { + return Math.max(this.getGrid().energy,0d); + } + } + + @Override + public void injectEnergyInThisNode(double amount, double voltage) + { + Set teset = new HashSet(); + ForgeDirection direction = ForgeDirection.getOrientation(this.facing).getOpposite(); + TileEntity te = EnergyNet.instance.getNeighbor(this.base, direction); + teset.add(te); + TileEntity te1 = this.base.getSink(te, teset); + if(te1==this.base) + { + return; + } + if(te1!=null && voltage>500D) + { + if(te1 instanceof IEnergyNetNode) + { + if(((IEnergyNetNode)te1).getMaxAllowableVoltage() cableList = new HashSet(); + + public SubRTUEnergyNetNode(RectifierTransformerUnitTileEntity base1, short facing1) + { + base=base1; + side=facing1; + } + + @Override + public double[] getPortPos(EntityLivingBase player) + { + double d=0.5D; + double f=0.25D; + double h=1.45d; + switch(base.getFacing()) + { + case 0: + case 1: + case 2: + switch(side) + { + case 0: + return new double[]{ + (base.xCoord+f), + (base.yCoord+h), + (base.zCoord+d)}; + case 1: + return new double[]{ + (base.xCoord+1d-f), + (base.yCoord+h), + (base.zCoord+d)}; + } + case 3: + switch(side) + { + case 1: + return new double[]{ + (base.xCoord+f), + (base.yCoord+h), + (base.zCoord+d)}; + case 0: + return new double[]{ + (base.xCoord+1d-f), + (base.yCoord+h), + (base.zCoord+d)}; + } + case 4: + switch(side) + { + case 1: + return new double[]{ + (base.xCoord+d), + (base.yCoord+h), + (base.zCoord+f)}; + case 0: + return new double[]{ + (base.xCoord+d), + (base.yCoord+h), + (base.zCoord+1d-f)}; + } + case 5: + switch(side) + { + case 0: + return new double[]{ + (base.xCoord+d), + (base.yCoord+h), + (base.zCoord+f)}; + case 1: + return new double[]{ + (base.xCoord+d), + (base.yCoord+h), + (base.zCoord+1d-f)}; + } + default: + return new double[]{ + (base.xCoord+1d-f), + (base.yCoord+h), + (base.zCoord+d)}; + } + } + + @Override + public IHLGrid getGrid() + { + if(gridID!=-1) + { + return IHLMod.enet.getGrid(gridID); + } + else + { + return null; + } + } + + @Override + public int getGridID() + { + return gridID; + } + + @Override + public void setGrid(int newgridID) + { + if(IC2.platform.isSimulating()&& base.addedToEnergyNet && base.getWorldObj()!=null) + { + MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(base)); + base.addedToEnergyNet = false; + } + if(newgridID!=-1) + { + this.gridID=newgridID; + IHLMod.enet.getGrid(newgridID).add(this); + } + else + { + this.gridID=-1; + } + if (IC2.platform.isSimulating()&& !base.addedToEnergyNet && base.getWorldObj()!=null) + { + MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(base)); + base.addedToEnergyNet = true; + } + } + + @Override + public double getMaxAllowableVoltage() + { + return 64000d; + } + + @Override + public boolean addCable(NBTTagCompound cable) + { + return this.cableList.add(IHLCable.fromNBT(cable)); + } + + @Override + public Set getCableList() { + return cableList; + } + + @Override + public void removeAttachedChains() + { + IHLUtils.removeChains(this,this.base.getWorldObj()); + } + + public void onLoaded() + { + if(gridID!=-1) + { + IHLGrid grid = IHLMod.enet.getGrid(gridID); + grid.add(this); + } + } + + public void onUnloaded() + { + if(gridID!=-1) + { + IHLGrid grid = IHLMod.enet.getGrid(gridID); + grid.remove(this); + } + } + + public NBTTagCompound writeToNBT() + { + NBTTagCompound nbt = new NBTTagCompound(); + NBTTagList cableNBTList = new NBTTagList(); + for(IHLCable cable:this.cableList) + { + cableNBTList.appendTag(cable.toNBT()); + } + nbt.setTag("cableList", cableNBTList); + nbt.setInteger("gridID", this.gridID); + return nbt; + } + + public void readFromNBT(NBTTagCompound nbt) { + NBTTagList cableNBTList=nbt.getTagList("cableList", 10); + for(int i=0;i0) + { + if(ElectricItem.manager.use(itemStack, this.operationEUCost, entityPlayer)) + { + fluid1.amount=Integer.MAX_VALUE; + int countFreeAmount = this.countAmountOfEmptyFluidCells(Ic2Items.FluidCell, fluid1, entityPlayer); + Set blockXYZSet = this.searchSourcesAndDestroyThem(world, blockXYZ, countFreeAmount/1000); + int countDestroedSources = blockXYZSet.size(); + this.destroyAllSources(world, blockXYZSet); + ElectricItem.manager.discharge(itemStack,this.operationEUCost,1,false,false, false); + this.fillUniversalFluidCells(fluid1, entityPlayer,countDestroedSources); + entityPlayer.inventoryContainer.detectAndSendChanges(); + } + return itemStack; + } + else if(entityPlayer.inventory.hasItemStack(IC2Items.getItem("cell"))) + { + if(ElectricItem.manager.use(itemStack, this.operationEUCost, entityPlayer)) + { + int countCells = this.countEmptyCells(IC2Items.getItem("cell"), entityPlayer); + Set blockXYZSet = this.searchSourcesAndDestroyThem(world, blockXYZ, countCells); + int countDestroedSources = blockXYZSet.size(); + this.destroyAllSources(world, blockXYZSet); + ElectricItem.manager.discharge(itemStack,this.operationEUCost,1,false,false, false); + this.fillFluidCells(fluid1, entityPlayer, countDestroedSources); + entityPlayer.inventoryContainer.detectAndSendChanges(); + return itemStack; + } + } + } + } + return itemStack; + } + + private void destroyAllSources(World world,Set blockXYZSet) + { + Iterator iterator = blockXYZSet.iterator(); + while(iterator.hasNext()) + { + BlockWithCoordinates blockXYZ = iterator.next(); + blockXYZ.setMetadataOrDestroyBlock(world, 1, 7); + } + } + + private void fillUniversalFluidCells(FluidStack fluid1, EntityPlayer entityPlayer, + int countDestroedSources) { + fluid1.amount=countDestroedSources*1000; + //System.out.println("countDestroedSources="+countDestroedSources); + //System.out.println("fluidStackAmount="+fluid1.amount); + a:for (int i=0;i=1000 && entityPlayer.inventory.getStackInSlot(i).stackSize>=1 && amount2>0) + { + amount2 = LiquidUtil.fillContainerStack(entityPlayer.inventory.getStackInSlot(i), entityPlayer, fluid1, false); + fluid1.amount-=amount2; + } + if(fluid1.amount<1000) + { + break a; + } + } + } + } + } + + private void fillFluidCells(FluidStack fluid1, EntityPlayer player, int countDestroedSources) { + ItemStack cell = IHLFluid.getCell(fluid1.getFluid().getName()); + if(cell==null) + { + return; + } + ItemStack emptyCells = IC2Items.getItem("cell").copy(); + emptyCells.stackSize=player.inventory.clearInventory(IC2Items.getItem("cell").getItem(),0)-countDestroedSources; + cell.stackSize=countDestroedSources; + IHLUtils.addItemStackToInventory(player, cell); + if(emptyCells.stackSize>0) + { + IHLUtils.addItemStackToInventory(player, emptyCells); + } + } + + private Set searchSourcesAndDestroyThem(World world, BlockWithCoordinates blockXYZ, int countCells) + { + int startx = blockXYZ.x; + int starty = blockXYZ.y; + int startz = blockXYZ.z; + int currentFlowDecay=getFlowDecay(world, blockXYZ, startx, starty, startz); + HashSet outputSet = new HashSet(); + for (int i=0; i<256;i++) + { + if(getFlowDecay(world, blockXYZ, startx, starty+1, startz)>=0) + { + starty++; + currentFlowDecay=getFlowDecay(world, blockXYZ, startx, starty, startz); + } + + else if(getFlowDecay(world, blockXYZ, startx+1, starty+1, startz)>=0) + { + starty++; + startx++; + currentFlowDecay=getFlowDecay(world, blockXYZ, startx, starty, startz); + } + + else if(getFlowDecay(world, blockXYZ, startx-1, starty+1, startz)>=0) + { + starty++; + startx--; + currentFlowDecay=getFlowDecay(world, blockXYZ, startx, starty, startz); + } + + else if(getFlowDecay(world, blockXYZ, startx, starty+1, startz+1)>=0) + { + starty++; + startz++; + currentFlowDecay=getFlowDecay(world, blockXYZ, startx, starty, startz); + } + + else if(getFlowDecay(world, blockXYZ, startx, starty+1, startz-1)>=0) + { + starty++; + startz--; + currentFlowDecay=getFlowDecay(world, blockXYZ, startx, starty, startz); + } + //Start checking neighbor blocks to lower flow decay. + else if(getFlowDecay(world, blockXYZ, startx-1, starty, startz) xyzlist = new ArrayList(); + if(currentFlowDecay==0) + { + xyzlist.add(new XYZ(startx, starty, startz)); + outputSet.add(new BlockWithCoordinates(world.getBlock(startx, starty, startz), startx, starty, startz,0)); + int listPos=0; + for(int i=0;i<=countCells;i++) + { + if(getFlowDecay(world, blockXYZ, startx-1, starty, startz)==0 && !xyzlist.contains(new XYZ(startx-1, starty, startz))) + { + startx--; + xyzlist.add(new XYZ(startx, starty, startz)); + listPos=xyzlist.size()-1; + outputSet.add(new BlockWithCoordinates(world.getBlock(startx, starty, startz), startx, starty, startz,0)); + } + else if(getFlowDecay(world, blockXYZ, startx, starty, startz+1)==0 && !xyzlist.contains(new XYZ(startx, starty, startz+1))) + { + startz++; + xyzlist.add(new XYZ(startx, starty, startz)); + listPos=xyzlist.size()-1; + outputSet.add(new BlockWithCoordinates(world.getBlock(startx, starty, startz), startx, starty, startz,0)); + } + else if(getFlowDecay(world, blockXYZ, startx, starty, startz-1)==0 && !xyzlist.contains(new XYZ(startx, starty, startz-1))) + { + startz--; + xyzlist.add(new XYZ(startx, starty, startz)); + listPos=xyzlist.size()-1; + outputSet.add(new BlockWithCoordinates(world.getBlock(startx, starty, startz), startx, starty, startz,0)); + } + else if(getFlowDecay(world, blockXYZ, startx+1, starty, startz)==0 && !xyzlist.contains(new XYZ(startx+1, starty, startz))) + { + startx++; + xyzlist.add(new XYZ(startx, starty, startz)); + listPos=xyzlist.size()-1; + outputSet.add(new BlockWithCoordinates(world.getBlock(startx, starty, startz), startx, starty, startz,0)); + } + else + { + if(listPos>0) + { + listPos--; + XYZ xyz = xyzlist.get(listPos); + startx=xyz.x; + starty=xyz.y; + startz=xyz.z; + } + } + } + } + return outputSet; + } + + private int countEmptyCells(ItemStack fluidCell, EntityPlayer player) { + int num=0; + ItemStack[] inv = player.inventory.mainInventory; + for (int i=0;i<=35;i++) + { + if(inv[i]!=null) + { + if(inv[i].getItem() == fluidCell.getItem()) + { + if(FluidContainerRegistry.isEmptyContainer(inv[i])) + { + num+=inv[i].stackSize; + } + } + } + } + return num; + } + + private int countAmountOfEmptyFluidCells(ItemStack fluidCell, FluidStack fluid, EntityPlayer entityPlayer) { + int num=0; + for (int i=0;imaxMeta) + { + return world.setBlockToAir(x, y, z); + } + else if(isWaterBlock()) + { + if(world.setBlock(x,y,z,Blocks.flowing_water,meta,3)) + { + world.scheduleBlockUpdate(x,y,z,Blocks.flowing_water,2); + return true; + } + return false; + } + else if(isLavaBlock()) + { + if(world.setBlock(x,y,z,Blocks.flowing_lava,meta,3)) + { + world.scheduleBlockUpdate(x,y,z,Blocks.flowing_lava,2); + return true; + } + return false; + } + return world.setBlockMetadataWithNotify(x, y, z, meta, 3); +} + +public boolean isSameTypeBlock(World world, int x2, int y2, int z2) +{ + Block block2 = world.getBlock(x2, y2, z2); + if(isWaterBlock()) + { + return block2==Blocks.water||block2==Blocks.flowing_water; + } + else if(isLavaBlock()) + { + return block2==Blocks.lava||block2==Blocks.flowing_lava; + } + else + { + return block2==block; + } +} + +public boolean isWaterBlock() +{ + if(block==Blocks.water||block==Blocks.flowing_water) + { + return true; + } + return false; +} + +public boolean isLavaBlock() +{ + if(block==Blocks.lava||block==Blocks.flowing_lava) + { + return true; + } + return false; +} + +@Override +public boolean equals(Object other) +{ + if(other instanceof BlockWithCoordinates) + { + BlockWithCoordinates bwc = (BlockWithCoordinates)other; + return bwc.block==this.block && bwc.x==this.x && bwc.y==this.y && bwc.z==this.z; + } + return false; +} + +} diff --git a/src/main/java/ihl/handpump/IHLHandPump.java b/src/main/java/ihl/handpump/IHLHandPump.java new file mode 100644 index 0000000..a21919d --- /dev/null +++ b/src/main/java/ihl/handpump/IHLHandPump.java @@ -0,0 +1,351 @@ +package ihl.handpump; + +import java.util.LinkedList; +import java.util.List; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ic2.api.item.ElectricItem; +import ic2.api.item.IBoxable; +import ic2.api.item.IC2Items; +import ic2.api.item.IElectricItem; +import ic2.api.item.IItemHudInfo; +import ic2.core.item.resources.ItemCell; +import ic2.core.util.LiquidUtil; +import ihl.IHLCreativeTab; +import ihl.IHLMod; +import ihl.IHLModInfo; +import ihl.utils.IHLUtils; +import ihl.worldgen.ores.IHLFluid; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; +import net.minecraftforge.fluids.BlockFluidBase; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.IFluidContainerItem; + +public class IHLHandPump extends Item implements IElectricItem, IBoxable, IItemHudInfo { + + protected int tier=1; + protected int maxCharge=30000; + protected int operationEUCost=600; + protected int transferLimit = 2000; + + public IHLHandPump() + { + super(); + this.setMaxDamage(27); + this.maxCharge=IHLMod.config.handpumpMaxCharge; + this.operationEUCost=IHLMod.config.handpumpOperationEUCost; + this.tier=IHLMod.config.handpumpTier; + this.setCreativeTab(IHLCreativeTab.tab); + this.maxStackSize=1; + } + + @Override + public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer) + { + MovingObjectPosition movingobjectposition = IHLUtils.returnMOPFromPlayer(entityPlayer, world); + if(movingobjectposition!=null) + { + int x=movingobjectposition.blockX; + int y=movingobjectposition.blockY; + int z=movingobjectposition.blockZ; + Block block = world.getBlock(x, y, z); + if(!block.getMaterial().isLiquid()) + { + y++; + block = world.getBlock(x, y, z); + if(!block.getMaterial().isLiquid()) + { + return itemStack; + } + } + if(world.isRemote && ElectricItem.manager.use(itemStack, this.operationEUCost, entityPlayer)) + { + entityPlayer.playSound(IHLModInfo.MODID+":handpumpOne", (float) (Math.random()*0.2D+0.6D), (float) (Math.random()*0.1D+0.9D)); + return itemStack; + } + else + { + BlockWithCoordinates blockXYZ = this.searchSource(world, x, y, z); + if(blockXYZ==null) + { + return itemStack; + } + block = blockXYZ.block; + FluidStack fluid1 = null; + if(block instanceof BlockFluidBase) + { + fluid1 = ((BlockFluidBase)block).drain(world, blockXYZ.x, blockXYZ.y, blockXYZ.z, false); + } + else if(blockXYZ.isWaterBlock()) + { + fluid1 = new FluidStack(FluidRegistry.WATER, 1000); + } + else if(blockXYZ.isLavaBlock()) + { + fluid1 = new FluidStack(FluidRegistry.LAVA, 1000); + } + int amount2=0; + ItemStack stack = this.getItemStackContains(fluid1, entityPlayer); + if(stack!=null && fluid1 != null) + { + amount2 = LiquidUtil.fillContainerStack(stack, entityPlayer, fluid1, true); + } + if(amount2 > 0) + { + if(ElectricItem.manager.use(itemStack, this.operationEUCost, entityPlayer) && blockXYZ.setMetadataOrDestroyBlock(world, blockXYZ.meta+1,7)) + { + ElectricItem.manager.discharge(itemStack,this.operationEUCost,1,false,false, false); + LiquidUtil.fillContainerStack(stack, entityPlayer, fluid1, false); + entityPlayer.inventoryContainer.detectAndSendChanges(); + } + return itemStack; + } + else if(entityPlayer.inventory.hasItemStack(IC2Items.getItem("cell"))) + { + if(ElectricItem.manager.use(itemStack, this.operationEUCost, entityPlayer) && blockXYZ.setMetadataOrDestroyBlock(world, blockXYZ.meta+1,7)) + { + ElectricItem.manager.discharge(itemStack,this.operationEUCost,1,false,false, false); + this.fillFluidCell(fluid1, entityPlayer); + entityPlayer.inventoryContainer.detectAndSendChanges(); + return itemStack; + } + } + } + } + return itemStack; + } + + + protected ItemStack getItemStackContains(FluidStack fluidStack, EntityPlayer player) { + for (int i=0;i 0) + { + return player.inventory.getStackInSlot(i); + } + } + } + } + return null; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister par1IconRegister) + { + this.itemIcon = par1IconRegister.registerIcon(IHLModInfo.MODID + ":itemElectricHandpump"); + } + + @Override + public boolean canProvideEnergy(ItemStack itemStack) { + return false; + } + + @Override + public Item getChargedItem(ItemStack itemStack) { + return this; + } + + @Override + public Item getEmptyItem(ItemStack itemStack) { + return this; + } + + @Override + public double getMaxCharge(ItemStack itemStack) { + return this.maxCharge; + } + + @Override + public double getTransferLimit(ItemStack itemStack) { + return this.transferLimit; + } + + @Override + public int getTier(ItemStack itemStack) { + return this.tier; + } + + @Override + public List getHudInfo(ItemStack itemStack) { + LinkedList info = new LinkedList(); + info.add(ElectricItem.manager.getToolTip(itemStack)); + info.add("Power Tier: " + this.tier); + return info; + } + + @SuppressWarnings({ "unchecked", "rawtypes" }) + @Override + public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean b) + { + info.add("PowerTier: " + this.tier); + } + + @Override + public boolean canBeStoredInToolbox(ItemStack itemstack) { + return true; + } + + @Override + public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) + { + return false; + } + + @Override + @SideOnly(Side.CLIENT) + @SuppressWarnings({ "unchecked", "rawtypes" }) + public void getSubItems(Item item, CreativeTabs tabs, List itemList) + { + itemList.add(this.getItemStack(this.maxCharge)); + itemList.add(this.getItemStack(0)); + } + + public ItemStack getItemStack(int charge) + { + ItemStack ret = new ItemStack(this); + ElectricItem.manager.charge(ret, charge, this.maxCharge, true, false); + return ret; + } + + + @Override + public double getDurabilityForDisplay(ItemStack stack) + { + return (this.maxCharge-ElectricItem.manager.getCharge(stack))/this.maxCharge; + } + + protected void fillFluidCell(FluidStack fluid1, EntityPlayer player) + { + ItemStack cell = IHLFluid.getCell(fluid1.getFluid().getName()); + if(cell==null) + { + return; + } + ItemStack[] inv = player.inventory.mainInventory; + for (int i=0;i<=35;i++) + { + if(inv[i]!=null) + { + if(inv[i].getItem() instanceof ItemCell) + { + if(inv[i].getItemDamage()==0) + { + if (IHLUtils.addItemStackToInventory(player, cell)) + { + if(inv[i].stackSize<=1) + { + ItemStack sourceItemStack = inv[i].copy(); + sourceItemStack.stackSize=player.inventory.clearInventory(sourceItemStack.getItem(),0)-1; + if(sourceItemStack.stackSize>0) + { + player.inventory.addItemStackToInventory(sourceItemStack); + } + } + else + { + inv[i].stackSize--; + } + return; + } + } + } + } + } + } + + protected BlockWithCoordinates searchSource(World world, int startx, int starty, int startz) + { + int currentFlowDecay=getFlowDecay(world, startx, starty, startz); + for (int i=0; i<256;i++) + { + if(getFlowDecay(world, startx, starty+1, startz)>=0) + { + starty++; + currentFlowDecay=getFlowDecay(world, startx, starty, startz); + } + + else if(getFlowDecay(world, startx+1, starty+1, startz)>=0) + { + starty++; + startx++; + currentFlowDecay=getFlowDecay(world, startx, starty, startz); + } + + else if(getFlowDecay(world, startx-1, starty+1, startz)>=0) + { + starty++; + startx--; + currentFlowDecay=getFlowDecay(world, startx, starty, startz); + } + + else if(getFlowDecay(world, startx, starty+1, startz+1)>=0) + { + starty++; + startz++; + currentFlowDecay=getFlowDecay(world, startx, starty, startz); + } + + else if(getFlowDecay(world, startx, starty+1, startz-1)>=0) + { + starty++; + startz--; + currentFlowDecay=getFlowDecay(world, startx, starty, startz); + } + //Start checking neighbor blocks to lower flow decay. + else if(getFlowDecay(world, startx-1, starty, startz) getCableList(); + void removeAttachedChains(); + void remove(IHLCable cable); + double getEnergyAmountThisNodeWant(); + void injectEnergyInThisNode(double amount, double voltage); + public boolean isTileEntityBaseInvalid(); +} diff --git a/src/main/java/ihl/interfaces/IFluidTankVisual.java b/src/main/java/ihl/interfaces/IFluidTankVisual.java new file mode 100644 index 0000000..cb34424 --- /dev/null +++ b/src/main/java/ihl/interfaces/IFluidTankVisual.java @@ -0,0 +1,8 @@ +package ihl.interfaces; + +public interface IFluidTankVisual { +int getVisibleFluidId(); +int getVisibleFluidAmount(); +float getRenderLiquidLevel(); + +} diff --git a/src/main/java/ihl/interfaces/IItemHasMiniGUI.java b/src/main/java/ihl/interfaces/IItemHasMiniGUI.java new file mode 100644 index 0000000..6b3d88a --- /dev/null +++ b/src/main/java/ihl/interfaces/IItemHasMiniGUI.java @@ -0,0 +1,12 @@ +package ihl.interfaces; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.inventory.Slot; + +public interface IItemHasMiniGUI +{ + @SideOnly(Side.CLIENT) + ItemMiniGUI getMiniGUI(GuiContainer gui, Slot slot); +} diff --git a/src/main/java/ihl/interfaces/IMultiPowerCableHolder.java b/src/main/java/ihl/interfaces/IMultiPowerCableHolder.java new file mode 100644 index 0000000..a6b1eba --- /dev/null +++ b/src/main/java/ihl/interfaces/IMultiPowerCableHolder.java @@ -0,0 +1,11 @@ +package ihl.interfaces; + +import net.minecraft.entity.player.EntityPlayer; + +public interface IMultiPowerCableHolder +{ + IEnergyNetNode getEnergyNetNode(short facing); + short getSide(EntityPlayer player); + void removeAttachedChains(); + boolean isCableRemoved(int chainUniqueID); +} diff --git a/src/main/java/ihl/interfaces/INetworkListener.java b/src/main/java/ihl/interfaces/INetworkListener.java new file mode 100644 index 0000000..7902df5 --- /dev/null +++ b/src/main/java/ihl/interfaces/INetworkListener.java @@ -0,0 +1,12 @@ +package ihl.interfaces; + +import io.netty.buffer.ByteBufInputStream; +import net.minecraft.entity.player.EntityPlayerMP; + +public interface INetworkListener +{ + void recieveData(ByteBufInputStream byteBufInputStream); + int getId(); + boolean isInvalid(); + void registerAndSendData(EntityPlayerMP player); +} diff --git a/src/main/java/ihl/interfaces/ISelectionBoxSpecialRenderer.java b/src/main/java/ihl/interfaces/ISelectionBoxSpecialRenderer.java new file mode 100644 index 0000000..2c27f32 --- /dev/null +++ b/src/main/java/ihl/interfaces/ISelectionBoxSpecialRenderer.java @@ -0,0 +1,10 @@ +package ihl.interfaces; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MovingObjectPosition; + +public interface ISelectionBoxSpecialRenderer +{ + public void drawSelectionBox(EntityPlayer player, ItemStack currentItem, MovingObjectPosition movingObjectPosition, float partialTick); +} diff --git a/src/main/java/ihl/interfaces/IWire.java b/src/main/java/ihl/interfaces/IWire.java new file mode 100644 index 0000000..c2a9c0b --- /dev/null +++ b/src/main/java/ihl/interfaces/IWire.java @@ -0,0 +1,9 @@ +package ihl.interfaces; + +import net.minecraft.item.ItemStack; + +public interface IWire { + public String getTag(); + public String getTagSecondary(); + public boolean isSameWire(ItemStack stack1, ItemStack stack2); +} diff --git a/src/main/java/ihl/interfaces/IWorkspaceElement.java b/src/main/java/ihl/interfaces/IWorkspaceElement.java new file mode 100644 index 0000000..7f57ca7 --- /dev/null +++ b/src/main/java/ihl/interfaces/IWorkspaceElement.java @@ -0,0 +1,10 @@ +package ihl.interfaces; + +import ic2.api.tile.IWrenchable; + +public interface IWorkspaceElement extends IWrenchable +{ + boolean canBeUsed(); + void use(); + boolean getIsInvalid(); +} diff --git a/src/main/java/ihl/interfaces/ItemMiniGUI.java b/src/main/java/ihl/interfaces/ItemMiniGUI.java new file mode 100644 index 0000000..249fb7d --- /dev/null +++ b/src/main/java/ihl/interfaces/ItemMiniGUI.java @@ -0,0 +1,29 @@ +package ihl.interfaces; + +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.inventory.Slot; + +public abstract class ItemMiniGUI { + protected final GuiContainer guiBase; + protected final Slot slotBase; + + protected final int TEXT_BOX_POSX = 50; + protected final int TEXT_BOX_POSY = 16; + protected final int TEXT_BOX_WIDTH = 42; + protected final int UNITS_LABEL_POSX = 105; + protected final int HEIGHT = 39; + protected final int RUNNER_POSY = 30; + + public ItemMiniGUI(GuiContainer gui, Slot slot) { + guiBase = gui; + slotBase = slot; + } + + public abstract void displayGUI(); + + public abstract boolean handleMouseClick(int mouseButton, int mouseX, int mouseY); + + public abstract boolean handleKeyTyped(char characterTyped, int keyIndex); + + public abstract void onGUIClosed(); +} diff --git a/src/main/java/ihl/items_blocks/FiberItem.java b/src/main/java/ihl/items_blocks/FiberItem.java new file mode 100644 index 0000000..79e50f9 --- /dev/null +++ b/src/main/java/ihl/items_blocks/FiberItem.java @@ -0,0 +1,109 @@ +package ihl.items_blocks; + +import java.util.List; + +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ihl.IHLCreativeTab; +import ihl.IHLModInfo; +import ihl.interfaces.IWire; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +public class FiberItem extends Item implements IWire { + + protected String info; + protected FiberMaterial material; + private String registryName; + + public FiberItem(FiberMaterial material1, int leadsNum1, String registryName1) + { + super(); + this.registryName=registryName1; + this.material=material1; + this.info=material.description; + this.setCreativeTab(IHLCreativeTab.tab); + this.setMaxStackSize(1); + this.setUnlocalizedName(registryName); + } + + public FiberItem() + { + super(); + } + + public static void init() + { + FiberMaterial[] var1 = FiberMaterial.values(); + for(int i=0;i yellowColoredWires = new HashSet(3); + + public FlexibleCableItem() { + super(); + yellowColoredWires.add("Gold"); + yellowColoredWires.add("Copper"); + yellowColoredWires.add("Bronze"); + this.setCreativeTab(IHLCreativeTab.tab); + this.setMaxStackSize(1); + this.setFull3D(); + instance = this; + } + + @Override + @SideOnly(Side.CLIENT) + @SuppressWarnings({ "rawtypes", "unchecked" }) + public void getSubItems(Item item, CreativeTabs tabs, List itemList) { + itemList.add(IHLUtils.getUninsulatedWire("Copper", 160, 15)); + itemList.add(IHLUtils.getUninsulatedWire("Copper", 160, 240)); + itemList.add(IHLUtils.getUninsulatedWire("Steel", 160, 15)); + itemList.add(IHLUtils.getUninsulatedWire("Steel", 160, 240)); + itemList.add(IHLUtils.getInsulatedWire("Copper", 160, 15, "RawRubber", 100)); + itemList.add(IHLUtils.getInsulatedWire("Copper", 160, 240, "RawRubber", 100)); + itemList.add(IHLUtils.getInsulatedWire("Steel", 160, 15, "RawRubber", 100)); + itemList.add(IHLUtils.getInsulatedWire("Steel", 160, 240, "RawRubber", 100)); + itemList.add(IHLUtils.getInsulatedWire("Copper", 160, 15, "Rubber", 100)); + itemList.add(IHLUtils.getInsulatedWire("Copper", 160, 240, "Rubber", 100)); + itemList.add(IHLUtils.getInsulatedWire("Steel", 160, 15, "Rubber", 100)); + itemList.add(IHLUtils.getInsulatedWire("Steel", 160, 240, "Rubber", 100)); + } + + public static void init() { + GameRegistry.registerItem(new FlexibleCableItem(), "copperWire"); + } + + @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); + if (!world.isRemote && t instanceof IEnergyTile && !(t instanceof IMultiPowerCableHolder) + && !(t instanceof ICableHolder)) { + ForgeDirection direction = ForgeDirection.getOrientation(facing); + x += direction.offsetX; + y += direction.offsetY; + z += direction.offsetZ; + t = world.getTileEntity(x, y, z); + if (IHLUtils.isBlockCanBeReplaced(world, x, y, z)) { + world.setBlock(x, y, z, IHLMod.cableAnchorBlock); + } else if (!(t instanceof AnchorTileEntity)) { + return false; + } + t = world.getTileEntity(x, y, z); + } + if (world.isRemote) + world.playSoundEffect(x + 0.5F, y + 0.5F, z + 0.5F, "step.stone", 1.0F, 0.8F); + if (!world.isRemote && t != null + && ((t instanceof IEnergyNetNode) + || (t instanceof IMultiPowerCableHolder)) + && stack.stackTagCompound.getInteger("fullLength") >= 1) { + double ppx, ppy, ppz; + ICableHolder te; + if (t instanceof IMultiPowerCableHolder) { + facing = ((IMultiPowerCableHolder) t).getSide(player); + if (facing == -1) { + return false; + } else { + te = ((IMultiPowerCableHolder) t).getEnergyNetNode(facing); + } + } else { + te = (ICableHolder) t; + } + ppx = te.getPortPos(player)[0]; + ppy = te.getPortPos(player)[1]; + ppz = te.getPortPos(player)[2]; + if (stack.stackTagCompound.getBoolean("firstConnection")) { + int x1 = stack.stackTagCompound.getInteger("connectorX"); + int y1 = stack.stackTagCompound.getInteger("connectorY"); + int z1 = stack.stackTagCompound.getInteger("connectorZ"); + int l1 = stack.stackTagCompound.getInteger("fullLength"); + int l2 = stack.stackTagCompound.getInteger("length"); + if (x == x1 && y == y1 && z == z1) { + this.cleanUp(stack.stackTagCompound.getInteger("chainUID")); + stack.stackTagCompound.setBoolean("firstConnection", false); + stack.stackTagCompound.setInteger("length", l1); + return true; + } + int t2DimensionId = stack.stackTagCompound.getInteger("connectorDimensionId"); + short facing2 = stack.stackTagCompound.getShort("connectorFacing"); + TileEntity t2 = MinecraftServer.getServer().worldServerForDimension(t2DimensionId).getTileEntity(x1, y1, + z1); + if (t2 == null) { + stack.stackTagCompound.setBoolean("firstConnection", false); + return false; + } else { + if (t instanceof IMultiPowerCableHolder) { + facing = ((IMultiPowerCableHolder) t).getSide(player); + if (facing == -1) { + return false; + } else { + te = ((IMultiPowerCableHolder) t).getEnergyNetNode(facing); + } + } else { + te = (ICableHolder) t; + } + te.setCableCheck(true); + } + this.connect(t, facing, t2, facing2, stack); + stack.stackTagCompound.setInteger("fullLength", l2); + if (l2 <= 0) { + stack.stackSize--; + } + stack.stackTagCompound.setBoolean("firstConnection", false); + stack.stackTagCompound.setInteger("chainArrangeNumber", + stack.stackTagCompound.getInteger("chainArrangeNumber") + 1); + x = x1; + y = y1; + z = z1; + } else { + te.setCableCheck(false); + stack.stackTagCompound.setBoolean("firstConnection", true); + stack.stackTagCompound.setInteger("connectorX", x); + stack.stackTagCompound.setInteger("connectorY", y); + stack.stackTagCompound.setInteger("connectorZ", z); + stack.stackTagCompound.setShort("connectorFacing", facing); + stack.stackTagCompound.setInteger("connectorDimensionId", world.provider.dimensionId); + stack.stackTagCompound.setInteger("prevDimensionId", world.provider.dimensionId); + stack.stackTagCompound.setInteger("chainArrangeNumber", 0); + stack.stackTagCompound.setInteger("chainUID", world.rand.nextInt()); + stack.stackTagCompound.setDouble("prevNodePosX", ppx); + stack.stackTagCompound.setDouble("prevNodePosY", ppy); + stack.stackTagCompound.setDouble("prevNodePosZ", ppz); + stack.stackTagCompound.setInteger("length", stack.stackTagCompound.getInteger("length")-1); + } + NodeEntity node = newNode(world, player.posX, player.posY, player.posZ, stack, + stack.stackTagCompound.getInteger("chainArrangeNumber"), x, y, z); + node.virtualNodePosX = ppx; + node.virtualNodePosY = ppy; + node.virtualNodePosZ = ppz; + return true; + } else { + return false; + } + } + + protected void connect(TileEntity t1, short facing, TileEntity t2, short facing2, ItemStack stack) { + IEnergyNetNode te; + IEnergyNetNode te1; + if (t1 instanceof IEnergyNetNode) { + te = (IEnergyNetNode) t1; + } else { + te = ((IMultiPowerCableHolder) t1).getEnergyNetNode(facing); + } + if (t2 instanceof IEnergyNetNode) { + te1 = (IEnergyNetNode) t2; + } else { + te1 = ((IMultiPowerCableHolder) t2).getEnergyNetNode(facing2); + } + int newGridID = IHLMod.enet.mergeGrids(te.getGridID(), te1.getGridID()); + int l1 = stack.stackTagCompound.getInteger("fullLength"); + int l2 = stack.stackTagCompound.getInteger("length"); + NBTTagCompound cable = (NBTTagCompound) stack.stackTagCompound.copy(); + cable.setInteger("length", l1 - l2); + cable.setBoolean("firstConnection", false); + cable.setInteger("connectorX1", t1.xCoord); + cable.setInteger("connectorY1", t1.yCoord); + cable.setInteger("connectorZ1", t1.zCoord); + cable.setShort("connectorFacing1", facing); + cable.setInteger("connectorDimensionId1", t1.getWorldObj().provider.dimensionId); + te.addCable(cable); + te1.addCable(cable); + te.setGrid(newGridID); + te1.setGrid(newGridID); + } + + private int getTransverseSection(ItemStack stack) { + if (stack.stackTagCompound == null) { + stack.stackTagCompound = new NBTTagCompound(); + } + return stack.stackTagCompound.getInteger("transverseSection"); + } + + public String getMaterial(ItemStack stack) { + if (stack.stackTagCompound == null) { + stack.stackTagCompound = new NBTTagCompound(); + } + return stack.stackTagCompound.getString("material"); + } + + public int getVoltageLimit(ItemStack stack) { + if (stack.stackTagCompound == null) { + stack.stackTagCompound = new NBTTagCompound(); + } + if (stack.stackTagCompound.hasKey("maxVoltage")) { + return stack.stackTagCompound.getInteger("maxVoltage"); + } + return 0; + } + + private long getResistance(ItemStack stack) { + if (stack.stackTagCompound == null) { + stack.stackTagCompound = new NBTTagCompound(); + } + return IHLUtils.getResistance(stack.stackTagCompound); + } + + private void cleanUp(int uid) { + Set cs = IHLMod.proxy.nodeEntityRegistry.get(uid); + if (cs != null) { + for (NodeEntity ne : cs) { + if (ne != null) { + ne.setDead(); + } + } + } + } + + @Override + public void onUpdate(ItemStack stack, World world, Entity entity, int slotIndex, boolean isCurrentItem) { + if (!world.isRemote && stack.stackTagCompound != null) { + if (stack.stackTagCompound.getBoolean("firstConnection")) { + int leight = stack.stackTagCompound.getInteger("length"); + if (leight > 0) { + double pnpx = stack.stackTagCompound.getDouble("prevNodePosX"); + double pnpy = stack.stackTagCompound.getDouble("prevNodePosY"); + double pnpz = stack.stackTagCompound.getDouble("prevNodePosZ"); + double ppx = entity.posX; + double ppy = entity.posY; + double ppz = entity.posZ; + + if (pnpx != 0D && pnpy != 0D && pnpz != 0D) { + double sqd = (ppx - pnpx) * (ppx - pnpx) + (ppy - pnpy) * (ppy - pnpy) + + (ppz - pnpz) * (ppz - pnpz); + if (sqd > 2D) { + int can = stack.stackTagCompound.getInteger("chainArrangeNumber") + 1; + int cx = stack.stackTagCompound.getInteger("connectorX"); + int cy = stack.stackTagCompound.getInteger("connectorY"); + int cz = stack.stackTagCompound.getInteger("connectorZ"); + NodeEntity node = newNode(world, ppx, ppy, ppz, stack, can, cx, cy, cz); + node.shouldFollowPlayer = true; + node.virtualNodePosX = ppx + (ppx - pnpx) * 2; + node.virtualNodePosY = ppy + (ppy - pnpy) * 2; + node.virtualNodePosZ = ppz + (ppz - pnpz) * 2; + stack.stackTagCompound.setInteger("chainArrangeNumber", can); + stack.stackTagCompound.setDouble("prevNodePosX", ppx); + stack.stackTagCompound.setDouble("prevNodePosY", ppy); + stack.stackTagCompound.setDouble("prevNodePosZ", ppz); + stack.stackTagCompound.setInteger("length", --leight); + stack.stackTagCompound.setInteger("prevDimensionId", world.provider.dimensionId); + } + } + } + } + } + } + + public void onPlayerTeleport(PlayerChangedDimensionEvent event) { + EntityPlayer player = event.player; + for (ItemStack stack : player.inventory.mainInventory) { + if (stack != null && stack.getItem() instanceof FlexibleCableItem) { + if (stack.stackTagCompound.getBoolean("firstConnection")) { + int can = -1; + Set ns = IHLMod.proxy.nodeEntityRegistry + .get(stack.stackTagCompound.getInteger("chainUID")); + if (ns != null) { + NodeEntity lastNode = null; + for (NodeEntity node : ns) { + node.shouldFollowPlayer = false; + if (node.chainArrangeNumber > can) { + lastNode = node; + can = node.chainArrangeNumber; + } + } + if (lastNode != null) { + lastNode.setVirtualNodePosToNearestPortal(); + } + } + double[] cc = IHLUtils.tracePlayerView(player); + can = stack.stackTagCompound.getInteger("chainArrangeNumber") + 1; + int cx = stack.stackTagCompound.getInteger("connectorX"); + int cy = stack.stackTagCompound.getInteger("connectorY"); + int cz = stack.stackTagCompound.getInteger("connectorZ"); + int leight = stack.stackTagCompound.getInteger("length"); + NodeEntity node = newNode(MinecraftServer.getServer().worldServerForDimension(event.toDim), cc[0], + player.posY, cc[2], stack, can, cx, cy, cz); + node.setVirtualNodePosToNearestPortal(); + stack.stackTagCompound.setInteger("chainArrangeNumber", can); + stack.stackTagCompound.setDouble("prevNodePosX", cc[0]); + stack.stackTagCompound.setDouble("prevNodePosY", cc[1]); + stack.stackTagCompound.setDouble("prevNodePosZ", cc[2]); + stack.stackTagCompound.setInteger("length", --leight); + stack.stackTagCompound.setInteger("prevDimensionId", event.toDim); + } + } + } + } + + protected NodeEntity newNode(World world, double ppx, double ppy, double ppz, ItemStack stack, int can, int x, + int y, int z) { + PowerCableNodeEntity node = new PowerCableNodeEntity(world); + node.setPosition(ppx, ppy, ppz); + node.setChainUniqueID(stack.stackTagCompound.getInteger("chainUID")); + short facing = stack.stackTagCompound.getShort("connectorFacing"); + int dimensionId = stack.stackTagCompound.getInteger("connectorDimensionId"); + node.setAnchor(x, y, z, facing, dimensionId); + node.chainArrangeNumber = can; + node.colorIndex = this.getColor(stack); + node.addCable((NBTTagCompound) stack.stackTagCompound.copy()); + if (stack.stackTagCompound.hasKey("insulationMaterial")) { + node.type = 1; + } else { + node.type = 0; + } + world.spawnEntityInWorld(node); + return node; + } + + private int getColor(ItemStack stack) { + if (!stack.stackTagCompound.hasKey("insulationMaterial")) { + if (yellowColoredWires.contains(this.getMaterial(stack))) { + return 0xFF9900; + } else { + return 0xAAAABB; + } + } + return 0xFFFFFF; + } + + @Override + @SuppressWarnings({ "rawtypes", "unchecked" }) + public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean flag) { + if (itemStack.stackTagCompound != null) { + info.add(StatCollector.translateToLocal("ihl.lenght")+": " + itemStack.stackTagCompound.getInteger("length") + " m"); + info.add(StatCollector.translateToLocal("ihl.wire_material")+": " + this.getMaterial(itemStack)); + info.add(StatCollector.translateToLocal("ihl.resistivity")+": " + this.getResistance(itemStack) / 1000F + " V^2/(EU*m)"); + info.add(StatCollector.translateToLocal("ihl.transverse_section")+": " + this.getTransverseSection(itemStack) / 10F + " sq. mm."); + if (itemStack.stackTagCompound.hasKey("insulationMaterial")) { + info.add(StatCollector.translateToLocal("ihl.insulation_material")+": " + this.getInsulationMaterial(itemStack)); + info.add(StatCollector.translateToLocal("ihl.insulation_thickness")+": " + this.getInsulationThickness(itemStack) / 10f + " mm"); + info.add(StatCollector.translateToLocal("ihl.insulation_beakdown_voltage")+": " + this.getVoltageLimit(itemStack) / 1000 + " kV"); + } + info.add(StatCollector.translateToLocal("ihl.powerCableTooltip")); + } + } + + @Override + public String getTag() { + return "length"; + } + + @Override + public String getTagSecondary() { + return "fullLength"; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister par1IconRegister) { + this.itemIcon = par1IconRegister.registerIcon(IHLModInfo.MODID + ":copperWire"); + } + + @Override + public String getUnlocalizedName(ItemStack stack) { + if (stack.stackTagCompound != null && !this.getInsulationMaterial(stack).equals("null")) { + return "cable"; + } + return "wire"; + } + + @Override + public boolean isSameWire(ItemStack stack1, ItemStack stack2) { + if (stack1.getItem() == stack2.getItem() && stack1.getItemDamage() == stack2.getItemDamage()) { + if (stack1.stackTagCompound != null && stack2.stackTagCompound != null) { + return this.getMaterial(stack1).equals(this.getMaterial(stack2)) + && this.getTransverseSection(stack1) == this.getTransverseSection(stack2) + && this.getInsulationMaterial(stack1).equals(this.getInsulationMaterial(stack2)) + && this.getInsulationThickness(stack1) == this.getInsulationThickness(stack2); + } + } + return false; + } + + public String getInsulationMaterial(ItemStack stack) { + if (stack.stackTagCompound.hasKey("insulationMaterial")) { + return stack.stackTagCompound.getString("insulationMaterial"); + } + return "null"; + } + + public int getInsulationThickness(ItemStack stack) { + if (stack.stackTagCompound.hasKey("insulationThickness")) { + return stack.stackTagCompound.getInteger("insulationThickness"); + } + return 0; + } +} diff --git a/src/main/java/ihl/items_blocks/FlexiblePipeItem.java b/src/main/java/ihl/items_blocks/FlexiblePipeItem.java new file mode 100644 index 0000000..f5bb3fd --- /dev/null +++ b/src/main/java/ihl/items_blocks/FlexiblePipeItem.java @@ -0,0 +1,107 @@ +package ihl.items_blocks; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ihl.IHLCreativeTab; +import ihl.IHLModInfo; +import ihl.utils.IHLUtils; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.IIcon; + +public class FlexiblePipeItem extends Item { + + private static Map iconMap = new HashMap(); + private static Map nameMap = new HashMap(); + + public FlexiblePipeItem() + { + super(); + this.setCreativeTab(IHLCreativeTab.tab); + this.setMaxStackSize(1); + this.setUnlocalizedName("flexiblePipe"); + } + + public static void init() + { + FlexiblePipeItem item = new FlexiblePipeItem(); + Type[] var1 = Type.values(); + GameRegistry.registerItem(item,item.getUnlocalizedName()); + for(int i=0;i nameMap = new HashMap(); + + public IHLItemBlock(Block block1) { + super(block1); + this.setFull3D(); + this.setHasSubtypes(true); + this.setCreativeTab(IHLCreativeTab.tab); + } + + @Override + public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer player, World world, int x, int y, int z, int par7, + float par8, float par9, float par10) { + Block block = world.getBlock(x, y, z); + + if (block == Blocks.snow_layer && (world.getBlockMetadata(x, y, z) & 7) < 1) { + par7 = 1; + } else if (block != Blocks.vine && block != Blocks.tallgrass && block != Blocks.deadbush) { + if (par7 == 0) { + --y; + } + + if (par7 == 1) { + ++y; + } + + if (par7 == 2) { + --z; + } + + if (par7 == 3) { + ++z; + } + + if (par7 == 4) { + --x; + } + + if (par7 == 5) { + ++x; + } + } + + if (par1ItemStack.stackSize == 0) { + return false; + } else if (!player.canPlayerEdit(x, y, z, par7, par1ItemStack)) { + return false; + } else if (y == 255) { + return false; + } else if (world.canPlaceEntityOnSide(this.field_150939_a, x, y, z, false, par7, player, par1ItemStack)) { + int metadata = par1ItemStack.getItemDamage(); + int var13 = this.field_150939_a.onBlockPlaced(world, x, y, z, par7, par8, par9, par10, metadata); + + if (world.setBlock(x, y, z, this.field_150939_a, var13, 3)) { + if (world.getBlock(x, y, z) == this.field_150939_a) { + this.field_150939_a.onBlockPlacedBy(world, x, y, z, player, par1ItemStack); + this.field_150939_a.onPostBlockPlaced(world, x, y, z, var13); + TileEntity tile = world.getTileEntity(x, y, z); + if (tile instanceof IWrenchable && IC2.platform.isSimulating()) { + IWrenchable te = (IWrenchable) tile; + int var6 = MathHelper.floor_double(player.rotationPitch * 4.0F / 360.0F + 0.5D) & 3; + int l = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; + te.setFacing((short) 0); + boolean allDPlacing = te.getFacing()==0; + if (player.isSneaking()) { + if (var6 == 1 && allDPlacing) { + te.setFacing((short) 0); + } else if (var6 == 3 && allDPlacing) { + te.setFacing((short) 1); + } else { + + switch (l) { + case 0: + te.setFacing((short) 3); + break; + + case 1: + te.setFacing((short) 4); + break; + + case 2: + te.setFacing((short) 2); + break; + + case 3: + te.setFacing((short) 5); + } + } + } else { + if (var6 == 1 && allDPlacing) { + te.setFacing((short) 1); + } else if (var6 == 3 && allDPlacing) { + te.setFacing((short) 0); + } else { + + switch (l) { + case 0: + te.setFacing((short) 2); + break; + + case 1: + te.setFacing((short) 5); + break; + + case 2: + te.setFacing((short) 3); + break; + + case 3: + te.setFacing((short) 4); + } + } + } + } + } + + world.playSoundEffect(x + 0.5F, y + 0.5F, z + 0.5F, "step.stone", 1.0F, 0.8F); + --par1ItemStack.stackSize; + } + + return true; + } else { + return false; + } + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister par1IconRegister) { + this.itemIcon = par1IconRegister.registerIcon(IHLModInfo.MODID + ":sackItem"); + } + + public Block getBlockContained() { + return this.field_150939_a; + } + + @Override + @SideOnly(Side.CLIENT) + public CreativeTabs getCreativeTab() { + return this.field_150939_a.getCreativeTabToDisplayOn(); + } + + @Override + public String getUnlocalizedName(ItemStack stack) { + if (!nameMap.isEmpty() && nameMap.containsKey(stack.getItemDamage())) { + return nameMap.get(stack.getItemDamage()); + } else { + return this.field_150939_a.getUnlocalizedName(); + } + } + + @SuppressWarnings({ "rawtypes", "unchecked" }) + @Override + public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean flag) { + if (itemStack.stackTagCompound != null) { + if (itemStack.stackTagCompound.hasKey("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")); + info.add(StatCollector.translateToLocal("ihl.tooltip.step") + " 2: " + + StatCollector.translateToLocal("fill_from_top_with_molten_metal")); + info.add(StatCollector.translateToLocal("ihl.tooltip.step") + " 3: " + + StatCollector.translateToLocal("wait_for_10_seconds")); + info.add(StatCollector.translateToLocal("ihl.tooltip.step") + " 4: " + + StatCollector.translateToLocal("destroy_mold_to_get_results")); + + } else { + info.add(StatCollector.translateToLocal("ihl.tooltip.step") + " 1: " + + StatCollector.translateToLocal("fill_from_top_with_molten_metal")); + 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")); + } + if (itemStack.stackTagCompound.hasKey("explosionPower")) { + info.add(StatCollector.translateToLocal("ihl.explosionPower") + " " + + itemStack.stackTagCompound.getInteger("explosionPower") + " " + + StatCollector.translateToLocal("ihl.mTNT")); + } + } + } +} diff --git a/src/main/java/ihl/items_blocks/IHLTool.java b/src/main/java/ihl/items_blocks/IHLTool.java new file mode 100644 index 0000000..eb23ff5 --- /dev/null +++ b/src/main/java/ihl/items_blocks/IHLTool.java @@ -0,0 +1,444 @@ +package ihl.items_blocks; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ic2.api.energy.tile.IEnergySink; +import ic2.api.reactor.IReactor; +import ihl.IHLCreativeTab; +import ihl.IHLModInfo; +import ihl.flexible_cable.SetOfDiesMiniGUI; +import ihl.interfaces.IEnergyNetNode; +import ihl.interfaces.IItemHasMiniGUI; +import ihl.interfaces.IMultiPowerCableHolder; +import ihl.interfaces.ItemMiniGUI; +import ihl.utils.IHLUtils; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.passive.EntitySheep; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Slot; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.potion.Potion; +import net.minecraft.stats.AchievementList; +import net.minecraft.stats.StatList; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; +import net.minecraftforge.oredict.OreDictionary; +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 isWeaponMap = new HashMap(); + private static Map damageVersusEntityMap = new HashMap(); + public static Item instance; + + private IIcon dice240; + + public IHLTool() + { + super(); + this.setMaxDamage(0); + this.setNoRepair(); + this.setHasSubtypes(true); + this.setCreativeTab(IHLCreativeTab.tab); + this.setUnlocalizedName("ihlTool"); + this.setMaxStackSize(1); + instance=this; + } + + @Override + public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer) + { + if(itemStack.getItemDamage()!=19 || world.isRemote) + { + return itemStack; + } + MovingObjectPosition movingobjectposition = IHLUtils.returnMOPFromPlayer(entityPlayer, world); + if(movingobjectposition!=null) + { + int x=movingobjectposition.blockX; + int y=movingobjectposition.blockY; + int z=movingobjectposition.blockZ; + TileEntity te = world.getTileEntity(x, y, z); + if(te instanceof IReactor) + { + this.setThermometerTemperature(itemStack, entityPlayer, ((IReactor)te).getHeat()+273); + } + if(te instanceof IEnergySink) + { + System.out.println("demanded="+((IEnergySink)te).getDemandedEnergy()); + } + IEnergyNetNode node = null; + if(te instanceof IMultiPowerCableHolder) + { + node = ((IMultiPowerCableHolder)te).getEnergyNetNode((short) 0); + for(short i=0;i<6;i++){ + if(((IMultiPowerCableHolder)te).getEnergyNetNode(i).getGridID()!=-1) + node = ((IMultiPowerCableHolder)te).getEnergyNetNode(i); + } + } + if(te instanceof IEnergyNetNode) + { + node = ((IEnergyNetNode)te); + } + if(node!=null){ + System.out.println("gridId="+node.getGridID()); + if(node.getGridID()!=-1){ + System.out.println("grid energy="+node.getGrid().energy); + System.out.println("getEnergyAmountThisNodeWant()="+node.getEnergyAmountThisNodeWant()); + } + } + } + return itemStack; + } + + @Override + public final ItemStack getContainerItem(ItemStack stack) + { + ItemStack outStack = stack.copy(); + IHLUtils.damageItemViaNBTTag(outStack, 100); + if(outStack.stackSize<=0) + { + return null; + } + else + { + return outStack; + } + } + + @Override + public final boolean doesContainerItemLeaveCraftingGrid(ItemStack aStack) + { + return false; + } + + @Override + public final boolean hasContainerItem(ItemStack aStack) + { + return true; + } + + public static void init() + { + IHLTool item = new IHLTool(); + GameRegistry.registerItem(item,item.getUnlocalizedName()); + Type[] var1 = Type.values(); + for(int i=0;i0) + { + for(int i1=0;i1=240) + { + return dice240; + } + } + return this.getIconFromDamage(stack.getItemDamage()); + } + + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int i) + { + return iconMap.get(i); + } + + public enum Type + { + Thermometer("mercuryThermometer",19,1,0.1f,false,null,(String[])null), + FiberGlassDie("fiberGlassDieSteel",18,20000,0.5f,false,null,(String[])null), + SharpenedCarvingKnifeBronze("sharpenedCarvingKnifeBronze",17,2000,3.5f, true, "ihl.mutton_drop_hint", "craftingToolBlade", "craftingToolKnife"), + GlassBlowingTube("glassBlowingTubeSteel",16,2000,0.5f,false,null,(String[])null), + PolishingPucks("polishingPucksSteel",15,2000,0.5f,false,null,(String[])null), + GravelSteel("graverSteelHardened",14,10,0.5f,false,null,(String[])null), + DiceM10Steel("diceM10x1SteelHardened",13,2000,0.5f,false,null,(String[])null), + TapM10("tapM10x1SteelHardened",12,2000,0.5f,false,null,(String[])null), + Vise("viseSteel",11,200000,0.5f,false,null,(String[])null), + SetOfFiles("setOfFilesSteel",10,20000,1.5f,false,null,"craftingToolFile"), + HandDrillBronze("handDrillBronze",9,20000,0.5f,false,null,(String[])null), + HackSawSteel("hackSawSteel",8,200,0.5f,false,null,"craftingToolSaw"), + DrillSteel("drillSteelHardened",7,200,0.5f,false,null,(String[])null), + NeedleFile("needleFile",6,2000,0.1f,false,null,(String[])null), + Chisel("chisel",5,2000,1.5f,false,null,"craftingToolChisel"), + Grindstone("grindstone",4,2000,0.5f,false,null,(String[])null), + Hammer("hammer",3,20000,2.5f,false,null,"craftingToolHardHammer","craftingToolForgeHammer"), + TinSnipsSteel("tinSnipsSteel",2,2000,0.5f,false,null,"craftingToolWireCutter"), + SetOfDies1_5sqmm("setOfDies1_5sqmm",0,2000,0.5f,false,"ihl.setOfDiesHint",(String[])null); + Type(String unlocalizedName1,int itemDamage1, int maxToolDamage1, float damageVersusEntity1, boolean isWeapon1, String hint1, String... oreDictName1) + { + unLocalizedName=unlocalizedName1; + itemDamage=itemDamage1; + maxToolDamage=maxToolDamage1; + damageVersusEntity=damageVersusEntity1; + isWeapon=isWeapon1; + hint=hint1; + oreDictName=oreDictName1; + } + public final String unLocalizedName; + public final String[] oreDictName; + public final int itemDamage; + public final int maxToolDamage; + public final float damageVersusEntity; + public final boolean isWeapon; + public final String hint; + } + + @Override + @SuppressWarnings({ "rawtypes", "unchecked" }) + public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean flag) + { + info.add(EnumChatFormatting.WHITE+StatCollector.translateToLocal("ihl.durability") +EnumChatFormatting.GREEN + (IHLUtils.getMaxDamageValueViaNBTTag(itemStack) - IHLUtils.getDamageValueViaNBTTag(itemStack))+" / "+IHLUtils.getMaxDamageValueViaNBTTag(itemStack)); + info.add(EnumChatFormatting.WHITE+StatCollector.translateToLocal("ihl.attack_damage") +EnumChatFormatting.DARK_BLUE + damageVersusEntityMap.get(itemStack.getItemDamage())); + if(hintMap.containsKey(itemStack.getItemDamage())) + { + info.add(EnumChatFormatting.RED+StatCollector.translateToLocal(hintMap.get(itemStack.getItemDamage()))); + } + if(itemStack.stackTagCompound.hasKey("transverseSection")) + { + info.add(EnumChatFormatting.WHITE+StatCollector.translateToLocal("ihl.transversesection") +EnumChatFormatting.GREEN + (itemStack.stackTagCompound.getInteger("transverseSection")/10f)+" sq. mm."); + } + } + + @Override + public boolean hitEntity(ItemStack stack, EntityLivingBase target, EntityLivingBase attacker) + { + IHLUtils.damageItemViaNBTTag(stack, 1); + if(target!=null && target instanceof EntitySheep && !target.isChild() && target.getHealth()<=0F) + { + target.entityDropItem(IHLUtils.getThisModItemStackWithSize("muttonLard", target.worldObj.rand.nextInt(2)+2), 1F); + } + return true; + } + + @Override//That was taken from Gregtech. I think Greg wouldn't mind. + public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) + { + if (entity.canAttackWithItem() && !entity.hitByEntity(player)) + { + float tMagicDamage = entity instanceof EntityLivingBase ? EnchantmentHelper.getEnchantmentModifierLiving(player, (EntityLivingBase)entity) : 0.0F; + float tDamage = (float)player.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue() + damageVersusEntityMap.get(stack.getItemDamage()); + + if (tDamage + tMagicDamage > 0.0F) + { + boolean tCriticalHit = player.fallDistance > 0.0F && !player.onGround && !player.isOnLadder() && !player.isInWater() && !player.isPotionActive(Potion.blindness) && player.ridingEntity == null && entity instanceof EntityLivingBase; + + if (tCriticalHit && tDamage > 0.0F) + { + tDamage *= 1.5F; + } + + tDamage += tMagicDamage; + + if (entity.attackEntityFrom(DamageSource.generic, tDamage)) + { + if (entity instanceof EntityLivingBase) + { + entity.setFire(EnchantmentHelper.getFireAspectModifier(player) * 4); + } + + int tKnockcack = (player.isSprinting() ? 1 : 0) + (entity instanceof EntityLivingBase ? EnchantmentHelper.getKnockbackModifier(player, (EntityLivingBase)entity) : 0); + + if (tKnockcack > 0) + { + entity.addVelocity(-MathHelper.sin(player.rotationYaw * (float)Math.PI / 180.0F) * tKnockcack * 0.5F, 0.1D, MathHelper.cos(player.rotationYaw * (float)Math.PI / 180.0F) * tKnockcack * 0.5F); + player.motionX *= 0.6D; + player.motionZ *= 0.6D; + player.setSprinting(false); + } + + if (tCriticalHit) + { + player.onCriticalHit(entity); + } + + if (tMagicDamage > 0.0F) + { + player.onEnchantmentCritical(entity); + } + + if (tDamage >= 18.0F) + { + player.triggerAchievement(AchievementList.overkill); + } + + player.setLastAttacker(entity); + + if (entity instanceof EntityLivingBase) + { + EnchantmentHelper.func_151384_a((EntityLivingBase)entity, player); + } + + EnchantmentHelper.func_151385_b(player, entity); + + if (entity instanceof EntityLivingBase) + { + player.addStat(StatList.damageDealtStat, Math.round(tDamage * 10.0F)); + } + entity.hurtResistantTime = isWeaponMap.get(stack.getItemDamage())?0:1; + if(entity!=null && entity instanceof EntitySheep && !((EntityLivingBase) entity).isChild() && ((EntityLivingBase) entity).getHealth()<=0F && isWeaponMap.get(stack.getItemDamage())) + { + entity.entityDropItem(IHLUtils.getThisModItemStackWithSize("muttonLard", entity.worldObj.rand.nextInt(2)+1), 1F); + } + player.addExhaustion(0.3F); + IHLUtils.damageItemViaNBTTag(stack, 1); + } + } + } + if (stack.stackSize <= 0) + { + player.destroyCurrentEquippedItem(); + } + return true; + } + + @Override + public boolean showDurabilityBar(ItemStack stack) + { + return true; + } + + @Override + public double getDurabilityForDisplay(ItemStack stack) + { + return ((double)IHLUtils.getDamageValueViaNBTTag(stack))/(double)IHLUtils.getMaxDamageValueViaNBTTag(stack); + } + + @Override + public void onUpdate(ItemStack stack, World world, Entity entity, int slotIndex, boolean isCurrentItem) + { + if(stack.stackTagCompound!=null && !world.isRemote) + { + if(stack.stackTagCompound.hasKey("showTemperature")) + { + byte timerDelay = stack.stackTagCompound.getByte("showTemperature"); + if(timerDelay>0) + { + timerDelay--; + if(Math.abs(stack.stackTagCompound.getDouble("playerPosX")-entity.prevPosX)>0.2d || + Math.abs(stack.stackTagCompound.getDouble("playerPosY")-entity.prevPosY)>0.2d || + Math.abs(stack.stackTagCompound.getDouble("playerPosZ")-entity.prevPosZ)>0.2d) + { + timerDelay=0; + } + stack.stackTagCompound.setByte("showTemperature",timerDelay); + if(timerDelay==0 && entity instanceof EntityPlayer) + { + ((EntityPlayer)entity).inventoryContainer.detectAndSendChanges(); + } + } + } + } + } + private void setThermometerTemperature(ItemStack itemStack, EntityPlayer entityPlayer, long l) + { + if(itemStack.stackTagCompound==null) + { + itemStack.stackTagCompound=new NBTTagCompound(); + } + itemStack.stackTagCompound.setLong("temperature", l); + itemStack.stackTagCompound.setByte("showTemperature", (byte) 60); + itemStack.stackTagCompound.setDouble("playerPosX", entityPlayer.prevPosX); + itemStack.stackTagCompound.setDouble("playerPosY", entityPlayer.prevPosY); + itemStack.stackTagCompound.setDouble("playerPosZ", entityPlayer.prevPosZ); + entityPlayer.inventoryContainer.detectAndSendChanges(); + + } + + @Override + @SideOnly(Side.CLIENT) + public ItemMiniGUI getMiniGUI(GuiContainer gui, Slot slot) + { + if(slot.getHasStack() && slot.getStack().getItemDamage()==0 && slot.getStack().stackTagCompound!=null) + { + return new SetOfDiesMiniGUI(gui, slot); + } + return null; + } +} diff --git a/src/main/java/ihl/items_blocks/ItemSubstance.java b/src/main/java/ihl/items_blocks/ItemSubstance.java new file mode 100644 index 0000000..507e65b --- /dev/null +++ b/src/main/java/ihl/items_blocks/ItemSubstance.java @@ -0,0 +1,413 @@ +package ihl.items_blocks; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ic2.api.item.IC2Items; +import ic2.api.recipe.RecipeInputOreDict; +import ic2.api.recipe.Recipes; +import ihl.IHLCreativeTab; +import ihl.IHLModInfo; +import ihl.explosion.DetonatorMiniGUI; +import ihl.interfaces.IItemHasMiniGUI; +import ihl.interfaces.ItemMiniGUI; +import ihl.utils.IHLUtils; +import ihl.worldgen.ores.IHLFluid.IHLFluidType; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Slot; +import net.minecraft.item.Item; +import net.minecraft.item.ItemFood; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.IIcon; +import net.minecraft.util.StatCollector; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidContainerRegistry.FluidContainerData; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.oredict.OreDictionary; + +public class ItemSubstance extends Item implements IItemHasMiniGUI { + + private static Map iconMap = new HashMap(); + private static Map nameMap = new HashMap(); + private static Map descriptionMap = new HashMap(); + public static ItemSubstance instance; + + public ItemSubstance() { + super(); + this.setMaxDamage(0); + this.setNoRepair(); + this.setHasSubtypes(true); + this.setCreativeTab(IHLCreativeTab.tab); + this.setUnlocalizedName("ihlSimpleItem"); + instance = this; + } + + public static void init() { + Item breadWithLard = (new ItemFood(4, 0.1F, false)).setUnlocalizedName("breadWithLard") + .setTextureName(IHLModInfo.MODID + ":breadWithLard").setCreativeTab(IHLCreativeTab.tab); + GameRegistry.registerItem(breadWithLard, "food"); + IHLUtils.registerLocally("breadWithLard", new ItemStack(breadWithLard, 1, 0)); + ItemSubstance item = new ItemSubstance(); + GameRegistry.registerItem(item, item.getUnlocalizedName()); + Type[] var1 = Type.values(); + for (int i = 0; i < var1.length; i++) { + nameMap.put(var1[i].damage, var1[i].unLocalizedName); + IHLUtils.registerLocally(var1[i].unLocalizedName, new ItemStack(item, 1, var1[i].damage)); + if (var1[i].registerInOreDictionary) { + OreDictionary.registerOre(var1[i].oreRegistryName, new ItemStack(item, 1, var1[i].damage)); + } + if (var1[i].description != null) { + descriptionMap.put(var1[i].damage, var1[i].description); + } + } + ItemStack emptyCell = IC2Items.getItem("cell"); + IHLFluidType[] var2 = IHLFluidType.values(); + for (int i = 0; i < var2.length; i++) { + IHLFluidType type = var2[i]; + if (type.cell != null) { + OreDictionary.registerOre("cell" + type.fluidName.replaceFirst("fluid", ""), type.cell); + FluidContainerRegistry.registerFluidContainer(new FluidContainerData( + new FluidStack(type.fluid, FluidContainerRegistry.BUCKET_VOLUME), type.cell, emptyCell.copy())); + } else { + ItemStack filledCell = FluidContainerRegistry.fillFluidContainer( + new FluidStack(type.fluid, FluidContainerRegistry.BUCKET_VOLUME), emptyCell.copy()); + if (filledCell == null && type.hasCell) { + ItemStack stack = new ItemStack(item, 1, type.damage); + nameMap.put(type.damage, type.cellName); + IHLUtils.registerLocally(type.cellName, stack); + type.cell = stack; + OreDictionary.registerOre("cell" + type.fluidName.replaceFirst("fluid", ""), type.cell); + FluidContainerRegistry.registerFluidContainer(new FluidContainerData( + new FluidStack(type.fluid, FluidContainerRegistry.BUCKET_VOLUME), stack, emptyCell.copy())); + } else { + type.cell = filledCell; + } + } + } + OreDictionary.registerOre("itemSalt", IHLUtils.getThisModItemStack("dustSalt")); + } + + public static void postInit() { + Type[] var1 = Type.values(); + for (int i = 0; i < var1.length; i++) { + if (var1[i].registerInOreDictionary) { + if (var1[i].oreRegistryName.contains("dustTiny")) { + RecipeInputOreDict stack = new RecipeInputOreDict(var1[i].oreRegistryName); + ; + Recipes.advRecipes.addShapelessRecipe( + IHLUtils.getOreDictItemStackWithSize(var1[i].oreRegistryName, 9), + new RecipeInputOreDict(var1[i].oreRegistryName.replace("dustTiny", "dust"))); + Recipes.advRecipes.addShapelessRecipe( + IHLUtils.getOreDictItemStack(var1[i].oreRegistryName.replace("dustTiny", "dust")), stack, + stack, stack, stack, stack, stack, stack, stack, stack); + } + if (var1[i].oreRegistryName.contains("ingot") + && IHLUtils.hasOreDictionaryEntry(var1[i].oreRegistryName.replace("ingot", "dust"))) { + IHLUtils.addIC2MaceratorRecipe(var1[i].oreRegistryName, + IHLUtils.getOreDictItemStack(var1[i].oreRegistryName.replace("ingot", "dust"))); + } + } + } + } + + @SuppressWarnings({ "rawtypes", "unchecked" }) + @Override + @SideOnly(Side.CLIENT) + public void getSubItems(Item item, CreativeTabs tabs, List itemList) { + Type[] var1 = Type.values(); + for (int i = 0; i < var1.length; i++) { + ItemStack stack = IHLUtils.getThisModItemStack(var1[i].unLocalizedName); + if (var1[i] == Type.Detonator) { + stack.stackTagCompound = new NBTTagCompound(); + stack.stackTagCompound.setInteger("detonator_delay", 5); + } + itemList.add(stack); + } + IHLFluidType[] var2 = IHLFluidType.values(); + for (int i = 0; i < var2.length; i++) { + if (var2[i].hasCell && var2[i].cell != null) { + itemList.add(var2[i].cell); + } + } + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister register) { + Type[] var1 = Type.values(); + for (int i = 0; i < var1.length; i++) { + iconMap.put(var1[i].damage, register.registerIcon(IHLModInfo.MODID + ":" + var1[i].textureName)); + } + IHLFluidType[] var2 = IHLFluidType.values(); + for (int i = 0; i < var2.length; i++) { + IHLFluidType type = var2[i]; + if (var2[i].hasCell) { + iconMap.put(type.damage, register.registerIcon(IHLModInfo.MODID + ":" + type.cellName)); + } + } + + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int i) { + return iconMap.get(i); + } + + @Override + public String getUnlocalizedName(ItemStack stack) { + return nameMap.get(stack.getItemDamage()); + } + + @Override + @SuppressWarnings({ "rawtypes", "unchecked" }) + public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean flag) { + if (ItemSubstance.descriptionMap.containsKey(itemStack.getItemDamage())) { + info.add(ItemSubstance.descriptionMap.get(itemStack.getItemDamage())); + } + if (itemStack.stackTagCompound != null && itemStack.stackTagCompound.hasKey("detonator_delay")) { + info.add(StatCollector.translateToLocal("ihl.detonator_delay") + " " + + itemStack.stackTagCompound.getInteger("detonator_delay") + + StatCollector.translateToLocal("ihl.seconds")); + info.add(StatCollector.translateToLocal("ihl.detonatorHint")); + } + } + + public enum Type { + dustMercuryFulminate(195, "dustMercuryFulminate", true, "Hg(CNO)\u2082"), + Detonator(194, "detonator"), + dustPentaerythritolTetranitrate(193, "dustPentaerythritolTetranitrate", true, "C(CH\u2082ONO\u2082)\u2084"), + DustPentaerythritol(192, "dustPentaerythritol", true, "C(CH\u2082OH)\u2084"), + DustPotassiumOxide(191, "dustPotassiumOxide", true, "K\u2082O"), + IngotPotassium(190, "ingotPotassium", true, "K"), + catalystIron(189, "catalystIron", false, "Fe (foam) + Al\u2082O\u2083 + K\u2082O"), + catalystIronOxide(188, "catalystIronOxide", false, "Fe\u2082O\u2083 + Al\u2082O\u2083 + K\u2082O"), + catalystRawIronOxide(187, "catalystRawIronOxide", false, "Fe\u2082O\u2083 + Al\u2082O\u2083 + K\u2082O"), + IronOxideCatalystMix(186, "dustIronOxideCatalystMix", false, "Fe\u2082O\u2083 + Al\u2082O\u2083 + K\u2082O"), + SodiumFormate(185, "dustSodiumFormate", true, "HCO\u2082Na"), + MercuryChloride(184, "dustMercuryChloride", true, "HgCl\u2082"), + CalciumAcetate(183, "dustCalciumAcetate", true, "Ca(CH\u2083COO)\u2082"), + TinySiliconDioxide(182, "dustTinySiliconDioxide", true, "SiO\u2082"), + TinyIronOxide(181, "dustTinyIronOxide", true, "Fe\u2082O\u2083"), + TinyManganeseOxide(180, "dustTinyManganeseOxide", true, "Mn\u2083O\u2084"), + TinyGypsum(179, "dustTinyGypsum", true, "CaSO\u2084\u00B72H\u2082O"), + SodiumZeoliteCoked(178, "dustSodiumZeoliteCoked", true, "Na[AlSi\u2083O\u2088]+C"), + SodiumZeolite(177, "dustSodiumZeolite", true, "Na[AlSi\u2083O\u2088]"), + SodiumAluminate(176, "dustSodiumAluminate", true, "NaAlO\u2082"), + SodiumHydroxide(175, "dustSodiumHydroxide", true, "NaOH"), + DustTinyTungsten(174, "dustTinyTungsten", true, "W"), + BauxiteDust(173, "dustBauxite", true, "Al\u2082O\u2083\u00B7H\u2082O"), + LithiumIngot(172, "ingotLithium", true, "Li"), + DustLithiumChloride(171, "dustLithiumChloride", true, "LiCl"), + CoalPlate(170, "plateCoal", true, "C (amorphic)"), + GraphitePlate(156, "plateGraphite", true, "C (graphite)"), + CoalRawPlate(155, "plateRawCoal"), + // RedstoneSensor(169,"redstoneSensor"), + // RedstoneEmitter(168,"redstoneEmitter"), + IncisorSteelDiamondCoated(167, "incisorSteelDiamondCoated"), + IncisorSteel(166, "incisorSteel"), + LampHolderPorcelain(165, "lampHolderPorcelain"), + LampHolderRawPorcelain(164, "lampHolderRawPorcelain"), + DustIridium(163, "dustIridium", true, "Ir"), + SiliconTiny(162, "dustTinySilicon", true, "Si"), + DustMagnesiumOxide(161, "dustMagnesiumOxide", true, "MgO"), + Silicon(160, "dustSilicon", true, "Si"), + Bischofite(159, "dustBischofite", true, "MgCl\u2082\u00B76H\u2082O"), + DustMagnesium(158, "dustMagnesium", true, "Mg"), + IngotMagnesium(157, "ingotMagnesium", true, "Mg"), + Ignitron(154, "ignitron"), + BoronCarbideElectrode(153, "stickBoronCarbide", true, "B\u2084C"), + LeadFoil(152, "foilLead", true, "Pb"), + DustLeadPlumbate(151, "dustLeadPlumbate", true, "Pb\u2082PbO\u2084"), + VacuumSwitch(150, "vacuumSwitch"), + HallSensor(149, "hallSensor"), + BatteryCells(148, "batteryCellsEbonite"), + // BatteryCellsRaw(147,"batteryCellsRawEbonite"), + MuscoviteGetinax(146, "plateMica", true, "KAl\u2082(AlSi\u2083O\u2081\u2080)(OH)\u2082"), + BoronCarbide(145, "dustBoronCarbide", true, "B\u2084C"), + DustBoricAcid(144, "dustBoricAcid", true, "H\u2083BO\u2083"), + DustDatolite(143, "dustDatolite", true, "H\u2082Ca\u2082B\u2082Si\u2082O\u2081\u2080"), + DustFerrite(142, "dustFerrite", true, "Li\u2082Fe\u2082O\u2084"), + RingFerrite(141, "ringFerrite", true, "Li\u2082Fe\u2082O\u2084"), + RingRawFerrite(140, "ringRawFerrite"), + LithiumOxide(139, "dustLithiumOxide", true, "Li\u2082O"), + SolderingAlloyDust(138, "dustSolderingAlloy", true, "Sn\u2089Sb"), + AntimonyTinyDust(137, "dustTinyAntimony", true, "Sb"), + InsulatorPorcelain(136, "insulatorPorcelain"), + InsulatorRawPorcelain(135, "insulatorRawPorcelain"), + AntimonyDust(134, "dustAntimony", true, "Sb"), + AntimonyOxide(133, "dustAntimonyOxide", true, "Sb\u2082O\u2083"), + StibniteDust(132, "dustStibnite", true, "Sb\u2082S\u2083"), + CrushedPurifiedStibnite(131, "crushedPurifiedStibnite", true, "Sb\u2082S\u2083"), + CrushedStibnite(130, "crushedStibnite", true, "Sb\u2082S\u2083"), + RingPorcelain(129, "ringPorcelain"), + RingRawPorcelain(128, "ringRawPorcelain"), + CopperFoil(127, "foilCopper", true, "Cu"), + CrushedPurifiedBauxite(126, "crushedPurifiedBauxite", true, "Al\u2082O\u2083\u00B7H\u2082O"), + CrushedBauxite(125, "crushedBauxite", true, "Al\u2082O\u2083�H\u2082O + SiO\u2082, Fe\u2082O\u2083"), + SodiumSulfide(124, "dustSodiumSulfide", true, "NaS"), + SodiumSulfate(123, "dustSodiumSulfate", true, "Na\u2082SO\u2084"), + dustWood(122, "dustWood", true), + Kenotron(121, "valveTube1C21P"), + HighVolatgeCapacitor(120, "highVoltageCapacitor"), + MuscovitePaper(119, "foilMica", true, "KAl\u2082(AlSi\u2083O\u2081\u2080)(OH)\u2082"), + MuscoviteDust(118, "dustMica", true, "KAl\u2082(AlSi\u2083O\u2081\u2080)(OH)\u2082"), + GaedesPumpBarrel(117, "gaedesPumpBarrelPorcelain"), + RawGaedesPumpBarrel(116, "gaedesPumpBarrelRawPorcelain"), + GlassDust(115, "dustGlass", true), + Gu81m(114, "gu-81m"), + TungstenFoil(113, "foilTungsten", true), + TungstenIngot(112, "ingotTungsten", true), + TungstenPlate(111, "plateTungsten", true), + TungstenHotPlate(110, "plateHotTungsten", true), + CrushedPurifiedCinnabar(109, "crushedPurifiedCinnabar", true, "HgS"), + CrushedCinnabar(108, "crushedCinnabar", true, "HgS"), + OvenRawPorcelain(107, "ovenRawPorcelain"), + TungstenDust(104, "dustTungsten", true, "W"), + ElectrolysisBathPorcelain(103, "electrolysisBathPorcelain"), + ElectrolysisBathRawPorcelain(102, "electrolysisBathRawPorcelain"), + Porcelain(99, "dustPorcelain", true), + FoilGold(98, "foilGold", true), + TungsticAcid(97, "dustTungsticAcid", true, "WO\u2083\u00B7H\u2082O"), + TurboCompressorSetOfMoldedParts(96, "turboCompressorSetOfMoldedPartsBronze"), + TungstenOxide(94, "dustTungstenOxide", true, "WO\u2083"), + CalciumTungstate(93, "dustCalciumTungstate", true, "CaWO\u2084"), + SodiumHydrogenSulfate(92, "dustSodiumHydrogenSulfate", true, "NaHSO\u2084"), + Salt(91, "dustSalt", true, "NaCl"), + CalciumChloride(90, "dustCalciumChloride", true, "CaCl\u2082"), + PotassiumSulphate(89, "dustPotassiumSulphate", true, "K\u2082SO\u2084"), + RockSalt(88, "dustRockSalt", true, "KCl"), + CrushedPurifiedGyuibnera(87, "crushedPurifiedGyubnera", true, "(Mn,Fe)WO\u2084 (5:1)"), + CrushedGyuibnera(86, "crushedGyubnera", true, "(Mn,Fe)WO\u2084 (5:1)"), + ManganeseOxide(85, "dustManganeseOxide", true, "Mn\u2083O\u2084"), + IronOxide(84, "dustIronOxide", true, "Fe\u2082O\u2083"), + SmallRound(83, "smallRoundSteel"), + SmallRoundPolished(82, "smallRoundPolishedSteel"), + RollingMachineSetOfMoldedParts(81, "rollingMachineSetOfMoldedPartsSteel"), + PistonCylinder(80, "pistonCylinderSteel"), + PipelineAccessoriesSteel(77, "pipelineAccessoriesSteel"), + DustTrona(76, "dustTrona", true, "Na\u2082CO\u2083�NaHCO\u2083\u00B72H\u2082O"), + HighPressureVessel(75, "highPressureVesselSteel"), + GasJet(74, "gasJetSteel"), + GasReducerSteel(73, "gasReducerSteel"), + HotSteelIngot(70, "ingotHotSteel", true), + BarD10Gold(69, "barD10Gold"), + CalciumCarbide(68, "dustCalciumCarbide", true, "CaC\u2082"), + foilRubber(67, "foilRubber", true, "(C\u2085H\u2088)n"), + Fabric(66, "fabric"), + ThinRubberWithSulfur(65, "foilRubberWithSulfur"), + Bucket_tarPitch(64, "bucket_tarPitch"), + DetonationSprayingMachineSetOfMoldedParts(63, "detonationSprayingMachineSetOfMoldedPartsBronze"), + SetOfPartsForLVElemotorSteel(62, "setOfPartsForLVElemotorSteel"), + // PlateNonVulcanizedRubber(60, "plateNonVulcanizedRubber"), + TapM10SteelHot(59, "tapM10x1SteelHot"), + DiceM10SteelHot(58, "diceM10x1SteelHot"), + NailSteel(57, "nailSteel"), + NutM10x1Steel(56, "nutM10x1Steel"), + GraverSteel(55, "graverSteel"), + GraverSteelHot(54, "graverSteelHot"), + DrillSteel(53, "drillSteel"), + DrillSteelHot(52, "drillSteelHot"), + BarD10Steel(51, "barD10Steel"), + BarD10SteelHot(50, "barD10SteelHot"), + SawBladeSteel(49, "sawBladeSteel"), + SawBladeSteelHot(48, "sawBladeSteelHot"), + SawBladeSteelHardened(47, "sawBladeSteelHardened"), + LinerIronGraphite(46, "linerIronGraphite"), + LinerIronGraphiteHot(45, "linerIronGraphiteHot"), + LinerIronGraphiteGreased(44, "linerIronGraphiteGreased"), + BoltM10x1Steel(43, "boltM10x1Steel"), + ExtruderSetOfMoldedParts(42, "extruderSetOfMoldedPartsSteel"), + MeshGlass(41, "meshGlass"), + TapM10Steel(39, "tapM10x1Steel"), + DiceM10Steel(38, "diceM10x1Steel"), + BlankSetOfFilesSteel(37, "blankSetOfFilesSteel"), + HandDrillSetOfMoldedPartsBronze(36, "handDrillSetOfMoldedPartsBronze"), + ViseSetOfMoldedPartsSteel(34, "viseSetOfMoldedPartsSteel"), + DustIrongraphite(33, "dustIrongraphite", true), + PlateSteelHot(32, "plateHotSteel"), + Chisel(31, "blankChiselSteel"), + CrucibleMixture(30, "crucibleMixture"), + GraphiteDust(29, "dustGraphite", true, "C (graphite)"), + BrickDust(28, "dustBrick", true), + CalciumSoap(27, "ingotCalciumSoap"), + Stearin(26, "ingotStearin"), + MuttonLard(25, "muttonLard"), + CarvingKnifeBronze(24, "carvingKnifeBronze"), + DehydratedGypsum(23, "dustDehydratedGypsum"), + BlankNeedleFileSteel(22, "blankNeedleFileSteel"), + HammerHead(21, "toolHeadHammerSmallSteel"), + SpringSteel(19, "springSteel"), + CoalElectrodePremix(18, "dustCoalElectrodePremix"), + rawCoalElectrode(17, "stickCoalElectrodePremix"), + FoilSteel(16, "foilSteel", true), + StickSteel(15, "stickSteel", true), + Quicklime(14, "dustQuicklime", true, "CaO"), + Calcite(13, "dustCalcite", true, "CaCO\u2082"), + Gypsum(12, "dustGypsum", true, "CaSO\u2084\u00B72H\u2082O"), + PotassiumFeldspar(11, "dustPotassiumFeldspar", true, "K[AlSi\u2083O\u2088]"), + Apatite(10, "gemApatite", true, "Ca\u2085[PO\u2084]\u2083(F,Cl,OH)"), + Saltpeter(9, "dustSaltpeter", true, "KNO\u2083"), + TarPitch(8, "ingotTarPitch", true), + nuggetTarPitch(7, "nuggetTarPitch", true), + Graphite_Electrode(6, "stickGraphite", true, "C (graphite)"), + Coal_Electrode(5, "stickCoal", true, "C (amorphic)"), + Carborundum(4, "dustCarborundum", true, "SiC"), + IridiumAndSodiumOxide(3, "dustIridiumAndSodiumOxide", true, "IrO\u2082 + Na\u2082O"), + PlatinumGroupSludge(2, "dustPlatinumGroupSludge", true), + TinyPlatinumGroupSludge(1, "dustTinyPlatinumGroupSludge", true), + SodiumPeroxide(0, "dustSodiumPeroxide", true, "Na\u2082O\u2082"); + Type(int damage1, String unlocalizedName1) { + damage = damage1; + textureName = unLocalizedName = unlocalizedName1; + } + + Type(int damage1, String unlocalizedName1, boolean registerInOreDictionary1) { + damage = damage1; + textureName = oreRegistryName = unLocalizedName = unlocalizedName1; + registerInOreDictionary = registerInOreDictionary1; + } + + Type(int damage1, String unlocalizedName1, boolean registerInOreDictionary1, String description1) { + damage = damage1; + textureName = oreRegistryName = unLocalizedName = unlocalizedName1; + registerInOreDictionary = registerInOreDictionary1; + description = description1; + } + + Type(int damage1, String unlocalizedName1, boolean registerInOreDictionary1, String description1, + String textureName1) { + damage = damage1; + oreRegistryName = unLocalizedName = unlocalizedName1; + registerInOreDictionary = registerInOreDictionary1; + description = description1; + textureName = textureName1; + } + + public int damage; + public String unLocalizedName; + public String oreRegistryName; + public String description; + public String textureName; + public boolean registerInOreDictionary = false; + } + + @Override + @SideOnly(Side.CLIENT) + public ItemMiniGUI getMiniGUI(GuiContainer gui, Slot slot) { + if (slot.getHasStack() && slot.getStack().getItemDamage() == Type.Detonator.damage + && slot.getStack().stackTagCompound != null) { + return new DetonatorMiniGUI(gui, slot); + } + return null; + } + +} \ No newline at end of file diff --git a/src/main/java/ihl/items_blocks/MachineBaseBlock.java b/src/main/java/ihl/items_blocks/MachineBaseBlock.java new file mode 100644 index 0000000..aef567c --- /dev/null +++ b/src/main/java/ihl/items_blocks/MachineBaseBlock.java @@ -0,0 +1,662 @@ +package ihl.items_blocks; + +import java.util.ArrayList; +import java.util.List; + +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ic2.api.tile.IWrenchable; +import ic2.core.IC2; +import ic2.core.IHasGui; +import ic2.core.item.tool.ItemToolCutter; +import ihl.IHLCreativeTab; +import ihl.IHLMod; +import ihl.IHLModInfo; +import ihl.flexible_cable.BatterySwitchUnitTileEntity; +import ihl.flexible_cable.IronWorkbenchTileEntity; +import ihl.flexible_cable.RectifierTransformerUnitTileEntity; +import ihl.interfaces.IEnergyNetNode; +import ihl.interfaces.IMultiPowerCableHolder; +import ihl.processing.chemistry.ChemicalReactorTileEntity; +import ihl.processing.chemistry.CryogenicDistillerTileEntity; +import ihl.processing.chemistry.DosingPumpTileEntity; +import ihl.processing.chemistry.ElectrolysisBathTileEntity; +import ihl.processing.chemistry.FluidizedBedReactorTileEntity; +import ihl.processing.chemistry.FractionatorBottomTileEntity; +import ihl.processing.chemistry.FractionatorCoverTileEntity; +import ihl.processing.chemistry.FractionatorSectionTileEntity; +import ihl.processing.chemistry.GaedesMercuryRotaryPumpTileEntity; +import ihl.processing.chemistry.LabElectrolyzerTileEntity; +import ihl.processing.chemistry.LeadOvenTileEntity; +import ihl.processing.chemistry.LoomTileEntity; +import ihl.processing.chemistry.PaperMachineTileEntity; +import ihl.processing.chemistry.RefluxCondenserTileEntity; +import ihl.processing.chemistry.SolarEvaporatorTileEntity; +import ihl.processing.metallurgy.AchesonFurnanceTileEntity; +import ihl.processing.metallurgy.CoilerTileEntity; +import ihl.processing.metallurgy.DetonationSprayingMachineTileEntity; +import ihl.processing.metallurgy.ExtruderTileEntity; +import ihl.processing.metallurgy.GasWeldingStationTileEntity; +import ihl.processing.metallurgy.ImpregnatingMachineTileEntity; +import ihl.processing.metallurgy.LathePart1TileEntity; +import ihl.processing.metallurgy.LathePart2TileEntity; +import ihl.processing.metallurgy.MuffleFurnanceTileEntity; +import ihl.processing.metallurgy.RollingMachinePart1TileEntity; +import ihl.processing.metallurgy.RollingMachinePart2TileEntity; +import ihl.processing.metallurgy.VulcanizationExtrudingMoldTileEntity; +import ihl.processing.metallurgy.WireMillTileEntity; +import ihl.processing.metallurgy.WoodenRollingMachinePart1TileEntity; +import ihl.processing.metallurgy.WoodenRollingMachinePart2TileEntity; +import ihl.utils.IHLUtils; +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.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +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 net.minecraftforge.common.util.ForgeDirection; + +public class MachineBaseBlock extends Block implements ITileEntityProvider { + + public MachineType type; + private static List instances = new ArrayList(); + + @SideOnly(Side.CLIENT) + IIcon textureSide, textureBack, textureFrontMuffleFurnance, textureTop, textureTopAchesonFurnance, + textureTopGoldFurnace, textureFrontGoldFurnace, textureSideGoldFurnace, textureFrontCryogenicDistiller, + textureTopCryogenicDistiller, textureBackCryogenicDistiller, textureFrontChemicalReactor, + textureLeftMachineCasing, textureTopMachineCasing, textureRightMachineCasing, textureFrontMachineCasing, + textureFrontPaperMachine, textureBackMachineCasing, bronzeTubTop, bronzeTubSide, steel, redPaint, + greenPaint, rubberInsulatedCase, powerPort, dosingPumpBack, dosingPumpLeftSide, dosingPumpRightSide, + dosingPumpTop, dosingPumpFront, solarEvaporatorSide; + + public MachineBaseBlock(MachineType type1) { + super(Material.iron); + this.type = type1; + this.setCreativeTab(IHLCreativeTab.tab); + this.setBlockName(type.unlocalizedName); + this.setHardness(2F); + this.setResistance(1F); + instances.add(this); + } + + @Override + public void onNeighborBlockChange(World world, int x, int y, int z, Block block) { + if (IC2.platform.isSimulating()) { + TileEntity te = world.getTileEntity(x, y, z); + boolean isPowered = world.isBlockIndirectlyGettingPowered(x, y, z); + if (te instanceof DosingPumpTileEntity) { + DosingPumpTileEntity dpte = (DosingPumpTileEntity) te; + dpte.setPowered(isPowered); + } + + if (world.getBlock(x, y + 1, z) == Blocks.fire) { + if (te instanceof DetonationSprayingMachineTileEntity) { + ((DetonationSprayingMachineTileEntity) te).operate(); + world.setBlockToAir(x, y + 1, z); + } + } + } + } + + @Override + public void onBlockPreDestroy(World world, int x, int y, int z, int meta) { + if (!world.isRemote) { + TileEntity te = world.getTileEntity(x, y, z); + if (te != null) { + if (te instanceof IEnergyNetNode) { + IEnergyNetNode ate = (IEnergyNetNode) te; + ate.removeAttachedChains(); + } + if (te instanceof IMultiPowerCableHolder) { + IMultiPowerCableHolder ate = (IMultiPowerCableHolder) te; + ate.removeAttachedChains(); + } + if (te instanceof IronWorkbenchTileEntity) { + IronWorkbenchTileEntity iwb = (IronWorkbenchTileEntity) te; + iwb.dropContents(); + } else if (te instanceof IInventory) { + IInventory inventory = (IInventory) te; + for (int i = 0; i < inventory.getSizeInventory(); i++) { + if (inventory.getStackInSlot(i) != null) + world.spawnEntityInWorld(new EntityItem(world, x, y + 1, z, inventory.getStackInSlot(i))); + } + } + } + } + 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) { + float height = 1f; + switch (this.type) { + case SolarEvaporator: + height = 0.5f; + case BronzeTub: + 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, height, 1.0F); + super.addCollisionBoxesToList(world, x, y, z, aabb, list, entity); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, height, 0.1F); + super.addCollisionBoxesToList(world, x, y, z, aabb, list, entity); + this.setBlockBounds(0.9F, 0.0F, 0.0F, 1.0F, height, 1.0F); + super.addCollisionBoxesToList(world, x, y, z, aabb, list, entity); + this.setBlockBounds(0.0F, 0.0F, 0.9F, 1.0F, height, 1.0F); + super.addCollisionBoxesToList(world, x, y, z, aabb, list, entity); + this.setBlockBoundsForItemRender(); + break; + default: + super.addCollisionBoxesToList(world, x, y, z, aabb, list, entity); + break; + } + } + + @Override + public void setBlockBoundsForItemRender() { + if(this.type.equals(MachineType.SolarEvaporator)){ + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5f, 1.0F); + } + else { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + } + + public static void init() { + MachineType[] var1 = MachineType.values(); + for (int i = 0; i < var1.length; i++) { + if (!var1[i].unlocalizedName.equalsIgnoreCase(IHLMod.config.preventMachineBlockRegistrationName)) { + GameRegistry.registerBlock(new MachineBaseBlock(var1[i]), IHLItemBlock.class, var1[i].unlocalizedName); + GameRegistry.registerTileEntity(var1[i].teclass, var1[i].unlocalizedName); + } + } + IHLUtils.getThisModBlock("tubBronze").setBlockTextureName("tubBronzeIcon"); + } + + @Override + public void dropBlockAsItemWithChance(World world, int x, int y, int z, int meta, float chance, int flag) { + if (this.type.itemDroppedOnBlockDestroy != null) { + this.dropBlockAsItem(world, x, y, z, this.type.itemDroppedOnBlockDestroy.copy()); + } else { + super.dropBlockAsItemWithChance(world, x, y, z, meta, chance, flag); + } + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) { + TileEntity newTE = null; + try { + newTE = (TileEntity) type.teclass.newInstance(); + } catch (InstantiationException e) { + e.printStackTrace(); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + return newTE; + } + + @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"); + this.textureFrontMuffleFurnance = par1IconRegister.registerIcon(IHLModInfo.MODID + ":muffleOvenFront"); + this.textureTopAchesonFurnance = par1IconRegister.registerIcon(IHLModInfo.MODID + ":achesonOvenTop"); + this.textureTopGoldFurnace = par1IconRegister.registerIcon(IHLModInfo.MODID + ":porcelainFurnaceTop"); + this.textureFrontGoldFurnace = par1IconRegister.registerIcon(IHLModInfo.MODID + ":porcelainFurnaceFront"); + this.textureSideGoldFurnace = par1IconRegister.registerIcon(IHLModInfo.MODID + ":porcelainFurnaceSide"); + this.textureLeftMachineCasing = par1IconRegister.registerIcon(IHLModInfo.MODID + ":fiberglassSpinneretsLeft"); + this.textureTopMachineCasing = par1IconRegister.registerIcon(IHLModInfo.MODID + ":fiberglassSpinneretsTop"); + this.textureRightMachineCasing = par1IconRegister.registerIcon(IHLModInfo.MODID + ":fiberglassSpinneretsRight"); + this.textureFrontMachineCasing = par1IconRegister.registerIcon(IHLModInfo.MODID + ":fiberglassSpinneretsFront"); + this.textureBackMachineCasing = par1IconRegister.registerIcon(IHLModInfo.MODID + ":fiberglassSpinneretsBack"); + this.textureFrontCryogenicDistiller = par1IconRegister + .registerIcon(IHLModInfo.MODID + ":cryogenicDistillerOxygenSide"); + this.textureTopCryogenicDistiller = par1IconRegister + .registerIcon(IHLModInfo.MODID + ":cryogenicDistillerNitrogenSide"); + this.textureBackCryogenicDistiller = par1IconRegister + .registerIcon(IHLModInfo.MODID + ":cryogenicDistillerInputSide"); + this.textureFrontChemicalReactor = par1IconRegister + .registerIcon(IHLModInfo.MODID + ":chemicalReactorOutputSide"); + this.textureFrontPaperMachine = par1IconRegister.registerIcon(IHLModInfo.MODID + ":paperMachineFront"); + this.bronzeTubTop = par1IconRegister.registerIcon(IHLModInfo.MODID + ":tubBronzeTop"); + this.bronzeTubSide = par1IconRegister.registerIcon(IHLModInfo.MODID + ":tubBronzeSide"); + this.steel = par1IconRegister.registerIcon(IHLModInfo.MODID + ":steel"); + this.redPaint = par1IconRegister.registerIcon(IHLModInfo.MODID + ":redPaint"); + this.greenPaint = par1IconRegister.registerIcon(IHLModInfo.MODID + ":greenPaint"); + this.rubberInsulatedCase = par1IconRegister.registerIcon(IHLModInfo.MODID + ":rubberInsulatedCase"); + this.powerPort = par1IconRegister.registerIcon(IHLModInfo.MODID + ":powerPort"); + this.dosingPumpBack = par1IconRegister.registerIcon(IHLModInfo.MODID + ":dosingPumpBack"); + this.dosingPumpLeftSide = par1IconRegister.registerIcon(IHLModInfo.MODID + ":dosingPumpLeft"); + this.dosingPumpRightSide = par1IconRegister.registerIcon(IHLModInfo.MODID + ":dosingPumpRight"); + this.dosingPumpTop = par1IconRegister.registerIcon(IHLModInfo.MODID + ":dosingPumpTop"); + this.dosingPumpFront = par1IconRegister.registerIcon(IHLModInfo.MODID + ":dosingPumpFront"); + this.solarEvaporatorSide = par1IconRegister.registerIcon(IHLModInfo.MODID + ":solarEvaporatorSide"); + } + + @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()) { + if (te instanceof DetonationSprayingMachineTileEntity && player.getCurrentEquippedItem() != null + && player.getCurrentEquippedItem().getItem() == Items.flint_and_steel) { + ((DetonationSprayingMachineTileEntity) te).operate(); + return true; + } + if (te instanceof LathePart2TileEntity) { + LathePart2TileEntity lte = ((LathePart2TileEntity) te); + te = world.getTileEntity(x - ForgeDirection.getOrientation(lte.getFacing()).offsetX, + y - ForgeDirection.getOrientation(lte.getFacing()).offsetY, + z - ForgeDirection.getOrientation(lte.getFacing()).offsetZ); + } + if (te instanceof RollingMachinePart2TileEntity) { + RollingMachinePart2TileEntity lte = ((RollingMachinePart2TileEntity) te); + te = world.getTileEntity(x - ForgeDirection.getOrientation(lte.getFacing()).offsetX, + y - ForgeDirection.getOrientation(lte.getFacing()).offsetY, + z - ForgeDirection.getOrientation(lte.getFacing()).offsetZ); + } + if (te instanceof WoodenRollingMachinePart2TileEntity) { + WoodenRollingMachinePart2TileEntity lte = ((WoodenRollingMachinePart2TileEntity) te); + te = world.getTileEntity(x - ForgeDirection.getOrientation(lte.getFacing()).offsetX, + y - ForgeDirection.getOrientation(lte.getFacing()).offsetY, + z - ForgeDirection.getOrientation(lte.getFacing()).offsetZ); + } + if (te instanceof RectifierTransformerUnitTileEntity) { + RectifierTransformerUnitTileEntity rtu = (RectifierTransformerUnitTileEntity) te; + if (player.getCurrentEquippedItem() == null) { + if (IC2.keyboard.isModeSwitchKeyDown(player)) { + rtu.switchModeDown(); + } else { + rtu.switchModeUp(); + } + IC2.platform.messagePlayer(player, "ic2.tooltip.mode", + new Object[] { " Voltage output was set to x" + rtu.mode }); + } + } + if (te instanceof IEnergyNetNode) { + IEnergyNetNode node = (IEnergyNetNode) te; + if (player.getCurrentEquippedItem() != null + && player.getCurrentEquippedItem().getItem() instanceof ItemToolCutter) { + node.removeAttachedChains(); + } + } + } + return te instanceof IHasGui + ? (IC2.platform.isSimulating() ? IC2.platform.launchGui(player, (IHasGui) te) : true) : 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 instanceof IWrenchable) { + ((IWrenchable) t).setFacing(IHLUtils.getFacingFromPlayerView(player, false)); + } + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) { + int facing = 3; + 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) { + if (this.type == MachineType.IronWorkbench) { + return this.steel; + } + if (this.type == MachineType.RectifierTransformerUnit) { + switch (side) { + case 0: + return this.bronzeTubSide; + case 1: + return this.textureSideGoldFurnace; + case 2: + return this.redPaint; + case 3: + return this.greenPaint; + case 4: + return this.rubberInsulatedCase; + case 5: + return this.powerPort; + } + } + return this.getIconFromFacing(3, side); + } + + @SideOnly(Side.CLIENT) + public IIcon getIconFromFacing(int facing, int side) { + 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 }; + switch (this.type) { + case RefluxCondenser: + return this.steel; + case RectifierTransformerUnit: + return this.bronzeTubSide; + case IronWorkbench: + return this.steel; + default: + } + switch (mask[facing * 6 + side]) { + case 0: + switch (this.type) { + case BronzeTub: + return this.bronzeTubSide; + case SolarEvaporator: + return this.solarEvaporatorSide; + case AchesonFurnace: + return this.blockIcon; + case MuffleFurnace: + return this.textureFrontMuffleFurnance; + case LeadOven: + return this.textureFrontGoldFurnace; + case WireMill: + return this.textureFrontMachineCasing; + case LabElectrolyzer: + return this.textureTopMachineCasing; + case FluidizedBedReactor: + return this.textureTopMachineCasing; + case ChemicalReactor: + return this.textureFrontChemicalReactor; + case CryogenicDistiller: + return this.textureFrontCryogenicDistiller; + case PaperMachine: + return this.textureFrontPaperMachine; + case DosingPump: + return this.dosingPumpFront; + default: + break; + } + case 1: + switch (this.type) { + case BronzeTub: + return this.bronzeTubSide; + case SolarEvaporator: + return this.solarEvaporatorSide; + case LeadOven: + return this.textureSideGoldFurnace; + case WireMill: + return this.textureBackMachineCasing; + case CryogenicDistiller: + return this.textureBackCryogenicDistiller; + case PaperMachine: + return this.textureBackCryogenicDistiller; + case LabElectrolyzer: + return this.textureBackCryogenicDistiller; + case FluidizedBedReactor: + return this.textureBackCryogenicDistiller; + case ChemicalReactor: + return this.textureBackCryogenicDistiller; + case DosingPump: + return this.dosingPumpBack; + default: + return this.textureBack; + } + + case 2: + switch (this.type) { + case BronzeTub: + return this.bronzeTubSide; + case SolarEvaporator: + return this.solarEvaporatorSide; + case LeadOven: + return this.textureSideGoldFurnace; + case WireMill: + return this.textureBackMachineCasing; + case CryogenicDistiller: + return this.textureBackMachineCasing; + case PaperMachine: + return this.textureBackMachineCasing; + case LabElectrolyzer: + return this.textureBackMachineCasing; + case FluidizedBedReactor: + return this.textureBackMachineCasing; + case ChemicalReactor: + return this.textureBackMachineCasing; + case DosingPump: + return this.dosingPumpBack; + default: + return this.textureTop; + } + case 3: + switch (this.type) { + case BronzeTub: + case SolarEvaporator: + return this.bronzeTubTop; + case AchesonFurnace: + return this.textureTopAchesonFurnance; + case MuffleFurnace: + return this.textureTop; + case LeadOven: + return this.textureTopGoldFurnace; + case WireMill: + return this.textureTopMachineCasing; + case CryogenicDistiller: + return this.textureTopCryogenicDistiller; + case PaperMachine: + return this.textureTopMachineCasing; + case LabElectrolyzer: + return this.textureTopMachineCasing; + case FluidizedBedReactor: + return this.textureTopMachineCasing; + case ChemicalReactor: + return this.textureTopMachineCasing; + case DosingPump: + return this.dosingPumpTop; + default: + return this.textureTop; + } + case 4: + switch (this.type) { + case BronzeTub: + return this.bronzeTubSide; + case SolarEvaporator: + return this.solarEvaporatorSide; + case LeadOven: + return this.textureSideGoldFurnace; + case WireMill: + return this.textureRightMachineCasing; + case CryogenicDistiller: + return this.textureRightMachineCasing; + case PaperMachine: + return this.textureRightMachineCasing; + case LabElectrolyzer: + return this.textureRightMachineCasing; + case FluidizedBedReactor: + return this.textureRightMachineCasing; + case ChemicalReactor: + return this.textureRightMachineCasing; + case DosingPump: + return this.dosingPumpRightSide; + default: + return this.textureSide; + } + case 5: + switch (this.type) { + case BronzeTub: + return this.bronzeTubSide; + case SolarEvaporator: + return this.solarEvaporatorSide; + case LeadOven: + return this.textureSideGoldFurnace; + case CryogenicDistiller: + return this.textureLeftMachineCasing; + case PaperMachine: + return this.textureLeftMachineCasing; + case WireMill: + return this.textureLeftMachineCasing; + case ChemicalReactor: + return this.textureLeftMachineCasing; + case LabElectrolyzer: + return this.textureLeftMachineCasing; + case FluidizedBedReactor: + return this.textureLeftMachineCasing; + case DosingPump: + return this.dosingPumpLeftSide; + default: + return this.textureSide; + } + default: + return this.textureSide; + } + } + + @Override + public boolean onBlockEventReceived(World world, int x, int y, int z, int metadata, int flag) { + return true; + } + + @Override + public boolean canProvidePower() { + return true; + } + + @Override + public int isProvidingStrongPower(IBlockAccess world, int x, int y, int z, int metadata) { + return this.isProvidingWeakPower(world, x, y, z, metadata); + } + + public enum MachineType { + SolarEvaporator("solarEvaporator", SolarEvaporatorTileEntity.class, false, true, null), + DosingPump("dosingPump", DosingPumpTileEntity.class, true, null), + IronWorkbench("ironWorkbench", IronWorkbenchTileEntity.class, false, true, null), + ElectrolysisBath("electrolysisBath", ElectrolysisBathTileEntity.class, false, IHLUtils + .getThisModItemStack("plateGraphite")), + RectifierTransformerUnit("rectifierTransformerUnit", RectifierTransformerUnitTileEntity.class, false, true, IHLUtils + .getThisModItemStack("foilSteel")), + BatterySwitchUnit("batterySwitchUnit", BatterySwitchUnitTileEntity.class, false, IHLUtils + .getThisModItemStack("foilSteel")), + FractionatorBottom("fractionatorBottom", FractionatorBottomTileEntity.class, false, IHLUtils + .getThisModItemStack("foilSteel")), + FractionatorSection("fractionatorSection", FractionatorSectionTileEntity.class, false, IHLUtils + .getThisModItemStackWithSize("ringPorcelain", 16)), + FractionatorCover("fractionatorCover", FractionatorCoverTileEntity.class, false, IHLUtils + .getThisModItemStack("foilSteel")), + RefluxCondenser("refluxCondenser", RefluxCondenserTileEntity.class, false, false, IHLUtils + .getThisModItemStack("foilSteel")), + PaperMachine("paperMachine", PaperMachineTileEntity.class, true, IHLUtils.getThisModItemStack("stickSteel")), + GaedesMercuryRotaryPump("gaedesMercuryRotaryPump", GaedesMercuryRotaryPumpTileEntity.class, false, IHLUtils + .getThisModItemStack("foilSteel")), + LabElectrolyzer("labElectrolyzer", LabElectrolyzerTileEntity.class, true, IHLUtils + .getThisModItemStack("stickGraphite")), + FluidizedBedReactor("fluidizedBedReactor", FluidizedBedReactorTileEntity.class, true, IHLUtils + .getThisModItemStack("highPressureVesselSteel")), + ChemicalReactor("chemicalReactor", ChemicalReactorTileEntity.class, true, IHLUtils + .getThisModItemStack("highPressureVesselSteel")), + CryogenicDistiller("cryogenicDistiller", CryogenicDistillerTileEntity.class, true, IHLUtils + .getThisModItemStack("highPressureVesselSteel")), + GasWeldingStation("gasWeldingStation", GasWeldingStationTileEntity.class, false, null), + WoodenRollingMachine1("woodenRollingMachinePart1", WoodenRollingMachinePart1TileEntity.class, false, IHLUtils + .getThisModItemStack("barD10Steel")), + WoodenRollingMachine2("woodenRollingMachinePart2", WoodenRollingMachinePart2TileEntity.class, false, IHLUtils + .getThisModItemStack("barD10Steel")), + WireMill("wireMill", WireMillTileEntity.class, true, IHLUtils.getThisModItemStack("stickSteel")), + VulcanizationExtrudingMold("vulcanizationExtrudingMold", VulcanizationExtrudingMoldTileEntity.class, false, IHLUtils + .getThisModItemStack("dustCarborundum")), + Extruder("extruder", ExtruderTileEntity.class, false, IHLUtils.getThisModItemStack("dustCarborundum")), + RollingMachine1("rollingMachinePart1", RollingMachinePart1TileEntity.class, false, IHLUtils + .getThisModItemStack("stickSteel")), + RollingMachine2("rollingMachinePart2", RollingMachinePart2TileEntity.class, false, IHLUtils + .getThisModItemStack("stickSteel")), + Loom("loom", LoomTileEntity.class, false, new ItemStack(Items.stick)), + Coiler("coiler", CoilerTileEntity.class, false, new ItemStack(Items.stick)), + Lathe1("lathePart1", LathePart1TileEntity.class, false, IHLUtils.getThisModItemStack("stickSteel")), + Lathe2("lathePart2", LathePart2TileEntity.class, false, IHLUtils.getOreDictItemStack("plateSteel")), + LeadOven("leadOven", LeadOvenTileEntity.class, true, IHLUtils.getThisModItemStack("dustPorcelain")), + DetonationSprayingMachine("cannonBronze", DetonationSprayingMachineTileEntity.class, false, new ItemStack( + Items.stick)), + 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) { + unlocalizedName = unlocalizedName1; + teclass = teclass1; + isNormalBlock = isNormalBlock1; + if (isNormalBlock) { + specialBlockRendererId = 0; + } else { + specialBlockRendererId = -2; + } + itemDroppedOnBlockDestroy = itemDroppedOnBlockDestroy1; + } + + MachineType(String unlocalizedName1, Class teclass1, boolean isNormalBlock1, + boolean hasSpecialBlockRenderer1, ItemStack itemDroppedOnBlockDestroy1) { + unlocalizedName = unlocalizedName1; + teclass = teclass1; + isNormalBlock = isNormalBlock1; + hasSpecialBlockRenderer = hasSpecialBlockRenderer1; + itemDroppedOnBlockDestroy = itemDroppedOnBlockDestroy1; + + } + + public String unlocalizedName; + Class teclass; + boolean isNormalBlock = true; + boolean hasSpecialBlockRenderer = false; + int specialBlockRendererId = -2; + ItemStack itemDroppedOnBlockDestroy; + } + + @Override + public int getRenderType() { + if (this.type.hasSpecialBlockRenderer) { + return IHLMod.proxy.shareBlockRendererByMachineType(this.type); + } + return this.type.specialBlockRendererId; + } + + @Override + public boolean isOpaqueCube() { + return this.type == null ? false : this.type.isNormalBlock; + } + + @Override + public boolean renderAsNormalBlock() { + return this.type.isNormalBlock; + } + + @SideOnly(Side.CLIENT) + public IIcon getAdditionalIconsForBlockRenderer(int flag) { + switch (this.type) { + case SolarEvaporator: + return this.solarEvaporatorSide; + case BronzeTub: + return this.bronzeTubSide; + default: + return this.blockIcon; + } + } +} \ No newline at end of file diff --git a/src/main/java/ihl/items_blocks/RecipeInputs.java b/src/main/java/ihl/items_blocks/RecipeInputs.java new file mode 100644 index 0000000..6b49ce2 --- /dev/null +++ b/src/main/java/ihl/items_blocks/RecipeInputs.java @@ -0,0 +1,25 @@ +package ihl.items_blocks; + +import ic2.api.recipe.IRecipeInput; +import ic2.api.recipe.RecipeInputItemStack; +import ic2.api.recipe.RecipeInputOreDict; +import ihl.utils.IHLUtils; + +public class RecipeInputs +{ + public static IRecipeInput cutter = new RecipeInputOreDict("craftingToolWireCutter"); + public static IRecipeInput saw = new RecipeInputOreDict("craftingToolSaw"); + public static IRecipeInput file = new RecipeInputOreDict("craftingToolFile"); + public static IRecipeInput vise = new RecipeInputItemStack(IHLUtils.getThisModItemStack("viseSteel")); + public static IRecipeInput plateSteel = new RecipeInputOreDict("plateSteel"); + public static IRecipeInput hammer = new RecipeInputOreDict("craftingToolHardHammer"); + + public static IRecipeInput get(String name, int amount) + { + return new RecipeInputItemStack(IHLUtils.getThisModItemStackWithSize(name,amount),amount); + } + public static IRecipeInput get(String name) + { + return new RecipeInputItemStack(IHLUtils.getThisModItemStack(name)); + } +} diff --git a/src/main/java/ihl/metallurgy/constants/Details.java b/src/main/java/ihl/metallurgy/constants/Details.java new file mode 100644 index 0000000..80c715c --- /dev/null +++ b/src/main/java/ihl/metallurgy/constants/Details.java @@ -0,0 +1,55 @@ +package ihl.metallurgy.constants; + +import ihl.IHLMod; + +public enum Details { + block(1296), + highPressureVessel(432), + turboCompressorSetOfMoldedParts(576), + rollingMachineSetOfMoldedParts(576), + gasJet(36), + setOfPartsForLVElemotor(288), + pipelineAccessories(288), + detonationSprayingMachineSetOfMoldedParts(432), + blankChisel(36), + carvingKnife(36), + machineCasingSetOfMoldedParts(288), + polishingPucks(288), + extruderSetOfMoldedParts(288), + handDrillSetOfMoldedParts(72), + barD10(1), + latheSetOfMoldedParts(144), + viseSetOfMoldedParts(144), + ingot(144), + tub(144), + nugget(16), + screw(16), + round(16), + gear(576), + bolt(18), + stick(72), + frameGt(288), + toolHeadHammer(864), + toolHeadHammerSmall(72), + toolTinSnipsParts(72), + ring(36), + toolHeadPickaxe(432), + gearSmall(144), + nozzle(864), + wire(48); + Details(int moltenAmount1) + { + IHLMod.moltenAmounts.put(this.name(), moltenAmount1); + } + public static int getMeltingFluidAmount(String name) + { + if(IHLMod.moltenAmounts.containsKey(name)) + { + return IHLMod.moltenAmounts.get(name); + } + else + { + return 0; + } + } +} diff --git a/src/main/java/ihl/metallurgy/constants/ElectricConductor.java b/src/main/java/ihl/metallurgy/constants/ElectricConductor.java new file mode 100644 index 0000000..e3412ab --- /dev/null +++ b/src/main/java/ihl/metallurgy/constants/ElectricConductor.java @@ -0,0 +1,49 @@ +package ihl.metallurgy.constants; + +public enum ElectricConductor { + Silver(158,1000), + Copper(175,100), + Gold(220,100), + Aluminum(270,100), + Magnesium(440,100), + Iridium(474,1000), + Molybdenum(540,1000), + Tungsten(550,5000), + Zinc(600,100), + Nickel(730,5000), + Bronze(990,100), + Iron(1000,5000), + Platinum(1080,5000), + Tin(1130,100), + Steel(1300,5000), + Lead(2080,100), + Antimony(3400,5000), + Manganese(4300,5000), + Constantan(5000,5000), + Titan(6000,5000), + Mercury(9540,-10), + Castiron(10000,5000), + Nichrome(11200,6000), + Bismuth(11800,5000), + Graphite(80000,10000), + Coal(400000,10000), + Uran(29000000,5000); + ElectricConductor(int resistivity1, int meltingPoint1)//Ohm*m *10^10 + { + resistivity=resistivity1; + meltingPoint=meltingPoint1; + } + public final long resistivity; + public final int meltingPoint; + public static long getResistivity(String name) + { + if(ElectricConductor.valueOf(name)==null) + { + return 0; + } + else + { + return ElectricConductor.valueOf(name).resistivity; + } + } +} diff --git a/src/main/java/ihl/metallurgy/constants/Insulation.java b/src/main/java/ihl/metallurgy/constants/Insulation.java new file mode 100644 index 0000000..cd8f8c9 --- /dev/null +++ b/src/main/java/ihl/metallurgy/constants/Insulation.java @@ -0,0 +1,40 @@ +package ihl.metallurgy.constants; + +public enum Insulation { + TarPitch(10000,6000), + RawRubber(10000,6000), + PVC(18000,20000), + Rubber(20000,10000), + Plastic(40000,35000),//Polyethylene + XPVC(30000,100000); + Insulation(int maxVoltagePermm1, int maxVoltageCap1) + { + maxVoltagePermm=maxVoltagePermm1;//V/mm + maxVoltageCap=maxVoltageCap1; + } + public final int maxVoltagePermm; + public final int maxVoltageCap; + public static int getMaxVoltagePermm(String name) + { + if(Insulation.valueOf(name)==null) + { + return 0; + } + else + { + return Insulation.valueOf(name).maxVoltagePermm; + } + } + public static int getMaxVoltageCap(String name) + { + if(Insulation.valueOf(name)==null) + { + return 0; + } + else + { + return Insulation.valueOf(name).maxVoltageCap; + } + } + +} diff --git a/src/main/java/ihl/model/CableHolderSelectionBoxSpecialRenderer.java b/src/main/java/ihl/model/CableHolderSelectionBoxSpecialRenderer.java new file mode 100644 index 0000000..e878a78 --- /dev/null +++ b/src/main/java/ihl/model/CableHolderSelectionBoxSpecialRenderer.java @@ -0,0 +1,42 @@ +package ihl.model; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ihl.flexible_cable.AnchorTileEntity; +import ihl.interfaces.ISelectionBoxSpecialRenderer; +import ihl.utils.IHLUtils; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderGlobal; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.MovingObjectPosition; + +@SideOnly(value=Side.CLIENT) +public class CableHolderSelectionBoxSpecialRenderer implements ISelectionBoxSpecialRenderer +{ + @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); + double[] portPos = ate.energyNetNodes[facing].getPortPos(player); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + GL11.glColor4f(0.0F, 0.0F, 0.0F, 0.8F); + GL11.glLineWidth(2.0F); + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glDepthMask(false); + 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); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glDisable(GL11.GL_BLEND); + } +} diff --git a/src/main/java/ihl/model/FlexibleCableItemRender.java b/src/main/java/ihl/model/FlexibleCableItemRender.java new file mode 100644 index 0000000..e11a253 --- /dev/null +++ b/src/main/java/ihl/model/FlexibleCableItemRender.java @@ -0,0 +1,178 @@ +package ihl.model; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ihl.items_blocks.FlexibleCableItem; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityClientPlayerMP; +import net.minecraft.client.renderer.GLAllocation; +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.minecraftforge.client.IItemRenderer; +import net.minecraftforge.common.util.ForgeDirection; + +@SideOnly(value=Side.CLIENT) +public class FlexibleCableItemRender implements IItemRenderer { + private ModelTube model; + private ModelTube modelThin; + private ModelTube modelLong; + private ModelTube modelThinLong; + private final int segmentsAmount = 19; + private final float spiralStepAngle = 1f; + private final float scale = 1 / 32f; + private final int[] displayListCache = new int[4]; + + public FlexibleCableItemRender() { + float vOffset = 16f; + int longFragmensSize = 24; + model = new ModelTube(null, 0, 0, -2F, -3F, -2F + vOffset, 4, 6, 4, 0f, 0.5f, 0.99f, ForgeDirection.UP); + modelLong = new ModelTube(null, 0, 0, -2F, -3F, -2F + vOffset, 4, longFragmensSize, 4, 0f, 0f, 0.99f, + ForgeDirection.UP); + modelThin = new ModelTube(null, 0, 0, -1F, -3F, -1F + vOffset, 2, 6, 2, 0f, 0.5f, 0.99f, ForgeDirection.UP); + modelThinLong = new ModelTube(null, 0, 0, -1F, -3F, -1F + vOffset, 2, longFragmensSize, 2, 0f, 0.5f, 0.99f, + ForgeDirection.UP); + } + + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) { + switch (type) { + case ENTITY: + return true; + case EQUIPPED: + return true; + case EQUIPPED_FIRST_PERSON: + return true; + case INVENTORY: + return true; + default: + return false; + } + } + + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { + return true; + } + + @Override + public void renderItem(ItemRenderType type, ItemStack stack, Object... data) { + GL11.glPushMatrix(); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GL11.glScalef(1F, -1F, -1F); + switch (type) { + case ENTITY: + GL11.glTranslatef(0, -1.0F, 0); + this.rendercoil(stack); + break; + case EQUIPPED: + GL11.glTranslatef(0.25F, -2F, -0.75F); + this.rendercoil(stack); + break; + case EQUIPPED_FIRST_PERSON: + RenderPlayer var25; + EntityClientPlayerMP var3 = Minecraft.getMinecraft().thePlayer; + Minecraft.getMinecraft().getTextureManager().bindTexture(var3.getLocationSkin()); + var25 = (RenderPlayer) RenderManager.instance.getEntityRenderObject(Minecraft.getMinecraft().thePlayer); + GL11.glRotatef(135F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(35F, 0.0F, 1.0F, 0.0F); + var25.renderFirstPersonArm(Minecraft.getMinecraft().thePlayer); + GL11.glRotatef(-35F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(-135F, 1.0F, 0.0F, 0.0F); + GL11.glTranslatef(0.0F, 0.2F, 0F); + GL11.glTranslatef(-0.25F, -1.0F, 0F); + this.rendercoil(stack); + break; + case INVENTORY: + GL11.glTranslatef(0.0F, -0.2F, 0F); + this.rendercoil(stack); + break; + default: + } + GL11.glPopMatrix(); + } + + private void rendercoil(ItemStack stack) { + int type = this.getCableType(stack); + if (this.displayListCache[type] != 0) { + GL11.glCallList(displayListCache[type]); + } else { + + this.displayListCache[type] = GLAllocation.generateDisplayLists(1); + GL11.glNewList(displayListCache[type], 4864 /* GL_COMPILE */); + + GL11.glDisable(GL11.GL_TEXTURE_2D); + int saMax = this.segmentsAmount * 2 + this.segmentsAmount / 2; + for (int i = 0; i <= saMax; i++) { + GL11.glRotatef(-spiralStepAngle, 0f, 0f, 1f); + GL11.glRotatef(360f / this.segmentsAmount, 1f, 0f, 0f); + GL11.glTranslatef(0.004f, 0f, 0f); + GL11.glRotatef(spiralStepAngle, 0f, 0f, 1f); + GL11.glColor3f(1f, 1f, 1f); + if (i == 0) { + if (isNoInsulation(stack)) { + if (FlexibleCableItem.instance.yellowColoredWires + .contains(FlexibleCableItem.instance.getMaterial(stack))) { + GL11.glColor3f(1f, 0.75f, 0.1f); + } else { + GL11.glColor3f(0.65f, 0.65f, 0.67f); + } + this.modelThinLong.render(Tessellator.instance, scale); + + } else { + this.modelLong.render(Tessellator.instance, scale); + } + } else if (i == saMax) { + GL11.glTranslatef(0.0F, -0.55F, 0F); + if (isNoInsulation(stack)) { + if (FlexibleCableItem.instance.yellowColoredWires + .contains(FlexibleCableItem.instance.getMaterial(stack))) { + GL11.glColor3f(1f, 0.75f, 0.1f); + } else { + GL11.glColor3f(0.65f, 0.65f, 0.67f); + } + this.modelThinLong.render(Tessellator.instance, scale); + + } else { + this.modelLong.render(Tessellator.instance, scale); + } + GL11.glTranslatef(0.0F, 0.55F, 0F); + } else { + if (isNoInsulation(stack)) { + if (FlexibleCableItem.instance.yellowColoredWires + .contains(FlexibleCableItem.instance.getMaterial(stack))) { + GL11.glColor3f(1f, 0.75f, 0.1f); + } else { + GL11.glColor3f(0.65f, 0.65f, 0.67f); + } + this.modelThin.render(Tessellator.instance, scale); + + } else { + this.model.render(Tessellator.instance, scale); + } + } + } + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glEndList(); + } + } + + private int getCableType(ItemStack stack) { + if (isNoInsulation(stack)) { + if (FlexibleCableItem.instance.yellowColoredWires.contains(FlexibleCableItem.instance.getMaterial(stack))) { + return 1; + } else { + return 2; + } + } + return 0; + } + + private boolean isNoInsulation(ItemStack stack) { + return stack.stackTagCompound != null && FlexibleCableItem.instance.getInsulationMaterial(stack).equals("null"); + } +} \ No newline at end of file diff --git a/src/main/java/ihl/model/FluidRenderer.java b/src/main/java/ihl/model/FluidRenderer.java new file mode 100644 index 0000000..674e4ea --- /dev/null +++ b/src/main/java/ihl/model/FluidRenderer.java @@ -0,0 +1,158 @@ +package ihl.model; +/* This code with minimal changes was + * taken by me (Foghrye4) from + * RailCraft GitHub. + */ + +/* + * Copyright (c) CovertJaguar, 2014 http://railcraft.info + * + * This code is the property of CovertJaguar + * and may only be used with explicit written + * permission unless otherwise specified on the + * license page at http://railcraft.info/wiki/info:license. + */ +import java.util.HashMap; +import java.util.Map; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GLAllocation; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.init.Blocks; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; + +/** + * + * @author CovertJaguar + */ +@SideOnly(value=Side.CLIENT) +public class FluidRenderer { + + private static RenderBlocks renderBlocks = new RenderBlocks(); + private static final ResourceLocation BLOCK_TEXTURE = TextureMap.locationBlocksTexture; + private static final Map flowingRenderCache = new HashMap(); + private static final Map stillRenderCache = new HashMap(); + public static final int DISPLAY_STAGES = 100; + private static final RenderInfo liquidBlock = new RenderInfo(); + + static { + liquidBlock.texture = new IIcon[1]; + } + + public static IIcon getFluidTexture(FluidStack fluidStack, boolean flowing) { + if (fluidStack == null) + return ((TextureMap) Minecraft.getMinecraft().getTextureManager().getTexture(TextureMap.locationBlocksTexture)).getAtlasSprite("missingno"); + Fluid fluid = fluidStack.getFluid(); + if (fluid == null) + return ((TextureMap) Minecraft.getMinecraft().getTextureManager().getTexture(TextureMap.locationBlocksTexture)).getAtlasSprite("missingno"); + IIcon icon = flowing ? fluid.getFlowingIcon() : fluid.getStillIcon(); + if(icon==null) + { + icon = ((TextureMap) Minecraft.getMinecraft().getTextureManager().getTexture(TextureMap.locationBlocksTexture)).getAtlasSprite("missingno"); + } + return icon; + } + + public static ResourceLocation getFluidSheet(FluidStack liquid) { + return BLOCK_TEXTURE; + } + + public static ResourceLocation setupFlowingLiquidTexture(FluidStack liquid, IIcon[] texArray) { + if (liquid == null || liquid.amount <= 0) + return null; + + Fluid fluid = liquid.getFluid(); + if (fluid == null) + return null; + IIcon top = fluid.getStillIcon(); + IIcon side = fluid.getFlowingIcon(); + texArray[0] = top; + texArray[1] = top; + texArray[2] = side; + texArray[3] = side; + texArray[4] = side; + texArray[5] = side; + return getFluidSheet(liquid); + } + + public static int[] getLiquidDisplayLists(FluidStack fluidStack) { + return getLiquidDisplayLists(fluidStack, false); + } + + public static int[] getLiquidDisplayLists(FluidStack fluidStack, boolean flowing) { + if (fluidStack == null) + return null; + Fluid fluid = fluidStack.getFluid(); + if (fluid == null) + return null; + Map cache = flowing ? flowingRenderCache : stillRenderCache; + int[] diplayLists = cache.get(fluid); + if (diplayLists != null) + return diplayLists; + + diplayLists = new int[DISPLAY_STAGES]; + + liquidBlock.texture[0] = null; + + if (fluid.getBlock() != null) { + liquidBlock.template = fluid.getBlock(); + liquidBlock.texture[0] = getFluidTexture(fluidStack, flowing); + } else { + liquidBlock.template = Blocks.water; + liquidBlock.texture[0] = getFluidTexture(fluidStack, flowing); + } + + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDisable(GL11.GL_CULL_FACE); + for (int s = 0; s < DISPLAY_STAGES; ++s) { + diplayLists[s] = GLAllocation.generateDisplayLists(1); + GL11.glNewList(diplayLists[s], 4864 /*GL_COMPILE*/); + + liquidBlock.minX = 0.01f; + liquidBlock.minY = 0; + liquidBlock.minZ = 0.01f; + + liquidBlock.maxX = 0.99f; + liquidBlock.maxY = (float) s / (float) DISPLAY_STAGES; + liquidBlock.maxZ = 0.99f; + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawingQuads(); + RenderInfo info = liquidBlock; + renderBlocks.setRenderBounds(info.minX, info.minY, info.minZ, info.maxX, info.maxY, info.maxZ); + + if (info.renderSide[0]) + renderBlocks.renderFaceYNeg(info.template, 0D, 0D, 0D, info.getBlockTextureFromSide(0)); + if (info.renderSide[1]) + renderBlocks.renderFaceYPos(info.template, 0D, 0D, 0D, info.getBlockTextureFromSide(1)); + if (info.renderSide[2]) + renderBlocks.renderFaceZNeg(info.template, 0D, 0D, 0D, info.getBlockTextureFromSide(2)); + if (info.renderSide[3]) + renderBlocks.renderFaceZPos(info.template, 0D, 0D, 0D, info.getBlockTextureFromSide(3)); + if (info.renderSide[4]) + renderBlocks.renderFaceXNeg(info.template, 0D, 0D, 0D, info.getBlockTextureFromSide(4)); + if (info.renderSide[5]) + renderBlocks.renderFaceXPos(info.template, 0D, 0D, 0D, info.getBlockTextureFromSide(5)); + tessellator.draw(); + GL11.glEndList(); + } + + GL11.glColor4f(1, 1, 1, 1); + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glEnable(GL11.GL_BLEND); + + cache.put(fluid, diplayLists); + + return diplayLists; + } + +} diff --git a/src/main/java/ihl/model/IHLBlockRenderer.java b/src/main/java/ihl/model/IHLBlockRenderer.java new file mode 100644 index 0000000..81efbd9 --- /dev/null +++ b/src/main/java/ihl/model/IHLBlockRenderer.java @@ -0,0 +1,78 @@ +package ihl.model; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ihl.handpump.BlockWithCoordinates; +import net.minecraft.client.renderer.GLAllocation; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.world.ChunkCache; +import net.minecraft.world.World; + +@SideOnly(value=Side.CLIENT) +public class IHLBlockRenderer { + + private RenderBlocks renderBlocks; + private final Map renderCache = new HashMap(); + public static IHLBlockRenderer instance; + + public IHLBlockRenderer() + { + renderBlocks=RenderBlocks.getInstance(); + instance=this; + } + + public void refreshDisplayLists(int diplayLists, List bwc, ChunkCache iBlockAccess) + { + if (bwc==null || bwc.isEmpty()) + { + return; + } + renderBlocks.blockAccess=iBlockAccess; + GL11.glNewList(diplayLists, 4864 /*GL_COMPILE*/); + Iterator bwci = bwc.iterator(); + while(bwci.hasNext()) + { + BlockWithCoordinates bwce = bwci.next(); + renderBlock(bwce); + } + GL11.glEndList(); + } + + + public int getBlockDisplayLists(BlockWithCoordinates bwc, World world) { + if (bwc.block == null) + { + return -1; + } + if(renderCache.containsKey(bwc)) + { + return renderCache.get(bwc); + } + int diplayLists = GLAllocation.generateDisplayLists(1); + if(renderBlocks.blockAccess==null || !renderBlocks.blockAccess.equals(world)) + { + renderBlocks.blockAccess=world; + } + GL11.glNewList(diplayLists, 4864 /*GL_COMPILE*/); + renderBlock(bwc); + GL11.glEndList(); + renderCache.put(bwc, diplayLists); + return diplayLists; + } + + private void renderBlock(BlockWithCoordinates bwc) + { + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawingQuads(); + renderBlocks.renderBlockByRenderType(bwc.block, bwc.x, bwc.y, bwc.z); + tessellator.draw(); + } +} diff --git a/src/main/java/ihl/model/IHLModelRenderer.java b/src/main/java/ihl/model/IHLModelRenderer.java new file mode 100644 index 0000000..0bf95d2 --- /dev/null +++ b/src/main/java/ihl/model/IHLModelRenderer.java @@ -0,0 +1,369 @@ +package ihl.model; + +import java.util.ArrayList; +import java.util.List; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.model.TextureOffset; +import net.minecraft.client.renderer.GLAllocation; +import net.minecraft.client.renderer.Tessellator; +import net.minecraftforge.common.util.ForgeDirection; + +@SideOnly(value=Side.CLIENT) +public class IHLModelRenderer { + /** The size of the texture file's width in pixels. */ + public float textureWidth; + + /** The size of the texture file's height in pixels. */ + public float textureHeight; + + /** The X offset into the texture used for displaying this model */ + private int textureOffsetX; + + /** The Y offset into the texture used for displaying this model */ + private int textureOffsetY; + public float rotationPointX; + public float rotationPointY; + public float rotationPointZ; + public float rotateAngleX; + public float rotateAngleY; + public float rotateAngleZ; + private boolean compiled; + + /** The GL display list rendered by the Tessellator for this model */ + private int displayList; + public boolean mirror; + public boolean showModel; + + /** Hides the model. */ + public boolean isHidden; + public List cubeList; + public List childModels; + public final String boxName; + private ModelBase baseModel; + public float offsetX; + public float offsetY; + public float offsetZ; + + public boolean drawFromInside=false; + + @SuppressWarnings("unchecked") + public IHLModelRenderer(ModelBase par1ModelBase, String par2Str) + { + this.textureWidth = 64.0F; + this.textureHeight = 32.0F; + this.showModel = true; + this.cubeList = new ArrayList(); + this.baseModel = par1ModelBase; + par1ModelBase.boxList.add(this); + this.boxName = par2Str; + this.setTextureSize(par1ModelBase.textureWidth, par1ModelBase.textureHeight); + } + + public IHLModelRenderer(ModelBase par1ModelBase) + { + this(par1ModelBase, (String)null); + } + + public IHLModelRenderer(ModelBase par1ModelBase, int par2, int par3) + { + this(par1ModelBase); + this.setTextureOffset(par2, par3); + } + + /** + * Sets the current box's rotation points and rotation angles to another box. + */ + public void addChild(ModelRenderer par1ModelRenderer) + { + if (this.childModels == null) + { + this.childModels = new ArrayList(); + } + + this.childModels.add(par1ModelRenderer); + } + + public IHLModelRenderer setTextureOffset(int par1, int par2) + { + this.textureOffsetX = par1; + this.textureOffsetY = par2; + return this; + } + + public IHLModelRenderer addBox(String par1Str, float par2, float par3, float par4, int par5, int par6, int par7, boolean inverted, boolean[] renderFace) + { + par1Str = this.boxName + "." + par1Str; + TextureOffset var8 = this.baseModel.getTextureOffset(par1Str); + this.setTextureOffset(var8.textureOffsetX, var8.textureOffsetY); + this.cubeList.add((new ModelToplessBox(this, this.textureOffsetX, this.textureOffsetY, par2, par3, par4, par5, par6, par7, 0.0F, inverted, renderFace)).func_78244_a(par1Str)); + return this; + } + + public IHLModelRenderer addBox(String par1Str, float par2, float par3, float par4, int par5, int par6, int par7, boolean inverted) + { + boolean[] renderFace={true,true,true,true,true,true}; + par1Str = this.boxName + "." + par1Str; + TextureOffset var8 = this.baseModel.getTextureOffset(par1Str); + this.setTextureOffset(var8.textureOffsetX, var8.textureOffsetY); + this.cubeList.add((new ModelToplessBox(this, this.textureOffsetX, this.textureOffsetY, par2, par3, par4, par5, par6, par7, 0.0F, inverted, renderFace)).func_78244_a(par1Str)); + return this; + } + + public IHLModelRenderer addBox(float par1, float par2, float par3, int par4, int par5, int par6, boolean inverted, boolean[] renderFace) + { + this.cubeList.add(new ModelToplessBox(this, this.textureOffsetX, this.textureOffsetY, par1, par2, par3, par4, par5, par6, 0.0F, inverted, renderFace)); + return this; + } + + public IHLModelRenderer addTube(String par1Str, float par1, float par2, float par3, int par4, int par5, int par6, float radius1, float radius2, ForgeDirection direction) + { + par1Str = this.boxName + "." + par1Str; + TextureOffset var8 = this.baseModel.getTextureOffset(par1Str); + this.setTextureOffset(var8.textureOffsetX, var8.textureOffsetY); + this.cubeList.add(new ModelTube(this, this.textureOffsetX, this.textureOffsetY, par1, par2, par3, par4, par5, par6, 0.0F, radius1,radius2, direction)); + return this; + } + + public IHLModelRenderer addKnee(String par1Str, float par1, float par2, float par3, int par4, int par5, int par6, float radius1, float radius2, ForgeDirection direction, ForgeDirection direction2) + { + par1Str = this.boxName + "." + par1Str; + TextureOffset var8 = this.baseModel.getTextureOffset(par1Str); + this.setTextureOffset(var8.textureOffsetX, var8.textureOffsetY); + this.cubeList.add(new ModelKnee(this, this.textureOffsetX, this.textureOffsetY, par1, par2, par3, par4, par5, par6, 0.0F, radius1,radius2, direction, direction2)); + return this; + } + + public IHLModelRenderer addBox(float par1, float par2, float par3, int par4, int par5, int par6) + { + boolean[] renderFace={true,true,true,true,true,true}; + this.cubeList.add(new ModelToplessBox(this, this.textureOffsetX, this.textureOffsetY, par1, par2, par3, par4, par5, par6, 0.0F, false, renderFace)); + return this; + } + + /** + * Creates a textured box. Args: originX, originY, originZ, width, height, depth, scaleFactor. + */ + public void addBox(float par1, float par2, float par3, int par4, int par5, int par6, float par7, boolean inverted, boolean[] renderFace) + { + this.cubeList.add(new ModelToplessBox(this, this.textureOffsetX, this.textureOffsetY, par1, par2, par3, par4, par5, par6, par7, inverted, renderFace)); + } + + public void setRotationPoint(float par1, float par2, float par3) + { + this.rotationPointX = par1; + this.rotationPointY = par2; + this.rotationPointZ = par3; + } + + public void render(float par1) + { + if (!this.isHidden) + { + if (this.showModel) + { + if (!this.compiled) + { + this.compileDisplayList(par1); + } + + GL11.glTranslatef(this.offsetX, this.offsetY, this.offsetZ); + int var2; + + if (this.rotateAngleX == 0.0F && this.rotateAngleY == 0.0F && this.rotateAngleZ == 0.0F) + { + if (this.rotationPointX == 0.0F && this.rotationPointY == 0.0F && this.rotationPointZ == 0.0F) + { + GL11.glCallList(this.displayList); + + if (this.childModels != null) + { + for (var2 = 0; var2 < this.childModels.size(); ++var2) + { + ((ModelRenderer)this.childModels.get(var2)).render(par1); + } + } + } + else + { + GL11.glTranslatef(this.rotationPointX * par1, this.rotationPointY * par1, this.rotationPointZ * par1); + GL11.glCallList(this.displayList); + + if (this.childModels != null) + { + for (var2 = 0; var2 < this.childModels.size(); ++var2) + { + ((ModelRenderer)this.childModels.get(var2)).render(par1); + } + } + + GL11.glTranslatef(-this.rotationPointX * par1, -this.rotationPointY * par1, -this.rotationPointZ * par1); + } + } + else + { + GL11.glPushMatrix(); + GL11.glTranslatef(this.rotationPointX * par1, this.rotationPointY * par1, this.rotationPointZ * par1); + + if (this.rotateAngleZ != 0.0F) + { + GL11.glRotatef(this.rotateAngleZ * (180F / (float)Math.PI), 0.0F, 0.0F, 1.0F); + } + + if (this.rotateAngleY != 0.0F) + { + GL11.glRotatef(this.rotateAngleY * (180F / (float)Math.PI), 0.0F, 1.0F, 0.0F); + } + + if (this.rotateAngleX != 0.0F) + { + GL11.glRotatef(this.rotateAngleX * (180F / (float)Math.PI), 1.0F, 0.0F, 0.0F); + } + + GL11.glCallList(this.displayList); + + if (this.childModels != null) + { + for (var2 = 0; var2 < this.childModels.size(); ++var2) + { + ((ModelRenderer)this.childModels.get(var2)).render(par1); + } + } + + GL11.glPopMatrix(); + } + + GL11.glTranslatef(-this.offsetX, -this.offsetY, -this.offsetZ); + } + } + } + + public void renderWithRotation(float par1) + { + if (!this.isHidden) + { + if (this.showModel) + { + if (!this.compiled) + { + this.compileDisplayList(par1); + } + + GL11.glPushMatrix(); + GL11.glTranslatef(this.rotationPointX * par1, this.rotationPointY * par1, this.rotationPointZ * par1); + + if (this.rotateAngleY != 0.0F) + { + GL11.glRotatef(this.rotateAngleY * (180F / (float)Math.PI), 0.0F, 1.0F, 0.0F); + } + + if (this.rotateAngleX != 0.0F) + { + GL11.glRotatef(this.rotateAngleX * (180F / (float)Math.PI), 1.0F, 0.0F, 0.0F); + } + + if (this.rotateAngleZ != 0.0F) + { + GL11.glRotatef(this.rotateAngleZ * (180F / (float)Math.PI), 0.0F, 0.0F, 1.0F); + } + + GL11.glCallList(this.displayList); + GL11.glPopMatrix(); + } + } + } + + /** + * Allows the changing of Angles after a box has been rendered + */ + public void postRender(float par1) + { + if (!this.isHidden) + { + if (this.showModel) + { + if (!this.compiled) + { + this.compileDisplayList(par1); + } + + if (this.rotateAngleX == 0.0F && this.rotateAngleY == 0.0F && this.rotateAngleZ == 0.0F) + { + if (this.rotationPointX != 0.0F || this.rotationPointY != 0.0F || this.rotationPointZ != 0.0F) + { + GL11.glTranslatef(this.rotationPointX * par1, this.rotationPointY * par1, this.rotationPointZ * par1); + } + } + else + { + GL11.glTranslatef(this.rotationPointX * par1, this.rotationPointY * par1, this.rotationPointZ * par1); + + if (this.rotateAngleZ != 0.0F) + { + GL11.glRotatef(this.rotateAngleZ * (180F / (float)Math.PI), 0.0F, 0.0F, 1.0F); + } + + if (this.rotateAngleY != 0.0F) + { + GL11.glRotatef(this.rotateAngleY * (180F / (float)Math.PI), 0.0F, 1.0F, 0.0F); + } + + if (this.rotateAngleX != 0.0F) + { + GL11.glRotatef(this.rotateAngleX * (180F / (float)Math.PI), 1.0F, 0.0F, 0.0F); + } + } + } + } + } + + /** + * Compiles a GL display list for this model + */ + private void compileDisplayList(float par1) + { + this.displayList = GLAllocation.generateDisplayLists(1); + GL11.glNewList(this.displayList, GL11.GL_COMPILE); + Tessellator var2 = Tessellator.instance; + + for (int var3 = 0; var3 < this.cubeList.size(); ++var3) + { + if(this.cubeList.get(var3) instanceof ModelToplessBox) + { + ((ModelToplessBox)this.cubeList.get(var3)).render(var2, par1); + } + else if(this.cubeList.get(var3) instanceof ModelTube) + { + ((ModelTube)this.cubeList.get(var3)).render(var2, par1); + } + else if(this.cubeList.get(var3) instanceof ModelKnee) + { + ((ModelKnee)this.cubeList.get(var3)).render(var2, par1); + } + } + + GL11.glEndList(); + this.compiled = true; + } + + /** + * Returns the model renderer with the new texture parameters. + */ + public IHLModelRenderer setTextureSize(int par1, int par2) + { + this.textureWidth = par1; + this.textureHeight = par2; + return this; + } + + public void addBox(String string, float f, float g, float h, int i, int j, int k) { + this.addBox(string, f, g, h, i, j, k, false); + } + + +} diff --git a/src/main/java/ihl/model/IHLToolRenderer.java b/src/main/java/ihl/model/IHLToolRenderer.java new file mode 100644 index 0000000..31758b2 --- /dev/null +++ b/src/main/java/ihl/model/IHLToolRenderer.java @@ -0,0 +1,69 @@ +package ihl.model; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.ItemRenderer; +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.minecraftforge.client.IItemRenderer; + +@SideOnly(value=Side.CLIENT) +public class IHLToolRenderer implements IItemRenderer +{ + + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) { + switch (type) { + case ENTITY: + return true; + case EQUIPPED: + return true; + case EQUIPPED_FIRST_PERSON: + return true; + case INVENTORY: + return true; + default: + return false; + } + } + + @Override + public void renderItem(ItemRenderType irt, ItemStack stack, Object... arg2) + { + IIcon icon = stack.getItem().getIcon(stack, 0); + Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationItemsTexture); + if(irt.equals(ItemRenderType.INVENTORY)) + { + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawingQuads(); + tessellator.setNormal(0f, 0f, -1f); + double xStart=0d,yStart=0d; + double xEnd=16d,yEnd=16d; + double z = 0.001d; + tessellator.addVertexWithUV(xStart, yEnd, z, icon.getMinU(), icon.getMaxV()); + tessellator.addVertexWithUV(xEnd, yEnd, z, icon.getMaxU(), icon.getMaxV()); + tessellator.addVertexWithUV(xEnd, yStart, z, icon.getMaxU(), icon.getMinV()); + tessellator.addVertexWithUV(xStart, yStart, z, icon.getMinU(), icon.getMinV()); + tessellator.draw(); + GL11.glDisable(GL11.GL_BLEND); + } + else + { + ItemRenderer.renderItemIn2D(Tessellator.instance, icon.getMaxU(), icon.getMinV(), icon.getMinU(), icon.getMaxV(), icon.getIconWidth(), icon.getIconHeight(), 0.0625F); + } + } + + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack arg1, ItemRendererHelper arg2) + { + return type.equals(ItemRenderType.ENTITY); + } + +} diff --git a/src/main/java/ihl/model/ImpregnatingMachineBlockRender.java b/src/main/java/ihl/model/ImpregnatingMachineBlockRender.java new file mode 100644 index 0000000..2602fd0 --- /dev/null +++ b/src/main/java/ihl/model/ImpregnatingMachineBlockRender.java @@ -0,0 +1,126 @@ +package ihl.model; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; +import cpw.mods.fml.client.registry.RenderingRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ihl.items_blocks.MachineBaseBlock; +import ihl.items_blocks.MachineBaseBlock.MachineType; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; + +@SideOnly(value=Side.CLIENT) +public class ImpregnatingMachineBlockRender implements ISimpleBlockRenderingHandler +{ + public static int renderId; + + public ImpregnatingMachineBlockRender() + { + renderId = RenderingRegistry.getNextAvailableRenderId(); + } + + @Override + public int getRenderId() + { + return renderId; + } + + @Override + public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderblocks) + { + MachineBaseBlock blockmb = (MachineBaseBlock) block; + Tessellator tessellator = Tessellator.instance; + block.setBlockBoundsForItemRender(); + renderblocks.setRenderBoundsFromBlock(block); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderblocks.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderblocks.getBlockIconFromSideAndMetadata(block, 0, metadata)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderblocks.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderblocks.getBlockIconFromSideAndMetadata(block, 1, metadata)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderblocks.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderblocks.getBlockIconFromSideAndMetadata(block, 2, metadata)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderblocks.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderblocks.getBlockIconFromSideAndMetadata(block, 3, metadata)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderblocks.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderblocks.getBlockIconFromSideAndMetadata(block, 4, metadata)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderblocks.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderblocks.getBlockIconFromSideAndMetadata(block, 5, metadata)); + tessellator.draw(); + float var11 = 0.0625F; + IIcon innerSideIcon = blockmb.getAdditionalIconsForBlockRenderer(0); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderblocks.renderFaceZNeg(block, 0.0D, 0.0D, 1.0F - var11, innerSideIcon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderblocks.renderFaceZPos(block, 0.0D, 0.0D, var11-1.0F, innerSideIcon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderblocks.renderFaceXNeg(block, 1.0F - var11, 0.0D, 0.0D, innerSideIcon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderblocks.renderFaceXPos(block, var11-1.0F, 0.0D, 0.0D, innerSideIcon); + tessellator.draw(); + IIcon innerBottomIcon = blockmb.getAdditionalIconsForBlockRenderer(1); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + if(blockmb.type.equals(MachineType.SolarEvaporator)) + var11 = 0.5625f; + renderblocks.renderFaceYPos(block, 0.0D, var11-1.0F, 0.0D, innerBottomIcon); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + + @Override + public boolean renderWorldBlock(IBlockAccess blockAccess, int x, int y, int z, Block block, int meta, RenderBlocks blockRenderer) + { + MachineBaseBlock blockmb = (MachineBaseBlock) block; + blockRenderer.renderStandardBlock(block, x, y, z); + Tessellator var5 = Tessellator.instance; + var5.setBrightness(block.getMixedBrightnessForBlock(blockAccess, x, y, z)); + int var6 = block.colorMultiplier(blockAccess, x, y, z); + 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); + IIcon innerSideIcon = blockmb.getAdditionalIconsForBlockRenderer(0); + var11 = 0.0625F; + + blockRenderer.renderFaceXPos(block, x - 1.0F + var11, y, z, innerSideIcon); + blockRenderer.renderFaceXNeg(block, x + 1.0F - var11, y, z, innerSideIcon); + blockRenderer.renderFaceZPos(block, x, y, z - 1.0F + var11, innerSideIcon); + blockRenderer.renderFaceZNeg(block, x, y, z + 1.0F - var11, innerSideIcon); + IIcon innerBottomIcon = blockmb.getAdditionalIconsForBlockRenderer(1); + if(blockmb.type.equals(MachineType.SolarEvaporator)) + var11 = 0.5625f; + blockRenderer.renderFaceYPos(block, x, y - 1.0F + var11, z, innerBottomIcon); + return true; + } + + @Override + public boolean shouldRender3DInInventory(int arg0) + { + return true; + } +} diff --git a/src/main/java/ihl/model/IronWorkbenchBlockRender.java b/src/main/java/ihl/model/IronWorkbenchBlockRender.java new file mode 100644 index 0000000..1af81cf --- /dev/null +++ b/src/main/java/ihl/model/IronWorkbenchBlockRender.java @@ -0,0 +1,107 @@ +package ihl.model; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; +import cpw.mods.fml.client.registry.RenderingRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.world.IBlockAccess; + +@SideOnly(value=Side.CLIENT) +public class IronWorkbenchBlockRender implements ISimpleBlockRenderingHandler +{ + public static int renderId; + + public IronWorkbenchBlockRender() + { + renderId = RenderingRegistry.getNextAvailableRenderId(); + } + + @Override + public int getRenderId() + { + return renderId; + } + + @Override + public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderblocks) + { + Tessellator tessellator = Tessellator.instance; + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + for(int i=0;i<=5;i++) + { + this.setBounds(i, renderblocks, block); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderblocks.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(0, 0)); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderblocks.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(0, 0)); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderblocks.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(0, 0)); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderblocks.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(0, 0)); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderblocks.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(0, 0)); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderblocks.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(0, 0)); + } + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + renderblocks.clearOverrideBlockTexture(); + } + + @Override + public boolean renderWorldBlock(IBlockAccess blockAccess, int x, int y, int z, Block block, int meta, RenderBlocks renderblocks) + { + Tessellator var5 = Tessellator.instance; + var5.setBrightness(block.getMixedBrightnessForBlock(blockAccess, x, y, z)); + int var6 = block.colorMultiplier(blockAccess, x, y, z); + float var7 = (var6 >> 16 & 255) / 255.0F; + float var8 = (var6 >> 8 & 255) / 255.0F; + float var9 = (var6 & 255) / 255.0F; + var5.setColorOpaque_F(var7, var8, var9); + for(int i=0;i<=5;i++) + { + this.setBounds(i, renderblocks, block); + renderblocks.renderStandardBlock(block, x, y, z); + } + return true; + } + + private void setBounds(int index, RenderBlocks renderblocks, Block block) + { + double rt = 1/11d; + switch(index) + { + case 0: + renderblocks.setRenderBounds(0d, 10*rt, 0d, 1d, 1d, 1d); + break; + case 1: + renderblocks.setRenderBounds(rt*2, 4*rt, rt*2, 9*rt, 5*rt, 9*rt); + break; + case 2: + renderblocks.setRenderBounds(rt, 0d, rt, rt*3, rt*10, rt*3); + break; + case 3: + renderblocks.setRenderBounds(rt*8, 0d, rt, rt*10, rt*10, rt*3); + break; + case 4: + renderblocks.setRenderBounds(rt, 0d, rt*8, rt*3, rt*10, rt*10); + break; + case 5: + renderblocks.setRenderBounds(rt*8, 0d, rt*8, rt*10, rt*10, rt*10); + break; + } + } + + @Override + public boolean shouldRender3DInInventory(int arg0) + { + return true; + } +} diff --git a/src/main/java/ihl/model/ModelKnee.java b/src/main/java/ihl/model/ModelKnee.java new file mode 100644 index 0000000..3f720ac --- /dev/null +++ b/src/main/java/ihl/model/ModelKnee.java @@ -0,0 +1,228 @@ +package ihl.model; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.model.PositionTextureVertex; +import net.minecraft.client.model.TexturedQuad; +import net.minecraft.client.renderer.Tessellator; +import net.minecraftforge.common.util.ForgeDirection; + +@SideOnly(value=Side.CLIENT) +public class ModelKnee { + /** + * The (x,y,z) vertex positions and (u,v) texture coordinates for each of the 8 points on a cube + */ + private PositionTextureVertex[] vertexPositions; + + /** An array of 6 TexturedQuads, one for each face of a cube */ + private TexturedQuad[] quadList; + + /** X vertex coordinate of lower box corner */ + public final float posX1; + + /** Y vertex coordinate of lower box corner */ + public final float posY1; + + /** Z vertex coordinate of lower box corner */ + public final float posZ1; + + /** X vertex coordinate of upper box corner */ + public final float posX2; + + /** Y vertex coordinate of upper box corner */ + public final float posY2; + + /** Z vertex coordinate of upper box corner */ + public final float posZ2; + public String field_78247_g; + private ForgeDirection direction1; + private ForgeDirection direction2; + + public ModelKnee(IHLModelRenderer par1ModelRenderer, int par2, int par3, float x1, float y1, float z1, int par7, int par8, int par9, float par10, float radius1, float radius2, ForgeDirection direction1_1) + { + this(par1ModelRenderer, par2, par3, x1, y1, z1, par7, par8, par9, par10, radius1, radius2, direction1_1, direction1_1); + } + + + public ModelKnee(IHLModelRenderer par1ModelRenderer, int par2, int par3, float x1, float y1, float z1, int par7, int par8, int par9, float par10, float radius1, float radius2, ForgeDirection direction1_1, ForgeDirection direction2_1) + { + this.direction1=direction1_1; + this.direction2=direction2_1; + this.posX1 = x1; + this.posY1 = y1; + this.posZ1 = z1; + this.posX2 = x1 + par7; + this.posY2 = y1 + par8; + this.posZ2 = z1 + par9; + this.vertexPositions = new PositionTextureVertex[32]; + this.quadList = new TexturedQuad[32]; + float x2 = x1 + par7; + float y2 = y1 + par8; + float z2 = z1 + par9; + x1 -= par10; + y1 -= par10; + z1 -= par10; + x2 += par10; + y2 += par10; + z2 += par10; + + if (par1ModelRenderer.mirror) + { + float var14 = x2; + x2 = x1; + x1 = var14; + } + float dx = x2-x1 ; + float dy = y2-y1; + float dz = z2-z1; + PositionTextureVertex[] outervertexes1 = new PositionTextureVertex[8]; + PositionTextureVertex[] innervertexes1 = new PositionTextureVertex[8]; + PositionTextureVertex[] outervertexes2 = new PositionTextureVertex[8]; + PositionTextureVertex[] innervertexes2 = new PositionTextureVertex[8]; + int i=0; + for(i=0;i<8;i++) + { + switch(direction1) + { + case UP: + outervertexes1[i] = new PositionTextureVertex(x1+dx*0.5F+dx*0.25F*(float)Math.cos(2D*Math.PI/8D*i), y1, z1+dz*0.5F+dz*0.25F*(float)Math.sin(2D*Math.PI/8D*i), par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); + innervertexes1[i] = new PositionTextureVertex(x1+dx*0.5F+dx*radius1*0.25F*(float)Math.cos(2D*Math.PI/8D*i), y1, z1+dz*0.5F+dz*0.25F*radius1*(float)Math.sin(2D*Math.PI/8D*i), par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); + break; + case DOWN: + outervertexes1[i] = new PositionTextureVertex(x1+dx*0.5F+dx*0.25F*radius2*(float)Math.cos(2D*Math.PI/8D*i), y2, z1+dz*0.5F-dz*0.25F*radius2*(float)Math.sin(2D*Math.PI/8D*i), par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); + innervertexes1[i] = new PositionTextureVertex(x1+dx*0.5F+dx*radius1*radius2*0.25F*(float)Math.cos(2D*Math.PI/8D*i), y2, z1+dz*0.5F-dz*0.25F*radius1*radius2*(float)Math.sin(2D*Math.PI/8D*i), par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); + break; + case SOUTH: + outervertexes1[i] = new PositionTextureVertex(x1+dx*0.5F+dx*0.25F*(float)Math.cos(2D*Math.PI/8D*i), y1+dy*0.5F+dy*0.25F*(float)Math.sin(2D*Math.PI/8D*i), z2, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); + innervertexes1[i] = new PositionTextureVertex(x1+dx*0.5F+dx*radius1*0.25F*(float)Math.cos(2D*Math.PI/8D*i), y1+dy*0.5F+dy*0.25F*radius1*(float)Math.sin(2D*Math.PI/8D*i), z2, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); + break; + case NORTH: + outervertexes1[i] = new PositionTextureVertex(x1+dx*0.5F+dx*0.25F*radius2*(float)Math.cos(2D*Math.PI/8D*i), y1+dy*0.5F+dy*0.25F*radius2*(float)Math.sin(2D*Math.PI/8D*i), z2, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); + innervertexes1[i] = new PositionTextureVertex(x1+dx*0.5F+dx*radius1*radius2*0.25F*(float)Math.cos(2D*Math.PI/8D*i), y1+dy*0.5F+dy*0.25F*radius1*radius2*(float)Math.sin(2D*Math.PI/8D*i), z2, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); + break; + case EAST: + outervertexes1[i] = new PositionTextureVertex(x1, y1+dy*0.5F+dy*0.25F*(float)Math.sin(2D*Math.PI/8D*i), z1+dz*0.5F+dz*0.25F*(float)Math.cos(2D*Math.PI/8D*i), par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); + innervertexes1[i] = new PositionTextureVertex(x1, y1+dy*0.5F+dy*0.25F*radius1*(float)Math.sin(2D*Math.PI/8D*i), z1+dz*0.5F+dz*radius1*0.25F*(float)Math.cos(2D*Math.PI/8D*i), par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); + break; + case WEST: + outervertexes1[i] = new PositionTextureVertex(x1, y1+dy*0.5F+dy*0.25F*radius2*(float)Math.sin(2D*Math.PI/8D*i), z1+dz*0.5F+dz*0.52F*radius2*(float)Math.cos(2D*Math.PI/8D*i), par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); + innervertexes1[i] = new PositionTextureVertex(x1, y1+dy*0.5F+dy*0.25F*radius2*radius1*(float)Math.sin(2D*Math.PI/8D*i), z1+dz*0.5F+dz*radius1*0.25F*radius2*(float)Math.cos(2D*Math.PI/8D*i), par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); + break; + default: + outervertexes1[i] = new PositionTextureVertex(x1, y1+dy*0.5F+dy*0.25F*radius2*(float)Math.sin(2D*Math.PI/8D*i), z1+dz*0.5F+dz*0.52F*radius2*(float)Math.cos(2D*Math.PI/8D*i), par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); + innervertexes1[i] = new PositionTextureVertex(x1, y1+dy*0.5F+dy*0.25F*radius2*radius1*(float)Math.sin(2D*Math.PI/8D*i), z1+dz*0.5F+dz*radius1*0.25F*radius2*(float)Math.cos(2D*Math.PI/8D*i), par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); + break; + } + + switch(direction2) + { + case UP: + outervertexes2[i] = new PositionTextureVertex(x1+dx*0.5F+dx*0.5F*radius2*(float)Math.cos(2D*Math.PI/8D*i), y2, z1+dz*0.5F+dz*0.5F*radius2*(float)Math.sin(2D*Math.PI/8D*i), par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); + innervertexes2[i] = new PositionTextureVertex(x1+dx*0.5F+dx*radius1*radius2*0.5F*(float)Math.cos(2D*Math.PI/8D*i), y2, z1+dz*0.5F+dz*0.5F*radius2*radius1*(float)Math.sin(2D*Math.PI/8D*i), par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); + break; + case DOWN: + outervertexes2[i] = new PositionTextureVertex(x1+dx*0.5F+dx*0.5F*(float)Math.cos(2D*Math.PI/8D*i), y2, z1+dz*0.5F+dz*0.5F*(float)Math.sin(2D*Math.PI/8D*i), par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); + innervertexes2[i] = new PositionTextureVertex(x1+dx*0.5F+dx*radius1*0.5F*(float)Math.cos(2D*Math.PI/8D*i), y2, z1+dz*0.5F+dz*0.5F*radius1*(float)Math.sin(2D*Math.PI/8D*i), par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); + break; + case WEST: + outervertexes2[i] = new PositionTextureVertex(x2, y1+dy*0.5F+dy*0.25F*(float)Math.cos(2D*Math.PI/8D*i), z1+dz*0.5F-dz*0.25F*(float)Math.sin(2D*Math.PI/8D*i), par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); + innervertexes2[i] = new PositionTextureVertex(x2, y1+dy*0.5F+dy*radius1*0.25F*(float)Math.cos(2D*Math.PI/8D*i), z1+dz*0.5F-dz*0.25F*radius1*(float)Math.sin(2D*Math.PI/8D*i), par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); + break; + case EAST: + outervertexes2[i] = new PositionTextureVertex(x1, y1+dy*0.5F+dy*0.25F*(float)Math.cos(2D*Math.PI/8D*i), z1+dz*0.5F+dz*0.25F*(float)Math.sin(2D*Math.PI/8D*i), par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); + innervertexes2[i] = new PositionTextureVertex(x1, y1+dy*0.5F+dy*radius1*0.25F*(float)Math.cos(2D*Math.PI/8D*i), z1+dz*0.5F+dz*0.25F*radius1*(float)Math.sin(2D*Math.PI/8D*i), par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); + break; + case NORTH: + outervertexes2[i] = new PositionTextureVertex(x1+dx*0.5F+dx*0.25F*(float)Math.cos(2D*Math.PI/8D*i), y1+z2-dz*0.5F-dz*0.25F*(float)Math.sin(2D*Math.PI/8D*i), z2, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); + innervertexes2[i] = new PositionTextureVertex(x1+dx*0.5F+dx*radius1*0.25F*(float)Math.cos(2D*Math.PI/8D*i), y1+z2-dz*0.5F-dz*0.25F*radius1*(float)Math.sin(2D*Math.PI/8D*i), z2, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); + break; + case SOUTH: + outervertexes2[i] = new PositionTextureVertex(x1+dx*0.5F+dx*0.25F*(float)Math.cos(2D*Math.PI/8D*i), y1+dy*0.5F+dy*0.25F*(float)Math.sin(2D*Math.PI/8D*i), z1, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); + innervertexes2[i] = new PositionTextureVertex(x1+dx*0.5F+dx*radius1*0.25F*(float)Math.cos(2D*Math.PI/8D*i), y1+dy*0.5F+dy*0.25F*radius1*(float)Math.sin(2D*Math.PI/8D*i), z1, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); + break; + default: + outervertexes2[i] = new PositionTextureVertex(x1+dx*0.5F+dx*0.5F*radius2*(float)Math.cos(2D*Math.PI/8D*i), y2, z1+dz*0.5F+dz*0.5F*radius2*(float)Math.sin(2D*Math.PI/8D*i), par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); + innervertexes2[i] = new PositionTextureVertex(x1+dx*0.5F+dx*radius1*radius2*0.5F*(float)Math.cos(2D*Math.PI/8D*i), y2, z1+dz*0.5F+dz*0.5F*radius2*radius1*(float)Math.sin(2D*Math.PI/8D*i), par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); + break; + } + } + for(i=0;i<32;i++) + { + if(i<8) + { + this.vertexPositions[i]=outervertexes1[i]; + } + else if(i<16) + { + this.vertexPositions[i]=innervertexes1[i-8]; + } + else if(i<24) + { + this.vertexPositions[i]=outervertexes2[i-16]; + } + else + { + this.vertexPositions[i]=innervertexes2[i-24]; + } + } + for(i=0;i<32;i++) + { + if(i<7) + { + this.quadList[i]=new TexturedQuad(new PositionTextureVertex[] {outervertexes1[i],outervertexes1[i+1],innervertexes1[i+1],innervertexes1[i]},par2 + par9 + par7, par3 + par9, par2 + par9 + par7 + par9, par3 + par9 + par8, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); + } + else if(i==7) + { + this.quadList[i]=new TexturedQuad(new PositionTextureVertex[] {outervertexes1[i],outervertexes1[0],innervertexes1[0],innervertexes1[i]},par2 + par9 + par7, par3 + par9, par2 + par9 + par7 + par9, par3 + par9 + par8, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); + } + else if(i<15) + { + this.quadList[i]=new TexturedQuad(new PositionTextureVertex[] {innervertexes2[i-8],innervertexes2[i+1-8],outervertexes2[i+1-8],outervertexes2[i-8]},par2, par3 + par9, par2 + par9, par3 + par9 + par8, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); + } + else if(i==15) + { + this.quadList[i]=new TexturedQuad(new PositionTextureVertex[] {innervertexes2[i-8],innervertexes2[0],outervertexes2[0],outervertexes2[i-8]},par2, par3 + par9, par2 + par9, par3 + par9 + par8, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); + } + else if(i<23) + { + this.quadList[i]=new TexturedQuad(new PositionTextureVertex[] {outervertexes1[i-16],outervertexes2[i-16],outervertexes2[i-16+1],outervertexes1[i-16+1]},par2 + par9, par3, par2 + par9 + par7, par3 + par9, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); + } + else if(i==23) + { + this.quadList[i]=new TexturedQuad(new PositionTextureVertex[] {outervertexes1[i-16],outervertexes2[i-16],outervertexes2[0],outervertexes1[0]},par2 + par9, par3, par2 + par9 + par7, par3 + par9, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); + } + else if(i<31) + { + this.quadList[i]=new TexturedQuad(new PositionTextureVertex[] {innervertexes1[i-24+1],innervertexes2[i-24+1], innervertexes2[i-24], innervertexes1[i-24]},par2 + par9, par3, par2 + par9 + par7, par3 + par9, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); + } + else if(i==31) + { + this.quadList[i]=new TexturedQuad(new PositionTextureVertex[] {innervertexes1[0],innervertexes2[0],innervertexes2[i-24],innervertexes1[i-24]},par2 + par9, par3, par2 + par9 + par7, par3 + par9, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); + } + } + if (par1ModelRenderer.mirror) + { + for (int var22 = 0; var22 < this.quadList.length; ++var22) + { + this.quadList[var22].flipFace(); + } + } + } + + /** + * Draw the six sided box defined by this ModelBox + */ + public void render(Tessellator par1Tessellator, float par2) + { + for(int i=0;i> 16 & 255) / 255.0F; + float var8 = (var6 >> 8 & 255) / 255.0F; + float var9 = (var6 & 255) / 255.0F; + var5.setColorOpaque_F(var7, var8, var9); + for(int i=0;i<=43;i++) + { + this.setBounds(i, renderblocks, block); + renderblocks.renderStandardBlock(block, x, y, z); + } + + this.setBounds(44, renderblocks, block); + renderblocks.renderFaceXNeg(block, x, y, z, block.getIcon(0, 0)); + renderblocks.renderFaceXPos(block, x, y, z, block.getIcon(0, 0)); + renderblocks.renderFaceZNeg(block, x, y, z, block.getIcon(0, 0)); + renderblocks.renderFaceZPos(block, x, y, z, block.getIcon(0, 0)); + renderblocks.renderFaceYNeg(block, x, y, z, block.getIcon(5, 0)); + + this.setBounds(45, renderblocks, block); + renderblocks.renderFaceXNeg(block, x, y, z, block.getIcon(5, 0)); + renderblocks.renderFaceXPos(block, x, y, z, block.getIcon(5, 0)); + renderblocks.renderFaceZNeg(block, x, y, z, block.getIcon(0, 0)); + renderblocks.renderFaceZPos(block, x, y, z, block.getIcon(0, 0)); + renderblocks.renderFaceYNeg(block, x, y, z, block.getIcon(0, 0)); + renderblocks.renderFaceYPos(block, x, y, z, block.getIcon(0, 0)); + + this.setBounds(46, renderblocks, block); + renderblocks.renderFaceXNeg(block, x, y, z, block.getIcon(0, 0)); + renderblocks.renderFaceXPos(block, x, y, z, block.getIcon(0, 0)); + renderblocks.renderFaceZNeg(block, x, y, z, block.getIcon(5, 0)); + renderblocks.renderFaceZPos(block, x, y, z, block.getIcon(5, 0)); + renderblocks.renderFaceYNeg(block, x, y, z, block.getIcon(0, 0)); + renderblocks.renderFaceYPos(block, x, y, z, block.getIcon(0, 0)); + + this.setBounds(47, renderblocks, block); + renderblocks.renderFaceXNeg(block, x, y, z, block.getIcon(0, 0)); + renderblocks.renderFaceXPos(block, x, y, z, block.getIcon(0, 0)); + renderblocks.renderFaceZNeg(block, x, y, z, block.getIcon(0, 0)); + renderblocks.renderFaceZPos(block, x, y, z, block.getIcon(0, 0)); + renderblocks.renderFaceYNeg(block, x, y, z, block.getIcon(0, 0)); + renderblocks.renderFaceYPos(block, x, y, z, block.getIcon(4, 0)); + + IHLRenderUtils.instance.setPosition(x, y, z); + IHLRenderUtils.instance.setRotationPoint(0F, 16F, 0F); + IHLRenderUtils.instance.setRotation(0F, 0f, 0F); + + IIcon icon = block.getIcon(1, 0); + + TileEntity tile = blockAccess.getTileEntity(x, y, z); + if(tile!=null && tile.getWorldObj() != null) + { + switch (((IWrenchable)tile).getFacing()) + { + case 2: + IHLRenderUtils.instance.drawPipe(-6F, -14F, -2F, 4, 2, 4, 0f, 0.5f,ForgeDirection.UP,icon); + IHLRenderUtils.instance.drawPipe(-6F, -12F, -2F, 4, 2, 4, 0f, 0.5f,ForgeDirection.UP,icon); + IHLRenderUtils.instance.drawPipe(-6F, -10F, -2F, 4, 2, 4, 0f, 0.5f,ForgeDirection.UP,icon); + + IHLRenderUtils.instance.drawPipe(2F, -14F, -2F, 4, 2, 4, 0f, 0.5f,ForgeDirection.UP,icon); + IHLRenderUtils.instance.drawPipe(2F, -12F, -2F, 4, 2, 4, 0f, 0.5f,ForgeDirection.UP,icon); + IHLRenderUtils.instance.drawPipe(2F, -10F, -2F, 4, 2, 4, 0f, 0.5f,ForgeDirection.UP,icon); + + icon = block.getIcon(2, 0); + IHLRenderUtils.instance.drawPipe(-4.5F, -16F, -0.5F, 1, 2, 1, 0f, 1f, ForgeDirection.UP,icon); + icon = block.getIcon(3, 0); + IHLRenderUtils.instance.drawPipe(3.5F, -16F, -0.5F, 1, 2, 1, 0f, 1f, ForgeDirection.UP,icon); + break; + case 5: + IHLRenderUtils.instance.drawPipe(-2F, -14F, -6F, 4, 2, 4, 0f, 0.5f,ForgeDirection.UP,icon); + IHLRenderUtils.instance.drawPipe(-2F, -12F, -6F, 4, 2, 4, 0f, 0.5f,ForgeDirection.UP,icon); + IHLRenderUtils.instance.drawPipe(-2F, -10F, -6F, 4, 2, 4, 0f, 0.5f,ForgeDirection.UP,icon); + + IHLRenderUtils.instance.drawPipe(-2F, -14F, 2F, 4, 2, 4, 0f, 0.5f,ForgeDirection.UP,icon); + IHLRenderUtils.instance.drawPipe(-2F, -12F, 2F, 4, 2, 4, 0f, 0.5f,ForgeDirection.UP,icon); + IHLRenderUtils.instance.drawPipe(-2F, -10F, 2F, 4, 2, 4, 0f, 0.5f,ForgeDirection.UP,icon); + + icon = block.getIcon(2, 0); + IHLRenderUtils.instance.drawPipe(-0.5F, -16F, -4.5F, 1, 2, 1, 0f, 1f, ForgeDirection.UP,icon); + icon = block.getIcon(3, 0); + IHLRenderUtils.instance.drawPipe(-0.5F, -16F, 3.5F, 1, 2, 1, 0f, 1f, ForgeDirection.UP,icon); + break; + case 3: + IHLRenderUtils.instance.drawPipe(-6F, -14F, -2F, 4, 2, 4, 0f, 0.5f,ForgeDirection.UP,icon); + IHLRenderUtils.instance.drawPipe(-6F, -12F, -2F, 4, 2, 4, 0f, 0.5f,ForgeDirection.UP,icon); + IHLRenderUtils.instance.drawPipe(-6F, -10F, -2F, 4, 2, 4, 0f, 0.5f,ForgeDirection.UP,icon); + + IHLRenderUtils.instance.drawPipe(2F, -14F, -2F, 4, 2, 4, 0f, 0.5f,ForgeDirection.UP,icon); + IHLRenderUtils.instance.drawPipe(2F, -12F, -2F, 4, 2, 4, 0f, 0.5f,ForgeDirection.UP,icon); + IHLRenderUtils.instance.drawPipe(2F, -10F, -2F, 4, 2, 4, 0f, 0.5f,ForgeDirection.UP,icon); + + icon = block.getIcon(3, 0); + IHLRenderUtils.instance.drawPipe(-4.5F, -16F, -0.5F, 1, 2, 1, 0f, 1f, ForgeDirection.UP,icon); + icon = block.getIcon(2, 0); + IHLRenderUtils.instance.drawPipe(3.5F, -16F, -0.5F, 1, 2, 1, 0f, 1f, ForgeDirection.UP,icon); + break; + case 4: + IHLRenderUtils.instance.drawPipe(-2F, -14F, -6F, 4, 2, 4, 0f, 0.5f,ForgeDirection.UP,icon); + IHLRenderUtils.instance.drawPipe(-2F, -12F, -6F, 4, 2, 4, 0f, 0.5f,ForgeDirection.UP,icon); + IHLRenderUtils.instance.drawPipe(-2F, -10F, -6F, 4, 2, 4, 0f, 0.5f,ForgeDirection.UP,icon); + + IHLRenderUtils.instance.drawPipe(-2F, -14F, 2F, 4, 2, 4, 0f, 0.5f,ForgeDirection.UP,icon); + IHLRenderUtils.instance.drawPipe(-2F, -12F, 2F, 4, 2, 4, 0f, 0.5f,ForgeDirection.UP,icon); + IHLRenderUtils.instance.drawPipe(-2F, -10F, 2F, 4, 2, 4, 0f, 0.5f,ForgeDirection.UP,icon); + + icon = block.getIcon(3, 0); + IHLRenderUtils.instance.drawPipe(-0.5F, -16F, -4.5F, 1, 2, 1, 0f, 1f, ForgeDirection.UP,icon); + icon = block.getIcon(2, 0); + IHLRenderUtils.instance.drawPipe(-0.5F, -16F, 3.5F, 1, 2, 1, 0f, 1f, ForgeDirection.UP,icon); + break; + default: + IHLRenderUtils.instance.drawPipe(-6F, -14F, -2F, 4, 2, 4, 0f, 0.5f,ForgeDirection.UP,icon); + IHLRenderUtils.instance.drawPipe(-6F, -12F, -2F, 4, 2, 4, 0f, 0.5f,ForgeDirection.UP,icon); + IHLRenderUtils.instance.drawPipe(-6F, -10F, -2F, 4, 2, 4, 0f, 0.5f,ForgeDirection.UP,icon); + + IHLRenderUtils.instance.drawPipe(2F, -14F, -2F, 4, 2, 4, 0f, 0.5f,ForgeDirection.UP,icon); + IHLRenderUtils.instance.drawPipe(2F, -12F, -2F, 4, 2, 4, 0f, 0.5f,ForgeDirection.UP,icon); + IHLRenderUtils.instance.drawPipe(2F, -10F, -2F, 4, 2, 4, 0f, 0.5f,ForgeDirection.UP,icon); + + icon = block.getIcon(2, 0); + IHLRenderUtils.instance.drawPipe(-4.5F, -16F, -0.5F, 1, 2, 1, 0f, 1f, ForgeDirection.UP,icon); + icon = block.getIcon(3, 0); + IHLRenderUtils.instance.drawPipe(3.5F, -16F, -0.5F, 1, 2, 1, 0f, 1f, ForgeDirection.UP,icon); + break; + } + } + return true; + } + + private void setBounds(int index, RenderBlocks renderblocks, Block block) + { + double rt = 1/11d; + switch(index) + { + case 0: + renderblocks.setRenderBounds(rt, 0d, 0d, rt*2, 1d, rt); + break; + case 1: + renderblocks.setRenderBounds(rt*3, rt*8, 0d, rt*4, 1d, rt); + break; + case 2: + renderblocks.setRenderBounds(rt*5, rt*8, 0d, rt*6, 1d, rt); + break; + case 3: + renderblocks.setRenderBounds(rt*7, rt*8, 0d, rt*8, 1d, rt); + break; + case 4: + renderblocks.setRenderBounds(rt*3, 0d, 0d, rt*4, rt*3, rt); + break; + case 5: + renderblocks.setRenderBounds(rt*5, 0d, 0d, rt*6, rt*3, rt); + break; + case 6: + renderblocks.setRenderBounds(rt*7, 0d, 0d, rt*8, rt*3, rt); + break; + case 7: + renderblocks.setRenderBounds(rt*9, 0d, 0d, rt*10, 1d, rt); + break; + + case 8: + renderblocks.setRenderBounds(rt, 0d, rt*10, rt*2, 1d, 1d); + break; + case 9: + renderblocks.setRenderBounds(rt*3, rt*8, rt*10, rt*4, 1d, 1d); + break; + case 10: + renderblocks.setRenderBounds(rt*5, rt*8, rt*10, rt*6, 1d, 1d); + break; + case 11: + renderblocks.setRenderBounds(rt*7, rt*8, rt*10, rt*8, 1d, 1d); + break; + case 12: + renderblocks.setRenderBounds(rt*3, 0d, rt*10, rt*4, rt*3, 1d); + break; + case 13: + renderblocks.setRenderBounds(rt*5, 0d, rt*10, rt*6, rt*3, 1d); + break; + case 14: + renderblocks.setRenderBounds(rt*7, 0d, rt*10, rt*8, rt*3, 1d); + break; + case 15: + renderblocks.setRenderBounds(rt*9, 0d, rt*10, rt*10, 1d, 1d); + break; + + case 16: + renderblocks.setRenderBounds(0d, 0d, rt, rt, 1d, rt*2); + break; + case 17: + renderblocks.setRenderBounds(0d,rt*8, rt*3,rt,1d, rt*4); + break; + case 18: + renderblocks.setRenderBounds(0d,rt*8, rt*5,rt, 1d, rt*6); + break; + case 19: + renderblocks.setRenderBounds(0d,rt*8, rt*7,rt,1d, rt*8); + break; + case 20: + renderblocks.setRenderBounds(0d,0d, rt*3, rt, rt*3,rt*4); + break; + case 21: + renderblocks.setRenderBounds(0d,0d, rt*5,rt, rt*3, rt*6); + break; + case 22: + renderblocks.setRenderBounds(0d,0d, rt*7, rt,rt*3, rt*8); + break; + case 23: + renderblocks.setRenderBounds(0d,0d, rt*9,rt,1d, rt*10); + break; + + case 24: + renderblocks.setRenderBounds(rt*10, 0d, rt, 1d, 1d, rt*2); + break; + case 25: + renderblocks.setRenderBounds(rt*10, rt*8, rt*3, 1d, 1d, rt*4); + break; + case 26: + renderblocks.setRenderBounds(rt*10, rt*8, rt*5,1d, 1d, rt*6); + break; + case 27: + renderblocks.setRenderBounds(rt*10, rt*8, rt*7, 1d, 1d, rt*8); + break; + case 28: + renderblocks.setRenderBounds(rt*10, 0d, rt*3, 1d, rt*3, rt*4); + break; + case 29: + renderblocks.setRenderBounds(rt*10, 0d, rt*5,1d, rt*3, rt*6); + break; + case 30: + renderblocks.setRenderBounds(rt*10, 0d, rt*7,1d, rt*3, rt*8); + break; + case 31: + renderblocks.setRenderBounds(rt*10, 0d, rt*9, 1d, 1d, rt*10); + break; + + case 32: + renderblocks.setRenderBounds(rt, 0d, rt*3, rt*3, rt, rt*4); + break; + case 33: + renderblocks.setRenderBounds(rt, 0d, rt*5, rt*3, rt, rt*6); + break; + case 34: + renderblocks.setRenderBounds(rt, 0d, rt*7, rt*3, rt, rt*8); + break; + case 35: + renderblocks.setRenderBounds(rt*8, 0d, rt*3, rt*10, rt, rt*4); + break; + case 36: + renderblocks.setRenderBounds(rt*8, 0d, rt*5, rt*10, rt, rt*6); + break; + case 37: + renderblocks.setRenderBounds(rt*8, 0d, rt*7, rt*10, rt, rt*8); + break; + + case 38: + renderblocks.setRenderBounds(rt*3, 0d, rt, rt*4, rt, rt*3); + break; + case 39: + renderblocks.setRenderBounds(rt*5, 0d, rt, rt*6, rt, rt*3); + break; + case 40: + renderblocks.setRenderBounds(rt*7, 0d, rt, rt*8, rt, rt*3); + break; + case 41: + renderblocks.setRenderBounds(rt*3, 0d, rt*8, rt*4, rt, rt*10); + break; + case 42: + renderblocks.setRenderBounds(rt*5, 0d, rt*8, rt*6, rt, rt*10); + break; + case 43: + renderblocks.setRenderBounds(rt*7, 0d, rt*8, rt*8, rt, rt*10); + break; + + case 44: + renderblocks.setRenderBounds(rt*3, 0d, rt*3, rt*8, rt, rt*8); + break; + + case 45: + renderblocks.setRenderBounds(0d, rt*3, rt*3, 1d, rt*8, rt*8); + break; + + case 46: + renderblocks.setRenderBounds(rt*3, rt*3, 0d, rt*8, rt*8, 1d); + break; + + case 47: + renderblocks.setRenderBounds(rt, rt, rt, rt*10, 1d, rt*10); + break; + + } + } + + @Override + public boolean shouldRender3DInInventory(int arg0) + { + return true; + } +} diff --git a/src/main/java/ihl/model/RectifierTransformerUnitSelectionBoxSpecialRenderer.java b/src/main/java/ihl/model/RectifierTransformerUnitSelectionBoxSpecialRenderer.java new file mode 100644 index 0000000..4ce866b --- /dev/null +++ b/src/main/java/ihl/model/RectifierTransformerUnitSelectionBoxSpecialRenderer.java @@ -0,0 +1,51 @@ +package ihl.model; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ihl.flexible_cable.RectifierTransformerUnitTileEntity; +import ihl.interfaces.ISelectionBoxSpecialRenderer; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderGlobal; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MovingObjectPosition; + +@SideOnly(value=Side.CLIENT) +public class RectifierTransformerUnitSelectionBoxSpecialRenderer implements ISelectionBoxSpecialRenderer +{ + @Override + public void drawSelectionBox(EntityPlayer player, ItemStack currentItem, MovingObjectPosition movingObjectPosition, float 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) + { + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + GL11.glLineWidth(2.0F); + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glDepthMask(false); + short side = tile.getSide(player); + if(side==0) + { + GL11.glColor4f(0.0F, 1.0F, 0.0F, 0.8F); + RenderGlobal.drawOutlinedBoundingBox(tile.aabb1.getOffsetBoundingBox(-offsetX, -offsetY, -offsetZ), -1); + RenderGlobal.drawOutlinedBoundingBox(tile.aabb1_1.getOffsetBoundingBox(-offsetX, -offsetY, -offsetZ), -1); + } + else if(side==1) + { + GL11.glColor4f(1.0F, 0.0F, 0.0F, 0.8F); + RenderGlobal.drawOutlinedBoundingBox(tile.aabb2.getOffsetBoundingBox(-offsetX, -offsetY, -offsetZ), -1); + RenderGlobal.drawOutlinedBoundingBox(tile.aabb2_1.getOffsetBoundingBox(-offsetX, -offsetY, -offsetZ), -1); + } + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glDepthMask(true); + GL11.glDisable(GL11.GL_BLEND); + } + } +} diff --git a/src/main/java/ihl/model/RefluxCondenserBlockRender.java b/src/main/java/ihl/model/RefluxCondenserBlockRender.java new file mode 100644 index 0000000..c9021b9 --- /dev/null +++ b/src/main/java/ihl/model/RefluxCondenserBlockRender.java @@ -0,0 +1,125 @@ +package ihl.model; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; +import cpw.mods.fml.client.registry.RenderingRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ic2.api.tile.IWrenchable; +import ihl.utils.IHLRenderUtils; +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; + +@SideOnly(value=Side.CLIENT) +public class RefluxCondenserBlockRender implements ISimpleBlockRenderingHandler +{ + public static int renderId; + + public RefluxCondenserBlockRender() + { + renderId = RenderingRegistry.getNextAvailableRenderId(); + } + + @Override + public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderblocks) + { + Tessellator tessellator = Tessellator.instance; + IHLRenderUtils.instance.reset(); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + IIcon icon = block.getIcon(0, 0); + IHLRenderUtils.instance.setPosition(0, 0, 0); + IHLRenderUtils.instance.setRotationPoint(0F, 16F, 0F); + IHLRenderUtils.instance.setRotation(0F, 0f, 0F); + IHLRenderUtils.instance.drawPipe(-2F, 7F, -2F, 4, 1, 4, 0.6f, 1f,ForgeDirection.UP,icon); + IHLRenderUtils.instance.drawKnee(-8F, 2F, -3F, 5, 6, 6, .8F, 1F, ForgeDirection.UP, ForgeDirection.EAST,icon); + IHLRenderUtils.instance.drawPipe(3.5F, -7F, -1.5F, 4, 3, 3, 0.8f, 1f,ForgeDirection.WEST,icon); + IHLRenderUtils.instance.drawPipe(7F, -7.5F, -2F, 1, 4, 4, 0.6f, 1f,ForgeDirection.WEST,icon); + IHLRenderUtils.instance.drawPipe(7F, 3F, -2F, 1, 4, 4, 0.6f, 1f,ForgeDirection.WEST,icon); + IHLRenderUtils.instance.drawPipe(-3F, 3.5F, -1.5F, 10, 3, 3, .8F, 1F, ForgeDirection.WEST,icon); + IHLRenderUtils.instance.drawPipe(-2F, -8F, -2F, 4, 1, 4, 0.6f, 1f,ForgeDirection.UP,icon); + IHLRenderUtils.instance.drawPipe(-1.5F, -7F, -1.5F, 3, 2, 3, 0.8f, 1f,ForgeDirection.UP,icon); + IHLRenderUtils.instance.drawPipe(-1.5F, 5F, -1.5F, 3, 2, 3, 0.8f, 1f,ForgeDirection.UP,icon); + IHLRenderUtils.instance.drawPipe(-2F, -2F, -8F, 4, 4, 1, 0.6f, 1f,ForgeDirection.NORTH,icon); + IHLRenderUtils.instance.drawPipe(-1.5F, -1.5F, -7F, 3, 3, 7, 0.8f, 1f,ForgeDirection.NORTH,icon); + IHLRenderUtils.instance.setRotationPoint(3F, 16F, 0F); + IHLRenderUtils.instance.setRotation(0F, 0f, -0.5F); + IHLRenderUtils.instance.drawPipe(1F, -4F, -4F, 2, 8, 8, 0f, 0.8f,ForgeDirection.WEST,icon); + IHLRenderUtils.instance.drawPipe(-9F, -4F, -4F, 10, 8, 8, 0.8f, 1f,ForgeDirection.WEST,icon); + IHLRenderUtils.instance.drawPipe(-11F, -4F, -4F, 2, 8, 8, 0f, 0.8f,ForgeDirection.EAST,icon); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + + @Override + public boolean renderWorldBlock(IBlockAccess blockAccess, int x, int y, int z, Block block, int meta, RenderBlocks blockRenderer) + { + IHLRenderUtils.instance.reset(); + TileEntity tile = blockAccess.getTileEntity(x, y, z); + if(tile.getWorldObj() != null) + { + switch (((IWrenchable)tile).getFacing()) + { + case 5: + IHLRenderUtils.instance.renderFromInside=true; + IHLRenderUtils.instance.swapXandZ=true; + IHLRenderUtils.instance.swapRenderBoundsZ=true; + break; + case 3: + IHLRenderUtils.instance.swapRenderBoundsX=true; + IHLRenderUtils.instance.swapRenderBoundsZ=true; + break; + case 4: + IHLRenderUtils.instance.renderFromInside=true; + IHLRenderUtils.instance.swapXandZ=true; + IHLRenderUtils.instance.swapRenderBoundsX=true; + break; + default: + } + } + Tessellator.instance.setBrightness(block.getMixedBrightnessForBlock(blockAccess, x, y, z)); + int colorMultiplier = block.colorMultiplier(blockAccess, x, y, z); + float red = (colorMultiplier >> 16 & 255) / 255.0F; + float green = (colorMultiplier >> 8 & 255) / 255.0F; + float blue = (colorMultiplier & 255) / 255.0F; + Tessellator.instance.setColorOpaque_F(red, green, blue); + IIcon icon = block.getBlockTextureFromSide(0); + IHLRenderUtils.instance.setPosition(x, y, z); + IHLRenderUtils.instance.setRotationPoint(0F, 16F, 0F); + IHLRenderUtils.instance.setRotation(0F, 0f, 0F); + IHLRenderUtils.instance.drawPipe(-2F, 7F, -2F, 4, 1, 4, 0.6f, 1f,ForgeDirection.UP,icon); + IHLRenderUtils.instance.drawKnee(-8F, 2F, -3F, 5, 6, 6, .8F, 1F, ForgeDirection.UP, ForgeDirection.EAST,icon); + IHLRenderUtils.instance.drawPipe(3.5F, -7F, -1.5F, 4, 3, 3, 0.8f, 1f,ForgeDirection.WEST,icon); + IHLRenderUtils.instance.drawPipe(7F, -7.5F, -2F, 1, 4, 4, 0.6f, 1f,ForgeDirection.WEST,icon); + IHLRenderUtils.instance.drawPipe(7F, 3F, -2F, 1, 4, 4, 0.6f, 1f,ForgeDirection.WEST,icon); + IHLRenderUtils.instance.drawPipe(-3F, 3.5F, -1.5F, 10, 3, 3, .8F, 1F, ForgeDirection.WEST,icon); + IHLRenderUtils.instance.drawPipe(-2F, -8F, -2F, 4, 1, 4, 0.6f, 1f,ForgeDirection.UP,icon); + IHLRenderUtils.instance.drawPipe(-1.5F, -7F, -1.5F, 3, 2, 3, 0.8f, 1f,ForgeDirection.UP,icon); + IHLRenderUtils.instance.drawPipe(-1.5F, 5F, -1.5F, 3, 2, 3, 0.8f, 1f,ForgeDirection.UP,icon); + IHLRenderUtils.instance.drawPipe(-2F, -2F, -8F, 4, 4, 1, 0.6f, 1f,ForgeDirection.NORTH,icon); + IHLRenderUtils.instance.drawPipe(-1.5F, -1.5F, -7F, 3, 3, 7, 0.8f, 1f,ForgeDirection.NORTH,icon); + IHLRenderUtils.instance.setRotationPoint(3F, 16F, 0F); + IHLRenderUtils.instance.setRotation(0F, 0f, -0.5F); + IHLRenderUtils.instance.drawPipe(1F, -4F, -4F, 2, 8, 8, 0f, 0.8f,ForgeDirection.WEST,icon); + IHLRenderUtils.instance.drawPipe(-9F, -4F, -4F, 10, 8, 8, 0.8f, 1f,ForgeDirection.WEST,icon); + IHLRenderUtils.instance.drawPipe(-11F, -4F, -4F, 2, 8, 8, 0f, 0.8f,ForgeDirection.EAST,icon); + return true; + } + + @Override + public boolean shouldRender3DInInventory(int arg0) + { + return true; + } + + @Override + public int getRenderId() { + return renderId; + } +} diff --git a/src/main/java/ihl/model/RenderInfo.java b/src/main/java/ihl/model/RenderInfo.java new file mode 100644 index 0000000..4e85f6f --- /dev/null +++ b/src/main/java/ihl/model/RenderInfo.java @@ -0,0 +1,71 @@ +package ihl.model; + +import java.util.Arrays; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.util.IIcon; + +@SideOnly(value=Side.CLIENT) +public class RenderInfo { + + public Block template = Blocks.stone; + public IIcon[] texture = null; + public IIcon override = null; + public float minX = 0; + public float minY = 0; + public float minZ = 0; + public float maxX = 1; + public float maxY = 1; + public float maxZ = 1; + public boolean[] renderSide = new boolean[6]; + public float light = -1f; + public int brightness = -1; + + public RenderInfo() { + setRenderAllSides(); + } + + public RenderInfo(Block template, IIcon[] texture) { + this(); + this.template = template; + this.texture = texture; + } + + public RenderInfo(float minX, float minY, float minZ, float maxX, float maxY, float maxZ) { + this(); + setBlockBounds(minX, minY, minZ, maxX, maxY, maxZ); + } + + public final void setBlockBounds(float minX, float minY, float minZ, float maxX, float maxY, float maxZ) { + this.minX = minX; + this.minY = minY; + this.minZ = minZ; + this.maxX = maxX; + this.maxY = maxY; + this.maxZ = maxZ; + } + + public final void setRenderSingleSide(int side) { + Arrays.fill(renderSide, false); + renderSide[side] = true; + } + + public final void setRenderAllSides() { + Arrays.fill(renderSide, true); + } + + public IIcon getBlockTextureFromSide(int i) { + if (override != null) + return override; + if (texture == null || texture.length == 0) + return template.getBlockTextureFromSide(i); + else { + if (i >= texture.length) + i = 0; + return texture[i]; + } + } +} diff --git a/src/main/java/ihl/model/UniversalTileRender.java b/src/main/java/ihl/model/UniversalTileRender.java new file mode 100644 index 0000000..d3cb4c6 --- /dev/null +++ b/src/main/java/ihl/model/UniversalTileRender.java @@ -0,0 +1,76 @@ +package ihl.model; +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ic2.api.tile.IWrenchable; +import ihl.IHLModInfo; +import ihl.flexible_cable.IronWorkbenchModel; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; + +public class UniversalTileRender extends TileEntitySpecialRenderer{ +private ModelBase model = new IronWorkbenchModel(); +private ResourceLocation tex = new ResourceLocation(IHLModInfo.MODID+":textures/blocks/ironWorkbench.png"); +private final float scale=1F/16F; + +@SideOnly(value=Side.CLIENT) +public UniversalTileRender(ModelBase model1, ResourceLocation texture) +{ + this.model=model1; + this.tex=texture; +} + + @Override + public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float par8) + { + int rotation = 0; + if(tile.getWorldObj() != null) + { + switch (((IWrenchable)tile).getFacing()) + { + case 2: + rotation = 0; + break; + case 5: + rotation = 1; + break; + case 3: + rotation = 2; + break; + case 4: + rotation = 3; + break; + default: + rotation = 0; + } + } + GL11.glPushMatrix(); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F); + GL11.glScalef(1.0F, -1F, -1F); + GL11.glRotatef(rotation*90, 0.0F, 1.0F, 0.0F); + + bindTexture(tex); + for(int i = 0;i getGuiClass() + { + return AchesonFurnaceGui.class; + } + + @Override + protected int[] getInputPosX() + { + return new int[]{40-5,40-5}; + } + + @Override + protected int[] getInputPosY() + { + return new int[]{40-11,22-11}; + } + + @Override + protected int[] getOutputPosX() + { + return new int[]{98-5}; + } + + @Override + protected int[] getOutputPosY() + { + return new int[]{32-11}; + } + + @Override + public String getRecipeId() + { + return "ihl.achesonFurnace"; + } + + @Override + public String getGuiTexture() + { + return "ihl:textures/gui/GUIAchesonFurnace.png"; + } + + @Override + public void loadTransferRects() + { + this.transferRects.add(new RecipeTransferRect(new Rectangle(57-5, 29-11, 40, 30), this.getRecipeId(), new Object[0])); + } + + @Override + public String getOverlayIdentifier() + { + return "achesonFurnace"; + } + + @Override + public Map getRecipeList() + { + return AchesonFurnanceTileEntity.getRecipes(); + } +} diff --git a/src/main/java/ihl/nei_integration/ChemicalReactorRecipeHandler.java b/src/main/java/ihl/nei_integration/ChemicalReactorRecipeHandler.java new file mode 100644 index 0000000..53eeb8d --- /dev/null +++ b/src/main/java/ihl/nei_integration/ChemicalReactorRecipeHandler.java @@ -0,0 +1,125 @@ +package ihl.nei_integration; + +import java.awt.Rectangle; +import java.util.Map; + +import org.lwjgl.opengl.GL11; + +import codechicken.lib.gui.GuiDraw; +import ihl.processing.chemistry.ChemicalReactorGui; +import ihl.processing.chemistry.ChemicalReactorTileEntity; +import ihl.recipes.UniversalRecipeInput; +import ihl.recipes.UniversalRecipeOutput; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.util.StatCollector; + + +public class ChemicalReactorRecipeHandler extends MachineRecipeHandler +{ + @Override + public Class getGuiClass() + { + return ChemicalReactorGui.class; + } + + @Override + protected int[] getInputPosX() + { + return new int[]{104-5,122-5}; + } + + @Override + protected int[] getInputPosY() + { + return new int[]{15-11}; + } + + @Override + protected int[] getFluidInputPosX() + { + return new int[]{60-5,42-5,24-5}; + } + + @Override + protected int[] getFluidInputPosY() + { + return new int[]{15-11}; + } + + @Override + protected int[] getOutputPosX() + { + return new int[]{104-5,122-5}; + } + + @Override + protected int[] getFluidOutputPosX() + { + return new int[]{42-5,60-5}; + } + + @Override + protected int[] getOutputPosY() + { + return new int[]{51-11}; + } + + @Override + protected int[] getFluidOutputPosY() + { + return new int[]{51-11}; + } + + @Override + public String getRecipeId() + { + return "ihl.chemicalReactor"; + } + + @Override + public String getGuiTexture() + { + return "ihl:textures/gui/GUIChemicalReactor.png"; + } + + @Override + public String getOverlayIdentifier() + { + return "chemicalReactor"; + } + + @Override + public void loadTransferRects() + { + this.transferRects.add(new RecipeTransferRect(new Rectangle(103-5,32-10, 36, 18), this.getRecipeId(), new Object[0])); + } + + @Override + public void drawExtras(int recipeNumber) + { + super.drawExtras(recipeNumber); + MachineRecipeHandler.CachedIORecipe recipe = (CachedIORecipe) this.arecipes.get(recipeNumber); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GuiDraw.drawTexturedModalRect(103-18-5, 52-11, 246, 226+6*(this.ticks%4),10,6); + if(recipe.specialConditions) + { + GuiDraw.drawTexturedModalRect(0, 32-11, 0, 166,134,18); + GuiDraw.fontRenderer.drawStringWithShadow(StatCollector.translateToLocal("ihl.use_with_cryogenic_distiller"), 0, 27, 16777215); + } + } + + @Override + public void drawBackground(int i) + { + super.drawBackground(i); + GuiDraw.drawTexturedModalRect(23-5, 14-11, 59, 14, 18, 18); + GuiDraw.drawTexturedModalRect(41-5, 14-11, 59, 14, 18, 18); + GuiDraw.drawTexturedModalRect(41-5, 50-11, 59, 50, 18, 18); + } + + @Override + public Map getRecipeList() + { + return ChemicalReactorTileEntity.getRecipes(); + } +} diff --git a/src/main/java/ihl/nei_integration/CrucibleRecipeHandler.java b/src/main/java/ihl/nei_integration/CrucibleRecipeHandler.java new file mode 100644 index 0000000..87bd6a2 --- /dev/null +++ b/src/main/java/ihl/nei_integration/CrucibleRecipeHandler.java @@ -0,0 +1,79 @@ +package ihl.nei_integration; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import codechicken.nei.PositionedStack; +import ihl.processing.metallurgy.Crucible; +import ihl.recipes.UniversalRecipeInput; +import ihl.recipes.UniversalRecipeOutput; +import ihl.utils.IHLUtils; +import net.minecraft.client.gui.inventory.GuiContainer; + + +public class CrucibleRecipeHandler extends MachineRecipeHandler +{ + @Override + public Class getGuiClass() + { + return null; + } + + @Override + protected int[] getInputPosX() + { + return new int[]{11-5}; + } + + @Override + protected int[] getInputPosY() + { + return new int[]{15-11}; + } + + @Override + protected int[] getOutputPosX() + { + return new int[]{106-5}; + } + + @Override + protected int[] getOutputPosY() + { + return new int[]{51-11}; + } + + @Override + public String getRecipeId() + { + return "ihl.crucible"; + } + + @Override + public String getGuiTexture() + { + return "ihl:textures/gui/GUICrucibleNEI.png"; + } + + @Override + public String getOverlayIdentifier() + { + return "crucible"; + } + + @Override + public Map getRecipeList() + { + return Crucible.getRecipes(); + } + + @Override + public List getAdditionalIngredients() + { + 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/src/main/java/ihl/nei_integration/CryogenicDistillerRecipeHandler.java b/src/main/java/ihl/nei_integration/CryogenicDistillerRecipeHandler.java new file mode 100644 index 0000000..374d66e --- /dev/null +++ b/src/main/java/ihl/nei_integration/CryogenicDistillerRecipeHandler.java @@ -0,0 +1,106 @@ +package ihl.nei_integration; + +import java.awt.Rectangle; +import java.util.Iterator; +import java.util.Map; + +import org.lwjgl.opengl.GL11; + +import codechicken.lib.gui.GuiDraw; +import ic2.core.item.ItemFluidCell; +import ihl.processing.chemistry.CryogenicDistillerGui; +import ihl.processing.chemistry.CryogenicDistillerTileEntity; +import ihl.recipes.UniversalRecipeInput; +import ihl.recipes.UniversalRecipeOutput; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.util.StatCollector; +import net.minecraftforge.fluids.FluidStack; + + +public class CryogenicDistillerRecipeHandler extends MachineRecipeHandler +{ + @Override + public Class getGuiClass() + { + return CryogenicDistillerGui.class; + } + + @Override + protected int[] getInputPosX() + { + return new int[]{103-5}; + } + + @Override + public void loadTransferRects() + { + this.transferRects.add(new RecipeTransferRect(new Rectangle(57-5, 32-10, 63, 18), this.getRecipeId(), new Object[0])); + } + + @Override + protected int[] getInputPosY() + { + return new int[]{51-11}; + } + + @Override + protected int[] getOutputPosX() + { + return new int[]{123-5}; + } + + @Override + protected int[] getOutputPosY() + { + return new int[]{33-11,51-11}; + } + + @Override + public String getRecipeId() + { + return "ihl.cryogenicDistiller"; + } + + @Override + public String getGuiTexture() + { + return "ihl:textures/gui/GUICryogenicDistiller.png"; + } + + @Override + public String getOverlayIdentifier() + { + return "cryogenicDistiller"; + } + + @SuppressWarnings("unchecked") + @Override + public void drawExtras(int recipeNumber) + { + super.drawExtras(recipeNumber); + MachineRecipeHandler.CachedIORecipe recipe = (MachineRecipeHandler.CachedIORecipe) this.arecipes.get(recipeNumber); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + if(recipe.specialConditions) + { + GuiDraw.drawTexturedModalRect(0, 0, 0, 166, 97, 69); + String note = StatCollector.translateToLocal("ihl.as_byproduct_of_processing_of"); + FluidStack fstack = ((ItemFluidCell)recipe.getIngredients().get(0).item.getItem()).getFluid(recipe.getIngredients().get(0).item); + note+=" "+ fstack.getLocalizedName(); + note+=" "+ StatCollector.translateToLocal("ihl.in_chemical_reactor"); + Iterator noteListIterator = GuiDraw.fontRenderer.listFormattedStringToWidth(note, 90).iterator(); + int yTextPos=0; + while(noteListIterator.hasNext()) + { + GuiDraw.fontRenderer.drawStringWithShadow(noteListIterator.next(), 0, yTextPos, 16777215); + yTextPos+=10; + } + GuiDraw.fontRenderer.drawStringWithShadow(StatCollector.translateToLocal("ihl.check_usage"), 0, 44, 16777215); + } + } + + @Override + public Map getRecipeList() + { + return CryogenicDistillerTileEntity.getRecipes(); + } +} diff --git a/src/main/java/ihl/nei_integration/DetonationSprayingMachineRecipeHandler.java b/src/main/java/ihl/nei_integration/DetonationSprayingMachineRecipeHandler.java new file mode 100644 index 0000000..e821bef --- /dev/null +++ b/src/main/java/ihl/nei_integration/DetonationSprayingMachineRecipeHandler.java @@ -0,0 +1,82 @@ +package ihl.nei_integration; + +import java.awt.Rectangle; +import java.util.Map; + +import codechicken.lib.gui.GuiDraw; +import ihl.processing.metallurgy.DetonationSprayingMachineGui; +import ihl.processing.metallurgy.DetonationSprayingMachineTileEntity; +import ihl.recipes.UniversalRecipeInput; +import ihl.recipes.UniversalRecipeOutput; +import net.minecraft.client.gui.inventory.GuiContainer; + + +public class DetonationSprayingMachineRecipeHandler extends MachineRecipeHandler +{ + @Override + public Class getGuiClass() + { + return DetonationSprayingMachineGui.class; + } + + @Override + protected int[] getInputPosX() + { + return new int[]{10-5,98-5,117-5}; + } + + @Override + protected int[] getInputPosY() + { + return new int[]{17-11}; + } + + @Override + protected int[] getOutputPosX() + { + return new int[]{10-5}; + } + + @Override + protected int[] getOutputPosY() + { + return new int[]{53-11}; + } + + @Override + public String getRecipeId() + { + return "ihl.detonationSprayingMachine"; + } + + @Override + public String getGuiTexture() + { + return "ihl:textures/gui/GUIDetonationSprayingMachine.png"; + } + + @Override + public void drawBackground(int i) + { + super.drawBackground(i); + GuiDraw.drawTexturedModalRect(9-5, 34-11, 176, 0, 18, 36); + } + + @Override + public void loadTransferRects() + { + this.transferRects.add(new RecipeTransferRect(new Rectangle(30-5,0, 60, 30), this.getRecipeId(), new Object[0])); + } + + @Override + public String getOverlayIdentifier() + { + return "detonationSprayingMachine"; + } + + @Override + public Map getRecipeList() + { + return DetonationSprayingMachineTileEntity.getRecipes(); + } +} diff --git a/src/main/java/ihl/nei_integration/ElectricEvaporatorRecipeHandler.java b/src/main/java/ihl/nei_integration/ElectricEvaporatorRecipeHandler.java new file mode 100644 index 0000000..349601a --- /dev/null +++ b/src/main/java/ihl/nei_integration/ElectricEvaporatorRecipeHandler.java @@ -0,0 +1,74 @@ +package ihl.nei_integration; + +import java.awt.Rectangle; +import java.util.Map; + +import ihl.processing.chemistry.ElectricEvaporatorGui; +import ihl.processing.chemistry.EvaporatorTileEntity; +import ihl.recipes.UniversalRecipeInput; +import ihl.recipes.UniversalRecipeOutput; +import net.minecraft.client.gui.inventory.GuiContainer; + + +public class ElectricEvaporatorRecipeHandler extends MachineRecipeHandler +{ + @Override + public Class getGuiClass() + { + return ElectricEvaporatorGui.class; + } + + @Override + protected int[] getInputPosX() + { + return new int[]{39}; + } + + @Override + protected int[] getInputPosY() + { + return new int[]{3}; + } + + @Override + protected int[] getOutputPosX() + { + return new int[]{112}; + } + + @Override + protected int[] getOutputPosY() + { + return new int[]{21}; + } + + @Override + public String getRecipeId() + { + return "ihl.electricEvaporator"; + } + + @Override + public String getGuiTexture() + { + return "ihl:textures/gui/GUIElectricEvaporator.png"; + } + + @Override + public String getOverlayIdentifier() + { + return "electricEvaporator"; + } + + @Override + public void loadTransferRects() + { + this.transferRects.add(new RecipeTransferRect(new Rectangle(99-5,34-10, 17, 13), this.getRecipeId(), new Object[0])); + } + + @Override + public Map getRecipeList() + { + return EvaporatorTileEntity.getRecipes(); + } +} diff --git a/src/main/java/ihl/nei_integration/ElectrolysisBathRecipeHandler.java b/src/main/java/ihl/nei_integration/ElectrolysisBathRecipeHandler.java new file mode 100644 index 0000000..bf91f03 --- /dev/null +++ b/src/main/java/ihl/nei_integration/ElectrolysisBathRecipeHandler.java @@ -0,0 +1,74 @@ +package ihl.nei_integration; + +import java.awt.Rectangle; +import java.util.Map; + +import ihl.processing.chemistry.ElectrolysisBathGui; +import ihl.processing.chemistry.ElectrolysisBathTileEntity; +import ihl.recipes.UniversalRecipeInput; +import ihl.recipes.UniversalRecipeOutput; +import net.minecraft.client.gui.inventory.GuiContainer; + + +public class ElectrolysisBathRecipeHandler extends MachineRecipeHandler +{ + @Override + public Class getGuiClass() + { + return ElectrolysisBathGui.class; + } + + @Override + protected int[] getInputPosX() + { + return new int[]{6-5,98-5,78-5}; + } + + @Override + protected int[] getInputPosY() + { + return new int[]{16-11}; + } + + @Override + protected int[] getOutputPosX() + { + return new int[]{6-5,87-5,106-5}; + } + + @Override + protected int[] getOutputPosY() + { + return new int[]{52-11,51-11,15-11}; + } + + @Override + public String getRecipeId() + { + return "ihl.electrolysisBath"; + } + + @Override + public String getGuiTexture() + { + return "ihl:textures/gui/GUIElectrolysisBath.png"; + } + + @Override + public String getOverlayIdentifier() + { + return "electrolysisBath"; + } + + @Override + public void loadTransferRects() + { + this.transferRects.add(new RecipeTransferRect(new Rectangle(115-5,10-10, 172-115, 72), this.getRecipeId(), new Object[0])); + } + + @Override + public Map getRecipeList() + { + return ElectrolysisBathTileEntity.getRecipes(); + } +} diff --git a/src/main/java/ihl/nei_integration/EvaporatorRecipeHandler.java b/src/main/java/ihl/nei_integration/EvaporatorRecipeHandler.java new file mode 100644 index 0000000..54eb4e9 --- /dev/null +++ b/src/main/java/ihl/nei_integration/EvaporatorRecipeHandler.java @@ -0,0 +1,74 @@ +package ihl.nei_integration; + +import java.awt.Rectangle; +import java.util.Map; + +import ihl.processing.chemistry.EvaporatorGui; +import ihl.processing.chemistry.EvaporatorTileEntity; +import ihl.recipes.UniversalRecipeInput; +import ihl.recipes.UniversalRecipeOutput; +import net.minecraft.client.gui.inventory.GuiContainer; + + +public class EvaporatorRecipeHandler extends MachineRecipeHandler +{ + @Override + public Class getGuiClass() + { + return EvaporatorGui.class; + } + + @Override + protected int[] getInputPosX() + { + return new int[]{39}; + } + + @Override + protected int[] getInputPosY() + { + return new int[]{3}; + } + + @Override + protected int[] getOutputPosX() + { + return new int[]{112}; + } + + @Override + protected int[] getOutputPosY() + { + return new int[]{21}; + } + + @Override + public String getRecipeId() + { + return "ihl.evaporator"; + } + + @Override + public String getGuiTexture() + { + return "ihl:textures/gui/GUISolidFuelEvaporator.png"; + } + + @Override + public String getOverlayIdentifier() + { + return "evaporator"; + } + + @Override + public void loadTransferRects() + { + this.transferRects.add(new RecipeTransferRect(new Rectangle(99-5,34-10, 17, 13), this.getRecipeId(), new Object[0])); + } + + @Override + public Map getRecipeList() + { + return EvaporatorTileEntity.getRecipes(); + } +} diff --git a/src/main/java/ihl/nei_integration/ExtruderRecipeHandler.java b/src/main/java/ihl/nei_integration/ExtruderRecipeHandler.java new file mode 100644 index 0000000..64dd072 --- /dev/null +++ b/src/main/java/ihl/nei_integration/ExtruderRecipeHandler.java @@ -0,0 +1,63 @@ +package ihl.nei_integration; + +import java.awt.Rectangle; +import java.util.Map; + +import ihl.processing.metallurgy.ExtruderGui; +import ihl.processing.metallurgy.ExtruderTileEntity; +import ihl.recipes.UniversalRecipeInput; +import ihl.recipes.UniversalRecipeOutput; +import net.minecraft.client.gui.inventory.GuiContainer; + +public class ExtruderRecipeHandler extends MachineRecipeHandler { + @Override + public Class getGuiClass() { + return ExtruderGui.class; + } + + @Override + protected int[] getInputPosX() { + return new int[] { 39 - 5, 57 - 5 }; + } + + @Override + protected int[] getInputPosY() { + return new int[] { 32 - 11 }; + } + + @Override + protected int[] getOutputPosX() { + return new int[] { 92 - 5 }; + } + + @Override + protected int[] getOutputPosY() { + return new int[] { 32 - 11 }; + } + + @Override + public String getRecipeId() { + return "ihl.extruder"; + } + + @Override + public String getGuiTexture() { + return "ihl:textures/gui/GUIExtruder.png"; + } + + @Override + public String getOverlayIdentifier() { + return "extruder"; + } + + @Override + public void loadTransferRects() { + this.transferRects + .add(new RecipeTransferRect(new Rectangle(74 - 5, 31 - 10, 18, 18), this.getRecipeId(), new Object[0])); + } + + @Override + public Map getRecipeList() { + return ExtruderTileEntity.getRecipes(); + } +} diff --git a/src/main/java/ihl/nei_integration/FluidizedBedReactorRecipeHandler.java b/src/main/java/ihl/nei_integration/FluidizedBedReactorRecipeHandler.java new file mode 100644 index 0000000..2f9c581 --- /dev/null +++ b/src/main/java/ihl/nei_integration/FluidizedBedReactorRecipeHandler.java @@ -0,0 +1,106 @@ +package ihl.nei_integration; + +import java.awt.Rectangle; +import java.util.Map; + +import codechicken.lib.gui.GuiDraw; +import ihl.processing.chemistry.FluidizedBedReactorGui; +import ihl.processing.chemistry.FluidizedBedReactorTileEntity; +import ihl.recipes.UniversalRecipeInput; +import ihl.recipes.UniversalRecipeOutput; +import net.minecraft.client.gui.inventory.GuiContainer; + + +public class FluidizedBedReactorRecipeHandler extends MachineRecipeHandler +{ + @Override + public Class getGuiClass() + { + return FluidizedBedReactorGui.class; + } + + @Override + protected int[] getInputPosX() + { + return new int[]{41-5}; + } + + @Override + protected int[] getInputPosY() + { + return new int[]{23-11,41-11}; + } + + @Override + protected int[] getFluidInputPosX() + { + return new int[]{102-5,84-5}; + } + + @Override + protected int[] getFluidInputPosY() + { + return new int[]{15-11}; + } + + @Override + protected int[] getOutputPosX() + { + return new int[]{76-5}; + } + + @Override + protected int[] getFluidOutputPosX() + { + return new int[]{102-5,84-5}; + } + + @Override + protected int[] getOutputPosY() + { + return new int[]{33-11}; + } + + @Override + protected int[] getFluidOutputPosY() + { + return new int[]{51-11,51-11}; + } + @Override + public void drawBackground(int i) + { + super.drawBackground(i); + GuiDraw.drawTexturedModalRect(83-5, 14-11, 101, 14, 18, 18); + GuiDraw.drawTexturedModalRect(83-5, 50-11, 101, 14, 18, 18); + } + + @Override + public String getRecipeId() + { + return "ihl.fluidizedBedReactor"; + } + + @Override + public String getGuiTexture() + { + return "ihl:textures/gui/GUIFluidizedBedReactor.png"; + } + + @Override + public void loadTransferRects() + { + this.transferRects.add(new RecipeTransferRect(new Rectangle(58-5,34-10, 17, 13), this.getRecipeId(), new Object[0])); + } + + @Override + public String getOverlayIdentifier() + { + return "fluidizedBedReactor"; + } + + @Override + public Map getRecipeList() + { + return FluidizedBedReactorTileEntity.getRecipes(); + } +} diff --git a/src/main/java/ihl/nei_integration/FractionationColumnRecipeHandler.java b/src/main/java/ihl/nei_integration/FractionationColumnRecipeHandler.java new file mode 100644 index 0000000..693dce2 --- /dev/null +++ b/src/main/java/ihl/nei_integration/FractionationColumnRecipeHandler.java @@ -0,0 +1,66 @@ +package ihl.nei_integration; + +import java.util.Map; + +import ihl.processing.chemistry.FractionatorBottomTileEntity; +import ihl.recipes.UniversalRecipeInput; +import ihl.recipes.UniversalRecipeOutput; +import net.minecraft.client.gui.inventory.GuiContainer; + + +public class FractionationColumnRecipeHandler extends MachineRecipeHandler +{ + @Override + public Class getGuiClass() + { + return null; + } + + @Override + protected int[] getInputPosX() + { + return new int[]{6-5,61-5,106-5}; + } + + @Override + protected int[] getInputPosY() + { + return new int[]{33-11}; + } + + @Override + protected int[] getOutputPosX() + { + return new int[]{76-5}; + } + + @Override + protected int[] getOutputPosY() + { + return new int[]{51-11,31-11}; + } + + @Override + public String getRecipeId() + { + return "ihl.fractionator"; + } + + @Override + public String getGuiTexture() + { + return "ihl:textures/gui/GUIFractionationColumn.png"; + } + + @Override + public String getOverlayIdentifier() + { + return "fractionator"; + } + + @Override + public Map getRecipeList() + { + return FractionatorBottomTileEntity.getRecipes(); + } +} diff --git a/src/main/java/ihl/nei_integration/GasWeldingStationGasRecipeHandler.java b/src/main/java/ihl/nei_integration/GasWeldingStationGasRecipeHandler.java new file mode 100644 index 0000000..eef6b75 --- /dev/null +++ b/src/main/java/ihl/nei_integration/GasWeldingStationGasRecipeHandler.java @@ -0,0 +1,74 @@ +package ihl.nei_integration; + +import java.awt.Rectangle; +import java.util.Map; + +import ihl.processing.metallurgy.GasWeldingStationGui; +import ihl.processing.metallurgy.GasWeldingStationTileEntity; +import ihl.recipes.UniversalRecipeInput; +import ihl.recipes.UniversalRecipeOutput; +import net.minecraft.client.gui.inventory.GuiContainer; + + +public class GasWeldingStationGasRecipeHandler extends MachineRecipeHandler +{ + @Override + public Class getGuiClass() + { + return GasWeldingStationGui.class; + } + + @Override + protected int[] getInputPosX() + { + return new int[]{44-5,62-5}; + } + + @Override + protected int[] getInputPosY() + { + return new int[]{15-11,51-11}; + } + + @Override + protected int[] getOutputPosX() + { + return new int[]{62-5}; + } + + @Override + protected int[] getOutputPosY() + { + return new int[]{15-11,33-11}; + } + + @Override + public void loadTransferRects() + { + this.transferRects.add(new RecipeTransferRect(new Rectangle(80-5, 15-11, 50, 50), this.getRecipeId(), new Object[0])); + } + + @Override + public String getRecipeId() + { + return "ihl.gasWeldingStationGas"; + } + + @Override + public String getGuiTexture() + { + return "ihl:textures/gui/GUIGasWeldingStation.png"; + } + + @Override + public String getOverlayIdentifier() + { + return "gasWeldingStationGas"; + } + + @Override + public Map getRecipeList() + { + return GasWeldingStationTileEntity.getGasRecipes(); + } +} diff --git a/src/main/java/ihl/nei_integration/IHLBlockHighlightHandler.java b/src/main/java/ihl/nei_integration/IHLBlockHighlightHandler.java new file mode 100644 index 0000000..1fc3666 --- /dev/null +++ b/src/main/java/ihl/nei_integration/IHLBlockHighlightHandler.java @@ -0,0 +1,46 @@ +package ihl.nei_integration; + +import java.util.List; + +import codechicken.nei.api.IHighlightHandler; +import codechicken.nei.api.ItemInfo; +import ihl.flexible_cable.RectifierTransformerUnitTileEntity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +public class IHLBlockHighlightHandler implements IHighlightHandler +{ + @Override + public List handleTextData(ItemStack stack, World world, EntityPlayer player, MovingObjectPosition movingObjectPosition, List currenttip, ItemInfo.Layout layout) + { + TileEntity tile = world.getTileEntity(movingObjectPosition.blockX, movingObjectPosition.blockY, movingObjectPosition.blockZ); + if(tile instanceof RectifierTransformerUnitTileEntity) + { + RectifierTransformerUnitTileEntity rtu = (RectifierTransformerUnitTileEntity)tile; + currenttip.add("Current mode: "+EnumChatFormatting.RED+getMode(rtu.mode)+"x V"); + currenttip.add("R.Click: "+EnumChatFormatting.RED+getMode(Math.min(rtu.mode*RectifierTransformerUnitTileEntity.modeMultiplier,RectifierTransformerUnitTileEntity.modeMax))+"x V"); + currenttip.add("IC2 Mode+R.Click: "+EnumChatFormatting.RED+getMode(Math.max(rtu.mode/RectifierTransformerUnitTileEntity.modeMultiplier,RectifierTransformerUnitTileEntity.modeMin))+"x V"); + } + return currenttip; + } + + private String getMode(float value) + { + if(value>=1f) + { + return Integer.toString(Math.round(value)); + } + else + { + return "1/"+Integer.toString(Math.round(1f/value)); + } + } + @Override + public ItemStack identifyHighlight(World world, EntityPlayer player, MovingObjectPosition mop) { + return null; + } +} diff --git a/src/main/java/ihl/nei_integration/IHLPositionedStack.java b/src/main/java/ihl/nei_integration/IHLPositionedStack.java new file mode 100644 index 0000000..d00083d --- /dev/null +++ b/src/main/java/ihl/nei_integration/IHLPositionedStack.java @@ -0,0 +1,45 @@ +package ihl.nei_integration; + +import java.util.Arrays; +import java.util.List; + +import codechicken.nei.PositionedStack; +import ic2.core.Ic2Items; +import ic2.core.item.ItemFluidCell; +import ihl.recipes.RecipeOutputItemStack; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + +public class IHLPositionedStack extends PositionedStack { + + public final float sQuantity; + public IHLPositionedStack(RecipeOutputItemStack object, int x, int y) + { + super(object.itemStack.copy(), x, y); + sQuantity=object.quantity; + } + + public IHLPositionedStack(FluidStack fluidStack, int x, int y) + { + super(Ic2Items.FluidCell.copy(), x, y); + ItemStack fluidCellStack = this.items[0]; + ((ItemFluidCell)fluidCellStack.getItem()).fill(fluidCellStack, fluidStack, true); + sQuantity=fluidStack.amount/1000f; + this.item=this.items[0]=fluidCellStack; + } + + + public IHLPositionedStack(List list, int x, int y) { + super(Ic2Items.FluidCell.copy(),x,y); + sQuantity = list.get(0).amount/1000f; + this.items = new ItemStack[list.size()]; + for(int i=0;i getRecipeList(); + + @Override + public void drawBackground(int i) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GuiDraw.changeTexture(this.getGuiTexture()); + GuiDraw.drawTexturedModalRect(0, 0, 5, 11, 140, 65); + } + + @Override + public void drawExtras(int i) + { + float f = this.ticks >= 20 ? (this.ticks - 20) % 20 / 20.0F : 0.0F; + this.drawProgressBar(74, 23, 176, 14, 25, 16, f, 0); + f = this.ticks <= 20 ? this.ticks / 20.0F : 1.0F; + this.drawProgressBar(51, 25, 176, 0, 14, 14, f, 3); + } + + @Override + public void onUpdate() + { + super.onUpdate(); + ++this.ticks; + } + + @Override + public void loadTransferRects() + { + this.transferRects.add(new RecipeTransferRect(new Rectangle(74, 23, 25, 16), this.getRecipeId(), new Object[0])); + } + + @Override + public void loadCraftingRecipes(String outputId, Object ... results) + { + if (outputId.equals(this.getRecipeId())) + { + Iterator> i$ = this.getRecipeList().entrySet().iterator(); + + while (i$.hasNext()) + { + Entry entry = i$.next(); + this.arecipes.add(new IHLRecipeHandler.CachedIORecipe((IRecipeInput)entry.getKey(), (RecipeOutput)entry.getValue())); + } + } + else + { + super.loadCraftingRecipes(outputId, results); + } + } + + @Override + public void loadCraftingRecipes(ItemStack result) + { + Iterator> i$ = this.getRecipeList().entrySet().iterator(); + + while (i$.hasNext()) + { + Entry entry = i$.next(); + Iterator i$1 = ((RecipeOutput)entry.getValue()).items.iterator(); + + while (i$1.hasNext()) + { + ItemStack output = i$1.next(); + + if (NEIServerUtils.areStacksSameTypeCrafting(output, result)) + { + this.arecipes.add(new IHLRecipeHandler.CachedIORecipe((IRecipeInput)entry.getKey(), (RecipeOutput)entry.getValue())); + break; + } + } + } + } + + @Override + public void loadUsageRecipes(ItemStack ingredient) + { + Iterator> i$ = this.getRecipeList().entrySet().iterator(); + + while (i$.hasNext()) + { + Entry entry = i$.next(); + + if (((IRecipeInput)entry.getKey()).matches(ingredient)) + { + this.arecipes.add(new IHLRecipeHandler.CachedIORecipe((IRecipeInput)entry.getKey(), (RecipeOutput)entry.getValue())); + } + } + } + + protected int getInputPosX() + { + return 51; + } + + protected int getInputPosY() + { + return 6; + } + + protected int getOutputPosX() + { + return 111; + } + + protected int getOutputPosY() + { + return 24; + } + + protected boolean isOutputsVertical() + { + return true; + } + + public class CachedIORecipe extends CachedRecipe + { + private final List ingredients = new ArrayList(); + private final PositionedStack output; + private final List otherStacks = new ArrayList(); + + @Override + public List getIngredients() + { + return this.getCycledIngredients(IHLRecipeHandler.this.cycleticks / 20, this.ingredients); + } + + @Override + public PositionedStack getResult() + { + return this.output; + } + + @Override + public List getOtherStacks() + { + return this.otherStacks; + } + + public CachedIORecipe(ItemStack input, ItemStack output1) + { + super(); + + if (input == null) + { + throw new NullPointerException("Input must not be null (recipe " + input + " -> " + output1 + ")."); + } + else if (output1 == null) + { + throw new NullPointerException("Output must not be null (recipe " + input + " -> " + output1 + ")."); + } + else + { + this.ingredients.add(new PositionedStack(input, IHLRecipeHandler.this.getInputPosX(), IHLRecipeHandler.this.getInputPosY())); + this.output = new PositionedStack(output1, IHLRecipeHandler.this.getOutputPosX(), IHLRecipeHandler.this.getOutputPosY()); + } + } + + public CachedIORecipe(IRecipeInput input, RecipeOutput output1) + { + super(); + + if (input == null) + { + throw new NullPointerException("Input must not be null (recipe " + input + " -> " + output1 + ")."); + } + else if (output1 == null) + { + throw new NullPointerException("Output must not be null (recipe " + input + " -> " + output1 + ")."); + } + else if (output1.items.isEmpty()) + { + throw new IllegalArgumentException("Output must not be empty (recipe " + input + " -> " + output1 + ")."); + } + else if (output1.items.contains((Object)null)) + { + throw new IllegalArgumentException("Output must not contain null (recipe " + input + " -> " + output1 + ")."); + } + else + { + ArrayList items = new ArrayList(); + Iterator i = input.getInputs().iterator(); + + while (i.hasNext()) + { + ItemStack item = i.next(); + items.add(StackUtil.copyWithSize(item, input.getAmount())); + } + + this.ingredients.add(new PositionedStack(items, IHLRecipeHandler.this.getInputPosX(), IHLRecipeHandler.this.getInputPosY())); + this.output = new PositionedStack(output1.items.get(0), IHLRecipeHandler.this.getOutputPosX(), IHLRecipeHandler.this.getOutputPosY()); + + for (int var7 = 1; var7 < output1.items.size(); ++var7) + { + if (IHLRecipeHandler.this.isOutputsVertical()) + { + this.otherStacks.add(new PositionedStack(output1.items.get(var7), IHLRecipeHandler.this.getOutputPosX(), IHLRecipeHandler.this.getOutputPosY() + var7 * 18)); + } + else + { + this.otherStacks.add(new PositionedStack(output1.items.get(var7), IHLRecipeHandler.this.getOutputPosX() + var7 * 18, IHLRecipeHandler.this.getOutputPosY())); + } + } + } + } + } +} diff --git a/src/main/java/ihl/nei_integration/ImpregnatingMachineRecipeHandler.java b/src/main/java/ihl/nei_integration/ImpregnatingMachineRecipeHandler.java new file mode 100644 index 0000000..9abad4b --- /dev/null +++ b/src/main/java/ihl/nei_integration/ImpregnatingMachineRecipeHandler.java @@ -0,0 +1,106 @@ +package ihl.nei_integration; + +import java.awt.Rectangle; +import java.util.Map; + +import codechicken.lib.gui.GuiDraw; +import ihl.processing.metallurgy.ImpregnatingMachineGui; +import ihl.processing.metallurgy.ImpregnatingMachineTileEntity; +import ihl.recipes.UniversalRecipeInput; +import ihl.recipes.UniversalRecipeOutput; +import net.minecraft.client.gui.inventory.GuiContainer; + + +public class ImpregnatingMachineRecipeHandler extends MachineRecipeHandler +{ + @Override + public Class getGuiClass() + { + return ImpregnatingMachineGui.class; + } + + @Override + protected int[] getInputPosX() + { + return new int[]{116-5}; + } + + @Override + protected int[] getInputPosY() + { + return new int[]{16-11}; + } + + @Override + protected int[] getFluidInputPosX() + { + return new int[]{24-5,6-5}; + } + + @Override + protected int[] getFluidInputPosY() + { + return new int[]{16-11}; + } + + @Override + protected int[] getOutputPosX() + { + return new int[]{116-5}; + } + + @Override + protected int[] getOutputPosY() + { + return new int[]{41-11,59-11}; + } + + @Override + protected int[] getFluidOutputPosX() + { + return new int[]{24-5}; + } + + @Override + protected int[] getFluidOutputPosY() + { + return new int[]{52-11}; + } + + @Override + public String getRecipeId() + { + return "ihl.impregnatingMachine"; + } + + @Override + public String getGuiTexture() + { + return "ihl:textures/gui/GUITubBronze.png"; + } + + @Override + public String getOverlayIdentifier() + { + return "impregnatingMachine"; + } + + @Override + public void loadTransferRects() + { + this.transferRects.add(new RecipeTransferRect(new Rectangle(134-5, 0, 35, 65), this.getRecipeId(), new Object[0])); + } + + @Override + public void drawBackground(int i) + { + super.drawBackground(i); + GuiDraw.drawTexturedModalRect(5-5, 15-11, 23, 15, 18, 18); + } + + @Override + public Map getRecipeList() + { + return ImpregnatingMachineTileEntity.getRecipes(); + } +} diff --git a/src/main/java/ihl/nei_integration/InjectionMoldRecipeHandler.java b/src/main/java/ihl/nei_integration/InjectionMoldRecipeHandler.java new file mode 100644 index 0000000..e125b54 --- /dev/null +++ b/src/main/java/ihl/nei_integration/InjectionMoldRecipeHandler.java @@ -0,0 +1,64 @@ +package ihl.nei_integration; + +import java.awt.Rectangle; +import java.util.Map; + +import ihl.processing.metallurgy.InjectionMoldTileEntity; +import ihl.recipes.UniversalRecipeInput; +import ihl.recipes.UniversalRecipeOutput; +import net.minecraft.client.gui.inventory.GuiContainer; + +public class InjectionMoldRecipeHandler extends MachineRecipeHandler { + @Override + public Class getGuiClass() { + return null; + } + + @Override + protected int[] getInputPosX() { + return new int[] { 65 - 5 }; + } + + @Override + protected int[] getInputPosY() { + return new int[] { 15 - 11, 51 - 11 }; + } + + @Override + protected int[] getOutputPosX() { + return new int[] { 101 - 5 }; + } + + @Override + protected int[] getOutputPosY() { + return new int[] { 51 - 11 }; + } + + @Override + public String getRecipeId() { + return "ihl.casting"; + } + + @Override + public String getGuiTexture() { + return "ihl:textures/gui/GUICastingNEI.png"; + } + + @Override + public String getOverlayIdentifier() { + return "casting"; + } + + @Override + public void loadTransferRects() { + this.transferRects + .add(new RecipeTransferRect(new Rectangle(64 - 5, 32 - 10, 18, 18), this.getRecipeId(), new Object[0])); + this.transferRects + .add(new RecipeTransferRect(new Rectangle(82 - 5, 50 - 10, 18, 18), this.getRecipeId(), new Object[0])); + } + + @Override + public Map getRecipeList() { + return InjectionMoldTileEntity.getRecipes(); + } +} diff --git a/src/main/java/ihl/nei_integration/IronWorkbenchRecipeHandler.java b/src/main/java/ihl/nei_integration/IronWorkbenchRecipeHandler.java new file mode 100644 index 0000000..c060bb7 --- /dev/null +++ b/src/main/java/ihl/nei_integration/IronWorkbenchRecipeHandler.java @@ -0,0 +1,283 @@ +package ihl.nei_integration; + +import java.awt.Rectangle; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import org.lwjgl.opengl.GL11; + +import codechicken.lib.gui.GuiDraw; +import codechicken.nei.NEIServerUtils; +import codechicken.nei.PositionedStack; +import codechicken.nei.recipe.TemplateRecipeHandler; +import ic2.api.recipe.IRecipeInput; +import ihl.flexible_cable.IronWorkbenchGui; +import ihl.flexible_cable.IronWorkbenchTileEntity; +import ihl.interfaces.IWire; +import ihl.recipes.IronWorkbenchRecipe; +import ihl.utils.IHLUtils; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.StatCollector; + +public class IronWorkbenchRecipeHandler extends TemplateRecipeHandler +{ + private static final int workspaceItemsPosX=8-7; + private static final int workspaceItemsPosY=8-7; + private static final int toolsPosX=26-7; + private static final int toolsPosY=8-7; + private static final int materialsPosX=65-7; + private static final int materialsPosY=8-7; + private static final int outputPosX=116-7; + private static final int outputPosY=8-7; + + @Override + public Class getGuiClass() + { + return IronWorkbenchGui.class; + } + + @Override + public String getRecipeName() + { + return StatCollector.translateToLocal(getRecipeId()); + } + + @Override + public int recipiesPerPage() + { + return 1; + } + + public String getRecipeId() + { + return "ihl.ironWorkbench"; + } + + @Override + public String getGuiTexture() + { + return "ihl:textures/gui/GUIIronWorkbench.png"; + } + + @Override + public String getOverlayIdentifier() + { + return "ironWorkbench"; + } + + public List getRecipeList() + { + return IronWorkbenchTileEntity.recipes; + } + + + @Override + public void drawBackground(int recipeNumber) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GuiDraw.changeTexture(this.getGuiTexture()); + GuiDraw.drawTexturedModalRect(0, 0, 7, 7, 162, 108); + } + + @Override + public void loadTransferRects() + { + this.transferRects.add(new RecipeTransferRect(new Rectangle(104-10, 9-10, 15, 108), this.getRecipeId(), new Object[0])); + } + + @Override + public void loadCraftingRecipes(String outputId, Object ... results) + { + if (outputId.equals(this.getRecipeId())) + { + Iterator i$ = this.getRecipeList().iterator(); + + while (i$.hasNext()) + { + IronWorkbenchRecipe entry = i$.next(); + this.arecipes.add(new IronWorkbenchRecipeHandler.CachedIORecipe(entry)); + } + } + else + { + super.loadCraftingRecipes(outputId, results); + } + } + + @Override + public void loadCraftingRecipes(ItemStack result) + { + Iterator i$ = this.getRecipeList().iterator(); + + while (i$.hasNext()) + { + IronWorkbenchRecipe entry = i$.next(); + Iterator i$1 = entry.outputs.iterator(); + while (i$1.hasNext()) + { + ItemStack output = i$1.next(); + if (NEIServerUtils.areStacksSameTypeCrafting(output, result)) + { + this.arecipes.add(new IronWorkbenchRecipeHandler.CachedIORecipe(entry)); + break; + } + } + } + } + + @Override + public void loadUsageRecipes(ItemStack ingredient) + { + Iterator i$ = this.getRecipeList().iterator(); + while (i$.hasNext()) + { + IronWorkbenchRecipe entry = i$.next(); + if(entry.workspaceElements!=null && !entry.workspaceElements.isEmpty()) + { + Iterator i$1 = entry.workspaceElements.iterator(); + while (i$1.hasNext()) + { + ItemStack output = (ItemStack)i$1.next(); + if (NEIServerUtils.areStacksSameTypeCrafting(output, ingredient) || IHLUtils.isItemsHaveSameOreDictionaryEntry(output, ingredient) || output.getItem()==ingredient.getItem()) + { + this.arecipes.add(new IronWorkbenchRecipeHandler.CachedIORecipe(entry)); + break; + } + } + } + + if(entry.tools!=null && !entry.tools.isEmpty()) + { + Iterator i$1 = entry.tools.iterator(); + while (i$1.hasNext()) + { + IRecipeInput output = i$1.next(); + if (output.matches(ingredient)) + { + this.arecipes.add(new IronWorkbenchRecipeHandler.CachedIORecipe(entry)); + break; + } + } + } + if(entry.materials!=null && !entry.materials.isEmpty()) + { + Iterator i$2 = entry.materials.iterator(); + while (i$2.hasNext()) + { + IRecipeInput output = i$2.next(); + if (output.matches(ingredient)) + { + this.arecipes.add(new IronWorkbenchRecipeHandler.CachedIORecipe(entry)); + break; + } + } + } + } + } + + public class CachedIORecipe extends CachedRecipe + { + private final List ingredients = new ArrayList(); + private final PositionedStack output; + private final List otherStacks = new ArrayList(); + + @Override + public List getIngredients() + { + return this.getCycledIngredients(IronWorkbenchRecipeHandler.this.cycleticks / 20, this.ingredients); + } + + @Override + public PositionedStack getResult() + { + return this.output; + } + + @Override + public List getOtherStacks() + { + return this.otherStacks; + } + + public CachedIORecipe(IronWorkbenchRecipe recipe) + { + super(); + if (recipe == null) + { + throw new NullPointerException("Recipe must not be null."); + } + else + { + this.ingredients.add(new PositionedStack(IHLUtils.getThisModItemStack("ironWorkbench"), workspaceItemsPosX, workspaceItemsPosY)); + if(recipe.workspaceElements!=null && !recipe.workspaceElements.isEmpty()) + { + Iterator i = recipe.workspaceElements.iterator(); + int index = 1; + while (i.hasNext()) + { + int x = workspaceItemsPosX; + int y = workspaceItemsPosY + index * 18; + 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(); + int index = 0; + while (i.hasNext()) + { + int x = toolsPosX + (index % 2) * 18; + int y = toolsPosY + index / 2 * 18; + IRecipeInput rInput = i.next(); + this.ingredients.add(new PositionedStack(rInput.getInputs(), x, y)); + index++; + } + } + + if(recipe.materials!=null && !recipe.materials.isEmpty()) + { + Iterator i = recipe.materials.iterator(); + int index = 0; + while (i.hasNext()) + { + int x = materialsPosX + (index % 2) * 18; + int y = materialsPosY + index / 2 * 18; + IRecipeInput rInput = (IRecipeInput)i.next(); + Iterator rInputsi = rInput.getInputs().iterator(); + List itemInputs = new ArrayList(); + while(rInputsi.hasNext()) + { + ItemStack stack = rInputsi.next().copy(); + if(!(stack.getItem() instanceof IWire)) + { + stack.stackSize=rInput.getAmount(); + } + itemInputs.add(stack); + } + this.ingredients.add(new PositionedStack(itemInputs, x, y)); + index++; + } + } + this.output=new PositionedStack(recipe.outputs.get(0), outputPosX, outputPosY); + 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 = i.next(); + if(index>0) + { + this.otherStacks.add(new PositionedStack(stack, x, y)); + } + index++; + } + } + } + + } +} diff --git a/src/main/java/ihl/nei_integration/LabElectrolyzerRecipeHandler.java b/src/main/java/ihl/nei_integration/LabElectrolyzerRecipeHandler.java new file mode 100644 index 0000000..a9df742 --- /dev/null +++ b/src/main/java/ihl/nei_integration/LabElectrolyzerRecipeHandler.java @@ -0,0 +1,77 @@ +package ihl.nei_integration; + +import java.awt.Rectangle; +import java.util.Map; + +import org.lwjgl.opengl.GL11; + +import codechicken.lib.gui.GuiDraw; +import ihl.processing.chemistry.LabElectrolyzerGui; +import ihl.processing.chemistry.LabElectrolyzerTileEntity; +import ihl.recipes.UniversalRecipeInput; +import ihl.recipes.UniversalRecipeOutput; +import net.minecraft.client.gui.inventory.GuiContainer; + +public class LabElectrolyzerRecipeHandler extends MachineRecipeHandler { + @Override + public Class getGuiClass() { + return LabElectrolyzerGui.class; + } + + @Override + protected int[] getInputPosX() { + return new int[] { 63 - 5, 46 - 5, 29 - 5 }; + } + + @Override + protected int[] getInputPosY() { + return new int[] { 11 - 10 }; + } + + @Override + protected int[] getOutputPosX() { + return new int[] { 29 - 5, 63 - 5, 109 - 5 }; + } + + @Override + protected int[] getOutputPosY() { + return new int[] { 47 - 10 }; + } + + @Override + public String getRecipeId() { + return "ihl.labElectrolyzer"; + } + + @Override + public String getGuiTexture() { + return "ihl:textures/gui/GUILabElectrolyzer.png"; + } + + @Override + public void loadTransferRects() { + this.transferRects + .add(new RecipeTransferRect(new Rectangle(28 - 5, 28 - 10, 18, 18), this.getRecipeId(), new Object[0])); + this.transferRects + .add(new RecipeTransferRect(new Rectangle(108 - 5, 32 - 10, 18, 18), this.getRecipeId(), new Object[0])); + } + + @Override + public String getOverlayIdentifier() { + return "labElectrolyzer"; + } + + @Override + public void drawBackground(int recipeNumber) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GuiDraw.changeTexture(this.getGuiTexture()); + GuiDraw.drawTexturedModalRect(0, 0, 5, 10, 140, 54); + GuiDraw.drawTexturedModalRect(46-5, 10-10, 62, 10, 18, 18); + } + + @Override + public Map getRecipeList() { + return LabElectrolyzerTileEntity.getRecipes(); + } +} diff --git a/src/main/java/ihl/nei_integration/LeadOvenRecipeHandler.java b/src/main/java/ihl/nei_integration/LeadOvenRecipeHandler.java new file mode 100644 index 0000000..8a7f686 --- /dev/null +++ b/src/main/java/ihl/nei_integration/LeadOvenRecipeHandler.java @@ -0,0 +1,83 @@ +package ihl.nei_integration; + +import java.awt.Rectangle; +import java.util.Map; + +import ihl.processing.chemistry.LeadOvenGui; +import ihl.processing.chemistry.LeadOvenTileEntity; +import ihl.recipes.UniversalRecipeInput; +import ihl.recipes.UniversalRecipeOutput; +import net.minecraft.client.gui.inventory.GuiContainer; + +public class LeadOvenRecipeHandler extends MachineRecipeHandler { + @Override + public Class getGuiClass() { + return LeadOvenGui.class; + } + + @Override + protected int[] getInputPosX() { + return new int[] { 47 - 5, 65 - 5 }; + } + + @Override + protected int[] getInputPosY() { + return new int[] { 17 - 11 }; + } + + @Override + protected int[] getOutputPosX() { + return new int[] { 112 - 5 }; + } + + @Override + protected int[] getOutputPosY() { + return new int[] { 35 - 11 }; + } + + @Override + protected int[] getFluidOutputPosX() { + return new int[] { 9 - 5 }; + } + + @Override + protected int[] getFluidOutputPosY() { + return new int[] { 53 - 11 }; + } + + @Override + protected int[] getFluidInputPosX() { + return new int[] { 9 - 5 }; + } + + @Override + protected int[] getFluidInputPosY() { + return new int[] { 17 - 11 }; + } + + @Override + public String getRecipeId() { + return "ihl.leadOven"; + } + + @Override + public String getGuiTexture() { + return "ihl:textures/gui/GUILeadOven.png"; + } + + @Override + public String getOverlayIdentifier() { + return "leadOven"; + } + + @Override + public void loadTransferRects() { + this.transferRects.add( + new RecipeTransferRect(new Rectangle(80 - 10, 35 - 10, 22, 15), this.getRecipeId(), new Object[0])); + } + + @Override + public Map getRecipeList() { + return LeadOvenTileEntity.getRecipes(); + } +} diff --git a/src/main/java/ihl/nei_integration/LoomRecipeHandler.java b/src/main/java/ihl/nei_integration/LoomRecipeHandler.java new file mode 100644 index 0000000..d34f505 --- /dev/null +++ b/src/main/java/ihl/nei_integration/LoomRecipeHandler.java @@ -0,0 +1,74 @@ +package ihl.nei_integration; + +import java.awt.Rectangle; +import java.util.Map; + +import ihl.processing.chemistry.LoomGui; +import ihl.processing.chemistry.LoomTileEntity; +import ihl.recipes.UniversalRecipeInput; +import ihl.recipes.UniversalRecipeOutput; +import net.minecraft.client.gui.inventory.GuiContainer; + + +public class LoomRecipeHandler extends MachineRecipeHandler +{ + @Override + public Class getGuiClass() + { + return LoomGui.class; + } + + @Override + protected int[] getInputPosX() + { + return new int[]{8-5}; + } + + @Override + protected int[] getInputPosY() + { + return new int[]{44-11}; + } + + @Override + protected int[] getOutputPosX() + { + return new int[]{127-5}; + } + + @Override + public void loadTransferRects() + { + this.transferRects.add(new RecipeTransferRect(new Rectangle(35-10, 0, 90, 60), this.getRecipeId(), new Object[0])); + } + + @Override + protected int[] getOutputPosY() + { + return new int[]{44-11}; + } + + @Override + public String getRecipeId() + { + return "ihl.loom"; + } + + @Override + public String getGuiTexture() + { + return "ihl:textures/gui/GUILoom.png"; + } + + @Override + public String getOverlayIdentifier() + { + return "loom"; + } + + @Override + public Map getRecipeList() + { + return LoomTileEntity.getRecipes(); + } +} diff --git a/src/main/java/ihl/nei_integration/MachineRecipeHandler.java b/src/main/java/ihl/nei_integration/MachineRecipeHandler.java new file mode 100644 index 0000000..eba0855 --- /dev/null +++ b/src/main/java/ihl/nei_integration/MachineRecipeHandler.java @@ -0,0 +1,413 @@ +package ihl.nei_integration; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; + +import org.lwjgl.opengl.GL11; + +import codechicken.lib.gui.GuiDraw; +import codechicken.nei.NEIServerUtils; +import codechicken.nei.PositionedStack; +import codechicken.nei.recipe.TemplateRecipeHandler; +import ic2.api.recipe.IRecipeInput; +import ihl.interfaces.IWire; +import ihl.recipes.IRecipeInputFluid; +import ihl.recipes.RecipeOutputItemStack; +import ihl.recipes.UniversalRecipeInput; +import ihl.recipes.UniversalRecipeOutput; +import ihl.utils.IHLUtils; +import net.minecraft.block.Block; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.util.StatCollector; +import net.minecraftforge.fluids.BlockFluidBase; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.IFluidContainerItem; + +public abstract class MachineRecipeHandler extends TemplateRecipeHandler { + protected int ticks; + + @Override + public String getRecipeName() { + return StatCollector.translateToLocal(getRecipeId()); + } + + public abstract String getRecipeId(); + + @Override + public abstract String getGuiTexture(); + + @Override + public abstract String getOverlayIdentifier(); + + public abstract Map getRecipeList(); + + @Override + public void drawBackground(int i) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GuiDraw.changeTexture(this.getGuiTexture()); + GuiDraw.drawTexturedModalRect(0, 0, 5, 11, 140, 65); + } + + @Override + public void drawExtras(int recipeNumber) { + 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 (stack instanceof IHLPositionedStack) + drawFormattedString((IHLPositionedStack) stack); + + } + for (PositionedStack stack : recipe.otherStacks) { + if (stack instanceof IHLPositionedStack) + drawFormattedString((IHLPositionedStack) stack); + } + if (recipe.output instanceof IHLPositionedStack) { + IHLPositionedStack rOutput = (IHLPositionedStack) recipe.output; + drawFormattedString(rOutput); + } + GuiDraw.changeTexture(this.getGuiTexture()); + } + + public void drawFormattedString(IHLPositionedStack rOutput) { + if (Math.abs(rOutput.sQuantity - Math.round(rOutput.sQuantity)) < 0.01f) { + if (Math.round(rOutput.sQuantity) != 1) { + GuiDraw.fontRenderer.drawStringWithShadow(String.format("%d", Math.round(rOutput.sQuantity)), + rOutput.relx + 11, rOutput.rely + 9, 16777215); + } + } else { + GuiDraw.fontRenderer.drawStringWithShadow(String.format("%.1f", rOutput.sQuantity), rOutput.relx + 3, + rOutput.rely + 9, 16777215); + } + } + + @Override + public void onUpdate() { + super.onUpdate(); + ++this.ticks; + } + + @Override + public void loadTransferRects() { + // this.transferRects.add(new RecipeTransferRect(new Rectangle(74, 23, + // 25, 16), this.getRecipeId(), new Object[0])); + } + + @Override + public void loadCraftingRecipes(String outputId, Object... results) { + if (outputId.equals(this.getRecipeId())) { + Iterator> i$ = this.getRecipeList().entrySet() + .iterator(); + + while (i$.hasNext()) { + Entry entry = i$.next(); + this.arecipes.add(new MachineRecipeHandler.CachedIORecipe(entry.getKey(), entry.getValue(), + getAdditionalIngredients())); + } + } else { + super.loadCraftingRecipes(outputId, results); + } + } + + @Override + public void loadCraftingRecipes(ItemStack result) { + Iterator> i$ = this.getRecipeList().entrySet().iterator(); + FluidStack fluidStack = FluidContainerRegistry.getFluidForFilledItem(result); + if (fluidStack == null && result.getItem() instanceof IFluidContainerItem) { + IFluidContainerItem ifc = (IFluidContainerItem) result.getItem(); + fluidStack = ifc.getFluid(result); + } else if (result.getItem() instanceof ItemBlock) { + Block blockfluid = ((ItemBlock) result.getItem()).field_150939_a; + if (blockfluid instanceof BlockFluidBase) { + Fluid fluid = ((BlockFluidBase) blockfluid).getFluid(); + if (fluid != null) { + fluidStack = new FluidStack(fluid, 1000); + } + } + } + if (fluidStack != null) { + while (i$.hasNext()) { + Entry entry = i$.next(); + Iterator i$1 = ((UniversalRecipeOutput) entry.getValue()).getFluidOutputs().iterator(); + while (i$1.hasNext()) { + 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())); + break; + } + } + } + } else { + while (i$.hasNext()) { + Entry entry = i$.next(); + Iterator i$1 = (entry.getValue()).getItemOutputs().iterator(); + + while (i$1.hasNext()) { + RecipeOutputItemStack output = i$1.next(); + + if (NEIServerUtils.areStacksSameTypeCrafting(output.itemStack, result) + || IHLUtils.isItemsHaveSameOreDictionaryEntry(output.itemStack, result)) { + this.arecipes.add(new MachineRecipeHandler.CachedIORecipe(entry.getKey(), entry.getValue(), + getAdditionalIngredients())); + break; + } + } + } + } + } + + public List getAdditionalIngredients() { + return null; + } + + @Override + public void loadUsageRecipes(ItemStack ingredient) { + Iterator> i$ = this.getRecipeList().entrySet().iterator(); + FluidStack fluidStack = FluidContainerRegistry.getFluidForFilledItem(ingredient); + if (fluidStack == null && ingredient.getItem() instanceof IFluidContainerItem) { + IFluidContainerItem ifc = (IFluidContainerItem) ingredient.getItem(); + fluidStack = ifc.getFluid(ingredient); + } else if (ingredient.getItem() instanceof ItemBlock) { + Block blockfluid = ((ItemBlock) ingredient.getItem()).field_150939_a; + if (blockfluid instanceof BlockFluidBase) { + Fluid fluid = ((BlockFluidBase) blockfluid).getFluid(); + if (fluid != null) { + fluidStack = new FluidStack(fluid, 1000); + } + } + } + + if (fluidStack != null && fluidStack.getFluid() != null) { + while (i$.hasNext()) { + Entry entry = i$.next(); + if (((UniversalRecipeInput) entry.getKey()).containFluidStack(fluidStack)) { + this.arecipes.add(new MachineRecipeHandler.CachedIORecipe(entry.getKey(), entry.getValue(), + getAdditionalIngredients())); + } + } + } else { + while (i$.hasNext()) { + Entry entry = i$.next(); + if (((UniversalRecipeInput) entry.getKey()).containItemStack(ingredient)) { + this.arecipes.add(new MachineRecipeHandler.CachedIORecipe(entry.getKey(), entry.getValue(), + getAdditionalIngredients())); + } + } + } + } + + protected int[] getFluidInputPosX() { + return null; + } + + protected int[] getFluidInputPosY() { + return null; + } + + protected int[] getFluidOutputPosX() { + return null; + } + + protected int[] getFluidOutputPosY() { + return null; + } + + protected abstract int[] getInputPosX(); + + protected abstract int[] getInputPosY(); + + protected abstract int[] getOutputPosX(); + + protected abstract int[] getOutputPosY(); + + public class CachedIORecipe extends CachedRecipe { + private final List ingredients = new ArrayList(); + public PositionedStack output; + public final List otherStacks = new ArrayList(); + public boolean specialConditions = false; + public UniversalRecipeInput urInput; + public UniversalRecipeOutput urOutput; + + @Override + public List getIngredients() { + return this.getCycledIngredients(MachineRecipeHandler.this.cycleticks / 20, this.ingredients); + } + + @Override + public PositionedStack getResult() { + return this.output; + } + + @Override + public List getOtherStacks() { + return this.otherStacks; + } + + public CachedIORecipe(UniversalRecipeInput input, UniversalRecipeOutput output1, + List additionalIngredients) { + super(); + if (input == null) { + throw new NullPointerException("Input must not be null (recipe " + input + " -> " + output1 + ")."); + } else if (output1 == null) { + throw new NullPointerException("Output must not be null (recipe " + input + " -> " + output1 + ")."); + } else if ((output1.getFluidOutputs() == null || output1.getFluidOutputs().isEmpty()) + && (output1.getItemOutputs() == null || output1.getItemOutputs().isEmpty())) { + throw new NullPointerException("Output must not be null (recipe " + input + " -> " + output1 + ")."); + } else { + this.urInput = input; + this.urOutput = output1; + specialConditions = output1.specialConditions; + ArrayList> items = new ArrayList>(); + ArrayList> fluidItems = new ArrayList>(); + if (input.getFluidInputs() != null && !input.getFluidInputs().isEmpty()) { + Iterator i = input.getFluidInputs().iterator(); + while (i.hasNext()) { + IRecipeInputFluid fstackRI = (IRecipeInputFluid) i.next(); + List fstackList = fstackRI.getInputs(); + fluidItems.add(fstackList); + } + } + + if (input.getItemInputs() != null && !input.getItemInputs().isEmpty()) { + Iterator i = input.getItemInputs().iterator(); + while (i.hasNext()) { + IRecipeInput rInput = (IRecipeInput) i.next(); + Iterator rInputsi = rInput.getInputs().iterator(); + List itemInputs = new ArrayList(); + while (rInputsi.hasNext()) { + ItemStack stack = rInputsi.next().copy(); + if (!(stack.getItem() instanceof IWire)) { + stack.stackSize = rInput.getAmount(); + } + itemInputs.add(stack); + } + items.add(itemInputs); + } + } + + int var7 = 0; + int var8 = 0; + boolean skipOneFluidOutput = false; + if (output1.getItemOutputs() != null && !output1.getItemOutputs().isEmpty()) { + int x = MachineRecipeHandler.this.getOutputPosX()[0], + y = MachineRecipeHandler.this.getOutputPosY()[0]; + if (output1.getItemOutputs().get(0) != null) + this.output = new IHLPositionedStack(output1.getItemOutputs().get(0), x, y); + Iterator i = output1.getItemOutputs().iterator(); + i.next(); + while (i.hasNext()) { + RecipeOutputItemStack rOut = i.next(); + var7++; + if (var7 < MachineRecipeHandler.this.getOutputPosX().length) { + x = MachineRecipeHandler.this.getOutputPosX()[var7]; + } + if (var7 < MachineRecipeHandler.this.getOutputPosY().length) { + y = MachineRecipeHandler.this.getOutputPosY()[var7]; + } + if (rOut != null) { + this.otherStacks.add(new IHLPositionedStack(rOut, x, y)); + } + } + } else { + if (MachineRecipeHandler.this.getFluidOutputPosX() != null) { + this.output = new IHLPositionedStack(output1.getFluidOutputs().get(0), + MachineRecipeHandler.this.getFluidOutputPosX()[0], + MachineRecipeHandler.this.getFluidOutputPosY()[0]); + } else { + this.output = new IHLPositionedStack(output1.getFluidOutputs().get(0), MachineRecipeHandler.this.getOutputPosX()[0], + MachineRecipeHandler.this.getOutputPosY()[0]); + } + skipOneFluidOutput = true; + var8++; + } + + if (output1.getFluidOutputs() != null && !output1.getFluidOutputs().isEmpty()) { + int x = MachineRecipeHandler.this.getOutputPosX()[0], + y = MachineRecipeHandler.this.getOutputPosY()[0]; + if (MachineRecipeHandler.this.getFluidOutputPosX() != null) { + x = MachineRecipeHandler.this.getFluidOutputPosX()[0]; + y = MachineRecipeHandler.this.getFluidOutputPosY()[0]; + } + Iterator i = output1.getFluidOutputs().iterator(); + if (skipOneFluidOutput) { + i.next(); + } + while (i.hasNext()) { + FluidStack fstack = (FluidStack) i.next(); + var7++; + if (MachineRecipeHandler.this.getFluidOutputPosX() != null) { + if (var8 < MachineRecipeHandler.this.getFluidOutputPosX().length) { + x = MachineRecipeHandler.this.getFluidOutputPosX()[var8]; + } + if (var8 < MachineRecipeHandler.this.getFluidOutputPosY().length) { + y = MachineRecipeHandler.this.getFluidOutputPosY()[var8]; + } + var8++; + } else { + if (var7 < MachineRecipeHandler.this.getOutputPosX().length) { + x = MachineRecipeHandler.this.getOutputPosX()[var7]; + } + if (var7 < MachineRecipeHandler.this.getOutputPosY().length) { + y = MachineRecipeHandler.this.getOutputPosY()[var7]; + } + } + this.otherStacks.add(new IHLPositionedStack(fstack, x, y)); + } + } + + if (MachineRecipeHandler.this.getFluidInputPosX() != null) { + int x = MachineRecipeHandler.this.getFluidInputPosX()[0], + y = MachineRecipeHandler.this.getFluidInputPosY()[0]; + for (int i = 0; i < fluidItems.size(); i++) { + if (i < MachineRecipeHandler.this.getFluidInputPosX().length) { + x = MachineRecipeHandler.this.getFluidInputPosX()[i]; + } + if (i < MachineRecipeHandler.this.getFluidInputPosY().length) { + y = MachineRecipeHandler.this.getFluidInputPosY()[i]; + } + this.ingredients.add(new IHLPositionedStack(fluidItems.get(i), x, y)); + } + x = MachineRecipeHandler.this.getInputPosX()[0]; + y = MachineRecipeHandler.this.getInputPosY()[0]; + for (int i = 0; i < items.size(); i++) { + if (i < MachineRecipeHandler.this.getInputPosX().length) { + x = MachineRecipeHandler.this.getInputPosX()[i]; + } + if (i < MachineRecipeHandler.this.getInputPosY().length) { + y = MachineRecipeHandler.this.getInputPosY()[i]; + } + this.ingredients.add(new PositionedStack(items.get(i), x, y)); + } + } else { + int x = MachineRecipeHandler.this.getInputPosX()[0], + y = MachineRecipeHandler.this.getInputPosY()[0]; + for (int i = 0; i < fluidItems.size() + items.size(); i++) { + if (i < MachineRecipeHandler.this.getInputPosX().length) { + x = MachineRecipeHandler.this.getInputPosX()[i]; + } + if (i < MachineRecipeHandler.this.getInputPosY().length) { + y = MachineRecipeHandler.this.getInputPosY()[i]; + } + if (i < fluidItems.size()) { + this.ingredients.add(new IHLPositionedStack(fluidItems.get(i), x, y)); + } else { + this.ingredients.add(new PositionedStack(items.get(i - fluidItems.size()), x, y)); + } + } + } + if (additionalIngredients != null) { + this.ingredients.addAll(additionalIngredients); + } + } + } + } +} diff --git a/src/main/java/ihl/nei_integration/MuffleFurnaceRecipeHandler.java b/src/main/java/ihl/nei_integration/MuffleFurnaceRecipeHandler.java new file mode 100644 index 0000000..c5ff0c9 --- /dev/null +++ b/src/main/java/ihl/nei_integration/MuffleFurnaceRecipeHandler.java @@ -0,0 +1,83 @@ +package ihl.nei_integration; + +import java.awt.Rectangle; +import java.util.Map; + +import codechicken.lib.gui.GuiDraw; +import ihl.processing.metallurgy.MuffleFurnaceGui; +import ihl.processing.metallurgy.MuffleFurnanceTileEntity; +import ihl.recipes.UniversalRecipeInput; +import ihl.recipes.UniversalRecipeOutput; +import net.minecraft.client.gui.inventory.GuiContainer; + + +public class MuffleFurnaceRecipeHandler extends MachineRecipeHandler +{ + @Override + public Class getGuiClass() + { + return MuffleFurnaceGui.class; + } + + @Override + protected int[] getInputPosX() + { + return new int[]{40-5,40-5}; + } + + @Override + protected int[] getInputPosY() + { + return new int[]{40-11,22-11}; + } + + @Override + protected int[] getOutputPosX() + { + return new int[]{98-5}; + } + + @Override + protected int[] getOutputPosY() + { + return new int[]{32-11}; + } + + @Override + public String getRecipeId() + { + return "ihl.muffleFurnace"; + } + + @Override + public String getGuiTexture() + { + return "ihl:textures/gui/GUIAchesonFurnace.png"; + } + + @Override + public String getOverlayIdentifier() + { + return "muffleFurnace"; + } + + @Override + public void loadTransferRects() + { + this.transferRects.add(new RecipeTransferRect(new Rectangle(57-5, 29-11, 40, 30), this.getRecipeId(), new Object[0])); + } + + + @Override + public void drawBackground(int i) + { + super.drawBackground(i); + GuiDraw.drawTexturedModalRect(86-5, 33-11, 176, 14, 54, 18); + } + + @Override + public Map getRecipeList() + { + return MuffleFurnanceTileEntity.getRecipes(); + } +} diff --git a/src/main/java/ihl/nei_integration/NEIIHLConfig.java b/src/main/java/ihl/nei_integration/NEIIHLConfig.java new file mode 100644 index 0000000..c1867a7 --- /dev/null +++ b/src/main/java/ihl/nei_integration/NEIIHLConfig.java @@ -0,0 +1,116 @@ +package ihl.nei_integration; + +import codechicken.nei.api.API; +import codechicken.nei.api.IConfigureNEI; +import codechicken.nei.api.ItemInfo; +import ihl.IHLModInfo; +import ihl.processing.chemistry.ChemicalReactorGui; +import ihl.processing.chemistry.CryogenicDistillerGui; +import ihl.processing.chemistry.ElectricEvaporatorGui; +import ihl.processing.chemistry.EvaporatorGui; +import ihl.processing.chemistry.FluidizedBedReactorGui; +import ihl.processing.chemistry.LabElectrolyzerGui; +import ihl.processing.chemistry.LeadOvenGui; +import ihl.processing.chemistry.LoomGui; +import ihl.processing.chemistry.PaperMachineGui; +import ihl.processing.metallurgy.AchesonFurnaceGui; +import ihl.processing.metallurgy.DetonationSprayingMachineGui; +import ihl.processing.metallurgy.ExtruderGui; +import ihl.processing.metallurgy.GasWeldingStationGui; +import ihl.processing.metallurgy.ImpregnatingMachineGui; +import ihl.processing.metallurgy.MuffleFurnaceGui; +import ihl.processing.metallurgy.RollingMachineGui; +import ihl.processing.metallurgy.WireMillGui; +import ihl.processing.metallurgy.WoodenRollingMachineGui; + +public class NEIIHLConfig implements IConfigureNEI +{ + @Override + public void loadConfig() + { + API.registerHighlightHandler(new IHLBlockHighlightHandler(), ItemInfo.Layout.HEADER); + API.registerRecipeHandler(new EvaporatorRecipeHandler()); + API.registerUsageHandler(new EvaporatorRecipeHandler()); + API.registerGuiOverlay(EvaporatorGui.class, "evaporator", 5, 11); + API.registerRecipeHandler(new ElectricEvaporatorRecipeHandler()); + API.registerUsageHandler(new ElectricEvaporatorRecipeHandler()); + API.registerGuiOverlay(ElectricEvaporatorGui.class, "electricevaporator", 5, 11); + API.registerRecipeHandler(new AchesonFurnaceRecipeHandler()); + API.registerUsageHandler(new AchesonFurnaceRecipeHandler()); + API.registerGuiOverlay(AchesonFurnaceGui.class, "achesonFurnace", 5, 11); + API.registerRecipeHandler(new MuffleFurnaceRecipeHandler()); + API.registerUsageHandler(new MuffleFurnaceRecipeHandler()); + API.registerGuiOverlay(MuffleFurnaceGui.class, "muffleFurnace", 5, 11); + API.registerRecipeHandler(new DetonationSprayingMachineRecipeHandler()); + API.registerUsageHandler(new DetonationSprayingMachineRecipeHandler()); + API.registerGuiOverlay(DetonationSprayingMachineGui.class, "detonationSprayingMachine", 5, 11); + API.registerRecipeHandler(new ExtruderRecipeHandler()); + API.registerUsageHandler(new ExtruderRecipeHandler()); + API.registerGuiOverlay(ExtruderGui.class, "extruder", 5, 11); + API.registerRecipeHandler(new ImpregnatingMachineRecipeHandler()); + API.registerUsageHandler(new ImpregnatingMachineRecipeHandler()); + API.registerGuiOverlay(ImpregnatingMachineGui.class, "impregnatingMachine", 5, 11); + API.registerRecipeHandler(new LeadOvenRecipeHandler()); + API.registerUsageHandler(new LeadOvenRecipeHandler()); + API.registerGuiOverlay(LeadOvenGui.class, "leadOven", 5, 11); + API.registerRecipeHandler(new LoomRecipeHandler()); + API.registerUsageHandler(new LoomRecipeHandler()); + API.registerGuiOverlay(LoomGui.class, "loom", 5, 11); + API.registerGuiOverlay(GasWeldingStationGui.class, "gasWeldingStation", 5, 11); + API.registerRecipeHandler(new GasWeldingStationGasRecipeHandler()); + API.registerUsageHandler(new GasWeldingStationGasRecipeHandler()); + API.registerGuiOverlay(GasWeldingStationGui.class, "gasWeldingStationGas", 5, 11); + API.registerRecipeHandler(new WoodenRollingMachineRecipeHandler()); + API.registerUsageHandler(new WoodenRollingMachineRecipeHandler()); + API.registerGuiOverlay(WoodenRollingMachineGui.class, "woodenRollingMachine", 5, 11); + API.registerRecipeHandler(new CryogenicDistillerRecipeHandler()); + API.registerUsageHandler(new CryogenicDistillerRecipeHandler()); + API.registerGuiOverlay(CryogenicDistillerGui.class, "cryogenicDistiller", 5, 11); + API.registerRecipeHandler(new ChemicalReactorRecipeHandler()); + API.registerUsageHandler(new ChemicalReactorRecipeHandler()); + API.registerGuiOverlay(ChemicalReactorGui.class, "chemicalReactor", 5, 11); + API.registerRecipeHandler(new FluidizedBedReactorRecipeHandler()); + API.registerUsageHandler(new FluidizedBedReactorRecipeHandler()); + API.registerGuiOverlay(FluidizedBedReactorGui.class, "fluidizedBedReactor", 5, 11); + API.registerRecipeHandler(new LabElectrolyzerRecipeHandler()); + API.registerUsageHandler(new LabElectrolyzerRecipeHandler()); + API.registerGuiOverlay(LabElectrolyzerGui.class, "labElectrolyzer", 5, 11); + API.registerRecipeHandler(new RollingMachineRecipeHandler()); + API.registerUsageHandler(new RollingMachineRecipeHandler()); + API.registerGuiOverlay(RollingMachineGui.class, "rollingMachine", 5, 11); + API.registerRecipeHandler(new PaperMachineRecipeHandler()); + API.registerUsageHandler(new PaperMachineRecipeHandler()); + API.registerGuiOverlay(PaperMachineGui.class, "paperMachine", 5, 11); + API.registerRecipeHandler(new ElectrolysisBathRecipeHandler()); + API.registerUsageHandler(new ElectrolysisBathRecipeHandler()); + API.registerGuiOverlay(PaperMachineGui.class, "paperMachine", 5, 11); + API.registerRecipeHandler(new WireMillRecipeHandler()); + API.registerUsageHandler(new WireMillRecipeHandler()); + API.registerGuiOverlay(WireMillGui.class, "wireMill", 5, 11); + API.registerRecipeHandler(new InjectionMoldRecipeHandler()); + API.registerUsageHandler(new InjectionMoldRecipeHandler()); + API.registerRecipeHandler(new VulcanizationExtrudingMoldRecipeHandler()); + API.registerUsageHandler(new VulcanizationExtrudingMoldRecipeHandler()); + API.registerRecipeHandler(new CrucibleRecipeHandler()); + API.registerUsageHandler(new CrucibleRecipeHandler()); + API.registerRecipeHandler(new FractionationColumnRecipeHandler()); + API.registerUsageHandler(new FractionationColumnRecipeHandler()); + API.registerRecipeHandler(new IronWorkbenchRecipeHandler()); + API.registerUsageHandler(new IronWorkbenchRecipeHandler()); + this.addSubsets(); + } + + public void addSubsets() {} + + @Override + public String getName() + { + return "IHL"; + } + + @Override + public String getVersion() + { + return IHLModInfo.MODVERSION; + } +} diff --git a/src/main/java/ihl/nei_integration/PaperMachineRecipeHandler.java b/src/main/java/ihl/nei_integration/PaperMachineRecipeHandler.java new file mode 100644 index 0000000..0a5fc90 --- /dev/null +++ b/src/main/java/ihl/nei_integration/PaperMachineRecipeHandler.java @@ -0,0 +1,75 @@ +package ihl.nei_integration; + +import java.awt.Rectangle; +import java.util.Map; + +import ihl.processing.chemistry.PaperMachineGui; +import ihl.processing.chemistry.PaperMachineTileEntity; +import ihl.recipes.UniversalRecipeInput; +import ihl.recipes.UniversalRecipeOutput; +import net.minecraft.client.gui.inventory.GuiContainer; + + +public class PaperMachineRecipeHandler extends MachineRecipeHandler +{ + @Override + public Class getGuiClass() + { + return PaperMachineGui.class; + } + + @Override + protected int[] getInputPosX() + { + return new int[]{78-5,78-5-18,122-5-18,122-5}; + } + + @Override + protected int[] getInputPosY() + { + return new int[]{15-11}; + } + + @Override + protected int[] getOutputPosX() + { + return new int[]{122-5,122-5-18,78-5-18}; + } + + @Override + protected int[] getOutputPosY() + { + return new int[]{51-11,51-11,51-11}; + } + + @Override + public String getRecipeId() + { + return "ihl.paperMachine"; + } + + @Override + public String getGuiTexture() + { + return "ihl:textures/gui/GUIPaperMachine.png"; + } + + @Override + public void loadTransferRects() + { + this.transferRects.add(new RecipeTransferRect(new Rectangle(25-5, 11-11, 52, 74), this.getRecipeId(), new Object[0])); + } + + + @Override + public String getOverlayIdentifier() + { + return "paperMachine"; + } + + @Override + public Map getRecipeList() + { + return PaperMachineTileEntity.getRecipes(); + } +} diff --git a/src/main/java/ihl/nei_integration/RollingMachineRecipeHandler.java b/src/main/java/ihl/nei_integration/RollingMachineRecipeHandler.java new file mode 100644 index 0000000..1a8e4ee --- /dev/null +++ b/src/main/java/ihl/nei_integration/RollingMachineRecipeHandler.java @@ -0,0 +1,67 @@ +package ihl.nei_integration; + +import java.util.Map; + +import ihl.processing.metallurgy.RollingMachineGui; +import ihl.processing.metallurgy.RollingMachinePart1TileEntity; +import ihl.recipes.UniversalRecipeInput; +import ihl.recipes.UniversalRecipeOutput; +import net.minecraft.client.gui.inventory.GuiContainer; + + +public class RollingMachineRecipeHandler extends MachineRecipeHandler +{ + @Override + public Class getGuiClass() + { + return RollingMachineGui.class; + } + + @Override + protected int[] getInputPosX() + { + return new int[]{54-5}; + } + + @Override + protected int[] getInputPosY() + { + return new int[]{25-11,34-11,53-11}; + } + + @Override + protected int[] getOutputPosX() + { + return new int[]{105-5}; + } + + @Override + protected int[] getOutputPosY() + { + return new int[]{25-11}; + } + + @Override + public String getRecipeId() + { + return "ihl.rollingMachine"; + } + + @Override + public String getGuiTexture() + { + return "ihl:textures/gui/GUIRollingMachine.png"; + } + + @Override + public String getOverlayIdentifier() + { + return "rollingMachine"; + } + + @Override + public Map getRecipeList() + { + return RollingMachinePart1TileEntity.getRecipes(); + } +} diff --git a/src/main/java/ihl/nei_integration/VulcanizationExtrudingMoldRecipeHandler.java b/src/main/java/ihl/nei_integration/VulcanizationExtrudingMoldRecipeHandler.java new file mode 100644 index 0000000..2ca3b46 --- /dev/null +++ b/src/main/java/ihl/nei_integration/VulcanizationExtrudingMoldRecipeHandler.java @@ -0,0 +1,66 @@ +package ihl.nei_integration; + +import java.util.Map; + +import ihl.processing.metallurgy.VulcanizationExtrudingMoldTileEntity; +import ihl.recipes.UniversalRecipeInput; +import ihl.recipes.UniversalRecipeOutput; +import net.minecraft.client.gui.inventory.GuiContainer; + + +public class VulcanizationExtrudingMoldRecipeHandler extends MachineRecipeHandler +{ + @Override + public Class getGuiClass() + { + return null; + } + + @Override + protected int[] getInputPosX() + { + return new int[]{41-5,16-5}; + } + + @Override + protected int[] getInputPosY() + { + return new int[]{17-11,46-11}; + } + + @Override + protected int[] getOutputPosX() + { + return new int[]{123-5}; + } + + @Override + protected int[] getOutputPosY() + { + return new int[]{46-11}; + } + + @Override + public String getRecipeId() + { + return "ihl.vulcanizationExtrudingMold"; + } + + @Override + public String getGuiTexture() + { + return "ihl:textures/gui/GUIVulcanizationExtrudingMoldNEI.png"; + } + + @Override + public String getOverlayIdentifier() + { + return "vulcanizationExtrudingMold"; + } + + @Override + public Map getRecipeList() + { + return VulcanizationExtrudingMoldTileEntity.getRecipes(); + } +} diff --git a/src/main/java/ihl/nei_integration/WireMillRecipeHandler.java b/src/main/java/ihl/nei_integration/WireMillRecipeHandler.java new file mode 100644 index 0000000..aebf85e --- /dev/null +++ b/src/main/java/ihl/nei_integration/WireMillRecipeHandler.java @@ -0,0 +1,101 @@ +package ihl.nei_integration; + +import java.awt.Rectangle; +import java.util.Map; + +import org.lwjgl.opengl.GL11; + +import codechicken.lib.gui.GuiDraw; +import ihl.processing.metallurgy.WireMillGui; +import ihl.processing.metallurgy.WireMillTileEntity; +import ihl.recipes.UniversalRecipeInput; +import ihl.recipes.UniversalRecipeOutput; +import net.minecraft.client.gui.inventory.GuiContainer; + + +public class WireMillRecipeHandler extends MachineRecipeHandler +{ + @Override + public Class getGuiClass() + { + return WireMillGui.class; + } + + @Override + protected int[] getInputPosX() + { + return new int[]{117-5,44-5}; + } + + @Override + protected int[] getInputPosY() + { + return new int[]{31-11,14-11}; + } + + @Override + protected int[] getFluidInputPosX() + { + return new int[]{8-5,26-5,44-5}; + } + + @Override + protected int[] getFluidInputPosY() + { + return new int[]{14-11}; + } + + + @Override + protected int[] getOutputPosX() + { + return new int[]{152-5}; + } + + @Override + protected int[] getOutputPosY() + { + return new int[]{31-11}; + } + + @Override + public String getRecipeId() + { + return "ihl.wireMill"; + } + + @Override + public String getGuiTexture() + { + return "ihl:textures/gui/GUIWireMill.png"; + } + + @Override + public String getOverlayIdentifier() + { + return "wireMill"; + } + + @Override + public void loadTransferRects() + { + this.transferRects.add(new RecipeTransferRect(new Rectangle(134-5, 33-11, 18, 13), this.getRecipeId(), new Object[0])); + } + + @Override + public void drawBackground(int i) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GuiDraw.changeTexture(this.getGuiTexture()); + GuiDraw.drawTexturedModalRect(0, 0, 5, 11, 151, 65); + GuiDraw.drawTexturedModalRect(133-5+18, 30-11, 98+18, 30, 18, 18); + GuiDraw.drawTexturedModalRect(7-5+18, 13-11, 25+18, 13, 18, 18); + GuiDraw.drawTexturedModalRect(7-5, 13-11, 25+18, 13, 18, 18); + } + + @Override + public Map getRecipeList() + { + return WireMillTileEntity.getRecipes(); + } +} diff --git a/src/main/java/ihl/nei_integration/WoodenRollingMachineRecipeHandler.java b/src/main/java/ihl/nei_integration/WoodenRollingMachineRecipeHandler.java new file mode 100644 index 0000000..f8adb4f --- /dev/null +++ b/src/main/java/ihl/nei_integration/WoodenRollingMachineRecipeHandler.java @@ -0,0 +1,74 @@ +package ihl.nei_integration; + +import java.awt.Rectangle; +import java.util.Map; + +import ihl.processing.metallurgy.WoodenRollingMachineGui; +import ihl.processing.metallurgy.WoodenRollingMachinePart1TileEntity; +import ihl.recipes.UniversalRecipeInput; +import ihl.recipes.UniversalRecipeOutput; +import net.minecraft.client.gui.inventory.GuiContainer; + + +public class WoodenRollingMachineRecipeHandler extends MachineRecipeHandler +{ + @Override + public Class getGuiClass() + { + return WoodenRollingMachineGui.class; + } + + @Override + protected int[] getInputPosX() + { + return new int[]{123-5}; + } + + @Override + protected int[] getInputPosY() + { + return new int[]{15-11,34-11,53-11}; + } + + @Override + protected int[] getOutputPosX() + { + return new int[]{54-5}; + } + + @Override + protected int[] getOutputPosY() + { + return new int[]{25-11}; + } + + @Override + public String getRecipeId() + { + return "ihl.woodenRollingMachine"; + } + + @Override + public String getGuiTexture() + { + return "ihl:textures/gui/GUIWoodenRollingMachine.png"; + } + + @Override + public void loadTransferRects() + { + this.transferRects.add(new RecipeTransferRect(new Rectangle(74-5,16-11, 46, 48), this.getRecipeId(), new Object[0])); + } + + @Override + public String getOverlayIdentifier() + { + return "woodenRollingMachine"; + } + + @Override + public Map getRecipeList() + { + return WoodenRollingMachinePart1TileEntity.getRecipes(); + } +} diff --git a/src/main/java/ihl/processing/chemistry/ApparatusProcessableInvSlot.java b/src/main/java/ihl/processing/chemistry/ApparatusProcessableInvSlot.java new file mode 100644 index 0000000..bfed5c9 --- /dev/null +++ b/src/main/java/ihl/processing/chemistry/ApparatusProcessableInvSlot.java @@ -0,0 +1,59 @@ +package ihl.processing.chemistry; + +import java.util.ArrayList; +import java.util.List; + +import ic2.api.recipe.IRecipeInput; +import ic2.core.block.TileEntityInventory; +import ic2.core.block.invslot.InvSlot; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +public class ApparatusProcessableInvSlot extends InvSlot { + + public ApparatusProcessableInvSlot(TileEntityInventory base1, String name1, int oldStartIndex1, Access access1, + int count, int stackSizeLimit1) { + super(base1, name1, oldStartIndex1, Access.I, count); + this.setStackSizeLimit(stackSizeLimit1); + } + + public List getItemStackList() { + List list = new ArrayList(); + for (int i = 0; i < this.size(); i++) { + if (get(i) != null) { + list.add(get(i)); + } + } + return list; + } + + public ItemStack getItemStack(Item item) { + for (int i = 0; i < this.size(); i++) { + if (get(i) != null && get(i).getItem() == item) { + return get(i); + } + } + return null; + } + + public void replaceItemStack(ItemStack stack1) { + for (int i = 0; i < this.size(); i++) { + if (this.get(i) != null && this.get(i).getItem() == stack1.getItem()) { + this.put(i, stack1); + } + } + } + + public void consume(IRecipeInput iRecipeInput) { + for (int i = 0; i < this.size(); i++) { + if (this.get(i) != null && iRecipeInput.matches(this.get(i))) { + this.get(i).stackSize -= iRecipeInput.getAmount(); + if (this.get(i).stackSize <= 0) { + this.put(i, null); + return; + } + } + } + } + +} diff --git a/src/main/java/ihl/processing/chemistry/BasicElectricMotorContainer.java b/src/main/java/ihl/processing/chemistry/BasicElectricMotorContainer.java new file mode 100644 index 0000000..a32e006 --- /dev/null +++ b/src/main/java/ihl/processing/chemistry/BasicElectricMotorContainer.java @@ -0,0 +1,74 @@ +package ihl.processing.chemistry; + +import ic2.core.ContainerBase; +import ic2.core.slot.SlotInvSlot; +import ihl.processing.metallurgy.BasicElectricMotorTileEntity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.Slot; + +public class BasicElectricMotorContainer extends ContainerBase { + + protected BasicElectricMotorTileEntity tileEntity; + public short lastProgress = -1; + public short lastEnergy = -1; + private final static int height = 166; + + public BasicElectricMotorContainer(EntityPlayer entityPlayer, T tileEntity1) { + super(tileEntity1); + this.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.dischargeSlot, 0, 8, 33)); + for (col = 0; col < 4; ++col) { + this.addSlotToContainer(new SlotInvSlot(tileEntity1.upgradeSlot, col, 152, 8 + col * 18)); + } + } + + @Override + public void detectAndSendChanges() { + super.detectAndSendChanges(); + for (int i = 0; i < this.crafters.size(); ++i) { + ICrafting icrafting = (ICrafting) this.crafters.get(i); + + if (this.tileEntity.progress != this.lastProgress) { + icrafting.sendProgressBarUpdate(this, 0, this.tileEntity.progress); + } + + if ((short) this.tileEntity.energy != this.lastEnergy) { + icrafting.sendProgressBarUpdate(this, 2, (short) this.tileEntity.energy); + } + } + + this.lastProgress = this.tileEntity.progress; + this.lastEnergy = (short) this.tileEntity.energy; + } + + @Override + public void updateProgressBar(int index, int value) { + super.updateProgressBar(index, value); + switch (index) { + case 0: + this.tileEntity.progress = (short) value; + break; + case 1: + break; + case 2: + this.tileEntity.energy = value; + break; + } + } + + @Override + public boolean canInteractWith(EntityPlayer var1) { + return tileEntity.isUseableByPlayer(var1); + } +} diff --git a/src/main/java/ihl/processing/chemistry/BatteryItem.java b/src/main/java/ihl/processing/chemistry/BatteryItem.java new file mode 100644 index 0000000..b9c5435 --- /dev/null +++ b/src/main/java/ihl/processing/chemistry/BatteryItem.java @@ -0,0 +1,194 @@ +package ihl.processing.chemistry; + +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ic2.api.item.ElectricItem; +import ic2.api.item.IElectricItem; +import ic2.api.item.IItemHudInfo; +import ihl.IHLCreativeTab; +import ihl.IHLModInfo; +import ihl.utils.IHLUtils; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + +public class BatteryItem extends Item implements IElectricItem, IItemHudInfo +{ + public int maxCharge=65536; + public int transferLimit = 4096; + public int tier = 4; + private static Map iconMap = new HashMap(); + private static Map nameMap = new HashMap(); + private static Map descriptionMap = new HashMap(); + + public BatteryItem() + { + super(); + this.setMaxDamage(27); + this.setCreativeTab(IHLCreativeTab.tab); + this.maxStackSize=1; + this.canRepair=false; + this.setUnlocalizedName("battery"); + } + + public static void init() + { + BatteryItem item = new BatteryItem(); + GameRegistry.registerItem(item,item.getUnlocalizedName()); + Type[] var1 = Type.values(); + for(int i=0;i getHudInfo(ItemStack itemStack) + { + LinkedList info = new LinkedList(); + info.add(ElectricItem.manager.getToolTip(itemStack)); + return info; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister register) + { + Type[] var1 = Type.values(); + for(int i=0;i { + + protected ChemicalReactorTileEntity tileEntity; + public List fluidTankFluidList; + public int fluidListHash = -1; + + public ChemicalReactorContainer(EntityPlayer entityPlayer, ChemicalReactorTileEntity tileEntity1) { + super(entityPlayer, tileEntity1); + this.tileEntity = tileEntity1; + fluidTankFluidList = tileEntity.getFluidTank().getFluidList(); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.fillInputSlot, 0, 60, 51)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.drainInputSlot, 0, 60, 15)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.emptyFluidItemsSlot, 0, 60, 33)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.input, 0, 122 - 18, 15)); + 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)); + } + + @Override + public void detectAndSendChanges() { + super.detectAndSendChanges(); + if (this.fluidListHash != fluidTankFluidList.hashCode()) { + IC2.network.get().sendContainerField(this, "fluidTankFluidList"); + this.fluidListHash = fluidTankFluidList.hashCode(); + } + } +} diff --git a/src/main/java/ihl/processing/chemistry/ChemicalReactorGui.java b/src/main/java/ihl/processing/chemistry/ChemicalReactorGui.java new file mode 100644 index 0000000..de22f76 --- /dev/null +++ b/src/main/java/ihl/processing/chemistry/ChemicalReactorGui.java @@ -0,0 +1,79 @@ +package ihl.processing.chemistry; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ihl.utils.IHLRenderUtils; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.util.ResourceLocation; + +@SideOnly(Side.CLIENT) +public class ChemicalReactorGui extends GuiContainer { + private static final ResourceLocation background = new ResourceLocation("ihl", "textures/gui/GUIChemicalReactor.png"); + private ChemicalReactorContainer container; + private int mixerFrame=0; + + public ChemicalReactorGui (ChemicalReactorContainer container1) { + //the container is instanciated and passed to the superclass for handling + super(container1); + this.container=container1; + } + + @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) + { + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + i1 = Math.min(this.container.tileEntity.getGUIEnergy(12),12); + this.drawTexturedModalRect(12, 16 + 12 - i1, 179, 12 - i1, 14, i1 + 2); + } + if (this.container.tileEntity.progress > 0) + { + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(27),27); + this.drawTexturedModalRect(30, 29, getFrameX(i1), getFrameY(i1),24,24); + if(mixerFrame++>4) + { + mixerFrame=0; + } + } + else + { + mixerFrame=0; + } + this.drawTexturedModalRect(103-18, 52, 246, 226+6*mixerFrame,10,6); + if (this.container.tileEntity.getTankAmount() > 0) + { + IHLRenderUtils.instance.renderIHLFluidTank(this.container.tileEntity.getFluidTank(), 102-18, 28, 114-18, 59, zLevel, par1, par2, xOffset, yOffset); + } + } + + @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(background); + int x = (width - xSize) / 2; + int y = (height - ySize) / 2; + this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); + } + + private int getFrameY(int number) + { + return (number % 10) * 24 + 14; + } + + private int getFrameX(int number) + { + return (number / 10) * 24 + 176; + } +} \ No newline at end of file diff --git a/src/main/java/ihl/processing/chemistry/ChemicalReactorTileEntity.java b/src/main/java/ihl/processing/chemistry/ChemicalReactorTileEntity.java new file mode 100644 index 0000000..7de2ccf --- /dev/null +++ b/src/main/java/ihl/processing/chemistry/ChemicalReactorTileEntity.java @@ -0,0 +1,294 @@ +package ihl.processing.chemistry; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ic2.core.ContainerBase; +import ic2.core.IC2; +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 ihl.processing.invslots.IHLInvSlotOutput; +import ihl.processing.invslots.InvSlotConsumableLiquidIHL; +import ihl.processing.metallurgy.BasicElectricMotorTileEntity; +import ihl.recipes.UniversalRecipeInput; +import ihl.recipes.UniversalRecipeManager; +import ihl.recipes.UniversalRecipeOutput; +import ihl.utils.IHLFluidTank; +import ihl.utils.IHLUtils; +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; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidHandler; + +public class ChemicalReactorTileEntity extends BasicElectricMotorTileEntity implements IFluidHandler +{ + private final static UniversalRecipeManager recipeManager = new UniversalRecipeManager("chemicalreactor"); + public final ApparatusProcessableInvSlot input; + public final IHLInvSlotOutput outputSlot; + public final InvSlotConsumableLiquidIHL drainInputSlot; + public final InvSlotConsumableLiquidIHL fillInputSlot; + public final InvSlotOutput emptyFluidItemsSlot; + private final IHLFluidTank fluidTank = new IHLFluidTank(8000); + public short temperature=20; + + public ChemicalReactorTileEntity() { + super(); + this.outputSlot = new IHLInvSlotOutput(this, "output", 0, 2); + 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.input = new ApparatusProcessableInvSlot(this, "input", 3, Access.I, 2, 64); + } + + @Override + public void readFromNBT(NBTTagCompound nbttagcompound) + { + super.readFromNBT(nbttagcompound); + this.fluidTank.readFromNBT(nbttagcompound.getCompoundTag("fluidTank")); + } + + @Override + public void writeToNBT(NBTTagCompound nbttagcompound) + { + super.writeToNBT(nbttagcompound); + NBTTagCompound fluidTankTag = new NBTTagCompound(); + this.fluidTank.writeToNBT(fluidTankTag); + nbttagcompound.setTag("fluidTank", fluidTankTag); + } + + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { + return this.getFacing()!=side; + } + + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { + return IHLUtils.getThisModItemStack("chemicalReactor"); + } + + @Override + public boolean enableUpdateEntity() + { + return IC2.platform.isSimulating(); + } + + + @Override + public void updateEntityServer() + { + super.updateEntityServer(); + IHLUtils.handleFluidSlotsBehaviour(fillInputSlot, drainInputSlot, emptyFluidItemsSlot, fluidTank); + } + + @Override + public FluidStack drain(ForgeDirection from, int amount, boolean doDrain) + { + switch(from) + { + case UP: + return this.fluidTank.drainLightest(amount, doDrain); + case NORTH: + return this.fluidTank.drainLightest(amount, doDrain); + case SOUTH: + return this.fluidTank.drainLightest(amount, doDrain); + case WEST: + return this.fluidTank.drainLightest(amount, doDrain); + case EAST: + return this.fluidTank.drainLightest(amount, doDrain); + case DOWN: + return this.fluidTank.drain(amount, doDrain); + default: + return this.fluidTank.drain(amount, doDrain); + } + } + + //1.7.10 API + @Override + public boolean canDrain(ForgeDirection arg0, Fluid arg1) { + return true; + } + + @Override + public boolean canFill(ForgeDirection direction, Fluid arg1) { + return true; + } + + @Override + public String getInventoryName() { + return "chemicalReactor"; + } + + public float getRenderLiquidLevel() + { + return (float)this.fluidTank.getFluidAmount()/(float)this.fluidTank.getCapacity(); + } + + @Override + public int gaugeProgressScaled(int i) + { + return this.progress * i / operationLength; + } + + @Override + @SideOnly(Side.CLIENT) + public GuiScreen getGui(EntityPlayer player, boolean arg1) { + return new ChemicalReactorGui(new ChemicalReactorContainer(player, this)); + } + + @Override + public ContainerBase getGuiContainer(EntityPlayer player) + { + this.fluidTank.sortFluidsByDensity(); + return new ChemicalReactorContainer(player, this); + } + + @Override + public void onGuiClosed(EntityPlayer player) {} + + @Override + public boolean canOperate() + { + UniversalRecipeOutput output = getOutput(); + if(output!=null && this.outputSlot.canAdd(getOutput().getItemOutputs())) + { + if(output.specialConditions) + { + return this.checkSpecialConditions(); + } + else + { + return true; + } + } + 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; + } + + @SuppressWarnings("unchecked") + public UniversalRecipeOutput getOutput() + { + return ChemicalReactorTileEntity.recipeManager.getOutputFor(this.getInput()[0],this.getInput()[1]); + } + + @SuppressWarnings({ "unchecked", "rawtypes" }) + @Override + public List[] getInput() + { + return new List[] {fluidTank.getFluidList(), this.input.getItemStackList()}; + } + + @Override + @SuppressWarnings({ "unchecked"}) + public void operate() + { + UniversalRecipeInput recipeInput = ChemicalReactorTileEntity.recipeManager.getRecipeInput(this.getInput()[0],this.getInput()[1]); + UniversalRecipeOutput output1 = getOutput(); + for(int i=0; i getRecipes() { + return recipeManager.getRecipes(); + } + + public static void addRecipe(FluidStack fluidStackInput1, FluidStack fluidStackInput2, ItemStack itemStackInput, FluidStack fluidStackOutput, ItemStack itemStackOutput1, ItemStack itemStackOutput2) + { + 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((new FluidStack[] {fluidStackInput1, fluidStackInput2}), (new ItemStack[] {itemStackInput})), new UniversalRecipeOutput((new FluidStack[] {fluidStackOutput}), (new ItemStack[] {itemStackOutput1, itemStackOutput2}),200, true)); + } + + public IHLFluidTank getFluidTank() + { + return this.fluidTank; + } + +} \ No newline at end of file diff --git a/src/main/java/ihl/processing/chemistry/CryogenicDistillerContainer.java b/src/main/java/ihl/processing/chemistry/CryogenicDistillerContainer.java new file mode 100644 index 0000000..988b844 --- /dev/null +++ b/src/main/java/ihl/processing/chemistry/CryogenicDistillerContainer.java @@ -0,0 +1,39 @@ +package ihl.processing.chemistry; + +import java.util.List; + +import ic2.core.IC2; +import ic2.core.slot.SlotInvSlot; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraftforge.fluids.FluidStack; + +public class CryogenicDistillerContainer extends BasicElectricMotorContainer { + + public CryogenicDistillerTileEntity tileEntity; + private int lastNumberOfFluids = -1; + private int lastFluidAmount = -1; + public List fluidTankFluidList; + + public CryogenicDistillerContainer(EntityPlayer entityPlayer, + CryogenicDistillerTileEntity lathePart1TileEntity) { + super(entityPlayer, lathePart1TileEntity); + tileEntity=lathePart1TileEntity; + fluidTankFluidList=tileEntity.fluidTankProducts.getFluidList(); + 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)); + this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.fluidItemsSlot,1, 103, 15)); + } + + @Override + public void detectAndSendChanges() + { + super.detectAndSendChanges(); + if (this.tileEntity.fluidTankProducts.getFluidAmount() != this.lastFluidAmount || this.tileEntity.fluidTankProducts.getNumberOfFluids() != this.lastNumberOfFluids) + { + IC2.network.get().sendContainerField(this, "fluidTankFluidList"); + } + this.lastNumberOfFluids = this.tileEntity.fluidTankProducts.getNumberOfFluids(); + this.lastFluidAmount = this.tileEntity.fluidTankProducts.getFluidAmount(); + } +} diff --git a/src/main/java/ihl/processing/chemistry/CryogenicDistillerGui.java b/src/main/java/ihl/processing/chemistry/CryogenicDistillerGui.java new file mode 100644 index 0000000..a8f9f0f --- /dev/null +++ b/src/main/java/ihl/processing/chemistry/CryogenicDistillerGui.java @@ -0,0 +1,71 @@ +package ihl.processing.chemistry; + +import org.lwjgl.opengl.GL11; + +import ic2.core.IC2; +import ihl.utils.IHLRenderUtils; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.util.ResourceLocation; + +public class CryogenicDistillerGui extends GuiContainer { + + private CryogenicDistillerContainer container; + protected static final ResourceLocation tex = new ResourceLocation("ihl", "textures/gui/GUICryogenicDistiller.png"); + + public CryogenicDistillerGui(CryogenicDistillerContainer latheContainer) { + super(latheContainer); + container = latheContainer; + } + + @SuppressWarnings("unchecked") + @Override + public void initGui() { + super.initGui(); + int x = (width - xSize) / 2; + int y = (height - ySize) / 2; + this.buttonList.add(new GuiButton(0, x + 7, y + 50, 49, 20, "Empty")); + } + + @Override + public void actionPerformed(GuiButton button) { + super.actionPerformed(button); + IC2.network.get().initiateClientTileEntityEvent(this.container.tileEntity, button.id); + } + + @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.getEnergy() > 0D) { + 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.9F); + i1 = Math.min(this.container.tileEntity.getGUIEnergy(12), 12); + this.drawTexturedModalRect(9, 15 + 12 - i1, 176, 12 - i1, 14, i1 + 2); + } + if (this.container.tileEntity.progress > 0) { + i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(18), 18); + this.drawTexturedModalRect(81, 35, 198, 0, i1 + 1, 13); + } + if (this.container.tileEntity.fluidTankProducts.getFluid() != null + && this.container.tileEntity.fluidTankProducts.getFluidAmount() > 0) { + IHLRenderUtils.instance.renderIHLFluidTank(this.container.tileEntity.fluidTankProducts, 125, 28, 137, 67, + zLevel, par1, par2, xOffset, yOffset); + } + } + + @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); + } +} diff --git a/src/main/java/ihl/processing/chemistry/CryogenicDistillerTileEntity.java b/src/main/java/ihl/processing/chemistry/CryogenicDistillerTileEntity.java new file mode 100644 index 0000000..6a156db --- /dev/null +++ b/src/main/java/ihl/processing/chemistry/CryogenicDistillerTileEntity.java @@ -0,0 +1,229 @@ +package ihl.processing.chemistry; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ic2.core.ContainerBase; +import ic2.core.block.invslot.InvSlot; +import ic2.core.block.invslot.InvSlotConsumableLiquid; +import ic2.core.block.invslot.InvSlotOutput; +import ihl.processing.invslots.InvSlotConsumableLiquidIHL; +import ihl.processing.metallurgy.BasicElectricMotorTileEntity; +import ihl.recipes.UniversalRecipeInput; +import ihl.recipes.UniversalRecipeManager; +import ihl.recipes.UniversalRecipeOutput; +import ihl.utils.IHLFluidTank; +import ihl.utils.IHLUtils; +import net.minecraft.block.Block; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +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; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidHandler; + +public class CryogenicDistillerTileEntity extends BasicElectricMotorTileEntity implements IFluidHandler { + + public final InvSlotConsumableLiquidIHL fillInputSlotInput; + public final InvSlotOutput fluidItemsSlot; + public final InvSlotConsumableLiquidIHL fillInputSlotProducts; + + private IHLFluidTank fluidTankInput = new IHLFluidTank(8000); + public IHLFluidTank fluidTankProducts = new IHLFluidTank(8000); + protected static final UniversalRecipeManager recipeManager = new UniversalRecipeManager("cryogenicdistiller"); + protected static UniversalRecipeOutput airOutput = new UniversalRecipeOutput(new FluidStack[] { + IHLUtils.getFluidStackWithSize("nitrogen", 781), IHLUtils.getFluidStackWithSize("oxygen", 209) }, null, 20, + false); + + static { + recipeManager.addRecipe( + new UniversalRecipeInput(new FluidStack[] { IHLUtils.getFluidStackWithSize("air", 1000) }, null), + airOutput); + } + + public CryogenicDistillerTileEntity() { + super(); + 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); + } + + @Override + public String getInventoryName() { + return "CryogenicDistiller"; + } + + @Override + public void updateEntityServer() { + super.updateEntityServer(); + IHLUtils.handleFluidSlotsBehaviour(fillInputSlotProducts, null, fluidItemsSlot, fluidTankProducts); + } + + @Override + public ItemStack getWrenchDrop(EntityPlayer player) { + return IHLUtils.getThisModItemStack("cryogenicDistiller"); + } + + @Override + @SideOnly(Side.CLIENT) + public GuiScreen getGui(EntityPlayer player, boolean arg1) { + return new CryogenicDistillerGui(new CryogenicDistillerContainer(player, this)); + } + + @Override + public ContainerBase getGuiContainer(EntityPlayer player) { + return new CryogenicDistillerContainer(player, this); + } + + @Override + public void operate() { + UniversalRecipeInput ri = CryogenicDistillerTileEntity.recipeManager.getRecipeInput(getInput()); + this.fluidTankProducts.fill(getOutput().getFluidOutputs(), true); + this.fluidTankInput.drain(ri.getFluidInputs().get(0), true); + TileEntity teOnTop = worldObj.getTileEntity(xCoord, yCoord + 1, zCoord); + if (teOnTop instanceof IFluidHandler && this.fluidTankProducts.getLigthestFluid() != null) { + IFluidHandler topFH = (IFluidHandler) teOnTop; + if (topFH.canFill(ForgeDirection.DOWN, this.fluidTankProducts.getLigthestFluid().getFluid())) { + FluidStack fsToDrain = this.fluidTankProducts.getLigthestFluid().copy(); + fsToDrain.amount = topFH.fill(ForgeDirection.DOWN, fsToDrain, true); + this.fluidTankProducts.drain(fsToDrain, true); + } + } + ForgeDirection orientation = ForgeDirection.getOrientation(this.getFacing()); + TileEntity teOnFront = worldObj.getTileEntity(xCoord + orientation.offsetX, yCoord, + zCoord + orientation.offsetZ); + if (teOnFront instanceof IFluidHandler && this.fluidTankProducts.getFluid() != null) { + IFluidHandler frontFH = (IFluidHandler) teOnFront; + if (frontFH.canFill(orientation, this.fluidTankProducts.getFluid().getFluid())) { + FluidStack fsToDrain = this.fluidTankProducts.getFluid().copy(); + fsToDrain.amount = frontFH.fill(orientation, fsToDrain, true); + this.fluidTankProducts.drain(fsToDrain, true); + } + } + } + + public UniversalRecipeOutput getOutput() { + return CryogenicDistillerTileEntity.recipeManager.getOutputFor(this.getInput()); + } + + @Override + @SuppressWarnings({ "unchecked", "rawtypes" }) + public List[] getInput() { + return new List[] { Arrays.asList(new FluidStack[] { this.fluidTankInput.getLigthestFluid() }), null }; + } + + @Override + public boolean canOperate() { + UniversalRecipeOutput output = this.getOutput(); + if (output == airOutput) { + ForgeDirection dir = ForgeDirection.getOrientation(this.getFacing()).getOpposite(); + Block block = worldObj.getBlock(xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ); + if (!block.isAir(worldObj, xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ) + && block != Blocks.air) + return false; + } + return output != null && (this.fluidTankProducts.getCapacity() - this.fluidTankProducts.getFluidAmount()) > 0; + } + + @Override + public void onGuiClosed(EntityPlayer arg0) { + } + + @Override + public void readFromNBT(NBTTagCompound nbttagcompound) { + super.readFromNBT(nbttagcompound); + this.fluidTankInput.readFromNBT(nbttagcompound.getCompoundTag("fluidTankInput")); + this.fluidTankProducts.readFromNBT(nbttagcompound.getCompoundTag("fluidTankProducts")); + } + + @Override + public void writeToNBT(NBTTagCompound nbttagcompound) { + super.writeToNBT(nbttagcompound); + NBTTagCompound fluidTankInputTag = new NBTTagCompound(); + this.fluidTankInput.writeToNBT(fluidTankInputTag); + nbttagcompound.setTag("fluidTankInput", fluidTankInputTag); + NBTTagCompound fluidTankProductsTag = new NBTTagCompound(); + this.fluidTankProducts.writeToNBT(fluidTankProductsTag); + nbttagcompound.setTag("fluidTankProducts", fluidTankProductsTag); + } + + public static void addRecipe(FluidStack input, FluidStack output, FluidStack output2, boolean specialCondition) { + if (output2 != null) { + recipeManager.addRecipe(new UniversalRecipeInput(new FluidStack[] { input }, null), + new UniversalRecipeOutput(new FluidStack[] { output, output2 }, null, 20, specialCondition)); + } else { + recipeManager.addRecipe(new UniversalRecipeInput(new FluidStack[] { input }, null), + new UniversalRecipeOutput(new FluidStack[] { output }, null, 20, specialCondition)); + } + } + + public static Map getRecipes() { + return recipeManager.getRecipes(); + } + + public boolean canProcess() { + return this.energy >= this.energyConsume; + } + + @Override + public boolean canDrain(ForgeDirection dir, Fluid arg1) { + return dir.equals(ForgeDirection.getOrientation(this.getFacing())) || dir.equals(ForgeDirection.UP); + } + + @Override + public boolean canFill(ForgeDirection dir, Fluid fluid) { + return dir.equals(ForgeDirection.getOrientation(this.getFacing()).getOpposite()); + } + + @Override + public FluidStack drain(ForgeDirection dir, FluidStack fstack, boolean doDrain) { + if (this.canDrain(dir, null)) { + return this.fluidTankProducts.drain(fstack, doDrain); + } + return null; + } + + @Override + public FluidStack drain(ForgeDirection dir, int amount, boolean doDrain) { + if (this.canDrain(dir, null)) { + if (dir.equals(ForgeDirection.UP)) { + return this.fluidTankProducts.drainLightest(amount, doDrain); + } + return this.fluidTankProducts.drain(amount, doDrain); + } + return null; + } + + @Override + public int fill(ForgeDirection dir, FluidStack fstack, boolean doFill) { + if (fstack != null && fstack.getFluid() != null && this.canFill(dir, fstack.getFluid())) { + return this.fluidTankInput.fill(fstack, doFill); + } + return 0; + } + + @Override + public FluidTankInfo[] getTankInfo(ForgeDirection dir) { + return new FluidTankInfo[] { this.fluidTankInput.getInfo(), this.fluidTankProducts.getInfo() }; + } + + @Override + public void onNetworkEvent(EntityPlayer player, int event) { + switch (event) { + case 0: + this.fluidTankProducts.setEmpty(); + break; + } + } + +} diff --git a/src/main/java/ihl/processing/chemistry/DosingPumpContainer.java b/src/main/java/ihl/processing/chemistry/DosingPumpContainer.java new file mode 100644 index 0000000..5a4cb21 --- /dev/null +++ b/src/main/java/ihl/processing/chemistry/DosingPumpContainer.java @@ -0,0 +1,95 @@ +package ihl.processing.chemistry; + +import java.util.List; + +import ic2.core.ContainerBase; +import ic2.core.IC2; +import ic2.core.slot.SlotInvSlot; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.Slot; +import net.minecraftforge.fluids.FluidStack; + +public class DosingPumpContainer extends ContainerBase { + + protected DosingPumpTileEntity tileEntity; + public int lastFluidAmount = -1; + public int lastNumberOfFluids = -1; + public short lastProgress = -1; + public int lastFluidAmountSetpoint = -1; + public short lastEnergy = -1; + private final static int height = 166; + public List fluidTankFluidList; + + public DosingPumpContainer(EntityPlayer entityPlayer, DosingPumpTileEntity tileEntity1) { + super(tileEntity1); + this.tileEntity = tileEntity1; + fluidTankFluidList = tileEntity.getFluidTank().getFluidList(); + 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.fillInputSlot, 0, 44, 50)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.drainInputSlot, 0, 44, 14)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.emptyFluidItemsSlot, 0, 44, 32)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.dischargeSlot, 0, 8, 32)); + } + + @Override + public void detectAndSendChanges() { + super.detectAndSendChanges(); + for (int i = 0; i < this.crafters.size(); ++i) { + ICrafting icrafting = (ICrafting) this.crafters.get(i); + + if (this.tileEntity.getTankAmount() != this.lastFluidAmount + || this.tileEntity.getNumberOfFluidsInTank() != this.lastNumberOfFluids) { + IC2.network.get().sendContainerField(this, "fluidTankFluidList"); + } + + if (this.tileEntity.progress != this.lastProgress) { + icrafting.sendProgressBarUpdate(this, 0, this.tileEntity.progress); + } + + if (this.tileEntity.fluidAmountSetpoint != this.lastFluidAmountSetpoint) { + icrafting.sendProgressBarUpdate(this, 1, this.tileEntity.fluidAmountSetpoint); + } + + if ((short) this.tileEntity.energy != this.lastEnergy) { + icrafting.sendProgressBarUpdate(this, 2, (short) this.tileEntity.energy); + } + } + + this.lastNumberOfFluids = this.tileEntity.getNumberOfFluidsInTank(); + this.lastFluidAmount = this.tileEntity.getTankAmount(); + this.lastProgress = this.tileEntity.progress; + this.lastFluidAmountSetpoint = this.tileEntity.fluidAmountSetpoint; + this.lastEnergy = (short) this.tileEntity.energy; + } + + @Override + public void updateProgressBar(int index, int value) { + super.updateProgressBar(index, value); + switch (index) { + case 0: + this.tileEntity.progress = (short) value; + break; + case 1: + this.tileEntity.fluidAmountSetpoint = (short) value; + break; + case 2: + this.tileEntity.energy = value; + break; + } + } + + @Override + public boolean canInteractWith(EntityPlayer var1) { + return tileEntity.isUseableByPlayer(var1); + } +} diff --git a/src/main/java/ihl/processing/chemistry/DosingPumpGui.java b/src/main/java/ihl/processing/chemistry/DosingPumpGui.java new file mode 100644 index 0000000..dde4f13 --- /dev/null +++ b/src/main/java/ihl/processing/chemistry/DosingPumpGui.java @@ -0,0 +1,103 @@ +package ihl.processing.chemistry; + +import java.awt.event.KeyEvent; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ihl.ClientProxy; +import ihl.IHLMod; +import ihl.utils.IHLRenderUtils; +import ihl.utils.IHLUtils; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiTextField; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; + +@SideOnly(Side.CLIENT) +public class DosingPumpGui extends GuiContainer { + private static final ResourceLocation background = new ResourceLocation("ihl", "textures/gui/GUIDosingPump.png"); + private DosingPumpContainer container; + private GuiTextField setpointTextField; + private int lastFluidAmountSetpoint = -1; + private final static int TANK_HEIGHT = 58; + + public DosingPumpGui(DosingPumpContainer container1) { + // the container is instanciated and passed to the superclass for + // handling + super(container1); + this.container = container1; + setpointTextField = new GuiTextField(Minecraft.getMinecraft().fontRenderer, 106, 34, 62, 16); + setpointTextField.setText(Integer.toString(this.container.tileEntity.fluidAmountSetpoint)); + setpointTextField.setFocused(true); + } + + @Override + protected void drawGuiContainerForegroundLayer(int par1, int par2) { + if(lastFluidAmountSetpoint!= this.container.tileEntity.fluidAmountSetpoint){ + setpointTextField.setText(Integer.toString(this.container.tileEntity.fluidAmountSetpoint)); + lastFluidAmountSetpoint= this.container.tileEntity.fluidAmountSetpoint; + } + 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) { + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + i1 = Math.min(this.container.tileEntity.getGUIEnergy(12), 12); + this.drawTexturedModalRect(12, 15 + 12 - i1, 179, 12 - i1, 14, i1 + 2); + } + i1 = TANK_HEIGHT - this.container.tileEntity.fluidAmountSetpoint * TANK_HEIGHT + / this.container.tileEntity.getFluidTank().getCapacity(); + this.drawTexturedModalRect(78, 6 + i1, 176, 14, 25, 7); + if (this.container.tileEntity.getTankAmount() > 0) { + IHLRenderUtils.instance.renderIHLFluidTank(this.container.tileEntity.getFluidTank(), 82, 10, 94, + 67, zLevel, par1, par2, xOffset, yOffset); + } + setpointTextField.drawTextBox(); + IHLRenderUtils.instance.drawTooltip(par1,par2,9,11,xOffset,yOffset,StatCollector.translateToLocal("ihl.dosingPump.tip")); + } + + @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(background); + int x = (width - xSize) / 2; + int y = (height - ySize) / 2; + this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); + } + + @Override + protected void keyTyped(char characterTyped, int keyIndex) { + super.keyTyped(characterTyped, keyIndex); + this.setpointTextField.textboxKeyTyped(characterTyped, keyIndex); + // 28 - enter; 156 - numpad enter + if (keyIndex == KeyEvent.VK_ACCEPT || keyIndex == KeyEvent.VK_ENTER || keyIndex == 28 || keyIndex == 156) { + int fluidAmountSetpoint = (short) Math.max(1, + Math.min(this.container.tileEntity.getFluidTank().getCapacity(), + IHLUtils.parseIntSafe(this.setpointTextField.getText(), 100))); + this.setpointTextField.setText(Integer.toString(fluidAmountSetpoint)); + this.setpointTextField.setFocused(false); + ((ClientProxy)IHLMod.proxy).sendIntegerFieldValueFromClientToServer(fluidAmountSetpoint, "fluidAmountSetpoint", this.container.tileEntity); + } + } + @Override + public void mouseClicked(int mouseX, int mouseY, int mouseButton) { + super.mouseClicked(mouseX, mouseY, mouseButton); + int x = (width - xSize) / 2; + int y = (height - ySize) / 2; + if (mouseX >= x + setpointTextField.xPosition && + mouseX <= x + setpointTextField.xPosition + setpointTextField.width && + mouseY >= y + setpointTextField.yPosition && + mouseY <= y + setpointTextField.yPosition + setpointTextField.height) { + setpointTextField.setFocused(true); + } + } + + +} \ No newline at end of file diff --git a/src/main/java/ihl/processing/chemistry/DosingPumpTileEntity.java b/src/main/java/ihl/processing/chemistry/DosingPumpTileEntity.java new file mode 100644 index 0000000..e1e4996 --- /dev/null +++ b/src/main/java/ihl/processing/chemistry/DosingPumpTileEntity.java @@ -0,0 +1,226 @@ +package ihl.processing.chemistry; + +import java.util.List; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ic2.core.ContainerBase; +import ic2.core.IC2; +import ic2.core.block.invslot.InvSlot; +import ic2.core.block.invslot.InvSlotConsumableLiquid; +import ic2.core.block.invslot.InvSlotOutput; +import ihl.processing.invslots.InvSlotConsumableLiquidIHL; +import ihl.processing.metallurgy.BasicElectricMotorTileEntity; +import ihl.utils.IHLFluidTank; +import ihl.utils.IHLUtils; +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; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidHandler; + +public class DosingPumpTileEntity extends BasicElectricMotorTileEntity implements IFluidHandler { + public final InvSlotConsumableLiquidIHL drainInputSlot; + public final InvSlotConsumableLiquidIHL fillInputSlot; + public final InvSlotOutput emptyFluidItemsSlot; + private final IHLFluidTank fluidTank = new IHLFluidTank(8000); + public int fluidAmountSetpoint = 8000; + private boolean prevIsPowered = false; + private boolean tickFree=false; + + public DosingPumpTileEntity() { + super(); + 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); + } + + @Override + public void readFromNBT(NBTTagCompound nbttagcompound) { + super.readFromNBT(nbttagcompound); + this.fluidTank.readFromNBT(nbttagcompound.getCompoundTag("fluidTank")); + this.fluidAmountSetpoint = nbttagcompound.getInteger("fluidAmountSetpoint"); + } + + @Override + public void writeToNBT(NBTTagCompound nbttagcompound) { + super.writeToNBT(nbttagcompound); + NBTTagCompound fluidTankTag = new NBTTagCompound(); + this.fluidTank.writeToNBT(fluidTankTag); + nbttagcompound.setTag("fluidTank", fluidTankTag); + nbttagcompound.setInteger("fluidAmountSetpoint", this.fluidAmountSetpoint); + } + + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { + return this.getFacing() != side; + } + + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { + return IHLUtils.getThisModItemStack("dosingPump"); + } + + @Override + public boolean enableUpdateEntity() { + return IC2.platform.isSimulating(); + } + + @Override + public void updateEntityServer() { + super.updateEntityServer(); + this.tickFree = true; + IHLUtils.handleFluidSlotsBehaviour(fillInputSlot, drainInputSlot, emptyFluidItemsSlot, fluidTank); + } + + @Override + public FluidStack drain(ForgeDirection from, int amount, boolean doDrain) { + switch (from) { + case UP: + return this.fluidTank.drainLightest(amount, doDrain); + case NORTH: + return this.fluidTank.drainLightest(amount, doDrain); + case SOUTH: + return this.fluidTank.drainLightest(amount, doDrain); + case WEST: + return this.fluidTank.drainLightest(amount, doDrain); + case EAST: + return this.fluidTank.drainLightest(amount, doDrain); + case DOWN: + return this.fluidTank.drain(amount, doDrain); + default: + return this.fluidTank.drain(amount, doDrain); + } + } + + // 1.7.10 API + @Override + public boolean canDrain(ForgeDirection arg0, Fluid arg1) { + return true; + } + + @Override + public boolean canFill(ForgeDirection direction, Fluid arg1) { + return !direction.equals(ForgeDirection.getOrientation(this.getFacing())); + } + + @Override + public String getInventoryName() { + return "dosingPump"; + } + + public float getRenderLiquidLevel() { + return (float) this.fluidTank.getFluidAmount() / (float) this.fluidTank.getCapacity(); + } + + @Override + public int gaugeProgressScaled(int i) { + return this.progress * i / operationLength; + } + + @Override + @SideOnly(Side.CLIENT) + public GuiScreen getGui(EntityPlayer player, boolean arg1) { + return new DosingPumpGui(new DosingPumpContainer(player, this)); + } + + @Override + public ContainerBase getGuiContainer(EntityPlayer player) { + this.fluidTank.sortFluidsByDensity(); + return new DosingPumpContainer(player, this); + } + + @Override + public void onGuiClosed(EntityPlayer player) { + } + + @Override + public boolean canOperate() { + return false; + } + + @Override + public void operate() { + int fluidAmountToDrain = fluidAmountSetpoint; + ForgeDirection dir = ForgeDirection.getOrientation(this.getFacing()); + TileEntity te = worldObj.getTileEntity(xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ); + if (te instanceof IFluidHandler) { + IFluidHandler fhte = (IFluidHandler) te; + for (int i = 0; i < this.fluidTank.getNumberOfFluids(); i++) { + FluidStack drained = this.fluidTank.drain(fluidAmountToDrain, true); + fluidAmountToDrain -= drained.amount; + if (fhte.canFill(dir, drained.getFluid())) { + fhte.fill(dir, drained, true); + } + if (fluidAmountToDrain <= 0) { + break; + } + } + } + this.energy-=this.energyConsume/10; + } + + @Override + public FluidStack drain(ForgeDirection arg0, FluidStack fluidStack, boolean doDrain) { + if (fluidTank.getFluid() != null && fluidTank.getFluid().containsFluid(fluidStack)) { + return this.fluidTank.drain(fluidStack, doDrain); + } + return null; + } + + @Override + public int fill(ForgeDirection arg0, FluidStack arg1, boolean arg2) { + return this.fluidTank.fill(arg1, arg2); + } + + @Override + public FluidTankInfo[] getTankInfo(ForgeDirection arg0) { + return new FluidTankInfo[] { this.fluidTank.getInfo() }; + } + + public boolean needsFluid() { + return this.fluidTank.getFluidAmount() <= this.fluidTank.getCapacity(); + } + + public FluidStack getFluidStackfromTank() { + return this.fluidTank.getFluid(); + } + + public int getTankAmount() { + return this.fluidTank.getFluidAmount(); + } + + public int gaugeLiquidScaled(int i, int index) { + return this.fluidTank.getFluidAmount() <= 0 ? 0 + : this.fluidTank.getFluidAmount(index) * i / this.fluidTank.getCapacity(); + } + + public int getNumberOfFluidsInTank() { + return this.fluidTank.getNumberOfFluids(); + } + + public IHLFluidTank getFluidTank() { + return this.fluidTank; + } + + @Override + public List[] getInput() { + return null; + } + + public void setPowered(boolean isPowered) { + if (isPowered && !prevIsPowered && this.energy > 0 && this.tickFree) { + this.operate(); + } + prevIsPowered = isPowered; + this.tickFree = false; // Only one operation per tick max + } + +} \ No newline at end of file diff --git a/src/main/java/ihl/processing/chemistry/ElectricEvaporatorBlock.java b/src/main/java/ihl/processing/chemistry/ElectricEvaporatorBlock.java new file mode 100644 index 0000000..f65b76d --- /dev/null +++ b/src/main/java/ihl/processing/chemistry/ElectricEvaporatorBlock.java @@ -0,0 +1,220 @@ +package ihl.processing.chemistry; + +import java.util.Random; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ihl.IHLCreativeTab; +import ihl.IHLModInfo; +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.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class ElectricEvaporatorBlock extends Block implements ITileEntityProvider{ + + IIcon textureFrontActive, textureSide, textureBottom, textureTop; + + public ElectricEvaporatorBlock(Material material) + { + super(material); + this.setCreativeTab(IHLCreativeTab.tab); + } + + @Override + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) + { + return new ItemStack(Blocks.furnace,1).getItem(); + } + + @Override + public void dropBlockAsItemWithChance(World world, int x, int y, int z, int meta, float chance, int flag) + { + ItemStack result = new ItemStack(Blocks.furnace,1); + this.dropBlockAsItem(world, x, y, z, result); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) { + return new ElectricEvaporatorTileEntity(); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister par1IconRegister) + { + this.blockIcon = par1IconRegister.registerIcon(IHLModInfo.MODID + ":electricEvaporatorFront"); + this.textureFrontActive = par1IconRegister.registerIcon(IHLModInfo.MODID + ":electricEvaporatorFrontActive"); + this.textureSide = par1IconRegister.registerIcon(IHLModInfo.MODID + ":electricEvaporatorSide"); + this.textureTop = par1IconRegister.registerIcon(IHLModInfo.MODID + ":electricEvaporatorTop"); + this.textureBottom = par1IconRegister.registerIcon(IHLModInfo.MODID + ":electricEvaporatorBottom"); + } + + @Override + public boolean hasTileEntity(int metadata) + { + return true; + } + + @Override + public boolean onBlockActivated(World world,int x,int y,int z,EntityPlayer entityPlayer,int i,float pos_x,float pos_y,float pos_z){ + TileEntity te = world.getTileEntity(x,y,z); + if(te instanceof ElectricEvaporatorTileEntity) + { + ElectricEvaporatorTileEntity bte = (ElectricEvaporatorTileEntity)te; + if (bte == null || entityPlayer.isSneaking()) { + return false; + } + else + { + return bte.getGui(entityPlayer); + } + } + 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) + { + int var7 = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; + TileEntity t = world.getTileEntity(x, y, z); + if(t!=null && t instanceof ElectricEvaporatorTileEntity) + { + ElectricEvaporatorTileEntity te = (ElectricEvaporatorTileEntity)t; + if(player.isSneaking()) + { + switch(var7) + { + case 0: + te.setFacing((short) 3); + break; + case 1: + te.setFacing((short) 4); + break; + case 2: + te.setFacing((short) 2); + break; + case 3: + te.setFacing((short) 5); + break; + default: + break; + } + } + else + { + switch(var7) + { + case 0: + te.setFacing((short) 2); + break; + case 1: + te.setFacing((short) 5); + break; + case 2: + te.setFacing((short) 3); + break; + case 3: + te.setFacing((short) 4); + break; + default: + break; + } + } + } + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) + { + IIcon faceIcon=this.blockIcon; + 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!=null) + { + ElectricEvaporatorTileEntity tebh = (ElectricEvaporatorTileEntity) te; + facing=tebh.getFacing(); + if(tebh.getActive()) + { + faceIcon=this.textureFrontActive; + } + } + + switch (mask[facing*6+side]) + { + case 0: + return faceIcon; + case 1: + return this.textureSide; + case 2: + return this.textureBottom; + case 3: + return this.textureTop; + case 4: + return this.textureSide; + case 5: + return this.textureSide; + default: + return this.textureSide; + } + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + switch (side) + { + case 0: + return this.textureBottom; + case 1: + return this.textureTop; + case 2: + return this.textureSide; + case 3: + return this.blockIcon; + case 4: + return this.textureSide; + case 5: + return this.textureSide; + default: + return this.textureSide; + } + } + + @Override + public void randomDisplayTick(World world, int x, int y, int z, Random random) + { + TileEntity te = world.getTileEntity(x, y, z); + if(te instanceof ElectricEvaporatorTileEntity) + { + ElectricEvaporatorTileEntity ete = (ElectricEvaporatorTileEntity) te; + if(ete.getActive()) + { + world.spawnParticle("snowshovel", x+0.2D, y+1.2D, z+0.2D, 0D, 0.05D, 0D); + } + } + } +} diff --git a/src/main/java/ihl/processing/chemistry/ElectricEvaporatorContainer.java b/src/main/java/ihl/processing/chemistry/ElectricEvaporatorContainer.java new file mode 100644 index 0000000..d981d94 --- /dev/null +++ b/src/main/java/ihl/processing/chemistry/ElectricEvaporatorContainer.java @@ -0,0 +1,113 @@ +package ihl.processing.chemistry; + +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; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; + +public class ElectricEvaporatorContainer extends ContainerBase { + + protected ElectricEvaporatorTileEntity tileEntity; + public int lastFluidAmount = -1; + public double lastEnergy = -1; + public short lastProgress = -1; + private final static int height=166; + + public ElectricEvaporatorContainer(EntityPlayer entityPlayer, ElectricEvaporatorTileEntity electricEvaporatorTileEntity){ + super(electricEvaporatorTileEntity); + this.tileEntity = electricEvaporatorTileEntity; + 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(electricEvaporatorTileEntity.fuelSlot, 0, 8, 32)); + this.addSlotToContainer(new SlotInvSlot(electricEvaporatorTileEntity.fluidItemsSlot, 0, 44, 14)); + this.addSlotToContainer(new SlotInvSlot(electricEvaporatorTileEntity.emptyFluidItemsSlot, 0, 44, 32)); + this.addSlotToContainer(new SlotInvSlot(electricEvaporatorTileEntity.fillItemsSlot, 0, 44, 50)); + this.addSlotToContainer(new SlotInvSlot(electricEvaporatorTileEntity.outputSlot, 0, 117, 32)); + for(int row=0;row<=3;row++) + { + this.addSlotToContainer(new SlotInvSlot(tileEntity.upgradeSlot, row, 152, 8+row*18)); + } + + } + + @Override + public void detectAndSendChanges() + { + super.detectAndSendChanges(); + for (int i = 0; i < this.crafters.size(); ++i) + { + ICrafting icrafting = (ICrafting)this.crafters.get(i); + + if (this.tileEntity.getFluidTank().getFluid()!=null && this.tileEntity.getFluidTank().getFluidAmount() != this.lastFluidAmount) + { + icrafting.sendProgressBarUpdate(this, 0, this.tileEntity.getFluidTank().getFluid().getFluid().getID()); + icrafting.sendProgressBarUpdate(this, 1, this.tileEntity.getFluidTank().getFluidAmount()); + } + + if (this.tileEntity.getEnergy() != this.lastEnergy) + { + icrafting.sendProgressBarUpdate(this, 2, ((int)this.tileEntity.getEnergy()>>15) & Short.MAX_VALUE); + icrafting.sendProgressBarUpdate(this, 3, (short)((int)this.tileEntity.getEnergy() & Short.MAX_VALUE)); + } + + if (this.tileEntity.progress != this.lastProgress) + { + icrafting.sendProgressBarUpdate(this, 4, this.tileEntity.progress); + icrafting.sendProgressBarUpdate(this, 5, this.tileEntity.maxProgress); + } + } + + this.lastFluidAmount = this.tileEntity.getFluidTank().getFluidAmount(); + this.lastEnergy = this.tileEntity.getEnergy(); + this.lastProgress = this.tileEntity.progress; + } + + @Override + public void updateProgressBar(int index, int value) + { + super.updateProgressBar(index, value); + + switch (index) + { + case 0: + this.tileEntity.getFluidTank().setFluid(new FluidStack(FluidRegistry.getFluid(value), 1000)); + break; + case 1: + this.tileEntity.getFluidTank().setFluid(new FluidStack(this.tileEntity.getFluidTank().getFluid().getFluid(), value)); + break; + case 2: + this.tileEntity.setEnergy(value<<15); + break; + case 3: + this.tileEntity.setEnergy(this.tileEntity.getEnergy()+value); + break; + case 4: + this.tileEntity.progress=(short) value; + break; + case 5: + this.tileEntity.maxProgress=(short) value; + break; + } + } + + @Override + public boolean canInteractWith(EntityPlayer var1) { + return tileEntity.isUseableByPlayer(var1); + } +} diff --git a/src/main/java/ihl/processing/chemistry/ElectricEvaporatorGui.java b/src/main/java/ihl/processing/chemistry/ElectricEvaporatorGui.java new file mode 100644 index 0000000..4a36631 --- /dev/null +++ b/src/main/java/ihl/processing/chemistry/ElectricEvaporatorGui.java @@ -0,0 +1,85 @@ +package ihl.processing.chemistry; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ic2.core.util.DrawUtil; +import ic2.core.util.GuiTooltipHelper; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; + +@SideOnly(Side.CLIENT) +public class ElectricEvaporatorGui extends GuiContainer { + private static final ResourceLocation background = new ResourceLocation("ihl", "textures/gui/GUIElectricEvaporator.png"); + private ElectricEvaporatorContainer container; + private String title = StatCollector.translateToLocal("ihl.gui.electricEvaporator"); + + public ElectricEvaporatorGui (ElectricEvaporatorContainer electricEvaporatorContainer) { + //the container is instanciated and passed to the superclass for handling + super(electricEvaporatorContainer); + this.container=electricEvaporatorContainer; + } + + @Override + protected void drawGuiContainerForegroundLayer(int par1, int par2) { + int xOffset = (this.width - xSize) / 2; + int yOffset = (this.height - ySize) / 2; + fontRendererObj.drawString(title, 8, 70, 6171880); + 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(9, 15 + 12 - i1, 176, 12 - i1, 14, i1 + 2); + } + if (this.container.tileEntity.progress > 0) + { + i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(18),18); + this.drawTexturedModalRect(99, 34, 198, 0, i1 + 1, 13); + } + + if (this.container.tileEntity.getFluidTank().getFluid()!=null && this.container.tileEntity.getFluidTank().getFluidAmount() > 0) + { + FluidStack fluidStack = this.container.tileEntity.getFluidTank().getFluid(); + if(fluidStack!=null) + { + Fluid fluid = fluidStack.getFluid(); + if(fluid!=null) + { + + IIcon fluidIcon = fluid.getIcon(); + + if (fluidIcon != null) + { + this.mc.renderEngine.bindTexture(TextureMap.locationBlocksTexture); + int liquidHeight = this.container.tileEntity.gaugeLiquidScaled(47); + + DrawUtil.drawRepeated(fluidIcon, (82), 16 + 47 - liquidHeight, 12.0D, liquidHeight, this.zLevel); + this.mc.renderEngine.bindTexture(background); + } + } + String tooltip = StatCollector.translateToLocal(fluidStack.getFluid().getUnlocalizedName()) + ": " + fluidStack.amount + "mB"; + //GuiTooltiphelper.drawAreaTooltip(par1-90, par2-32, tooltip, xOffset+64, yOffset+23, xOffset+74, yOffset+71); + GuiTooltipHelper.drawAreaTooltip(par1-90, par2-32, tooltip, xOffset-8, yOffset-15, xOffset+2, yOffset+30); + } + } + } + + @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(background); + int x = (width - xSize) / 2; + int y = (height - ySize) / 2; + this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); + } +} \ No newline at end of file diff --git a/src/main/java/ihl/processing/chemistry/ElectricEvaporatorTileEntity.java b/src/main/java/ihl/processing/chemistry/ElectricEvaporatorTileEntity.java new file mode 100644 index 0000000..cdf3524 --- /dev/null +++ b/src/main/java/ihl/processing/chemistry/ElectricEvaporatorTileEntity.java @@ -0,0 +1,430 @@ +package ihl.processing.chemistry; + +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 ic2.api.energy.event.EnergyTileLoadEvent; +import ic2.api.energy.event.EnergyTileUnloadEvent; +import ic2.api.energy.tile.IEnergySink; +import ic2.api.item.IC2Items; +import ic2.api.network.INetworkTileEntityEventListener; +import ic2.core.ContainerBase; +import ic2.core.IC2; +import ic2.core.IHasGui; +import ic2.core.audio.AudioSource; +import ic2.core.block.invslot.InvSlot; +import ic2.core.block.invslot.InvSlot.Access; +import ic2.core.block.invslot.InvSlotUpgrade; +import ic2.core.upgrade.IUpgradableBlock; +import ic2.core.upgrade.IUpgradeItem; +import ic2.core.upgrade.UpgradableProperty; +import ihl.IHLMod; +import ihl.utils.IHLInvSlotDischarge; +import ihl.utils.IHLUtils; +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.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.util.ForgeDirection; + +public class ElectricEvaporatorTileEntity extends EvaporatorTileEntity implements IEnergySink, IUpgradableBlock, INetworkTileEntityEventListener +{ + public final InvSlotUpgrade upgradeSlot; + private int tier; + public int maxStorage; + private int defaultMaxStorage; + private double energy; + public final int defaultEnergyConsume; + public final int defaultOperationLength; + public final int defaultTier; + public int energyConsume; + public AudioSource audioSource; + private int updateChecksum=0; + private boolean addedToEnergyNet=false; + + public ElectricEvaporatorTileEntity() + { + super(); + this.defaultEnergyConsume = this.energyConsume = 8; + this.defaultOperationLength = this.maxProgress = 400; + this.energy=0D; + 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); + } + + @Override + public void onLoaded() + { + super.onLoaded(); + if (IC2.platform.isSimulating()&&!this.addedToEnergyNet) + { + MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this)); + this.addedToEnergyNet = true; + } + } + + @Override + public List getNetworkedFields() + { + List fields = super.getNetworkedFields(); + fields.add("tier"); + fields.add("maxStorage"); + return fields; + } + + public void setOverclockRates() + { + int speedUp=0; + int tierUp=0; + int capacityUp=0; + int checksum=0; + for(int i=0;i 1.0D) + { + double amount = ((IHLInvSlotDischarge)this.fuelSlot).discharge(this.getDemandedEnergy(), false); + this.energy += amount; + } + if (this.needsFluid()) + { + IHLUtils.handleFluidSlotsBehaviour(null, fluidItemsSlot, emptyFluidItemsSlot, fluidTank); + } + + if (this.canOperate() && this.energy >= this.energyConsume) + { + this.setActive(true); + + if (this.progress == 0) + { + IC2.network.get().initiateTileEntityEvent(this, 0, true); + } + ++this.progress; + this.energy -= this.energyConsume; + if (this.progress >= this.maxProgress) + { + 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); + } + for (int i = 0; i < this.upgradeSlot.size(); ++i) + { + ItemStack stack = this.upgradeSlot.get(i); + + if (stack != null && stack.getItem() instanceof IUpgradeItem) + { + ((IUpgradeItem)stack.getItem()).onTick(stack, this); + } + } + } + } + + @Override + public void onNetworkEvent(int event) + { + if (this.audioSource == null && this.getStartSoundFile() != null) + { + this.audioSource = IC2.audioManager.createSource(this, this.getStartSoundFile()); + } + + switch (event) + { + case 0: + if (this.audioSource != null) + { + this.audioSource.play(); + } + + break; + + case 1: + if (this.audioSource != null) + { + this.audioSource.stop(); + } + + break; + + case 2: + if (this.audioSource != null) + { + this.audioSource.stop(); + } + + } + } + + public String getStartSoundFile() + { + return "Machines/Electro Furnace/ElectroFurnaceLoop.ogg"; + } + + /** + * Returns the name of the inventory + */ + @Override + public String getInventoryName() + { + return "Electric evaporator"; + } + + @Override + public ContainerBase getGuiContainer(EntityPlayer entityPlayer) + { + return new ElectricEvaporatorContainer(entityPlayer, this); + } + + @Override + @SideOnly(Side.CLIENT) + public GuiScreen getGui(EntityPlayer entityPlayer, boolean isAdmin) + { + return new ElectricEvaporatorGui(new ElectricEvaporatorContainer(entityPlayer, this)); + } + + @Override + public boolean getGui(EntityPlayer player) + { + return this instanceof IHasGui ? (IC2.platform.isSimulating() ? IC2.platform.launchGui(player, this) : true) : false; + } + + @Override + public int mX() + { + switch(this.getFacing()) + { + case 4: + return -1; + case 5: + return 1; + default: + return 0; + } + } + + @Override + public int mZ() + { + switch(this.getFacing()) + { + case 2: + return -1; + case 3: + return 1; + default: + return 0; + } + } + + @Override + public double getEnergy() + { + return this.energy; + } + + @Override + public boolean useEnergy(double amount) { + if (this.energy >= amount) + { + this.energy -= amount; + return true; + } + else + { + return false; + } + } + + public void setEnergy(double i) { + this.energy=i; + } + + @Override + public double getDemandedEnergy() + { + return this.maxStorage - this.energy; + } + + @Override + public int getSinkTier() + { + return this.tier; + } + + @Override + public double injectEnergy(ForgeDirection directionFrom, double amount, double voltage) + { + if (this.energy >= this.maxStorage) + { + return amount; + } + else + { + this.energy += amount; + return 0.0D; + } + } + + @Override + public boolean acceptsEnergyFrom(TileEntity emitter, + ForgeDirection direction) { + return true; + } + + public ItemStack getOutput(int arg0) + { + return this.outputSlot.get(arg0); + } + + public int getOutputSize() { + return this.outputSlot.size(); + } + + public void setOutput(int arg0, ItemStack arg1) + { + this.outputSlot.put(arg0, arg1); + } + + @Override + public Set getUpgradableProperties() + { + Set properties = new HashSet(); + properties.add(UpgradableProperty.ItemProducing); + properties.add(UpgradableProperty.EnergyStorage); + properties.add(UpgradableProperty.Transformer); + return properties; + } +} \ No newline at end of file diff --git a/src/main/java/ihl/processing/chemistry/ElectrolysisBathContainer.java b/src/main/java/ihl/processing/chemistry/ElectrolysisBathContainer.java new file mode 100644 index 0000000..13a5ddb --- /dev/null +++ b/src/main/java/ihl/processing/chemistry/ElectrolysisBathContainer.java @@ -0,0 +1,79 @@ +package ihl.processing.chemistry; + +import java.util.List; + +import ic2.core.ContainerBase; +import ic2.core.IC2; +import ic2.core.slot.SlotInvSlot; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.Slot; +import net.minecraftforge.fluids.FluidStack; + +public class ElectrolysisBathContainer extends ContainerBase { + + protected ElectrolysisBathTileEntity tileEntity; + public int lastFluidAmount = -1; + public int lastNumberOfFluids = -1; + public short lastProgress = -1; + public short lastTemperature = -1; + private final static int height = 166; + public List fluidTankFluidList; + public int fluidListHash = -1; + + public ElectrolysisBathContainer(EntityPlayer entityPlayer, ElectrolysisBathTileEntity tileEntity1) { + super(tileEntity1); + this.tileEntity = tileEntity1; + fluidTankFluidList = this.tileEntity.getFluidTank().getFluidList(); + 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.fillInputSlot, 0, 6, 52)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.drainInputSlot, 0, 6, 16)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.emptyFluidItemsSlot, 0, 6, 33)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.input, 0, 98, 16)); + } + + @Override + public void detectAndSendChanges() { + super.detectAndSendChanges(); + for (int i = 0; i < this.crafters.size(); ++i) { + ICrafting icrafting = (ICrafting) this.crafters.get(i); + if (this.fluidListHash != fluidTankFluidList.hashCode()) { + IC2.network.get().sendContainerField(this, "fluidTankFluidList"); + this.fluidListHash = fluidTankFluidList.hashCode(); + } + + if (this.tileEntity.progress != this.lastProgress) { + icrafting.sendProgressBarUpdate(this, 0, this.tileEntity.progress); + } + + } + + this.lastNumberOfFluids = this.tileEntity.getNumberOfFluidsInTank(); + this.lastFluidAmount = this.tileEntity.getTankAmount(); + this.lastProgress = this.tileEntity.progress; + } + + @Override + public void updateProgressBar(int index, int value) { + super.updateProgressBar(index, value); + switch (index) { + case 0: + this.tileEntity.progress = (short) value; + break; + } + } + + @Override + public boolean canInteractWith(EntityPlayer var1) { + return tileEntity.isUseableByPlayer(var1); + } +} diff --git a/src/main/java/ihl/processing/chemistry/ElectrolysisBathGui.java b/src/main/java/ihl/processing/chemistry/ElectrolysisBathGui.java new file mode 100644 index 0000000..404ef94 --- /dev/null +++ b/src/main/java/ihl/processing/chemistry/ElectrolysisBathGui.java @@ -0,0 +1,100 @@ +package ihl.processing.chemistry; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ic2.core.IC2; +import ihl.utils.GuiMultiTextureButton; +import ihl.utils.IHLRenderUtils; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.util.ResourceLocation; + +@SideOnly(Side.CLIENT) +public class ElectrolysisBathGui extends GuiContainer { + private static final ResourceLocation background = new ResourceLocation("ihl", "textures/gui/GUIElectrolysisBath.png"); + private ElectrolysisBathContainer container; + private GuiMultiTextureButton button1; + private int timer=10; + + public ElectrolysisBathGui (ElectrolysisBathContainer container1) { + //the container is instanciated and passed to the superclass for handling + super(container1); + this.container=container1; + } + + @SuppressWarnings("unchecked") + @Override + public void initGui() + { + super.initGui(); + int x = (width - xSize) / 2; + int y = (height - ySize) / 2; + button1=new GuiMultiTextureButton(0, x+97, y+58, 18, 18, background,97,58,238,238); + this.buttonList.add(button1); + } + + @Override + public void actionPerformed(GuiButton button) + { + super.actionPerformed(button); + IC2.network.get().initiateClientTileEntityEvent(this.container.tileEntity, button.id); + if (button.id == 0) + { + button1.isActive=true; + timer=10; + } + } + + @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.progress > 0) + { + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(27),27); + this.drawTexturedModalRect(121, 33, getFrameX(i1), getFrameY(i1),24,24); + } + if (this.container.tileEntity.getTankAmount() > 0) + { + IHLRenderUtils.instance.renderIHLFluidTank(this.container.tileEntity.getFluidTank(), 32, 11, 89, 72, zLevel, par1, par2, xOffset, yOffset); + } + this.mc.renderEngine.bindTexture(background); + this.drawTexturedModalRect(60, 3, 252, 0,4,48); + } + + @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(background); + int x = (width - xSize) / 2; + int y = (height - ySize) / 2; + this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); + if(timer>0) + { + timer--; + } + if(timer==1) + { + button1.isActive=false; + } + } + + private int getFrameY(int number) + { + return (number % 10) * 24 + 14; + } + + private int getFrameX(int number) + { + return (number / 10) * 24 + 176; + } +} \ No newline at end of file diff --git a/src/main/java/ihl/processing/chemistry/ElectrolysisBathModel.java b/src/main/java/ihl/processing/chemistry/ElectrolysisBathModel.java new file mode 100644 index 0000000..310ec62 --- /dev/null +++ b/src/main/java/ihl/processing/chemistry/ElectrolysisBathModel.java @@ -0,0 +1,86 @@ +package ihl.processing.chemistry; + +// Date: 12.04.2015 13:06:31 +// Template version 1.1 +// Java generated by Techne +// Keep in mind that you still need to fill in some blanks +// - ZeuX + + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; + +public class ElectrolysisBathModel extends ModelBase +{ + //fields + ModelRenderer Piece1; + ModelRenderer FrontPylone; + ModelRenderer BackPylone; + ModelRenderer LeftPylone; + ModelRenderer RightPylone; + + public ElectrolysisBathModel() + { + textureWidth = 64; + textureHeight = 128; + setTextureOffset("Piece1.Stick01", 48, 4); + setTextureOffset("Piece1.Shape1", 16, 18); + setTextureOffset("Piece1.Body04", 0, 48); + setTextureOffset("Piece1.Shape2", 0, 18); + setTextureOffset("Piece1.Shape3", 16, 0); + setTextureOffset("Piece1.Shape4", 0, 0); + setTextureOffset("Piece1.Box01", 41, 18); + setTextureOffset("Piece1.Shape5", 23, 84); + setTextureOffset("Piece1.Shape6", 23, 84); + setTextureOffset("Piece1.Shape7", 23, 84); + setTextureOffset("Piece1.Shape8", 23, 83); + setTextureOffset("FrontPylone.Shape9", 23, 84); + setTextureOffset("BackPylone.Shape10", 23, 84); + setTextureOffset("LeftPylone.Shape12", 23, 84); + setTextureOffset("RightPylone.Shape11", 23, 82); + + Piece1 = new ModelRenderer(this, "Piece1"); + Piece1.setRotationPoint(0F, 16F, 0F); + setRotation(Piece1, 0F, 0F, 0F); + Piece1.mirror = false; + Piece1.addBox("Stick01", -1F, -16F, -1F, 2, 9, 2); + Piece1.addBox("Shape1", -8F, -8F, -8F, 2, 16, 14); + Piece1.addBox("Body04", -6F, -7F, -6F, 12, 15, 12); + Piece1.addBox("Shape2", 6F, -8F, -6F, 2, 16, 14); + Piece1.addBox("Shape3", -6F, -8F, -8F, 14, 16, 2); + Piece1.addBox("Shape4", -8F, -8F, 6F, 14, 16, 2); + Piece1.addBox("Box01", -2F, -13F, -2F, 4, 2, 4); + Piece1.addBox("Shape5", 5F, -9F, -1.5F, 2, 2, 3); + Piece1.addBox("Shape6", -7F, -9F, -1.5F, 2, 2, 3); + Piece1.addBox("Shape7", -1.5F, -9F, 5F, 3, 2, 2); + Piece1.addBox("Shape8", -1.5F, -9F, -7F, 3, 2, 2); + FrontPylone = new ModelRenderer(this, "FrontPylone"); + FrontPylone.setRotationPoint(0F, 7F, -5F); + setRotation(FrontPylone, -0.9F, 0F, 0); + FrontPylone.mirror = true; + FrontPylone.addBox("Shape9", -1F, -5F, -1F, 2, 6, 1); + BackPylone = new ModelRenderer(this, "BackPylone"); + BackPylone.setRotationPoint(0F, 7F, 5F); + setRotation(BackPylone, 0.9F, 0F, 0F); + BackPylone.mirror = true; + BackPylone.addBox("Shape10", -1F, -5F, 0F, 2, 6, 1); + LeftPylone = new ModelRenderer(this, "LeftPylone"); + LeftPylone.setRotationPoint(5F, 7F, 0F); + setRotation(LeftPylone, 0F, 0F, -0.9F); + LeftPylone.mirror = true; + LeftPylone.addBox("Shape12", 0F, -5F, -1F, 1, 6, 2); + RightPylone = new ModelRenderer(this, "RightPylone"); + RightPylone.setRotationPoint(-5F, 7F, 0F); + setRotation(RightPylone, 0, 0F, 0.9F); + RightPylone.mirror = true; + RightPylone.addBox("Shape11", -1F, -5F, -1F, 1, 6, 2); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + +} diff --git a/src/main/java/ihl/processing/chemistry/ElectrolysisBathTileEntity.java b/src/main/java/ihl/processing/chemistry/ElectrolysisBathTileEntity.java new file mode 100644 index 0000000..ea98a34 --- /dev/null +++ b/src/main/java/ihl/processing/chemistry/ElectrolysisBathTileEntity.java @@ -0,0 +1,297 @@ +package ihl.processing.chemistry; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ic2.api.network.INetworkClientTileEntityEventListener; +import ic2.core.ContainerBase; +import ic2.core.IC2; +import ic2.core.IHasGui; +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 ihl.flexible_cable.FlexibleCableHolderBaseTileEntity; +import ihl.processing.invslots.InvSlotConsumableLiquidIHL; +import ihl.recipes.UniversalRecipeInput; +import ihl.recipes.UniversalRecipeManager; +import ihl.recipes.UniversalRecipeOutput; +import ihl.utils.IHLFluidTank; +import ihl.utils.IHLUtils; +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; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidHandler; + +public class ElectrolysisBathTileEntity extends FlexibleCableHolderBaseTileEntity implements IHasGui, INetworkClientTileEntityEventListener, IFluidHandler +{ + private final static UniversalRecipeManager recipeManager = new UniversalRecipeManager("electrolysisbath"); + public final ApparatusProcessableInvSlot input; + public final InvSlotConsumableLiquidIHL drainInputSlot; + public final InvSlotConsumableLiquidIHL fillInputSlot; + public final InvSlotOutput emptyFluidItemsSlot; + public short progress; + protected short operationLength=20000;//Short.MAX_VALUE=32767 + private final IHLFluidTank fluidTank = new IHLFluidTank(2000); + private final static double resistance=5D; + + public ElectrolysisBathTileEntity() { + super(); + 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.input = new ApparatusProcessableInvSlot(this, "input", 3, Access.IO, 1, 64); + } + + @Override + public void readFromNBT(NBTTagCompound nbttagcompound) + { + super.readFromNBT(nbttagcompound); + this.fluidTank.readFromNBT(nbttagcompound.getCompoundTag("fluidTank")); + } + + @Override + public void writeToNBT(NBTTagCompound nbttagcompound) + { + super.writeToNBT(nbttagcompound); + NBTTagCompound fluidTankTag = new NBTTagCompound(); + this.fluidTank.writeToNBT(fluidTankTag); + nbttagcompound.setTag("fluidTank", fluidTankTag); + } + + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { + return false; + } + + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { + return IHLUtils.getThisModItemStack("electrolysisBath"); + } + + public boolean enableUpdateEntity() + { + return IC2.platform.isSimulating(); + } + + @Override + public void updateEntityServer() + { + super.updateEntityServer(); + IHLUtils.handleFluidSlotsBehaviour(fillInputSlot, drainInputSlot, emptyFluidItemsSlot, fluidTank); + if (this.canOperate()) + { + this.setActive(true); + if (this.progress == 0) + { + IC2.network.get().initiateTileEntityEvent(this, 0, true); + } + if(gridID!=-1 && this.getGrid().energy>0D) + { + double drawEnergy = getEnergyAmountThisNodeWant(); + this.progress+=drawEnergy; + this.getGrid().drawEnergy(drawEnergy, this); + } + + 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 FluidStack drain(ForgeDirection from, int amount, boolean doDrain) + { + FluidStack fstack = this.fluidTank.drain(amount, doDrain); + return fstack; + } + + + //1.7.10 API + @Override + public boolean canDrain(ForgeDirection arg0, Fluid arg1) { + return true; + } + + @Override + public boolean canFill(ForgeDirection direction, Fluid arg1) { + return true; + } + + @Override + public String getInventoryName() { + return "Electrolysis bath"; + } + + @Override + public void onNetworkEvent(EntityPlayer player, int event) + { + TileEntity te = worldObj.getTileEntity(xCoord, yCoord-1, zCoord); + if(te instanceof IFluidHandler && this.fluidTank.getFluid()!=null) + { + IFluidHandler ifhte = (IFluidHandler)te; + if(ifhte.canFill(ForgeDirection.UP, this.fluidTank.getFluid().getFluid())) + { + int filled = ifhte.fill(ForgeDirection.UP, this.fluidTank.drain(this.getTankAmount(), false), true); + this.fluidTank.drain(filled, true); + } + } + } + + public int gaugeProgressScaled(int i) + { + return this.progress * i / operationLength; + } + + @Override + @SideOnly(Side.CLIENT) + public GuiScreen getGui(EntityPlayer player, boolean arg1) { + return new ElectrolysisBathGui(new ElectrolysisBathContainer(player, this)); + } + + @Override + public ContainerBase getGuiContainer(EntityPlayer player) + { + this.fluidTank.sortFluidsByDensity(); + return new ElectrolysisBathContainer(player, this); + } + + @Override + public void onGuiClosed(EntityPlayer player) {} + + public boolean canOperate() + { + return getOutput()!=null; + } + + public UniversalRecipeOutput getOutput() + { + return ElectrolysisBathTileEntity.recipeManager.getOutputFor(this.getInput()); + } + + @SuppressWarnings("rawtypes") + public List[] getInput() + { + for(int i=0;i this.fluidTank.getFluidAmount()) { + UniversalRecipeInput recipeInput = ElectrolysisBathTileEntity.recipeManager.getRecipeInput(getInput()); + UniversalRecipeOutput output1 = getOutput(); + for (int i = 0; i < recipeInput.getItemInputs().size(); i++) { + this.input.consume(recipeInput.getItemInputs().get(i)); + } + this.fluidTank.fill(output1.getFluidOutputs(), true); + } + } + + @Override + public FluidStack drain(ForgeDirection arg0, FluidStack fluidStack, boolean doDrain) { + if(fluidTank.getFluid()!=null && fluidTank.getFluid().containsFluid(fluidStack)) + { + return this.fluidTank.drain(fluidStack, doDrain); + } + return null; + } + + @Override + public int fill(ForgeDirection arg0, FluidStack arg1, boolean arg2) { + return this.fluidTank.fill(arg1, arg2); + } + + @Override + public FluidTankInfo[] getTankInfo(ForgeDirection arg0) { + return new FluidTankInfo[] {this.fluidTank.getInfo()}; + } + + public boolean needsFluid() + { + return this.fluidTank.getFluidAmount() <= this.fluidTank.getCapacity(); + } + + public FluidStack getFluidStackfromTank() + { + return this.fluidTank.getFluid(); + } + + public int getTankAmount() + { + return this.fluidTank.getFluidAmount(); + } + + public int gaugeLiquidScaled(int i, int index) + { + return this.fluidTank.getFluidAmount() <= 0 ? 0 : this.fluidTank.getFluidAmount(index) * i / this.fluidTank.getCapacity(); + } + public static void addRecipe(UniversalRecipeInput input, UniversalRecipeOutput output) + { + recipeManager.addRecipe(input, output); + } + + public int getNumberOfFluidsInTank() + { + return this.fluidTank.getNumberOfFluids(); + } + + public static Map getRecipes() { + return recipeManager.getRecipes(); + } + + public IHLFluidTank getFluidTank() + { + return this.fluidTank; + } + + @Override + public double getMaxAllowableVoltage() + { + return 64000D; + } + + @Override + public double getEnergyAmountThisNodeWant() + { + double voltage = this.getGrid().getSinkVoltage(this); + double energy = voltage*voltage/resistance; + return this.getOutput()!=null?energy>1d?energy:1d:0d; + } + + @Override + public void injectEnergyInThisNode(double amount, double voltage) + { + this.progress+=amount; + } +} \ No newline at end of file diff --git a/src/main/java/ihl/processing/chemistry/EvaporatorBlock.java b/src/main/java/ihl/processing/chemistry/EvaporatorBlock.java new file mode 100644 index 0000000..6994176 --- /dev/null +++ b/src/main/java/ihl/processing/chemistry/EvaporatorBlock.java @@ -0,0 +1,221 @@ +package ihl.processing.chemistry; + +import java.util.Random; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ihl.IHLCreativeTab; +import ihl.IHLModInfo; +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.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class EvaporatorBlock extends Block implements ITileEntityProvider{ + + IIcon textureFrontActive, textureSide, textureBottom, textureTop; + + public EvaporatorBlock(Material material) + { + super(material); + this.setCreativeTab(IHLCreativeTab.tab); + } + + @Override + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) + { + return new ItemStack(Blocks.furnace,1).getItem(); + } + + @Override + public void dropBlockAsItemWithChance(World world, int x, int y, int z, int meta, float chance, int flag) + { + ItemStack result = new ItemStack(Blocks.furnace,1); + this.dropBlockAsItem(world, x, y, z, result); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) { + return new EvaporatorTileEntity(); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister par1IconRegister) + { + this.blockIcon = par1IconRegister.registerIcon(IHLModInfo.MODID + ":solidFuelEvaporatorFront"); + this.textureFrontActive = par1IconRegister.registerIcon(IHLModInfo.MODID + ":solidFuelEvaporatorFrontActive"); + this.textureSide = par1IconRegister.registerIcon(IHLModInfo.MODID + ":solidFuelEvaporatorSide"); + this.textureTop = par1IconRegister.registerIcon(IHLModInfo.MODID + ":solidFuelEvaporatorTop"); + this.textureBottom = par1IconRegister.registerIcon(IHLModInfo.MODID + ":solidFuelEvaporatorBottom"); + } + + @Override + public boolean hasTileEntity(int metadata) + { + return true; + } + + @Override + public boolean onBlockActivated(World world,int x,int y,int z,EntityPlayer entityPlayer,int i,float pos_x,float pos_y,float pos_z){ + TileEntity te = world.getTileEntity(x,y,z); + if(te instanceof EvaporatorTileEntity) + { + EvaporatorTileEntity bte = (EvaporatorTileEntity)te; + if (bte == null || entityPlayer.isSneaking()) { + return false; + } + else + { + return bte.getGui(entityPlayer); + } + } + 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) + { + int var7 = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; + TileEntity t = world.getTileEntity(x, y, z); + if(t!=null && t instanceof EvaporatorTileEntity) + { + EvaporatorTileEntity te = (EvaporatorTileEntity)t; + if(player.isSneaking()) + { + switch(var7) + { + case 0: + te.setFacing((short) 3); + break; + case 1: + te.setFacing((short) 4); + break; + case 2: + te.setFacing((short) 2); + break; + case 3: + te.setFacing((short) 5); + break; + default: + break; + } + } + else + { + switch(var7) + { + case 0: + te.setFacing((short) 2); + break; + case 1: + te.setFacing((short) 5); + break; + case 2: + te.setFacing((short) 3); + break; + case 3: + te.setFacing((short) 4); + break; + default: + break; + } + } + } + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) + { + IIcon faceIcon=this.blockIcon; + 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!=null) + { + EvaporatorTileEntity tebh = (EvaporatorTileEntity) te; + facing=tebh.getFacing(); + if(tebh.getActive()) + { + faceIcon=this.textureFrontActive; + } + } + + switch (mask[facing*6+side]) + { + case 0: + return faceIcon; + case 1: + return this.textureSide; + case 2: + return this.textureBottom; + case 3: + return this.textureTop; + case 4: + return this.textureSide; + case 5: + return this.textureSide; + default: + return this.textureSide; + } + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + switch (side) + { + case 0: + return this.textureTop; + case 1: + return this.textureBottom; + case 2: + return this.textureSide; + case 3: + return this.blockIcon; + case 4: + return this.textureSide; + case 5: + return this.textureSide; + default: + return this.textureSide; + } + } + + @Override + public void randomDisplayTick(World world, int x, int y, int z, Random random) + { + TileEntity te = world.getTileEntity(x, y, z); + if(te instanceof EvaporatorTileEntity) + { + EvaporatorTileEntity ete = (EvaporatorTileEntity) te; + if(ete.getActive()) + { + world.spawnParticle("snowshovel", x+0.2D, y+1.2D, z+0.2D, 0D, 0.05D, 0D); + world.spawnParticle("flame", x+0.5D+ete.mX()*0.5D+(random.nextDouble()*0.4D-0.2D)*ete.mZ(), y+random.nextDouble()*0.25D, z+0.5D+ete.mZ()*0.5D+(random.nextDouble()*0.4D-0.2D)*ete.mX(), 0D, 0.01D, 0D); + } + } + } +} diff --git a/src/main/java/ihl/processing/chemistry/EvaporatorContainer.java b/src/main/java/ihl/processing/chemistry/EvaporatorContainer.java new file mode 100644 index 0000000..cb83269 --- /dev/null +++ b/src/main/java/ihl/processing/chemistry/EvaporatorContainer.java @@ -0,0 +1,100 @@ +package ihl.processing.chemistry; + +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; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; + +public class EvaporatorContainer extends ContainerBase { + + protected EvaporatorTileEntity tileEntity; + public int lastFluidAmount = -1; + public int lastFuel = -1; + public short lastProgress = -1; + private final static int height=166; + + public EvaporatorContainer(EntityPlayer entityPlayer, EvaporatorTileEntity tileEntity1){ + super(tileEntity1); + this.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.fuelSlot, 0, 8, 32)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.fluidItemsSlot, 0, 44, 14)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.emptyFluidItemsSlot, 0, 44, 32)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.fillItemsSlot, 0, 44, 50)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.outputSlot, 0, 117, 32)); + + } + + @Override + public void detectAndSendChanges() + { + super.detectAndSendChanges(); + for (int i = 0; i < this.crafters.size(); ++i) + { + ICrafting icrafting = (ICrafting)this.crafters.get(i); + + if (this.tileEntity.getFluidTank().getFluid()!=null && this.tileEntity.getFluidTank().getFluidAmount() != this.lastFluidAmount) + { + icrafting.sendProgressBarUpdate(this, 0, this.tileEntity.getFluidTank().getFluid().getFluid().getID()); + icrafting.sendProgressBarUpdate(this, 1, this.tileEntity.getFluidTank().getFluidAmount()); + } + + if (this.tileEntity.fuel != this.lastFuel) + { + icrafting.sendProgressBarUpdate(this, 2, this.tileEntity.fuel); + } + + if (this.tileEntity.progress != this.lastProgress) + { + icrafting.sendProgressBarUpdate(this, 3, this.tileEntity.progress); + } + } + + this.lastFluidAmount = this.tileEntity.getFluidTank().getFluidAmount(); + this.lastFuel = this.tileEntity.fuel; + this.lastProgress = this.tileEntity.progress; + } + + @Override + public void updateProgressBar(int index, int value) + { + super.updateProgressBar(index, value); + + switch (index) + { + case 0: + this.tileEntity.getFluidTank().setFluid(new FluidStack(FluidRegistry.getFluid(value), 1000)); + break; + case 1: + this.tileEntity.getFluidTank().setFluid(new FluidStack(this.tileEntity.getFluidTank().getFluid().getFluid(), value)); + break; + case 2: + this.tileEntity.fuel=value; + break; + case 3: + this.tileEntity.progress=(short) value; + break; + } + } + + @Override + public boolean canInteractWith(EntityPlayer var1) { + return tileEntity.isUseableByPlayer(var1); + } +} diff --git a/src/main/java/ihl/processing/chemistry/EvaporatorGui.java b/src/main/java/ihl/processing/chemistry/EvaporatorGui.java new file mode 100644 index 0000000..05f7c31 --- /dev/null +++ b/src/main/java/ihl/processing/chemistry/EvaporatorGui.java @@ -0,0 +1,84 @@ +package ihl.processing.chemistry; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ic2.core.util.DrawUtil; +import ic2.core.util.GuiTooltipHelper; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; + +@SideOnly(Side.CLIENT) +public class EvaporatorGui extends GuiContainer { + private static final ResourceLocation background = new ResourceLocation("ihl", "textures/gui/GUISolidFuelEvaporator.png"); + private EvaporatorContainer container; + private String title = StatCollector.translateToLocal("ihl.gui.evaporator"); + + + public EvaporatorGui (EvaporatorContainer container1) { + //the container is instanciated and passed to the superclass for handling + super(container1); + this.container=container1; + } + + @Override + protected void drawGuiContainerForegroundLayer(int par1, int par2) { + int xOffset = (this.width - xSize) / 2; + int yOffset = (this.height - ySize) / 2; + fontRendererObj.drawString(title, 8, 70, 6171880); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.renderEngine.bindTexture(background); + int i1; + if (this.container.tileEntity.fuel > 0) + { + i1 = Math.min(this.container.tileEntity.gaugeFuelScaled(12),12); + this.drawTexturedModalRect(9, 16 + 12 - i1, 176, 12 - i1, 14, i1 + 2); + } + if (this.container.tileEntity.progress > 0) + { + i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(18),18); + this.drawTexturedModalRect(99, 34, 198, 0, i1 + 1, 13); + } + + if (this.container.tileEntity.getTankAmount() > 0) + { + FluidStack fluidStack = this.container.tileEntity.getFluidTank().getFluid(); + if(fluidStack!=null) + { + Fluid fluid = fluidStack.getFluid(); + if(fluid!=null) + { + + IIcon fluidIcon = fluid.getIcon(); + + if (fluidIcon != null) + { + this.mc.renderEngine.bindTexture(TextureMap.locationBlocksTexture); + int liquidHeight = this.container.tileEntity.gaugeLiquidScaled(47); + DrawUtil.drawRepeated(fluidIcon, (82), 16 + 47 - liquidHeight, 12.0D, liquidHeight, this.zLevel); + this.mc.renderEngine.bindTexture(background); + } + } + String tooltip = StatCollector.translateToLocal(fluidStack.getFluid().getUnlocalizedName()) + ": " + fluidStack.amount + "mB"; + GuiTooltipHelper.drawAreaTooltip(par1-90, par2-32, tooltip, xOffset-8, yOffset-15, xOffset+2, yOffset+30); + } + } + } + + @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(background); + int x = (width - xSize) / 2; + int y = (height - ySize) / 2; + this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); + } +} \ No newline at end of file diff --git a/src/main/java/ihl/processing/chemistry/EvaporatorTileEntity.java b/src/main/java/ihl/processing/chemistry/EvaporatorTileEntity.java new file mode 100644 index 0000000..279fa17 --- /dev/null +++ b/src/main/java/ihl/processing/chemistry/EvaporatorTileEntity.java @@ -0,0 +1,290 @@ +package ihl.processing.chemistry; + +import java.util.Arrays; +import java.util.Map; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ic2.api.item.IC2Items; +import ic2.core.ContainerBase; +import ic2.core.IC2; +import ic2.core.IHasGui; +import ic2.core.block.TileEntityLiquidTankInventory; +import ic2.core.block.invslot.InvSlot; +import ic2.core.block.invslot.InvSlotConsumableFuel; +import ic2.core.block.invslot.InvSlotConsumableLiquid; +import ic2.core.block.invslot.InvSlotOutput; +import ihl.IHLMod; +import ihl.processing.invslots.IHLInvSlotOutput; +import ihl.processing.invslots.InvSlotConsumableLiquidIHL; +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.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; + +public class EvaporatorTileEntity extends TileEntityLiquidTankInventory implements IHasGui +{ + public final IHLInvSlotOutput outputSlot; + public InvSlot fuelSlot; + public final InvSlotConsumableLiquidIHL fluidItemsSlot; + public final InvSlotConsumableLiquidIHL fillItemsSlot; + public final InvSlotOutput emptyFluidItemsSlot; + + public short progress = 0; + public short maxProgress = 450; + public int fuel = 0; + public int maxFuel = 0; + protected static final UniversalRecipeManager recipeManager = new UniversalRecipeManager("evaporator"); + + public EvaporatorTileEntity() + { + super(8); + this.outputSlot = new IHLInvSlotOutput(this, "output", 0, 1); + this.fuelSlot = new InvSlotConsumableFuel(this, "fuel", 1, 1, true); + this.fluidItemsSlot = new InvSlotConsumableLiquidIHL(this, "drainInput", 2, InvSlot.Access.I, 1, InvSlot.InvSide.TOP, InvSlotConsumableLiquid.OpType.Drain); + this.fillItemsSlot = new InvSlotConsumableLiquidIHL(this, "fillInput", 4, InvSlot.Access.I, 1, InvSlot.InvSide.TOP, InvSlotConsumableLiquid.OpType.Fill); + this.emptyFluidItemsSlot = new InvSlotOutput(this, "fluidCellsOutput", 3, 1); + } + + public static void init() + { + addRecipe(new FluidStack(FluidRegistry.getFluid("fluidrubbertreesap"),200), IC2Items.getItem("resin")); + } + + @Override + public void readFromNBT(NBTTagCompound nbttagcompound) + { + super.readFromNBT(nbttagcompound); + + try + { + this.fuel = nbttagcompound.getInteger("fuel"); + } + catch (Throwable var4) + { + this.fuel = nbttagcompound.getShort("fuel"); + } + + try + { + this.maxFuel = nbttagcompound.getInteger("maxFuel"); + } + catch (Throwable var3) + { + this.maxFuel = nbttagcompound.getShort("maxFuel"); + } + + this.progress = nbttagcompound.getShort("progress"); + } + + @Override + public void writeToNBT(NBTTagCompound nbttagcompound) + { + super.writeToNBT(nbttagcompound); + nbttagcompound.setInteger("fuel", this.fuel); + nbttagcompound.setInteger("maxFuel", this.maxFuel); + nbttagcompound.setShort("progress", this.progress); + } + + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { + return this.getFacing()!=(short)side && side!=0 && side!=1; + } + + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { + if(this.outputSlot.get()!=null)this.worldObj.spawnEntityInWorld(new EntityItem(this.worldObj, this.xCoord, this.yCoord+1, this.zCoord, this.outputSlot.get())); + if(this.fuelSlot.get()!=null)this.worldObj.spawnEntityInWorld(new EntityItem(this.worldObj, this.xCoord, this.yCoord+1, this.zCoord, this.fuelSlot.get())); + if(this.emptyFluidItemsSlot.get()!=null)this.worldObj.spawnEntityInWorld(new EntityItem(this.worldObj, this.xCoord, this.yCoord+1, this.zCoord, this.emptyFluidItemsSlot.get())); + return new ItemStack(IHLMod.evaporatorBlock,1); + } + + public int gaugeProgressScaled(int i) + { + return this.progress * i / maxProgress; + } + + public int gaugeFuelScaled(int i) + { + if (this.maxFuel == 0) + { + this.maxFuel = this.fuel; + + if (this.maxFuel == 0) + { + this.maxFuel = 160; + } + } + + return this.fuel * i / this.maxFuel; + } + + public boolean enableUpdateEntity() + { + return IC2.platform.isSimulating(); + } + + @Override + public void updateEntityServer() + { + super.updateEntityServer(); + if (this.needsFluid()) + { + IHLUtils.handleFluidSlotsBehaviour(fillItemsSlot, fluidItemsSlot, emptyFluidItemsSlot, fluidTank); + } + if (this.fuel <= 0 && this.canOperate() && this.fuelSlot instanceof InvSlotConsumableFuel) + { + this.fuel = this.maxFuel = ((InvSlotConsumableFuel) this.fuelSlot).consumeFuel(); + } + + if (this.isBurning() && this.canOperate()) + { + ++this.progress; + + if (this.progress >= maxProgress) + { + this.progress = 0; + this.operate(); + } + } + else + { + this.progress = 0; + } + + if (this.fuel > 0) + { + --this.fuel; + } + + if (this.getActive() != this.isBurning()) + { + this.setActive(this.isBurning()); + } + } + + public void operate() + { + UniversalRecipeOutput output = this.getOutput(); + if(output!=null && !output.getItemOutputs().isEmpty()) + { + this.outputSlot.add(this.getOutput().getItemOutputs().get(0).copy()); + } + this.fluidTank.drain(recipeManager.getRecipeInput(Arrays.asList(new FluidStack [] {this.fluidTank.getFluid()}),null).getFluidInputs().get(0).getAmount(), true); + } + + public boolean isBurning() + { + return this.fuel > 0; + } + + public boolean canOperate() + { + if (this.fluidTank.getFluid()==null) + { + return false; + } + else + { + UniversalRecipeOutput output = recipeManager.getOutputFor(Arrays.asList(new FluidStack [] {this.fluidTank.getFluid()}),null); + return output == null ? false : (this.outputSlot.canAdd(output.getItemOutputs()) ? true : false); + } + } + + /** + * Returns the name of the inventory + */ + @Override + public String getInventoryName() + { + return "Solid fuel evaporator"; + } + + @Override + public ContainerBase getGuiContainer(EntityPlayer entityPlayer) + { + return new EvaporatorContainer(entityPlayer, this); + } + + @Override + @SideOnly(Side.CLIENT) + public GuiScreen getGui(EntityPlayer entityPlayer, boolean isAdmin) + { + return new EvaporatorGui(new EvaporatorContainer(entityPlayer, this)); + } + + @Override + public void onGuiClosed(EntityPlayer entityPlayer) {} + + @Override + public boolean canDrain(ForgeDirection arg0, Fluid arg1) { + return false; + } + + @Override + public boolean canFill(ForgeDirection arg0, Fluid fluid1) { + return true; + } + + public boolean getGui(EntityPlayer player) + { + return this instanceof IHasGui ? (IC2.platform.isSimulating() ? IC2.platform.launchGui(player, this) : true) : false; + } + + public int mX() + { + switch(this.getFacing()) + { + case 4: + return -1; + case 5: + return 1; + default: + return 0; + } + } + + public int mZ() + { + switch(this.getFacing()) + { + case 2: + return -1; + case 3: + return 1; + default: + return 0; + } + } + + public static void addRecipe(FluidStack input, ItemStack output) + { + recipeManager.addRecipe(new UniversalRecipeInput((new FluidStack [] {input}),null), new UniversalRecipeOutput(null, (new ItemStack[] {output}),20)); + } + + public UniversalRecipeOutput getOutput() + { + if (this.fluidTank.getFluid()==null) + { + return null; + } + else + { + UniversalRecipeOutput output = recipeManager.getOutputFor(Arrays.asList(new FluidStack [] {this.fluidTank.getFluid()}),null); + return output == null ? null : (this.outputSlot.canAdd(output.getItemOutputs()) ? output : null); + } + } + + public static Map getRecipes() { + return recipeManager.getRecipes(); + } +} \ No newline at end of file diff --git a/src/main/java/ihl/processing/chemistry/ExtruderModel.java b/src/main/java/ihl/processing/chemistry/ExtruderModel.java new file mode 100644 index 0000000..4d4688a --- /dev/null +++ b/src/main/java/ihl/processing/chemistry/ExtruderModel.java @@ -0,0 +1,100 @@ +package ihl.processing.chemistry; + +import ihl.model.IHLModelRenderer; +import net.minecraft.client.model.ModelBase; +import net.minecraftforge.common.util.ForgeDirection; + +public class ExtruderModel extends ModelBase +{ + //fields + IHLModelRenderer Base; + IHLModelRenderer RotatingPart2; + IHLModelRenderer MotorPart1; + IHLModelRenderer MotorPart2; + IHLModelRenderer Belt; + IHLModelRenderer Belt2; + IHLModelRenderer Extruder; + + public ExtruderModel() + { + textureWidth = 64; + textureHeight = 32; + setTextureOffset("Base.Shape6", 0, 0); + setTextureOffset("Base.Shape3", 0, 0); + setTextureOffset("Base.Shape16", 0, 0); + setTextureOffset("RotatingPart2.PipeN7", 49, 23); + setTextureOffset("RotatingPart2.PipeN4", 0, 7); + setTextureOffset("MotorPart1.PipeN41", 0, 0); + setTextureOffset("MotorPart1.PipeN12", 0, 0); + setTextureOffset("MotorPart1.PipeN13", 0, 0); + setTextureOffset("MotorPart2.Shape4", 0, 24); + setTextureOffset("MotorPart2.Shape7", 0, 9); + setTextureOffset("MotorPart2.Shape10", 0, 9); + setTextureOffset("Belt.Shape12", 0, 0); + setTextureOffset("Belt2.Shape13", 0, 0); + setTextureOffset("Extruder.PipeN16", 0, 0); + setTextureOffset("Extruder.PipeN15", 24, 20); + setTextureOffset("Extruder.Shape8", 0, 0); + setTextureOffset("Extruder.PipeU17", 0, 0); + setTextureOffset("Extruder.PipeUC18", 0, 0); + setTextureOffset("Extruder.Shape14", 0, 0); + setTextureOffset("Extruder.PipeN14", 0, 0); + + Base = new IHLModelRenderer(this, "Base"); + Base.setRotationPoint(0F, 16F, 0F); + setRotation(Base, 0F, 0F, 0F); + Base.mirror = true; + Base.addBox("Shape6", -8F, 7F, -8F, 16, 1, 16); + Base.addBox("Shape3", -5F, 0F, -7F, 4, 7, 1); + Base.addBox("Shape16", 3F, 3F, -6F, 3, 4, 1); + RotatingPart2 = new IHLModelRenderer(this, "RotatingPart2"); + RotatingPart2.setRotationPoint(-3F, 18F, -7F); + setRotation(RotatingPart2, 0F, 0F, 0F); + RotatingPart2.mirror = true; + RotatingPart2.addTube("PipeN7", -2.5F, -2.5F, -1F, 5, 5, 1, 0F,1F,ForgeDirection.NORTH); + RotatingPart2.addTube("PipeN4", -1F, -1F, 1F, 2, 2, 1, 0F,1F,ForgeDirection.NORTH); + MotorPart1 = new IHLModelRenderer(this, "MotorPart1"); + MotorPart1.setRotationPoint(4.5F, 20.5F, 0F); + setRotation(MotorPart1, 0F, 0F, 0F); + MotorPart1.mirror = true; + MotorPart1.addTube("PipeN41", -1.5F, -1.5F, -8F, 3, 3, 1, 0F,1F,ForgeDirection.NORTH); + MotorPart1.addTube("PipeN12", -0.5F, -0.5F, -7F, 1, 1, 1, 0F,1F,ForgeDirection.NORTH); + MotorPart1.addTube("PipeN13", -1.5F, -1.5F, -5F, 3, 3, 5, 0F,1F,ForgeDirection.NORTH); + MotorPart2 = new IHLModelRenderer(this, "MotorPart2"); + MotorPart2.setRotationPoint(0F, 16F, 0F); + setRotation(MotorPart2, 0F, 0F, 0F); + MotorPart2.mirror = true; + MotorPart2.addBox("Shape4", 3F, 3F, 0F, 3, 4, 4); + MotorPart2.addBox("Shape7", 6F, 3F, -5F, 2, 4, 5); + MotorPart2.addBox("Shape10", 1F, 3F, -5F, 2, 4, 5); + Belt = new IHLModelRenderer(this, "Belt"); + Belt.setRotationPoint(-3F, 15.5F, -7.9F); + setRotation(Belt, 0F, 0F, 0.45F); + Belt.mirror = true; + Belt.addBox("Shape12", 0.5F, 0F, 0F, 8, 1, 1); + Belt2 = new IHLModelRenderer(this, "Belt2"); + Belt2.setRotationPoint(-3F, 19.5F, -7.9F); + setRotation(Belt2, 0F, 0F, 0.19F); + Belt2.mirror = true; + Belt2.addBox("Shape13", 0F, 0F, 0F, 8, 1, 1); + Extruder = new IHLModelRenderer(this, "Extruder"); + Extruder.setRotationPoint(0F, 16F, 0F); + setRotation(Extruder, 0F, 0F, 0F); + Extruder.mirror = true; + Extruder.addTube("PipeN16", -4.5F, 0.5F, -5F, 3, 3, 12, 0F,1F,ForgeDirection.NORTH); + Extruder.addTube("PipeN15", -5.5F, -0.5F, 0F, 5, 5, 7, 0.5F,1F,ForgeDirection.NORTH); + Extruder.addBox("Shape8", -5F, 4F, 6.9F, 4, 3, 1); + Extruder.addTube("PipeU17", -5.5F, -8F, -5F, 5, 8, 5, 0.8F,1F,ForgeDirection.UP); + Extruder.addTube("PipeUC18", -5.5F, 0F, -5F, 5, 2, 5, 0.8F,0.6F,ForgeDirection.UP); + Extruder.addBox("Shape14", -5F, 3F, -4.9F, 4, 4, 1); + Extruder.addTube("PipeN14", -5.5F, -0.5F, 7F, 5, 5, 1, 0.5F,1F,ForgeDirection.NORTH); + } + + private void setRotation(IHLModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + +} diff --git a/src/main/java/ihl/processing/chemistry/FluidizedBedReactorContainer.java b/src/main/java/ihl/processing/chemistry/FluidizedBedReactorContainer.java new file mode 100644 index 0000000..ada1463 --- /dev/null +++ b/src/main/java/ihl/processing/chemistry/FluidizedBedReactorContainer.java @@ -0,0 +1,44 @@ +package ihl.processing.chemistry; + +import java.util.List; + +import ic2.core.IC2; +import ic2.core.slot.SlotInvSlot; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraftforge.fluids.FluidStack; + +public class FluidizedBedReactorContainer extends BasicElectricMotorContainer { + + protected FluidizedBedReactorTileEntity tileEntity; + public int lastFluidsHash = -1; + private final static int height=166; + public List fluidTankFluidList; + + public FluidizedBedReactorContainer(EntityPlayer entityPlayer, FluidizedBedReactorTileEntity tileEntity1){ + super(entityPlayer, tileEntity1); + this.tileEntity = tileEntity1; + fluidTankFluidList = this.tileEntity.getFluidTank().getFluidList(); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.fillInputSlot, 0, 102, 51)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.drainInputSlot, 0, 102, 15)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.emptyFluidItemsSlot, 0, 102, 33)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.input, 0, 41, 23)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.input, 1, 41, 41)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.outputSlot, 0, 76, 33)); + } + + @Override + public void detectAndSendChanges() + { + super.detectAndSendChanges(); + if (fluidTankFluidList.hashCode() != this.lastFluidsHash) + { + IC2.network.get().sendContainerField(this, "fluidTankFluidList"); + this.lastFluidsHash = fluidTankFluidList.hashCode(); + } + } + + @Override + public boolean canInteractWith(EntityPlayer var1) { + return tileEntity.isUseableByPlayer(var1); + } +} diff --git a/src/main/java/ihl/processing/chemistry/FluidizedBedReactorGui.java b/src/main/java/ihl/processing/chemistry/FluidizedBedReactorGui.java new file mode 100644 index 0000000..95ba8f0 --- /dev/null +++ b/src/main/java/ihl/processing/chemistry/FluidizedBedReactorGui.java @@ -0,0 +1,59 @@ +package ihl.processing.chemistry; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ihl.utils.IHLRenderUtils; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.util.ResourceLocation; + +@SideOnly(Side.CLIENT) +public class FluidizedBedReactorGui extends GuiContainer { + private static final ResourceLocation background = new ResourceLocation("ihl", + "textures/gui/GUIFluidizedBedReactor.png"); + private FluidizedBedReactorContainer container; + private int mixerFrame = 0; + + public FluidizedBedReactorGui(FluidizedBedReactorContainer container1) { + // the container is instanciated and passed to the superclass for + // handling + super(container1); + this.container = container1; + } + + @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(12, 16 + 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(58, 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 + 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(background); + int x = (width - xSize) / 2; + int y = (height - ySize) / 2; + this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); + } +} \ No newline at end of file diff --git a/src/main/java/ihl/processing/chemistry/FluidizedBedReactorTileEntity.java b/src/main/java/ihl/processing/chemistry/FluidizedBedReactorTileEntity.java new file mode 100644 index 0000000..69dd4e1 --- /dev/null +++ b/src/main/java/ihl/processing/chemistry/FluidizedBedReactorTileEntity.java @@ -0,0 +1,318 @@ +package ihl.processing.chemistry; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ic2.core.ContainerBase; +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 ihl.IHLMod; +import ihl.processing.invslots.IHLInvSlotOutput; +import ihl.processing.invslots.InvSlotConsumableLiquidIHL; +import ihl.processing.metallurgy.BasicElectricMotorTileEntity; +import ihl.recipes.RecipeOutputItemStack; +import ihl.recipes.UniversalRecipeInput; +import ihl.recipes.UniversalRecipeManager; +import ihl.recipes.UniversalRecipeOutput; +import ihl.utils.IHLFluidTank; +import ihl.utils.IHLUtils; +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; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidHandler; + +public class FluidizedBedReactorTileEntity extends BasicElectricMotorTileEntity implements IFluidHandler +{ + private final static UniversalRecipeManager recipeManager = new UniversalRecipeManager("fluidizedbedreactor"); + public final ApparatusProcessableInvSlot input; + public final IHLInvSlotOutput outputSlot; + public final InvSlotConsumableLiquidIHL drainInputSlot; + public final InvSlotConsumableLiquidIHL fillInputSlot; + public final InvSlotOutput emptyFluidItemsSlot; + private final IHLFluidTank fluidTank = new IHLFluidTank(8000); + public short temperature=20; + + public FluidizedBedReactorTileEntity() { + super(); + this.outputSlot = new IHLInvSlotOutput(this, "output", 0, 1); + 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.input = new ApparatusProcessableInvSlot(this, "input", 3, Access.IO, 2, 64); + } + + @Override + public void readFromNBT(NBTTagCompound nbttagcompound) + { + super.readFromNBT(nbttagcompound); + this.fluidTank.readFromNBT(nbttagcompound.getCompoundTag("fluidTank")); + } + + @Override + public void writeToNBT(NBTTagCompound nbttagcompound) + { + super.writeToNBT(nbttagcompound); + NBTTagCompound fluidTankTag = new NBTTagCompound(); + this.fluidTank.writeToNBT(fluidTankTag); + nbttagcompound.setTag("fluidTank", fluidTankTag); + } + + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { + return this.getFacing()!=side; + } + + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { + return IHLUtils.getThisModItemStack("fluidizedBedReactor"); + } + + @Override + public void updateEntityServer() + { + super.updateEntityServer(); + IHLUtils.handleFluidSlotsBehaviour(fillInputSlot, drainInputSlot, emptyFluidItemsSlot, fluidTank); + } + + @Override + public FluidStack drain(ForgeDirection from, int amount, boolean doDrain) + { + switch(from) + { + case UP: + return this.fluidTank.drainLightest(amount, doDrain); + case NORTH: + return this.fluidTank.drainLightest(amount, doDrain); + case SOUTH: + return this.fluidTank.drainLightest(amount, doDrain); + case WEST: + return this.fluidTank.drainLightest(amount, doDrain); + case EAST: + return this.fluidTank.drainLightest(amount, doDrain); + case DOWN: + return this.fluidTank.drain(amount, doDrain); + default: + return this.fluidTank.drain(amount, doDrain); + } + } + + + //1.7.10 API + @Override + public boolean canDrain(ForgeDirection arg0, Fluid arg1) { + return true; + } + + @Override + public boolean canFill(ForgeDirection direction, Fluid arg1) { + return true; + } + + @Override + public String getInventoryName() { + return "fluidizedBedReactor"; + } + + @Override + public int gaugeProgressScaled(int i) + { + return this.progress * i / operationLength; + } + + @Override + @SideOnly(Side.CLIENT) + public GuiScreen getGui(EntityPlayer player, boolean arg1) { + return new FluidizedBedReactorGui(new FluidizedBedReactorContainer(player, this)); + } + + @Override + public ContainerBase getGuiContainer(EntityPlayer player) + { + this.fluidTank.sortFluidsByDensity(); + return new FluidizedBedReactorContainer(player, this); + } + + @Override + public void onGuiClosed(EntityPlayer player) {} + + @Override + public boolean canOperate() + { + UniversalRecipeOutput output = getOutput(); + if(output!=null && this.outputSlot.canAdd(getOutput().getItemOutputs())) + { + if(output.specialConditions) + { + return this.checkSpecialConditions(); + } + else + { + return true; + } + } + 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 FluidizedBedReactorTileEntity.recipeManager.getOutputFor(this.getInput()); + } + + @SuppressWarnings({ "rawtypes", "unchecked" }) + @Override + public List[] getInput() + { + for(int i=0;i IHLMod.config.maxCatalystUses){ + stack.stackTagCompound.setInteger("catalyst_uses", 0); + if(--stack.stackSize<=0) + this.input.put(i1, null); + } + } + } + } + } + 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); + if(!output1.getItemOutputs().isEmpty() && output1.getItemOutputs().get(0)!=null)this.outputSlot.add(output1.getItemOutputs()); + + } + + @Override + public FluidStack drain(ForgeDirection arg0, FluidStack fluidStack, boolean doDrain) { + if(fluidTank.getFluid()!=null && fluidTank.getFluid().containsFluid(fluidStack)) + { + return this.fluidTank.drain(fluidStack, doDrain); + } + return null; + } + + @Override + public int fill(ForgeDirection arg0, FluidStack arg1, boolean arg2) { + return this.fluidTank.fill(arg1, arg2); + } + + @Override + public FluidTankInfo[] getTankInfo(ForgeDirection arg0) { + return new FluidTankInfo[] {this.fluidTank.getInfo()}; + } + + public boolean needsFluid() + { + return this.fluidTank.getFluidAmount() <= this.fluidTank.getCapacity(); + } + + public FluidStack getFluidStackfromTank() + { + return this.fluidTank.getFluid(); + } + + public int getTankAmount() + { + return this.fluidTank.getFluidAmount(); + } + + public int gaugeLiquidScaled(int i, int index) + { + return this.fluidTank.getFluidAmount() <= 0 ? 0 : this.fluidTank.getFluidAmount(index) * i / this.fluidTank.getCapacity(); + } + public static void addRecipe(UniversalRecipeInput input, UniversalRecipeOutput output) + { + recipeManager.addRecipe(input, output); + } + + public int getNumberOfFluidsInTank() + { + return this.fluidTank.getNumberOfFluids(); + } + + public static Map getRecipes() + { + return recipeManager.getRecipes(); + } + + public static void addRecipe(FluidStack fluidStackInput1, ItemStack itemStackInput, FluidStack fluidStackOutput, ItemStack itemStackOutput1) + { + if(fluidStackOutput!=null) + { + addRecipe(new UniversalRecipeInput((new FluidStack[] {fluidStackInput1}), (new ItemStack[] {itemStackInput})), new UniversalRecipeOutput((new FluidStack[] {fluidStackOutput}), (new ItemStack[] {itemStackOutput1}),200)); + } + else + { + addRecipe(new UniversalRecipeInput((new FluidStack[] {fluidStackInput1}), (new ItemStack[] {itemStackInput})), new UniversalRecipeOutput(null, (new ItemStack[] {itemStackOutput1}),200)); + } + } + + public IHLFluidTank getFluidTank() + { + return this.fluidTank; + } + + public static void addRecipe(FluidStack fluidStackInput1, ItemStack itemStackInput, FluidStack fluidStackOutput, RecipeOutputItemStack itemStackOutput1) { + if(fluidStackOutput!=null) + { + addRecipe(new UniversalRecipeInput((new FluidStack[] {fluidStackInput1}), (new ItemStack[] {itemStackInput})), new UniversalRecipeOutput((new FluidStack[] {fluidStackOutput}), (new RecipeOutputItemStack[] {itemStackOutput1}),200)); + } + else + { + addRecipe(new UniversalRecipeInput((new FluidStack[] {fluidStackInput1}), (new ItemStack[] {itemStackInput})), new UniversalRecipeOutput(null, (new RecipeOutputItemStack[] {itemStackOutput1}),200)); + } + } + +} \ No newline at end of file diff --git a/src/main/java/ihl/processing/chemistry/FractionatorBottomModel.java b/src/main/java/ihl/processing/chemistry/FractionatorBottomModel.java new file mode 100644 index 0000000..c395af7 --- /dev/null +++ b/src/main/java/ihl/processing/chemistry/FractionatorBottomModel.java @@ -0,0 +1,48 @@ +// Date: 05.04.2015 16:55:22 +// Template version 1.1 +// Java generated by Techne +// Keep in mind that you still need to fill in some blanks +// - ZeuX + +package ihl.processing.chemistry; + +import ihl.model.IHLModelRenderer; +import net.minecraft.client.model.ModelBase; +import net.minecraftforge.common.util.ForgeDirection; + +public class FractionatorBottomModel extends ModelBase +{ + //fields + IHLModelRenderer Base; + + public FractionatorBottomModel() + { + textureWidth = 64; + textureHeight = 32; + setTextureOffset("Base.Box03", 0, 0); + setTextureOffset("Base.Box04", 0, 0); + setTextureOffset("Base.Pipeup02", 0, 0); + setTextureOffset("Base.WestPipe03", 0, 0); + setTextureOffset("Base.WestPipe04", 0, 0); + setTextureOffset("Base.PipeUp05", 0, 0); + + Base = new IHLModelRenderer(this, "Base"); + Base.setRotationPoint(0F, 16F, 0F); + setRotation(Base, 0F, 0F, 0F); + Base.mirror = true; + Base.addBox("Box03", 2F, -7.1F, -8F, 6, 15, 16); + Base.addBox("Box04", -8F, 7F, -8F, 16, 1, 16); + Base.addTube("Pipeup02", -8F, -8F, -8F, 16, 1, 16, 0.8F, 1.0F, ForgeDirection.UP); + Base.addTube("WestPipe03", -7.5F, -1.5F, -1.5F, 3, 3, 3, 0.8F, 1.0F, ForgeDirection.WEST); + Base.addTube("WestPipe04", -8F, -2F, -2F, 1, 4, 4, 0.8F, 1.0F, ForgeDirection.WEST); + Base.addTube("PipeUp05", -7F, -7F, -7F, 14, 15, 14, 0.8F, 1.0F, ForgeDirection.UP); + } + + private void setRotation(IHLModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + +} diff --git a/src/main/java/ihl/processing/chemistry/FractionatorBottomTileEntity.java b/src/main/java/ihl/processing/chemistry/FractionatorBottomTileEntity.java new file mode 100644 index 0000000..3d9e95e --- /dev/null +++ b/src/main/java/ihl/processing/chemistry/FractionatorBottomTileEntity.java @@ -0,0 +1,352 @@ +package ihl.processing.chemistry; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import ic2.api.energy.tile.IHeatSource; +import ic2.core.IC2; +import ic2.core.block.TileEntityInventory; +import ihl.recipes.IRecipeInputFluid; +import ihl.recipes.UniversalRecipeInput; +import ihl.recipes.UniversalRecipeManager; +import ihl.recipes.UniversalRecipeOutput; +import ihl.utils.IHLFluidTank; +import ihl.utils.IHLUtils; +import ihl.worldgen.ores.IHLFluid; +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; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidHandler; + +public class FractionatorBottomTileEntity extends TileEntityInventory implements IFluidHandler +{ + private final static UniversalRecipeManager recipeManager = new UniversalRecipeManager("fractionator"); + private static float kF = 24000F; + private static float fluidC = 4F; + private static float H = 2256F; + private final IHLFluidTank waterTank = new IHLFluidTank(100); + private final IHLFluidTank fluidTank = new IHLFluidTank(8000); + private int amountOfGasCondensed=0; + private int amountOfFluidEvaporated=0; + private int systemHeat=0; + private static final int maxSystemHeat=10000; + private final List listOfColumnSections = new ArrayList(); + private FractionatorCoverTileEntity columnCover; + private RefluxCondenserTileEntity refluxCondenser; + private IHeatSource heatSource; + private int fluxRecirculationProportion=10; + + public FractionatorBottomTileEntity() + { + super(); + } + + @Override + public void readFromNBT(NBTTagCompound nbttagcompound) + { + super.readFromNBT(nbttagcompound); + this.fluidTank.readFromNBT(nbttagcompound.getCompoundTag("fluidTank")); + this.waterTank.readFromNBT(nbttagcompound.getCompoundTag("waterTank")); + this.amountOfGasCondensed=nbttagcompound.getInteger("amountOfGasCondensed"); + this.systemHeat=nbttagcompound.getInteger("systemHeat"); + } + + @Override + public void writeToNBT(NBTTagCompound nbttagcompound) + { + super.writeToNBT(nbttagcompound); + NBTTagCompound fluidTankTag = new NBTTagCompound(); + this.fluidTank.writeToNBT(fluidTankTag); + nbttagcompound.setTag("fluidTank", fluidTankTag); + + NBTTagCompound waterTankTag = new NBTTagCompound(); + this.waterTank.writeToNBT(waterTankTag); + nbttagcompound.setTag("waterTank", waterTankTag); + + nbttagcompound.setInteger("amountOfGasCondensed",this.amountOfGasCondensed); + nbttagcompound.setInteger("systemHeat",this.systemHeat); + + } + + public static void addRecipe(FluidStack fluidIn, FluidStack fluidOut1, FluidStack fluidOut2) + { + recipeManager.addRecipe(new UniversalRecipeInput((new FluidStack[] {fluidIn}), null), new UniversalRecipeOutput((new FluidStack[] {fluidOut1,fluidOut2}),null,2)); + } + + + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { + return this.getFacing()!=(short)side && side!=0 && side!=1; + } + + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { + return IHLUtils.getThisModItemStack("fractionatorBottom"); + } + + public boolean enableUpdateEntity() + { + return IC2.platform.isSimulating(); + } + + @Override + public void updateEntityServer() + { + super.updateEntityServer(); + if(!this.checkIntegrity()) + { + return; + } + this.fluxRecirculationProportion=100-10000/(100+this.listOfColumnSections.size()*3); + ForgeDirection orientation = ForgeDirection.getOrientation(this.getFacing()).getRotation(ForgeDirection.UP); + if(systemHeat < maxSystemHeat && this.checkHeatSource(orientation)) + { + systemHeat+=this.heatSource.requestHeat(orientation.getOpposite(), Integer.MAX_VALUE); + } + FluidStack fsCurrentInput = this.fluidTank.getFluid(); + if(fsCurrentInput!=null && fsCurrentInput.amount>100 && systemHeat>0) + { + UniversalRecipeOutput rOutput = FractionatorBottomTileEntity.recipeManager.getOutputFor(this.fluidTank.getFluidList(),null); + UniversalRecipeInput rInput = FractionatorBottomTileEntity.recipeManager.getRecipeInput(this.fluidTank.getFluidList(),null); + if(rOutput!=null) + { + IRecipeInputFluid input = rInput.getFluidInputs().get(0); + int rInputAmount = input.getAmount(); + FluidStack result1=rOutput.getFluidOutputs().get(0).copy(); + FluidStack result2=rOutput.getFluidOutputs().get(1).copy(); + //max heat per tick of electric heater is 100 + int amountOfFluidToEvaporate = Math.min(fsCurrentInput.amount*result2.amount/rInputAmount,systemHeat/100); + systemHeat-=amountOfFluidToEvaporate*100; + amountOfFluidEvaporated+=amountOfFluidToEvaporate; + int amountOfVapours=amountOfFluidEvaporated*50; + FluidStack coolant = this.waterTank.getFluid(); + if(coolant!=null && coolant.amount>0) + { + int amountOfGasToCondense = Math.min(coolant.amount*50, amountOfVapours); + amountOfGasCondensed += amountOfGasToCondense; + amountOfFluidEvaporated -= amountOfGasToCondense/50; + } + if(amountOfGasCondensed>10000) + { + int amountToProcess=amountOfGasCondensed*this.fluxRecirculationProportion/5000;//only 10% of condensate will be extracted. + int amount = rInputAmount * amountToProcess / result2.amount; + result1.amount = result1.amount* amountToProcess / result2.amount; + result2.amount = amountToProcess; + this.fluidTank.drain(input,amount, true); + this.fillVatResidueOutputApparatus(orientation.getOpposite(), result1, true); + this.fillCondensateOutputApparatus(ForgeDirection.UP, result2, true); + amountOfGasCondensed=0; + } + } + } + if(this.waterTank.getFluid()!=null) + { + FluidStack coolant = this.waterTank.drain(5, true); + this.fillHeatTransferAgentOutputApparatus(ForgeDirection.UP, coolant, true); + } + } + + + private boolean checkHeatSource(ForgeDirection orientation) + { + if(this.heatSource!=null) + { + return true; + } + else + { + TileEntity te = worldObj.getTileEntity(xCoord+orientation.offsetX, yCoord, zCoord+orientation.offsetZ); + if(te instanceof IHeatSource) + { + if(((IHeatSource)te).maxrequestHeatTick(orientation.getOpposite())>0) + { + this.heatSource=(IHeatSource)te; + return true; + } + } + } + return false; + } + + private boolean checkIntegrity() + { + boolean allright=true; + if(!this.listOfColumnSections.isEmpty() && + this.columnCover!=null && + !this.columnCover.isInvalid() && + this.refluxCondenser!=null && + !this.refluxCondenser.isInvalid()) + { + Iterator sectionsIterator = this.listOfColumnSections.iterator(); + while(sectionsIterator.hasNext()) + { + FractionatorSectionTileEntity section = sectionsIterator.next(); + if(section==null || section.isInvalid()) + { + allright=false; + } + } + } + else + { + allright=false; + } + if(allright) + { + return true; + } + else + { + this.listOfColumnSections.clear(); + this.columnCover=null; + this.refluxCondenser=null; + boolean checking = true; + int height=0; + while(checking) + { + height++; + TileEntity te = worldObj.getTileEntity(xCoord, yCoord+height, zCoord); + if(te instanceof FractionatorSectionTileEntity) + { + FractionatorSectionTileEntity section = (FractionatorSectionTileEntity)te; + section.columnBottom=this; + this.listOfColumnSections.add(section); + } + else if(te instanceof FractionatorCoverTileEntity) + { + if(this.listOfColumnSections.isEmpty()) + { + return false; + } + FractionatorCoverTileEntity fcte = (FractionatorCoverTileEntity)te; + this.columnCover=fcte; + ForgeDirection orientation = ForgeDirection.getOrientation(fcte.getFacing()).getRotation(ForgeDirection.DOWN); + te = worldObj.getTileEntity(xCoord+orientation.offsetX, yCoord+height, zCoord+orientation.offsetZ); + if(te instanceof RefluxCondenserTileEntity) + { + if(((RefluxCondenserTileEntity)te).getFacing()==fcte.getFacing()) + { + this.refluxCondenser=(RefluxCondenserTileEntity)te; + this.refluxCondenser.columnBottom=this; + return true; + } + } + } + else + { + checking=false; + } + } + } + return false; + } + + @Override + public String getInventoryName() + { + return "fractionator"; + } + + public void onGuiClosed(EntityPlayer entityPlayer) {} + + public int fill(ForgeDirection direction, FluidStack fluidStack, boolean doFill) + { + if(direction.equals(ForgeDirection.UP)) + { + return waterTank.fill(fluidStack, doFill); + } + else + { + return fluidTank.fill(fluidStack, doFill); + } + } + + private int fillCondensateOutputApparatus(ForgeDirection direction,FluidStack fluidStack, boolean doFill) + { + TileEntity te = worldObj.getTileEntity(this.refluxCondenser.xCoord,this.refluxCondenser.yCoord-1,this.refluxCondenser.zCoord); + if(te instanceof IFluidHandler) + { + return ((IFluidHandler)te).fill(direction, fluidStack, doFill); + } + else + { + return 0; + } + } + + + private int fillVatResidueOutputApparatus(ForgeDirection orientation, FluidStack fluidStack, boolean doFill) { + TileEntity te = worldObj.getTileEntity(xCoord+orientation.offsetX,yCoord, zCoord+orientation.offsetZ); + if(te instanceof IFluidHandler) + { + return ((IFluidHandler)te).fill(orientation, fluidStack, doFill); + } + else + { + return 0; + } + } + + private int fillHeatTransferAgentOutputApparatus(ForgeDirection direction,FluidStack fluidStack, boolean doFill) + { + ForgeDirection orientation = ForgeDirection.getOrientation(this.refluxCondenser.getFacing()).getOpposite(); + TileEntity te = worldObj.getTileEntity(this.refluxCondenser.xCoord+orientation.offsetX,this.refluxCondenser.yCoord,this.refluxCondenser.zCoord+orientation.offsetZ); + if(te instanceof IFluidHandler) + { + return ((IFluidHandler)te).fill(orientation, fluidStack, doFill); + } + else + { + return 0; + } + } + + @Override + public void setFacing(short facing1) + { + super.setFacing((short) Math.max(facing1, 2)); + } + + public FluidTankInfo[] getTankInfo(ForgeDirection arg0) { + return new FluidTankInfo[]{this.fluidTank.getInfo(), this.waterTank.getInfo()}; + } + + + public static Map getRecipes() { + return recipeManager.getRecipes(); + } + + @Override + public boolean shouldRenderInPass(int pass) + { + return pass==0; + } + + @Override + public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) { + return this.fluidTank.drain(resource, doDrain); + } + + @Override + public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) { + return this.fluidTank.drain(maxDrain, doDrain); + } + + @Override + public boolean canFill(ForgeDirection from, Fluid fluid) { + return true; + } + + @Override + public boolean canDrain(ForgeDirection from, Fluid fluid) { + return true; + } +} \ No newline at end of file diff --git a/src/main/java/ihl/processing/chemistry/FractionatorCoverModel.java b/src/main/java/ihl/processing/chemistry/FractionatorCoverModel.java new file mode 100644 index 0000000..451d73c --- /dev/null +++ b/src/main/java/ihl/processing/chemistry/FractionatorCoverModel.java @@ -0,0 +1,52 @@ +// Date: 05.04.2015 1:01:48 +// Template version 1.1 +// Java generated by Techne +// Keep in mind that you still need to fill in some blanks +// - ZeuX +package ihl.processing.chemistry; + +import ihl.model.IHLModelRenderer; +import net.minecraft.client.model.ModelBase; +import net.minecraftforge.common.util.ForgeDirection; + +public class FractionatorCoverModel extends ModelBase +{ + //fields + IHLModelRenderer Base; + + public FractionatorCoverModel() + { + textureWidth = 64; + textureHeight = 32; + setTextureOffset("Base.PipeUp03", 0, 0); + setTextureOffset("Base.ConeUp14to10", 0, 0); + setTextureOffset("Base.PipeUp", 0, 0); + setTextureOffset("Base.KneeUPWEST", 0, 0); + setTextureOffset("Base.WestPipe03", 0, 0); + setTextureOffset("Base.WestPipe04", 0, 0); + setTextureOffset("Base.ConeUp10To3", 0, 0); + setTextureOffset("Base.WestPipe02", 0, 0); + setTextureOffset("Base.WestPipe01", 0, 0); + + Base = new IHLModelRenderer(this, "Base"); + Base.setRotationPoint(0F, 16F, 0F); + setRotation(Base, 0F, 0F, 0F); + Base.mirror = true; + Base.addTube("PipeUp03", -8F, 7F, -8F, 16, 1, 16, .8F, 1F, ForgeDirection.UP); + Base.addTube("ConeUp14to10", -7F, 2F, -7F, 14, 5, 14, .8F, 0.71F, ForgeDirection.DOWN); + Base.addTube("PipeUp", -1.5F, -2.5F, -1.5F, 3, 3, 3, .8F, 1F, ForgeDirection.UP); + Base.addKnee("KneeUPWEST", -3F, -8.5F, -3F, 6, 6, 6, .8F, 1F, ForgeDirection.DOWN, ForgeDirection.WEST); + Base.addTube("WestPipe03", -7F, -7F, -1.5F, 4, 3, 3, .8F, 1F, ForgeDirection.WEST); + Base.addTube("WestPipe04", -8F, -7.5F, -2F, 1, 4, 4, .6F, 1F, ForgeDirection.WEST); + Base.addTube("ConeUp10To3", -5F, 0F, -5F, 10, 2, 10, .8F, 0.3F, ForgeDirection.DOWN); + Base.addTube("WestPipe02", -8F, 3F, -2F, 1, 4, 4, .6F, 1F, ForgeDirection.WEST); + Base.addTube("WestPipe01", -7F, 3.5F, -1.5F, 3, 3, 3, .8F, 1F, ForgeDirection.WEST); + } + + private void setRotation(IHLModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } +} diff --git a/src/main/java/ihl/processing/chemistry/FractionatorCoverTileEntity.java b/src/main/java/ihl/processing/chemistry/FractionatorCoverTileEntity.java new file mode 100644 index 0000000..048f953 --- /dev/null +++ b/src/main/java/ihl/processing/chemistry/FractionatorCoverTileEntity.java @@ -0,0 +1,104 @@ +package ihl.processing.chemistry; + +import java.util.ArrayList; +import java.util.List; + +import ic2.api.network.INetworkDataProvider; +import ic2.api.tile.IWrenchable; +import ic2.core.IC2; +import ihl.utils.IHLUtils; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; + +public class FractionatorCoverTileEntity extends TileEntity implements IWrenchable, INetworkDataProvider{ + + private short facing=2; + private short lastFacing=2; + public FractionatorBottomTileEntity columnBottom; + + public FractionatorCoverTileEntity() + { + super(); + } + + public boolean enableUpdateEntity() + { + return IC2.platform.isSimulating(); + } + + @Override + public List getNetworkedFields() + { + List fields = new ArrayList(); + fields.add("facing"); + return fields; + } + + @Override + public void updateEntity() + { + super.updateEntity(); + if(lastFacing!=facing) + { + IC2.network.get().updateTileEntityField(this, "facing"); + lastFacing=facing; + } + } + + + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { + return this.getFacing()!=side; + } + + + @Override + public short getFacing() { + return this.facing; + } + + + @Override + public void setFacing(short facing1) + { + facing=(short) Math.max(2,facing1); + if(IC2.platform.isSimulating()) + { + IC2.network.get().updateTileEntityField(this, "facing"); + } + } + + + @Override + public boolean wrenchCanRemove(EntityPlayer entityPlayer) { + return true; + } + + + @Override + public float getWrenchDropRate() { + return 1F; + } + + + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { + return IHLUtils.getThisModItemStack("fractionatorCover"); + } + + @Override + public void readFromNBT(NBTTagCompound nbttagcompound) + { + super.readFromNBT(nbttagcompound); + facing=nbttagcompound.getShort("facing"); + } + + @Override + public void writeToNBT(NBTTagCompound nbttagcompound) + { + super.writeToNBT(nbttagcompound); + nbttagcompound.setShort("facing", facing); + } +} diff --git a/src/main/java/ihl/processing/chemistry/FractionatorSectionModel.java b/src/main/java/ihl/processing/chemistry/FractionatorSectionModel.java new file mode 100644 index 0000000..2a20e7b --- /dev/null +++ b/src/main/java/ihl/processing/chemistry/FractionatorSectionModel.java @@ -0,0 +1,47 @@ +// Date: 05.04.2015 16:59:49 +// Template version 1.1 +// Java generated by Techne +// Keep in mind that you still need to fill in some blanks +// - ZeuX +package ihl.processing.chemistry; + +import ihl.model.IHLModelRenderer; +import net.minecraft.client.model.ModelBase; +import net.minecraftforge.common.util.ForgeDirection; + + +public class FractionatorSectionModel extends ModelBase +{ + //fields + IHLModelRenderer Base; + + public FractionatorSectionModel() + { + textureWidth = 64; + textureHeight = 32; + setTextureOffset("Base.PipeUp03", 0, 0); + setTextureOffset("Base.Pipeup02", 0, 0); + setTextureOffset("Base.WestPipe03", 0, 0); + setTextureOffset("Base.WestPipe04", 0, 0); + setTextureOffset("Base.PipeUp05", 0, 0); + + Base = new IHLModelRenderer(this, "Base"); + Base.setRotationPoint(0F, 16F, 0F); + setRotation(Base, 0F, 0F, 0F); + Base.mirror = true; + Base.addTube("PipeUp03", -8F, 7F, -8F, 16, 1, 16, 0.8F, 1.0F, ForgeDirection.UP); + Base.addTube("Pipeup02", -8F, -8F, -8F, 16, 1, 16, 0.8F, 1.0F, ForgeDirection.UP); + Base.addTube("WestPipe03", 4.5F, -1.5F, -1.5F, 3, 3, 3, 0.8F, 1.0F, ForgeDirection.WEST); + Base.addTube("WestPipe04", 7F, -2F, -2F, 1, 4, 4, 0.8F, 1.0F, ForgeDirection.WEST); + Base.addTube("PipeUp05", -7F, -7F, -7F, 14, 14, 14, 0.8F, 1.0F, ForgeDirection.UP); + } + + private void setRotation(IHLModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + +} diff --git a/src/main/java/ihl/processing/chemistry/FractionatorSectionTileEntity.java b/src/main/java/ihl/processing/chemistry/FractionatorSectionTileEntity.java new file mode 100644 index 0000000..e71c453 --- /dev/null +++ b/src/main/java/ihl/processing/chemistry/FractionatorSectionTileEntity.java @@ -0,0 +1,148 @@ +package ihl.processing.chemistry; + +import java.util.ArrayList; +import java.util.List; + +import ic2.api.network.INetworkDataProvider; +import ic2.api.tile.IWrenchable; +import ic2.core.IC2; +import ihl.utils.IHLUtils; +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; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidHandler; + +public class FractionatorSectionTileEntity extends TileEntity implements IWrenchable, INetworkDataProvider, IFluidHandler{ + + private short facing=2; + private short lastFacing=2; + public FractionatorBottomTileEntity columnBottom; + + public FractionatorSectionTileEntity() + { + super(); + } + + public boolean enableUpdateEntity() + { + return IC2.platform.isSimulating(); + } + + @Override + public List getNetworkedFields() + { + List fields = new ArrayList(); + fields.add("facing"); + return fields; + } + + @Override + public void updateEntity() + { + super.updateEntity(); + if(lastFacing!=facing) + { + IC2.network.get().updateTileEntityField(this, "facing"); + lastFacing=facing; + } + } + + + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { + return this.getFacing()!=side; + } + + + @Override + public short getFacing() { + return this.facing; + } + + + @Override + public void setFacing(short facing1) + { + facing=(short) Math.max(2,facing1); + if(IC2.platform.isSimulating()) + { + IC2.network.get().updateTileEntityField(this, "facing"); + } + } + + + @Override + public boolean wrenchCanRemove(EntityPlayer entityPlayer) { + return true; + } + + + @Override + public float getWrenchDropRate() { + return 1F; + } + + + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { + return IHLUtils.getThisModItemStack("fractionatorSection"); + } + + @Override + public void readFromNBT(NBTTagCompound nbttagcompound) + { + super.readFromNBT(nbttagcompound); + facing=nbttagcompound.getShort("facing"); + } + + @Override + public void writeToNBT(NBTTagCompound nbttagcompound) + { + super.writeToNBT(nbttagcompound); + nbttagcompound.setShort("facing", facing); + } + + @Override + public boolean canDrain(ForgeDirection arg0, Fluid arg1) { + return false; + } + + @Override + public boolean canFill(ForgeDirection direction, Fluid arg1) { + return ForgeDirection.getOrientation(this.getFacing()).getRotation(ForgeDirection.UP).equals(direction); + } + + @Override + public FluidStack drain(ForgeDirection arg0, FluidStack arg1, boolean arg2) { + return null; + } + + @Override + public FluidStack drain(ForgeDirection arg0, int arg1, boolean arg2) { + return null; + } + + @Override + public int fill(ForgeDirection direction, FluidStack fluidStack, boolean doFill) { + if(fluidStack!=null && fluidStack.getFluid()!=null && this.canFill(direction, fluidStack.getFluid()) && columnBottom!=null) + { + return columnBottom.fill(direction, fluidStack, doFill); + } + return 0; + } + + @Override + public FluidTankInfo[] getTankInfo(ForgeDirection arg0) + { + if(columnBottom!=null) + return columnBottom.getTankInfo(arg0); + else + return new FluidTankInfo[] {new FluidTankInfo(null, 8000)}; + } + +} diff --git a/src/main/java/ihl/processing/chemistry/GaedesMercuryRotaryPumpContainer.java b/src/main/java/ihl/processing/chemistry/GaedesMercuryRotaryPumpContainer.java new file mode 100644 index 0000000..b283a48 --- /dev/null +++ b/src/main/java/ihl/processing/chemistry/GaedesMercuryRotaryPumpContainer.java @@ -0,0 +1,76 @@ +package ihl.processing.chemistry; + +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 GaedesMercuryRotaryPumpContainer extends ContainerBase { + + protected GaedesMercuryRotaryPumpTileEntity tileEntity; + private final static int height=166; + public short lastEnergy = -1; + public short lastProgress = -1; + + public GaedesMercuryRotaryPumpContainer(EntityPlayer entityPlayer, GaedesMercuryRotaryPumpTileEntity tileEntity1){ + super(tileEntity1); + this.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.dischargeSlot, 0, 61, 36)); + } + + @Override + public void detectAndSendChanges() + { + super.detectAndSendChanges(); + for (int i = 0; i < this.crafters.size(); ++i) + { + ICrafting icrafting = (ICrafting)this.crafters.get(i); + + if (this.tileEntity.progress != this.lastProgress) + { + icrafting.sendProgressBarUpdate(this, 0, this.tileEntity.progress); + } + if ((short) this.tileEntity.energy != this.lastEnergy) + { + icrafting.sendProgressBarUpdate(this, 2, (short) this.tileEntity.energy); + } + } + + this.lastProgress = this.tileEntity.progress; + this.lastEnergy = (short) this.tileEntity.energy; + } + + @Override + public void updateProgressBar(int index, int value) + { + super.updateProgressBar(index, value); + + switch (index) + { + case 0: + this.tileEntity.progress=(short) value; + break; + case 2: + this.tileEntity.energy=value; + break; + } + } + + @Override + public boolean canInteractWith(EntityPlayer var1) { + return tileEntity.isUseableByPlayer(var1); + } +} diff --git a/src/main/java/ihl/processing/chemistry/GaedesMercuryRotaryPumpGui.java b/src/main/java/ihl/processing/chemistry/GaedesMercuryRotaryPumpGui.java new file mode 100644 index 0000000..28c9edc --- /dev/null +++ b/src/main/java/ihl/processing/chemistry/GaedesMercuryRotaryPumpGui.java @@ -0,0 +1,60 @@ +package ihl.processing.chemistry; + +import org.lwjgl.opengl.GL11; + +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.util.ResourceLocation; + +public class GaedesMercuryRotaryPumpGui extends GuiContainer { + + private GaedesMercuryRotaryPumpContainer container; + protected static final ResourceLocation tex = new ResourceLocation("ihl", "textures/gui/GUIGaedesMercuryRotaryPump.png"); + + public GaedesMercuryRotaryPumpGui(GaedesMercuryRotaryPumpContainer latheContainer) { + super(latheContainer); + container = latheContainer; + } + + + @Override + protected void drawGuiContainerForegroundLayer(int par1, int par2) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.renderEngine.bindTexture(tex); + int i1; + if (this.container.tileEntity.getEnergy() > 0D) + { + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + i1 = Math.min(this.container.tileEntity.getGUIEnergy(12),12); + this.drawTexturedModalRect(51, 37 + 12 - i1, 179, 12 - i1, 14, i1 + 2); + } + if (this.container.tileEntity.progress > 0) + { + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(27),27); + this.drawTexturedModalRect(17, 30, getFrameX(i1), getFrameY(i1),24,24); + } + } + + @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); + } + + private int getFrameY(int number) + { + return (number % 10) * 24 + 14; + } + + private int getFrameX(int number) + { + return (number / 10) * 24 + 176; + } +} diff --git a/src/main/java/ihl/processing/chemistry/GaedesMercuryRotaryPumpModel.java b/src/main/java/ihl/processing/chemistry/GaedesMercuryRotaryPumpModel.java new file mode 100644 index 0000000..607d26a --- /dev/null +++ b/src/main/java/ihl/processing/chemistry/GaedesMercuryRotaryPumpModel.java @@ -0,0 +1,64 @@ +package ihl.processing.chemistry; + +import ihl.model.IHLModelRenderer; +import net.minecraft.client.model.ModelBase; +import net.minecraftforge.common.util.ForgeDirection; + +// Date: 17.03.2015 21:30:34 +// Template version 1.1 +// Java generated by Techne +// Keep in mind that you still need to fill in some blanks +// - ZeuX + +public class GaedesMercuryRotaryPumpModel extends ModelBase +{ + //fields + IHLModelRenderer Base; + + public GaedesMercuryRotaryPumpModel() + { + textureWidth = 64; + textureHeight = 32; + setTextureOffset("Base.PipeN1", 0, 0); + setTextureOffset("Base.PipeU3", 0, 0); + setTextureOffset("Base.Shape3", 0, 0); + setTextureOffset("Base.PipeN2", 0, 0); + setTextureOffset("Base.Shape5", 0, 0); + setTextureOffset("Base.Shape6", 0, 0); + setTextureOffset("Base.Shape7", 0, 0); + setTextureOffset("Base.PipeU4", 0, 0); + setTextureOffset("Base.Shape1", 0, 0); + setTextureOffset("Base.PipeW5", 0, 0); + setTextureOffset("Base.Shape2", 0, 0); + setTextureOffset("Base.Shape4", 0, 0); + setTextureOffset("Base.Shape8", 0, 0); + setTextureOffset("Base.PipeW8", 0, 0); + + Base = new IHLModelRenderer(this, "Base"); + Base.setRotationPoint(0F, 16F, 0F); + setRotation(Base, 0F, 0F, 0F); + Base.mirror = true; + Base.addTube("PipeN1", -5F, -5F, -6F, 10, 10, 10,0F,1F,ForgeDirection.NORTH); + Base.addTube("PipeU3", -0.5F, -2.5F, -8F, 1, 2, 1,0.1F,1F,ForgeDirection.UP); + Base.addBox("Shape3", -0.5F, -0.5F, -8F, 1, 1, 2); + Base.addTube("PipeN2", -3F, -2F, 4F, 6, 6, 4,0F,1F,ForgeDirection.NORTH); + Base.addBox("Shape5", -7F, 7F, -6F, 14, 1, 14); + Base.addBox("Shape6", 2F, 1F, -5F, 1, 6, 12); + Base.addBox("Shape7", -3F, 1F, -5F, 1, 6, 12); + Base.addTube("PipeU4", 0F, -8F, -5F, 1, 3, 1,0.1F,1F,ForgeDirection.UP); + Base.addBox("Shape1", 0F, -7F, -5F, 1, 1, 1); + Base.addTube("PipeW5", -1F, -7F, -5F, 8, 1, 1,0.1F,1F,ForgeDirection.WEST); + Base.addBox("Shape2", 4F, -8F, -5F, 1, 2, 1); + Base.addBox("Shape4", 4F, -8F, -1F, 1, 8, 1); + Base.addBox("Shape8", -5F, -8F, -1F, 1, 8, 1); + Base.addTube("PipeW8", -4F, -8F, -1F, 8, 1, 1,0.1F,1F,ForgeDirection.WEST); + } + + private void setRotation(IHLModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + +} diff --git a/src/main/java/ihl/processing/chemistry/GaedesMercuryRotaryPumpTileEntity.java b/src/main/java/ihl/processing/chemistry/GaedesMercuryRotaryPumpTileEntity.java new file mode 100644 index 0000000..186b606 --- /dev/null +++ b/src/main/java/ihl/processing/chemistry/GaedesMercuryRotaryPumpTileEntity.java @@ -0,0 +1,83 @@ +package ihl.processing.chemistry; + +import java.util.List; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ic2.core.ContainerBase; +import ihl.interfaces.IWorkspaceElement; +import ihl.processing.metallurgy.BasicElectricMotorTileEntity; +import ihl.utils.IHLUtils; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + +public class GaedesMercuryRotaryPumpTileEntity extends BasicElectricMotorTileEntity implements IWorkspaceElement{ + + public boolean ready=false; + + public GaedesMercuryRotaryPumpTileEntity() + { + } + + @Override + public void operate() + { + ready=true; + } + + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) + { + return IHLUtils.getThisModItemStack("gaedesMercuryRotaryPump"); + } + + @SuppressWarnings({ "unchecked", "rawtypes" }) + @Override + public List[] getInput() + { + return null; + } + + @Override + public boolean canOperate() + { + return !ready; + } + + @Override + @SideOnly(Side.CLIENT) + public GuiScreen getGui(EntityPlayer player, boolean arg1) { + return new GaedesMercuryRotaryPumpGui(new GaedesMercuryRotaryPumpContainer(player, this)); + } + + @Override + public ContainerBase getGuiContainer(EntityPlayer player) { + return new GaedesMercuryRotaryPumpContainer(player, this); + } + + @Override + public boolean canBeUsed() + { + return ready; + } + + @Override + public void use() + { + ready=false; + } + + @Override + public boolean getIsInvalid() + { + return this.isInvalid(); + } + + @Override + public boolean shouldRenderInPass(int pass) + { + return pass==0; + } + +} diff --git a/src/main/java/ihl/processing/chemistry/LabElectrolyzerContainer.java b/src/main/java/ihl/processing/chemistry/LabElectrolyzerContainer.java new file mode 100644 index 0000000..1be5e01 --- /dev/null +++ b/src/main/java/ihl/processing/chemistry/LabElectrolyzerContainer.java @@ -0,0 +1,73 @@ +package ihl.processing.chemistry; + +import java.util.List; + +import ic2.core.IC2; +import ic2.core.slot.SlotInvSlot; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraftforge.fluids.FluidStack; + +public class LabElectrolyzerContainer extends BasicElectricMotorContainer { + + protected LabElectrolyzerTileEntity tileEntity; + public short lastProgress = -1; + public short lastTemperature = -1; + public short lastEnergy = -1; + public int lastFluidAmount = -1; + public int lastNumberOfFluids = -1; + public int lastFluidAmount2 = -1; + public int lastNumberOfFluids2 = -1; + public int lastFluidAmount3 = -1; + public int lastNumberOfFluids3 = -1; + public List fluidTankFluidList; + public List fluidTankFluidList2; + public List fluidTankFluidList3; + + public LabElectrolyzerContainer(EntityPlayer entityPlayer, LabElectrolyzerTileEntity tileEntity1) { + super(entityPlayer, tileEntity1); + this.tileEntity = tileEntity1; + fluidTankFluidList = this.tileEntity.getFluidTank().getFluidList(); + fluidTankFluidList2 = this.tileEntity.fluidTankAnodeOutput.getFluidList(); + fluidTankFluidList3 = this.tileEntity.fluidTankCathodeOutput.getFluidList(); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.fillInputSlot, 0, 63, 47)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.fillInputSlotAnodeOutput, 0, 109, 47)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.fillInputSlotCathodeOutput, 0, 29, 47)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.drainInputSlot, 0, 63, 11)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.emptyFluidItemsSlot, 0, 29, 11)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.emptyFluidItemsSlot, 1, 63, 29)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.emptyFluidItemsSlot, 2, 109, 11)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.outputSlot, 1, 63, 65)); + } + + @Override + public void detectAndSendChanges() { + super.detectAndSendChanges(); + if (this.tileEntity.getTankAmount() != this.lastFluidAmount + || this.tileEntity.getNumberOfFluidsInTank() != this.lastNumberOfFluids) { + IC2.network.get().sendContainerField(this, "fluidTankFluidList"); + } + + if (this.tileEntity.fluidTankAnodeOutput.getFluidAmount() != this.lastFluidAmount2 + || this.tileEntity.fluidTankAnodeOutput.getNumberOfFluids() != this.lastNumberOfFluids2) { + IC2.network.get().sendContainerField(this, "fluidTankFluidList2"); + } + + if (this.tileEntity.fluidTankCathodeOutput.getFluidAmount() != this.lastFluidAmount3 + || this.tileEntity.fluidTankCathodeOutput.getNumberOfFluids() != this.lastNumberOfFluids3) { + IC2.network.get().sendContainerField(this, "fluidTankFluidList3"); + } + + this.lastNumberOfFluids = this.tileEntity.getNumberOfFluidsInTank(); + this.lastFluidAmount = this.tileEntity.getTankAmount(); + this.lastNumberOfFluids2 = this.tileEntity.fluidTankAnodeOutput.getNumberOfFluids(); + this.lastFluidAmount2 = this.tileEntity.fluidTankAnodeOutput.getFluidAmount(); + this.lastNumberOfFluids3 = this.tileEntity.fluidTankCathodeOutput.getNumberOfFluids(); + this.lastFluidAmount3 = this.tileEntity.fluidTankCathodeOutput.getFluidAmount(); + + } + + @Override + public boolean canInteractWith(EntityPlayer var1) { + return tileEntity.isUseableByPlayer(var1); + } +} diff --git a/src/main/java/ihl/processing/chemistry/LabElectrolyzerGui.java b/src/main/java/ihl/processing/chemistry/LabElectrolyzerGui.java new file mode 100644 index 0000000..3eb14a3 --- /dev/null +++ b/src/main/java/ihl/processing/chemistry/LabElectrolyzerGui.java @@ -0,0 +1,74 @@ +package ihl.processing.chemistry; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ihl.utils.IHLRenderUtils; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.util.ResourceLocation; + +@SideOnly(Side.CLIENT) +public class LabElectrolyzerGui extends GuiContainer { + private static final ResourceLocation background = new ResourceLocation("ihl", + "textures/gui/GUILabElectrolyzer.png"); + private LabElectrolyzerContainer container; + + public LabElectrolyzerGui(LabElectrolyzerContainer container1) { + // the container is instanciated and passed to the superclass for + // handling + super(container1); + this.container = container1; + } + + @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) { + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + i1 = Math.min(this.container.tileEntity.getGUIEnergy(12), 12); + this.drawTexturedModalRect(12, 16 + 12 - i1, 179, 12 - i1, 14, i1 + 2); + } + if (this.container.tileEntity.progress > 0) { + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(27), 27); + this.drawTexturedModalRect(81, 31, getFrameX(i1), getFrameY(i1), 24, 24); + } + if (this.container.tileEntity.getTankAmount() > 0) { + IHLRenderUtils.instance.renderIHLFluidTank(this.container.tileEntity.getFluidTank(), 83, 15, 104, 81, zLevel, + par1, par2, xOffset, yOffset); + } + if (this.container.tileEntity.fluidTankCathodeOutput.getFluidAmount() > 0) { + IHLRenderUtils.instance.renderIHLFluidTank(this.container.tileEntity.fluidTankCathodeOutput, 48, 24, 59, 81, + zLevel, par1, par2, xOffset, yOffset); + } + if (this.container.tileEntity.fluidTankAnodeOutput.getFluidAmount() > 0) { + IHLRenderUtils.instance.renderIHLFluidTank(this.container.tileEntity.fluidTankAnodeOutput, 128, 24, 139, 81, + zLevel, par1, par2, xOffset, yOffset); + } + } + + @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(background); + int x = (width - xSize) / 2; + int y = (height - ySize) / 2; + this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); + } + + private int getFrameY(int number) { + return (number % 10) * 24 + 14; + } + + private int getFrameX(int number) { + return (number / 10) * 24 + 176; + } +} \ No newline at end of file diff --git a/src/main/java/ihl/processing/chemistry/LabElectrolyzerTileEntity.java b/src/main/java/ihl/processing/chemistry/LabElectrolyzerTileEntity.java new file mode 100644 index 0000000..19348b6 --- /dev/null +++ b/src/main/java/ihl/processing/chemistry/LabElectrolyzerTileEntity.java @@ -0,0 +1,272 @@ +package ihl.processing.chemistry; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ic2.core.ContainerBase; +import ic2.core.IC2; +import ic2.core.block.invslot.InvSlot; +import ic2.core.block.invslot.InvSlotConsumableLiquid; +import ic2.core.block.invslot.InvSlotOutput; +import ihl.processing.invslots.IHLInvSlotOutput; +import ihl.processing.invslots.InvSlotConsumableLiquidIHL; +import ihl.processing.metallurgy.BasicElectricMotorTileEntity; +import ihl.recipes.UniversalRecipeInput; +import ihl.recipes.UniversalRecipeManager; +import ihl.recipes.UniversalRecipeOutput; +import ihl.utils.IHLFluidTank; +import ihl.utils.IHLUtils; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidHandler; + +public class LabElectrolyzerTileEntity extends BasicElectricMotorTileEntity implements IFluidHandler { + private final static UniversalRecipeManager recipeManager = new UniversalRecipeManager("labelectrolyzer"); + public final IHLInvSlotOutput outputSlot; + public final InvSlotConsumableLiquidIHL drainInputSlot; + public final InvSlotConsumableLiquidIHL fillInputSlot; + public final InvSlotConsumableLiquidIHL fillInputSlotAnodeOutput; + public final InvSlotConsumableLiquidIHL fillInputSlotCathodeOutput; + public final InvSlotOutput emptyFluidItemsSlot; + private final IHLFluidTank fluidTank = new IHLFluidTank(2000); + public final IHLFluidTank fluidTankAnodeOutput = new IHLFluidTank(8000); + public final IHLFluidTank fluidTankCathodeOutput = new IHLFluidTank(8000); + public short temperature = 20; + + public LabElectrolyzerTileEntity() { + super(); + this.energyConsume *= 10; + this.outputSlot = new IHLInvSlotOutput(this, "output", 0, 2); + 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.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); + } + + @Override + public void readFromNBT(NBTTagCompound nbttagcompound) { + super.readFromNBT(nbttagcompound); + this.fluidTank.readFromNBT(nbttagcompound.getCompoundTag("fluidTank")); + this.fluidTankAnodeOutput.readFromNBT(nbttagcompound.getCompoundTag("fluidTankAnodeOutput")); + this.fluidTankCathodeOutput.readFromNBT(nbttagcompound.getCompoundTag("fluidTankCathodeOutput")); + } + + @Override + public void writeToNBT(NBTTagCompound nbttagcompound) { + super.writeToNBT(nbttagcompound); + NBTTagCompound fluidTankTag = new NBTTagCompound(); + this.fluidTank.writeToNBT(fluidTankTag); + nbttagcompound.setTag("fluidTank", fluidTankTag); + + NBTTagCompound fluidTankAnodeTag = new NBTTagCompound(); + this.fluidTankAnodeOutput.writeToNBT(fluidTankAnodeTag); + nbttagcompound.setTag("fluidTankAnodeOutput", fluidTankAnodeTag); + + NBTTagCompound fluidTankCathodeTag = new NBTTagCompound(); + this.fluidTankCathodeOutput.writeToNBT(fluidTankCathodeTag); + nbttagcompound.setTag("fluidTankCathodeOutput", fluidTankCathodeTag); + } + + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { + return this.getFacing() != side; + } + + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { + return IHLUtils.getThisModItemStack("labElectrolyzer"); + } + + @Override + public boolean enableUpdateEntity() { + return IC2.platform.isSimulating(); + } + + @Override + public void updateEntityServer() { + super.updateEntityServer(); + IHLUtils.handleFluidSlotsBehaviour(fillInputSlot, drainInputSlot, emptyFluidItemsSlot, fluidTank); + IHLUtils.handleFluidSlotsBehaviour(fillInputSlotAnodeOutput, null, emptyFluidItemsSlot, fluidTankAnodeOutput); + IHLUtils.handleFluidSlotsBehaviour(fillInputSlotCathodeOutput, null, emptyFluidItemsSlot, + fluidTankCathodeOutput); + } + + @Override + public FluidStack drain(ForgeDirection direction, int amount, boolean doDrain) { + if (this.canDrain(direction, null)) { + if (direction.equals(ForgeDirection.getOrientation(this.getFacing()).getRotation(ForgeDirection.UP))) { + return this.fluidTankAnodeOutput.drain(amount, doDrain); + } + if (direction.equals(ForgeDirection.getOrientation(this.getFacing()).getRotation(ForgeDirection.DOWN))) { + return this.fluidTankCathodeOutput.drain(amount, doDrain); + } + return this.fluidTank.drain(amount, doDrain); + } + return null; + } + + // 1.7.10 API + @Override + public boolean canDrain(ForgeDirection direction, Fluid arg1) { + return direction.equals(ForgeDirection.getOrientation(this.getFacing()).getRotation(ForgeDirection.UP)) + || direction.equals(ForgeDirection.getOrientation(this.getFacing()).getRotation(ForgeDirection.DOWN)) + || direction.equals(ForgeDirection.DOWN); + } + + @Override + public boolean canFill(ForgeDirection direction, Fluid arg1) { + return direction.equals(ForgeDirection.getOrientation(this.getFacing()).getOpposite()); + } + + @Override + public String getInventoryName() { + return "labElectrolizer"; + } + + @Override + public int gaugeProgressScaled(int i) { + return this.progress * i / operationLength; + } + + @Override + @SideOnly(Side.CLIENT) + public GuiScreen getGui(EntityPlayer player, boolean arg1) { + return new LabElectrolyzerGui(new LabElectrolyzerContainer(player, this)); + } + + @Override + public ContainerBase getGuiContainer(EntityPlayer player) { + this.fluidTank.sortFluidsByDensity(); + return new LabElectrolyzerContainer(player, this); + } + + @Override + public void onGuiClosed(EntityPlayer player) { + } + + @Override + public boolean canOperate() { + UniversalRecipeOutput output = getOutput(); + if (output != null) { + if (getOutput().getItemOutputs() != null && !getOutput().getItemOutputs().isEmpty() + && getOutput().getItemOutputs().get(0) != null) { + return this.outputSlot.canAdd(getOutput().getItemOutputs()); + } else { + return this.fluidTankAnodeOutput.getFluidAmount() < this.fluidTankAnodeOutput.getCapacity() + && this.fluidTankAnodeOutput.getFluidAmount() < this.fluidTankCathodeOutput.getCapacity(); + } + } + return false; + } + + public UniversalRecipeOutput getOutput() { + return LabElectrolyzerTileEntity.recipeManager.getOutputFor(this.getInput()); + } + + @SuppressWarnings({ "unchecked", "rawtypes" }) + @Override + public List[] getInput() { + return new List[] { Arrays.asList(new FluidStack[] { fluidTank.getFluid() }), null }; + } + + @Override + public void operate() { + UniversalRecipeInput recipeInput = LabElectrolyzerTileEntity.recipeManager.getRecipeInput(getInput()); + UniversalRecipeOutput output1 = getOutput(); + this.fluidTank.drain(recipeInput.getFluidInputs().get(0), true); + if (output1.getFluidOutputs().size() > 0) + this.fluidTankAnodeOutput.fill(output1.getFluidOutputs().get(0).copy(), true); + if (output1.getFluidOutputs().size() > 1) + this.fluidTankCathodeOutput.fill(output1.getFluidOutputs().get(1).copy(), true); + if (!output1.getItemOutputs().isEmpty() && output1.getItemOutputs().get(0) != null) + this.outputSlot.add(output1.getItemOutputs()); + } + + @Override + public FluidStack drain(ForgeDirection direction, FluidStack fluidStack, boolean doDrain) { + if (this.fluidTankAnodeOutput.getFluid().containsFluid(fluidStack)) { + return this.fluidTankAnodeOutput.drain(fluidStack.amount, doDrain); + } else if (this.fluidTankCathodeOutput.getFluid().containsFluid(fluidStack)) { + return this.fluidTankCathodeOutput.drain(fluidStack.amount, doDrain); + } + return null; + } + + @Override + public int fill(ForgeDirection arg0, FluidStack arg1, boolean arg2) { + return this.fluidTank.fill(arg1, arg2); + } + + @Override + public FluidTankInfo[] getTankInfo(ForgeDirection direction) { + if (direction.equals(ForgeDirection.getOrientation(this.getFacing()).getRotation(ForgeDirection.UP))) { + return new FluidTankInfo[] { this.fluidTankAnodeOutput.getInfo() }; + } + if (direction.equals(ForgeDirection.getOrientation(this.getFacing()).getRotation(ForgeDirection.DOWN))) { + return new FluidTankInfo[] { this.fluidTankCathodeOutput.getInfo() }; + } + return new FluidTankInfo[] { this.fluidTank.getInfo() }; + + } + + public boolean needsFluid() { + return this.fluidTank.getFluidAmount() <= this.fluidTank.getCapacity(); + } + + public FluidStack getFluidStackfromTank() { + return this.fluidTank.getFluid(); + } + + public int getTankAmount() { + return this.fluidTank.getFluidAmount(); + } + + public int gaugeLiquidScaled(int i, int index) { + return this.fluidTank.getFluidAmount() <= 0 ? 0 + : this.fluidTank.getFluidAmount(index) * i / this.fluidTank.getCapacity(); + } + + public static void addRecipe(UniversalRecipeInput input, UniversalRecipeOutput output) { + recipeManager.addRecipe(input, output); + } + + public int getNumberOfFluidsInTank() { + return this.fluidTank.getNumberOfFluids(); + } + + public static Map getRecipes() { + return recipeManager.getRecipes(); + } + + public static void addRecipe(FluidStack fluidStackInput1, FluidStack fluidStackOutputAnode, + FluidStack fluidStackOutputCathode, ItemStack itemStackOutput1) { + if (itemStackOutput1 != null) { + addRecipe(new UniversalRecipeInput((new FluidStack[] { fluidStackInput1 }), null), + new UniversalRecipeOutput((new FluidStack[] { fluidStackOutputAnode, fluidStackOutputCathode }), + (new ItemStack[] { itemStackOutput1 }), 200)); + } else { + addRecipe(new UniversalRecipeInput((new FluidStack[] { fluidStackInput1 }), null), + new UniversalRecipeOutput((new FluidStack[] { fluidStackOutputAnode, fluidStackOutputCathode }), + null, 200)); + } + } + + public IHLFluidTank getFluidTank() { + return this.fluidTank; + } + +} \ No newline at end of file diff --git a/src/main/java/ihl/processing/chemistry/LeadOvenContainer.java b/src/main/java/ihl/processing/chemistry/LeadOvenContainer.java new file mode 100644 index 0000000..2f0ff8a --- /dev/null +++ b/src/main/java/ihl/processing/chemistry/LeadOvenContainer.java @@ -0,0 +1,95 @@ +package ihl.processing.chemistry; + +import java.util.List; + +import ic2.core.ContainerBase; +import ic2.core.IC2; +import ic2.core.slot.SlotInvSlot; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.Slot; +import net.minecraftforge.fluids.FluidStack; + +public class LeadOvenContainer extends ContainerBase { + + protected LeadOvenTileEntity tileEntity; + public int lastInputFluidAmount = -1; + public int lastOutputFluidAmount = -1; + public int lastFuel = -1; + public short lastProgress = -1; + private final static int height = 166; + public List inputTankFluidList; + public List outputTankFluidList; + + public LeadOvenContainer(EntityPlayer entityPlayer, LeadOvenTileEntity tileEntity1) { + super(tileEntity1); + this.tileEntity = tileEntity1; + inputTankFluidList = this.tileEntity.inputTank.getFluidList(); + outputTankFluidList = this.tileEntity.outputTank.getFluidList(); + 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.fuelSlot, 0, 56, 53)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.inputSlot, 0, 47, 17)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.inputSlot, 1, 65, 17)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.outputSlot, 0, 112, 35)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.fillInputSlot, 0, 9, 53)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.drainInputSlot, 0, 9, 17)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.emptyFluidItemsSlot, 0, 9, 35)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.fillInputSlot2, 0, 150, 53)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.drainInputSlot2, 0, 150, 17)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.emptyFluidItemsSlot, 1, 150, 35)); + } + + @Override + public void detectAndSendChanges() { + super.detectAndSendChanges(); + for (int i = 0; i < this.crafters.size(); ++i) { + ICrafting icrafting = (ICrafting) this.crafters.get(i); + if (this.tileEntity.inputTank.getFluidAmount() != this.lastInputFluidAmount) { + IC2.network.get().sendContainerField(this, "inputTankFluidList"); + } + if (this.tileEntity.outputTank.getFluidAmount() != this.lastOutputFluidAmount) { + IC2.network.get().sendContainerField(this, "outputTankFluidList"); + } + + if (this.tileEntity.fuel != this.lastFuel) { + icrafting.sendProgressBarUpdate(this, 0, this.tileEntity.fuel); + } + + if (this.tileEntity.progress != this.lastProgress) { + icrafting.sendProgressBarUpdate(this, 1, this.tileEntity.progress); + } + } + this.lastFuel = this.tileEntity.fuel; + this.lastProgress = this.tileEntity.progress; + this.lastInputFluidAmount = this.tileEntity.inputTank.getFluidAmount(); + this.lastOutputFluidAmount = this.tileEntity.outputTank.getFluidAmount(); + } + + @Override + public void updateProgressBar(int index, int value) { + super.updateProgressBar(index, value); + + switch (index) { + case 0: + this.tileEntity.fuel = value; + break; + case 1: + this.tileEntity.progress = (short) value; + break; + } + } + + @Override + public boolean canInteractWith(EntityPlayer var1) { + return tileEntity.isUseableByPlayer(var1); + } +} diff --git a/src/main/java/ihl/processing/chemistry/LeadOvenGui.java b/src/main/java/ihl/processing/chemistry/LeadOvenGui.java new file mode 100644 index 0000000..72fb107 --- /dev/null +++ b/src/main/java/ihl/processing/chemistry/LeadOvenGui.java @@ -0,0 +1,55 @@ +package ihl.processing.chemistry; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ihl.utils.IHLRenderUtils; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.util.ResourceLocation; + +@SideOnly(Side.CLIENT) +public class LeadOvenGui extends GuiContainer { + private static final ResourceLocation background = new ResourceLocation("ihl", "textures/gui/GUILeadOven.png"); + private LeadOvenContainer container; + + public LeadOvenGui(LeadOvenContainer container1) { + // the container is instanciated and passed to the superclass for + // handling + super(container1); + this.container = container1; + } + + @Override + protected void drawGuiContainerForegroundLayer(int par1, int par2) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.renderEngine.bindTexture(background); + int x = (width - xSize) / 2; + int y = (height - ySize) / 2; + if (this.container.tileEntity.inputTank.getFluidAmount() > 0) { + IHLRenderUtils.instance.renderIHLFluidTank(this.container.tileEntity.inputTank, 30, 19, 42, 66, zLevel, + par1, par2, x, y); + } + if (this.container.tileEntity.outputTank.getFluidAmount() > 0) { + IHLRenderUtils.instance.renderIHLFluidTank(this.container.tileEntity.outputTank, 133, 19, 145, 66, zLevel, + par1, par2, x, y); + } + } + + @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(background); + int x = (width - xSize) / 2; + int y = (height - ySize) / 2; + this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); + int i1; + if (this.container.tileEntity.fuel > 0) { + i1 = this.container.tileEntity.gaugeFuelScaled(12); + this.drawTexturedModalRect(x + 56, y + 36 + 12 - i1, 176, 12 - i1, 14, i1 + 2); + } + i1 = this.container.tileEntity.gaugeProgressScaled(24); + this.drawTexturedModalRect(x + 79, y + 34, 176, 14, i1 + 1, 16); + } +} \ No newline at end of file diff --git a/src/main/java/ihl/processing/chemistry/LeadOvenTileEntity.java b/src/main/java/ihl/processing/chemistry/LeadOvenTileEntity.java new file mode 100644 index 0000000..95636ad --- /dev/null +++ b/src/main/java/ihl/processing/chemistry/LeadOvenTileEntity.java @@ -0,0 +1,286 @@ +package ihl.processing.chemistry; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +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; +import ic2.core.block.invslot.InvSlot.Access; +import ic2.core.block.invslot.InvSlotConsumableFuel; +import ic2.core.block.invslot.InvSlotConsumableLiquid; +import ic2.core.block.invslot.InvSlotOutput; +import ihl.processing.invslots.IHLInvSlotOutput; +import ihl.processing.invslots.InvSlotConsumableLiquidIHL; +import ihl.recipes.RecipeOutputItemStack; +import ihl.recipes.UniversalRecipeInput; +import ihl.recipes.UniversalRecipeManager; +import ihl.recipes.UniversalRecipeOutput; +import ihl.utils.IHLFluidTank; +import ihl.utils.IHLUtils; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidHandler; + +public class LeadOvenTileEntity extends TileEntityInventory implements IHasGui, IFluidHandler { + public final InvSlotConsumableFuel fuelSlot; + public final ApparatusProcessableInvSlot inputSlot; + public final IHLInvSlotOutput outputSlot; + public final IHLFluidTank inputTank = new IHLFluidTank(1000); + public final IHLFluidTank outputTank = new IHLFluidTank(1000); + public final InvSlotConsumableLiquidIHL drainInputSlot; + public final InvSlotConsumableLiquidIHL fillInputSlot; + public final InvSlotOutput emptyFluidItemsSlot; + public final InvSlotConsumableLiquidIHL drainInputSlot2; + public final InvSlotConsumableLiquidIHL fillInputSlot2; + public short progress = 0; + public final short maxProgress = 160; + public int fuel = 0; + public int maxFuel = 0; + protected static final UniversalRecipeManager recipeManager = new UniversalRecipeManager("chemicaloven"); + + public LeadOvenTileEntity() { + super(); + this.fuelSlot = new InvSlotConsumableFuel(this, "fuel", 1, 1, true); + this.inputSlot = new ApparatusProcessableInvSlot(this, "input", 2, Access.IO, 2, 64); + this.outputSlot = new IHLInvSlotOutput(this, "output", 0, 1); + 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.drainInputSlot2 = new InvSlotConsumableLiquidIHL(this, "drainInput", -1, InvSlot.Access.I, 1, + InvSlot.InvSide.TOP, InvSlotConsumableLiquid.OpType.Drain); + this.fillInputSlot2 = new InvSlotConsumableLiquidIHL(this, "fillInput", -1, InvSlot.Access.I, 1, + InvSlot.InvSide.BOTTOM, InvSlotConsumableLiquid.OpType.Fill); + this.emptyFluidItemsSlot = new InvSlotOutput(this, "fluidCellsOutput", 2, 2); + } + + public static void addRecipe(UniversalRecipeInput input, UniversalRecipeOutput output) { + recipeManager.addRecipe(input, output); + } + + @Override + public void readFromNBT(NBTTagCompound nbttagcompound) { + super.readFromNBT(nbttagcompound); + this.fuel = nbttagcompound.getInteger("fuel"); + this.maxFuel = nbttagcompound.getInteger("maxFuel"); + this.progress = nbttagcompound.getShort("progress"); + this.inputTank.readFromNBT(nbttagcompound.getCompoundTag("inputTank")); + this.outputTank.readFromNBT(nbttagcompound.getCompoundTag("outputTank")); + } + + @Override + public void writeToNBT(NBTTagCompound nbttagcompound) { + super.writeToNBT(nbttagcompound); + nbttagcompound.setInteger("fuel", this.fuel); + nbttagcompound.setInteger("maxFuel", this.maxFuel); + nbttagcompound.setShort("progress", this.progress); + NBTTagCompound inputTankTag = new NBTTagCompound(); + this.inputTank.writeToNBT(inputTankTag); + nbttagcompound.setTag("inputTank", inputTankTag); + NBTTagCompound outputTankTag = new NBTTagCompound(); + this.outputTank.writeToNBT(outputTankTag); + nbttagcompound.setTag("outputTank", outputTankTag); + } + + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { + return this.getFacing() != (short) side && side != 0 && side != 1; + } + + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { + return IHLUtils.getThisModItemStack("leadOven"); + } + + public int gaugeProgressScaled(int i) { + return this.progress * i / maxProgress; + } + + public int gaugeFuelScaled(int i) { + if (this.maxFuel == 0) { + this.maxFuel = this.fuel; + + if (this.maxFuel == 0) { + this.maxFuel = 160; + } + } + + return this.fuel * i / this.maxFuel; + } + + public boolean enableUpdateEntity() { + return IC2.platform.isSimulating(); + } + + @Override + public void updateEntityServer() { + super.updateEntityServer(); + IHLUtils.handleFluidSlotsBehaviour(fillInputSlot, drainInputSlot, emptyFluidItemsSlot, inputTank); + IHLUtils.handleFluidSlotsBehaviour(fillInputSlot2, drainInputSlot2, emptyFluidItemsSlot, outputTank); + if (this.fuel <= 0 && this.canOperate()) { + this.fuel = this.maxFuel = this.fuelSlot.consumeFuel(); + } + + if (this.isBurning() && this.canOperate()) { + ++this.progress; + + if (this.progress >= maxProgress) { + this.progress = 0; + this.operate(); + } + } else { + this.progress = 0; + } + + if (this.fuel > 0) { + --this.fuel; + } + + if (this.getActive() != this.isBurning()) { + this.setActive(this.isBurning()); + } + } + + public boolean isBurning() { + return this.fuel > 0; + } + + public boolean canOperate() { + return this.getOutput() != null; + } + + /** + * Returns the name of the inventory + */ + @Override + public String getInventoryName() { + return "goldOven"; + } + + @Override + public ContainerBase getGuiContainer(EntityPlayer entityPlayer) { + return new LeadOvenContainer(entityPlayer, this); + } + + @Override + @SideOnly(Side.CLIENT) + public GuiScreen getGui(EntityPlayer entityPlayer, boolean isAdmin) { + return new LeadOvenGui(new LeadOvenContainer(entityPlayer, this)); + } + + @Override + public void onGuiClosed(EntityPlayer entityPlayer) { + } + + public UniversalRecipeOutput getOutput() { + return LeadOvenTileEntity.recipeManager.getOutputFor(this.getInput()); + } + + @SuppressWarnings("rawtypes") + public List[] getInput() { + if (this.inputSlot.get(1) != null) { + return new List[] { this.inputTank.getFluidList(), + Arrays.asList(new ItemStack[] { this.inputSlot.get(0), this.inputSlot.get(1) }) }; + } + return new List[] { this.inputTank.getFluidList(), Arrays.asList(new ItemStack[] { this.inputSlot.get() }) }; + } + + public void operate() { + UniversalRecipeInput rinput = LeadOvenTileEntity.recipeManager.getRecipeInput(getInput()); + List rinputItems = rinput.getItemInputs(); + UniversalRecipeOutput routput = LeadOvenTileEntity.recipeManager.getOutputFor(getInput()); + List output2 = routput.getFluidOutputs(); + if (!output2.isEmpty()) { + this.outputTank.fill(output2.get(0), true); + } + this.inputTank.drain(rinput.getFluidInputs(), true); + List itemOutputs = routput.getItemOutputs(); + if (itemOutputs != null && !itemOutputs.isEmpty()) { + this.outputSlot.add(itemOutputs); + } + for (int i = 0; i < rinputItems.size(); i++) { + this.inputSlot.consume(rinputItems.get(i)); + } + + } + + @Override + public FluidStack drain(ForgeDirection from, int amount, boolean doDrain) { + switch (from) { + case UP: + return this.outputTank.drainLightest(amount, doDrain); + case NORTH: + return this.outputTank.drainLightest(amount, doDrain); + case SOUTH: + return this.outputTank.drainLightest(amount, doDrain); + case WEST: + return this.outputTank.drainLightest(amount, doDrain); + case EAST: + return this.outputTank.drainLightest(amount, doDrain); + case DOWN: + return this.outputTank.drain(amount, doDrain); + default: + return this.outputTank.drain(amount, doDrain); + } + } + + // 1.7.10 API + @Override + public boolean canDrain(ForgeDirection arg0, Fluid arg1) { + return true; + } + + @Override + public boolean canFill(ForgeDirection direction, Fluid arg1) { + return direction.equals(ForgeDirection.getOrientation(this.getFacing()).getOpposite()); + } + + public static void addRecipe(UniversalRecipeInput input, FluidStack fluidStackWithSize) { + recipeManager.addRecipe(input, new UniversalRecipeOutput((new FluidStack[] { fluidStackWithSize }), null, 20)); + } + + public static Map getRecipes() { + return recipeManager.getRecipes(); + } + + public static void addRecipe(IRecipeInput recipeInputOreDict, FluidStack fluidStackOutput, ItemStack output) { + recipeManager.addRecipe(new UniversalRecipeInput(null, (new IRecipeInput[] { recipeInputOreDict })), + new UniversalRecipeOutput((new FluidStack[] { fluidStackOutput }), (new ItemStack[] { output }), 20)); + } + + public static void addRecipe(IRecipeInput input, ItemStack output) { + recipeManager.addRecipe(new UniversalRecipeInput(null, (new IRecipeInput[] { input })), + new UniversalRecipeOutput(null, (new ItemStack[] { output }), 20)); + } + + @Override + public FluidStack drain(ForgeDirection arg0, FluidStack fluidStack, boolean doDrain) { + if (outputTank.getFluid() != null && outputTank.getFluid().containsFluid(fluidStack)) { + return this.outputTank.drain(fluidStack, doDrain); + } + return null; + } + + @Override + public int fill(ForgeDirection arg0, FluidStack arg1, boolean arg2) { + return this.inputTank.fill(arg1, arg2); + } + + @Override + public FluidTankInfo[] getTankInfo(ForgeDirection arg0) { + return new FluidTankInfo[] { this.inputTank.getInfo() }; + } +} \ No newline at end of file diff --git a/src/main/java/ihl/processing/chemistry/LoomContainer.java b/src/main/java/ihl/processing/chemistry/LoomContainer.java new file mode 100644 index 0000000..2d480ef --- /dev/null +++ b/src/main/java/ihl/processing/chemistry/LoomContainer.java @@ -0,0 +1,66 @@ +package ihl.processing.chemistry; + +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 LoomContainer extends ContainerBase { + + public LoomTileEntity tileEntity; + public int lastProgress = -1; + private final static int height=166; + + public LoomContainer(EntityPlayer entityPlayer, + LoomTileEntity lathePart1TileEntity) { + super(lathePart1TileEntity); + tileEntity=lathePart1TileEntity; + 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(lathePart1TileEntity.input, 0, 8, 44)); + this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.output, 0, 127, 44)); + } + + @Override + public void detectAndSendChanges() + { + super.detectAndSendChanges(); + for (int i = 0; i < this.crafters.size(); ++i) + { + ICrafting icrafting = (ICrafting)this.crafters.get(i); + if (this.tileEntity.progress != this.lastProgress) + { + icrafting.sendProgressBarUpdate(this, 0, this.tileEntity.progress); + } + } + this.lastProgress = this.tileEntity.progress; + } + + @Override + public void updateProgressBar(int index, int value) + { + super.updateProgressBar(index, value); + + switch (index) + { + case 0: + this.tileEntity.progress=(short) value; + break; + + } + } + +} diff --git a/src/main/java/ihl/processing/chemistry/LoomGui.java b/src/main/java/ihl/processing/chemistry/LoomGui.java new file mode 100644 index 0000000..4964687 --- /dev/null +++ b/src/main/java/ihl/processing/chemistry/LoomGui.java @@ -0,0 +1,60 @@ +package ihl.processing.chemistry; + +import org.lwjgl.opengl.GL11; + +import ic2.core.IC2; +import ihl.utils.IHLRenderUtils; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; + +public class LoomGui extends GuiContainer { + + private LoomContainer container; + protected static final ResourceLocation tex = new ResourceLocation("ihl", "textures/gui/GUILoom.png"); + + public LoomGui(LoomContainer 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); + } + IHLRenderUtils.instance.drawTooltip(par1,par2,9,11,xOffset,yOffset,StatCollector.translateToLocal("ihl.coiler.tip")); + } + + @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/src/main/java/ihl/processing/chemistry/LoomModel.java b/src/main/java/ihl/processing/chemistry/LoomModel.java new file mode 100644 index 0000000..31c2724 --- /dev/null +++ b/src/main/java/ihl/processing/chemistry/LoomModel.java @@ -0,0 +1,66 @@ +package ihl.processing.chemistry; + +import ihl.model.IHLModelRenderer; +import net.minecraft.client.model.ModelBase; +import net.minecraftforge.common.util.ForgeDirection; + +public class LoomModel extends ModelBase +{ + //fields + IHLModelRenderer RotatePart; + IHLModelRenderer Piece1; + + public LoomModel() + { + 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/src/main/java/ihl/processing/chemistry/LoomTileEntity.java b/src/main/java/ihl/processing/chemistry/LoomTileEntity.java new file mode 100644 index 0000000..8432a2d --- /dev/null +++ b/src/main/java/ihl/processing/chemistry/LoomTileEntity.java @@ -0,0 +1,172 @@ +package ihl.processing.chemistry; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +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 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; + +public class LoomTileEntity extends TileEntityInventory implements IHasGui, INetworkClientTileEntityEventListener +{ + protected static UniversalRecipeManager recipeManager = new UniversalRecipeManager("loom"); + public short progress; + protected short operationLength=200; + public final ApparatusProcessableInvSlot input; + public final IHLInvSlotOutput output; + boolean isGuiScreenOpened=false; + + public LoomTileEntity() + { + 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 "Loom"; + } + + @Override + public ItemStack getWrenchDrop(EntityPlayer player) + { + return IHLUtils.getThisModItemStack("loom"); + } + + @Override + @SideOnly(Side.CLIENT) + public GuiScreen getGui(EntityPlayer player, boolean arg1) { + return new LoomGui(new LoomContainer(player, this)); + } + + @Override + public ContainerBase getGuiContainer(EntityPlayer player) { + this.isGuiScreenOpened=true; + return new LoomContainer(player, this); + } + + public void operate() + { + List input1 = LoomTileEntity.recipeManager.getRecipeInput(getInput()).getItemInputs(); + List output1 = LoomTileEntity.recipeManager.getOutputFor(getInput()).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(input1.get(0)); + } + } + + @SuppressWarnings("rawtypes") + public List[] getInput() + { + return new List[] {null,Arrays.asList(new ItemStack[] {input.get()})}; + } + + public boolean canOperate() + { + if(LoomTileEntity.recipeManager.getOutputFor(getInput())==null) return false; + List output1 = LoomTileEntity.recipeManager.getOutputFor(getInput()).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,new ItemStack[] {input}), new UniversalRecipeOutput(null, 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/src/main/java/ihl/processing/chemistry/PaperMachineContainer.java b/src/main/java/ihl/processing/chemistry/PaperMachineContainer.java new file mode 100644 index 0000000..01db6fd --- /dev/null +++ b/src/main/java/ihl/processing/chemistry/PaperMachineContainer.java @@ -0,0 +1,41 @@ +package ihl.processing.chemistry; + +import java.util.List; + +import ic2.core.IC2; +import ic2.core.slot.SlotInvSlot; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraftforge.fluids.FluidStack; + +public class PaperMachineContainer extends BasicElectricMotorContainer { + + protected PaperMachineTileEntity tileEntity; + public int lastFluidAmount = -1; + public int lastNumberOfFluids = -1; + public short lastProgress = -1; + public short lastTemperature = -1; + public short lastEnergy = -1; + public List fluidTankFluidList; + + public PaperMachineContainer(EntityPlayer entityPlayer, PaperMachineTileEntity tileEntity1){ + super(entityPlayer, tileEntity1); + this.tileEntity = tileEntity1; + fluidTankFluidList=this.tileEntity.getFluidTank().getFluidList(); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.fillInputSlot, 0, 78, 51)); + 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)); + } + + @Override + public void detectAndSendChanges() + { + super.detectAndSendChanges(); + if (this.tileEntity.getTankAmount() != this.lastFluidAmount || this.tileEntity.getNumberOfFluidsInTank() != this.lastNumberOfFluids) + { + IC2.network.get().sendContainerField(this, "fluidTankFluidList"); + } + this.lastNumberOfFluids = this.tileEntity.getNumberOfFluidsInTank(); + this.lastFluidAmount = this.tileEntity.getTankAmount(); + } +} diff --git a/src/main/java/ihl/processing/chemistry/PaperMachineGui.java b/src/main/java/ihl/processing/chemistry/PaperMachineGui.java new file mode 100644 index 0000000..8fea247 --- /dev/null +++ b/src/main/java/ihl/processing/chemistry/PaperMachineGui.java @@ -0,0 +1,79 @@ +package ihl.processing.chemistry; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ihl.utils.IHLRenderUtils; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.util.ResourceLocation; + +@SideOnly(Side.CLIENT) +public class PaperMachineGui extends GuiContainer { + private static final ResourceLocation background = new ResourceLocation("ihl", "textures/gui/GUIPaperMachine.png"); + private PaperMachineContainer container; + private int mixerFrame=0; + + public PaperMachineGui (PaperMachineContainer container1) { + //the container is instanciated and passed to the superclass for handling + super(container1); + this.container=container1; + } + + @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) + { + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + i1 = Math.min(this.container.tileEntity.getGUIEnergy(12),12); + this.drawTexturedModalRect(12, 16 + 12 - i1, 179, 12 - i1, 14, i1 + 2); + } + if (this.container.tileEntity.progress > 0) + { + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(27),27); + this.drawTexturedModalRect(38, 29, getFrameX(i1), getFrameY(i1),24,24); + if(mixerFrame++>4) + { + mixerFrame=0; + } + } + else + { + mixerFrame=0; + } + this.drawTexturedModalRect(103, 52, 246, 226+6*mixerFrame,10,6); + if (this.container.tileEntity.getTankAmount() > 0) + { + IHLRenderUtils.instance.renderIHLFluidTank(this.container.tileEntity.getFluidTank(), 102, 28, 114, 59, zLevel, par1, par2, xOffset, yOffset); + } + } + + @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(background); + int x = (width - xSize) / 2; + int y = (height - ySize) / 2; + this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); + } + + private int getFrameY(int number) + { + return (number % 10) * 24 + 14; + } + + private int getFrameX(int number) + { + return (number / 10) * 24 + 176; + } +} \ No newline at end of file diff --git a/src/main/java/ihl/processing/chemistry/PaperMachineTileEntity.java b/src/main/java/ihl/processing/chemistry/PaperMachineTileEntity.java new file mode 100644 index 0000000..dddd306 --- /dev/null +++ b/src/main/java/ihl/processing/chemistry/PaperMachineTileEntity.java @@ -0,0 +1,261 @@ +package ihl.processing.chemistry; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ic2.core.ContainerBase; +import ic2.core.IC2; +import ic2.core.block.invslot.InvSlot; +import ic2.core.block.invslot.InvSlotConsumableLiquid; +import ic2.core.block.invslot.InvSlotOutput; +import ihl.processing.invslots.IHLInvSlotOutput; +import ihl.processing.invslots.InvSlotConsumableLiquidIHL; +import ihl.processing.metallurgy.BasicElectricMotorTileEntity; +import ihl.recipes.UniversalRecipeInput; +import ihl.recipes.UniversalRecipeManager; +import ihl.recipes.UniversalRecipeOutput; +import ihl.utils.IHLFluidTank; +import ihl.utils.IHLUtils; +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; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidHandler; + +public class PaperMachineTileEntity extends BasicElectricMotorTileEntity implements IFluidHandler +{ + private final static UniversalRecipeManager recipeManager = new UniversalRecipeManager("papermachine"); + public final IHLInvSlotOutput outputSlot; + public final InvSlotConsumableLiquidIHL drainInputSlot; + public final InvSlotConsumableLiquidIHL fillInputSlot; + public final InvSlotOutput emptyFluidItemsSlot; + private final IHLFluidTank fluidTank = new IHLFluidTank(8000); + public short temperature=20; + + public PaperMachineTileEntity() { + super(); + this.outputSlot = new IHLInvSlotOutput(this, "output", 0, 2); + 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); + } + + @Override + public void readFromNBT(NBTTagCompound nbttagcompound) + { + super.readFromNBT(nbttagcompound); + this.fluidTank.readFromNBT(nbttagcompound.getCompoundTag("fluidTank")); + } + + @Override + public void writeToNBT(NBTTagCompound nbttagcompound) + { + super.writeToNBT(nbttagcompound); + NBTTagCompound fluidTankTag = new NBTTagCompound(); + this.fluidTank.writeToNBT(fluidTankTag); + nbttagcompound.setTag("fluidTank", fluidTankTag); + } + + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { + return this.getFacing()!=side; + } + + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { + return IHLUtils.getThisModItemStack("paperMachine"); + } + + @Override + public boolean enableUpdateEntity() + { + return IC2.platform.isSimulating(); + } + + + @Override + public void updateEntityServer() + { + super.updateEntityServer(); + IHLUtils.handleFluidSlotsBehaviour(fillInputSlot, drainInputSlot, emptyFluidItemsSlot, fluidTank); + } + + @Override + public FluidStack drain(ForgeDirection from, int amount, boolean doDrain) + { + FluidStack fstack = this.fluidTank.drain(amount, doDrain); + return fstack; + } + + + //1.7.10 API + @Override + public boolean canDrain(ForgeDirection arg0, Fluid arg1) { + return true; + } + + @Override + public boolean canFill(ForgeDirection direction, Fluid arg1) { + return direction.equals(ForgeDirection.UP); + } + + @Override + public String getInventoryName() { + return "chemicalReactor"; + } + + public float getRenderLiquidLevel() + { + return (float)this.fluidTank.getFluidAmount()/(float)this.fluidTank.getCapacity(); + } + + @Override + public int gaugeProgressScaled(int i) + { + return this.progress * i / operationLength; + } + + @Override + @SideOnly(Side.CLIENT) + public GuiScreen getGui(EntityPlayer player, boolean arg1) { + return new PaperMachineGui(new PaperMachineContainer(player, this)); + } + + @Override + public ContainerBase getGuiContainer(EntityPlayer player) + { + this.fluidTank.sortFluidsByDensity(); + return new PaperMachineContainer(player, this); + } + + @Override + public void onGuiClosed(EntityPlayer player) {} + + @Override + public boolean canOperate() + { + UniversalRecipeOutput output = getOutput(); + if(output!=null && this.outputSlot.canAdd(getOutput().getItemOutputs())) + { + if(output.specialConditions) + { + return this.checkSpecialConditions(); + } + else + { + return true; + } + } + 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 PaperMachineTileEntity.recipeManager.getOutputFor(this.getInput()); + } + + @Override + @SuppressWarnings({ "rawtypes", "unchecked" }) + public List[] getInput() + { + return new List[] {Arrays.asList(new FluidStack[]{fluidTank.getFluid()}), null}; + } + + @Override + public void operate() + { + UniversalRecipeInput recipeInput = PaperMachineTileEntity.recipeManager.getRecipeInput(getInput()); + UniversalRecipeOutput output1 = getOutput(); + this.fluidTank.drain(recipeInput.getFluidInputs(), true); + this.fluidTank.fill(output1.getFluidOutputs(), true); + if(!output1.getItemOutputs().isEmpty() && output1.getItemOutputs().get(0)!=null)this.outputSlot.add(output1.getItemOutputs()); + } + + @Override + public FluidStack drain(ForgeDirection arg0, FluidStack fluidStack, boolean doDrain) { + if(fluidTank.getFluid()!=null && fluidTank.getFluid().containsFluid(fluidStack)) + { + return this.fluidTank.drain(fluidStack, doDrain); + } + return null; + } + + @Override + public int fill(ForgeDirection arg0, FluidStack arg1, boolean arg2) { + return this.fluidTank.fill(arg1, arg2); + } + + @Override + public FluidTankInfo[] getTankInfo(ForgeDirection arg0) { + return new FluidTankInfo[] {this.fluidTank.getInfo()}; + } + + public boolean needsFluid() + { + return this.fluidTank.getFluidAmount() <= this.fluidTank.getCapacity(); + } + + public FluidStack getFluidStackfromTank() + { + return this.fluidTank.getFluid(); + } + + public int getTankAmount() + { + return this.fluidTank.getFluidAmount(); + } + + public int gaugeLiquidScaled(int i, int index) + { + return this.fluidTank.getFluidAmount() <= 0 ? 0 : this.fluidTank.getFluidAmount(index) * i / this.fluidTank.getCapacity(); + } + public static void addRecipe(UniversalRecipeInput input, UniversalRecipeOutput output) + { + recipeManager.addRecipe(input, output); + } + + public int getNumberOfFluidsInTank() + { + return this.fluidTank.getNumberOfFluids(); + } + + public static Map getRecipes() { + return recipeManager.getRecipes(); + } + + public static void addRecipe(FluidStack fluidStackInput1, ItemStack itemStackOutput1) + { + 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(new FluidStack[] {fluidStackInput1, fluidStackInput2}, (new ItemStack[] {itemStackInput})), new UniversalRecipeOutput((new FluidStack[] {fluidStackOutput}), (new ItemStack[] {itemStackOutput1, itemStackOutput2}),200, true)); + } + + public IHLFluidTank getFluidTank() + { + return this.fluidTank; + } + +} \ No newline at end of file diff --git a/src/main/java/ihl/processing/chemistry/RefluxCondenserModel.java b/src/main/java/ihl/processing/chemistry/RefluxCondenserModel.java new file mode 100644 index 0000000..9cb2f2f --- /dev/null +++ b/src/main/java/ihl/processing/chemistry/RefluxCondenserModel.java @@ -0,0 +1,70 @@ +// Date: 05.04.2015 16:30:47 +// Template version 1.1 +// Java generated by Techne +// Keep in mind that you still need to fill in some blanks +// - ZeuX +package ihl.processing.chemistry; + +import ihl.model.IHLModelRenderer; +import net.minecraft.client.model.ModelBase; +import net.minecraftforge.common.util.ForgeDirection; + + +public class RefluxCondenserModel extends ModelBase +{ + //fields + IHLModelRenderer Base; + IHLModelRenderer RotatingPartZ; + + public RefluxCondenserModel() + { + textureWidth = 64; + textureHeight = 32; + setTextureOffset("Base.PipeUp03", 0, 0); + setTextureOffset("Base.KneeUpEast", 0, 0); + setTextureOffset("Base.WestPipe03", 0, 0); + setTextureOffset("Base.WestPipe04", 0, 0); + setTextureOffset("Base.WestPipe02", 0, 0); + setTextureOffset("Base.WestPipe01", 0, 0); + setTextureOffset("Base.Shape1", 0, 0); + setTextureOffset("Base.PipeUp06", 0, 0); + setTextureOffset("Base.PipeUp07", 0, 0); + setTextureOffset("Base.PipeNorth07", 0, 0); + setTextureOffset("Base.PipeNorth08", 0, 0); + setTextureOffset("RotatingPartZ.ConeWest05", 0, 0); + setTextureOffset("RotatingPartZ.PipeWest07", 0, 0); + setTextureOffset("RotatingPartZ.ConeEast06", 0, 0); + + Base = new IHLModelRenderer(this, "Base"); + Base.setRotationPoint(0F, 16F, 0F); + setRotation(Base, 0F, 0F, 0F); + Base.mirror = true; + Base.addTube("PipeUp03", -2F, 7F, -2F, 4, 1, 4, 0.6f, 1f,ForgeDirection.UP); + Base.addKnee("KneeUpEast", -8F, 2F, -3F, 5, 6, 6, .8F, 1F, ForgeDirection.UP, ForgeDirection.EAST); + Base.addTube("WestPipe03", 3.5F, -7F, -1.5F, 4, 3, 3, 0.8f, 1f,ForgeDirection.WEST); + Base.addTube("WestPipe04", 7F, -7.5F, -2F, 1, 4, 4, 0.6f, 1f,ForgeDirection.WEST); + Base.addTube("WestPipe02", 7F, 3F, -2F, 1, 4, 4, 0.6f, 1f,ForgeDirection.WEST); + Base.addTube("WestPipe01", -3F, 3.5F, -1.5F, 10, 3, 3, .8F, 1F, ForgeDirection.WEST); + Base.addTube("Shape1", -2F, -8F, -2F, 4, 1, 4, 0.6f, 1f,ForgeDirection.UP); + Base.addTube("PipeUp06", -1.5F, -7F, -1.5F, 3, 2, 3, 0.8f, 1f,ForgeDirection.UP); + Base.addTube("PipeUp07", -1.5F, 5F, -1.5F, 3, 2, 3, 0.8f, 1f,ForgeDirection.UP); + Base.addTube("PipeNorth07", -2F, -2F, -8F, 4, 4, 1, 0.6f, 1f,ForgeDirection.NORTH); + Base.addTube("PipeNorth08", -1.5F, -1.5F, -7F, 3, 3, 7, 0.8f, 1f,ForgeDirection.NORTH); + RotatingPartZ = new IHLModelRenderer(this, "RotatingPartZ"); + RotatingPartZ.setRotationPoint(3F, 13F, 0F); + setRotation(RotatingPartZ, 0F, 0F, -0.5F); + RotatingPartZ.mirror = true; + RotatingPartZ.addTube("ConeWest05", 1F, -4F, -4F, 2, 8, 8, 0f, 0.8f,ForgeDirection.WEST); + RotatingPartZ.addTube("PipeWest07", -9F, -4F, -4F, 10, 8, 8, 0.8f, 1f,ForgeDirection.WEST); + RotatingPartZ.addTube("ConeEast06", -11F, -4F, -4F, 2, 8, 8, 0f, 0.8f,ForgeDirection.EAST); + } + + private void setRotation(IHLModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + +} diff --git a/src/main/java/ihl/processing/chemistry/RefluxCondenserTileEntity.java b/src/main/java/ihl/processing/chemistry/RefluxCondenserTileEntity.java new file mode 100644 index 0000000..83eb108 --- /dev/null +++ b/src/main/java/ihl/processing/chemistry/RefluxCondenserTileEntity.java @@ -0,0 +1,148 @@ +package ihl.processing.chemistry; + +import java.util.ArrayList; +import java.util.List; + +import ic2.api.network.INetworkDataProvider; +import ic2.api.tile.IWrenchable; +import ic2.core.IC2; +import ihl.utils.IHLUtils; +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; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidHandler; + +public class RefluxCondenserTileEntity extends TileEntity implements IWrenchable, INetworkDataProvider, IFluidHandler{ + + private short facing=2; + private short lastFacing=2; + public FractionatorBottomTileEntity columnBottom; + + public RefluxCondenserTileEntity() + { + super(); + } + + public boolean enableUpdateEntity() + { + return IC2.platform.isSimulating(); + } + + @Override + public List getNetworkedFields() + { + List fields = new ArrayList(); + fields.add("facing"); + return fields; + } + + @Override + public void updateEntity() + { + super.updateEntity(); + if(lastFacing!=facing) + { + IC2.network.get().updateTileEntityField(this, "facing"); + lastFacing=facing; + } + } + + + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { + return this.getFacing()!=side; + } + + + @Override + public short getFacing() { + return this.facing; + } + + + @Override + public void setFacing(short facing1) + { + facing=(short) Math.max(2,facing1); + if(IC2.platform.isSimulating()) + { + IC2.network.get().updateTileEntityField(this, "facing"); + } + } + + + @Override + public boolean wrenchCanRemove(EntityPlayer entityPlayer) { + return true; + } + + + @Override + public float getWrenchDropRate() { + return 1F; + } + + + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { + return IHLUtils.getThisModItemStack("refluxCondenser"); + } + + @Override + public void readFromNBT(NBTTagCompound nbttagcompound) + { + super.readFromNBT(nbttagcompound); + facing=nbttagcompound.getShort("facing"); + } + + @Override + public void writeToNBT(NBTTagCompound nbttagcompound) + { + super.writeToNBT(nbttagcompound); + nbttagcompound.setShort("facing", facing); + } + + @Override + public boolean canDrain(ForgeDirection arg0, Fluid arg1) { + return false; + } + + @Override + public boolean canFill(ForgeDirection direction, Fluid arg1) { + return direction.equals(ForgeDirection.UP); + } + + @Override + public FluidStack drain(ForgeDirection arg0, FluidStack arg1, boolean arg2) { + return null; + } + + @Override + public FluidStack drain(ForgeDirection arg0, int arg1, boolean arg2) { + return null; + } + + @Override + public int fill(ForgeDirection direction, FluidStack fluidStack, boolean doFill) { + if(fluidStack!=null && fluidStack.getFluid()!=null && this.canFill(direction, fluidStack.getFluid()) && columnBottom!=null) + { + return columnBottom.fill(direction, fluidStack, doFill); + } + return 0; + } + + @Override + public FluidTankInfo[] getTankInfo(ForgeDirection arg0) + { + if(columnBottom!=null) + return columnBottom.getTankInfo(arg0); + else + return new FluidTankInfo[] {new FluidTankInfo(null, 8000)}; + } + +} diff --git a/src/main/java/ihl/processing/chemistry/SolarEvaporatorContainer.java b/src/main/java/ihl/processing/chemistry/SolarEvaporatorContainer.java new file mode 100644 index 0000000..4ecf44d --- /dev/null +++ b/src/main/java/ihl/processing/chemistry/SolarEvaporatorContainer.java @@ -0,0 +1,112 @@ +package ihl.processing.chemistry; + +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; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; + +public class SolarEvaporatorContainer extends ContainerBase { + + protected SolarEvaporatorTileEntity tileEntity; + public int lastFluidAmount = -1; + public int lastFuel = -1; + public short lastProgress = -1; + private final static int height = 166; + public int lastNumberOfFluids = -1; + public int lastVisibleFluidID = -1; + public int lastVisibleFluidAmount = -1; + + public SolarEvaporatorContainer(EntityPlayer entityPlayer, SolarEvaporatorTileEntity tileEntity1) { + super(tileEntity1); + this.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.fluidItemsSlot, 0, 44, 14)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.emptyFluidItemsSlot, 0, 44, 32)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.fillItemsSlot, 0, 44, 50)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.outputSlot, 0, 117, 32)); + + } + + @Override + public void detectAndSendChanges() { + super.detectAndSendChanges(); + for (int i = 0; i < this.crafters.size(); ++i) { + ICrafting icrafting = (ICrafting) this.crafters.get(i); + + if (this.tileEntity.getFluidTank().getFluid() != null + && this.tileEntity.getFluidTank().getFluidAmount() != this.lastFluidAmount) { + icrafting.sendProgressBarUpdate(this, 0, this.tileEntity.getFluidTank().getFluid().getFluid().getID()); + icrafting.sendProgressBarUpdate(this, 1, this.tileEntity.getFluidTank().getFluidAmount()); + } + + if (this.tileEntity.fuel != this.lastFuel) { + icrafting.sendProgressBarUpdate(this, 2, this.tileEntity.fuel); + } + + if (this.tileEntity.progress != this.lastProgress) { + icrafting.sendProgressBarUpdate(this, 3, this.tileEntity.progress); + } + if (this.tileEntity.visibleFluidId != this.lastVisibleFluidID) + { + icrafting.sendProgressBarUpdate(this, 4, this.tileEntity.visibleFluidId); + } + if (this.tileEntity.visibleFluidAmount != this.lastVisibleFluidAmount) + { + icrafting.sendProgressBarUpdate(this, 5, this.tileEntity.visibleFluidAmount); + } + } + + this.lastFluidAmount = this.tileEntity.getFluidTank().getFluidAmount(); + this.lastFuel = this.tileEntity.fuel; + this.lastProgress = this.tileEntity.progress; + this.lastVisibleFluidID=this.tileEntity.visibleFluidId; + this.lastVisibleFluidAmount=this.tileEntity.visibleFluidAmount; + } + + @Override + public void updateProgressBar(int index, int value) { + super.updateProgressBar(index, value); + + switch (index) { + case 0: + this.tileEntity.getFluidTank().setFluid(new FluidStack(FluidRegistry.getFluid(value), 1000)); + break; + case 1: + this.tileEntity.getFluidTank() + .setFluid(new FluidStack(this.tileEntity.getFluidTank().getFluid().getFluid(), value)); + break; + case 2: + this.tileEntity.fuel = value; + break; + case 3: + this.tileEntity.progress = (short) value; + break; + case 4: + this.tileEntity.visibleFluidId=value; + break; + case 5: + this.tileEntity.visibleFluidAmount=value; + break; + + } + } + + @Override + public boolean canInteractWith(EntityPlayer var1) { + return tileEntity.isUseableByPlayer(var1); + } +} diff --git a/src/main/java/ihl/processing/chemistry/SolarEvaporatorGui.java b/src/main/java/ihl/processing/chemistry/SolarEvaporatorGui.java new file mode 100644 index 0000000..e97f9e0 --- /dev/null +++ b/src/main/java/ihl/processing/chemistry/SolarEvaporatorGui.java @@ -0,0 +1,78 @@ +package ihl.processing.chemistry; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ic2.core.util.DrawUtil; +import ic2.core.util.GuiTooltipHelper; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; + +@SideOnly(Side.CLIENT) +public class SolarEvaporatorGui extends GuiContainer { + private static final ResourceLocation background = new ResourceLocation("ihl", + "textures/gui/GUISolarEvaporator.png"); + private SolarEvaporatorContainer container; + + public SolarEvaporatorGui(SolarEvaporatorContainer container1) { + // the container is instanciated and passed to the superclass for + // handling + super(container1); + this.container = container1; + } + + @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.getActive()) { + this.drawTexturedModalRect(9, 16, 176, 0, 14, 14); + } + if (this.container.tileEntity.progress > 0) { + i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(18), 18); + this.drawTexturedModalRect(99, 34, 198, 0, i1 + 1, 13); + } + + if (this.container.tileEntity.getTankAmount() > 0) { + FluidStack fluidStack = this.container.tileEntity.getFluidTank().getFluid(); + if (fluidStack != null) { + Fluid fluid = fluidStack.getFluid(); + if (fluid != null) { + + IIcon fluidIcon = fluid.getIcon(); + + if (fluidIcon != null) { + this.mc.renderEngine.bindTexture(TextureMap.locationBlocksTexture); + int liquidHeight = this.container.tileEntity.gaugeLiquidScaled(47); + DrawUtil.drawRepeated(fluidIcon, (82), 16 + 47 - liquidHeight, 12.0D, liquidHeight, + this.zLevel); + this.mc.renderEngine.bindTexture(background); + } + } + String tooltip = StatCollector.translateToLocal(fluidStack.getFluid().getUnlocalizedName()) + ": " + + fluidStack.amount + "mB"; + GuiTooltipHelper.drawAreaTooltip(par1 - 90, par2 - 32, tooltip, xOffset - 8, yOffset - 15, xOffset + 2, + yOffset + 30); + } + } + } + + @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(background); + int x = (width - xSize) / 2; + int y = (height - ySize) / 2; + this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); + } +} \ No newline at end of file diff --git a/src/main/java/ihl/processing/chemistry/SolarEvaporatorTileEntity.java b/src/main/java/ihl/processing/chemistry/SolarEvaporatorTileEntity.java new file mode 100644 index 0000000..947a88a --- /dev/null +++ b/src/main/java/ihl/processing/chemistry/SolarEvaporatorTileEntity.java @@ -0,0 +1,108 @@ +package ihl.processing.chemistry; + +import java.util.List; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ic2.core.ContainerBase; +import ic2.core.IC2; +import ihl.interfaces.IFluidTankVisual; +import ihl.utils.IHLUtils; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.EnumSkyBlock; + +public class SolarEvaporatorTileEntity extends EvaporatorTileEntity implements IFluidTankVisual { + public int visibleFluidId = -1; + public int visibleFluidAmount = 1; + + public SolarEvaporatorTileEntity(){ + super(); + this.fuelSlot = null; + this.maxProgress = 4500; + } + + @Override + public List getNetworkedFields() + { + List ret = super.getNetworkedFields(); + ret.add("visibleFluidId"); + ret.add("visibleFluidAmount"); + return ret; + } + + @Override + public void updateEntityServer() + { + super.updateEntityServer(); + if(this.fluidTank.getFluid()!=null && (visibleFluidId!=this.fluidTank.getFluid().getFluid().getID() || visibleFluidAmount!=this.fluidTank.getFluidAmount())) + { + visibleFluidId = this.fluidTank.getFluid().getFluid().getID(); + visibleFluidAmount = this.fluidTank.getFluidAmount(); + IC2.network.get().updateTileEntityField(this, "visibleFluidId"); + IC2.network.get().updateTileEntityField(this, "visibleFluidAmount"); + } + else if(this.fluidTank.getFluid()==null && visibleFluidId!=-1) + { + visibleFluidId=-1; + IC2.network.get().updateTileEntityField(this, "visibleFluidId"); + } + } + @Override + public boolean isBurning() + { + return this.worldObj.getSkyBlockTypeBrightness(EnumSkyBlock.Sky, xCoord, yCoord, zCoord)>=15; + } + + @Override + public ContainerBase getGuiContainer(EntityPlayer entityPlayer) + { + return new SolarEvaporatorContainer(entityPlayer, this); + } + + @Override + @SideOnly(Side.CLIENT) + public GuiScreen getGui(EntityPlayer entityPlayer, boolean isAdmin) + { + return new SolarEvaporatorGui(new SolarEvaporatorContainer(entityPlayer, this)); + } + + @Override + public short getFacing() + { + return 3; + } + + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { + return false; + } + + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { + return IHLUtils.getThisModItemStack("solarEvaporator"); + } + + @Override + public int getVisibleFluidId() { + return this.visibleFluidId; + } + + @Override + public int getVisibleFluidAmount() { + return this.visibleFluidAmount; + } + + @Override + public float getRenderLiquidLevel() + { + return (float)this.visibleFluidAmount/(float)this.fluidTank.getCapacity()/2; + } + + @Override + public boolean shouldRenderInPass(int pass) + { + return pass==0; + } +} diff --git a/src/main/java/ihl/processing/invslots/IHLInvSlotOutput.java b/src/main/java/ihl/processing/invslots/IHLInvSlotOutput.java new file mode 100644 index 0000000..d5186e2 --- /dev/null +++ b/src/main/java/ihl/processing/invslots/IHLInvSlotOutput.java @@ -0,0 +1,166 @@ +package ihl.processing.invslots; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; + +import ic2.core.block.TileEntityInventory; +import ic2.core.block.invslot.InvSlotOutput; +import ihl.recipes.RecipeOutputItemStack; +import ihl.utils.IHLUtils; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; + +public class IHLInvSlotOutput extends InvSlotOutput { + + 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) { + if (itemOutputs == null || itemOutputs.isEmpty()) { + return true; + } + Iterator ioi = itemOutputs.iterator(); + if (this.size() >= itemOutputs.size()) { + Object rois; + if (ioi.hasNext()) { + rois = ioi.next(); + } else { + return true; + } + for (int i = 0; i < this.size(); i++) { + if (this.get(i) == null || (this.objectMatchesSlot(rois, i) + && this.get(i).stackSize + this.getAmoutOfObject(rois) < this.getStackSizeLimit() + && this.get(i).stackSize + this.getAmoutOfObject(rois) <= this.get(i).getMaxStackSize())) { + if (ioi.hasNext()) { + rois = ioi.next(); + } else { + return true; + } + } else { + if (i == this.size() - 1) { + return false; + } + } + } + + } + return false; + } + + private float getAmoutOfObject(Object obj) { + if (obj instanceof ItemStack) { + return ((ItemStack) obj).stackSize; + } else if (obj instanceof RecipeOutputItemStack) { + return ((RecipeOutputItemStack) obj).quantity; + } + return Short.MAX_VALUE; + } + + public boolean objectMatchesSlot(Object obj, int slot) { + if (this.get(slot) == null) { + return true; + } else { + if (obj instanceof ItemStack) { + return IHLUtils.isItemStacksIsEqual(this.get(slot), (ItemStack) obj, true); + } else if (obj instanceof RecipeOutputItemStack) { + return ((RecipeOutputItemStack) obj).matches(this.get(slot)); + } + } + return false; + } + + public void add(RecipeOutputItemStack rois) { + for (int i = 0; i < this.size(); i++) { + if (this.get(i) == null || (this.objectMatchesSlot(rois, i) + && this.get(i).stackSize + this.getAmoutOfObject(rois) < this.getStackSizeLimit())) { + this.add(i, rois); + break; + } + } + } + + private void add(int i, RecipeOutputItemStack rois) { + long key = (Item.getIdFromItem(rois.itemStack.getItem()) << 32) + rois.itemStack.getItemDamage(); + float amount = 0f; + if (this.substanceAmount.containsKey(key)) { + amount = this.substanceAmount.get(key); + } + amount += rois.quantity; + while (amount >= 1) { + amount--; + this.add(rois.itemStack.copy()); + } + this.substanceAmount.put(key, amount); + } + + @Override + @SuppressWarnings("rawtypes") + public int add(List itemOutputs) { + if (itemOutputs == null || itemOutputs.isEmpty()) { + return 0; + } + Iterator ioi = itemOutputs.iterator(); + if (this.size() >= itemOutputs.size() && ioi.hasNext()) { + Object rois = ioi.next(); + for (int i = 0; i < this.size(); i++) { + if (this.get(i) == null || (this.objectMatchesSlot(rois, i) + && this.get(i).stackSize + this.getAmoutOfObject(rois) < this.getStackSizeLimit())) { + if (rois instanceof ItemStack) { + this.add(((ItemStack) rois).copy()); + } else if (rois instanceof RecipeOutputItemStack) { + this.add(i, (RecipeOutputItemStack) rois); + } + if (ioi.hasNext()) { + rois = ioi.next(); + } else { + return itemOutputs.size(); + } + } else { + if (i == this.size() - 1) { + return 0; + } + } + } + + } + return 0; + } + + @Override + public void readFromNbt(NBTTagCompound nbtTagCompound) { + super.readFromNbt(nbtTagCompound); + NBTTagList amountTagList = nbtTagCompound.getTagList("substanceAmountMap", 10); + for (int i = 0; i < amountTagList.tagCount(); i++) { + if (amountTagList.getCompoundTagAt(i).hasKey("substanceKey")) { + long substanceKey = amountTagList.getCompoundTagAt(i).getLong("substanceKey"); + float substanceAmount = amountTagList.getCompoundTagAt(i).getFloat("substanceAmount"); + this.substanceAmount.put(substanceKey, substanceAmount); + } + } + } + + @Override + public void writeToNbt(NBTTagCompound nbtTagCompound) { + super.writeToNbt(nbtTagCompound); + NBTTagList sAmountsList = new NBTTagList(); + Iterator> entrySetIterator = this.substanceAmount.entrySet().iterator(); + while (entrySetIterator.hasNext()) { + Entry entry = entrySetIterator.next(); + NBTTagCompound tag = new NBTTagCompound(); + tag.setLong("substanceKey", entry.getKey()); + tag.setFloat("substanceAmount", entry.getValue()); + sAmountsList.appendTag(tag); + } + nbtTagCompound.setTag("substanceAmountMap", sAmountsList); + } +} diff --git a/src/main/java/ihl/processing/invslots/InvSlotConsumableLiquidIHL.java b/src/main/java/ihl/processing/invslots/InvSlotConsumableLiquidIHL.java new file mode 100644 index 0000000..7bb6ecc --- /dev/null +++ b/src/main/java/ihl/processing/invslots/InvSlotConsumableLiquidIHL.java @@ -0,0 +1,271 @@ +package ihl.processing.invslots; + +import java.util.Iterator; + +import org.apache.commons.lang3.mutable.MutableObject; + +import ic2.core.block.TileEntityInventory; +import ic2.core.block.invslot.InvSlotConsumableLiquid; +import ic2.core.util.StackUtil; +import ihl.utils.IHLUtils; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.IFluidContainerItem; + +public class InvSlotConsumableLiquidIHL extends InvSlotConsumableLiquid{ + + private OpType opType; + private String additionalInputs; + + public InvSlotConsumableLiquidIHL(TileEntityInventory base1, String name1,int oldStartIndex1, Access access1, int count,InvSide preferredSide1, OpType opType1) + { + super(base1, name1, oldStartIndex1, access1, count, preferredSide1, opType1); + opType=opType1; + } + + public InvSlotConsumableLiquidIHL(TileEntityInventory base1, String name1,int oldStartIndex1, Access access1, int count,InvSide preferredSide1, OpType opType1, String additionalInputs1) + { + super(base1, name1, oldStartIndex1, access1, count, preferredSide1, opType1); + opType=opType1; + additionalInputs=additionalInputs1; + } + + @Override + public FluidStack drain(Fluid fluid, int maxAmount, MutableObject output, boolean simulate) + { + if(output!=null) + { + output.setValue((ItemStack)null); + } + + if (this.opType != InvSlotConsumableLiquid.OpType.Drain && this.opType != InvSlotConsumableLiquid.OpType.Both) + { + return null; + } + else + { + ItemStack stack = this.get(); + + if (stack == null) + { + return null; + } + else if (!FluidContainerRegistry.isFilledContainer(stack)) + { + if (stack.getItem() instanceof IFluidContainerItem) + { + IFluidContainerItem var9 = (IFluidContainerItem)stack.getItem(); + + if (var9.getFluid(stack) == null) + { + return null; + } + else if (fluid != null && var9.getFluid(stack).getFluid() != fluid) + { + return null; + } + else if (!this.acceptsLiquid(var9.getFluid(stack).getFluid())) + { + return null; + } + else + { + ItemStack singleStack = StackUtil.copyWithSize(stack, 1); + FluidStack fluidStack = var9.drain(singleStack, maxAmount, true); + + if (fluidStack != null && fluidStack.amount > 0) + { + if (singleStack.stackSize <= 0) + { + if (!simulate) + { + --stack.stackSize; + } + } + else if (var9.getFluid(singleStack) == null) + { + if(output!=null) + { + output.setValue(singleStack); + } + if (!simulate) + { + --stack.stackSize; + } + } + else + { + if (stack.stackSize > 1) + { + return null; + } + + if (!simulate) + { + this.put(singleStack); + } + } + + if (stack.stackSize <= 0) + { + this.put((ItemStack)null); + } + + return fluidStack; + } + else + { + return null; + } + } + } + else + { + return null; + } + } + else + { + FluidStack container = FluidContainerRegistry.getFluidForFilledItem(stack); + + if (container != null && (fluid == null || fluid == container.getFluid())) + { + if (!this.acceptsLiquid(container.getFluid())) + { + return null; + } + else if (container.amount > 0 && container.amount <= maxAmount) + { + if (stack.getItem().hasContainerItem(stack) && output!=null) + { + output.setValue(stack.getItem().getContainerItem(stack)); + } + else + { + ItemStack emptystack = FluidContainerRegistry.drainFluidContainer(stack); + if(emptystack!=null && output!=null) + { + output.setValue(emptystack); + } + } + + if (!simulate) + { + --stack.stackSize; + + if (stack.stackSize <= 0) + { + this.put((ItemStack)null); + } + } + + return container; + } + else + { + return null; + } + } + else + { + return null; + } + } + } + } + + @Override + public boolean accepts(ItemStack stack) + { + if (stack == null) + { + return true; + } + Item item = stack.getItem(); + if (item == null) + { + return false; + } + else + { + if(this.additionalInputs!=null) + { + String fon = IHLUtils.getFirstOreDictName(stack); + if(fon!=null && fon.contains(additionalInputs)) + { + return true; + } + } + if (this.opType == InvSlotConsumableLiquid.OpType.Drain || this.opType == InvSlotConsumableLiquid.OpType.Both) + { + FluidStack containerItem = null; + if (FluidContainerRegistry.isFilledContainer(stack)) + { + containerItem = FluidContainerRegistry.getFluidForFilledItem(stack); + } + else if (item instanceof IFluidContainerItem) + { + containerItem = ((IFluidContainerItem)item).getFluid(stack); + } + + if (containerItem != null && containerItem.amount > 0) + { + return true; + } + } + if (this.opType == InvSlotConsumableLiquid.OpType.Fill || this.opType == InvSlotConsumableLiquid.OpType.Both) + { + if (FluidContainerRegistry.isEmptyContainer(stack)) + { + if (this.getPossibleFluids() == null) + { + return true; + } + + Iterator containerItem1 = this.getPossibleFluids().iterator(); + + while (containerItem1.hasNext()) + { + Fluid prevFluid = containerItem1.next(); + + if (FluidContainerRegistry.fillFluidContainer(new FluidStack(prevFluid, Integer.MAX_VALUE), stack) != null) + { + return true; + } + } + } + else if (item instanceof IFluidContainerItem) + { + IFluidContainerItem containerItem2 = (IFluidContainerItem)item; + FluidStack prevFluid1 = containerItem2.getFluid(stack); + + if (prevFluid1 == null || containerItem2.getCapacity(stack) > prevFluid1.amount) + { + if (this.getPossibleFluids() == null) + { + return true; + } + + ItemStack singleStack = StackUtil.copyWithSize(stack, 1); + Iterator i$ = this.getPossibleFluids().iterator(); + + while (i$.hasNext()) + { + Fluid fluid = i$.next(); + + if (containerItem2.fill(singleStack, new FluidStack(fluid, Integer.MAX_VALUE), false) > 0) + { + return true; + } + } + } + } + } + return false; + } + } + +} diff --git a/src/main/java/ihl/processing/invslots/InvSlotUpgradeIHL.java b/src/main/java/ihl/processing/invslots/InvSlotUpgradeIHL.java new file mode 100644 index 0000000..5c1fff9 --- /dev/null +++ b/src/main/java/ihl/processing/invslots/InvSlotUpgradeIHL.java @@ -0,0 +1,61 @@ +package ihl.processing.invslots; + +import ic2.core.Ic2Items; +import ic2.core.block.TileEntityInventory; +import ic2.core.block.invslot.InvSlot; +import ihl.utils.IHLUtils; +import net.minecraft.item.ItemStack; + +public class InvSlotUpgradeIHL extends InvSlot { + + public InvSlotUpgradeIHL(int count) { + super(count); + } + + public InvSlotUpgradeIHL(TileEntityInventory base, int oldStartIndex, Access access, int count, InvSide side) { + super(base, "invSlotUpgrade", oldStartIndex, access, count, side); + } + + public double getPowerConsumtionMultiplier() { + double base = 1d; + for (int i = 0; i < this.size(); i++) { + if (IHLUtils.isItemStacksIsEqual(this.get(i), Ic2Items.overclockerUpgrade, false)) { + int i1 = this.get(i).stackSize; + while (i1-- > 0 && base < 600) { + base *= 1.6f; + } + } + } + return base; + } + + public float getProgressMultiplier() { + float base = 1f; + for (int i = 0; i < this.size(); i++) { + if (IHLUtils.isItemStacksIsEqual(this.get(i), Ic2Items.overclockerUpgrade, false)) { + int i1 = this.get(i).stackSize; + while (i1-- > 0 && base < 600) { + base *= 1.428571429f; + } + } + } + return base; + } + + public int getAdditionalEnergyStorage() { + int base = 0; + for (int i = 0; i < this.size(); i++) { + if (IHLUtils.isItemStacksIsEqual(this.get(i), Ic2Items.energyStorageUpgrade, false)) { + base += this.get(i).stackSize * 10000; + } + } + return base; + } + + @Override + public boolean accepts(ItemStack stack) { + return IHLUtils.isItemStacksIsEqual(stack, Ic2Items.overclockerUpgrade, false) || + IHLUtils.isItemStacksIsEqual(stack, Ic2Items.energyStorageUpgrade, false); + } + +} diff --git a/src/main/java/ihl/processing/invslots/SlotInvSlotIronWorkbench.java b/src/main/java/ihl/processing/invslots/SlotInvSlotIronWorkbench.java new file mode 100644 index 0000000..7f00e06 --- /dev/null +++ b/src/main/java/ihl/processing/invslots/SlotInvSlotIronWorkbench.java @@ -0,0 +1,32 @@ +package ihl.processing.invslots; + +import ic2.core.slot.SlotInvSlot; +import ihl.flexible_cable.IronWorkbenchInvSlot; +import ihl.flexible_cable.IronWorkbenchTileEntity; +import net.minecraft.entity.player.EntityPlayer; + +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/src/main/java/ihl/processing/invslots/SlotInvSlotOutputInProgress.java b/src/main/java/ihl/processing/invslots/SlotInvSlotOutputInProgress.java new file mode 100644 index 0000000..25c0673 --- /dev/null +++ b/src/main/java/ihl/processing/invslots/SlotInvSlotOutputInProgress.java @@ -0,0 +1,23 @@ +package ihl.processing.invslots; + +import ic2.core.slot.SlotInvSlot; +import ihl.flexible_cable.IronWorkbenchInvSlot; +import net.minecraft.entity.player.EntityPlayer; + +public class SlotInvSlotOutputInProgress extends SlotInvSlot { + + public IronWorkbenchInvSlot invSlot; + + public SlotInvSlotOutputInProgress(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(); + } +} diff --git a/src/main/java/ihl/processing/metallurgy/AchesonFurnaceGui.java b/src/main/java/ihl/processing/metallurgy/AchesonFurnaceGui.java new file mode 100644 index 0000000..6f8238a --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/AchesonFurnaceGui.java @@ -0,0 +1,46 @@ +package ihl.processing.metallurgy; + +import org.lwjgl.opengl.GL11; + +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; + +public class AchesonFurnaceGui extends GuiContainer { + protected static final ResourceLocation achesonFurnaceBackground = new ResourceLocation("ihl", "textures/gui/GUIAchesonFurnace.png"); + private MachineBaseContainer container; + + public AchesonFurnaceGui(MachineBaseContainer machineBaseContainer) { + super(machineBaseContainer); + this.container=machineBaseContainer; + } + + @Override + protected void drawGuiContainerForegroundLayer(int par1, int par2) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.renderEngine.bindTexture(achesonFurnaceBackground); + int i1; + if (this.container.tileEntity.getEnergy() > 0D) + { + i1 = Math.min(this.container.tileEntity.getGUIEnergy(12),12); + this.drawTexturedModalRect(8, 6 + 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(70,34, 197, 0, i1 + 1, 13); + } + fontRendererObj.drawStringWithShadow(StatCollector.translateToLocal("ihl.gui.achesonFurnance"), 40, 12, 16768125); + } + + @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(achesonFurnaceBackground); + int x = (width - xSize) / 2; + int y = (height - ySize) / 2; + this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); + } +} diff --git a/src/main/java/ihl/processing/metallurgy/AchesonFurnanceContainer.java b/src/main/java/ihl/processing/metallurgy/AchesonFurnanceContainer.java new file mode 100644 index 0000000..2580c6c --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/AchesonFurnanceContainer.java @@ -0,0 +1,16 @@ +package ihl.processing.metallurgy; + +import ic2.core.slot.SlotInvSlot; +import net.minecraft.entity.player.EntityPlayer; + +public class AchesonFurnanceContainer extends MachineBaseContainer { + + public AchesonFurnanceContainer(EntityPlayer entityPlayer, + AchesonFurnanceTileEntity tileEntity1) { + super(entityPlayer, tileEntity1); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.input, 0, 40, 22)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.input, 1, 40, 40)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.outputSlot, 0, 98, 32)); + } + +} diff --git a/src/main/java/ihl/processing/metallurgy/AchesonFurnanceTileEntity.java b/src/main/java/ihl/processing/metallurgy/AchesonFurnanceTileEntity.java new file mode 100644 index 0000000..75efd70 --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/AchesonFurnanceTileEntity.java @@ -0,0 +1,101 @@ +package ihl.processing.metallurgy; + +import java.util.List; +import java.util.Map; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ic2.api.recipe.IRecipeInput; +import ic2.core.ContainerBase; +import ihl.IHLMod; +import ihl.processing.invslots.IHLInvSlotOutput; +import ihl.recipes.RecipeOutputItemStack; +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; + +public class AchesonFurnanceTileEntity extends MachineBaseTileEntity { + + protected static final UniversalRecipeManager recipeManager = new UniversalRecipeManager("achesonfurnace"); + public final IHLInvSlotOutput outputSlot; + + public AchesonFurnanceTileEntity() { + super(2); + this.outputSlot = new IHLInvSlotOutput(this, "output", 0, 1); + } + + public static void addRecipe(IRecipeInput input1, IRecipeInput input2, String output1) { + recipeManager.addRecipe(new UniversalRecipeInput(null, new IRecipeInput[] { input1, input2 }), + new UniversalRecipeOutput(null, new ItemStack[] { IHLUtils.getThisModItemStack(output1) }, 20)); + } + + @Override + public String getStartSoundFile() { + return "Machines/Electro Furnace/ElectroFurnaceLoop.ogg"; + } + + @Override + public String getLoopSoundFile() { + return null; + } + + @Override + public String getStopSoundFile() { + return null; + } + + @Override + public String getInventoryName() { + return "AchesonFurnance"; + } + + @Override + @SideOnly(Side.CLIENT) + public GuiScreen getGui(EntityPlayer player, boolean arg1) { + return new AchesonFurnaceGui(new AchesonFurnanceContainer(player, this)); + } + + @Override + public ContainerBase getGuiContainer(EntityPlayer player) { + return new AchesonFurnanceContainer(player, this); + } + + @Override + public void operate() { + ItemStack crucible = input.getItemStack(IHLMod.crucible); + if (crucible != null) { + ((Crucible) crucible.getItem()).processContent(crucible, this); + return; + } + List output = recipeManager + .getOutputFor(getInput()).getItemOutputs(); + List rinput = recipeManager.getRecipeInput(getInput()).getItemInputs(); + for (int i = 0; i < rinput.size(); i++) { + this.input.consume(rinput.get(i)); + } + this.outputSlot.add(output); + } + + @Override + public boolean canOperate() { + return this.getOutput() != null; + } + + @Override + public List[] getInput() { + return new List[] { null, this.input.getItemStackList() }; + } + + public static Map getRecipes() { + return recipeManager.getRecipes(); + } + + @Override + public UniversalRecipeOutput getOutput() { + return AchesonFurnanceTileEntity.recipeManager.getOutputFor(this.getInput()); + } +} diff --git a/src/main/java/ihl/processing/metallurgy/BasicElectricMotorTileEntity.java b/src/main/java/ihl/processing/metallurgy/BasicElectricMotorTileEntity.java new file mode 100644 index 0000000..a546b0a --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/BasicElectricMotorTileEntity.java @@ -0,0 +1,272 @@ +package ihl.processing.metallurgy; + +import java.util.Iterator; +import java.util.List; + +import ic2.api.energy.event.EnergyTileLoadEvent; +import ic2.api.energy.event.EnergyTileUnloadEvent; +import ic2.api.energy.tile.IEnergySink; +import ic2.api.network.INetworkClientTileEntityEventListener; +import ic2.core.IC2; +import ic2.core.IHasGui; +import ic2.core.block.invslot.InvSlot; +import ic2.core.block.invslot.InvSlot.Access; +import ihl.IHLMod; +import ihl.flexible_cable.FlexibleCableHolderBaseTileEntity; +import ihl.flexible_cable.NodeEntity; +import ihl.processing.invslots.InvSlotUpgradeIHL; +import ihl.utils.IHLInvSlotDischarge; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.util.ForgeDirection; + +public abstract class BasicElectricMotorTileEntity extends FlexibleCableHolderBaseTileEntity + implements IHasGui, INetworkClientTileEntityEventListener, IEnergySink { + + public final IHLInvSlotDischarge dischargeSlot; + public final InvSlotUpgradeIHL upgradeSlot; + public short progress; + protected short operationLength = 6000; + protected double energyConsume = 1d; + public double energy = 0d; + public int maxStorage = 128; + private boolean addedToEnergyNet = false; + + public BasicElectricMotorTileEntity() { + super(); + energyConsume = IHLMod.config.machineryEnergyConsume/100d; + dischargeSlot = new IHLInvSlotDischarge(this, 1, Access.I, 4, InvSlot.InvSide.BOTTOM); + upgradeSlot = new InvSlotUpgradeIHL(this, 1, Access.I, 4, InvSlot.InvSide.BOTTOM); + } + + @Override + public String getInventoryName() { + return "Lathe"; + } + + public boolean enableUpdateEntity() { + return IC2.platform.isSimulating(); + } + + @Override + public void onLoaded() { + super.onLoaded(); + if (IC2.platform.isSimulating() && !this.addedToEnergyNet) { + MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this)); + this.addedToEnergyNet = true; + } + } + + @Override + public void onUnloaded() { + if (IC2.platform.isSimulating() && this.addedToEnergyNet) { + MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this)); + this.addedToEnergyNet = false; + } + + super.onUnloaded(); + } + + @SuppressWarnings("unchecked") + @Override + public void setFacing(short facing1) { + double d = 0.3D; + double f = -0.1D; + if (IC2.platform.isSimulating() && this.addedToEnergyNet) { + MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this)); + this.addedToEnergyNet = false; + } + double range = 2D; + AxisAlignedBB searchArea = AxisAlignedBB.getBoundingBox(connectionX - range, connectionY - range, + connectionZ - range, connectionX + range, connectionY + range, connectionZ + range); + List nodeList = worldObj.getEntitiesWithinAABB(NodeEntity.class, searchArea); + super.setFacing(facing1); + switch (getFacing()) { + case 4: + setConnectionX(this.xCoord + 0.5D); + setConnectionY(this.yCoord + d); + setConnectionZ(this.zCoord + 1D - f); + break; + case 5: + setConnectionX(this.xCoord + 0.5D); + setConnectionY(this.yCoord + d); + setConnectionZ(this.zCoord + f); + break; + case 2: + setConnectionX(this.xCoord + 1D - f); + setConnectionY(this.yCoord + d); + setConnectionZ(this.zCoord + 0.5D); + break; + case 3: + setConnectionX(this.xCoord + f); + setConnectionY(this.yCoord + d); + setConnectionZ(this.zCoord + 0.5D); + break; + default: + setConnectionX(this.xCoord + 1D - f); + setConnectionY(this.yCoord + d); + setConnectionZ(this.zCoord + 0.5D); + break; + + } + if (!nodeList.isEmpty()) { + Iterator ei = nodeList.iterator(); + while (ei.hasNext()) { + NodeEntity ne = ei.next(); + if ((ne.prevAnchorEntity == null || ne.nextAnchorEntity == null) + && this.cableListContains(ne.getChainUniqueID())) { + ne.setVirtualNodePos(connectionX, connectionY, connectionZ); + } + } + } + if (IC2.platform.isSimulating() && !this.addedToEnergyNet) { + MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this)); + this.addedToEnergyNet = true; + } + } + + @Override + public double getDemandedEnergy() { + if(this.getMaxStorage() - this.energy <= 1d) + { + return 0d; + } + return this.getMaxStorage() - this.energy; + } + + @Override + public int getSinkTier() { + return 4; + } + + @Override + public double injectEnergy(ForgeDirection directionFrom, double amount, double voltage) { + if (this.energy < this.getMaxStorage()) { + this.energy += amount; + return 0.0D; + } else { + return amount; + } + } + + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { + return this.getFacing() != (short) side; + } + + @Override + public void writeToNBT(NBTTagCompound nbt) { + super.writeToNBT(nbt); + nbt.setShort("progress", this.progress); + nbt.setDouble("energy", this.energy); + } + + @Override + public void readFromNBT(NBTTagCompound nbt) { + super.readFromNBT(nbt); + this.progress = nbt.getShort("progress"); + this.energy = nbt.getDouble("energy"); + } + + @Override + public void onNetworkEvent(EntityPlayer player, int event) { + switch (event) { + case 0: + break; + } + } + + public abstract void operate(); + + @Override + public void updateEntityServer() { + 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.getMaxStorage()) { + this.energy += energyConsume * 10D; + this.getGrid().drawEnergy(energyConsume * 10D, this); + } + if (this.canOperate() && this.energy >= this.energyConsume) { + this.energy -= this.energyConsume * this.upgradeSlot.getPowerConsumtionMultiplier(); + if (this.progress == 0) { + IC2.network.get().initiateTileEntityEvent(this, 0, true); + } + this.progress+=(short)(10*this.upgradeSlot.getProgressMultiplier()); + 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; + } + } + + } + + private double getMaxStorage() { + return maxStorage+this.upgradeSlot.getAdditionalEnergyStorage(); + } + + public abstract List[] getInput(); + + public abstract boolean canOperate(); + + @Override + public void onGuiClosed(EntityPlayer arg0) { + } + + public int getEnergy() { + return (int) this.energy; + } + + public int getGUIEnergy(int i) { + if (this.energy < Float.MAX_VALUE) { + return Math.round((float) (this.energy / this.getMaxStorage() * i)); + } else { + return Math.round((float) (this.energy / this.getMaxStorage()) * i); + } + } + + public int gaugeProgressScaled(int i) { + return this.progress * i / this.operationLength; + } + + public void setEnergy(int value) { + this.energy = value; + } + + @Override + public boolean acceptsEnergyFrom(TileEntity emitter, ForgeDirection direction) { + return true; + } + + @Override + public double getMaxAllowableVoltage() { + return 64000D; + } + + @Override + public double getEnergyAmountThisNodeWant() { + return this.getMaxStorage()-this.energy; + } + + public double drawEnergyToGrid(double amount) { + return 0d; + } + + @Override + public void injectEnergyInThisNode(double amount, double voltage) { + this.energy += amount; + } + +} diff --git a/src/main/java/ihl/processing/metallurgy/CoilerContainer.java b/src/main/java/ihl/processing/metallurgy/CoilerContainer.java new file mode 100644 index 0000000..710a708 --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/CoilerContainer.java @@ -0,0 +1,65 @@ +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 CoilerContainer extends ContainerBase { + + public CoilerTileEntity tileEntity; + private short lastEnergy = -1; + private final static int height=166; + + public CoilerContainer(EntityPlayer entityPlayer, + CoilerTileEntity lathePart1TileEntity) { + super(lathePart1TileEntity); + tileEntity=lathePart1TileEntity; + 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(lathePart1TileEntity.output, 0, 69, 22)); + this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.dischargeSlot,0, 22, 55)); + } + + @Override + public void detectAndSendChanges() + { + super.detectAndSendChanges(); + for (int i = 0; i < this.crafters.size(); ++i) + { + ICrafting icrafting = (ICrafting)this.crafters.get(i); + if (this.tileEntity.getEnergy() != this.lastEnergy) + { + icrafting.sendProgressBarUpdate(this, 1, this.tileEntity.getEnergy()); + } + } + this.lastEnergy = (short) this.tileEntity.getEnergy(); + } + + @Override + public void updateProgressBar(int index, int value) + { + super.updateProgressBar(index, value); + + switch (index) + { + case 1: + this.tileEntity.setEnergy(value); + break; + } + } + +} diff --git a/src/main/java/ihl/processing/metallurgy/CoilerGui.java b/src/main/java/ihl/processing/metallurgy/CoilerGui.java new file mode 100644 index 0000000..b635506 --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/CoilerGui.java @@ -0,0 +1,48 @@ +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; + +public class CoilerGui extends GuiContainer { + + private CoilerContainer container; + protected static final ResourceLocation tex = new ResourceLocation("ihl", "textures/gui/GUICoiler.png"); + + public CoilerGui(CoilerContainer 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); + fontRendererObj.drawStringWithShadow(StatCollector.translateToLocal("ihl.gui.coiler"), 40, 12, 16768125); + this.mc.renderEngine.bindTexture(tex); + int i1; + if (this.container.tileEntity.getEnergy() > 0D) + { + i1 = Math.min(this.container.tileEntity.getGUIEnergy(12),12); + this.drawTexturedModalRect(39, 55 + 12 - i1, 179, 12 - i1, 14, i1 + 2); + } + IHLRenderUtils.instance.drawTooltip(par1,par2,9,11,xOffset,yOffset,StatCollector.translateToLocal("ihl.coiler.tip")); + } + + @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); + } +} diff --git a/src/main/java/ihl/processing/metallurgy/CoilerModel.java b/src/main/java/ihl/processing/metallurgy/CoilerModel.java new file mode 100644 index 0000000..9c1721e --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/CoilerModel.java @@ -0,0 +1,103 @@ +package ihl.processing.metallurgy; + +import ihl.model.IHLModelRenderer; +import net.minecraft.client.model.ModelBase; +import net.minecraftforge.common.util.ForgeDirection; + +public class CoilerModel extends ModelBase +{ + //fields + IHLModelRenderer Base; + IHLModelRenderer RotatingPart2; + IHLModelRenderer MotorPart1; + IHLModelRenderer MotorPart2; + IHLModelRenderer Belt; + IHLModelRenderer Belt2; + IHLModelRenderer CoilRotating; + IHLModelRenderer Coil; + + public CoilerModel() + { + textureWidth = 64; + textureHeight = 32; + setTextureOffset("Base.Shape6", 0, 0); + setTextureOffset("Base.Shape3", 0, 0); + setTextureOffset("Base.Shape2", 0, 0); + setTextureOffset("Base.Shape16", 0, 0); + setTextureOffset("RotatingPart2.PipeN1", 0, 0); + setTextureOffset("RotatingPart2.PipeN7", 49, 23); + setTextureOffset("RotatingPart2.PipeN4", 0, 17); + setTextureOffset("RotatingPart2.PipeN14", 0, 19); + setTextureOffset("RotatingPart2.PipeN17", 0, 17); + setTextureOffset("MotorPart1.PipeN41", 0, 0); + setTextureOffset("MotorPart1.PipeN12", 0, 0); + setTextureOffset("MotorPart1.PipeN13", 0, 0); + setTextureOffset("MotorPart2.Shape4", 0, 24); + setTextureOffset("MotorPart2.Shape7", 0, 9); + setTextureOffset("MotorPart2.Shape10", 0, 9); + setTextureOffset("Belt.Shape12", 0, 0); + setTextureOffset("Belt2.Shape13", 0, 0); + setTextureOffset("CoilRotating.PipeN15", 22, 19); + setTextureOffset("Coil.Shape1", 22, 30); + + Base = new IHLModelRenderer(this, "Base"); + Base.setRotationPoint(0F, 16F, 0F); + setRotation(Base, 0F, 0F, 0F); + Base.mirror = true; + Base.addBox("Shape6", -8F, 7F, -8F, 16, 1, 16); + Base.addBox("Shape3", -5F, 0F, -7F, 4, 7, 1); + Base.addBox("Shape2", -5.5F, -1F, 7F, 5, 8, 1); + Base.addBox("Shape16", 3F, 3F, -6F, 3, 4, 1); + RotatingPart2 = new IHLModelRenderer(this, "RotatingPart2"); + RotatingPart2.setRotationPoint(-3F, 18F, -7F); + setRotation(RotatingPart2, 0F, 0F, 0F); + RotatingPart2.mirror = true; + RotatingPart2.addTube("PipeN1", -0.5F, -0.5F, 0F, 1, 1, 14, 0F,1F,ForgeDirection.NORTH); + RotatingPart2.addTube("PipeN7", -2.5F, -2.5F, -1F, 5, 5, 1, 0F,1F,ForgeDirection.NORTH); + RotatingPart2.addTube("PipeN4", -4F, -4F, 2F, 8, 8, 1, 0F,1F,ForgeDirection.NORTH); + RotatingPart2.addTube("PipeN14", -4F, -4F, 12F, 8, 8, 1, 0F,1F,ForgeDirection.NORTH); + RotatingPart2.addTube("PipeN17", -1F, -1F, 3F, 2, 2, 9, 0F,1F,ForgeDirection.NORTH); + MotorPart1 = new IHLModelRenderer(this, "MotorPart1"); + MotorPart1.setRotationPoint(4.5F, 20.5F, 0F); + setRotation(MotorPart1, 0F, 0F, 0F); + MotorPart1.mirror = true; + MotorPart1.addTube("PipeN41", -1.5F, -1.5F, -8F, 3, 3, 1, 0F,1F,ForgeDirection.NORTH); + MotorPart1.addTube("PipeN12", -0.5F, -0.5F, -7F, 1, 1, 1, 0F,1F,ForgeDirection.NORTH); + MotorPart1.addTube("PipeN13", -1.5F, -1.5F, -5F, 3, 3, 5, 0F,1F,ForgeDirection.NORTH); + MotorPart2 = new IHLModelRenderer(this, "MotorPart2"); + MotorPart2.setRotationPoint(0F, 16F, 0F); + setRotation(MotorPart2, 0F, 0F, 0F); + MotorPart2.mirror = true; + MotorPart2.addBox("Shape4", 3F, 3F, 0F, 3, 4, 4); + MotorPart2.addBox("Shape7", 6F, 3F, -5F, 2, 4, 5); + MotorPart2.addBox("Shape10", 1F, 3F, -5F, 2, 4, 5); + Belt = new IHLModelRenderer(this, "Belt"); + Belt.setRotationPoint(-3F, 15.5F, -7.9F); + setRotation(Belt, 0F, 0F, 0.45F); + Belt.mirror = true; + Belt.addBox("Shape12", 0.5F, 0F, 0F, 8, 1, 1); + Belt2 = new IHLModelRenderer(this, "Belt2"); + Belt2.setRotationPoint(-3F, 19.5F, -7.9F); + setRotation(Belt2, 0F, 0F, 0.19F); + Belt2.mirror = true; + Belt2.addBox("Shape13", 0F, 0F, 0F, 8, 1, 1); + CoilRotating = new IHLModelRenderer(this, "CoilRotating"); + CoilRotating.setRotationPoint(-3F, 18F, -7F); + setRotation(CoilRotating, 0F, 0F, 0F); + CoilRotating.mirror = true; + CoilRotating.addTube("PipeN15", -2F, -2F, 3F, 4, 4, 9, 0F,1F,ForgeDirection.NORTH); + Coil = new IHLModelRenderer(this, "Coil"); + Coil.setRotationPoint(-0.25F, 16F, 0F); + setRotation(Coil, 0F, 0F, -0.2F); + Coil.mirror = true; + Coil.addTube("Shape1", -8F, -0.25F, -0.5F, 5, 1, 1, 0F,1F,ForgeDirection.WEST); + } + + private void setRotation(IHLModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + +} diff --git a/src/main/java/ihl/processing/metallurgy/CoilerRender.java b/src/main/java/ihl/processing/metallurgy/CoilerRender.java new file mode 100644 index 0000000..26ee32f --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/CoilerRender.java @@ -0,0 +1,80 @@ +package ihl.processing.metallurgy; +import org.lwjgl.opengl.GL11; + +import ic2.api.tile.IWrenchable; +import ihl.IHLModInfo; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; + +public class CoilerRender extends TileEntitySpecialRenderer{ +private CoilerModel model = new CoilerModel(); +private ResourceLocation tex = new ResourceLocation(IHLModInfo.MODID+":textures/blocks/coiler.png"); +private final float scale=1F/16F; + + public CoilerRender() {} + + + @Override + public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float par8) + { + int rotation = 0; + if(tile.getWorldObj() != null) + { + switch (((IWrenchable)tile).getFacing()) + { + case 2: + rotation = 0; + break; + case 5: + rotation = 1; + break; + case 3: + rotation = 2; + break; + case 4: + rotation = 3; + break; + default: + rotation = 0; + } + } + else + { + return; + } + CoilerTileEntity cte = (CoilerTileEntity)tile; + GL11.glPushMatrix(); + GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F); + GL11.glScalef(1.0F, -1F, -1F); + GL11.glRotatef(rotation*90, 0.0F, 1.0F, 0.0F); + + bindTexture(tex); + model.Base.render(scale); + model.Belt.render(scale); + model.Belt2.render(scale); + if(cte.getActive()) + { + model.Coil.render(scale); + model.CoilRotating.rotateAngleZ+=0.02F; + model.CoilRotating.render(scale); + model.RotatingPart2.rotateAngleZ+=0.02F; + model.MotorPart1.rotateAngleZ+=0.03F; + model.MotorPart1.render(scale); + model.MotorPart2.render(scale); + } + else + { + + if(cte.hasCoil) + { + model.CoilRotating.render(scale); + } + model.MotorPart1.render(scale); + model.MotorPart2.render(scale); + } + model.RotatingPart2.render(scale); + GL11.glPopMatrix(); //end + + } +} \ No newline at end of file diff --git a/src/main/java/ihl/processing/metallurgy/CoilerTileEntity.java b/src/main/java/ihl/processing/metallurgy/CoilerTileEntity.java new file mode 100644 index 0000000..3853a0e --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/CoilerTileEntity.java @@ -0,0 +1,155 @@ +package ihl.processing.metallurgy; + +import java.util.List; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ic2.core.ContainerBase; +import ic2.core.IC2; +import ic2.core.block.invslot.InvSlotOutput; +import ihl.interfaces.IWire; +import ihl.utils.IHLUtils; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + +public class CoilerTileEntity extends BasicElectricMotorTileEntity implements IProductionLine{ + + public final InvSlotOutput output; + private int activeTimer=0; + public boolean hasCoil=false; + + public CoilerTileEntity() + { + super(); + this.output = new InvSlotOutput(this, "output", 1, 1); + } + + + @Override + public String getInventoryName() { + return "Coiler"; + } + + @Override + public List getNetworkedFields() + { + List fields = super.getNetworkedFields(); + fields.add("hasCoil"); + return fields; + } + + @Override + public ItemStack getWrenchDrop(EntityPlayer player) + { + return IHLUtils.getThisModItemStack("coiler"); + } + + @Override + @SideOnly(Side.CLIENT) + public GuiScreen getGui(EntityPlayer player, boolean arg1) { + return new CoilerGui(new CoilerContainer(player, this)); + } + + @Override + public ContainerBase getGuiContainer(EntityPlayer player) + { + return new CoilerContainer(player, this); + } + + @Override + public boolean canOperate() + { + return false; + } + + @Override + public void updateEntityServer() + { + super.updateEntityServer(); + if(activeTimer>0) + { + activeTimer--; + } + else + { + setActive(false); + } + if(this.output.isEmpty() && hasCoil==true) + { + this.hasCoil=false; + IC2.network.get().updateTileEntityField(this, "hasCoil"); + } + else if(!this.output.isEmpty() && hasCoil==false) + { + this.hasCoil=true; + IC2.network.get().updateTileEntityField(this, "hasCoil"); + } + } + + @Override + public void operate() + {} + + @SuppressWarnings({ "unchecked", "rawtypes" }) + @Override + public List[] getInput() + { + return null; + } + + @Override + public boolean canProcess(ItemStack cable) { + if(this.energy>1D && cable.getItem() instanceof IWire) + { + if(this.output.isEmpty()) + { + return true; + } + else if(this.output.get().getItem() instanceof IWire) + { + return ((IWire)this.output.get().getItem()).isSameWire(this.output.get(), cable); + } + else + { + return this.output.get().isItemEqual(cable); + } + } + return false; + } + + + @Override + public void process(ItemStack cable) { + if(cable.getItem() instanceof IWire) + { + this.energy-=1D; + if(this.output.isEmpty()) + { + setActive(true); + activeTimer=800; + this.output.put(cable); + this.hasCoil=true; + IC2.network.get().updateTileEntityField(this, "hasCoil"); + } + else + { + setActive(true); + activeTimer=800; + int length = this.output.get().stackTagCompound.getInteger(((IWire)this.output.get().getItem()).getTag()); + int fullLength = this.output.get().stackTagCompound.getInteger(((IWire)this.output.get().getItem()).getTagSecondary()); + int lengthToAdd = cable.stackTagCompound.getInteger(((IWire)cable.getItem()).getTag()); + int fullLengthToAdd = cable.stackTagCompound.getInteger(((IWire)cable.getItem()).getTagSecondary()); + this.output.get().stackTagCompound.setInteger(((IWire)this.output.get().getItem()).getTag(), length+lengthToAdd); + this.output.get().stackTagCompound.setInteger(((IWire)this.output.get().getItem()).getTagSecondary(),fullLength+fullLengthToAdd); + } + } + } + + @Override + public boolean shouldRenderInPass(int pass) + { + return pass==0; + } + +} diff --git a/src/main/java/ihl/processing/metallurgy/Crucible.java b/src/main/java/ihl/processing/metallurgy/Crucible.java new file mode 100644 index 0000000..220b505 --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/Crucible.java @@ -0,0 +1,366 @@ +package ihl.processing.metallurgy; + +import java.util.Arrays; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ic2.api.item.IItemHudInfo; +import ic2.api.recipe.IRecipeInput; +import ic2.api.recipe.RecipeInputOreDict; +import ic2.core.IC2; +import ic2.core.IHasGui; +import ic2.core.item.IHandHeldInventory; +import ic2.core.util.LiquidUtil; +import ic2.core.util.StackUtil; +import ihl.IHLCreativeTab; +import ihl.IHLModInfo; +import ihl.recipes.UniversalRecipeInput; +import ihl.recipes.UniversalRecipeManager; +import ihl.recipes.UniversalRecipeOutput; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; +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.IFluidContainerItem; +import net.minecraftforge.fluids.IFluidHandler; + +public class Crucible extends Item implements IHandHeldInventory, IFluidContainerItem, IItemHudInfo{ + + public int capacity=864; + private String itemName; + protected static final UniversalRecipeManager recipeManager = new UniversalRecipeManager("crucible"); + + @SideOnly(Side.CLIENT) + private IIcon iconHot; + + public Crucible() { + super(); + this.itemName="crucible"; + this.setUnlocalizedName(itemName); + GameRegistry.registerItem(this, this.itemName); + this.setCreativeTab(IHLCreativeTab.tab); + this.maxStackSize=1; + this.setCreativeTab(IHLCreativeTab.tab); + this.setMaxDamage(0); + } + + public static void addRecipe(String string, FluidStack output) + { + recipeManager.addRecipe(new UniversalRecipeInput(null, new IRecipeInput[] {new RecipeInputOreDict(string)}), new UniversalRecipeOutput(new FluidStack[] {output},null,20)); + } + + @Override + public IHasGui getInventory(EntityPlayer entityPlayer, ItemStack itemStack) + { + return new CrucibleInventory(entityPlayer, itemStack); + } + + @Override + public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer) + { + if (IC2.platform.isSimulating()) + { + IC2.platform.launchGui(entityPlayer, this.getInventory(entityPlayer, itemStack)); + } + return itemStack; + } + + /** + * allows items to add custom lines of information to the mouseover description + */ + @SuppressWarnings({ "rawtypes", "unchecked" }) + @Override + public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean b) + { + super.addInformation(itemStack, player, info, b); + FluidStack fs = this.getFluid(itemStack); + + if (fs != null) + { + info.add("< " + FluidRegistry.getFluidName(fs) + ", " + fs.amount + " mB >"); + } + else + { + info.add(StatCollector.translateToLocal("ic2.item.FluidContainer.Empty")); + } + } + + @Override + public List getHudInfo(ItemStack itemStack) + { + LinkedList info = new LinkedList(); + FluidStack fs = this.getFluid(itemStack); + + if (fs != null) + { + info.add("< " + FluidRegistry.getFluidName(fs) + ", " + fs.amount + " mB >"); + } + else + { + info.add(StatCollector.translateToLocal("ic2.item.FluidContainer.Empty")); + } + + return info; + } + + @Override + public FluidStack getFluid(ItemStack stack) + { + NBTTagCompound nbtTagCompound = StackUtil.getOrCreateNbtData(stack); + NBTTagCompound fluidTag = nbtTagCompound.getCompoundTag("Fluid"); + return FluidStack.loadFluidStackFromNBT(fluidTag); + } + + public boolean isEmpty(ItemStack stack) + { + return this.getFluid(stack) == null; + } + + @Override + public int getCapacity(ItemStack container) + { + return this.capacity; + } + + public boolean canfill(Fluid var1) + { + return true; + } + + public ItemStack processContent(ItemStack itemStack, IInventory inventoryContainer) + { + CrucibleInventory inventory = new CrucibleInventory(inventoryContainer, itemStack); + ItemStack content = inventory.getStackInSlot(0); + if(content!=null) + { + UniversalRecipeOutput routput = recipeManager.getOutputFor(null, Arrays.asList(new ItemStack [] {content})); + if(routput!=null && !routput.getFluidOutputs().isEmpty()) + { + FluidStack fluidStack = routput.getFluidOutputs().get(0).copy(); + fluidStack.amount *= content.stackSize; + itemStack.stackTagCompound = new NBTTagCompound(); + this.fill(itemStack, fluidStack, true); + return itemStack; + } + } + return itemStack; + } + + @Override + public int fill(ItemStack stack, FluidStack resource, boolean doFill) + { + if (stack.stackSize != 1) + { + return 0; + } + else if (resource == null) + { + return 0; + } + else if (!this.canfill(resource.getFluid())) + { + return 0; + } + else + { + NBTTagCompound nbtTagCompound = StackUtil.getOrCreateNbtData(stack); + NBTTagCompound fluidTag = nbtTagCompound.getCompoundTag("Fluid"); + FluidStack fs = FluidStack.loadFluidStackFromNBT(fluidTag); + + if (fs == null) + { + fs = new FluidStack(resource, 0); + } + + if (!fs.isFluidEqual(resource)) + { + return 0; + } + else + { + int amount = Math.min(this.capacity - fs.amount, resource.amount); + + if (doFill && amount > 0) + { + fs.amount += amount; + fs.writeToNBT(fluidTag); + nbtTagCompound.setTag("Fluid", fluidTag); + if(fs.getFluid().getTemperature()>900)stack.setItemDamage(1); + } + + return amount; + } + } + } + + @Override + public FluidStack drain(ItemStack stack, int maxDrain, boolean doDrain) + { + if (stack.stackSize != 1) + { + return null; + } + else + { + NBTTagCompound nbtTagCompound = StackUtil.getOrCreateNbtData(stack); + NBTTagCompound fluidTag = nbtTagCompound.getCompoundTag("Fluid"); + FluidStack fs = FluidStack.loadFluidStackFromNBT(fluidTag); + + if (fs == null) + { + return null; + } + else + { + maxDrain = Math.min(fs.amount, maxDrain); + + if (doDrain) + { + fs.amount -= maxDrain; + + if (fs.amount <= 0) + { + nbtTagCompound.removeTag("Fluid"); + stack.setItemDamage(0); + } + else + { + fs.writeToNBT(fluidTag); + nbtTagCompound.setTag("Fluid", fluidTag); + } + } + + return new FluidStack(fs, maxDrain); + } + } + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister register) + { + itemIcon=register.registerIcon(IHLModInfo.MODID + ":crucible"); + iconHot=register.registerIcon(IHLModInfo.MODID + ":crucibleHot"); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int meta) + { + switch(meta) + { + case 0: + return this.itemIcon; + case 1: + return this.iconHot; + default: + return this.itemIcon; + } + } + + @Override + public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float xOffset, float yOffset, float zOffset) + { + if (!IC2.platform.isSimulating()) + { + return false; + } + else if (this.interactWithTank(stack, player, world, x, y, z, side)) + { + return true; + } + return false; + } + + + private boolean interactWithTank(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side) + { + if (!IC2.platform.isSimulating()) + { + return false; + } + else + { + TileEntity te = world.getTileEntity(x, y, z); + + if (!(te instanceof IFluidHandler)) + { + return false; + } + else + { + IFluidHandler handler = (IFluidHandler)te; + ForgeDirection dir = ForgeDirection.getOrientation(side); + FluidStack fs = this.getFluid(stack); + int amount; + + if (fs != null && (!player.isSneaking() || fs.amount >= this.capacity)) + { + amount = handler.fill(dir, fs, false); + + if (amount <= 0) + { + return false; + } + else + { + fs = LiquidUtil.drainContainerStack(stack, player, amount, false); + + if (fs != null && fs.amount > 0) + { + handler.fill(dir, fs, true); + return true; + } + else + { + return false; + } + } + } + else + { + amount = fs == null ? this.capacity : this.capacity - fs.amount; + FluidStack input = handler.drain(dir, amount, false); + + if (input != null && input.amount > 0) + { + amount = LiquidUtil.fillContainerStack(stack, player, input, false); + + if (amount <= 0) + { + return false; + } + else + { + handler.drain(dir, amount, true); + return true; + } + } + else + { + return false; + } + } + } + } + } + + public static Map getRecipes() { + return recipeManager.getRecipes(); + } + +} diff --git a/src/main/java/ihl/processing/metallurgy/CrucibleContainer.java b/src/main/java/ihl/processing/metallurgy/CrucibleContainer.java new file mode 100644 index 0000000..20ec65e --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/CrucibleContainer.java @@ -0,0 +1,66 @@ +package ihl.processing.metallurgy; + +import ic2.core.ContainerBase; +import ic2.core.IC2; +import ic2.core.util.StackUtil; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; + +public class CrucibleContainer extends ContainerBase +{ + public CrucibleInventory box; + public CrucibleContainer(EntityPlayer entityPlayer, CrucibleInventory box) + { + super(box); + this.box = box; + int col; + if(((Crucible)this.box.thisItemStack.getItem()).isEmpty(this.box.thisItemStack)) + { + this.addSlotToContainer(new CrucibleSlot(this.box, 0, 81, 42)); + } + 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, 84 + col * 18)); + } + } + + for (col = 0; col < 9; ++col) + { + this.addSlotToContainer(new Slot(entityPlayer.inventory, col, 8 + col * 18, 142)); + } + } + + @Override + public ItemStack slotClick(int slot, int button, int par3, EntityPlayer player) + { + if (player instanceof EntityPlayerMP && IC2.platform.isSimulating() && slot == -999 && (button == 0 || button == 1)) + { + ItemStack stack = player.inventory.getItemStack(); + + if (stack != null) + { + StackUtil.getOrCreateNbtData(stack); + + if (this.box.isThisContainer(stack)) + { + ((EntityPlayerMP)player).closeScreen(); + } + } + } + return super.slotClick(slot, button, par3, player); + } + + /** + * Called when the container is closed. + */ + @Override + public void onContainerClosed(EntityPlayer entityPlayer) + { + this.box.onGuiClosed(entityPlayer); + super.onContainerClosed(entityPlayer); + } +} diff --git a/src/main/java/ihl/processing/metallurgy/CrucibleGui.java b/src/main/java/ihl/processing/metallurgy/CrucibleGui.java new file mode 100644 index 0000000..f05e7bb --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/CrucibleGui.java @@ -0,0 +1,84 @@ +package ihl.processing.metallurgy; + +import org.lwjgl.opengl.GL11; + +import ic2.core.util.DrawUtil; +import ic2.core.util.GuiTooltipHelper; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; + +public class CrucibleGui extends GuiContainer +{ + public CrucibleContainer container; + private static final ResourceLocation background = new ResourceLocation("ihl", "textures/gui/GUICrucible.png"); + private static final String title = StatCollector.translateToLocal("item.crucible.name"); + + public CrucibleGui(CrucibleContainer container1) + { + super(container1); + this.container = container1; + } + + @Override + protected void drawGuiContainerForegroundLayer(int par1, int par2) { + fontRendererObj.drawString(title, 68, 0, 6171880); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + } + + @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); + int x = (width - xSize) / 2; + int y = (height - ySize) / 2; + this.mc.renderEngine.bindTexture(background); + this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); + if(this.getItemStack().getItemDamage()==1) + { + this.drawTexturedModalRect(x+67, y+26, 198, 52, 58, 39); + } + FluidStack fluidStack = this.getItemInstance().getFluid(this.getItemStack()); + if (fluidStack!=null && fluidStack.amount > 0) + { + Fluid fluid = fluidStack.getFluid(); + if(fluid!=null) + { + IIcon fluidIcon = fluid.getIcon(); + if (fluidIcon != null) + { + this.mc.renderEngine.bindTexture(TextureMap.locationBlocksTexture); + int liquidHeight = fluidStack.amount*20/getItemInstance().capacity; + DrawUtil.drawRepeated(fluidIcon, x+71, y+ 41 + 20 - liquidHeight, 35.0D, liquidHeight, this.zLevel); + } + } + String tooltip = StatCollector.translateToLocal(fluidStack.getFluid().getName()) + ": " + fluidStack.amount + "mB"; + GuiTooltipHelper.drawAreaTooltip(par2, par3, tooltip, x-16, y+10, x+16, y+29); + } + this.mc.renderEngine.bindTexture(background); + if(this.getItemStack().getItemDamage()==1) + { + this.drawTexturedModalRect(x+68, y+40, 198, 26, 58, 26); + } + else + { + this.drawTexturedModalRect(x+68, y+40, 198, 0, 58, 26); + } + } + + private Crucible getItemInstance() + { + return ((Crucible)this.container.box.thisItemStack.getItem()); + } + + private ItemStack getItemStack() + { + return this.container.box.thisItemStack; + } +} \ No newline at end of file diff --git a/src/main/java/ihl/processing/metallurgy/CrucibleInventory.java b/src/main/java/ihl/processing/metallurgy/CrucibleInventory.java new file mode 100644 index 0000000..253483f --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/CrucibleInventory.java @@ -0,0 +1,126 @@ +package ihl.processing.metallurgy; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ic2.core.ContainerBase; +import ic2.core.IC2; +import ic2.core.item.tool.HandHeldInventory; +import ic2.core.util.StackUtil; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; + +public class CrucibleInventory extends HandHeldInventory { + + ItemStack thisItemStack; + IInventory inventoryContainer; + + public CrucibleInventory(EntityPlayer player, ItemStack stack) { + super(player, stack, 1); + thisItemStack = stack; + inventoryContainer = player.inventory; + } + + public CrucibleInventory(IInventory inventoryContainer1, ItemStack stack) { + super(null, stack, 1); + thisItemStack = stack; + inventoryContainer = inventoryContainer1; + } + + @Override + @SideOnly(Side.CLIENT) + public GuiScreen getGui(EntityPlayer player, boolean arg1) { + return new CrucibleGui(new CrucibleContainer(player, this)); + } + + @Override + public ContainerBase getGuiContainer(EntityPlayer player) { + return new CrucibleContainer(player, this); + } + + @Override + public String getInventoryName() { + return "crucible"; + } + + @Override + public boolean hasCustomInventoryName() { + return false; + } + + @Override + public boolean isItemValidForSlot(int arg0, ItemStack stack) { + return true; + } + + @Override + public int getInventoryStackLimit() { + return 6; + } + + @Override + public void save() { + if (IC2.platform.isSimulating()) { + NBTTagCompound nbtTagCompound = StackUtil.getOrCreateNbtData(this.thisItemStack); + + for (int nbtTagList = 0; nbtTagList < this.getSizeInventory(); ++nbtTagList) { + if (this.inventory[nbtTagList] != null) { + NBTTagCompound i = StackUtil.getOrCreateNbtData(this.inventory[nbtTagList]); + + if (nbtTagCompound.getInteger("uid") == i.getInteger("uid")) { + this.thisItemStack.stackSize = 1; + this.inventory[nbtTagList] = null; + break; + } + } + } + + NBTTagList var7 = new NBTTagList(); + int var8; + + for (var8 = 0; var8 < this.inventory.length; ++var8) { + if (this.inventory[var8] != null) { + NBTTagCompound itemStackSlot = new NBTTagCompound(); + itemStackSlot.setByte("Slot", (byte) var8); + this.inventory[var8].writeToNBT(itemStackSlot); + var7.appendTag(itemStackSlot); + } + } + + nbtTagCompound.setTag("Items", var7); + + for (var8 = -1; var8 < inventoryContainer.getSizeInventory(); ++var8) { + ItemStack var9 = null; + + if (var8 == -1 && inventoryContainer instanceof InventoryPlayer) { + var9 = ((InventoryPlayer) inventoryContainer).getItemStack(); + } else if (var8 >= 0) { + var9 = inventoryContainer.getStackInSlot(var8); + } + + if (var9 != null) { + NBTTagCompound nbtTagCompoundSlot = var9.getTagCompound(); + + if (nbtTagCompoundSlot != null + && nbtTagCompound.getInteger("uid") == nbtTagCompoundSlot.getInteger("uid")) { + this.thisItemStack.stackSize = 1; + + if (var8 == -1 && inventoryContainer instanceof InventoryPlayer) { + ((InventoryPlayer) inventoryContainer).setItemStack(this.thisItemStack); + } else { + inventoryContainer.setInventorySlotContents(var8, this.thisItemStack); + } + + break; + } + } + } + + } + } + +} diff --git a/src/main/java/ihl/processing/metallurgy/CrucibleSlot.java b/src/main/java/ihl/processing/metallurgy/CrucibleSlot.java new file mode 100644 index 0000000..5fc6a33 --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/CrucibleSlot.java @@ -0,0 +1,18 @@ +package ihl.processing.metallurgy; + +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; + +public class CrucibleSlot extends Slot { + CrucibleInventory inventory; + + public CrucibleSlot(CrucibleInventory arg0, int arg1, int arg2, int arg3) { + super(arg0, arg1, arg2, arg3); + inventory = arg0; + } + + @Override + public boolean isItemValid(ItemStack itemstack) { + return itemstack != null; + } +} diff --git a/src/main/java/ihl/processing/metallurgy/DetonationSprayingMachineContainer.java b/src/main/java/ihl/processing/metallurgy/DetonationSprayingMachineContainer.java new file mode 100644 index 0000000..94d479c --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/DetonationSprayingMachineContainer.java @@ -0,0 +1,39 @@ +package ihl.processing.metallurgy; + +import ic2.core.ContainerBase; +import ic2.core.slot.SlotInvSlot; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Slot; + +public class DetonationSprayingMachineContainer extends ContainerBase { + + protected DetonationSprayingMachineTileEntity tileEntity; + public int lastFluidAmount = -1; + public short lastProgress = -1; + private final static int height=166; + + public DetonationSprayingMachineContainer(EntityPlayer entityPlayer, DetonationSprayingMachineTileEntity detonationSprayingMachineTileEntity){ + super(detonationSprayingMachineTileEntity); + this.tileEntity = detonationSprayingMachineTileEntity; + 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(detonationSprayingMachineTileEntity.input, 0, 10, 17)); + this.addSlotToContainer(new SlotInvSlot(detonationSprayingMachineTileEntity.input, 1, 98, 17)); + this.addSlotToContainer(new SlotInvSlot(detonationSprayingMachineTileEntity.input, 2, 117, 17)); + } + + @Override + public boolean canInteractWith(EntityPlayer var1) { + return tileEntity.isUseableByPlayer(var1); + } +} diff --git a/src/main/java/ihl/processing/metallurgy/DetonationSprayingMachineGui.java b/src/main/java/ihl/processing/metallurgy/DetonationSprayingMachineGui.java new file mode 100644 index 0000000..8cd29d0 --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/DetonationSprayingMachineGui.java @@ -0,0 +1,48 @@ +package ihl.processing.metallurgy; + +import java.util.Iterator; + +import org.lwjgl.opengl.GL11; + +import codechicken.lib.gui.GuiDraw; +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; + +@SideOnly(Side.CLIENT) +public class DetonationSprayingMachineGui extends GuiContainer { + private static final ResourceLocation background = new ResourceLocation("ihl", "textures/gui/GUIDetonationSprayingMachine.png"); + 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); + } + + @Override + protected void drawGuiContainerForegroundLayer(int par1, int par2) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.renderEngine.bindTexture(background); + } + + @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 + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.renderEngine.bindTexture(background); + int x = (width - xSize) / 2; + int y = (height - ySize) / 2; + this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); + Iterator noteListIterator = this.mc.fontRenderer.listFormattedStringToWidth(hint, 140).iterator(); + int yTextPos=40; + while(noteListIterator.hasNext()) + { + GuiDraw.fontRenderer.drawStringWithShadow(noteListIterator.next(), x+15, y+yTextPos, 16777215); + yTextPos+=10; + } + } +} \ No newline at end of file diff --git a/src/main/java/ihl/processing/metallurgy/DetonationSprayingMachineModel.java b/src/main/java/ihl/processing/metallurgy/DetonationSprayingMachineModel.java new file mode 100644 index 0000000..7335125 --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/DetonationSprayingMachineModel.java @@ -0,0 +1,57 @@ +package ihl.processing.metallurgy; + +import ihl.model.IHLModelRenderer; +import net.minecraft.client.model.ModelBase; +import net.minecraft.entity.Entity; +import net.minecraftforge.common.util.ForgeDirection; + +public class DetonationSprayingMachineModel extends ModelBase { + //fields + IHLModelRenderer Base; + + public DetonationSprayingMachineModel() + { + textureWidth = 64; + textureHeight = 32; + setTextureOffset("Base.Shape1", 20, 0); + setTextureOffset("Base.Shape2", 34, 0); + setTextureOffset("Base.Shape3", 23, 0); + setTextureOffset("Base.Shape4", 23, 0); + setTextureOffset("Base.Shape5", 0, 0); + setTextureOffset("Base.Tube1", 0, 0); + setTextureOffset("Base.Tube2", 0, 0); + setTextureOffset("Base.Shape12", 0, 20); + setTextureOffset("Base.Shape13", 0, 20); + setTextureOffset("Base.Shape14", 0, 20); + setTextureOffset("Base.Shape7", 26, 22); + setTextureOffset("Base.Shape8", 18, 19); + setTextureOffset("Base.Shape9", 18, 22); + setTextureOffset("Base.Tube11", 8, 5); + + Base = new IHLModelRenderer(this, "Base"); + Base.setRotationPoint(0F, 8F, 0F); + Base.mirror = true; + Base.addBox("Shape1", 4F, 6F, 7F, 2, 9, 1, false); + Base.addBox("Shape2", -7F, 4F, 6F, 14, 11, 1, false); + Base.addBox("Shape3", -1F, 6F, 7F, 2, 9, 1, false); + Base.addBox("Shape4", -6F, 6F, 7F, 2, 9, 1, false); + Base.addBox("Shape5", -8F, 15F, -8F, 16, 1, 16, false); + Base.addTube("Tube1", -1F, 10F, -7F, 2, 2, 6, 0.5F,1F,ForgeDirection.NORTH); + Base.addTube("Tube2", -2.5F, 10.5F, -6F, 5, 1, 1, 0F,1F,ForgeDirection.EAST); + Base.addBox("Shape12", -2.5F, 11.7F, -2.2F, 5, 4, 1, false); + Base.addBox("Shape13", 1F, 9F, -8F, 1, 6, 6, false); + Base.addBox("Shape14", -2F, 9F, -8F, 1, 6, 6, false); + Base.addBox("Shape7", -1F, 14F, -8F, 2, 1, 5, false); + Base.addBox("Shape8", 2F, 14F, -8F, 2, 1, 9, false); + Base.addBox("Shape9", -4F, 14F, -8F, 2, 1, 9, false); + Base.addTube("Tube11", -1F, 10F, -8F, 2, 2, 1, 0F,1F,ForgeDirection.NORTH); + } + + @Override + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) + { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + } +} + + diff --git a/src/main/java/ihl/processing/metallurgy/DetonationSprayingMachineRender.java b/src/main/java/ihl/processing/metallurgy/DetonationSprayingMachineRender.java new file mode 100644 index 0000000..b68f8b3 --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/DetonationSprayingMachineRender.java @@ -0,0 +1,61 @@ +package ihl.processing.metallurgy; +import org.lwjgl.opengl.GL11; + +import ic2.api.tile.IWrenchable; +import ihl.IHLModInfo; +import ihl.utils.IHLItemRenderer; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; + +public class DetonationSprayingMachineRender extends TileEntitySpecialRenderer{ +private DetonationSprayingMachineModel model = new DetonationSprayingMachineModel(); +private ResourceLocation tex = new ResourceLocation(IHLModInfo.MODID+":textures/blocks/detonationSprayingMachine.png"); +private final float scale=1F/16F; +private IHLItemRenderer itemRenderer=new IHLItemRenderer(true); + +public DetonationSprayingMachineRender(){} + +public void renderAModelAt(DetonationSprayingMachineTileEntity tile, double x, double y, double z, float f) { + GL11.glPushMatrix(); + GL11.glTranslatef((float)x + 0.5F, (float)y+0.5F, (float)z + 0.5F); + int rotation = 0; + if(tile.getWorldObj() != null) + { + switch (((IWrenchable)tile).getFacing()) + { + case 2: + rotation = 0; + break; + case 5: + rotation = 1; + break; + case 3: + rotation = 2; + break; + case 4: + rotation = 3; + break; + default: + rotation = 0; + } + } + GL11.glRotatef(-rotation*90f, 0F, 1F, 0F); + if(tile.input.get()!=null) + { + this.itemRenderer.doRender(RenderManager.instance,tile.input.get(),0F,-0.2F,-0.35F); + } + bindTexture(tex); //texture + GL11.glScalef(1F, -1F, -1F); + GL11.glTranslatef(0F, -1.0F, 0F); + model.Base.render(scale); + GL11.glPopMatrix(); +} + + @Override + public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8) + { + this.renderAModelAt((DetonationSprayingMachineTileEntity)par1TileEntity, par2, par4, par6, par8); + } +} \ No newline at end of file diff --git a/src/main/java/ihl/processing/metallurgy/DetonationSprayingMachineTileEntity.java b/src/main/java/ihl/processing/metallurgy/DetonationSprayingMachineTileEntity.java new file mode 100644 index 0000000..411b8db --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/DetonationSprayingMachineTileEntity.java @@ -0,0 +1,198 @@ +package ihl.processing.metallurgy; + +import java.util.List; +import java.util.Map; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ic2.api.network.INetworkTileEntityEventListener; +import ic2.api.recipe.IRecipeInput; +import ic2.api.recipe.RecipeInputItemStack; +import ic2.api.recipe.RecipeInputOreDict; +import ic2.core.ContainerBase; +import ic2.core.ExplosionIC2; +import ic2.core.IC2; +import ic2.core.IHasGui; +import ic2.core.audio.AudioSource; +import ic2.core.audio.PositionSpec; +import ic2.core.block.TileEntityInventory; +import ic2.core.block.invslot.InvSlot.Access; +import ihl.processing.chemistry.ApparatusProcessableInvSlot; +import ihl.recipes.RecipeOutputItemStack; +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 net.minecraft.nbt.NBTTagCompound; + +public class DetonationSprayingMachineTileEntity extends TileEntityInventory implements IHasGui, INetworkTileEntityEventListener +{ + protected static final UniversalRecipeManager recipeManager = new UniversalRecipeManager("detonationsprayingmachine"); + public final ApparatusProcessableInvSlot input; + private AudioSource explosion; + + public DetonationSprayingMachineTileEntity() { + super(); + this.input = new ApparatusProcessableInvSlot(this, "input", 0, Access.IO, 3, 64); + } + + @Override + public List getNetworkedFields() + { + List fields = super.getNetworkedFields(); + return fields; + } + + @Override + public void readFromNBT(NBTTagCompound nbttagcompound) + { + super.readFromNBT(nbttagcompound); + } + + @Override + public void writeToNBT(NBTTagCompound nbttagcompound) + { + super.writeToNBT(nbttagcompound); + } + + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { + return false; + } + + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { + return IHLUtils.getThisModItemStack("cannonBronze"); + } + + @Override + public String getInventoryName() { + return "detonationSprayingMachine"; + } + + @Override + public void onNetworkEvent(int event) + { + worldObj.playSoundEffect(xCoord, yCoord, zCoord, "random.explode", 4.0F, 1.0F); + } + + @Override + @SideOnly(Side.CLIENT) + public GuiScreen getGui(EntityPlayer player, boolean arg1) { + return new DetonationSprayingMachineGui(new DetonationSprayingMachineContainer(player, this)); + } + + @Override + public ContainerBase getGuiContainer(EntityPlayer player) { + return new DetonationSprayingMachineContainer(player, this); + } + + @Override + public void onGuiClosed(EntityPlayer player) {} + + public boolean canOperate() + { + return getOutput()!=null; + } + + public UniversalRecipeOutput getOutput() + { + return DetonationSprayingMachineTileEntity.recipeManager.getOutputFor(this.getInput()); + } + + public List[] getInput() + { + return new List[] {null,this.input.getItemStackList()}; + } + + @Override + public void onLoaded() + { + super.onLoaded(); + if (IC2.platform.isRendering() && this.explosion==null) + { + this.explosion = IC2.audioManager.createSource(this, PositionSpec.Center, "Machines/MinerOp.ogg",false,false, 0.5F); + } + } + + + public void operate() + {//diamond file max durability - 128000 + //file tags - "GT.ToolStats"->"MaxDamage" & "Damage" + if(this.canOperate()) + { + List input1 = DetonationSprayingMachineTileEntity.recipeManager.getRecipeInput(getInput()).getItemInputs(); + List output1 = DetonationSprayingMachineTileEntity.recipeManager.getOutputFor(getInput()).getItemOutputs(); + ItemStack resultStack = output1.get(0).itemStack.copy(); + resultStack.stackSize=this.input.get(0).stackSize; + if(resultStack.stackTagCompound==null) + { + resultStack.stackTagCompound=this.input.get(0).stackTagCompound; + } + if(resultStack.stackTagCompound!=null && resultStack.stackTagCompound.hasKey("GT.ToolStats")) + { + NBTTagCompound gtTagCompound = resultStack.stackTagCompound.getCompoundTag("GT.ToolStats"); + if(gtTagCompound!=null && gtTagCompound.hasKey("MaxDamage")) + { + int maxDamage = gtTagCompound.getInteger("MaxDamage"); + int damage = 0; + if(gtTagCompound.hasKey("Damage")) + { + damage = gtTagCompound.getInteger("Damage"); + } + if(damage getRecipes() { + return recipeManager.getRecipes(); + } + + @Override + public boolean shouldRenderInPass(int pass) + { + return pass==0; + } + +} \ No newline at end of file diff --git a/src/main/java/ihl/processing/metallurgy/ElectricEngineItem.java b/src/main/java/ihl/processing/metallurgy/ElectricEngineItem.java new file mode 100644 index 0000000..c1e0003 --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/ElectricEngineItem.java @@ -0,0 +1,84 @@ +package ihl.processing.metallurgy; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ihl.IHLCreativeTab; +import ihl.IHLModInfo; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.item.Item; +import net.minecraft.util.IIcon; + +public class ElectricEngineItem extends Item{ + + public Type type; + public static List instances = new ArrayList (); + private static Map iconMap = new HashMap(); + + + public ElectricEngineItem(Type type1) + { + super(); + this.type=type1; + this.setCreativeTab(IHLCreativeTab.tab); + this.setUnlocalizedName(type.unLocalizedName); + this.setMaxStackSize(1); + instances.add(this); + } + + public static void init() + { + Type[] var1 = Type.values(); + for(int i=0;i ii = instances.iterator(); + while(ii.hasNext()) + { + ElectricEngineItem instance = ii.next(); + GameRegistry.registerItem(instance,instance.type.unLocalizedName); + } + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister register) + { + iconMap.put(this.type, register.registerIcon(IHLModInfo.MODID + ":"+this.type.unLocalizedName)); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int i) + { + return iconMap.get(type); + } + + + public enum Type + { + LVLEElectricEngine("electricMotorLVLEDC", 600,400,0.2F,1500); + Type(String unlocalizedName1, int maxVoltage1, int generatedVoltage1, float efficiency1,int rpm1) + { + unLocalizedName=unlocalizedName1; + maxVoltage=maxVoltage1; + generatedVoltage=generatedVoltage1; + efficiency=efficiency1; + rpm=rpm1; + } + + public String unLocalizedName; + public int maxVoltage=600; + public int generatedVoltage=400; + public float efficiency = 0.2F; + public int rpm=1500;//at max voltage + } + +} diff --git a/src/main/java/ihl/processing/metallurgy/ExtruderContainer.java b/src/main/java/ihl/processing/metallurgy/ExtruderContainer.java new file mode 100644 index 0000000..77b92e6 --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/ExtruderContainer.java @@ -0,0 +1,75 @@ +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 ExtruderContainer extends ContainerBase { + + public ExtruderTileEntity tileEntity; + public int lastProgress = -1; + private short lastEnergy = -1; + private final static int height=166; + + public ExtruderContainer(EntityPlayer entityPlayer, + ExtruderTileEntity lathePart1TileEntity) { + super(lathePart1TileEntity); + tileEntity=lathePart1TileEntity; + 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(lathePart1TileEntity.input, 0, 39, 32)); + this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.input2, 0, 57, 32)); + this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.dischargeSlot,0, 8, 32)); + } + + @Override + public void detectAndSendChanges() + { + super.detectAndSendChanges(); + for (int i = 0; i < this.crafters.size(); ++i) + { + ICrafting icrafting = (ICrafting)this.crafters.get(i); + if (this.tileEntity.progress != this.lastProgress) + { + icrafting.sendProgressBarUpdate(this, 0, this.tileEntity.progress); + } + if (this.tileEntity.getEnergy() != this.lastEnergy) + { + icrafting.sendProgressBarUpdate(this, 1, this.tileEntity.getEnergy()); + } + } + this.lastProgress = this.tileEntity.progress; + this.lastEnergy = (short) this.tileEntity.getEnergy(); + } + + @Override + public void updateProgressBar(int index, int value) + { + super.updateProgressBar(index, value); + + switch (index) + { + case 0: + this.tileEntity.progress=(short) value; + break; + case 1: + this.tileEntity.setEnergy(value); + break; + } + } + +} diff --git a/src/main/java/ihl/processing/metallurgy/ExtruderGui.java b/src/main/java/ihl/processing/metallurgy/ExtruderGui.java new file mode 100644 index 0000000..acf1a76 --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/ExtruderGui.java @@ -0,0 +1,49 @@ +package ihl.processing.metallurgy; + +import org.lwjgl.opengl.GL11; + +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.util.ResourceLocation; + +public class ExtruderGui extends GuiContainer { + + private ExtruderContainer container; + protected static final ResourceLocation tex = new ResourceLocation("ihl", "textures/gui/GUIExtruder.png"); + + public ExtruderGui(ExtruderContainer latheContainer) { + super(latheContainer); + container = latheContainer; + } + + + @Override + protected void drawGuiContainerForegroundLayer(int par1, int par2) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.renderEngine.bindTexture(tex); + int i1; + if (this.container.tileEntity.getEnergy() > 0D) + { + 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.9F); + i1 = Math.min(this.container.tileEntity.getGUIEnergy(12),12); + this.drawTexturedModalRect(9, 15 + 12 - i1, 176, 12 - i1, 14, i1 + 2); + } + if (this.container.tileEntity.progress > 0) + { + i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(18),18); + this.drawTexturedModalRect(74, 34, 198, 0, i1 + 1, 13); + } + } + + @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); + } +} diff --git a/src/main/java/ihl/processing/metallurgy/ExtruderModel.java b/src/main/java/ihl/processing/metallurgy/ExtruderModel.java new file mode 100644 index 0000000..fcff405 --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/ExtruderModel.java @@ -0,0 +1,100 @@ +package ihl.processing.metallurgy; + +import ihl.model.IHLModelRenderer; +import net.minecraft.client.model.ModelBase; +import net.minecraftforge.common.util.ForgeDirection; + +public class ExtruderModel extends ModelBase +{ + //fields + IHLModelRenderer Base; + IHLModelRenderer RotatingPart2; + IHLModelRenderer MotorPart1; + IHLModelRenderer MotorPart2; + IHLModelRenderer Belt; + IHLModelRenderer Belt2; + IHLModelRenderer Extruder; + + public ExtruderModel() + { + textureWidth = 64; + textureHeight = 32; + setTextureOffset("Base.Shape6", 0, 0); + setTextureOffset("Base.Shape3", 0, 0); + setTextureOffset("Base.Shape16", 0, 0); + setTextureOffset("RotatingPart2.PipeN7", 49, 23); + setTextureOffset("RotatingPart2.PipeN4", 0, 7); + setTextureOffset("MotorPart1.PipeN41", 0, 0); + setTextureOffset("MotorPart1.PipeN12", 0, 0); + setTextureOffset("MotorPart1.PipeN13", 0, 0); + setTextureOffset("MotorPart2.Shape4", 0, 24); + setTextureOffset("MotorPart2.Shape7", 0, 9); + setTextureOffset("MotorPart2.Shape10", 0, 9); + setTextureOffset("Belt.Shape12", 0, 0); + setTextureOffset("Belt2.Shape13", 0, 0); + setTextureOffset("Extruder.PipeN16", 0, 0); + setTextureOffset("Extruder.PipeN15", 24, 20); + setTextureOffset("Extruder.Shape8", 0, 0); + setTextureOffset("Extruder.PipeU17", 0, 0); + setTextureOffset("Extruder.PipeUC18", 0, 0); + setTextureOffset("Extruder.Shape14", 0, 0); + setTextureOffset("Extruder.PipeN14", 0, 0); + + Base = new IHLModelRenderer(this, "Base"); + Base.setRotationPoint(0F, 16F, 0F); + setRotation(Base, 0F, 0F, 0F); + Base.mirror = true; + Base.addBox("Shape6", -8F, 7F, -8F, 16, 1, 16); + Base.addBox("Shape3", -5F, 0F, -7F, 4, 7, 1); + Base.addBox("Shape16", 3F, 3F, -6F, 3, 4, 1); + RotatingPart2 = new IHLModelRenderer(this, "RotatingPart2"); + RotatingPart2.setRotationPoint(-3F, 18F, -7F); + setRotation(RotatingPart2, 0F, 0F, 0F); + RotatingPart2.mirror = true; + RotatingPart2.addTube("PipeN7", -2.5F, -2.5F, -1F, 5, 5, 1, 0F,1F,ForgeDirection.NORTH); + RotatingPart2.addTube("PipeN4", -1F, -1F, 1F, 2, 2, 1, 0F,1F,ForgeDirection.NORTH); + MotorPart1 = new IHLModelRenderer(this, "MotorPart1"); + MotorPart1.setRotationPoint(4.5F, 20.5F, 0F); + setRotation(MotorPart1, 0F, 0F, 0F); + MotorPart1.mirror = true; + MotorPart1.addTube("PipeN41", -1.5F, -1.5F, -8F, 3, 3, 1, 0F,1F,ForgeDirection.NORTH); + MotorPart1.addTube("PipeN12", -0.5F, -0.5F, -7F, 1, 1, 1, 0F,1F,ForgeDirection.NORTH); + MotorPart1.addTube("PipeN13", -1.5F, -1.5F, -5F, 3, 3, 5, 0F,1F,ForgeDirection.NORTH); + MotorPart2 = new IHLModelRenderer(this, "MotorPart2"); + MotorPart2.setRotationPoint(0F, 16F, 0F); + setRotation(MotorPart2, 0F, 0F, 0F); + MotorPart2.mirror = true; + MotorPart2.addBox("Shape4", 3F, 3F, 0F, 3, 4, 4); + MotorPart2.addBox("Shape7", 6F, 3F, -5F, 2, 4, 5); + MotorPart2.addBox("Shape10", 1F, 3F, -5F, 2, 4, 5); + Belt = new IHLModelRenderer(this, "Belt"); + Belt.setRotationPoint(-3F, 15.5F, -7.9F); + setRotation(Belt, 0F, 0F, 0.45F); + Belt.mirror = true; + Belt.addBox("Shape12", 0.5F, 0F, 0F, 8, 1, 1); + Belt2 = new IHLModelRenderer(this, "Belt2"); + Belt2.setRotationPoint(-3F, 19.5F, -7.9F); + setRotation(Belt2, 0F, 0F, 0.19F); + Belt2.mirror = true; + Belt2.addBox("Shape13", 0F, 0F, 0F, 8, 1, 1); + Extruder = new IHLModelRenderer(this, "Extruder"); + Extruder.setRotationPoint(0F, 16F, 0F); + setRotation(Extruder, 0F, 0F, 0F); + Extruder.mirror = true; + Extruder.addTube("PipeN16", -4.5F, 0.5F, -5F, 3, 3, 12, 0F,1F,ForgeDirection.NORTH); + Extruder.addTube("PipeN15", -5.5F, -0.5F, 0F, 5, 5, 7, 0.5F,1F,ForgeDirection.NORTH); + Extruder.addBox("Shape8", -5F, 4F, 6.9F, 4, 3, 1); + Extruder.addTube("PipeU17", -5.5F, -8F, -5F, 5, 8, 5, 0.8F,1F,ForgeDirection.UP); + Extruder.addTube("PipeUC18", -5.5F, 0F, -5F, 5, 2, 5, 0.8F,0.6F,ForgeDirection.UP); + Extruder.addBox("Shape14", -5F, 3F, -4.9F, 4, 4, 1); + Extruder.addTube("PipeN14", -5.5F, -0.5F, 7F, 5, 5, 1, 0.5F,1F,ForgeDirection.NORTH); + } + + private void setRotation(IHLModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + +} diff --git a/src/main/java/ihl/processing/metallurgy/ExtruderTileEntity.java b/src/main/java/ihl/processing/metallurgy/ExtruderTileEntity.java new file mode 100644 index 0000000..a46ae62 --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/ExtruderTileEntity.java @@ -0,0 +1,155 @@ +package ihl.processing.metallurgy; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ic2.core.ContainerBase; +import ic2.core.block.invslot.InvSlot.Access; +import ihl.processing.chemistry.ApparatusProcessableInvSlot; +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 net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTank; +import net.minecraftforge.fluids.IFluidHandler; + +public class ExtruderTileEntity extends BasicElectricMotorTileEntity{ + + public final ApparatusProcessableInvSlot input; + public final ApparatusProcessableInvSlot input2; + private int processTimer=0; + private FluidTank fluidTank = new FluidTank(1000); + protected static final UniversalRecipeManager recipeManager = new UniversalRecipeManager("extruder"); + + public ExtruderTileEntity() + { + super(); + input = new ApparatusProcessableInvSlot(this, "input", 1, Access.IO, 1, 64); + input2 = new ApparatusProcessableInvSlot(this, "input2", 2, Access.IO, 1, 64); + } + + + + @Override + public List getNetworkedFields() + { + return super.getNetworkedFields(); + } + + + @Override + public String getInventoryName() { + return "Extruder"; + } + + @Override + public void updateEntityServer() + { + super.updateEntityServer(); + 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) + { + this.processTimer=0; + ((IFluidHandler)te).fill(ForgeDirection.getOrientation(getFacing()), this.fluidTank.drain(this.fluidTank.getCapacity(), true), true); + } + + } + + @Override + public ItemStack getWrenchDrop(EntityPlayer player) + { + return IHLUtils.getThisModItemStack("extruder"); + } + + @Override + @SideOnly(Side.CLIENT) + public GuiScreen getGui(EntityPlayer player, boolean arg1) { + return new ExtruderGui(new ExtruderContainer(player, this)); + } + + @Override + public ContainerBase getGuiContainer(EntityPlayer player) { + return new ExtruderContainer(player, this); + } + + @Override + public void operate() + { + UniversalRecipeInput ri = ExtruderTileEntity.recipeManager.getRecipeInput(getInput()); + this.fluidTank.fill(getOutput().getFluidOutputs().get(0), true); + this.input.consume(ri.getItemInputs().get(0)); + this.input2.consume(ri.getItemInputs().get(1)); + } + + public UniversalRecipeOutput getOutput() + { + return ExtruderTileEntity.recipeManager.getOutputFor(this.getInput()); + } + + @SuppressWarnings({ "unchecked", "rawtypes" }) + @Override + public List[] getInput() + { + return new List[]{null,Arrays.asList(new ItemStack[] {input.get(),input2.get()})}; + } + + @Override + public boolean canOperate() + { + return this.fluidTank.getFluidAmount() getRecipes() { + return recipeManager.getRecipes(); + } + + @Override + public boolean shouldRenderInPass(int pass) + { + return pass==0; + } + +} diff --git a/src/main/java/ihl/processing/metallurgy/GasWeldingStationContainer.java b/src/main/java/ihl/processing/metallurgy/GasWeldingStationContainer.java new file mode 100644 index 0000000..e960edb --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/GasWeldingStationContainer.java @@ -0,0 +1,99 @@ +package ihl.processing.metallurgy; + +import java.util.List; + +import ic2.core.ContainerBase; +import ic2.core.IC2; +import ic2.core.slot.SlotInvSlot; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.Slot; +import net.minecraftforge.fluids.FluidStack; + +public class GasWeldingStationContainer extends ContainerBase { + + protected GasWeldingStationTileEntity tileEntity; + public short lastProgress2 = -1; + private final static int height=166; + public int lastFluidAmount = -1; + public int lastNumberOfFluids = -1; + public int lastFluidAmount2 = -1; + public int lastNumberOfFluids2 = -1; + public List fluidTankFluidList; + public List fluidTankFluidList2; + + public GasWeldingStationContainer(EntityPlayer entityPlayer, GasWeldingStationTileEntity weldingStation){ + super(weldingStation); + this.tileEntity = weldingStation; + fluidTankFluidList = this.tileEntity.flammableGasTank.getFluidList(); + fluidTankFluidList2 = this.tileEntity.oxygenTank.getFluidList(); + 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(tileEntity.drainInputSlotOxygen, 0, 8, 15)); + this.addSlotToContainer(new SlotInvSlot(tileEntity.drainInputSlotFlammableGas, 0, 44, 15)); + this.addSlotToContainer(new SlotInvSlot(tileEntity.fillInputSlotOxygen, 0, 8, 51)); + this.addSlotToContainer(new SlotInvSlot(tileEntity.fillInputSlotFlammableGas, 0, 44, 51)); + this.addSlotToContainer(new SlotInvSlot(tileEntity.emptyFluidItemsSlot, 0, 8, 33)); + this.addSlotToContainer(new SlotInvSlot(tileEntity.emptyFluidItemsSlot, 1, 44, 33)); + this.addSlotToContainer(new SlotInvSlot(tileEntity.input, 0, 62, 51)); + } + + @Override + public void detectAndSendChanges() + { + super.detectAndSendChanges(); + for (int i = 0; i < this.crafters.size(); ++i) + { + ICrafting icrafting = (ICrafting)this.crafters.get(i); + if (this.tileEntity.progress2 != this.lastProgress2) + { + icrafting.sendProgressBarUpdate(this, 1, this.tileEntity.progress2); + } + if (this.tileEntity.flammableGasTank.getFluidAmount() != this.lastFluidAmount || this.tileEntity.flammableGasTank.getNumberOfFluids() != this.lastNumberOfFluids) + { + + IC2.network.get().sendContainerField(this, "fluidTankFluidList"); + } + + if (this.tileEntity.oxygenTank.getFluidAmount() != this.lastFluidAmount2 || this.tileEntity.oxygenTank.getNumberOfFluids() != this.lastNumberOfFluids2) + { + + IC2.network.get().sendContainerField(this, "fluidTankFluidList2"); + } + } + + + this.lastProgress2 = this.tileEntity.progress2; + this.lastNumberOfFluids = this.tileEntity.flammableGasTank.getNumberOfFluids(); + this.lastFluidAmount = this.tileEntity.flammableGasTank.getFluidAmount(); + this.lastNumberOfFluids2 = this.tileEntity.oxygenTank.getNumberOfFluids(); + this.lastFluidAmount2 = this.tileEntity.oxygenTank.getFluidAmount(); + } + + @Override + public void updateProgressBar(int index, int value) + { + super.updateProgressBar(index, value); + switch (index) + { + case 1: + this.tileEntity.progress2=(short) value; + break; + } + } + + @Override + public boolean canInteractWith(EntityPlayer var1) { + return tileEntity.isUseableByPlayer(var1); + } +} diff --git a/src/main/java/ihl/processing/metallurgy/GasWeldingStationGui.java b/src/main/java/ihl/processing/metallurgy/GasWeldingStationGui.java new file mode 100644 index 0000000..79becd5 --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/GasWeldingStationGui.java @@ -0,0 +1,78 @@ +package ihl.processing.metallurgy; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ic2.core.IC2; +import ihl.utils.IHLRenderUtils; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.inventory.Slot; +import net.minecraft.util.ResourceLocation; + +@SideOnly(Side.CLIENT) +public class GasWeldingStationGui extends GuiContainer { + private static final ResourceLocation background = new ResourceLocation("ihl", "textures/gui/GUIGasWeldingStation.png"); + private GasWeldingStationContainer container; + private int outputslotoffset=45; + + public GasWeldingStationGui (GasWeldingStationContainer 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); + int i1; + if (this.container.tileEntity.progress2 > 0) + { + i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(27),27); + this.drawTexturedModalRect(90, 30, getFrameX(i1), getFrameY(i1),24,24); + } + if (this.container.tileEntity.flammableGasTank.getFluid()!=null && this.container.tileEntity.flammableGasTank.getFluidAmount() > 0) + { + IHLRenderUtils.instance.renderIHLFluidTank(this.container.tileEntity.flammableGasTank, 64, 28, 76, 67, zLevel, par1, par2, xOffset, yOffset); + } + if (this.container.tileEntity.oxygenTank.getFluid()!=null && this.container.tileEntity.oxygenTank.getFluidAmount() > 0) + { + IHLRenderUtils.instance.renderIHLFluidTank(this.container.tileEntity.oxygenTank, 28, 28, 40, 67, zLevel, par1, par2, xOffset, yOffset); + } + + } + + @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(background); + int x = (width - xSize) / 2; + int y = (height - ySize) / 2; + this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); + } + + @Override + public void handleMouseClick(Slot slot,int arg1,int arg2,int arg3) + { + if(slot!=null && slot.slotNumber>=outputslotoffset && slot.slotNumber getNetworkedFields() + { + List fields = super.getNetworkedFields(); + return fields; + } + + @Override + public void updateEntityServer() + { + if (this.canProduceGas()) + { + ++this.progress2; + if (this.progress2 >= this.operationLength) + { + this.produceGas(); + this.progress2 = 0; + } + } + else + { + if (!this.canProduceGas()) + { + this.progress2 = 0; + } + } + IHLUtils.handleFluidSlotsBehaviour(fillInputSlotFlammableGas, drainInputSlotFlammableGas, emptyFluidItemsSlot, flammableGasTank); + IHLUtils.handleFluidSlotsBehaviour(fillInputSlotOxygen, drainInputSlotOxygen, emptyFluidItemsSlot, oxygenTank); + } + + @Override + public void readFromNBT(NBTTagCompound nbttagcompound) + { + super.readFromNBT(nbttagcompound); + this.flammableGasTank.readFromNBT(nbttagcompound.getCompoundTag("flammableGasTank")); + this.oxygenTank.readFromNBT(nbttagcompound.getCompoundTag("oxygenTank")); + } + + @Override + public void writeToNBT(NBTTagCompound nbttagcompound) + { + super.writeToNBT(nbttagcompound); + NBTTagCompound flammableGasTankNBT = new NBTTagCompound(); + this.flammableGasTank.writeToNBT(flammableGasTankNBT); + nbttagcompound.setTag("flammableGasTank", flammableGasTankNBT); + NBTTagCompound oxygenTankNBT = new NBTTagCompound(); + this.oxygenTank.writeToNBT(oxygenTankNBT); + nbttagcompound.setTag("oxygenTank", oxygenTankNBT); + } + + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { + return false; + } + + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { + return IHLUtils.getThisModItemStack("gasWeldingStation"); + } + + @Override + public String getInventoryName() { + return "detonationSprayingMachine"; + } + + @Override + @SideOnly(Side.CLIENT) + public GuiScreen getGui(EntityPlayer player, boolean arg1) { + return new GasWeldingStationGui(new GasWeldingStationContainer(player, this)); + } + + @Override + public ContainerBase getGuiContainer(EntityPlayer player) { + return new GasWeldingStationContainer(player, this); + } + + @Override + public void onGuiClosed(EntityPlayer player) {} + + @Override + public void onNetworkEvent(EntityPlayer player, int event) + { + } + + public boolean canProduceGas() + { + UniversalRecipeOutput rOutput = GasWeldingStationTileEntity.acetyleneRecipeManager.getOutputFor(Arrays.asList(new FluidStack[]{this.flammableGasTank.getFluid()}), Arrays.asList(new ItemStack[]{this.input.get()})); + return rOutput!=null; + } + + public void produceGas() + { + if(canProduceGas()) + { + UniversalRecipeInput rInput = GasWeldingStationTileEntity.acetyleneRecipeManager.getRecipeInput(Arrays.asList(new FluidStack[]{this.flammableGasTank.getFluid()}), Arrays.asList(new ItemStack[]{this.input.get()})); + UniversalRecipeOutput rOutput = GasWeldingStationTileEntity.acetyleneRecipeManager.getOutputFor(Arrays.asList(new FluidStack[]{this.flammableGasTank.getFluid()}), Arrays.asList(new ItemStack[]{this.input.get()})); + FluidStack output1 = rOutput.getFluidOutputs().get(0).copy(); + FluidStack output2 = rOutput.getFluidOutputs().get(1).copy(); + this.flammableGasTank.drain(rInput.getFluidInputs().get(0), true); + this.input.get().stackSize-=rInput.getItemInputs().get(0).getAmount(); + if(this.input.get().stackSize<=0) + { + this.input.clear(); + } + this.flammableGasTank.fill(output1, true); + this.flammableGasTank.fill(output2, true); + } + } + + + public UniversalRecipeInput getInput() + { + 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(new FluidStack[] {inputFluid},new ItemStack[] {input}), new UniversalRecipeOutput(new FluidStack [] {output, output2},new ItemStack [] {}, 20)); + } + + public static Map getGasRecipes() { + return acetyleneRecipeManager.getRecipes(); + } + + @Override + public FluidStack drain(ForgeDirection from, int amount, boolean doDrain) + { + FluidStack fstack = this.flammableGasTank.drain(amount, doDrain); + return fstack; + } + + @Override + public FluidStack drain(ForgeDirection arg0, FluidStack fluidStack, boolean doDrain) { + if(this.flammableGasTank.getFluid().containsFluid(fluidStack)) + { + return this.flammableGasTank.drain(fluidStack.amount, doDrain); + } + return null; + } + + @Override + public int fill(ForgeDirection arg0, FluidStack arg1, boolean arg2) { + return this.oxygenTank.fill(arg1, arg2); + } + + @Override + public FluidTankInfo[] getTankInfo(ForgeDirection arg0) { + return new FluidTankInfo[] {this.flammableGasTank.getInfo(),this.oxygenTank.getInfo()}; + } + + + //1.7.10 API + @Override + public boolean canDrain(ForgeDirection arg0, Fluid arg1) { + return true; + } + + @Override + public boolean canFill(ForgeDirection direction, Fluid arg1) { + return true; + } + + public int gaugeProgressScaled(int i) + { + return this.progress2 * i / this.operationLength; + } + + public int gaugeFlammableGasScaled(int i) + { + if(this.flammableGasTank.getFluid()!=null) + { + return this.flammableGasTank.getFluidAmount() * i /this.flammableGasTank.getCapacity(); + } + else + { + return 0; + } + } + + public int gaugeOxygenScaled(int i) + { + if(this.oxygenTank.getFluid()!=null) + { + return this.oxygenTank.getFluidAmount() * i /this.oxygenTank.getCapacity(); + } + else + { + return 0; + } + } + + @Override + public boolean canBeUsed() + { + return + this.flammableGasTank.getFluid()!=null && + this.flammableGasTank.getLigthestFluid().getFluid().getName().equals("acetylene") && + this.flammableGasTank.getLigthestFluid().amount>=20 && + this.oxygenTank.getFluid()!=null && + this.oxygenTank.getLigthestFluid().getFluid().getName().equals("oxygen") && + this.oxygenTank.getLigthestFluid().amount>=20; + } + + @Override + public void use() + { + this.flammableGasTank.drain(IHLUtils.getFluidStackWithSize("acetylene", 20), true); + this.oxygenTank.drain(IHLUtils.getFluidStackWithSize("oxygen", 20), true); + } + + @Override + public boolean getIsInvalid() + { + return this.isInvalid(); + } + + @Override + public boolean shouldRenderInPass(int pass) + { + return pass==0; + } +} \ No newline at end of file diff --git a/src/main/java/ihl/processing/metallurgy/IProductionLine.java b/src/main/java/ihl/processing/metallurgy/IProductionLine.java new file mode 100644 index 0000000..5cf7605 --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/IProductionLine.java @@ -0,0 +1,12 @@ +package ihl.processing.metallurgy; + +import net.minecraft.item.ItemStack; + +public interface IProductionLine +{ + + short getFacing(); + boolean canProcess(ItemStack stack); + void process(ItemStack stack); + +} diff --git a/src/main/java/ihl/processing/metallurgy/ImpregnatingMachineContainer.java b/src/main/java/ihl/processing/metallurgy/ImpregnatingMachineContainer.java new file mode 100644 index 0000000..d166889 --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/ImpregnatingMachineContainer.java @@ -0,0 +1,105 @@ +package ihl.processing.metallurgy; + +import java.util.List; + +import ic2.core.ContainerBase; +import ic2.core.IC2; +import ic2.core.slot.SlotInvSlot; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.Slot; +import net.minecraftforge.fluids.FluidStack; + +public class ImpregnatingMachineContainer extends ContainerBase { + + protected ImpregnatingMachineTileEntity tileEntity; + public int lastFluidAmount = -1; + public int lastNumberOfFluids = -1; + public int lastVisibleFluidID = -1; + public int lastVisibleFluidAmount = -1; + public short lastProgress = -1; + public short lastTemperature = -1; + private final static int height = 166; + public List fluidTankFluidList; + public int fluidListHash = -1; + + public ImpregnatingMachineContainer(EntityPlayer entityPlayer, ImpregnatingMachineTileEntity tileEntity1) { + super(tileEntity1); + this.tileEntity = tileEntity1; + fluidTankFluidList = this.tileEntity.getFluidTank().getFluidList(); + 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.drainInputSlot, 0, 24, 16)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.emptyFluidItemsSlot, 0, 24, 34)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.fillInputSlot, 0, 24, 52)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.input, 0, 116, 16)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.outputSlot, 0, 116, 41)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.outputSlot, 1, 116, 59)); + } + + @Override + public void detectAndSendChanges() { + super.detectAndSendChanges(); + for (int i = 0; i < this.crafters.size(); ++i) { + ICrafting icrafting = (ICrafting) this.crafters.get(i); + + if (this.fluidListHash != fluidTankFluidList.hashCode()) { + IC2.network.get().sendContainerField(this, "fluidTankFluidList"); + this.fluidListHash = fluidTankFluidList.hashCode(); + } + + if (this.tileEntity.progress != this.lastProgress) { + icrafting.sendProgressBarUpdate(this, 0, this.tileEntity.progress); + } + + if (this.tileEntity.temperature != this.lastTemperature) { + icrafting.sendProgressBarUpdate(this, 1, this.tileEntity.temperature); + } + if (this.tileEntity.visibleFluidId != this.lastVisibleFluidID) { + icrafting.sendProgressBarUpdate(this, 2, this.tileEntity.visibleFluidId); + } + if (this.tileEntity.visibleFluidAmount != this.lastVisibleFluidAmount) { + icrafting.sendProgressBarUpdate(this, 3, this.tileEntity.visibleFluidAmount); + } + } + + this.lastNumberOfFluids = this.tileEntity.getNumberOfFluidsInTank(); + this.lastFluidAmount = this.tileEntity.getTankAmount(); + this.lastProgress = this.tileEntity.progress; + this.lastTemperature = this.tileEntity.temperature; + this.lastVisibleFluidID = this.tileEntity.visibleFluidId; + this.lastVisibleFluidAmount = this.tileEntity.visibleFluidAmount; + } + + @Override + public void updateProgressBar(int index, int value) { + super.updateProgressBar(index, value); + switch (index) { + case 0: + this.tileEntity.progress = (short) value; + break; + case 1: + this.tileEntity.temperature = (short) value; + break; + case 2: + this.tileEntity.visibleFluidId = value; + break; + case 3: + this.tileEntity.visibleFluidAmount = value; + break; + } + } + + @Override + public boolean canInteractWith(EntityPlayer var1) { + return tileEntity.isUseableByPlayer(var1); + } +} diff --git a/src/main/java/ihl/processing/metallurgy/ImpregnatingMachineGui.java b/src/main/java/ihl/processing/metallurgy/ImpregnatingMachineGui.java new file mode 100644 index 0000000..29ba298 --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/ImpregnatingMachineGui.java @@ -0,0 +1,63 @@ +package ihl.processing.metallurgy; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ihl.utils.IHLRenderUtils; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.util.ResourceLocation; + +@SideOnly(Side.CLIENT) +public class ImpregnatingMachineGui extends GuiContainer { + private static final ResourceLocation background = new ResourceLocation("ihl", "textures/gui/GUITubBronze.png"); + private ImpregnatingMachineContainer container; + + + public ImpregnatingMachineGui (ImpregnatingMachineContainer container1) { + //the container is instanciated and passed to the superclass for handling + super(container1); + this.container=container1; + } + + @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, 0.5F); + this.mc.renderEngine.bindTexture(background); + 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); + i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(27),27); + this.drawTexturedModalRect(138, 28, getFrameX(i1), getFrameY(i1),24,24); + } + if (this.container.tileEntity.getTankAmount() > 0) + { + IHLRenderUtils.instance.renderIHLFluidTank(this.container.tileEntity.getFluidTank(), 50, 11, 107, 72, zLevel, par1, par2, xOffset, yOffset); + } + } + + @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(background); + int x = (width - xSize) / 2; + int y = (height - ySize) / 2; + this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); + } + + private int getFrameY(int number) + { + return (number % 10) * 24 + 14; + } + + private int getFrameX(int number) + { + return (number / 10) * 24 + 176; + } +} \ No newline at end of file diff --git a/src/main/java/ihl/processing/metallurgy/ImpregnatingMachineRender.java b/src/main/java/ihl/processing/metallurgy/ImpregnatingMachineRender.java new file mode 100644 index 0000000..9529186 --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/ImpregnatingMachineRender.java @@ -0,0 +1,55 @@ +package ihl.processing.metallurgy; + +import org.lwjgl.opengl.GL11; + +import ihl.interfaces.IFluidTankVisual; +import ihl.model.FluidRenderer; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; + +public class ImpregnatingMachineRender extends TileEntitySpecialRenderer { + + private float cap; + + public ImpregnatingMachineRender(float capIn) { + cap = capIn; + } + + public void renderAModelAt(IFluidTankVisual tile, double x, double y, double z, float f) { + GL11.glPushMatrix(); + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.5F); + float rotation = 0F; + GL11.glRotatef(-rotation, 0F, 1F, 0F); + GL11.glScalef(1F, -1F, -1F); + GL11.glTranslatef(0F, -1.0F, 0F); + GL11.glPopMatrix(); + if (tile.getVisibleFluidId() == -1 || tile.getVisibleFluidAmount() <= 0) { + return; + } + FluidStack fluidStack = new FluidStack(FluidRegistry.getFluid(tile.getVisibleFluidId()), + tile.getVisibleFluidAmount()); + GL11.glPushMatrix(); + GL11.glPushAttrib(GL11.GL_ENABLE_BIT); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GL11.glTranslatef((float) x, (float) y + 0.1F, (float) z); + GL11.glScalef(0.99F, 0.8F * tile.getRenderLiquidLevel(), 0.99F); + int[] displayLists = FluidRenderer.getLiquidDisplayLists(fluidStack); + if (displayLists != null) { + float level = Math.min(fluidStack.amount, cap) / cap; + bindTexture(FluidRenderer.getFluidSheet(fluidStack)); + GL11.glCallList(displayLists[(int) (level * (FluidRenderer.DISPLAY_STAGES - 1))]); + } + GL11.glDisable(GL11.GL_BLEND); + GL11.glPopAttrib(); + GL11.glPopMatrix(); + + } + + @Override + public void renderTileEntityAt(TileEntity tile, double par2, double par4, double par6, float par8) { + this.renderAModelAt((IFluidTankVisual) tile, par2, par4, par6, par8); + } +} \ No newline at end of file diff --git a/src/main/java/ihl/processing/metallurgy/ImpregnatingMachineTileEntity.java b/src/main/java/ihl/processing/metallurgy/ImpregnatingMachineTileEntity.java new file mode 100644 index 0000000..4f7c529 --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/ImpregnatingMachineTileEntity.java @@ -0,0 +1,343 @@ +package ihl.processing.metallurgy; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ic2.api.network.INetworkTileEntityEventListener; +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 ihl.interfaces.IFluidTankVisual; +import ihl.processing.chemistry.ApparatusProcessableInvSlot; +import ihl.processing.chemistry.ChemicalReactorTileEntity; +import ihl.processing.invslots.IHLInvSlotOutput; +import ihl.processing.invslots.InvSlotConsumableLiquidIHL; +import ihl.recipes.UniversalRecipeInput; +import ihl.recipes.UniversalRecipeManager; +import ihl.recipes.UniversalRecipeOutput; +import ihl.utils.IHLFluidTank; +import ihl.utils.IHLUtils; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +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; + +public class ImpregnatingMachineTileEntity extends TileEntityInventory implements IHasGui,IFluidTankVisual,INetworkTileEntityEventListener, IFluidHandler +{ + private final static UniversalRecipeManager recipeManager = new UniversalRecipeManager("tub"); + public final ApparatusProcessableInvSlot input; + public final IHLInvSlotOutput outputSlot; + public final InvSlotConsumableLiquidIHL drainInputSlot; + public final InvSlotConsumableLiquidIHL fillInputSlot; + public final InvSlotOutput emptyFluidItemsSlot; + public short progress; + protected short operationLength=Short.MAX_VALUE/2; + private final IHLFluidTank fluidTank = new IHLFluidTank(8000); + public short temperature=20; + public int visibleFluidId = -1; + public int visibleFluidAmount = 1; + + public ImpregnatingMachineTileEntity() { + super(); + this.outputSlot = new IHLInvSlotOutput(this, "output", 0, 2); + 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.input = new ApparatusProcessableInvSlot(this, "input", 3, Access.IO, 1, 64); + } + + @Override + public void readFromNBT(NBTTagCompound nbttagcompound) + { + super.readFromNBT(nbttagcompound); + this.fluidTank.readFromNBT(nbttagcompound.getCompoundTag("fluidTank")); + } + + @Override + public void writeToNBT(NBTTagCompound nbttagcompound) + { + super.writeToNBT(nbttagcompound); + NBTTagCompound fluidTankTag = new NBTTagCompound(); + this.fluidTank.writeToNBT(fluidTankTag); + nbttagcompound.setTag("fluidTank", fluidTankTag); + } + + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { + return false; + } + + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { + return IHLUtils.getThisModItemStack("tubBronze"); + } + + public boolean enableUpdateEntity() + { + return IC2.platform.isSimulating(); + } + + @Override + public List getNetworkedFields() + { + List ret = super.getNetworkedFields(); + ret.add("visibleFluidId"); + ret.add("visibleFluidAmount"); + return ret; + } + + @Override + public void updateEntityServer() + { + if(this.fluidTank.getFluid()!=null) + { + if(this.fluidTank.getLigthestFluid().getFluid().isGaseous()) + { + this.fluidTank.drainLightest(10, true); + } + } + if(this.fluidTank.getFluid()!=null && (visibleFluidId!=this.fluidTank.getFluid().getFluid().getID() || visibleFluidAmount!=this.fluidTank.getFluidAmount())) + { + visibleFluidId = this.fluidTank.getFluid().getFluid().getID(); + visibleFluidAmount = this.fluidTank.getFluidAmount(); + IC2.network.get().updateTileEntityField(this, "visibleFluidId"); + IC2.network.get().updateTileEntityField(this, "visibleFluidAmount"); + } + else if(this.fluidTank.getFluid()==null && visibleFluidId!=-1) + { + visibleFluidId=-1; + IC2.network.get().updateTileEntityField(this, "visibleFluidId"); + } + IHLUtils.handleFluidSlotsBehaviour(fillInputSlot, drainInputSlot, emptyFluidItemsSlot, fluidTank); + if (this.canOperate()) + { + this.setActive(true); + if (this.progress == 0) + { + IC2.network.get().initiateTileEntityEvent(this, 0, true); + } + + this.progress+=this.operationLength/this.getOutput().getTime(); + 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 FluidStack drain(ForgeDirection from, int amount, boolean doDrain) + { + FluidStack fstack = this.fluidTank.drain(amount, doDrain); + return fstack; + } + + + //1.7.10 API + @Override + public boolean canDrain(ForgeDirection arg0, Fluid arg1) { + return true; + } + + @Override + public boolean canFill(ForgeDirection direction, Fluid arg1) { + return true; + } + + @Override + public String getInventoryName() { + return "impregnatingMachine"; + } + + public float getRenderLiquidLevel() + { + return (float)this.visibleFluidAmount/(float)this.fluidTank.getCapacity(); + } + + @Override + public void onNetworkEvent(int event) + { + } + + public int gaugeProgressScaled(int i) + { + return this.progress * i / operationLength; + } + + @Override + @SideOnly(Side.CLIENT) + public GuiScreen getGui(EntityPlayer player, boolean arg1) { + return new ImpregnatingMachineGui(new ImpregnatingMachineContainer(player, this)); + } + + @Override + public ContainerBase getGuiContainer(EntityPlayer player) + { + this.fluidTank.sortFluidsByDensity(); + return new ImpregnatingMachineContainer(player, this); + } + + @Override + public void onGuiClosed(EntityPlayer player) {} + + public boolean canOperate() + { + return getOutput()!=null && this.outputSlot.canAdd(getOutput().getItemOutputs()); + } + + public UniversalRecipeOutput getOutput() + { + return ImpregnatingMachineTileEntity.recipeManager.getOutputFor(this.getInput()); + } + + @SuppressWarnings("rawtypes") + public List[] getInput() + { + for(int i=0;i getRecipes() { + return recipeManager.getRecipes(); + } + + public static void addQuenchingRecipe(String nameHot, String nameQuenched) + { + addRecipe(new UniversalRecipeInput((new FluidStack[] {new FluidStack(FluidRegistry.WATER, 50)}), (new ItemStack[] {IHLUtils.getThisModItemStack(nameHot)})), new UniversalRecipeOutput(null, (new ItemStack[] {IHLUtils.getThisModItemStack(nameQuenched)}),2)); + } + + public IHLFluidTank getFluidTank() + { + return this.fluidTank; + } + + public static void addChemicalRecipe(UniversalRecipeInput universalRecipeInput, UniversalRecipeOutput universalRecipeOutput) + { + addRecipe(universalRecipeInput,universalRecipeOutput); + ChemicalReactorTileEntity.addRecipe(universalRecipeInput,universalRecipeOutput); + } + + @Override + public boolean shouldRenderInPass(int pass) + { + return pass==0; + } + + @Override + public int getVisibleFluidId() { + return this.visibleFluidId; + } + + @Override + public int getVisibleFluidAmount() { + return this.visibleFluidAmount; + } +} \ No newline at end of file diff --git a/src/main/java/ihl/processing/metallurgy/InjectionMoldBlock.java b/src/main/java/ihl/processing/metallurgy/InjectionMoldBlock.java new file mode 100644 index 0000000..bbea1cb --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/InjectionMoldBlock.java @@ -0,0 +1,248 @@ +package ihl.processing.metallurgy; + +import java.util.ArrayList; +import java.util.List; +import java.util.Locale; + +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ihl.IHLCreativeTab; +import ihl.IHLModInfo; +import ihl.items_blocks.IHLItemBlock; +import ihl.metallurgy.constants.Details; +import ihl.utils.IHLUtils; +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.EntityLivingBase; +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.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.fluids.FluidStack; + +public class InjectionMoldBlock extends Block implements ITileEntityProvider{ + + IIcon textureSide; + + public static InjectionMoldBlock instance; + public static String[] materials = new String[] {"Bronze","Steel","Gold","Magnesium", "Lithium", "TarPitch", "Potassium", "Sodium"}; + + public InjectionMoldBlock() + { + super(Material.rock); + this.setResistance(0.5F); + this.setHardness(0.5F); + this.setBlockName("injectionMold"); + this.setCreativeTab(IHLCreativeTab.tab); + instance=this; + } + + public static void init() + { + GameRegistry.registerBlock(new InjectionMoldBlock(),IHLItemBlock.class,"injectionMold"); + GameRegistry.registerTileEntity(InjectionMoldTileEntity.class,"injectionMoldTileEntity"); + } + + @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); + } + + + @SuppressWarnings({ "rawtypes", "unchecked" }) + @Override + public void getSubBlocks(Item item, CreativeTabs par2CreativeTabs, List itemList) + { + ItemStack result = new ItemStack(item); + result.stackTagCompound=new NBTTagCompound(); + result.stackTagCompound.setString("resultSuffix", "ingot"); + itemList.add(result); + } + + + @Override + public TileEntity createNewTileEntity(World world, int var2) { + return new InjectionMoldTileEntity(); + } + + @Override + public void onBlockPreDestroy(World world, int x, int y, int z, int meta) + { + if(!world.isRemote) + { + TileEntity te = world.getTileEntity(x, y, z); + if(te!=null && te instanceof InjectionMoldTileEntity) + { + InjectionMoldTileEntity gte = (InjectionMoldTileEntity) te; + gte.dropContents(); + } + } + super.onBlockPreDestroy(world, x, y, z, meta); + } + + @Override + public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) + { + ArrayList drops = new ArrayList(); + TileEntity t = world.getTileEntity(x, y, z); + if(t!=null) + { + InjectionMoldTileEntity te = (InjectionMoldTileEntity)t; + if(te.result!=null)drops.add(te.result); + if(te.result2!=null)drops.add(te.result2); + } + return drops; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister par1IconRegister) + { + this.blockIcon = par1IconRegister.registerIcon(IHLModInfo.MODID + ":injectionMoldTop"); + this.textureSide = par1IconRegister.registerIcon(IHLModInfo.MODID + ":injectionMoldSide"); + } + + @Override + public boolean hasTileEntity(int metadata) + { + return true; + } + + @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 instanceof InjectionMoldTileEntity) + { + InjectionMoldTileEntity te = (InjectionMoldTileEntity)t; + te.resultSuffix=itemStack.stackTagCompound.getString("resultSuffix"); + if(itemStack.stackTagCompound.hasKey("isContainStearin")) + { + te.isContainStearin=itemStack.stackTagCompound.getBoolean("isContainStearin"); + } + if(itemStack.stackTagCompound.hasKey("maxAmount")) + { + te.maxAmount=itemStack.stackTagCompound.getByte("maxAmount"); + } + + } + } + @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) + { + if(player.getCurrentEquippedItem()!=null && player.getCurrentEquippedItem().getItem() instanceof Crucible) + { + if(!world.isRemote) + { + return ((Crucible)player.getCurrentEquippedItem().getItem()).onItemUse(player.getCurrentEquippedItem(), player, world, x, y, z, 0, pos_x, pos_y, pos_z); + } + return true; + } + return false; + } + + + + /** + * Called when the block is placed in the world. + */ + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) + { + switch (side) + { + case 1: + return this.blockIcon; + case 0: + return this.textureSide; + case 2: + return this.textureSide; + case 3: + return this.textureSide; + case 4: + return this.textureSide; + case 5: + return this.textureSide; + default: + return this.textureSide; + } + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + switch (side) + { + case 1: + return this.blockIcon; + case 0: + return this.textureSide; + case 2: + return this.textureSide; + case 3: + return this.textureSide; + case 4: + return this.textureSide; + case 5: + return this.textureSide; + default: + return this.textureSide; + } + } + + public ItemStack getSandInjectionMoldForResult(String result1) + { + ItemStack stack = new ItemStack(this); + stack.stackTagCompound=new NBTTagCompound(); + stack.stackTagCompound.setString("resultSuffix", result1); + registerRecipes(result1, stack); + return stack; + } + + public ItemStack getGypsumInjectionMoldForResult(String result1) + { + ItemStack stack = new ItemStack(this); + stack.stackTagCompound=new NBTTagCompound(); + stack.stackTagCompound.setString("resultSuffix", result1); + stack.stackTagCompound.setByte("maxAmount", (byte)1); + stack.stackTagCompound.setBoolean("isContainStearin", true); + registerRecipes(result1, stack); + return stack; + } + + public static void registerRecipes(String result1,ItemStack stack1) + { + for(int i=0;i16) + { + if(this.timer--==0) + { + String formattedFluidName=this.getFormattedMaterialName(this.getFluidfromTank().getName()); + if(formattedFluidName!="") + { + int fluidAmountPerItem = Details.getMeltingFluidAmount(this.resultSuffix); + ArrayList resultList = OreDictionary.getOres(this.resultSuffix+formattedFluidName); + if(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); + if(ro!=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(); + } + } + int fluidAmountPerItem2 = Details.getMeltingFluidAmount("nugget"); + ArrayList resultList2 = OreDictionary.getOres("nugget"+formattedFluidName); + if(!resultList.isEmpty()) + { + if(fluidAmountPerItem>0) + { + int stackSize1=Math.min(this.maxAmount,this.getFluidStackfromTank().amount/fluidAmountPerItem); + if(stackSize1>0) + { + result=resultList.get(0).copy(); + result.stackSize=stackSize1; + } + } + } + if(!resultList2.isEmpty()) + { + int stackSize1=this.getFluidStackfromTank().amount/fluidAmountPerItem2; + if(result!=null) + { + stackSize1=(this.getFluidStackfromTank().amount % fluidAmountPerItem)/fluidAmountPerItem2; + } + if(stackSize1>0) + { + result2=resultList2.get(0).copy(); + result2.stackSize=stackSize1; + } + } + } + } + } + } + + @Override + public boolean canDrain(ForgeDirection arg0, Fluid arg1) { + return false; + } + + @Override + public boolean canFill(ForgeDirection direction, Fluid fluid1) { + return direction==ForgeDirection.UP && !isContainStearin; + } + + public String getInventoryName() { + return "injectionMold"; + } + + private String getFormattedMaterialName(String input) + { + String input2 = input.replace("molten.", "").replace(".molten", ""); + String firstletter = String.valueOf(input2.charAt(0)).toUpperCase(); + input2 = input2.replaceFirst(".", firstletter); + return input2; + } + + public FluidTank getFluidTank() + { + return this.fluidTank; + } + + public FluidStack getFluidStackfromTank() + { + return this.getFluidTank().getFluid(); + } + + public Fluid getFluidfromTank() + { + return this.getFluidStackfromTank().getFluid(); + } + + @Override + public int fill(ForgeDirection from, FluidStack resource, boolean doFill) + { + return this.canFill(from, resource.getFluid()) ? this.getFluidTank().fill(resource, doFill) : 0; + } + + @Override + public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) + { + return null; + } + + @Override + public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) + { + return this.getFluidTank().drain(maxDrain, doDrain); + } + + @Override + public FluidTankInfo[] getTankInfo(ForgeDirection from) + { + return new FluidTankInfo[] {this.getFluidTank().getInfo()}; + } + + public void dropContents() + { + if(result!=null)this.worldObj.spawnEntityInWorld(new EntityItem(this.worldObj, this.xCoord, this.yCoord+1, this.zCoord, result)); + if(result2!=null)this.worldObj.spawnEntityInWorld(new EntityItem(this.worldObj, this.xCoord, this.yCoord+1, this.zCoord, result2)); + } + + public static Map getRecipes() + { + return recipeManager.getRecipes(); + } +} \ No newline at end of file diff --git a/src/main/java/ihl/processing/metallurgy/LatheContainer.java b/src/main/java/ihl/processing/metallurgy/LatheContainer.java new file mode 100644 index 0000000..5e79a2a --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/LatheContainer.java @@ -0,0 +1,72 @@ +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 LatheContainer extends ContainerBase { + + public LathePart1TileEntity tileEntity; + public int lastProgress = -1; + private short lastEnergy = -1; + private final static int height=166; + + public LatheContainer(EntityPlayer entityPlayer, + LathePart1TileEntity lathePart1TileEntity) { + super(lathePart1TileEntity); + tileEntity=lathePart1TileEntity; + 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(lathePart1TileEntity.dischargeSlot,0, 22, 55)); + } + + @Override + public void detectAndSendChanges() + { + super.detectAndSendChanges(); + for (int i = 0; i < this.crafters.size(); ++i) + { + ICrafting icrafting = (ICrafting)this.crafters.get(i); + if (this.tileEntity.progress != this.lastProgress) + { + icrafting.sendProgressBarUpdate(this, 0, this.tileEntity.progress); + } + if (this.tileEntity.getEnergy() != this.lastEnergy) + { + icrafting.sendProgressBarUpdate(this, 1, this.tileEntity.getEnergy()); + } + } + this.lastProgress = this.tileEntity.progress; + this.lastEnergy = (short) this.tileEntity.getEnergy(); + } + + @Override + public void updateProgressBar(int index, int value) + { + super.updateProgressBar(index, value); + + switch (index) + { + case 0: + this.tileEntity.progress=(short) value; + break; + case 1: + this.tileEntity.setEnergy(value); + break; + } + } + +} diff --git a/src/main/java/ihl/processing/metallurgy/LatheGui.java b/src/main/java/ihl/processing/metallurgy/LatheGui.java new file mode 100644 index 0000000..16f64c5 --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/LatheGui.java @@ -0,0 +1,51 @@ +package ihl.processing.metallurgy; + +import org.lwjgl.opengl.GL11; + +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; + +public class LatheGui extends GuiContainer { + + private LatheContainer container; + protected static final ResourceLocation tex = new ResourceLocation("ihl", "textures/gui/GUILathe.png"); + + public LatheGui(LatheContainer latheContainer) { + super(latheContainer); + container = latheContainer; + } + + + @Override + protected void drawGuiContainerForegroundLayer(int par1, int par2) { + 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); + int i1; + if (this.container.tileEntity.getEnergy() > 0D) + { + 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.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, 1.0F); + i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(50),50); + this.drawTexturedModalRect(64, 63, 197, 0, i1 + 1, 13); + } + } + + @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); + } +} diff --git a/src/main/java/ihl/processing/metallurgy/LathePart1Model.java b/src/main/java/ihl/processing/metallurgy/LathePart1Model.java new file mode 100644 index 0000000..c08b3bf --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/LathePart1Model.java @@ -0,0 +1,93 @@ +package ihl.processing.metallurgy; + +import ihl.model.IHLModelRenderer; +import net.minecraft.client.model.ModelBase; +import net.minecraftforge.common.util.ForgeDirection; + +public class LathePart1Model extends ModelBase +{ + //fields + IHLModelRenderer Base; + IHLModelRenderer RotatingPart2; + IHLModelRenderer MotorPart1; + IHLModelRenderer MotorPart2; + IHLModelRenderer Belt; + IHLModelRenderer Belt2; + + public LathePart1Model() + { + textureWidth = 64; + textureHeight = 32; + setTextureOffset("Base.Shape6", 0, 0); + setTextureOffset("Base.Shape3", 0, 0); + setTextureOffset("Base.Shape2", 0, 0); + setTextureOffset("Base.NewShape4", 0, 0); + setTextureOffset("RotatingPart2.PipeN1", 0, 0); + setTextureOffset("RotatingPart2.PipeN7", 49, 23); + setTextureOffset("RotatingPart2.Shape1", 56, 19); + setTextureOffset("RotatingPart2.Shape5", 0, 8); + setTextureOffset("RotatingPart2.Shape8", 0, 11); + setTextureOffset("RotatingPart2.PipeN4", 0, 0); + setTextureOffset("RotatingPart2.Shape9", 0, 0); + setTextureOffset("MotorPart1.PipeN41", 0, 0); + setTextureOffset("MotorPart1.PipeN12", 0, 0); + setTextureOffset("MotorPart1.PipeN13", 0, 0); + setTextureOffset("MotorPart2.Shape4", 0, 24); + setTextureOffset("MotorPart2.Shape7", 0, 9); + setTextureOffset("MotorPart2.Shape10", 0, 9); + setTextureOffset("Belt.Shape12", 46, 0); + setTextureOffset("Belt2.Shape13", 46, 0); + + Base = new IHLModelRenderer(this, "Base"); + Base.setRotationPoint(0F, 16F, 0F); + setRotation(Base, 0F, 0F, 0F); + Base.mirror = true; + Base.addBox("Shape6", -8F, 7F, -8F, 16, 1, 16); + Base.addBox("Shape3", -5.5F, -1.5F, -7F, 7, 9, 1); + Base.addBox("Shape2", -5.5F, -0.5F, -4F, 5, 8, 1); + Base.addBox("NewShape4", 3F, 3F, -6F, 3, 4, 1); + RotatingPart2 = new IHLModelRenderer(this, "RotatingPart2"); + RotatingPart2.setRotationPoint(-3F, 18F, -7F); + setRotation(RotatingPart2, 0F, 0F, 0F); + RotatingPart2.mirror = true; + RotatingPart2.addTube("PipeN1", -1.5F, -1.5F, 0F, 3, 3, 5, 0F,1F,ForgeDirection.NORTH); + RotatingPart2.addTube("PipeN7", -2.5F, -2.5F, -1F, 5, 5, 1, 0F,1F,ForgeDirection.NORTH); + RotatingPart2.addBox("Shape1", 2F, -0.5F, 8.5F, 3, 1, 1); + RotatingPart2.addBox("Shape5", -0.5F, -5F, 8.5F, 1, 3, 1); + RotatingPart2.addBox("Shape8", -5F, -0.5F, 8.5F, 3, 1, 1); + RotatingPart2.addTube("PipeN4", -4F, -4F, 4F, 8, 8, 5, 0.3F,1F,ForgeDirection.NORTH); + RotatingPart2.addBox("Shape9", -0.5F, 2F, 8.5F, 1, 3, 1); + MotorPart1 = new IHLModelRenderer(this, "MotorPart1"); + MotorPart1.setRotationPoint(0F, 21F, 0F); + setRotation(MotorPart1, 0F, 0F, 0F); + MotorPart1.mirror = true; + MotorPart1.addTube("PipeN41", 3F, -2F, -8F, 3, 3, 1, 0F,1F,ForgeDirection.NORTH); + MotorPart1.addTube("PipeN12", 4F, -1F, -7F, 1, 1, 1, 0F,1F,ForgeDirection.NORTH); + MotorPart1.addTube("PipeN13", 3F, -2F, -5F, 3, 3, 5, 0F,1F,ForgeDirection.NORTH); + MotorPart2 = new IHLModelRenderer(this, "MotorPart2"); + MotorPart2.setRotationPoint(0F, 16F, 0F); + setRotation(MotorPart2, 0F, 0F, 0F); + MotorPart2.mirror = true; + MotorPart2.addBox("Shape4", 3F, 3F, 0F, 3, 4, 4); + MotorPart2.addBox("Shape7", 6F, 3F, -5F, 2, 4, 5); + MotorPart2.addBox("Shape10", 1F, 3F, -5F, 2, 4, 5); + Belt = new IHLModelRenderer(this, "Belt"); + Belt.setRotationPoint(-3F, 15.5F, -7.9F); + setRotation(Belt, 0F, 0F, 0.45F); + Belt.mirror = true; + Belt.addBox("Shape12", 0F, 0F, 0F, 8, 1, 1); + Belt2 = new IHLModelRenderer(this, "Belt2"); + Belt2.setRotationPoint(-3F, 19.5F, -7.9F); + setRotation(Belt2, 0F, 0F, 0.19F); + Belt2.mirror = true; + Belt2.addBox("Shape13", 0F, 0F, 0F, 8, 1, 1); + } + + private void setRotation(IHLModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + +} diff --git a/src/main/java/ihl/processing/metallurgy/LathePart1TileEntity.java b/src/main/java/ihl/processing/metallurgy/LathePart1TileEntity.java new file mode 100644 index 0000000..788bfd4 --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/LathePart1TileEntity.java @@ -0,0 +1,99 @@ +package ihl.processing.metallurgy; + +import java.util.List; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ic2.core.ContainerBase; +import ihl.interfaces.IWorkspaceElement; +import ihl.utils.IHLUtils; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + +public class LathePart1TileEntity extends BasicElectricMotorTileEntity implements IWorkspaceElement{ + + public boolean ready=false; + + public LathePart1TileEntity() + { + super(); + } + + + @Override + public String getInventoryName() { + return "Lathe"; + } + + @Override + public void operate() + { + ready=true; + } + + @Override + public ItemStack getWrenchDrop(EntityPlayer player) + { + return IHLUtils.getThisModItemStack("lathePart1"); + } + + @Override + @SideOnly(Side.CLIENT) + public GuiScreen getGui(EntityPlayer player, boolean arg1) { + return new LatheGui(new LatheContainer(player, this)); + } + + @Override + public ContainerBase getGuiContainer(EntityPlayer player) { + return new LatheContainer(player, this); + } + + + @SuppressWarnings({ "rawtypes", "unchecked" }) + @Override + public List[] getInput() + { + return null; + } + + @Override + public boolean canOperate() + { + TileEntity te = worldObj.getTileEntity(xCoord+ForgeDirection.getOrientation(getFacing()).offsetX,yCoord,zCoord+ForgeDirection.getOrientation(getFacing()).offsetZ); + if(te!=null && te instanceof LathePart2TileEntity) + { + return !ready; + } + return false; + } + + @Override + public void onGuiClosed(EntityPlayer arg0) {} + + @Override + public boolean canBeUsed() + { + return ready; + } + + @Override + public void use() + { + ready=false; + } + + @Override + public boolean getIsInvalid() + { + return this.isInvalid(); + } + + @Override + public boolean shouldRenderInPass(int pass) + { + return pass==0; + } +} diff --git a/src/main/java/ihl/processing/metallurgy/LathePart2Model.java b/src/main/java/ihl/processing/metallurgy/LathePart2Model.java new file mode 100644 index 0000000..40b9b2a --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/LathePart2Model.java @@ -0,0 +1,87 @@ +package ihl.processing.metallurgy; + +import ihl.model.IHLModelRenderer; +import net.minecraft.client.model.ModelBase; +import net.minecraftforge.common.util.ForgeDirection; + +public class LathePart2Model extends ModelBase +{ + //fields + IHLModelRenderer Base; + + public LathePart2Model() + { + textureWidth = 64; + textureHeight = 32; + setTextureOffset("Base.Shape6", 0, 0); + setTextureOffset("Base.Shape1", 0, 0); + setTextureOffset("Base.Shape2", 38, 5); + setTextureOffset("Base.Shape3", 0, 0); + setTextureOffset("Base.Shape4", 0, 0); + setTextureOffset("Base.Shape5", 0, 0); + setTextureOffset("Base.PipeN7", 0, 0); + setTextureOffset("Base.Shape7", 0, 0); + setTextureOffset("Base.PipeW9", 0, 0); + setTextureOffset("Base.PipeW9", 0, 0); + setTextureOffset("Base.Shape9", 0, 0); + setTextureOffset("Base.Shape10", 0, 0); + setTextureOffset("Base.Shape11", 0, 0); + setTextureOffset("Base.Shape12", 0, 0); + setTextureOffset("Base.PipeW13", 0, 0); + setTextureOffset("Base.PipeN13", 0, 0); + setTextureOffset("Base.Shape13", 0, 0); + setTextureOffset("Base.Shape14", 0, 0); + setTextureOffset("Base.PipeU15", 0, 0); + setTextureOffset("Base.PipeU16", 0, 0); + setTextureOffset("Base.PipeU17", 0, 0); + setTextureOffset("Base.PipeU18", 0, 0); + setTextureOffset("Base.Shape15", 0, 0); + setTextureOffset("Base.Shape16", 0, 0); + setTextureOffset("Base.PipeW20", 0, 0); + setTextureOffset("Base.PipeW19", 0, 0); + setTextureOffset("Base.PipeN21", 0, 0); + setTextureOffset("Base.PipeN22", 0, 0); + + Base = new IHLModelRenderer(this, "Base"); + Base.setRotationPoint(0F, 16F, 0F); + setRotation(Base, 0F, 0F, 0F); + Base.mirror = true; + Base.addBox("Shape6", -8F, 7F, -8F, 14, 1, 16); + Base.addBox("Shape1", 0F, 1F, 0F, 4, 1, 4); + Base.addBox("Shape2", -2F, 2F, 1F, 5, 1, 1); + Base.addBox("Shape3", 0F, 3F, 0F, 4, 2, 4); + Base.addBox("Shape4", 2F, 6F, -8F, 1, 1, 16); + Base.addBox("Shape5", 5F, 6F, -8F, 1, 1, 13); + Base.addTube("PipeN7", 3.5F, 6F, -7F, 1, 1, 12, 0F,1F,ForgeDirection.NORTH); + Base.addBox("Shape7", 3F, 6F, -8F, 2, 1, 1); + Base.addTube("PipeW9", 6F, 5F, 5F, 1, 3, 3, 0F,1F,ForgeDirection.WEST); + Base.addTube("PipeW9", 7F, 6F, 5.2F, 1, 1, 1, 0F,1F,ForgeDirection.WEST); + Base.addBox("Shape9", 3F, 5F, 5F, 3, 2, 3); + Base.addBox("Shape10", -2F, 5F, 0F, 8, 1, 1); + Base.addBox("Shape11", -2F, 5F, 3F, 8, 1, 1); + Base.addBox("Shape12", 1F, 5F, 1F, 2, 1, 2); + Base.addTube("PipeW13", -1F, 5F, 1.5F, 6, 1, 1, 0F,1F,ForgeDirection.WEST); + Base.addTube("PipeN13", -4F, 1F, 3F, 2, 2, 3, 0F,1F,ForgeDirection.NORTH); + Base.addBox("Shape13", -3.5F, 2F, 3.8F, 1, 5, 2); + Base.addBox("Shape14", -4.5F, 6F, 2F, 3, 1, 4); + Base.addTube("PipeU15", 0F, 2F, 3F, 1, 1, 1, 0F,1F,ForgeDirection.UP); + Base.addTube("PipeU16", 3F, 2F, 3F, 1, 1, 1, 0F,1F,ForgeDirection.UP); + Base.addTube("PipeU17", 3F, 2F, 0F, 1, 1, 1, 0F,1F,ForgeDirection.UP); + Base.addTube("PipeU18", 0F, 2F, 0F, 1, 1, 1, 0F,1F,ForgeDirection.UP); + Base.addBox("Shape15", 5F, 5F, 1F, 1, 1, 2); + Base.addBox("Shape16", -2F, 5F, 1F, 1, 1, 2); + Base.addTube("PipeW20", 6F, 4F, 0.5F, 1, 3, 3, 0F,1F,ForgeDirection.WEST); + Base.addTube("PipeW19", 7F, 5F, 0.8F, 1, 1, 1, 0F,1F,ForgeDirection.WEST); + Base.addTube("PipeN21", -4.5F, 0.5F, 6F, 3, 3, 1, 0F,1F,ForgeDirection.NORTH); + Base.addTube("PipeN22", -3F, 1F, 7F, 1, 1, 1, 0F,1F,ForgeDirection.NORTH); + } + + private void setRotation(IHLModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + +} diff --git a/src/main/java/ihl/processing/metallurgy/LathePart2TileEntity.java b/src/main/java/ihl/processing/metallurgy/LathePart2TileEntity.java new file mode 100644 index 0000000..7d4dac7 --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/LathePart2TileEntity.java @@ -0,0 +1,104 @@ +package ihl.processing.metallurgy; + +import java.util.ArrayList; +import java.util.List; + +import ic2.api.network.INetworkDataProvider; +import ic2.api.tile.IWrenchable; +import ic2.core.IC2; +import ihl.utils.IHLUtils; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; + +public class LathePart2TileEntity extends TileEntity implements IWrenchable, INetworkDataProvider{ + + private short facing=2; + private short lastFacing=2; + + public LathePart2TileEntity() + { + super(); + } + + public boolean enableUpdateEntity() + { + return IC2.platform.isSimulating(); + } + + @Override + public List getNetworkedFields() + { + List fields = new ArrayList(); + fields.add("facing"); + return fields; + } + + @Override + public void updateEntity() + { + super.updateEntity(); + if(lastFacing!=facing) + { + IC2.network.get().updateTileEntityField(this, "facing"); + lastFacing=facing; + } + } + + + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { + return this.getFacing()!=side; + } + + + @Override + public short getFacing() { + return this.facing; + } + + + @Override + public void setFacing(short facing1) + { + facing=(short) Math.max(2,facing1); + if(IC2.platform.isSimulating()) + { + IC2.network.get().updateTileEntityField(this, "facing"); + lastFacing=facing; + } + } + + + @Override + public boolean wrenchCanRemove(EntityPlayer entityPlayer) { + return true; + } + + + @Override + public float getWrenchDropRate() { + return 1F; + } + + + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { + return IHLUtils.getThisModItemStack("lathePart2"); + } + + @Override + public void readFromNBT(NBTTagCompound nbttagcompound) + { + super.readFromNBT(nbttagcompound); + facing=nbttagcompound.getShort("facing"); + } + + @Override + public void writeToNBT(NBTTagCompound nbttagcompound) + { + super.writeToNBT(nbttagcompound); + nbttagcompound.setShort("facing", facing); + } +} diff --git a/src/main/java/ihl/processing/metallurgy/MachineBaseContainer.java b/src/main/java/ihl/processing/metallurgy/MachineBaseContainer.java new file mode 100644 index 0000000..d7e3ac7 --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/MachineBaseContainer.java @@ -0,0 +1,74 @@ +package ihl.processing.metallurgy; + +import ic2.core.ContainerBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.Slot; + +public class MachineBaseContainer extends ContainerBase { + + protected MachineBaseTileEntity tileEntity; + public int lastProgress = -1; + private short lastEnergy; + private final static int height=166; + + public MachineBaseContainer(EntityPlayer entityPlayer, MachineBaseTileEntity tileEntity1){ + super(tileEntity1); + this.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)); + } + + } + + @Override + public void detectAndSendChanges() + { + super.detectAndSendChanges(); + for (int i = 0; i < this.crafters.size(); ++i) + { + ICrafting icrafting = (ICrafting)this.crafters.get(i); + if (this.tileEntity.progress != this.lastProgress) + { + icrafting.sendProgressBarUpdate(this, 0, this.tileEntity.progress); + } + if (this.tileEntity.getEnergy() != this.lastEnergy) + { + icrafting.sendProgressBarUpdate(this, 1, this.tileEntity.getEnergy()); + } + } + this.lastProgress = this.tileEntity.progress; + } + + @Override + public void updateProgressBar(int index, int value) + { + super.updateProgressBar(index, value); + + switch (index) + { + case 0: + this.tileEntity.progress=(short) value; + break; + case 1: + this.tileEntity.setEnergy(value); + break; + } + } + + @Override + public boolean canInteractWith(EntityPlayer var1) { + return tileEntity.isUseableByPlayer(var1); + } +} diff --git a/src/main/java/ihl/processing/metallurgy/MachineBaseTileEntity.java b/src/main/java/ihl/processing/metallurgy/MachineBaseTileEntity.java new file mode 100644 index 0000000..79763b5 --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/MachineBaseTileEntity.java @@ -0,0 +1,279 @@ +package ihl.processing.metallurgy; + +import java.util.List; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ic2.api.energy.event.EnergyTileLoadEvent; +import ic2.api.energy.event.EnergyTileUnloadEvent; +import ic2.api.energy.tile.IEnergySink; +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 ihl.processing.chemistry.ApparatusProcessableInvSlot; +import ihl.recipes.UniversalRecipeOutput; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.util.ForgeDirection; + +public abstract class MachineBaseTileEntity extends TileEntityInventory implements IHasGui, IEnergySink +{ + public short progress; + protected short operationLength=200; + protected double energy; + public int maxStorage; + public int energyConsume; + public final ApparatusProcessableInvSlot input; + private boolean addedToEnergyNet=false; + + public MachineBaseTileEntity(int inputCount) + { + input = new ApparatusProcessableInvSlot(this, "input", 0, Access.IO, inputCount, 64); + maxStorage=128; + energyConsume=5; + } + @Override + public List getNetworkedFields() + { + List fields = super.getNetworkedFields(); + return fields; + } + + @Override + public void readFromNBT(NBTTagCompound nbttagcompound) + { + super.readFromNBT(nbttagcompound); + this.progress = nbttagcompound.getShort("progress"); + } + + @Override + public void writeToNBT(NBTTagCompound nbttagcompound) + { + super.writeToNBT(nbttagcompound); + nbttagcompound.setShort("progress", this.progress); + } + + @Override + public void onLoaded() + { + super.onLoaded(); + if (IC2.platform.isSimulating()&&!this.addedToEnergyNet) + { + MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this)); + this.addedToEnergyNet = true; + } + } + + @Override + public void onUnloaded() + { + if (IC2.platform.isSimulating()&&this.addedToEnergyNet) + { + MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this)); + this.addedToEnergyNet = false; + } + + super.onUnloaded(); + } + + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { + return this.getFacing()!=(short)side; + } + + @Override + public void setFacing(short facing1) + { + if (IC2.platform.isSimulating()&&this.addedToEnergyNet) + { + MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this)); + this.addedToEnergyNet = false; + } + super.setFacing(facing1); + if (IC2.platform.isSimulating()&&!this.addedToEnergyNet) + { + MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this)); + this.addedToEnergyNet = true; + } + } + + public boolean enableUpdateEntity() + { + return IC2.platform.isSimulating(); + } + + public abstract String getStartSoundFile(); + + public abstract String getLoopSoundFile(); + + public abstract String getStopSoundFile(); + + @Override + public void updateEntityServer() + { + if(this.energy>this.maxStorage) + { + this.energy=this.maxStorage; + } + + if (this.canOperate() && this.energy >= this.energyConsume) + { + this.setActive(true); + + if (this.progress == 0) + { + IC2.network.get().initiateTileEntityEvent(this, 0, true); + } + + ++this.progress; + this.energy -= this.energyConsume; + + 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); + } + } + + protected int mX() + { + switch(this.getFacing()) + { + case 4: + return 1; + case 5: + return -1; + default: + return 0; + } + } + + protected int mY() + { + switch(this.getFacing()) + { + case 0: + return -1; + case 1: + return 1; + default: + return 0; + } + } + + protected int mZ() + { + switch(this.getFacing()) + { + case 2: + return 1; + case 3: + return -1; + default: + return 0; + } + } + + @Override + public abstract String getInventoryName(); + + @Override + @SideOnly(Side.CLIENT) + public abstract GuiScreen getGui(EntityPlayer arg0, boolean arg1); + + @Override + public abstract ContainerBase getGuiContainer(EntityPlayer arg0); + + @Override + public void onGuiClosed(EntityPlayer arg0) {} + + public int gaugeProgressScaled(int i) + { + return this.progress * i / this.operationLength; + } + + public boolean canOperate() + { + return getOutput()!=null; + } + + public abstract UniversalRecipeOutput getOutput(); + + @SuppressWarnings("rawtypes") + public List[] getInput() + { + return new List[]{null, this.input.getItemStackList()}; + } + + + @Override + public double getDemandedEnergy() + { + return this.maxStorage - this.energy; + } + + @Override + public int getSinkTier() + { + return 4; + } + + @Override + public double injectEnergy(ForgeDirection directionFrom, double amount, double voltage) + { + if (this.energy >= this.maxStorage) + { + return amount; + } + else + { + this.energy += amount; + return 0.0D; + } + } + + @Override + public boolean acceptsEnergyFrom(TileEntity emitter, ForgeDirection direction) + { + return true; + } + + + public abstract void operate(); + public short getEnergy() { + return (short)this.energy; + } + public void setEnergy(int value) + { + this.energy=value; + } + public int getGUIEnergy(int i) { + if(this.energy 0D) + { + i1 = Math.min(this.container.tileEntity.getGUIEnergy(12),12); + this.drawTexturedModalRect(8, 6 + 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(70,34, 197, 0, i1 + 1, 13); + } + fontRendererObj.drawStringWithShadow(StatCollector.translateToLocal("ihl.gui.muffleFurnace"), 40, 12, 16768125); + + } + + @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(muffleFurnaceBackground); + int x = (width - xSize) / 2; + int y = (height - ySize) / 2; + this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); + } +} diff --git a/src/main/java/ihl/processing/metallurgy/MuffleFurnanceContainer.java b/src/main/java/ihl/processing/metallurgy/MuffleFurnanceContainer.java new file mode 100644 index 0000000..1ae7203 --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/MuffleFurnanceContainer.java @@ -0,0 +1,16 @@ +package ihl.processing.metallurgy; + +import ic2.core.slot.SlotInvSlot; +import net.minecraft.entity.player.EntityPlayer; + +public class MuffleFurnanceContainer extends MachineBaseContainer { + + public MuffleFurnanceContainer(EntityPlayer entityPlayer, + MuffleFurnanceTileEntity tileEntity1) { + super(entityPlayer, tileEntity1); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.input, 0, 40, 22)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.input, 1, 40, 40)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.outputSlot, 0, 98, 32)); + } + +} diff --git a/src/main/java/ihl/processing/metallurgy/MuffleFurnanceTileEntity.java b/src/main/java/ihl/processing/metallurgy/MuffleFurnanceTileEntity.java new file mode 100644 index 0000000..6f811cb --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/MuffleFurnanceTileEntity.java @@ -0,0 +1,119 @@ +package ihl.processing.metallurgy; + +import java.util.List; +import java.util.Map; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ic2.api.recipe.IRecipeInput; +import ic2.core.ContainerBase; +import ihl.IHLMod; +import ihl.processing.invslots.IHLInvSlotOutput; +import ihl.recipes.RecipeOutputItemStack; +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; + +public class MuffleFurnanceTileEntity extends MachineBaseTileEntity { + + protected static UniversalRecipeManager recipeManager = new UniversalRecipeManager("mufflefurnace"); + public final IHLInvSlotOutput outputSlot; + + public MuffleFurnanceTileEntity() { + super(2); + this.outputSlot = new IHLInvSlotOutput(this, "output", 0, 1); + } + + @Override + public String getStartSoundFile() { + return null; + } + + @Override + public String getLoopSoundFile() { + return null; + } + + @Override + public String getStopSoundFile() { + return null; + } + + @Override + public String getInventoryName() { + return "MuffleFurnance"; + } + + @Override + @SideOnly(Side.CLIENT) + public GuiScreen getGui(EntityPlayer player, boolean arg1) { + return new MuffleFurnaceGui(new MuffleFurnanceContainer(player, this)); + } + + @Override + public ContainerBase getGuiContainer(EntityPlayer player) { + return new MuffleFurnanceContainer(player, this); + } + + @Override + public boolean canOperate() { + ItemStack crucible = input.getItemStack(IHLMod.crucible); + if (crucible != null) { + return true; + } + ItemStack mold = input.getItemStack(IHLUtils.getThisModItem("injectionMold")); + if (mold != null) { + return true; + } + return getOutput() != null; + } + + @Override + public void operate() { + ItemStack crucible = input.getItemStack(IHLMod.crucible); + if (crucible != null) { + ((Crucible) crucible.getItem()).processContent(crucible, this); + return; + } + ItemStack mold = input.getItemStack(IHLUtils.getThisModItem("injectionMold")); + if (mold != null) { + mold.stackTagCompound.setBoolean("isContainStearin", false); + return; + } + List output = recipeManager + .getOutputFor(getInput()).getItemOutputs(); + List rinput = recipeManager.getRecipeInput(getInput()).getItemInputs(); + for (int i = 0; i < rinput.size(); i++) { + this.input.consume(rinput.get(i)); + } + this.outputSlot.add(output); + } + + public static void addRecipe(IRecipeInput recipeInputOreDict, ItemStack output) { + recipeManager.addRecipe(new UniversalRecipeInput(null, (new IRecipeInput[] { recipeInputOreDict })), + new UniversalRecipeOutput(null, (new ItemStack[] { output }), 20)); + } + + public static Map getRecipes() { + return recipeManager.getRecipes(); + } + + @Override + public UniversalRecipeOutput getOutput() { + return MuffleFurnanceTileEntity.recipeManager.getOutputFor(null, this.input.getItemStackList()); + } + + public static void addRecipe(UniversalRecipeInput universalRecipeInput, + UniversalRecipeOutput universalRecipeOutput) { + recipeManager.addRecipe(universalRecipeInput, universalRecipeOutput); + } + + public static void addRecipe(IRecipeInput recipeInputOreDict, ItemStack output, float f) { + recipeManager.addRecipe(new UniversalRecipeInput(null, (new IRecipeInput[] { recipeInputOreDict })), new UniversalRecipeOutput( + null, (new RecipeOutputItemStack[] { new RecipeOutputItemStack(output, f) }), 20)); + } +} diff --git a/src/main/java/ihl/processing/metallurgy/RollingMachineContainer.java b/src/main/java/ihl/processing/metallurgy/RollingMachineContainer.java new file mode 100644 index 0000000..7a83d9d --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/RollingMachineContainer.java @@ -0,0 +1,75 @@ +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 RollingMachineContainer extends ContainerBase { + + public RollingMachinePart1TileEntity tileEntity; + public int lastProgress = -1; + private short lastEnergy = -1; + private final static int height=166; + + public RollingMachineContainer(EntityPlayer entityPlayer, + RollingMachinePart1TileEntity lathePart1TileEntity) { + super(lathePart1TileEntity); + tileEntity=lathePart1TileEntity; + 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(lathePart1TileEntity.input, 0, 54, 25)); + this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.output, 0, 105, 25)); + this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.dischargeSlot,0, 22, 55)); + } + + @Override + public void detectAndSendChanges() + { + super.detectAndSendChanges(); + for (int i = 0; i < this.crafters.size(); ++i) + { + ICrafting icrafting = (ICrafting)this.crafters.get(i); + if (this.tileEntity.progress != this.lastProgress) + { + icrafting.sendProgressBarUpdate(this, 0, this.tileEntity.progress); + } + if (this.tileEntity.getEnergy() != this.lastEnergy) + { + icrafting.sendProgressBarUpdate(this, 1, this.tileEntity.getEnergy()); + } + } + this.lastProgress = this.tileEntity.progress; + this.lastEnergy = (short) this.tileEntity.getEnergy(); + } + + @Override + public void updateProgressBar(int index, int value) + { + super.updateProgressBar(index, value); + + switch (index) + { + case 0: + this.tileEntity.progress=(short) value; + break; + case 1: + this.tileEntity.setEnergy(value); + break; + } + } + +} diff --git a/src/main/java/ihl/processing/metallurgy/RollingMachineGui.java b/src/main/java/ihl/processing/metallurgy/RollingMachineGui.java new file mode 100644 index 0000000..a792bd3 --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/RollingMachineGui.java @@ -0,0 +1,50 @@ +package ihl.processing.metallurgy; + +import org.lwjgl.opengl.GL11; + +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.util.ResourceLocation; + +public class RollingMachineGui extends GuiContainer { + + private RollingMachineContainer container; + protected static final ResourceLocation tex = new ResourceLocation("ihl", "textures/gui/GUIRollingMachine.png"); + + public RollingMachineGui(RollingMachineContainer latheContainer) { + super(latheContainer); + container = latheContainer; + } + + + @Override + protected void drawGuiContainerForegroundLayer(int par1, int par2) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.renderEngine.bindTexture(tex); + int i1; + if (this.container.tileEntity.getEnergy() > 0D) + { + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + 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.progress > 0) + { + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(50),50); + this.drawTexturedModalRect(64, 63, 197, 0, i1 + 1, 13); + } + } + + @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); + } +} diff --git a/src/main/java/ihl/processing/metallurgy/RollingMachinePart1Model.java b/src/main/java/ihl/processing/metallurgy/RollingMachinePart1Model.java new file mode 100644 index 0000000..fe062f8 --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/RollingMachinePart1Model.java @@ -0,0 +1,97 @@ +package ihl.processing.metallurgy; + + +import ihl.model.IHLModelRenderer; +import net.minecraft.client.model.ModelBase; +import net.minecraftforge.common.util.ForgeDirection; + + +public class RollingMachinePart1Model extends ModelBase +{ + //fields + IHLModelRenderer Base; + IHLModelRenderer RotatingPart2; + IHLModelRenderer MotorPart1; + IHLModelRenderer MotorPart2; + IHLModelRenderer RotatingPart1; + IHLModelRenderer Plate; + + public RollingMachinePart1Model() + { + textureWidth = 64; + textureHeight = 32; + setTextureOffset("Base.Shape6", 0, 0); + setTextureOffset("Base.Shape16", 0, 0); + setTextureOffset("Base.Shape5", 0, 0); + setTextureOffset("Base.Shape8", 0, 0); + setTextureOffset("Base.Shape11", 0, 0); + setTextureOffset("Base.Shape9", 0, 0); + setTextureOffset("RotatingPart2.PipeN7", 0, 0); + setTextureOffset("RotatingPart2.PipeN17", 0, 0); + setTextureOffset("RotatingPart2.Shape3", 0, 0); + setTextureOffset("RotatingPart2.Shape12", 0, 0); + setTextureOffset("MotorPart1.PipeN41", 0, 0); + setTextureOffset("MotorPart1.PipeN12", 0, 0); + setTextureOffset("MotorPart1.PipeN13", 0, 0); + setTextureOffset("MotorPart2.Shape4", 0, 24); + setTextureOffset("MotorPart2.Shape7", 0, 9); + setTextureOffset("MotorPart2.Shape10", 0, 9); + setTextureOffset("RotatingPart1.Shape1", 0, 0); + setTextureOffset("RotatingPart1.Shape2", 0, 0); + setTextureOffset("RotatingPart1.Shape13", 0, 0); + setTextureOffset("Plate.Shape14", 0, 0); + + Base = new IHLModelRenderer(this, "Base"); + Base.setRotationPoint(0F, 16F, 0F); + setRotation(Base, 0F, 0F, 0F); + Base.mirror = true; + Base.addBox("Shape6", -8F, 7F, -8F, 16, 1, 16); + Base.addBox("Shape16", -3F, -7F, -6F, 9, 14, 1); + Base.addBox("Shape5", 2F, -1F, -5F, 6, 1, 13); + Base.addBox("Shape8", -8F, -1F, -5F, 6, 1, 13); + Base.addBox("Shape11", 3F, 0F, 7F, 4, 7, 1); + Base.addBox("Shape9", -7F, 0F, 7F, 4, 7, 1); + RotatingPart2 = new IHLModelRenderer(this, "RotatingPart2"); + RotatingPart2.setRotationPoint(0F, 16F, -7F); + setRotation(RotatingPart2, 0F, 0F, 0F); + RotatingPart2.mirror = true; + RotatingPart2.addTube("PipeN7", -5.5F, -5.5F, -0.9F, 11, 11, 1, 0F,1F,ForgeDirection.NORTH); + RotatingPart2.addTube("PipeN17", -2F, -2F, 2F, 4, 4, 26, 0F,1F,ForgeDirection.NORTH); + RotatingPart2.addTube("Shape3", -2.5F, -2.5F, 0F, 5, 5, 1, 0F,1F,ForgeDirection.NORTH); + RotatingPart2.addTube("Shape12", -1F, -1F, 28F, 2, 2, 3, 0F,1F,ForgeDirection.NORTH); + MotorPart1 = new IHLModelRenderer(this, "MotorPart1"); + MotorPart1.setRotationPoint(4.5F, 20.5F, 0F); + setRotation(MotorPart1, 0F, 0F, 0F); + MotorPart1.mirror = true; + MotorPart1.addTube("PipeN41", -1.5F, -1.5F, -8F, 3, 3, 1, 0F,1F,ForgeDirection.NORTH); + MotorPart1.addTube("PipeN12", -0.5F, -0.5F, -7F, 1, 1, 1, 0F,1F,ForgeDirection.NORTH); + MotorPart1.addTube("PipeN13", -1.5F, -1.5F, -5F, 3, 3, 5, 0F,1F,ForgeDirection.NORTH); + MotorPart2 = new IHLModelRenderer(this, "MotorPart2"); + MotorPart2.setRotationPoint(0F, 16F, 0F); + setRotation(MotorPart2, 0F, 0F, 0F); + MotorPart2.mirror = true; + MotorPart2.addBox("Shape4", 3F, 3F, 0F, 3, 4, 4); + MotorPart2.addBox("Shape7", 6F, 3F, -5F, 2, 4, 5); + MotorPart2.addBox("Shape10", 1F, 3F, -5F, 2, 4, 5); + RotatingPart1 = new IHLModelRenderer(this, "RotatingPart1"); + RotatingPart1.setRotationPoint(0F, 11.9F, -5F); + setRotation(RotatingPart1, 0F, 0F, 0F); + RotatingPart1.mirror = true; + RotatingPart1.addTube("Shape1", -2F, -2F, 0F, 4, 4, 26, 0F,1F,ForgeDirection.NORTH); + RotatingPart1.addTube("Shape2", -2.5F, -2.5F, -1.9F, 5, 5, 1, 0F,1F,ForgeDirection.NORTH); + RotatingPart1.addTube("Shape13", -1F, -1F, 26F, 2, 2, 3, 0F,1F,ForgeDirection.NORTH); + Plate = new IHLModelRenderer(this, "Plate"); + Plate.setRotationPoint(0F, 13.5F, 0F); + setRotation(Plate, 0F, 0F, 0F); + Plate.mirror = true; + Plate.addBox("Shape14", -18F, 0F, 0F, 16, 1, 16); + } + + private void setRotation(IHLModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + +} diff --git a/src/main/java/ihl/processing/metallurgy/RollingMachinePart1TileEntity.java b/src/main/java/ihl/processing/metallurgy/RollingMachinePart1TileEntity.java new file mode 100644 index 0000000..da60877 --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/RollingMachinePart1TileEntity.java @@ -0,0 +1,149 @@ +package ihl.processing.metallurgy; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ic2.api.recipe.IRecipeInput; +import ic2.core.ContainerBase; +import ic2.core.IC2; +import ic2.core.block.invslot.InvSlot.Access; +import ihl.processing.chemistry.ApparatusProcessableInvSlot; +import ihl.processing.invslots.IHLInvSlotOutput; +import ihl.recipes.RecipeOutputItemStack; +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 net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + +public class RollingMachinePart1TileEntity extends BasicElectricMotorTileEntity{ + + public final ApparatusProcessableInvSlot input; + public final IHLInvSlotOutput output; + public boolean assembled; + protected static final UniversalRecipeManager recipeManager = new UniversalRecipeManager("rollingmachine"); + + public RollingMachinePart1TileEntity() + { + super(); + input = new ApparatusProcessableInvSlot(this, "input", 1, Access.IO, 1, 64); + output = new IHLInvSlotOutput(this, "output", 2, 1); + } + + public UniversalRecipeOutput getOutput() + { + return RollingMachinePart1TileEntity.recipeManager.getOutputFor(this.getInput()); + } + + @Override + public List getNetworkedFields() + { + List fields = super.getNetworkedFields(); + fields.add("assembled"); + return fields; + } + + + @Override + public String getInventoryName() { + return "RollingMachine"; + } + + @Override + public void updateEntityServer() + { + super.updateEntityServer(); + if(assembled && !this.checkCorrectAccembly()) + { + assembled=false; + IC2.network.get().updateTileEntityField(this, "assembled"); + } + else if(!assembled && this.checkCorrectAccembly()) + { + assembled=true; + IC2.network.get().updateTileEntityField(this, "assembled"); + } + if (this.getActive() && this.progress == 0 && !this.canOperate()) + { + this.setActive(false); + } + + if (!this.getActive() && this.progress>0 && this.canOperate()) + { + this.setActive(true); + } + + } + + @Override + public ItemStack getWrenchDrop(EntityPlayer player) + { + return IHLUtils.getThisModItemStack("rollingMachinePart1"); + } + + @Override + @SideOnly(Side.CLIENT) + public GuiScreen getGui(EntityPlayer player, boolean arg1) { + return new RollingMachineGui(new RollingMachineContainer(player, this)); + } + + @Override + public ContainerBase getGuiContainer(EntityPlayer player) { + return new RollingMachineContainer(player, this); + } + + @Override + public void operate() + { + List rinput = recipeManager.getRecipeInput(getInput()).getItemInputs(); + List output = RollingMachinePart1TileEntity.recipeManager.getOutputFor(getInput()).getItemOutputs(); + this.output.add(output); + this.input.consume(rinput.get(0)); + } + + @SuppressWarnings({ "rawtypes", "unchecked" }) + @Override + public List[] getInput() + { + return new List[]{null, Arrays.asList(new ItemStack[] {input.get()})}; + } + + @Override + public boolean canOperate() + { + return this.getOutput()!=null && this.output.canAdd(this.getOutput().getItemOutputs()) && checkCorrectAccembly(); + } + + private boolean checkCorrectAccembly() + { + TileEntity te = worldObj.getTileEntity(xCoord+ForgeDirection.getOrientation(getFacing()).offsetX,yCoord+ForgeDirection.getOrientation(getFacing()).offsetY,zCoord+ForgeDirection.getOrientation(getFacing()).offsetZ); + return te!=null && te instanceof RollingMachinePart2TileEntity && ((RollingMachinePart2TileEntity)te).getFacing()==this.getFacing(); + } + + @Override + public void onGuiClosed(EntityPlayer arg0) {} + + public static void addRecipe(ItemStack input, ItemStack output) + { + recipeManager.addRecipe(new UniversalRecipeInput(null, (new ItemStack [] {input})), new UniversalRecipeOutput(null, (new ItemStack[] {output}), 20)); + } + + + public static Map getRecipes() { + return recipeManager.getRecipes(); + } + + @Override + public boolean shouldRenderInPass(int pass) + { + return pass==0; + } + +} diff --git a/src/main/java/ihl/processing/metallurgy/RollingMachinePart2Model.java b/src/main/java/ihl/processing/metallurgy/RollingMachinePart2Model.java new file mode 100644 index 0000000..39fd1f5 --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/RollingMachinePart2Model.java @@ -0,0 +1,42 @@ +package ihl.processing.metallurgy; + + +import ihl.model.IHLModelRenderer; +import net.minecraft.client.model.ModelBase; + +public class RollingMachinePart2Model extends ModelBase +{ + //fields + IHLModelRenderer Base; + + public RollingMachinePart2Model() + { + textureWidth = 64; + textureHeight = 32; + setTextureOffset("Base.Shape6", 0, 0); + setTextureOffset("Base.Shape16", 0, 0); + setTextureOffset("Base.Shape5", 0, 0); + setTextureOffset("Base.Shape8", 0, 0); + setTextureOffset("Base.Shape11", 0, 0); + setTextureOffset("Base.Shape9", 0, 0); + + Base = new IHLModelRenderer(this, "Base"); + Base.setRotationPoint(0F, 16F, 0F); + setRotation(Base, 0F, 0F, 0F); + Base.mirror = true; + Base.addBox("Shape6", -8F, 7F, -8F, 16, 1, 16); + Base.addBox("Shape16", -3F, -7F, 5F, 6, 14, 1); + Base.addBox("Shape5", 2F, -1F, -8F, 6, 1, 13); + Base.addBox("Shape8", -8F, -1F, -8F, 6, 1, 13); + Base.addBox("Shape11", 3F, 0F, -8F, 4, 7, 1); + Base.addBox("Shape9", -7F, 0F, -8F, 4, 7, 1); + } + + private void setRotation(IHLModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + +} diff --git a/src/main/java/ihl/processing/metallurgy/RollingMachinePart2TileEntity.java b/src/main/java/ihl/processing/metallurgy/RollingMachinePart2TileEntity.java new file mode 100644 index 0000000..13f4f6c --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/RollingMachinePart2TileEntity.java @@ -0,0 +1,104 @@ +package ihl.processing.metallurgy; + +import java.util.ArrayList; +import java.util.List; + +import ic2.api.network.INetworkDataProvider; +import ic2.api.tile.IWrenchable; +import ic2.core.IC2; +import ihl.utils.IHLUtils; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; + +public class RollingMachinePart2TileEntity extends TileEntity implements IWrenchable, INetworkDataProvider{ + + private short facing=2; + private short lastFacing=2; + + public RollingMachinePart2TileEntity() + { + super(); + } + + public boolean enableUpdateEntity() + { + return IC2.platform.isSimulating(); + } + + @Override + public List getNetworkedFields() + { + List fields = new ArrayList(); + fields.add("facing"); + return fields; + } + + @Override + public void updateEntity() + { + super.updateEntity(); + if(lastFacing!=facing) + { + IC2.network.get().updateTileEntityField(this, "facing"); + lastFacing=facing; + } + } + + + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { + return this.getFacing()!=side; + } + + + @Override + public short getFacing() { + return this.facing; + } + + + @Override + public void setFacing(short facing1) + { + facing=(short) Math.max(2,facing1); + if(IC2.platform.isSimulating()) + { + IC2.network.get().updateTileEntityField(this, "facing"); + } + } + + + @Override + public boolean wrenchCanRemove(EntityPlayer entityPlayer) { + return true; + } + + + @Override + public float getWrenchDropRate() { + return 1F; + } + + + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { + return IHLUtils.getThisModItemStack("rollingMachinePart2"); + } + + @Override + public void readFromNBT(NBTTagCompound nbttagcompound) + { + super.readFromNBT(nbttagcompound); + facing=nbttagcompound.getShort("facing"); + } + + @Override + public void writeToNBT(NBTTagCompound nbttagcompound) + { + super.writeToNBT(nbttagcompound); + nbttagcompound.setShort("facing", facing); + } + +} diff --git a/src/main/java/ihl/processing/metallurgy/RollingMachineRender.java b/src/main/java/ihl/processing/metallurgy/RollingMachineRender.java new file mode 100644 index 0000000..f347a73 --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/RollingMachineRender.java @@ -0,0 +1,81 @@ +package ihl.processing.metallurgy; +import org.lwjgl.opengl.GL11; + +import ic2.api.tile.IWrenchable; +import ihl.IHLModInfo; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; + +public class RollingMachineRender extends TileEntitySpecialRenderer{ +private RollingMachinePart1Model model = new RollingMachinePart1Model(); +private ResourceLocation tex = new ResourceLocation(IHLModInfo.MODID+":textures/blocks/coiler.png"); +private final float scale=1F/16F; + + public RollingMachineRender() {} + + + @Override + public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float par8) + { + int rotation = 0; + if(tile.getWorldObj() != null) + { + switch (((IWrenchable)tile).getFacing()) + { + case 2: + rotation = 0; + break; + case 5: + rotation = 1; + break; + case 3: + rotation = 2; + break; + case 4: + rotation = 3; + break; + default: + rotation = 0; + } + } + else + { + return; + } + RollingMachinePart1TileEntity cte = (RollingMachinePart1TileEntity)tile; + GL11.glPushMatrix(); + GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F); + GL11.glScalef(1.0F, -1F, -1F); + GL11.glRotatef(rotation*90, 0.0F, 1.0F, 0.0F); + + bindTexture(tex); + model.Base.render(scale); + if(cte.getActive()) + { + model.RotatingPart1.rotateAngleZ-=0.01F; + model.RotatingPart2.rotateAngleZ+=0.01F; + model.RotatingPart1.render(scale); + model.RotatingPart2.render(scale); + model.MotorPart1.rotateAngleZ-=0.03F; + model.MotorPart1.render(scale); + model.MotorPart2.render(scale); + model.Plate.offsetX+=0.001F; + if(model.Plate.offsetX>1F){model.Plate.offsetX=0;} + model.Plate.render(scale); + } + else + { + model.Plate.offsetX=0F; + if(cte.assembled) + { + model.RotatingPart1.render(scale); + model.RotatingPart2.render(scale); + } + model.MotorPart1.render(scale); + model.MotorPart2.render(scale); + } + GL11.glPopMatrix(); //end + + } +} \ No newline at end of file diff --git a/src/main/java/ihl/processing/metallurgy/VulcanizationExtrudingMoldModel.java b/src/main/java/ihl/processing/metallurgy/VulcanizationExtrudingMoldModel.java new file mode 100644 index 0000000..9ce0f01 --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/VulcanizationExtrudingMoldModel.java @@ -0,0 +1,54 @@ +package ihl.processing.metallurgy; + +import ihl.model.IHLModelRenderer; +import net.minecraft.client.model.ModelBase; +import net.minecraftforge.common.util.ForgeDirection; + +public class VulcanizationExtrudingMoldModel extends ModelBase +{ + //fields + IHLModelRenderer Base; + + public VulcanizationExtrudingMoldModel() + { + textureWidth = 64; + textureHeight = 32; + setTextureOffset("Base.Shape6", 0, 0); + setTextureOffset("Base.Shape3", 0, 0); + setTextureOffset("Base.Shape16", 0, 0); + setTextureOffset("Base.PipeW161", 0, 0); + setTextureOffset("Base.PipeN16", 0, 0); + setTextureOffset("Base.PipeW15", 22, 22); + setTextureOffset("Base.PipeW17", 0, 0); + setTextureOffset("Base.Shape14", 0, 0); + setTextureOffset("Base.PipeN14", 0, 0); + setTextureOffset("Base.Shape2", 0, 0); + setTextureOffset("Base.Shape4", 42, 17); + setTextureOffset("Base.Shape5", 37, 17); + + Base = new IHLModelRenderer(this, "Base"); + Base.setRotationPoint(0F, 16F, 0F); + setRotation(Base, 0F, 0F, 0F); + Base.mirror = true; + Base.addBox("Shape6", -8F, 7F, -8F, 16, 1, 16); + Base.addBox("Shape3", -5F, 0F, -7F, 4, 7, 1); + Base.addBox("Shape16", 6.9F, 3F, -1.5F, 1, 4, 3); + Base.addTube("PipeW161", -7F, 0.5F, -1.5F, 15, 3, 3, 0.5F,1F,ForgeDirection.WEST); + Base.addTube("PipeN16", -4.5F, 0.5F, -6F, 3, 3, 6, 0.8F,1F,ForgeDirection.NORTH); + Base.addTube("PipeW15", -5.5F, -0.5F, -2.5F, 12, 5, 5, 0.5F,1F,ForgeDirection.WEST); + Base.addTube("PipeW17", -8F, -0.5F, -2.5F, 1, 5, 5, 0.1F,1F,ForgeDirection.WEST); + Base.addBox("Shape14", -5F, 3F, -4.9F, 4, 4, 1); + Base.addTube("PipeN14", -5.5F, -0.5F, -8F, 5, 5, 1, 0.5F,1F,ForgeDirection.NORTH); + Base.addBox("Shape2", -7F, 3F, -1.5F, 1, 4, 3); + Base.addBox("Shape4", 5F, 3F, 1F, 1, 4, 1); + Base.addBox("Shape5", 5F, 6F, 2F, 3, 1, 1); + } + + private void setRotation(IHLModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + +} diff --git a/src/main/java/ihl/processing/metallurgy/VulcanizationExtrudingMoldTileEntity.java b/src/main/java/ihl/processing/metallurgy/VulcanizationExtrudingMoldTileEntity.java new file mode 100644 index 0000000..bb51ced --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/VulcanizationExtrudingMoldTileEntity.java @@ -0,0 +1,256 @@ +package ihl.processing.metallurgy; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +import ic2.api.energy.event.EnergyTileLoadEvent; +import ic2.api.energy.event.EnergyTileUnloadEvent; +import ic2.api.energy.tile.IEnergySink; +import ic2.api.network.INetworkDataProvider; +import ic2.api.recipe.IRecipeInput; +import ic2.api.recipe.RecipeInputItemStack; +import ic2.api.tile.IWrenchable; +import ic2.core.IC2; +import ihl.items_blocks.FlexibleCableItem; +import ihl.recipes.UniversalRecipeInput; +import ihl.recipes.UniversalRecipeManager; +import ihl.recipes.UniversalRecipeOutput; +import ihl.utils.IHLUtils; +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.MinecraftForge; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTank; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidHandler; + +public class VulcanizationExtrudingMoldTileEntity extends TileEntity + implements IWrenchable, INetworkDataProvider, IEnergySink, IProductionLine, IFluidHandler { + + private short facing = 2; + private short lastFacing = 2; + public double energy; + public int maxStorage = 64; + private double energyConsume = 16D; + private boolean addedToEnergyNet = false; + private FluidTank fluidTank = new FluidTank(5000); + protected static final UniversalRecipeManager recipeManager = new UniversalRecipeManager( + "vulcanizationextrudingmold"); + + public VulcanizationExtrudingMoldTileEntity() { + super(); + } + + public static void addRecipe(FluidStack inputFluid, ItemStack input, ItemStack output1) { + recipeManager.addRecipe( + new UniversalRecipeInput((new FluidStack[] { inputFluid }), + (new IRecipeInput[] { new RecipeInputItemStack(input) })), + new UniversalRecipeOutput(null, (new ItemStack[] { output1 }), 200)); + } + + public boolean enableUpdateEntity() { + return IC2.platform.isSimulating(); + } + + @Override + public void invalidate() { + if (IC2.platform.isSimulating() && this.addedToEnergyNet) { + MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this)); + this.addedToEnergyNet = false; + } + super.invalidate(); + } + + @Override + public List getNetworkedFields() { + List fields = new ArrayList(); + fields.add("facing"); + return fields; + } + + @Override + public void updateEntity() { + super.updateEntity(); + if (IC2.platform.isSimulating() && !this.addedToEnergyNet) { + MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this)); + this.addedToEnergyNet = true; + } + + if (lastFacing != facing) { + IC2.network.get().updateTileEntityField(this, "facing"); + lastFacing = facing; + } + } + + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { + return this.getFacing() != side; + } + + @Override + public short getFacing() { + return this.facing; + } + + @Override + public void setFacing(short facing1) { + if (IC2.platform.isSimulating() && this.addedToEnergyNet) { + MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this)); + this.addedToEnergyNet = false; + } + facing = (short) Math.max(2, facing1); + if (IC2.platform.isSimulating()) { + IC2.network.get().updateTileEntityField(this, "facing"); + lastFacing = facing; + } + if (IC2.platform.isSimulating() && !this.addedToEnergyNet) { + MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this)); + this.addedToEnergyNet = true; + } + } + + @Override + public boolean wrenchCanRemove(EntityPlayer entityPlayer) { + return true; + } + + @Override + public float getWrenchDropRate() { + return 1F; + } + + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { + return IHLUtils.getThisModItemStack("vulcanizationExtrudingMold"); + } + + @Override + public void readFromNBT(NBTTagCompound nbttagcompound) { + super.readFromNBT(nbttagcompound); + this.fluidTank.readFromNBT(nbttagcompound.getCompoundTag("fluidTank")); + facing = nbttagcompound.getShort("facing"); + energy = nbttagcompound.getDouble("energy"); + } + + @Override + public void writeToNBT(NBTTagCompound nbttagcompound) { + super.writeToNBT(nbttagcompound); + NBTTagCompound fluidTankTag = new NBTTagCompound(); + this.fluidTank.writeToNBT(fluidTankTag); + nbttagcompound.setTag("fluidTank", fluidTankTag); + nbttagcompound.setShort("facing", facing); + nbttagcompound.setDouble("energy", this.energy); + } + + @Override + public double getDemandedEnergy() { + return this.maxStorage - this.energy; + } + + @Override + public int getSinkTier() { + return 4; + } + + @Override + public double injectEnergy(ForgeDirection directionFrom, double amount, double voltage) { + if (this.energy < this.maxStorage) { + this.energy += amount; + return 0.0D; + } else { + return amount; + } + } + + @Override + public boolean acceptsEnergyFrom(TileEntity emitter, ForgeDirection direction) { + return true; + } + + private ItemStack processWire(ItemStack wire, boolean doProcess) { + UniversalRecipeOutput rOutput = VulcanizationExtrudingMoldTileEntity.recipeManager.getOutputFor( + Arrays.asList(new FluidStack[] { this.fluidTank.getFluid() }), Arrays.asList(new ItemStack[] { wire })); + if (rOutput == null || this.energy < this.energyConsume) { + return wire; + } + UniversalRecipeInput rInput = VulcanizationExtrudingMoldTileEntity.recipeManager.getRecipeInput( + Arrays.asList(new FluidStack[] { this.fluidTank.getFluid() }), Arrays.asList(new ItemStack[] { wire })); + ItemStack cableAsRO = rOutput.getItemOutputs().get(0).itemStack; + ItemStack cable = wire.copy(); + FlexibleCableItem fci = (FlexibleCableItem) cableAsRO.getItem(); + cable.stackTagCompound.setString("insulationMaterial", fci.getInsulationMaterial(cableAsRO)); + cable.stackTagCompound.setInteger("insulationThickness", fci.getInsulationThickness(cableAsRO)); + cable.stackTagCompound.setInteger("maxVoltage", IHLUtils + .getInsulationMaxVoltage(fci.getInsulationMaterial(cableAsRO), fci.getInsulationThickness(cableAsRO))); + if (doProcess) { + this.energy -= this.energyConsume; + this.fluidTank.drain(rInput.getFluidInputs().get(0).getAmount() * IHLUtils.getWireLength(cable), true); + } + return cable; + } + + @Override + public boolean canProcess(ItemStack wire) { + ItemStack cable = this.processWire(wire, false); + ForgeDirection dir = ForgeDirection.getOrientation(getFacing()).getRotation(ForgeDirection.UP); + TileEntity te = worldObj.getTileEntity(xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ); + if (te instanceof IProductionLine) { + if (ForgeDirection.getOrientation(((IProductionLine) te).getFacing()) + .equals(dir.getRotation(ForgeDirection.DOWN))) { + return ((IProductionLine) te).canProcess(cable); + } + } + return false; + } + + @Override + public void process(ItemStack wire) { + ItemStack cable = this.processWire(wire, true); + ForgeDirection dir = ForgeDirection.getOrientation(getFacing()).getRotation(ForgeDirection.UP); + TileEntity te = worldObj.getTileEntity(xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ); + if (te instanceof IProductionLine && ForgeDirection.getOrientation(((IProductionLine) te).getFacing()) + .equals(dir.getRotation(ForgeDirection.DOWN))) { + ((IProductionLine) te).process(cable); + } + } + + @Override + public boolean canDrain(ForgeDirection arg0, Fluid arg1) { + return false; + } + + @Override + public boolean canFill(ForgeDirection arg0, Fluid arg1) { + return ForgeDirection.getOrientation(this.facing) == arg0; + } + + @Override + public FluidStack drain(ForgeDirection arg0, FluidStack arg1, boolean arg2) { + return null; + } + + @Override + public FluidStack drain(ForgeDirection arg0, int arg1, boolean arg2) { + return null; + } + + @Override + public int fill(ForgeDirection arg0, FluidStack arg1, boolean arg2) { + return this.fluidTank.fill(arg1, arg2); + } + + @Override + public FluidTankInfo[] getTankInfo(ForgeDirection arg0) { + return new FluidTankInfo[] {this.fluidTank.getInfo()}; + } + + public static Map getRecipes() { + return recipeManager.getRecipes(); + } +} diff --git a/src/main/java/ihl/processing/metallurgy/WireMillContainer.java b/src/main/java/ihl/processing/metallurgy/WireMillContainer.java new file mode 100644 index 0000000..34f79de --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/WireMillContainer.java @@ -0,0 +1,113 @@ +package ihl.processing.metallurgy; + +import java.util.List; + +import ic2.core.ContainerBase; +import ic2.core.IC2; +import ic2.core.slot.SlotInvSlot; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.Slot; +import net.minecraftforge.fluids.FluidStack; + +public class WireMillContainer extends ContainerBase { + + public WireMillTileEntity tileEntity; + public int lastProgress = -1; + private short lastEnergy = -1; + public int lastFluidAmount = -1; + public int lastNumberOfFluids = -1; + public int lastFluidAmount2 = -1; + public int lastNumberOfFluids2 = -1; + public int lastFluidAmount3 = -1; + public int lastNumberOfFluids3 = -1; + private final static int height=166; + public List fluidTankFluidList; + public List fluidTankFluidList2; + public List fluidTankFluidList3; + + public WireMillContainer(EntityPlayer entityPlayer, + WireMillTileEntity lathePart1TileEntity) { + super(lathePart1TileEntity); + tileEntity=lathePart1TileEntity; + fluidTankFluidList = this.tileEntity.waterFluidTank.getFluidList(); + fluidTankFluidList2 = this.tileEntity.oilFluidTank.getFluidList(); + fluidTankFluidList3 = this.tileEntity.metalFluidTank.getFluidList(); + 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(tileEntity.dice, 0, 99+18, 31)); + 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.dischargeSlot,0, 8, 14)); + } + + @Override + public void detectAndSendChanges() + { + super.detectAndSendChanges(); + for (int i = 0; i < this.crafters.size(); ++i) + { + ICrafting icrafting = (ICrafting)this.crafters.get(i); + if (this.tileEntity.progress != this.lastProgress) + { + icrafting.sendProgressBarUpdate(this, 0, this.tileEntity.progress); + } + if (this.tileEntity.getEnergy() != this.lastEnergy) + { + icrafting.sendProgressBarUpdate(this, 1, this.tileEntity.getEnergy()); + } + + if (this.tileEntity.waterFluidTank.getFluidAmount() != this.lastFluidAmount || this.tileEntity.waterFluidTank.getNumberOfFluids() != this.lastNumberOfFluids) + { + IC2.network.get().sendContainerField(this, "fluidTankFluidList"); + } + + if (this.tileEntity.oilFluidTank.getFluidAmount() != this.lastFluidAmount2 || this.tileEntity.oilFluidTank.getNumberOfFluids() != this.lastNumberOfFluids2) + { + IC2.network.get().sendContainerField(this, "fluidTankFluidList2"); + } + + if (this.tileEntity.metalFluidTank.getFluidAmount() != this.lastFluidAmount3 || this.tileEntity.metalFluidTank.getNumberOfFluids() != this.lastNumberOfFluids3) + { + IC2.network.get().sendContainerField(this, "fluidTankFluidList3"); + } + } + this.lastNumberOfFluids = this.tileEntity.waterFluidTank.getNumberOfFluids(); + this.lastFluidAmount = this.tileEntity.waterFluidTank.getFluidAmount(); + this.lastNumberOfFluids2 = this.tileEntity.oilFluidTank.getNumberOfFluids(); + this.lastFluidAmount2 = this.tileEntity.oilFluidTank.getFluidAmount(); + this.lastNumberOfFluids3 = this.tileEntity.metalFluidTank.getNumberOfFluids(); + this.lastFluidAmount3 = this.tileEntity.metalFluidTank.getFluidAmount(); + this.lastProgress = this.tileEntity.progress; + this.lastEnergy = (short) this.tileEntity.getEnergy(); + } + + @Override + public void updateProgressBar(int index, int value) + { + super.updateProgressBar(index, value); + switch (index) + { + case 0: + this.tileEntity.progress=(short) value; + break; + case 1: + this.tileEntity.setEnergy(value); + break; + } + } + +} diff --git a/src/main/java/ihl/processing/metallurgy/WireMillGui.java b/src/main/java/ihl/processing/metallurgy/WireMillGui.java new file mode 100644 index 0000000..8a3d583 --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/WireMillGui.java @@ -0,0 +1,68 @@ +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; + +public class WireMillGui extends GuiContainer { + + private WireMillContainer container; + protected static final ResourceLocation tex = new ResourceLocation("ihl", "textures/gui/GUIWireMill.png"); + + public WireMillGui(WireMillContainer 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.getEnergy() > 0D) + { + 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.9F); + i1 = Math.min(this.container.tileEntity.getGUIEnergy(12),12); + this.drawTexturedModalRect(27, 15 + 12 - i1, 176, 12 - i1, 14, i1 + 2); + } + if (this.container.tileEntity.progress > 0) + { + i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(18),18); + this.drawTexturedModalRect(134, 33, 198, 0, i1 + 1, 13); + } + if (this.container.tileEntity.oilFluidTank.getFluid()!=null && this.container.tileEntity.oilFluidTank.getFluidAmount() > 0) + { + IHLRenderUtils.instance.renderIHLFluidTank(this.container.tileEntity.oilFluidTank, 81, 16, 93, 63, zLevel, par1, par2, xOffset, yOffset); + } + if (this.container.tileEntity.waterFluidTank.getFluid()!=null && this.container.tileEntity.waterFluidTank.getFluidAmount() > 0) + { + IHLRenderUtils.instance.renderIHLFluidTank(this.container.tileEntity.waterFluidTank, 64, 16, 76, 63, zLevel, par1, par2, xOffset, yOffset); + } + if (this.container.tileEntity.metalFluidTank.getFluid()!=null && this.container.tileEntity.metalFluidTank.getFluidAmount() > 0) + { + IHLRenderUtils.instance.renderIHLFluidTank(this.container.tileEntity.metalFluidTank, 98, 16, 110, 63, zLevel, par1, par2, xOffset, yOffset); + } + + this.mc.renderEngine.bindTexture(tex); + IHLRenderUtils.instance.drawTooltip(par1,par2,9,11,xOffset,yOffset,StatCollector.translateToLocal("ihl.wiremill.tip")); + } + + @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); + } +} diff --git a/src/main/java/ihl/processing/metallurgy/WireMillTileEntity.java b/src/main/java/ihl/processing/metallurgy/WireMillTileEntity.java new file mode 100644 index 0000000..d93eb4f --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/WireMillTileEntity.java @@ -0,0 +1,378 @@ +package ihl.processing.metallurgy; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +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.InvSlot.Access; +import ic2.core.block.invslot.InvSlotConsumableLiquid; +import ic2.core.block.invslot.InvSlotOutput; +import ihl.IHLMod; +import ihl.items_blocks.IHLTool; +import ihl.processing.chemistry.ApparatusProcessableInvSlot; +import ihl.processing.invslots.InvSlotConsumableLiquidIHL; +import ihl.recipes.IRecipeInputFluid; +import ihl.recipes.RecipeInputDie; +import ihl.recipes.RecipeInputFluidDictionary; +import ihl.recipes.RecipeInputFluidStack; +import ihl.recipes.UniversalRecipeInput; +import ihl.recipes.UniversalRecipeManager; +import ihl.recipes.UniversalRecipeOutput; +import ihl.utils.IHLFluidTank; +import ihl.utils.IHLUtils; +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; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidHandler; + +public class WireMillTileEntity extends BasicElectricMotorTileEntity implements IFluidHandler{ + + public final ApparatusProcessableInvSlot dice; + public final InvSlotConsumableLiquidIHL fillInputSlot; + public final InvSlotConsumableLiquidIHL drainInputSlot; + public final InvSlotOutput emptyFluidItemsSlot; + public final IHLFluidTank oilFluidTank = new IHLFluidTank(1100); + public final IHLFluidTank waterFluidTank = new IHLFluidTank(1100); + public final IHLFluidTank metalFluidTank = new IHLFluidTank(1100); + protected static final UniversalRecipeManager recipeManager = new UniversalRecipeManager("wiremill"); + protected static final UniversalRecipeManager recipeManagerMelting = new UniversalRecipeManager("wiremillMelting"); + + public WireMillTileEntity() + { + super(); + emptyFluidItemsSlot = new InvSlotOutput(this, "emptyWaterFluidItemsSlot", 2, 1); + 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.operationLength=600; + } + + + @Override + public String getInventoryName() { + return "WireMill"; + } + + @Override + public ItemStack getWrenchDrop(EntityPlayer player) + { + return IHLUtils.getThisModItemStack("wireMill"); + } + + @Override + @SideOnly(Side.CLIENT) + public GuiScreen getGui(EntityPlayer player, boolean arg1) + { + return new WireMillGui(new WireMillContainer(player, this)); + } + + @Override + public ContainerBase getGuiContainer(EntityPlayer player) + { + return new WireMillContainer(player, this); + } + + @Override + public void operate() + { + UniversalRecipeInput rInput = WireMillTileEntity.recipeManager.getRecipeInput(getInput()); + IRecipeInput rInputDice = rInput.getItemInputs().get(0); + UniversalRecipeOutput rOutput = this.getOutput(); + ItemStack rOutputItemStack=null; + if(!rOutput.getItemOutputs().isEmpty()) + { + rOutputItemStack = rOutput.getItemOutputs().get(0).itemStack.copy(); + } + List rInputFluidStacks = rInput.getFluidInputs(); + int consumeMoltenMetalAmount=1; + if(!rInputFluidStacks.isEmpty() && rOutputItemStack!=null && rInputDice!=null && rInputDice instanceof RecipeInputDie) + { + if(rInputFluidStacks.size()>=3) + { + consumeMoltenMetalAmount=rInputFluidStacks.get(2).getAmount(); + } + else + { + consumeMoltenMetalAmount=rInputFluidStacks.get(0).getAmount(); + } + if(rOutputItemStack!=null && rInputDice!=null && rInputDice instanceof RecipeInputDie) + { + consumeMoltenMetalAmount*=((RecipeInputDie)rInputDice).transformOutput(this.dice.get(), rOutputItemStack); + } + } + if(dice.get()!=null) + { + if(dice.get().getItem() instanceof IHLTool) + { + IHLUtils.damageItemViaNBTTag(dice.get(), 1); + if(dice.get().stackSize<=0) + { + dice.put(null); + } + } + else + { + dice.consume(rInputDice); + } + } + if(this.drainInputSlot.get()!=null && !rInput.getItemInputs().isEmpty() && rInput.getItemInputs().get(0).matches(this.drainInputSlot.get())) + { + this.drainInputSlot.consume(1); + } + if(!rOutput.getFluidOutputs().isEmpty()) + { + this.metalFluidTank.fill(rOutput.getFluidOutputs().get(0), true); + } + 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) + { + if(!rInputFluidStacks.isEmpty()) + { + this.oilFluidTank.drain(1, true); + this.waterFluidTank.drain(1, true); + this.metalFluidTank.drain(consumeMoltenMetalAmount, true); + } + ((IProductionLine)te).process(rOutputItemStack); + } + } + + @SuppressWarnings({ "rawtypes", "unchecked" }) + @Override + public List[] getInput() + { + return new List[]{Arrays.asList(new FluidStack[] {this.oilFluidTank.getFluid(),this.waterFluidTank.getFluid(),this.metalFluidTank.getFluid()}),Arrays.asList(new ItemStack[] {dice.get(),drainInputSlot.get()})}; + } + + public UniversalRecipeOutput getOutput() + { + return WireMillTileEntity.recipeManager.getOutputFor(this.getInput()); + } + + public static void addRecipe(FluidStack moltenMetal, IRecipeInput inputDice,ItemStack output1) + { + 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, (new IRecipeInput [] {new RecipeInputOreDict(string)})),new UniversalRecipeOutput((new FluidStack[] {fluidStack}),null,200)); + } + + + @Override + public boolean canOperate() + { + UniversalRecipeOutput output = this.getOutput(); + if(output!=null) + { + 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(te instanceof IProductionLine && !output.getItemOutputs().isEmpty()) + { + ItemStack isOut=this.getOutput().getItemOutputs().get(0).itemStack.copy(); + if(this.dice.get()!=null) + { + isOut.stackTagCompound.setInteger("transverseSection", this.dice.get().stackTagCompound.getInteger("transverseSection")); + } + return ForgeDirection.getOrientation(((IProductionLine)te).getFacing()).equals(dir) && ((IProductionLine)te).canProcess(isOut); + } + else if(!output.getFluidOutputs().isEmpty()) + { + FluidStack fstack = output.getFluidOutputs().get(0); + return metalFluidTank.fill(fstack, false)==fstack.amount; + } + } + return false; + } + + @Override + public void readFromNBT(NBTTagCompound nbttagcompound) + { + super.readFromNBT(nbttagcompound); + this.oilFluidTank.readFromNBT(nbttagcompound.getCompoundTag("oilFluidTank")); + this.waterFluidTank.readFromNBT(nbttagcompound.getCompoundTag("waterFluidTank")); + this.metalFluidTank.readFromNBT(nbttagcompound.getCompoundTag("metalFluidTank")); + } + + @Override + public void writeToNBT(NBTTagCompound nbttagcompound) + { + super.writeToNBT(nbttagcompound); + NBTTagCompound oilFluidTankTag = new NBTTagCompound(); + this.oilFluidTank.writeToNBT(oilFluidTankTag); + nbttagcompound.setTag("oilFluidTank", oilFluidTankTag); + NBTTagCompound waterFluidTankTag = new NBTTagCompound(); + this.waterFluidTank.writeToNBT(waterFluidTankTag); + nbttagcompound.setTag("waterFluidTank", waterFluidTankTag); + NBTTagCompound metalFluidTankTag = new NBTTagCompound(); + this.metalFluidTank.writeToNBT(metalFluidTankTag); + nbttagcompound.setTag("metalFluidTank", metalFluidTankTag); + } + + @Override + public void updateEntityServer() + { + super.updateEntityServer(); + FluidStack drainSlotContent = drainInputSlot.drain(null, Integer.MAX_VALUE, null, true); + if(drainSlotContent!=null) + { + String fluidDictionaryName = IHLMod.fluidDictionary.getFluidName(drainSlotContent.getFluid()); + if(fluidDictionaryName!=null && fluidDictionaryName.equals("lubricant")) + { + IHLUtils.handleFluidSlotsBehaviour(fillInputSlot, drainInputSlot, emptyFluidItemsSlot, oilFluidTank); + } + else if(fluidDictionaryName!=null && fluidDictionaryName.equals("water")) + { + IHLUtils.handleFluidSlotsBehaviour(fillInputSlot, drainInputSlot, emptyFluidItemsSlot, waterFluidTank); + } + else + { + IHLUtils.handleFluidSlotsBehaviour(fillInputSlot, drainInputSlot, emptyFluidItemsSlot, metalFluidTank); + } + } + else + { + if(metalFluidTank.getNumberOfFluids()>0) + { + IHLUtils.handleFluidSlotsBehaviour(fillInputSlot, drainInputSlot, emptyFluidItemsSlot, metalFluidTank); + } + else if(oilFluidTank.getNumberOfFluids()>0) + { + IHLUtils.handleFluidSlotsBehaviour(fillInputSlot, drainInputSlot, emptyFluidItemsSlot, oilFluidTank); + } + else + { + IHLUtils.handleFluidSlotsBehaviour(fillInputSlot, drainInputSlot, emptyFluidItemsSlot, waterFluidTank); + } + } + + } + public int gaugeLiquidScaled(int i) { + if(this.oilFluidTank.getFluid()!=null) + { + return this.oilFluidTank.getFluidAmount() * i /this.oilFluidTank.getCapacity(); + } + else + { + return 0; + } + } + + @Override + public int gaugeProgressScaled(int i) + { + return this.progress * i / this.operationLength; + } + + public int gaugeWaterScaled(int i) + { + if(this.waterFluidTank.getFluid()!=null) + { + return this.waterFluidTank.getFluidAmount() * i /this.waterFluidTank.getCapacity(); + } + else + { + return 0; + } + } + + public static Map getRecipes() + { + return recipeManager.getRecipes(); + } + + + @Override + public boolean canDrain(ForgeDirection arg0, Fluid arg1) { + return true; + } + + + @Override + public boolean canFill(ForgeDirection arg0, Fluid arg1) { + return true; + } + + + @Override + public FluidStack drain(ForgeDirection direction, FluidStack arg1, boolean arg2) + { + if(direction.equals(ForgeDirection.DOWN)) + { + return this.metalFluidTank.drain(arg1, arg2); + } + else if(direction.equals(ForgeDirection.UP)) + { + return this.waterFluidTank.drain(arg1, arg2); + } + else + { + return this.oilFluidTank.drain(arg1, arg2); + } + } + + + @Override + public FluidStack drain(ForgeDirection direction, int arg1, boolean arg2) + { + if(direction.equals(ForgeDirection.DOWN)) + { + return this.metalFluidTank.drain(arg1, arg2); + } + else if(direction.equals(ForgeDirection.UP)) + { + return this.waterFluidTank.drain(arg1, arg2); + } + else + { + return this.oilFluidTank.drain(arg1, arg2); + } + } + + + @Override + public int fill(ForgeDirection direction, FluidStack arg1, boolean arg2) + { + if(direction.equals(ForgeDirection.DOWN)) + { + return this.metalFluidTank.fill(arg1, arg2); + } + else if(direction.equals(ForgeDirection.UP)) + { + return this.waterFluidTank.fill(arg1, arg2); + } + else + { + return this.oilFluidTank.fill(arg1, arg2); + } + } + + @Override + public FluidTankInfo[] getTankInfo(ForgeDirection direction) + { + if(direction.equals(ForgeDirection.DOWN)) + { + return new FluidTankInfo[] {this.metalFluidTank.getInfo()}; + } + else if(direction.equals(ForgeDirection.UP)) + { + return new FluidTankInfo[] {this.waterFluidTank.getInfo()}; + } + else + { + return new FluidTankInfo[] {this.oilFluidTank.getInfo()}; + } + } +} diff --git a/src/main/java/ihl/processing/metallurgy/WoodenRollingMachineContainer.java b/src/main/java/ihl/processing/metallurgy/WoodenRollingMachineContainer.java new file mode 100644 index 0000000..ba191f8 --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/WoodenRollingMachineContainer.java @@ -0,0 +1,77 @@ +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 WoodenRollingMachineContainer extends ContainerBase { + + public WoodenRollingMachinePart1TileEntity tileEntity; + public int lastProgress = -1; + private short lastEnergy = -1; + private final static int height=166; + + public WoodenRollingMachineContainer(EntityPlayer entityPlayer, + WoodenRollingMachinePart1TileEntity lathePart1TileEntity) { + super(lathePart1TileEntity); + tileEntity=lathePart1TileEntity; + 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(lathePart1TileEntity.output, 0, 54, 25)); + 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.dischargeSlot,0, 22, 55)); + } + + @Override + public void detectAndSendChanges() + { + super.detectAndSendChanges(); + for (int i = 0; i < this.crafters.size(); ++i) + { + ICrafting icrafting = (ICrafting)this.crafters.get(i); + if (this.tileEntity.progress != this.lastProgress) + { + icrafting.sendProgressBarUpdate(this, 0, this.tileEntity.progress); + } + if (this.tileEntity.getEnergy() != this.lastEnergy) + { + icrafting.sendProgressBarUpdate(this, 1, this.tileEntity.getEnergy()); + } + } + this.lastProgress = this.tileEntity.progress; + this.lastEnergy = (short) this.tileEntity.getEnergy(); + } + + @Override + public void updateProgressBar(int index, int value) + { + super.updateProgressBar(index, value); + + switch (index) + { + case 0: + this.tileEntity.progress=(short) value; + break; + case 1: + this.tileEntity.setEnergy(value); + break; + } + } + +} diff --git a/src/main/java/ihl/processing/metallurgy/WoodenRollingMachineGui.java b/src/main/java/ihl/processing/metallurgy/WoodenRollingMachineGui.java new file mode 100644 index 0000000..085dae5 --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/WoodenRollingMachineGui.java @@ -0,0 +1,60 @@ +package ihl.processing.metallurgy; + +import org.lwjgl.opengl.GL11; + +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.util.ResourceLocation; + +public class WoodenRollingMachineGui extends GuiContainer { + + private WoodenRollingMachineContainer container; + protected static final ResourceLocation tex = new ResourceLocation("ihl", "textures/gui/GUIWoodenRollingMachine.png"); + + public WoodenRollingMachineGui(WoodenRollingMachineContainer latheContainer) { + super(latheContainer); + container = latheContainer; + } + + + @Override + protected void drawGuiContainerForegroundLayer(int par1, int par2) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.renderEngine.bindTexture(tex); + int i1; + if (this.container.tileEntity.getEnergy() > 0D) + { + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + 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.progress > 0) + { + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(27),27); + this.drawTexturedModalRect(18, 22, getFrameX(i1), getFrameY(i1),24,24); + } + } + + @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); + } + + private int getFrameY(int number) + { + return (number % 10) * 24 + 14; + } + + private int getFrameX(int number) + { + return (number / 10) * 24 + 176; + } +} diff --git a/src/main/java/ihl/processing/metallurgy/WoodenRollingMachinePart1Model.java b/src/main/java/ihl/processing/metallurgy/WoodenRollingMachinePart1Model.java new file mode 100644 index 0000000..ac7799b --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/WoodenRollingMachinePart1Model.java @@ -0,0 +1,122 @@ +// Date: 15.02.2015 11:28:39 +// Template version 1.1 +// Java generated by Techne +// Keep in mind that you still need to fill in some blanks +// - ZeuX + +package ihl.processing.metallurgy; + +import ihl.model.IHLModelRenderer; +import net.minecraft.client.model.ModelBase; +import net.minecraftforge.common.util.ForgeDirection; + +public class WoodenRollingMachinePart1Model extends ModelBase +{ + //fields + IHLModelRenderer Base; + IHLModelRenderer RotatingPart2; + IHLModelRenderer MotorPart1; + IHLModelRenderer MotorPart2; + IHLModelRenderer RotatingPart1; + IHLModelRenderer RotatingPart3; + IHLModelRenderer RotatingPart4; + IHLModelRenderer Belt1; + IHLModelRenderer Belt2; + + public WoodenRollingMachinePart1Model() + { + textureWidth = 64; + textureHeight = 32; + setTextureOffset("Base.Shape6", 0, 15); + setTextureOffset("Base.Shape16", 0, 23); + setTextureOffset("Base.PipeN18", 0, 0); + setTextureOffset("Base.PipeN19", 0, 0); + setTextureOffset("RotatingPart2.PipeN17", 0, 0); + setTextureOffset("RotatingPart2.PipeN21", 0, 0); + setTextureOffset("RotatingPart2.PipeN25", 0, 0); + setTextureOffset("MotorPart1.PipeN41", 0, 0); + setTextureOffset("MotorPart1.PipeN13", 0, 0); + setTextureOffset("MotorPart1.PipeN12", 0, 0); + setTextureOffset("MotorPart1.PipeN16", 0, 0); + setTextureOffset("MotorPart2.Shape4", 0, 24); + setTextureOffset("MotorPart2.Shape7", 0, 9); + setTextureOffset("MotorPart2.Shape10", 0, 9); + setTextureOffset("RotatingPart1.PipeN27", 0, 0); + setTextureOffset("RotatingPart1.PipN119", 0, 0); + setTextureOffset("RotatingPart1.pipeN24", 0, 0); + setTextureOffset("RotatingPart3.PipeN23", 0, 0); + setTextureOffset("RotatingPart3.PipeN22", 0, 0); + setTextureOffset("RotatingPart3.PipeN26", 0, 0); + setTextureOffset("RotatingPart4.PipeN28", 0, 0); + setTextureOffset("Belt1.Shape12", 60, 0); + setTextureOffset("Belt2.Shape17", 60, 0); + + Base = new IHLModelRenderer(this, "Base"); + Base.setRotationPoint(0F, 16F, 0F); + setRotation(Base, 0F, 0F, 0F); + Base.mirror = true; + Base.addBox("Shape6", -8F, 7F, -8F, 16, 1, 16); + Base.addBox("Shape16", -6F, -1F, -7F, 12, 8, 1); + Base.addTube("PipeN18", -5F, -6.1F, -7.1F, 10, 10, 1, 0.9F,1F,ForgeDirection.NORTH); + Base.addTube("PipeN19", -1.5F, -6F, -7F, 3, 3, 1, 0.25F,1F,ForgeDirection.NORTH);; + RotatingPart2 = new IHLModelRenderer(this, "RotatingPart2"); + RotatingPart2.setRotationPoint(-2.2F, 16F, -8F); + setRotation(RotatingPart2, 0F, 0F, 0F); + RotatingPart2.mirror = true; + RotatingPart2.addTube("PipeN17", -2F, -2F, 2F, 4, 4, 28, 0F,1F,ForgeDirection.NORTH); + RotatingPart2.addTube("PipeN21", -0.5F, -0.5F, 0F, 1, 1, 1, 0F,1F,ForgeDirection.NORTH); + RotatingPart2.addTube("PipeN25", -0.5F, -0.5F, 30F, 1, 1, 2, 0F,1F,ForgeDirection.NORTH); + MotorPart1 = new IHLModelRenderer(this, "MotorPart1"); + MotorPart1.setRotationPoint(4.5F, 20.5F, 0F); + setRotation(MotorPart1, 0F, 0F, 0F); + MotorPart1.mirror = true; + MotorPart1.addTube("PipeN41", -1.5F, -1.5F, -8F, 3, 3, 1, 0F,1F,ForgeDirection.NORTH); + MotorPart1.addTube("PipeN12", -0.5F, -0.5F, -7F, 1, 1, 1, 0F,1F,ForgeDirection.NORTH); + MotorPart1.addTube("PipeN13", -1.5F, -1.5F, -5F, 3, 3, 5, 0F,1F,ForgeDirection.NORTH); + MotorPart2 = new IHLModelRenderer(this, "MotorPart2"); + MotorPart2.setRotationPoint(0F, 16F, 0F); + setRotation(MotorPart2, 0F, 0F, 0F); + MotorPart2.mirror = true; + MotorPart2.addBox("Shape4", 3F, 3F, 0F, 3, 4, 4); + MotorPart2.addBox("Shape7", 6F, 3F, -5F, 2, 4, 5); + MotorPart2.addBox("Shape10", 1F, 3F, -5F, 2, 4, 5); + RotatingPart1 = new IHLModelRenderer(this, "RotatingPart1"); + RotatingPart1.setRotationPoint(0F, 11.5F, -6F); + setRotation(RotatingPart1, 0F, 0F, 0F); + RotatingPart1.mirror = true; + RotatingPart1.addTube("PipeN27", -2F, -2F, 0F, 4, 4, 28, 0F,1F,ForgeDirection.NORTH); + RotatingPart1.addTube("PipN119", -0.5F, -0.5F, -2F, 1, 1, 2, 0F,1F,ForgeDirection.NORTH); + RotatingPart1.addTube("pipeN24", -0.5F, -0.5F, 28F, 1, 1, 2, 0F,1F,ForgeDirection.NORTH); + RotatingPart3 = new IHLModelRenderer(this, "RotatingPart3"); + RotatingPart3.setRotationPoint(2.2F, 16F, -8F); + setRotation(RotatingPart3, 0F, 0F, 0F); + RotatingPart3.mirror = true; + RotatingPart3.addTube("PipeN23", -2F, -2F, 2F, 4, 4, 28, 0F,1F,ForgeDirection.NORTH); + RotatingPart3.addTube("PipeN22", -1.5F, -1.5F, 0F, 3, 3, 1, 0F,1F,ForgeDirection.NORTH); + RotatingPart3.addTube("PipeN26", -0.5F, -0.5F, 30F, 1, 1, 2, 0F,1F,ForgeDirection.NORTH); + RotatingPart4 = new IHLModelRenderer(this, "RotatingPart4"); + RotatingPart4.setRotationPoint(0F, 15F, -5F); + setRotation(RotatingPart3, 0F, 0F, 0F); + RotatingPart4.mirror = true; + RotatingPart4.addTube("PipeN28", -0.5F, -0.5F, 0F, 1, 1, 27, 0F,1F,ForgeDirection.NORTH); + Belt1 = new IHLModelRenderer(this, "Belt1"); + Belt1.setRotationPoint(2.5F, 16F, -7.9F); + setRotation(Belt1, 0F, 0F, -0.45F); + Belt1.mirror = true; + Belt1.addBox("Shape12", 0F, 0F, 0F, 1, 5, 1); + Belt2 = new IHLModelRenderer(this, "Belt2"); + Belt2.setRotationPoint(2F, 16F, -7.9F); + setRotation(Belt2, 0F, 0F, -0.45F); + Belt2.mirror = true; + Belt2.addBox("Shape17", -1F, 0F, 0F, 1, 6, 1); + } + + + private void setRotation(IHLModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + +} diff --git a/src/main/java/ihl/processing/metallurgy/WoodenRollingMachinePart1TileEntity.java b/src/main/java/ihl/processing/metallurgy/WoodenRollingMachinePart1TileEntity.java new file mode 100644 index 0000000..857575a --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/WoodenRollingMachinePart1TileEntity.java @@ -0,0 +1,158 @@ +package ihl.processing.metallurgy; + +import java.util.List; +import java.util.Map; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ic2.api.recipe.IRecipeInput; +import ic2.api.recipe.RecipeInputItemStack; +import ic2.api.recipe.RecipeInputOreDict; +import ic2.core.ContainerBase; +import ic2.core.IC2; +import ic2.core.block.invslot.InvSlot.Access; +import ihl.processing.chemistry.ApparatusProcessableInvSlot; +import ihl.processing.invslots.IHLInvSlotOutput; +import ihl.recipes.RecipeOutputItemStack; +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 net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + +public class WoodenRollingMachinePart1TileEntity extends BasicElectricMotorTileEntity{ + + public final ApparatusProcessableInvSlot input; + public final IHLInvSlotOutput output; + public boolean assembled; + protected static final UniversalRecipeManager recipeManager = new UniversalRecipeManager("woodenrollingmachine"); + + public WoodenRollingMachinePart1TileEntity() + { + super(); + input = new ApparatusProcessableInvSlot(this, "input", 1, Access.IO, 3, 64); + output = new IHLInvSlotOutput(this, "output", 2, 1); + } + + public UniversalRecipeOutput getOutput() + { + return WoodenRollingMachinePart1TileEntity.recipeManager.getOutputFor(this.getInput()); + } + + @Override + public List getNetworkedFields() + { + List fields = super.getNetworkedFields(); + fields.add("assembled"); + return fields; + } + + + @Override + public String getInventoryName() { + return "WoodenRollingMachine"; + } + + @Override + public void updateEntityServer() + { + super.updateEntityServer(); + if(assembled && !this.checkCorrectAccembly()) + { + assembled=false; + IC2.network.get().updateTileEntityField(this, "assembled"); + } + else if(!assembled && this.checkCorrectAccembly()) + { + assembled=true; + IC2.network.get().updateTileEntityField(this, "assembled"); + } + if (this.getActive() && this.progress == 0 && !this.canOperate()) + { + this.setActive(false); + } + + if (!this.getActive() && this.progress>0 && this.canOperate()) + { + this.setActive(true); + } + + } + + @Override + public ItemStack getWrenchDrop(EntityPlayer player) + { + return IHLUtils.getThisModItemStack("woodenRollingMachinePart1"); + } + + @Override + @SideOnly(Side.CLIENT) + public GuiScreen getGui(EntityPlayer player, boolean arg1) { + return new WoodenRollingMachineGui(new WoodenRollingMachineContainer(player, this)); + } + + @Override + public ContainerBase getGuiContainer(EntityPlayer player) { + return new WoodenRollingMachineContainer(player, this); + } + + @Override + public void operate() + { + List rInput = WoodenRollingMachinePart1TileEntity.recipeManager.getRecipeInput(getInput()).getItemInputs(); + List rOutput = WoodenRollingMachinePart1TileEntity.recipeManager.getOutputFor(getInput()).getItemOutputs(); + this.output.add(rOutput); + for(int i=0;i getRecipes() { + return recipeManager.getRecipes(); + } + + public static void addRecipe(RecipeInputOreDict recipeInputOreDict, RecipeInputOreDict recipeInputOreDict2, ItemStack output) + { + recipeManager.addRecipe(new UniversalRecipeInput(null, (new IRecipeInput[] {recipeInputOreDict,recipeInputOreDict2})), new UniversalRecipeOutput(null,(new ItemStack[] {output}),20)); + } + + @Override + public boolean shouldRenderInPass(int pass) + { + return pass==0; + } + +} diff --git a/src/main/java/ihl/processing/metallurgy/WoodenRollingMachinePart2Model.java b/src/main/java/ihl/processing/metallurgy/WoodenRollingMachinePart2Model.java new file mode 100644 index 0000000..6ebc58e --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/WoodenRollingMachinePart2Model.java @@ -0,0 +1,44 @@ +// Date: 15.02.2015 11:31:12 +// Template version 1.1 +// Java generated by Techne +// Keep in mind that you still need to fill in some blanks +// - ZeuX + +package ihl.processing.metallurgy; + +import ihl.model.IHLModelRenderer; +import net.minecraft.client.model.ModelBase; +import net.minecraftforge.common.util.ForgeDirection; + +public class WoodenRollingMachinePart2Model extends ModelBase +{ + //fields + IHLModelRenderer Base; + + public WoodenRollingMachinePart2Model() + { + textureWidth = 64; + textureHeight = 32; + setTextureOffset("Base.Shape6", 0, 15); + setTextureOffset("Base.Shape16", 0, 23); + setTextureOffset("Base.PipeN18", 0, 0); + setTextureOffset("Base.PipeN19", 0, 0); + + Base = new IHLModelRenderer(this, "Base"); + Base.setRotationPoint(0F, 16F, 0F); + setRotation(Base, 0F, 0F, 0F); + Base.mirror = true; + Base.addBox("Shape6", -8F, 7F, -8F, 16, 1, 16); + Base.addBox("Shape16", -6F, -1F, 6F, 12, 8, 1); + Base.addTube("PipeN18", -5F, -6.1F, 6.1F, 10, 10, 1, 0.9F,1F,ForgeDirection.NORTH); + Base.addTube("PipeN19", -1.5F, -6F, 6F, 3, 3, 1, 0.25F,1F,ForgeDirection.NORTH);; + } + + private void setRotation(IHLModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + +} diff --git a/src/main/java/ihl/processing/metallurgy/WoodenRollingMachinePart2TileEntity.java b/src/main/java/ihl/processing/metallurgy/WoodenRollingMachinePart2TileEntity.java new file mode 100644 index 0000000..9aec41b --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/WoodenRollingMachinePart2TileEntity.java @@ -0,0 +1,104 @@ +package ihl.processing.metallurgy; + +import java.util.ArrayList; +import java.util.List; + +import ic2.api.network.INetworkDataProvider; +import ic2.api.tile.IWrenchable; +import ic2.core.IC2; +import ihl.utils.IHLUtils; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; + +public class WoodenRollingMachinePart2TileEntity extends TileEntity implements IWrenchable, INetworkDataProvider{ + + private short facing=2; + private short lastFacing=2; + + public WoodenRollingMachinePart2TileEntity() + { + super(); + } + + public boolean enableUpdateEntity() + { + return IC2.platform.isSimulating(); + } + + @Override + public List getNetworkedFields() + { + List fields = new ArrayList(); + fields.add("facing"); + return fields; + } + + @Override + public void updateEntity() + { + super.updateEntity(); + if(lastFacing!=facing) + { + IC2.network.get().updateTileEntityField(this, "facing"); + lastFacing=facing; + } + } + + + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { + return this.getFacing()!=side; + } + + + @Override + public short getFacing() { + return this.facing; + } + + + @Override + public void setFacing(short facing1) + { + facing=(short) Math.max(2,facing1); + if(IC2.platform.isSimulating()) + { + IC2.network.get().updateTileEntityField(this, "facing"); + } + } + + + @Override + public boolean wrenchCanRemove(EntityPlayer entityPlayer) { + return true; + } + + + @Override + public float getWrenchDropRate() { + return 1F; + } + + + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { + return IHLUtils.getThisModItemStack("woodenRollingMachinePart2"); + } + + @Override + public void readFromNBT(NBTTagCompound nbttagcompound) + { + super.readFromNBT(nbttagcompound); + facing=nbttagcompound.getShort("facing"); + } + + @Override + public void writeToNBT(NBTTagCompound nbttagcompound) + { + super.writeToNBT(nbttagcompound); + nbttagcompound.setShort("facing", facing); + } + +} diff --git a/src/main/java/ihl/processing/metallurgy/WoodenRollingMachineRender.java b/src/main/java/ihl/processing/metallurgy/WoodenRollingMachineRender.java new file mode 100644 index 0000000..f180f75 --- /dev/null +++ b/src/main/java/ihl/processing/metallurgy/WoodenRollingMachineRender.java @@ -0,0 +1,91 @@ +package ihl.processing.metallurgy; +import org.lwjgl.opengl.GL11; + +import ic2.api.tile.IWrenchable; +import ihl.IHLModInfo; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; + +public class WoodenRollingMachineRender extends TileEntitySpecialRenderer{ +private WoodenRollingMachinePart1Model model = new WoodenRollingMachinePart1Model(); +private ResourceLocation tex = new ResourceLocation(IHLModInfo.MODID+":textures/blocks/woodenRollingMachine.png"); +private final float scale=1F/16F; + + public WoodenRollingMachineRender() {} + + + @Override + public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float par8) + { + int rotation = 0; + if(tile.getWorldObj() != null) + { + switch (((IWrenchable)tile).getFacing()) + { + case 2: + rotation = 0; + break; + case 5: + rotation = 1; + break; + case 3: + rotation = 2; + break; + case 4: + rotation = 3; + break; + default: + rotation = 0; + } + } + else + { + return; + } + WoodenRollingMachinePart1TileEntity cte = (WoodenRollingMachinePart1TileEntity)tile; + GL11.glPushMatrix(); + GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F); + GL11.glScalef(1.0F, -1F, -1F); + GL11.glRotatef(rotation*90, 0.0F, 1.0F, 0.0F); + + bindTexture(tex); + model.Base.render(scale); + if(cte.getActive()) + { + model.RotatingPart1.rotateAngleZ+=0.01F; + model.RotatingPart2.rotateAngleZ+=0.01F; + model.RotatingPart3.rotateAngleZ+=0.01F; + model.RotatingPart4.rotateAngleZ-=0.01F; + model.RotatingPart1.render(scale); + model.RotatingPart2.render(scale); + model.RotatingPart3.render(scale); + model.RotatingPart4.render(scale); + model.MotorPart1.rotateAngleZ-=0.03F; + model.MotorPart1.render(scale); + model.MotorPart2.render(scale); + model.Belt1.render(scale); + model.Belt2.render(scale); + } + else + { + model.RotatingPart1.rotateAngleZ=0.0F; + model.RotatingPart2.rotateAngleZ=0.0F; + model.RotatingPart3.rotateAngleZ=0.0F; + model.RotatingPart4.rotateAngleZ=0.0F; + if(cte.assembled) + { + model.RotatingPart1.render(scale); + model.RotatingPart2.render(scale); + model.RotatingPart3.render(scale); + model.RotatingPart4.render(scale); + } + model.MotorPart1.render(scale); + model.MotorPart2.render(scale); + model.Belt1.render(scale); + model.Belt2.render(scale); + } + GL11.glPopMatrix(); //end + + } +} \ No newline at end of file diff --git a/src/main/java/ihl/recipes/IRecipeInputFluid.java b/src/main/java/ihl/recipes/IRecipeInputFluid.java new file mode 100644 index 0000000..774973c --- /dev/null +++ b/src/main/java/ihl/recipes/IRecipeInputFluid.java @@ -0,0 +1,11 @@ +package ihl.recipes; + +import java.util.List; + +import net.minecraftforge.fluids.FluidStack; + +public interface IRecipeInputFluid { + public boolean matches(FluidStack subject); + public int getAmount(); + public List getInputs(); +} diff --git a/src/main/java/ihl/recipes/IronWorkbenchRecipe.java b/src/main/java/ihl/recipes/IronWorkbenchRecipe.java new file mode 100644 index 0000000..e471811 --- /dev/null +++ b/src/main/java/ihl/recipes/IronWorkbenchRecipe.java @@ -0,0 +1,214 @@ +package ihl.recipes; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import ic2.api.recipe.IRecipeInput; +import ic2.api.recipe.RecipeInputItemStack; +import ic2.api.recipe.RecipeInputOreDict; +import ihl.interfaces.IWire; +import ihl.utils.IHLUtils; +import net.minecraft.item.ItemStack; + +public class IronWorkbenchRecipe { + public List workspaceElements=new ArrayList(); + public List tools=new ArrayList(); + public List materials=new ArrayList(); + public List outputs = new ArrayList(); + + public IronWorkbenchRecipe(List tools1, List materials1, List output1_1) + { + if(tools1!=null) + { + Iterator iTools1 = tools1.iterator(); + while(iTools1.hasNext()) + { + Object tool = iTools1.next(); + if(tool instanceof ItemStack) + { + ItemStack stack = (ItemStack) tool; + String oreDictName = IHLUtils.getFirstOreDictNameExcludingTagAny(stack); + if(!oreDictName.isEmpty() && oreDictName.length()>3) + { + tools.add(new RecipeInputOreDict(oreDictName)); + } + else + { + tools.add(new RecipeInputItemStack(stack)); + } + } + else + { + tools.add((IRecipeInput) tool); + } + } + } + Iterator iMaterials1 = materials1.iterator(); + while(iMaterials1.hasNext()) + { + Object material = iMaterials1.next(); + if(material instanceof ItemStack) + { + ItemStack stack = (ItemStack) material; + String oreDictName = IHLUtils.getFirstOreDictNameExcludingTagAny(stack); + if(stack.getItem() instanceof IWire) + { + materials.add(new RecipeInputWire(stack)); + } + else if(!oreDictName.isEmpty() && oreDictName.length()>3) + { + materials.add(new RecipeInputOreDict(oreDictName,stack.stackSize)); + } + else + { + materials.add(new RecipeInputItemStack(stack)); + } + } + else + { + materials.add((IRecipeInput) material); + } + + } + Iterator iOutput = output1_1.iterator(); + while(iOutput.hasNext()) + { + ItemStack outputStack = iOutput.next(); + if(outputStack==null) + throw new NullPointerException("Output shall not contain null."); + this.outputs.add(outputStack); + } + if(tools.size()>8 || materials.size()>12) + { + throw new IllegalArgumentException("Iron workbench recipe cannot contain more than 8 tools or more than 12 materials!"); + } + } + + 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) + { + if(workspaceElements!=null && !workspaceElements.isEmpty()) + { + if(workspaceElements1==null||workspaceElements1.isEmpty()) + { + return false; + } + Iterator i1 = workspaceElements.iterator(); + while(i1.hasNext()) + { + ItemStack tool = i1.next(); + if(!this.isItemStackInList(tool, workspaceElements1)) + { + return false; + } + } + } + + if(tools!=null && !tools.isEmpty()) + { + if(tools1==null||tools1.isEmpty()) + { + return false; + } + Iterator i1 = tools.iterator(); + while(i1.hasNext()) + { + IRecipeInput tool = i1.next(); + if(!this.isItemStackInList(tool, tools1)) + { + return false; + } + } + } + if(materials!=null && !materials.isEmpty()) + { + Iterator i1 = materials.iterator(); + while(i1.hasNext()) + { + IRecipeInput material = i1.next(); + if(!this.isItemStackInList(material, materials1)) + { + return false; + } + } + } + return true; + } + + private boolean isItemStackInList(IRecipeInput tool, List tools1) { + Iterator it = tools1.iterator(); + while(it.hasNext()) + { + ItemStack tool2 = it.next(); + if(tool.matches(tool2)) + { + if(tool2.getItem() instanceof IWire) + { + if(IHLUtils.getWireLength(tool2)>=tool.getAmount()) + { + return true; + } + } + else if(tool2.stackSize>=tool.getAmount()) + { + return true; + } + } + } + return false; + } + + private boolean isItemStackInList(ItemStack tool, List tools1) + { + Iterator it = tools1.iterator(); + while(it.hasNext()) + { + ItemStack tool2 = it.next(); + if(IHLUtils.isItemStacksIsEqual(tool,tool2,true)) + { + if(tool2.getItem() instanceof IWire) + { + if(IHLUtils.getWireLength(tool2)>=IHLUtils.getWireLength(tool)) + { + return true; + } + } + else if(tool2.stackSize>=tool.stackSize) + { + return true; + } + } + } + return false; + } + +} diff --git a/src/main/java/ihl/recipes/RecipeInputDetonator.java b/src/main/java/ihl/recipes/RecipeInputDetonator.java new file mode 100644 index 0000000..15030fd --- /dev/null +++ b/src/main/java/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/src/main/java/ihl/recipes/RecipeInputDie.java b/src/main/java/ihl/recipes/RecipeInputDie.java new file mode 100644 index 0000000..8fbd4db --- /dev/null +++ b/src/main/java/ihl/recipes/RecipeInputDie.java @@ -0,0 +1,97 @@ +package ihl.recipes; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import ic2.api.recipe.IRecipeInput; +import ihl.interfaces.IWire; +import ihl.utils.IHLUtils; +import net.minecraft.item.ItemStack; + +public class RecipeInputDie implements IRecipeInput +{ + public final ItemStack input; + public final int transverseSection; + + public RecipeInputDie(String string, int transverseSection) + { + this(IHLUtils.getItemStackWithTag(string, "transverseSection", transverseSection)); + } + + public RecipeInputDie(ItemStack itemStack) + { + input=itemStack; + transverseSection=itemStack.stackTagCompound.getInteger("transverseSection"); + } + + @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("transverseSection"); + ItemStack material; + for(ItemStack material1:outputs) + { + if(material1.getItem() instanceof IWire) + { + material=material1.copy(); + int length = material.stackTagCompound.getInteger("length"); + length = length * transverseSection / misTS; + material.stackTagCompound.setInteger("length", length); + material.stackTagCompound.setInteger("fullLength", length); + material.stackTagCompound.setInteger("transverseSection", misTS); + newOutputs.add(material); + } + else + { + newOutputs.add(material1); + } + } + return newOutputs; + } + + public int transformOutput(ItemStack matchedItemStack, ItemStack material) + { + int consumeAmountMultiplier=1; + int misTS = matchedItemStack.stackTagCompound.getInteger("transverseSection"); + if(misTS<=transverseSection) + { + int length = material.stackTagCompound.getInteger("length"); + length = length * transverseSection / misTS; + material.stackTagCompound.setInteger("length", length); + material.stackTagCompound.setInteger("fullLength", length); + } + else + { + consumeAmountMultiplier=misTS/transverseSection+1; + } + material.stackTagCompound.setInteger("transverseSection", misTS); + return consumeAmountMultiplier; + } +} + diff --git a/src/main/java/ihl/recipes/RecipeInputFluidDictionary.java b/src/main/java/ihl/recipes/RecipeInputFluidDictionary.java new file mode 100644 index 0000000..eb5b057 --- /dev/null +++ b/src/main/java/ihl/recipes/RecipeInputFluidDictionary.java @@ -0,0 +1,46 @@ +package ihl.recipes; + +import java.util.List; + +import ihl.IHLMod; +import net.minecraftforge.fluids.FluidStack; + +public class RecipeInputFluidDictionary implements IRecipeInputFluid +{ + private final String input; + private final int amount; + public RecipeInputFluidDictionary(String input1, int amount1) + { + this.input=input1; + this.amount=amount1; + } + + @Override + public boolean matches(FluidStack subject) + { + if(subject==null) + { + return false; + } + String fName = IHLMod.fluidDictionary.getFluidName(subject.getFluid()); + return fName==null?false:fName.equals(input); + } + + @Override + public int getAmount() { + return amount; + } + + @Override + public List getInputs() { + return IHLMod.fluidDictionary.getFluids(input); + } + + @Override + public String toString() + { + return "RInputFluidStackDictionary<" + this.amount + "x" + this.input; + } + + +} diff --git a/src/main/java/ihl/recipes/RecipeInputFluidStack.java b/src/main/java/ihl/recipes/RecipeInputFluidStack.java new file mode 100644 index 0000000..e4c116d --- /dev/null +++ b/src/main/java/ihl/recipes/RecipeInputFluidStack.java @@ -0,0 +1,45 @@ +package ihl.recipes; + +import java.util.Arrays; +import java.util.List; + +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; + +public class RecipeInputFluidStack implements IRecipeInputFluid +{ + private final Fluid fluid; + private final int amount; + public RecipeInputFluidStack(FluidStack fstack) + { + this.fluid=fstack.getFluid(); + this.amount=fstack.amount; + } + + @Override + public boolean matches(FluidStack subject) + { + if(subject==null || subject.getFluid()==null) + { + return false; + } + return fluid.getName().equals(subject.getFluid().getName()); + } + + @Override + public int getAmount() { + return amount; + } + + @Override + 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/src/main/java/ihl/recipes/RecipeInputObjectInstance.java b/src/main/java/ihl/recipes/RecipeInputObjectInstance.java new file mode 100644 index 0000000..42fdc26 --- /dev/null +++ b/src/main/java/ihl/recipes/RecipeInputObjectInstance.java @@ -0,0 +1,44 @@ +package ihl.recipes; + +import java.util.Arrays; +import java.util.List; + +import ic2.api.recipe.IRecipeInput; +import ihl.utils.IHLUtils; +import net.minecraft.item.ItemStack; + +public class RecipeInputObjectInstance implements IRecipeInput +{ + public final ItemStack input; + + public RecipeInputObjectInstance(ItemStack aInput) + { + this.input = aInput; + } + + @Override + public boolean matches(ItemStack subject) + { + return this.input==subject; + } + + @Override + public int getAmount() + { + return IHLUtils.getAmountOf(input); + } + + @Override + public List getInputs() + { + return Arrays.asList(new ItemStack[] {this.input}); + } + + @Override + public String toString() + { + ItemStack stack = this.input.copy(); + return "RInputWireItemStack<" + stack + ">"; + } + +} diff --git a/src/main/java/ihl/recipes/RecipeInputOreDictionaryList.java b/src/main/java/ihl/recipes/RecipeInputOreDictionaryList.java new file mode 100644 index 0000000..e438d98 --- /dev/null +++ b/src/main/java/ihl/recipes/RecipeInputOreDictionaryList.java @@ -0,0 +1,122 @@ +package ihl.recipes; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; + +import ic2.api.recipe.IRecipeInput; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; + +public class RecipeInputOreDictionaryList implements IRecipeInput { + + public final String[] input; + public final int amount; + public final Integer meta; + private List ores; + + public RecipeInputOreDictionaryList(String[] input1) { + this(input1, 1); + } + + public RecipeInputOreDictionaryList(String[] input1, int amount1) { + this(input1, amount1, (Integer) null); + } + + public RecipeInputOreDictionaryList(String[] input1, int amount1, Integer meta) { + this.input = input1; + this.amount = amount1; + this.meta = meta; + } + + @Override + public boolean matches(ItemStack subject) { + List inputs = this.getOres(); + boolean useOreStackMeta = this.meta == null; + Item subjectItem = subject.getItem(); + int subjectMeta = subject.getItemDamage(); + Iterator i$ = inputs.iterator(); + Item oreItem; + int metaRequired; + + do { + do { + ItemStack oreStack; + + do { + if (!i$.hasNext()) { + return false; + } + + oreStack = i$.next(); + oreItem = oreStack.getItem(); + } while (oreItem == null); + + metaRequired = useOreStackMeta ? oreStack.getItemDamage() : this.meta.intValue(); + } while (subjectItem != oreItem); + } while (subjectMeta != metaRequired && metaRequired != 32767); + + return true; + } + + @Override + public int getAmount() { + return this.amount; + } + + @Override + public List getInputs() { + List ores = this.getOres(); + boolean hasInvalidEntries = false; + Iterator ret = ores.iterator(); + + while (ret.hasNext()) { + ItemStack i$ = ret.next(); + + if (i$.getItem() == null) { + hasInvalidEntries = true; + break; + } + } + + if (!hasInvalidEntries) { + return ores; + } else { + ArrayList ret1 = new ArrayList(ores.size()); + Iterator i$1 = ores.iterator(); + + while (i$1.hasNext()) { + ItemStack stack = i$1.next(); + + if (stack.getItem() != null) { + ret1.add(stack); + } + } + + return Collections.unmodifiableList(ret1); + } + } + + @Override + public String toString() { + return this.meta == null ? "RInputOreDict<" + this.amount + "x" + this.input + ">" + : "RInputOreDict<" + this.amount + "x" + this.input + "@" + this.meta + ">"; + } + + private List getOres() { + if (this.ores != null) { + return this.ores; + } else { + this.ores = new ArrayList(); + for (int i = 0; i < this.input.length; i++) { + ArrayList ret = OreDictionary.getOres(this.input[i]); + if (ret != OreDictionary.EMPTY_LIST) { + this.ores.addAll(ret); + } + } + return this.ores; + } + } +} diff --git a/src/main/java/ihl/recipes/RecipeInputWire.java b/src/main/java/ihl/recipes/RecipeInputWire.java new file mode 100644 index 0000000..a7d5310 --- /dev/null +++ b/src/main/java/ihl/recipes/RecipeInputWire.java @@ -0,0 +1,72 @@ +package ihl.recipes; + +import java.util.Arrays; +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; + +public class RecipeInputWire implements IRecipeInput { + public final ItemStack input; + public final int amount; + + public RecipeInputWire(final ItemStack aInput) { + this(aInput, IHLUtils.getWireLength(aInput)); + } + + public RecipeInputWire(final ItemStack aInput, int aAmount) { + if (aInput.getItem() == null || !(aInput.getItem() instanceof IWire)) { + throw new IllegalArgumentException("Invalid item stack specfied"); + } else { + this.input = aInput; + this.amount = aAmount; + } + } + + public RecipeInputWire(String string, int i) { + this(IHLUtils.getThisModWireItemStackWithLength(string, i), i); + } + + public RecipeInputWire(String material, int length, int transverseSection) { + this(IHLUtils.getUninsulatedWire(material, length, transverseSection), length); + } + + public RecipeInputWire(String material, int length, int transverseSection, String insulationMaterial, + int insulationThickness, int insulationBreakdownVoltage) { + this(IHLUtils.getInsulatedWire(material, length, transverseSection, insulationMaterial, insulationThickness), + length); + } + + @Override + public boolean matches(ItemStack subject) { + if (subject.getItem() == this.input.getItem() + && (subject.getItemDamage() == this.input.getItemDamage() || this.input.getItemDamage() == 32767)) { + if (subject.getItem() instanceof FlexibleCableItem) { + FlexibleCableItem item = (FlexibleCableItem) subject.getItem(); + return item.isSameWire(this.input, subject); + } else { + return true; + } + } + return false; + } + + @Override + public int getAmount() { + return this.amount; + } + + @Override + public List getInputs() { + return Arrays.asList(new ItemStack[] { this.input }); + } + + @Override + public String toString() { + ItemStack stack = this.input.copy(); + return "RInputWireItemStack<" + stack + ">"; + } +} diff --git a/src/main/java/ihl/recipes/RecipeOutputItemStack.java b/src/main/java/ihl/recipes/RecipeOutputItemStack.java new file mode 100644 index 0000000..480d1f8 --- /dev/null +++ b/src/main/java/ihl/recipes/RecipeOutputItemStack.java @@ -0,0 +1,52 @@ +package ihl.recipes; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; + +public class RecipeOutputItemStack { + public final ItemStack itemStack; + public final float quantity; + + public RecipeOutputItemStack(ItemStack itemStack1, float quantity1) { + itemStack = itemStack1; + quantity = quantity1; + itemStack.stackSize = 1; + } + + public RecipeOutputItemStack(ItemStack itemStack1) { + this(itemStack1, itemStack1.stackSize); + } + + public boolean matches(RecipeOutputItemStack is1) { + if (is1 == null || (itemStack.getItem() != is1.itemStack.getItem())) { + return false; + } else if (is1.itemStack.getItemDamage() != OreDictionary.WILDCARD_VALUE + && itemStack.getItemDamage() != is1.itemStack.getItemDamage()) { + return false; + } + return true; + } + + public RecipeOutputItemStack copy(int mulipier) { + return new RecipeOutputItemStack(itemStack, quantity * mulipier); + } + + public RecipeOutputItemStack copy() { + return new RecipeOutputItemStack(itemStack, quantity); + } + + @Override + public String toString() { + return this.itemStack.getUnlocalizedName() + ":" + this.quantity; + } + + public boolean matches(ItemStack is1) { + if (is1 == null || (itemStack.getItem() != is1.getItem())) { + return false; + } else if (is1.getItemDamage() != OreDictionary.WILDCARD_VALUE + && itemStack.getItemDamage() != is1.getItemDamage()) { + return false; + } + return true; + } +} diff --git a/src/main/java/ihl/recipes/UniversalRecipeInput.java b/src/main/java/ihl/recipes/UniversalRecipeInput.java new file mode 100644 index 0000000..7cdb386 --- /dev/null +++ b/src/main/java/ihl/recipes/UniversalRecipeInput.java @@ -0,0 +1,205 @@ +package ihl.recipes; + +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 ic2.api.recipe.IRecipeInput; +import ic2.api.recipe.RecipeInputItemStack; +import ic2.api.recipe.RecipeInputOreDict; +import ihl.interfaces.IWire; +import ihl.utils.IHLUtils; +import ihl.worldgen.ores.IHLFluid; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + +public class UniversalRecipeInput { + + private final List fluidInputs = new ArrayList(); + private final List itemInputs = new ArrayList(); + + public UniversalRecipeInput(Object[] fluidStacks, Object[] iRecipeInputs) { + if (fluidStacks != null) { + for (Object material : fluidStacks) { + if (material == null) { + throw new NullPointerException("Recipe input cannot be null!"); + } + if (material instanceof FluidStack) { + fluidInputs.add(new RecipeInputFluidStack((FluidStack) material)); + } else { + fluidInputs.add((IRecipeInputFluid) material); + } + } + } + sortFluidsByDensity(); + if (iRecipeInputs != null) { + for (Object material : iRecipeInputs) { + if (material == null) { + throw new NullPointerException("Recipe input cannot be null!"); + } + if (material instanceof ItemStack) { + ItemStack stack = (ItemStack) material; + String oreDictName = IHLUtils.getFirstOreDictNameExcludingTagAny(stack); + if (stack.getItem() instanceof IWire) { + itemInputs.add(new RecipeInputWire(stack)); + } else if (!oreDictName.isEmpty() && oreDictName.length() > 3) { + itemInputs.add(new RecipeInputOreDict(oreDictName, stack.stackSize)); + } else { + itemInputs.add(new RecipeInputItemStack(stack)); + } + } else { + itemInputs.add((IRecipeInput) material); + } + } + } + } + + public void sortFluidsByDensity() + { + Map sortMap = new HashMap(); + int[] keysArray = new int[fluidInputs.size()]; + Iterator fli = fluidInputs.iterator(); + while(fli.hasNext()) + { + IRecipeInputFluid rinput = fli.next(); + FluidStack fluid=rinput.getInputs().get(0); + if(fluid==null) + { + return; + } + int key = Math.round(IHLFluid.getRealDensity(fluid.getFluid())*100F); + while(sortMap.containsKey(key)) + { + key++; + } + sortMap.put(key, rinput); + keysArray[fluidInputs.indexOf(rinput)]=key; + } + Arrays.sort(keysArray); + List newFluidList = new ArrayList(); + for(int i=keysArray.length-1;i>=0;i--) + { + newFluidList.add(sortMap.get(keysArray[i])); + } + this.fluidInputs.clear(); + this.fluidInputs.addAll(newFluidList); + } + + public boolean matches(List fluidInputs1, List itemInputs1) { + return this.matches(fluidInputs1, itemInputs1, false); + } + + public List getFluidInputs() { + return fluidInputs; + } + + public List getItemInputs() { + return itemInputs; + } + + public boolean matches(UniversalRecipeInput input) { + List rInputs = input.getItemInputs(); + Iterator ii = rInputs.iterator(); + List rInputsItems = new ArrayList(); + while (ii.hasNext()) { + IRecipeInput is = ii.next(); + rInputsItems.add(is.getInputs().get(0)); + } + List rInputsFluids = new ArrayList(); + List rInputsF = input.getFluidInputs(); + Iterator iiF = rInputsF.iterator(); + while (iiF.hasNext()) { + IRecipeInputFluid is = iiF.next(); + rInputsFluids.add(is.getInputs().get(0)); + } + return this.matches(rInputsFluids, rInputsItems); + } + + public boolean matches(List fluidInputs1, List itemInputs1, boolean doCheckAmounts) { + if (incorrectInputAmount(fluidInputs1, itemInputs1)) { + return false; + } + if (fluidInputs1 != null) { + Iterator fi = fluidInputs.iterator(); + while (fi.hasNext()) { + IRecipeInputFluid fs = fi.next(); + FluidStack fs1 = getMatchedFluidStack(fs, fluidInputs1); + if (fs1 == null || !fs.matches(fs1)) { + return false; + } else if (doCheckAmounts && fs1.amount < fs.getAmount()) { + return false; + } + } + } + if (itemInputs1 != null) { + Iterator ii = itemInputs.iterator(); + while (ii.hasNext()) { + IRecipeInput is = ii.next(); + ItemStack is1 = getMatchedItemStack(is, itemInputs1); + if (is1 == null || !is.matches(is1)) { + return false; + } else if (doCheckAmounts && IHLUtils.getAmountOf(is1) < is.getAmount()) { + return false; + } + } + } + return true; + } + + private ItemStack getMatchedItemStack(IRecipeInput is, List itemInputs1) { + for (ItemStack is1 : itemInputs1) { + if (is1 != null) { + if (is.matches(is1)) { + return is1; + } + } + } + return null; + } + + private FluidStack getMatchedFluidStack(IRecipeInputFluid fs, List fluidInputs1) { + for (FluidStack fs1 : fluidInputs1) { + if (fs.matches(fs1)) { + return fs1; + } + } + return null; + } + + public boolean containItemStack(ItemStack ingredient) { + if (itemInputs == null || itemInputs.isEmpty()) { + return false; + } + Iterator ii = itemInputs.iterator(); + while (ii.hasNext()) { + IRecipeInput is = ii.next(); + if (is.matches(ingredient)) { + return true; + } + } + return false; + } + + public boolean containFluidStack(FluidStack fluidStack) { + if (fluidInputs == null || fluidInputs.isEmpty()) { + return false; + } + Iterator ii = fluidInputs.iterator(); + while (ii.hasNext()) { + IRecipeInputFluid is = ii.next(); + if (is != null && is.matches(fluidStack)) { + return true; + } + } + return false; + } + + private boolean incorrectInputAmount(List fluidInputs1, List itemInputs1) { + return (fluidInputs.size() > 0 && fluidInputs1 == null) || (itemInputs.size() > 0 && itemInputs1 == null) + || (fluidInputs1 != null && fluidInputs.size() > fluidInputs1.size()) + || (itemInputs1 != null && itemInputs.size() > itemInputs1.size()); + } +} diff --git a/src/main/java/ihl/recipes/UniversalRecipeManager.java b/src/main/java/ihl/recipes/UniversalRecipeManager.java new file mode 100644 index 0000000..cddc252 --- /dev/null +++ b/src/main/java/ihl/recipes/UniversalRecipeManager.java @@ -0,0 +1,195 @@ +package ihl.recipes; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; + +import ic2.api.recipe.IRecipeInput; +import ihl.utils.IHLUtils; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + +public class UniversalRecipeManager { + + public static Map machineRecipeManagers = new HashMap(); + public final String machine; + + public UniversalRecipeManager(String machine1) { + machine = machine1; + if (machineRecipeManagers.containsKey(machine1)) { + throw new IllegalArgumentException("Recipe manager for " + machine1 + " already exist!"); + } + machineRecipeManagers.put(machine1, this); + } + + private final Map recipes = new HashMap(); + private final Map keywordMap = new HashMap(); + + public void addRecipe(UniversalRecipeInput input, UniversalRecipeOutput output) { + if (input == null) { + throw new NullPointerException("The recipe input is null"); + } else { + if (output.getFluidOutputs() == null || output.getItemOutputs() == null + || (output.getFluidOutputs().size() == 0 && output.getItemOutputs().size() == 0)) { + throw new NullPointerException("The output is empty"); + } + } + + Iterator var8 = this.recipes.keySet().iterator(); + + while (var8.hasNext()) { + UniversalRecipeInput existingInput = (UniversalRecipeInput) var8.next(); + if (existingInput.matches(input)) { + 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()) { + ssError.append(fii1.next().toString()); + ssError.append(" \n"); + } + ssError.append("New input: \n"); + Iterator iii2 = input.getItemInputs().iterator(); + Iterator fii2 = input.getFluidInputs().iterator(); + while (iii2 != null && iii2.hasNext()) { + ssError.append(iii2.next().toString()); + ssError.append(" \n"); + } + 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) { + if (fluidInputs == null && itemInputs == null) { + return null; + } else { + Iterator> i$ = this.recipes.entrySet().iterator(); + + while (true) { + if (i$.hasNext()) { + Entry entry = i$.next(); + UniversalRecipeInput recipeInput = entry.getKey(); + + if (!recipeInput.matches(fluidInputs, itemInputs)) { + continue; + } + + if (recipeInput.matches(fluidInputs, itemInputs, true)) { + return entry.getValue(); + } + } + + return null; + } + } + } + + public Map getRecipes() { + return this.recipes; + } + + public UniversalRecipeInput getRecipeInput(List fluidInputs1, List itemInputs1) { + { + Iterator> i$ = this.recipes.entrySet().iterator(); + + while (true) { + if (i$.hasNext()) { + Entry entry = i$.next(); + UniversalRecipeInput recipeInput = entry.getKey(); + + if (!recipeInput.matches(fluidInputs1, itemInputs1)) { + continue; + } + + if (recipeInput.matches(fluidInputs1, itemInputs1, true)) { + return recipeInput; + } + } + + return null; + } + } + } + + @SuppressWarnings({ "unchecked", "rawtypes" }) + public UniversalRecipeOutput getOutputFor(List[] input) { + return this.getOutputFor(input[0], input[1]); + } + + @SuppressWarnings({ "unchecked", "rawtypes" }) + public UniversalRecipeInput getRecipeInput(List[] input) { + return this.getRecipeInput(input[0], input[1]); + } + + public void removeRecipeByInput(UniversalRecipeInput uRecipeInput) { + List fluidInputs = IHLUtils.convertRecipeInputToFluidStackList(uRecipeInput.getFluidInputs()); + List itemInputs = IHLUtils.convertRecipeInputToItemStackList(uRecipeInput.getItemInputs()); + { + Iterator> i$ = this.recipes.entrySet().iterator(); + while (i$.hasNext()) { + Entry entry = i$.next(); + UniversalRecipeInput recipeInput = entry.getKey(); + if (recipeInput.matches(fluidInputs, itemInputs)) { + i$.remove(); + break; + } + } + } + } + + public void removeRecipeByOutput(UniversalRecipeOutput uRecipeOutput) { + Iterator> i$ = this.recipes.entrySet().iterator(); + while (i$.hasNext()) { + Entry entry = i$.next(); + UniversalRecipeOutput recipeOutput = entry.getValue(); + if (recipeOutputHasCommonEntries(recipeOutput, uRecipeOutput)) { + i$.remove(); + } + } + } + + public boolean recipeOutputHasCommonEntries(UniversalRecipeOutput out, UniversalRecipeOutput out1) { + List fluidOutputs = out.getFluidOutputs(); + List itemOutputs = out.getItemOutputs(); + if (!fluidOutputs.isEmpty() && !out1.getFluidOutputs().isEmpty()) { + FluidStack fs1 = out1.getFluidOutputs().get(0); + Iterator fi = fluidOutputs.iterator(); + while (fi.hasNext()) { + FluidStack fs = fi.next(); + if (fs.getFluid() == fs1.getFluid()) { + return true; + } + } + } + if (!itemOutputs.isEmpty() && !out1.getItemOutputs().isEmpty()) { + RecipeOutputItemStack is1 = out1.getItemOutputs().get(0); + Iterator ii = itemOutputs.iterator(); + while (ii.hasNext()) { + RecipeOutputItemStack is = ii.next(); + if (is.matches(is1)) { + return true; + } + } + } + return false; + } +} diff --git a/src/main/java/ihl/recipes/UniversalRecipeOutput.java b/src/main/java/ihl/recipes/UniversalRecipeOutput.java new file mode 100644 index 0000000..17c20e4 --- /dev/null +++ b/src/main/java/ihl/recipes/UniversalRecipeOutput.java @@ -0,0 +1,149 @@ +package ihl.recipes; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + +public class UniversalRecipeOutput{ + + private final List fluidOutputs=new ArrayList(); + private final List itemOutputs=new ArrayList(); + private final int time; + public final boolean specialConditions; + + public UniversalRecipeOutput(FluidStack[] fluidOutputs1, Object[] itemOutputs1, int time1) + { + this(fluidOutputs1, itemOutputs1, time1,false); + } + + public UniversalRecipeOutput(FluidStack[] fluidStacks, Object[] recipeOutputItemStacks, int time1, boolean specialConditions1) + { + if(fluidStacks!=null) + { + for(FluidStack fStack:fluidStacks) + { + if(fStack==null) + { + throw new NullPointerException("Recipe cannot contain null elements!"); + } + fluidOutputs.add(fStack); + } + } + if(recipeOutputItemStacks!=null) + { + for(Object io:recipeOutputItemStacks) + { + if(io==null) + { + throw new NullPointerException("Recipe output cannot be null!"); + } + if(io instanceof ItemStack) + { + this.itemOutputs.add(new RecipeOutputItemStack((ItemStack) io)); + } + else + { + this.itemOutputs.add((RecipeOutputItemStack) io); + } + } + } + specialConditions=specialConditions1; + 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()) + { + return false; + } + Iterator fi1 = fluidOutputs1.iterator(); + Iterator ii1 = itemOutputs1.iterator(); + Iterator fi = fluidOutputs.iterator(); + Iterator ii = itemOutputs.iterator(); + while(fi.hasNext()) + { + FluidStack fs = fi.next(); + FluidStack fs1 = fi1.next(); + if(fs.getFluid()!=fs1.getFluid()) + { + return false; + } + } + while(ii.hasNext()) + { + RecipeOutputItemStack is = ii.next(); + ItemStack is1 = ii1.next(); + if(!is.matches(is1)) + { + return false; + } + } + return true; + } + + public List getFluidOutputs() { + return fluidOutputs; + } + + public List getItemOutputs() { + return itemOutputs; + } + + public UniversalRecipeOutput copyWithMultiplier(int mulipier) { + FluidStack[] fluidStacks = null; + RecipeOutputItemStack[] itemStacks = null; + if(fluidOutputs!=null && !fluidOutputs.isEmpty()) + { + fluidStacks = new FluidStack[fluidOutputs.size()]; + for(int i=0;i0) + { + EntityPig pig = (EntityPig) pigList.get(0); + DamageSource ds = DamageSource.wither; + pig.attackEntityFrom(ds, 10F); + LostHeadEntity lh = new LostHeadEntity(world); + lh.setPosition(pig.posX,pig.posY,pig.posZ); + world.spawnEntityInWorld(lh); + } + } + } + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) + { + Block topBlock = world.getBlock(x, y+1, z); + Block bottomBlock = world.getBlock(x, y-1, z); + IIcon sideIcon = this.blockIcon; + if(topBlock==this && bottomBlock==this) + { + sideIcon = this.textureSide4; + } + else if(topBlock==this) + { + sideIcon = this.textureSide3; + } + else if(bottomBlock==this) + { + sideIcon = this.textureSide2; + } + switch (side) + { + case 0: + return this.textureTop; + case 1: + return this.textureTop; + default: + return sideIcon; + } + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + IIcon sideIcon = this.blockIcon; + switch (side) + { + case 0: + return this.textureTop; + case 1: + return this.textureTop; + default: + return sideIcon; + } + } +} diff --git a/src/main/java/ihl/servitor/FlameEntityFX.java b/src/main/java/ihl/servitor/FlameEntityFX.java new file mode 100644 index 0000000..783476e --- /dev/null +++ b/src/main/java/ihl/servitor/FlameEntityFX.java @@ -0,0 +1,87 @@ +package ihl.servitor; + +import net.minecraft.client.particle.EntityFX; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.world.World; + +public class FlameEntityFX extends EntityFX { + + public FlameEntityFX(World world, double x, double y, double z) + { + super(world, x, y, z); + this.renderDistanceWeight = 5.0D; + } + + public FlameEntityFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12, float par14) + { + super(par1World, par2, par4, par6, 0.0D, 0.0D, 0.0D); + this.motionX *= 0.10000000149011612D; + this.motionY *= 0.10000000149011612D; + this.motionZ *= 0.10000000149011612D; + this.motionX += par8; + this.motionY += par10; + this.motionZ += par12; + this.particleScale *= par14; + this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D)); + this.noClip = false; + this.renderDistanceWeight = 6.0D; + } + + @Override + public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) + { + float var8 = this.particleTextureIndexX / 4.0F; + float var9 = var8 + 0.0624375F*4F; + float var10 = this.particleTextureIndexY / 4.0F; + float var11 = var10 + 0.0624375F*4F; + float var12 = 0.1F * this.particleScale; + + float var13 = (float)(this.prevPosX + (this.posX - this.prevPosX) * par2 - interpPosX); + float var14 = (float)(this.prevPosY + (this.posY - this.prevPosY) * par2 - interpPosY); + float var15 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * par2 - interpPosZ); + par1Tessellator.addVertexWithUV(var13 - par3 * var12 - par6 * var12, var14 - par4 * var12, var15 - par5 * var12 - par7 * var12, var9, var11); + par1Tessellator.addVertexWithUV(var13 - par3 * var12 + par6 * var12, var14 + par4 * var12, var15 - par5 * var12 + par7 * var12, var9, var10); + par1Tessellator.addVertexWithUV(var13 + par3 * var12 + par6 * var12, var14 + par4 * var12, var15 + par5 * var12 + par7 * var12, var8, var10); + par1Tessellator.addVertexWithUV(var13 + par3 * var12 - par6 * var12, var14 - par4 * var12, var15 + par5 * var12 - par7 * var12, var8, var11); + } + + @Override + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if (this.particleAge++ >= this.particleMaxAge) + { + this.setDead(); + } + this.setParticleTextureIndex(this.particleAge * 15 / this.particleMaxAge); + this.motionY += 0.004D; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + + if (this.posY == this.prevPosY) + { + this.motionX *= 1.1D; + this.motionZ *= 1.1D; + } + + this.motionX *= 0.9599999785423279D; + this.motionY *= 0.9599999785423279D; + this.motionZ *= 0.9599999785423279D; + + if (this.onGround) + { + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + } + } + + @Override + public void setParticleTextureIndex(int par1) + { + this.particleTextureIndexX = par1 % 4; + this.particleTextureIndexY = par1 / 4; + } + +} diff --git a/src/main/java/ihl/servitor/FlameRenderFX.java b/src/main/java/ihl/servitor/FlameRenderFX.java new file mode 100644 index 0000000..f90e378 --- /dev/null +++ b/src/main/java/ihl/servitor/FlameRenderFX.java @@ -0,0 +1,55 @@ +package ihl.servitor; + +import org.lwjgl.opengl.GL11; + +import net.minecraft.client.particle.EntityFX; +import net.minecraft.client.renderer.ActiveRenderInfo; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.entity.Entity; +import net.minecraft.util.ResourceLocation; + +public class FlameRenderFX extends Render{ + private ResourceLocation tex; + +public FlameRenderFX(String textureLocation) +{ + super(); + tex = new ResourceLocation(textureLocation); +} + +@Override +public void doRender(Entity entity, double x, double y, double z, + float arg4, float arg5) +{ + float var3 = ActiveRenderInfo.rotationX; + float var4 = ActiveRenderInfo.rotationZ; + float var5 = ActiveRenderInfo.rotationYZ; + float var6 = ActiveRenderInfo.rotationXY; + float var7 = ActiveRenderInfo.rotationXZ; + EntityFX.interpPosX = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * arg4; + EntityFX.interpPosY = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * arg4; + EntityFX.interpPosZ = entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * arg4; + this.renderManager.renderEngine.bindTexture(tex); + GL11.glPushMatrix(); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glTranslatef((float)x, (float)y, (float)z); + GL11.glDepthMask(false); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); + Tessellator var9 = Tessellator.instance; + var9.startDrawingQuads(); + EntityFX var11 = (EntityFX) entity; + var11.renderParticle(var9, arg4, var3, var7, var4, var5, var6); + var9.draw(); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthMask(true); + GL11.glPopMatrix(); +} + + @Override + protected ResourceLocation getEntityTexture(Entity arg0) + { + return tex; + } +} \ No newline at end of file diff --git a/src/main/java/ihl/servitor/LostHeadEntity.java b/src/main/java/ihl/servitor/LostHeadEntity.java new file mode 100644 index 0000000..704743b --- /dev/null +++ b/src/main/java/ihl/servitor/LostHeadEntity.java @@ -0,0 +1,475 @@ +package ihl.servitor; + +import java.util.List; + +import ic2.api.item.IC2Items; +import ihl.IHLMod; +import ihl.IHLModInfo; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityFlying; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.monster.IMob; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.World; + +public class LostHeadEntity extends EntityFlying implements IMob +{ + public int courseChangeCooldown; + public double waypointX; + public double waypointY; + public double waypointZ; + private Entity targetedEntity; + + /** Cooldown time between target loss and new target aquirement. */ + private int aggroCooldown; + public int prevAttackCounter; + public int attackCounter; + public int attackCounterIncrement; + + private final double psr = 0.5D; + private final double delta = 0.35D; + + private final double damage = 4D; + private final double knockbackStrength=2D; + + + public LostHeadEntity(World par1World) + { + super(par1World); + this.setSize(1.0F, 1.0F); + this.isImmuneToFire = true; + this.experienceValue = 5; + } + + public boolean func_110182_bF() + { + return this.dataWatcher.getWatchableObjectByte(16) != 0; + } + + /** + * Called when the entity is attacked. + */ + @Override + public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) + { + if (this.isEntityInvulnerable()) + { + return false; + } + else + { + return super.attackEntityFrom(par1DamageSource, par2); + } + } + + @Override + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(16, Byte.valueOf((byte)0)); + } + + @Override + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(10.0D); + } + + @SuppressWarnings("unchecked") + @Override + public void onLivingUpdate() + { + super.onLivingUpdate(); + if(worldObj.isRemote) + { + double x1,y1,z1,x2,z2; + x1=this.prevPosX+psr*Math.sin(-rotationYaw/180D*Math.PI+delta+Math.random()*0.1D-0.05D); + z1=this.prevPosZ+psr*Math.cos(-rotationYaw/180D*Math.PI+delta+Math.random()*0.1D-0.05D); + x2=this.prevPosX+psr*Math.sin(-rotationYaw/180D*Math.PI-delta+Math.random()*0.1D-0.05D); + z2=this.prevPosZ+psr*Math.cos(-rotationYaw/180D*Math.PI-delta+Math.random()*0.1D-0.05D); + y1=this.prevPosY+psr*Math.sin(rotationPitch/180D*Math.PI+Math.random()*0.1D-0.05D)+0.4D; + IHLMod.proxy.spawnParticle(0,worldObj, x1,y1,z1,0D,0.1D,0D,1F); + IHLMod.proxy.spawnParticle(0,worldObj, x2,y1,z2,0D,0.1D,0D,1F); + } + //this part was mindlessly taken from EntityArrow. + Vec3 var17 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); + Vec3 var3 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + MovingObjectPosition var4 = this.worldObj.func_147447_a(var17, var3, false, true, false); + var17 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); + var3 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + + if (var4 != null) + { + var3 = Vec3.createVectorHelper(var4.hitVec.xCoord, var4.hitVec.yCoord, var4.hitVec.zCoord); + } + + Entity var5 = null; + List 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; + + for (var9 = 0; var9 < var6.size(); ++var9) + { + Entity var10 = (Entity)var6.get(var9); + + if (var10.canBeCollidedWith()) + { + var11 = 0.3F; + AxisAlignedBB var12 = var10.boundingBox.expand(var11, var11, var11); + MovingObjectPosition var13 = var12.calculateIntercept(var17, var3); + + if (var13 != null) + { + double var14 = var17.distanceTo(var13.hitVec); + + if (var14 < var7 || var7 == 0.0D) + { + var5 = var10; + var7 = var14; + } + } + } + } + + + if (var5 != null) + { + var4 = new MovingObjectPosition(var5); + } + + float var19; + float var26; + + if (var4 != null) + { + if (var4.entityHit != null) + { + var19 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ); + int var23 = MathHelper.ceiling_double_int(var19 * this.damage); + + DamageSource var21 = DamageSource.causeThrownDamage(this, this); + + if (var4.entityHit.attackEntityFrom(var21, var23)) + { + if (var4.entityHit instanceof EntityLivingBase) + { + var26 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + if (var26 > 0.0F) + { + var4.entityHit.addVelocity(this.motionX * this.knockbackStrength * 0.6D / var26, 0.1D, this.motionZ * this.knockbackStrength * 0.6D / var26); + } + } + } + } + } + } + + + @Override + protected void updateEntityActionState() + { + if (!this.worldObj.isRemote && this.worldObj.difficultySetting == EnumDifficulty.PEACEFUL) + { + this.setDead(); + } + + this.despawnEntity(); + this.prevAttackCounter = this.attackCounter; + double var1 = this.waypointX - this.posX; + double var3 = this.waypointY - this.posY; + double var5 = this.waypointZ - this.posZ; + double var7 = var1 * var1 + var3 * var3 + var5 * var5; + + if (var7 < 1.0D || var7 > 3600.0D) + { + this.waypointX = this.posX + (this.rand.nextFloat() * 2.0F - 1.0F) * 16.0F; + this.waypointY = this.posY + (this.rand.nextFloat() * 2.0F - 1.0F) * 16.0F; + this.waypointZ = this.posZ + (this.rand.nextFloat() * 2.0F - 1.0F) * 16.0F; + } + + if (this.courseChangeCooldown-- <= 0) + { + this.courseChangeCooldown += this.rand.nextInt(5) + 2; + var7 = MathHelper.sqrt_double(var7); + + if (this.isCourseTraversable(this.waypointX, this.waypointY, this.waypointZ, var7)) + { + this.motionX += var1 / var7 * 0.02D; + this.motionY += var3 / var7 * 0.02D; + this.motionZ += var5 / var7 * 0.02D; + } + else + { + this.waypointX = this.posX; + this.waypointY = this.posY; + this.waypointZ = this.posZ; + } + } + + if (this.targetedEntity != null && this.targetedEntity.isDead) + { + if (!this.worldObj.isRemote) + { + this.playSound(IHLModInfo.MODID+":lostHeadLaughtLong", 10F, this.getSoundPitch()); + } + this.targetedEntity = null; + } + + if (this.targetedEntity == null || this.aggroCooldown-- <= 0) + { + this.targetedEntity = this.worldObj.getClosestVulnerablePlayerToEntity(this, 100.0D); + + if (this.targetedEntity != null) + { + this.aggroCooldown = 20; + } + } + + double var9 = 64.0D; + + if (this.targetedEntity != null && this.targetedEntity.getDistanceSqToEntity(this) < var9 * var9) + { + double var11 = this.targetedEntity.posX - this.posX; + double var15 = this.targetedEntity.posZ - this.posZ; + this.renderYawOffset = this.rotationYaw = -((float)Math.atan2(var11, var15)) * 180.0F / (float)Math.PI; + + if (this.canEntityBeSeen(this.targetedEntity)) + { + if (this.attackCounter == 70) + { + //play attack scream before attack + if (!this.worldObj.isRemote) + { + this.playSound(IHLModInfo.MODID+":lostHeadLaught", 10F, this.getSoundPitch()); + } + } + + ++this.attackCounter; + + if (this.attackCounter == 80) + { + //play fire sound before attack + this.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1008, (int)this.posX, (int)this.posY, (int)this.posZ, 0); + double vX = this.targetedEntity.posX-this.posX; + double vY = this.targetedEntity.posY+this.targetedEntity.height-this.posY; + double vZ = this.targetedEntity.posZ-this.posZ; + this.motionX=vX*0.1D; + this.motionY=vY*0.1D; + this.motionZ=vZ*0.1D; + this.courseChangeCooldown=40; + this.attackCounter = -60; + } + } + else if (this.attackCounter > 0) + { + --this.attackCounter; + } + } + else + { + float rYaw=-((float)Math.atan2(this.motionX, this.motionZ)) * 180.0F / (float)Math.PI; + float rYawD=this.rotationYaw-rYaw; + this.renderYawOffset = this.rotationYaw -= rYawD*0.2F; + + if (this.attackCounter > 0) + { + --this.attackCounter; + } + } + + if (!this.worldObj.isRemote) + { + byte var21 = this.dataWatcher.getWatchableObjectByte(16); + byte var12 = (byte)(this.attackCounter > 10 ? 1 : 0); + + if (var21 != var12) + { + this.dataWatcher.updateObject(16, Byte.valueOf(var12)); + } + } + } + + /** + * 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 = (this.waypointX - this.posX) / par7; + double var11 = (this.waypointY - this.posY) / par7; + double var13 = (this.waypointZ - 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; + } + + /** + * Returns the sound this mob makes while it's alive. + */ + @Override + protected String getLivingSound() + { + return IHLModInfo.MODID+":lostHeadCry"; + } + + @Override + public int getTalkInterval() + { + return 400; + } + /** + * Returns the sound this mob makes when it is hurt. + */ + @Override + protected String getHurtSound() + { + return IHLModInfo.MODID+":lostHeadScream"; + } + + /** + * Returns the sound this mob makes on death. + */ + @Override + protected String getDeathSound() + { + return IHLModInfo.MODID+":lostHeadDeath"; + } + + /** + * Drop 0-2 items of this living's type + */ + @Override + protected void dropFewItems(boolean par1, int par2) + { + int var3 = this.rand.nextInt(2) + this.rand.nextInt(1 + par2); + int var4; + + if(var3==0) + { + this.entityDropItem(new ItemStack(IHLMod.ihlSkull,1), 1); + } + else + { + for (var4 = 0; var4 < var3; ++var4) + { + this.entityDropItem(new ItemStack(Items.dye, 1, 15), 1); + } + } + + var3 = this.rand.nextInt(3) + this.rand.nextInt(1 + par2); + + for (var4 = 0; var4 < var3; ++var4) + { + this.entityDropItem(IC2Items.getItem("smallTinDust"), 1); + } + } + + /** + * Returns the volume for the sounds this mob makes. + */ + @Override + protected float getSoundVolume() + { + return 1.0F; + } + + /** + * Checks if the entity's current position is a valid location to spawn this entity. + */ + @Override + public boolean getCanSpawnHere() + { + return this.rand.nextInt(20) == 0 && super.getCanSpawnHere() && this.worldObj.difficultySetting != EnumDifficulty.PEACEFUL; + } + + /** + * Will return how many at most can spawn in a chunk at once. + */ + @Override + public int getMaxSpawnedInChunk() + { + return 1; + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + @Override + public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) + { + super.writeEntityToNBT(par1NBTTagCompound); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + @Override + public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) + { + super.readEntityFromNBT(par1NBTTagCompound); + } + + @Override + public void moveEntityWithHeading(float par1, float par2) + { + if (this.isInWater()) + { + this.moveFlying(par1, par2, 0.02F); + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.800000011920929D; + this.motionY *= 0.800000011920929D; + this.motionZ *= 0.800000011920929D; + } + else if (this.handleLavaMovement()) + { + this.moveFlying(par1, par2, 0.02F); + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.5D; + this.motionY *= 0.5D; + this.motionZ *= 0.5D; + } + else + { + float var3 = 0.91F; + + if (this.onGround) + { + var3 = this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)).slipperiness * 0.91F; + } + + float var4 = 0.16277136F / (var3 * var3 * var3); + this.moveFlying(par1, par2, this.onGround ? 0.1F * var4 : 0.02F); + var3 = 0.98F; + + if (this.onGround) + { + var3 = this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)).slipperiness * 0.91F; + } + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= var3; + this.motionY *= var3; + this.motionZ *= var3; + } + } +} diff --git a/src/main/java/ihl/servitor/LostHeadRender.java b/src/main/java/ihl/servitor/LostHeadRender.java new file mode 100644 index 0000000..f4e7cb9 --- /dev/null +++ b/src/main/java/ihl/servitor/LostHeadRender.java @@ -0,0 +1,40 @@ +package ihl.servitor; + +import org.lwjgl.opengl.GL11; + +import ihl.IHLModInfo; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.entity.Entity; +import net.minecraft.util.ResourceLocation; + +public class LostHeadRender extends Render{ + private SkullModel model = new SkullModel(); + private ResourceLocation tex; + private float scale; + +public LostHeadRender() +{ + super(); + scale = 1F/80F; + tex = new ResourceLocation(IHLModInfo.MODID+":textures/items/skull.png"); +} + +@Override +public void doRender(Entity entity, double x, double y, double z, + float arg4, float arg5) +{ + bindTexture(tex); + GL11.glPushMatrix(); + GL11.glTranslated(x, y, z); + GL11.glScalef(1.0F, -1F, -1F); + GL11.glRotated(entity.rotationYaw+180D, 0D, 1.0D, 0D); + model.Base.render(scale); + GL11.glPopMatrix(); +} + + @Override + protected ResourceLocation getEntityTexture(Entity arg0) + { + return tex; + } +} \ No newline at end of file diff --git a/src/main/java/ihl/servitor/SkullItemRender.java b/src/main/java/ihl/servitor/SkullItemRender.java new file mode 100644 index 0000000..8b9e2b7 --- /dev/null +++ b/src/main/java/ihl/servitor/SkullItemRender.java @@ -0,0 +1,78 @@ +package ihl.servitor; + +import org.lwjgl.opengl.GL11; + +import ihl.IHLModInfo; +import net.minecraft.client.Minecraft; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.IItemRenderer; + +public class SkullItemRender implements IItemRenderer{ + private SkullModel model = new SkullModel(); + private ResourceLocation tex; + private float scale; + +public SkullItemRender() +{ + super(); + scale = 1F/80F; + tex = new ResourceLocation(IHLModInfo.MODID+":textures/items/skull.png"); +} + +@Override +public void renderItem(ItemRenderType type, ItemStack item, Object... data) +{ + GL11.glPushMatrix(); + switch(type) + { + case EQUIPPED_FIRST_PERSON: + GL11.glRotatef(80F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(0F, 0.18F, 1F); + GL11.glScalef(1.5F, -1.5F, -1.5F); + break; + case ENTITY: + GL11.glTranslatef(0F, 1.0F, 0F); + GL11.glScalef(1.0F, -1F, -1F); + break; + case INVENTORY: + GL11.glRotatef(210F, 0F, 1.0F, -0.15F); + GL11.glTranslatef(0.0F,-0.75F,0.0F); + GL11.glScalef(1.5F, -1.5F, -1.5F); + break; + case EQUIPPED: + GL11.glTranslatef(0.5F,0.5F,0.25F); + GL11.glScalef(1.0F, -1F, -1F); + break; + default: + break; + } + Minecraft.getMinecraft().renderEngine.bindTexture(tex); + model.Base.render(scale); + GL11.glPopMatrix(); +} + +/** + * IItemRenderer implementation * + */ +@Override +public boolean handleRenderType(ItemStack item, ItemRenderType type) { + switch (type) { + case ENTITY: + return true; + case EQUIPPED: + return true; + case EQUIPPED_FIRST_PERSON: + return true; + case INVENTORY: + return true; + default: + return false; + } +} + +@Override +public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { + return true; +} +} \ No newline at end of file diff --git a/src/main/java/ihl/servitor/SkullModel.java b/src/main/java/ihl/servitor/SkullModel.java new file mode 100644 index 0000000..1bdbdcf --- /dev/null +++ b/src/main/java/ihl/servitor/SkullModel.java @@ -0,0 +1,153 @@ +package ihl.servitor; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; + +public class SkullModel extends ModelBase +{ + //fields + ModelRenderer Base; + + public SkullModel() + { + textureWidth = 256; + textureHeight = 256; + setTextureOffset("Base.Shape2", 110, 11); + setTextureOffset("Base.Shape3", 59, 62); + setTextureOffset("Base.Shape4", 83, 59); + setTextureOffset("Base.Shape5", 83, 59); + setTextureOffset("Base.Shape6", 0, 18); + setTextureOffset("Base.Shape8", 0, 26); + setTextureOffset("Base.Shape9", 2, 33); + setTextureOffset("Base.Shape10", 26, 37); + setTextureOffset("Base.Shape11", 28, 157); + setTextureOffset("Base.Shape12", 83, 111); + setTextureOffset("Base.Shape13", 67, 110); + setTextureOffset("Base.Shape14", 72, 99); + setTextureOffset("Base.Shape15", 92, 114); + setTextureOffset("Base.Shape16", 102, 112); + setTextureOffset("Base.Shape17", 82, 107); + setTextureOffset("Base.Shape18", 71, 108); + setTextureOffset("Base.Shape19", 89, 114); + setTextureOffset("Base.Shape20", 90, 124); + setTextureOffset("Base.Shape21", 106, 31); + setTextureOffset("Base.Shape22", 77, 139); + setTextureOffset("Base.Shape23", 115, 193); + setTextureOffset("Base.Shape24", 1, 163); + setTextureOffset("Base.Shape25", 127, 117); + setTextureOffset("Base.Shape26", 81, 116); + setTextureOffset("Base.Shape27", 81, 115); + setTextureOffset("Base.Shape28", 81, 114); + setTextureOffset("Base.Shape29", 6, 167); + setTextureOffset("Base.Shape1", 0, 154); + setTextureOffset("Base.Shape7", 92, 124); + setTextureOffset("Base.Shape30", 89, 124); + setTextureOffset("Base.Shape31", 128, 193); + setTextureOffset("Base.Shape32", 106, 88); + setTextureOffset("Base.Shape33", 109, 70); + setTextureOffset("Base.Shape34", 166, 109); + setTextureOffset("Base.Shape35", 100, 53); + setTextureOffset("Base.Shape36", 169, 98); + setTextureOffset("Base.Shape37", 99, 81); + setTextureOffset("Base.Shape38", 101, 108); + setTextureOffset("Base.Shape39", 92, 85); + setTextureOffset("Base.Shape40", 22, 89); + setTextureOffset("Base.Shape41", 62, 151); + setTextureOffset("Base.Shape42", 37, 97); + setTextureOffset("Base.Shape43", 9, 101); + setTextureOffset("Base.Shape44", 77, 15); + setTextureOffset("Base.Shape45", 18, 145); + setTextureOffset("Base.Shape46", 28, 156); + setTextureOffset("Base.Shape47", 28, 155); + setTextureOffset("Base.Shape48", 106, 104); + setTextureOffset("Base.Shape49", 77, 129); + setTextureOffset("Base.Shape50", 25, 82); + setTextureOffset("Base.Shape51", 46, 33); + setTextureOffset("Base.Shape52", 101, 85); + setTextureOffset("Base.Shape53", 141, 38); + setTextureOffset("Base.Shape54", 24, 149); + setTextureOffset("Base.Shape55", 83, 132); + setTextureOffset("Base.Shape56", 99, 132); + setTextureOffset("Base.Shape57", 30, 186); + setTextureOffset("Base.Shape58", 142, 220); + + Base = new ModelRenderer(this, "Base"); + Base.setRotationPoint(0F, -30F, -30F); + setRotation(Base, 0F, 0F, 0F); + Base.mirror = false; + Base.addBox("Shape2", -25F, -24F, 18F, 8, 24, 34); + Base.addBox("Shape3", -23F, -28F, 13F, 46, 4, 38); + Base.addBox("Shape4", -22F, -30F, 14F, 44, 2, 37); + Base.addBox("Shape5", -21F, -32F, 12F, 42, 2, 39); + Base.addBox("Shape6", -19F, -34F, 9F, 38, 2, 43); + Base.addBox("Shape8", -17F, -36F, 11F, 34, 2, 46); + Base.addBox("Shape9", -15F, -38F, 13F, 28, 2, 42); + Base.addBox("Shape10", -9F, -40F, 21F, 20, 2, 24); + Base.addBox("Shape11", -13F, -24F, 1F, 26, 26, 3); + Base.addBox("Shape12", -16F, -11.2F, 66F, 14, 4, 2); + Base.addBox("Shape13", 2F, -11.2F, 66F, 14, 4, 2); + Base.addBox("Shape14", -9F, -24F, 66F, 18, 17, 1); + Base.addBox("Shape15", -2F, -7F, 65F, 4, 7, 3); + Base.addBox("Shape16", -2F, -4F, 68F, 4, 4, 1); + Base.addBox("Shape17", 2F, -10F, 64F, 3, 4, 5); + Base.addBox("Shape18", -5F, -10F, 64F, 3, 4, 5); + Base.addBox("Shape19", -6F, 0F, 65F, 4, 1, 1); + Base.addBox("Shape20", -16F, 1F, 63F, 12, 5, 4); + Base.addBox("Shape21", -24F, 0F, 18F, 8, 4, 38); + Base.addBox("Shape22", -8F, 10F, 66F, 16, 5, 2); + Base.addBox("Shape23", -16F, 4F, 7F, 9, 3, 56); + Base.addBox("Shape24", -10F, 7F, 16F, 8, 3, 52); + Base.addBox("Shape25", -10F, 16F, 17F, 20, 1, 12); + Base.addBox("Shape26", -10F, 15F, 15F, 20, 1, 15); + Base.addBox("Shape27", -11F, 14F, 13F, 22, 1, 18); + Base.addBox("Shape28", -11F, 13F, 11F, 22, 1, 21); + Base.addBox("Shape29", -12F, 7.1F, 8F, 24, 6, 26); + Base.addBox("Shape1", 2F, 7F, 16F, 8, 3, 52); + Base.addBox("Shape7", 2F, 0F, 65F, 4, 1, 1); + Base.addBox("Shape30", 4F, 1F, 63F, 12, 5, 4); + Base.addBox("Shape31", 7F, 4F, 7F, 9, 3, 56); + Base.addBox("Shape32", 16F, 0F, 18F, 8, 4, 38); + Base.addBox("Shape33", 17F, -24F, 18F, 8, 24, 34); + Base.addBox("Shape34", 18F, -7F, 52F, 6, 7, 9); + Base.addBox("Shape35", -24F, -7F, 52F, 6, 7, 9); + Base.addBox("Shape36", 16F, -13F, 56F, 6, 16, 6); + Base.addBox("Shape37", 18F, -24F, 52F, 2, 17, 12); + Base.addBox("Shape38", -22F, -13F, 56F, 6, 16, 6); + Base.addBox("Shape39", -20F, -24F, 52F, 2, 17, 12); + Base.addBox("Shape40", -18F, -28F, 51F, 36, 4, 13); + Base.addBox("Shape41", -17.5F, -30F, 34F, 35, 2, 29); + Base.addBox("Shape42", -18F, -24F, 62F, 36, 17, 4); + Base.addBox("Shape43", -17F, -32F, 7F, 34, 2, 54); + Base.addBox("Shape44", -16.2F, -34F, 51F, 32, 2, 8); + Base.addBox("Shape45", -19.5F, -33F, 8F, 39, 37, 8); + Base.addBox("Shape46", -14F, -26F, 2F, 28, 30, 1); + Base.addBox("Shape47", -15F, -28F, 3F, 30, 32, 2); + Base.addBox("Shape48", -18F, -1F, 56F, 3, 5, 8); + Base.addBox("Shape49", 15F, -1F, 56F, 3, 5, 8); + Base.addBox("Shape50", -5F, -39F, 15F, 12, 1, 6); + Base.addBox("Shape51", -6F, -39F, 45F, 12, 1, 6); + Base.addBox("Shape52", -21.5F, -31F, 11F, 43, 34, 6); + Base.addBox("Shape53", -23.5F, -24F, 13F, 47, 26, 5); + Base.addBox("Shape54", -17F, -30F, 5F, 34, 34, 3); + Base.addBox("Shape55", 8F, 10F, 58F, 2, 4, 9); + Base.addBox("Shape56", -10F, 10F, 58F, 2, 4, 8); + Base.addBox("Shape57", -9F, 4F, 3F, 18, 5, 5); + Base.addBox("Shape58", -8F, 10F, 41F, 16, 1, 25); + } + + @Override +public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + Base.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + +} diff --git a/src/main/java/ihl/servitor/SkullModel.txt b/src/main/java/ihl/servitor/SkullModel.txt new file mode 100644 index 0000000..be648bd --- /dev/null +++ b/src/main/java/ihl/servitor/SkullModel.txt @@ -0,0 +1,165 @@ +// Date: 12.07.2014 13:37:52 +// Template version 1.1 +// Java generated by Techne +// Keep in mind that you still need to fill in some blanks +// - ZeuX + + + + + + +package net.minecraft.src; + +public class ModelShieldModel extends ModelBase +{ + //fields + ModelRenderer Base; + + public ModelShieldModel() + { + textureWidth = 256; + textureHeight = 256; + setTextureOffset("Base.Shape2", 110, 11); + setTextureOffset("Base.Shape3", 59, 62); + setTextureOffset("Base.Shape4", 83, 59); + setTextureOffset("Base.Shape5", 83, 59); + setTextureOffset("Base.Shape6", 0, 18); + setTextureOffset("Base.Shape8", 0, 26); + setTextureOffset("Base.Shape9", 2, 33); + setTextureOffset("Base.Shape10", 26, 37); + setTextureOffset("Base.Shape11", 28, 157); + setTextureOffset("Base.Shape12", 83, 111); + setTextureOffset("Base.Shape13", 67, 110); + setTextureOffset("Base.Shape14", 72, 99); + setTextureOffset("Base.Shape15", 92, 114); + setTextureOffset("Base.Shape16", 102, 112); + setTextureOffset("Base.Shape17", 82, 107); + setTextureOffset("Base.Shape18", 71, 108); + setTextureOffset("Base.Shape19", 89, 114); + setTextureOffset("Base.Shape20", 90, 124); + setTextureOffset("Base.Shape21", 106, 31); + setTextureOffset("Base.Shape22", 77, 139); + setTextureOffset("Base.Shape23", 115, 193); + setTextureOffset("Base.Shape24", 1, 163); + setTextureOffset("Base.Shape25", 127, 117); + setTextureOffset("Base.Shape26", 81, 116); + setTextureOffset("Base.Shape27", 81, 115); + setTextureOffset("Base.Shape28", 81, 114); + setTextureOffset("Base.Shape29", 6, 167); + setTextureOffset("Base.Shape1", 0, 154); + setTextureOffset("Base.Shape7", 92, 124); + setTextureOffset("Base.Shape30", 89, 124); + setTextureOffset("Base.Shape31", 128, 193); + setTextureOffset("Base.Shape32", 106, 88); + setTextureOffset("Base.Shape33", 109, 70); + setTextureOffset("Base.Shape34", 166, 109); + setTextureOffset("Base.Shape35", 100, 53); + setTextureOffset("Base.Shape36", 169, 98); + setTextureOffset("Base.Shape37", 99, 81); + setTextureOffset("Base.Shape38", 101, 108); + setTextureOffset("Base.Shape39", 92, 85); + setTextureOffset("Base.Shape40", 22, 89); + setTextureOffset("Base.Shape41", 62, 151); + setTextureOffset("Base.Shape42", 37, 97); + setTextureOffset("Base.Shape43", 9, 101); + setTextureOffset("Base.Shape44", 77, 15); + setTextureOffset("Base.Shape45", 18, 145); + setTextureOffset("Base.Shape46", 28, 156); + setTextureOffset("Base.Shape47", 28, 155); + setTextureOffset("Base.Shape48", 106, 104); + setTextureOffset("Base.Shape49", 77, 129); + setTextureOffset("Base.Shape50", 25, 82); + setTextureOffset("Base.Shape51", 46, 33); + setTextureOffset("Base.Shape52", 101, 85); + setTextureOffset("Base.Shape53", 141, 38); + setTextureOffset("Base.Shape54", 24, 149); + setTextureOffset("Base.Shape55", 83, 132); + setTextureOffset("Base.Shape56", 99, 132); + setTextureOffset("Base.Shape57", 30, 186); + setTextureOffset("Base.Shape58", 142, 220); + + Base = new ModelRenderer(this, "Base"); + Base.setRotationPoint(0F, -30F, -30F); + setRotation(Base, 0F, 0F, 0F); + Base.mirror = true; + Base.addBox("Shape2", -25F, -24F, 18F, 8, 24, 34); + Base.addBox("Shape3", -23F, -28F, 13F, 46, 4, 38); + Base.addBox("Shape4", -22F, -30F, 14F, 44, 2, 37); + Base.addBox("Shape5", -21F, -32F, 12F, 42, 2, 39); + Base.addBox("Shape6", -19F, -34F, 9F, 38, 2, 43); + Base.addBox("Shape8", -17F, -36F, 11F, 34, 2, 46); + Base.addBox("Shape9", -15F, -38F, 13F, 28, 2, 42); + Base.addBox("Shape10", -9F, -40F, 21F, 20, 2, 24); + Base.addBox("Shape11", -13F, -24F, 1F, 26, 26, 3); + Base.addBox("Shape12", -16F, -11,2F, 66F, 14, 4, 2); + Base.addBox("Shape13", 2F, -11,2F, 66F, 14, 4, 2); + Base.addBox("Shape14", -9F, -24F, 66F, 18, 17, 1); + Base.addBox("Shape15", -2F, -7F, 65F, 4, 7, 3); + Base.addBox("Shape16", -2F, -4F, 68F, 4, 4, 1); + Base.addBox("Shape17", 2F, -10F, 64F, 3, 4, 5); + Base.addBox("Shape18", -5F, -10F, 64F, 3, 4, 5); + Base.addBox("Shape19", -6F, 0F, 65F, 4, 1, 1); + Base.addBox("Shape20", -16F, 1F, 63F, 12, 5, 4); + Base.addBox("Shape21", -24F, 0F, 18F, 8, 4, 38); + Base.addBox("Shape22", -8F, 10F, 66F, 16, 5, 2); + Base.addBox("Shape23", -16F, 4F, 7F, 9, 3, 56); + Base.addBox("Shape24", -10F, 7F, 16F, 8, 3, 52); + Base.addBox("Shape25", -10F, 16F, 17F, 20, 1, 12); + Base.addBox("Shape26", -10F, 15F, 15F, 20, 1, 15); + Base.addBox("Shape27", -11F, 14F, 13F, 22, 1, 18); + Base.addBox("Shape28", -11F, 13F, 11F, 22, 1, 21); + Base.addBox("Shape29", -12F, 7,1F, 8F, 24, 6, 26); + Base.addBox("Shape1", 2F, 7F, 16F, 8, 3, 52); + Base.addBox("Shape7", 2F, 0F, 65F, 4, 1, 1); + Base.addBox("Shape30", 4F, 1F, 63F, 12, 5, 4); + Base.addBox("Shape31", 7F, 4F, 7F, 9, 3, 56); + Base.addBox("Shape32", 16F, 0F, 18F, 8, 4, 38); + Base.addBox("Shape33", 17F, -24F, 18F, 8, 24, 34); + Base.addBox("Shape34", 18F, -7F, 52F, 6, 7, 9); + Base.addBox("Shape35", -24F, -7F, 52F, 6, 7, 9); + Base.addBox("Shape36", 16F, -13F, 56F, 6, 16, 6); + Base.addBox("Shape37", 18F, -24F, 52F, 2, 17, 12); + Base.addBox("Shape38", -22F, -13F, 56F, 6, 16, 6); + Base.addBox("Shape39", -20F, -24F, 52F, 2, 17, 12); + Base.addBox("Shape40", -18F, -28F, 51F, 36, 4, 13); + Base.addBox("Shape41", -17,5F, -30F, 34F, 35, 2, 29); + Base.addBox("Shape42", -18F, -24F, 62F, 36, 17, 4); + Base.addBox("Shape43", -17F, -32F, 7F, 34, 2, 54); + Base.addBox("Shape44", -16,24F, -34,04F, 51F, 32, 2, 8); + Base.addBox("Shape45", -19,5F, -33F, 8F, 39, 37, 8); + Base.addBox("Shape46", -14F, -26F, 2F, 28, 30, 1); + Base.addBox("Shape47", -15F, -28F, 3F, 30, 32, 2); + Base.addBox("Shape48", -18F, -1F, 56F, 3, 5, 8); + Base.addBox("Shape49", 15F, -1F, 56F, 3, 5, 8); + Base.addBox("Shape50", -5F, -39F, 15F, 12, 1, 6); + Base.addBox("Shape51", -6F, -39F, 45F, 12, 1, 6); + Base.addBox("Shape52", -21,5F, -31F, 11F, 43, 34, 6); + Base.addBox("Shape53", -23,5F, -24F, 13F, 47, 26, 5); + Base.addBox("Shape54", -17F, -30F, 5F, 34, 34, 3); + Base.addBox("Shape55", 8F, 10F, 58F, 2, 4, 9); + Base.addBox("Shape56", -10F, 10F, 58F, 2, 4, 8); + Base.addBox("Shape57", -9F, 4F, 3F, 18, 5, 5); + Base.addBox("Shape58", -8F, 10F, 41F, 16, 1, 25); + } + + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5); + Base.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5) + { + super.setRotationAngles(f, f1, f2, f3, f4, f5); + } + +} diff --git a/src/main/java/ihl/trans_dimensional_item_teleporter/TDITBlock.java b/src/main/java/ihl/trans_dimensional_item_teleporter/TDITBlock.java new file mode 100644 index 0000000..584692d --- /dev/null +++ b/src/main/java/ihl/trans_dimensional_item_teleporter/TDITBlock.java @@ -0,0 +1,132 @@ +package ihl.trans_dimensional_item_teleporter; + +import java.util.Random; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ic2.api.item.IC2Items; +import ihl.IHLCreativeTab; +import ihl.IHLModInfo; +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.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class TDITBlock extends Block implements ITileEntityProvider{ + + IIcon textureLeft, textureRight, textureBack, textureBottom; + + public TDITBlock(Material material) + { + super(material); + this.setCreativeTab(IHLCreativeTab.tab); + } + + @Override + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) + { + return IC2Items.getItem("machine").getItem(); + } + + @Override + public void dropBlockAsItemWithChance(World world, int x, int y, int z, int meta, float chance, int flag) + { + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) { + return new TDITTileEntity(); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister par1IconRegister) + { + this.blockIcon = par1IconRegister.registerIcon(IHLModInfo.MODID + ":tditTop"); + this.textureBack = par1IconRegister.registerIcon(IHLModInfo.MODID + ":tditBack"); + this.textureLeft = par1IconRegister.registerIcon(IHLModInfo.MODID + ":tditLeft"); + this.textureRight = par1IconRegister.registerIcon(IHLModInfo.MODID + ":tditRight"); + this.textureBottom = par1IconRegister.registerIcon(IHLModInfo.MODID + ":tditBottom"); + } + + @Override + public boolean hasTileEntity(int metadata) + { + return true; + } + + @Override + public boolean onBlockActivated(World world,int x,int y,int z,EntityPlayer entityPlayer,int i,float pos_x,float pos_y,float pos_z){ + TileEntity te = world.getTileEntity(x,y,z); + if(te instanceof TDITTileEntity) + { + TDITTileEntity bte = (TDITTileEntity)te; + if (bte == null || entityPlayer.isSneaking()) { + return false; + } + else if(entityPlayer.getCurrentEquippedItem()==null || !(entityPlayer.getCurrentEquippedItem().getItem() instanceof TDITFrequencyTransmitter)) + { + return bte.getGui(entityPlayer); + } + } + return false; + } + + /** + * Called when the block is placed in the world. + */ + + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) + { + switch (side) + { + case 0: + return this.textureBottom; + case 1: + return this.blockIcon; + case 2: + return this.textureBack; + case 3: + return this.textureBack; + case 4: + return this.textureLeft; + case 5: + return this.textureRight; + default: + return this.blockIcon; + } + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + switch (side) + { + case 0: + return this.textureBottom; + case 1: + return this.blockIcon; + case 2: + return this.textureBack; + case 3: + return this.textureBack; + case 4: + return this.textureLeft; + case 5: + return this.textureRight; + default: + return this.blockIcon; + } + } + +} diff --git a/src/main/java/ihl/trans_dimensional_item_teleporter/TDITContainer.java b/src/main/java/ihl/trans_dimensional_item_teleporter/TDITContainer.java new file mode 100644 index 0000000..35dd1a0 --- /dev/null +++ b/src/main/java/ihl/trans_dimensional_item_teleporter/TDITContainer.java @@ -0,0 +1,93 @@ +package ihl.trans_dimensional_item_teleporter; + +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 TDITContainer extends ContainerBase { + + protected TDITTileEntity tileEntity; + public int lastStorage = -1; + private final static int height=166; + + public TDITContainer(EntityPlayer entityPlayer, TDITTileEntity tileEntity1){ + super(tileEntity1); + this.tileEntity = tileEntity1; + int col, row; + + 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.dischargeSlot, 0, 8, 44)); + for(row=0;row<=3;row++) + { + this.addSlotToContainer(new SlotInvSlot(tileEntity1.upgradeSlot, row, 152, 8+row*18)); + } + for(row=0;row<=2;row++) + { + for(col=0;col<=2;col++) + { + this.addSlotToContainer(new SlotInvSlot(tileEntity1.inputSlot, row+col*3, 31+col*18, 8+row*18)); + } + } + for(row=0;row<=2;row++) + { + for(col=0;col<=2;col++) + { + this.addSlotToContainer(new SlotInvSlot(tileEntity1.outputSlot, row+col*3, 89+col*18, 8+row*18)); + } + } + } + + @Override + public void detectAndSendChanges() + { + super.detectAndSendChanges(); + for (int i = 0; i < this.crafters.size(); ++i) + { + ICrafting icrafting = (ICrafting)this.crafters.get(i); + + if (this.tileEntity.getStored() != this.lastStorage) + { + icrafting.sendProgressBarUpdate(this, 0, (this.tileEntity.getStored()>>15) & Short.MAX_VALUE); + icrafting.sendProgressBarUpdate(this, 1, (short)(this.tileEntity.getStored() & Short.MAX_VALUE)); + + } + } + + this.lastStorage = this.tileEntity.getStored(); + } + + @Override + public void updateProgressBar(int index, int value) + { + super.updateProgressBar(index, value); + + switch (index) + { + case 0: + this.tileEntity.setStored(value<<15); + break; + case 1: + this.tileEntity.setStored(this.tileEntity.getStored()+value); + break; + } + } + + @Override + public boolean canInteractWith(EntityPlayer var1) { + return tileEntity.isUseableByPlayer(var1); + } +} diff --git a/src/main/java/ihl/trans_dimensional_item_teleporter/TDITFrequencyTransmitter.java b/src/main/java/ihl/trans_dimensional_item_teleporter/TDITFrequencyTransmitter.java new file mode 100644 index 0000000..633b824 --- /dev/null +++ b/src/main/java/ihl/trans_dimensional_item_teleporter/TDITFrequencyTransmitter.java @@ -0,0 +1,172 @@ +package ihl.trans_dimensional_item_teleporter; + +import java.util.LinkedList; +import java.util.List; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ic2.api.item.IItemHudInfo; +import ic2.core.IC2; +import ic2.core.util.StackUtil; +import ihl.IHLCreativeTab; +import ihl.IHLModInfo; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.server.MinecraftServer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +public class TDITFrequencyTransmitter extends Item implements IItemHudInfo { + + IIcon textureDamaged; + + public TDITFrequencyTransmitter() + { + super(); + this.setCreativeTab(IHLCreativeTab.tab); + this.maxStackSize=1; + this.setMaxDamage(0); + } + + @Override + public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) + { + if (IC2.platform.isSimulating()) + { + if (itemstack.getItemDamage() == 0) + { + NBTTagCompound nbtData = StackUtil.getOrCreateNbtData(itemstack); + + if (nbtData.getBoolean("targetSet")) + { + nbtData.setBoolean("targetSet", false); + IC2.platform.messagePlayer(entityplayer, "TDIT Frequency Transmitter unlinked", new Object[0]); + } + } + else + { + itemstack.setItemDamage(0); + } + } + + return itemstack; + } + + @Override + public boolean onItemUseFirst(ItemStack itemstack, EntityPlayer entityPlayer, World world, int x, int y, int z, int l, float hitX, float hitY, float hitZ) + { + TileEntity tileEntity = world.getTileEntity(x, y, z); + + if (tileEntity instanceof TDITTileEntity && IC2.platform.isSimulating()) + { + NBTTagCompound nbtData = StackUtil.getOrCreateNbtData(itemstack); + boolean targetSet = nbtData.getBoolean("targetSet"); + int dimesionID = nbtData.getInteger("dimesionID"); + int targetX = nbtData.getInteger("targetX"); + int targetY = nbtData.getInteger("targetY"); + int targetZ = nbtData.getInteger("targetZ"); + TDITTileEntity tp = (TDITTileEntity)tileEntity; + + if (!targetSet) + { + targetSet = true; + dimesionID = world.provider.dimensionId; + targetX = tp.xCoord; + targetY = tp.yCoord; + targetZ = tp.zCoord; + IC2.platform.messagePlayer(entityPlayer, "TDIT Frequency Transmitter linked to TDIT.", new Object[0]); + } + else if (tp.xCoord == targetX && tp.yCoord == targetY && tp.zCoord == targetZ) + { + IC2.platform.messagePlayer(entityPlayer, "Can\'t link TDIT to itself.", new Object[0]); + } + else if (tp.targetSet && tp.targetX == targetX && tp.targetY == targetY && tp.targetZ == targetZ) + { + IC2.platform.messagePlayer(entityPlayer, "TDIT link unchanged.", new Object[0]); + } + else + { + tp.setTarget(targetX, targetY, targetZ, dimesionID); + + TileEntity te1 = MinecraftServer.getServer().worldServerForDimension(dimesionID).getTileEntity(targetX, targetY, targetZ); + + if (te1 instanceof TDITTileEntity) + { + TDITTileEntity tp21 = (TDITTileEntity)te1; + + if (!tp21.targetSet) + { + tp21.setTarget(tp.xCoord, tp.yCoord, tp.zCoord, dimesionID); + } + } + + IC2.platform.messagePlayer(entityPlayer, "Teleportation link established.", new Object[0]); + } + + nbtData.setBoolean("targetSet", targetSet); + nbtData.setInteger("dimesionID", dimesionID); + nbtData.setInteger("targetX", targetX); + nbtData.setInteger("targetY", targetY); + nbtData.setInteger("targetZ", targetZ); + itemstack.setItemDamage(1); + return false; + } + else + { + return false; + } + } + + @Override + public List getHudInfo(ItemStack itemStack) { + LinkedList info = new LinkedList(); + if(itemStack.stackTagCompound!=null) + { + NBTTagCompound nbtData = StackUtil.getOrCreateNbtData(itemStack); + boolean targetSet = nbtData.getBoolean("targetSet"); + if(targetSet) + { + int dimesionID = nbtData.getInteger("dimesionID"); + int targetX = nbtData.getInteger("targetX"); + int targetY = nbtData.getInteger("targetY"); + int targetZ = nbtData.getInteger("targetZ"); + info.add("Dimesion ID: " + dimesionID); + info.add("X coord: " + targetX); + info.add("Y coord: " + targetY); + info.add("Z coord: " + targetZ); + } + else + { + info.add("Memory clean"); + } + } + return info; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon=iconRegister.registerIcon(IHLModInfo.MODID + ":itemTDITFT"); + this.textureDamaged=iconRegister.registerIcon(IHLModInfo.MODID + ":itemTDITFT_1"); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int meta) + { + switch(meta) + { + case 0: + return this.itemIcon; + case 1: + return this.textureDamaged; + default: + return this.itemIcon; + } + } +} diff --git a/src/main/java/ihl/trans_dimensional_item_teleporter/TDITGui.java b/src/main/java/ihl/trans_dimensional_item_teleporter/TDITGui.java new file mode 100644 index 0000000..5966e5e --- /dev/null +++ b/src/main/java/ihl/trans_dimensional_item_teleporter/TDITGui.java @@ -0,0 +1,48 @@ +package ihl.trans_dimensional_item_teleporter; + +import org.lwjgl.opengl.GL11; + +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; + +@SideOnly(Side.CLIENT) +public class TDITGui extends GuiContainer { + private static final ResourceLocation background = new ResourceLocation("ihl", "textures/gui/GUITDIT.png"); + private TDITContainer container; + + public TDITGui (TDITContainer container1) { + //the container is instanciated and passed to the superclass for handling + super(container1); + this.container=container1; + } + + @Override + protected void drawGuiContainerForegroundLayer(int param1, int param2) + { + //the parameters for drawString are: string, x, y, color + String status = StatCollector.translateToLocal("ihl.gui.tdit.message" + this.container.tileEntity.currentStatus); + fontRendererObj.drawString(status, 12, 68, 852037); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.renderEngine.bindTexture(background); + //charge + if (this.container.tileEntity.getStored() > 0) + { + int chargeLevel=Math.min(Math.round(this.container.tileEntity.getStored()*13.0F/this.container.tileEntity.maxStorage),13); + this.drawTexturedModalRect(11, 28+13-chargeLevel, xSize, 13-chargeLevel, 7, chargeLevel); + } + } + + @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(background); + int x = (width - xSize) / 2; + int y = (height - ySize) / 2; + this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); + } +} \ No newline at end of file diff --git a/src/main/java/ihl/trans_dimensional_item_teleporter/TDITTileEntity.java b/src/main/java/ihl/trans_dimensional_item_teleporter/TDITTileEntity.java new file mode 100644 index 0000000..d54a705 --- /dev/null +++ b/src/main/java/ihl/trans_dimensional_item_teleporter/TDITTileEntity.java @@ -0,0 +1,497 @@ +package ihl.trans_dimensional_item_teleporter; + +import java.util.ArrayList; +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 ic2.api.energy.event.EnergyTileLoadEvent; +import ic2.api.energy.event.EnergyTileUnloadEvent; +import ic2.api.energy.tile.IEnergySink; +import ic2.api.item.IC2Items; +import ic2.api.network.NetworkHelper; +import ic2.core.ContainerBase; +import ic2.core.IC2; +import ic2.core.IHasGui; +import ic2.core.audio.AudioSource; +import ic2.core.audio.PositionSpec; +import ic2.core.block.TileEntityInventory; +import ic2.core.block.invslot.InvSlot; +import ic2.core.block.invslot.InvSlot.Access; +import ic2.core.block.invslot.InvSlotOutput; +import ic2.core.block.invslot.InvSlotUpgrade; +import ic2.core.upgrade.IUpgradableBlock; +import ic2.core.upgrade.IUpgradeItem; +import ic2.core.upgrade.UpgradableProperty; +import ihl.IHLMod; +import ihl.utils.IHLInvSlotDischarge; +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.server.MinecraftServer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.util.ForgeDirection; + +public class TDITTileEntity extends TileEntityInventory implements IEnergySink, IHasGui, IUpgradableBlock +{ + private int tier=4; + private int defaultTier=4; + public int maxStorage=12000; + private int defaultMaxStorage=12000; + private double energy=0D; + private double energyConsume=12000D;//per full stack + public boolean addedToEnergyNet = false; + public final InvSlotUpgrade upgradeSlot; + public final IHLInvSlotDischarge dischargeSlot; + public final InvSlotOutput outputSlot; + public final InvSlot inputSlot; + + public int updateChecksum=-1; + + private AudioSource startAS; + public boolean targetSet=false; + public int targetDimension; + public int targetX; + public int targetY; + public int targetZ; + /** 0 - Ready, 100% + * 1 - Not enough energy + * 2 - Receiver not responding + * 3 - Receiver not defined + * 4 - Clean receiver chamber! + */ + public int currentStatus=0; + public int lastStatus=0; + private int timer=0; + + + public TDITTileEntity() + { + this.defaultTier=IHLMod.config.tditTier; + this.defaultMaxStorage=IHLMod.config.tditMaxEnergyStorage; + this.energyConsume=IHLMod.config.tditEnergyConsumePerStack; + this.dischargeSlot = new IHLInvSlotDischarge(this, 0, Access.IO, this.tier, InvSlot.InvSide.SIDE); + this.upgradeSlot = new InvSlotUpgrade(this, "upgrade", 1, 4); + this.outputSlot = new InvSlotOutput(this, "output", 2, 9); + this.inputSlot = new InvSlot(this, "input", 2, InvSlot.Access.I, 9, InvSlot.InvSide.TOP); + } + + @Override + public List getNetworkedFields() + { + List fields = super.getNetworkedFields(); + fields.add("tier"); + fields.add("maxStorage"); + fields.add("currentStatus"); + return fields; + } + + @Override + public void readFromNBT(NBTTagCompound nbttagcompound) + { + super.readFromNBT(nbttagcompound); + try + { + this.energy = nbttagcompound.getDouble("energy"); + } + catch (Exception var3) + { + this.energy = nbttagcompound.getInteger("energy"); + + if (this.maxStorage > Integer.MAX_VALUE) + { + this.energy *= 10.0D; + } + } + this.targetSet = nbttagcompound.getBoolean("targetSet"); + this.targetDimension = nbttagcompound.getInteger("targetDimension"); + this.targetX = nbttagcompound.getInteger("targetX"); + this.targetY = nbttagcompound.getInteger("targetY"); + this.targetZ = nbttagcompound.getInteger("targetZ"); + } + + @Override + public void writeToNBT(NBTTagCompound nbttagcompound) + { + super.writeToNBT(nbttagcompound); + nbttagcompound.setDouble("energy", this.energy); + nbttagcompound.setBoolean("targetSet", this.targetSet); + nbttagcompound.setInteger("targetDimension", this.targetDimension); + nbttagcompound.setInteger("targetX", this.targetX); + nbttagcompound.setInteger("targetY", this.targetY); + nbttagcompound.setInteger("targetZ", this.targetZ); + } + + @Override + public void onLoaded() + { + super.onLoaded(); + if (IC2.platform.isSimulating()) + { + MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this)); + this.addedToEnergyNet = true; + } + if (IC2.platform.isRendering() && this.startAS==null) + { + this.startAS = IC2.audioManager.createSource(this, PositionSpec.Center, this.getStartSoundFile(),false,false, 1F); + } + } + + @Override + public void onUnloaded() + { + if (IC2.platform.isRendering() && this.startAS != null) + { + this.startAS.stop(); + this.startAS = null; + IC2.audioManager.removeSources(this); + } + + if (IC2.platform.isSimulating() && this.addedToEnergyNet) + { + MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this)); + this.addedToEnergyNet = false; + } + super.onUnloaded(); + } + + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { + return false; + } + + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { + if(this.dischargeSlot.get()!=null)this.worldObj.spawnEntityInWorld(new EntityItem(this.worldObj, this.xCoord, this.yCoord+1, this.zCoord, this.dischargeSlot.get())); + if(this.upgradeSlot.get(0)!=null)this.worldObj.spawnEntityInWorld(new EntityItem(this.worldObj, this.xCoord, this.yCoord+1, this.zCoord, this.upgradeSlot.get(0))); + if(this.upgradeSlot.get(1)!=null)this.worldObj.spawnEntityInWorld(new EntityItem(this.worldObj, this.xCoord, this.yCoord+1, this.zCoord, this.upgradeSlot.get(1))); + if(this.upgradeSlot.get(2)!=null)this.worldObj.spawnEntityInWorld(new EntityItem(this.worldObj, this.xCoord, this.yCoord+1, this.zCoord, this.upgradeSlot.get(2))); + if(this.upgradeSlot.get(3)!=null)this.worldObj.spawnEntityInWorld(new EntityItem(this.worldObj, this.xCoord, this.yCoord+1, this.zCoord, this.upgradeSlot.get(3))); + return new ItemStack(IHLMod.tditBlock,1); + } + + @Override + public void setFacing(short facing1) + { + super.setFacing(facing1); + this.updateChecksum=-1; + } + + public boolean enableUpdateEntity() + { + return true; + } + + public String getStartSoundFile() + { + return "Machines/IHL Industrial Fan/start.ogg"; + } + + public String getLoopSoundFile() + { + return "Machines/IHL Industrial Fan/loop.ogg"; + } + + public String getStopSoundFile() + { + return "Machines/IHL Industrial Fan/stop.ogg"; + } + + @Override + public void updateEntityServer() + { + + if (IC2.platform.isSimulating()) + { + this.setOverclockRates(); + if(this.timer>0) + { + this.timer--; + } + else + { + this.timer=60; + int energyToOperate=this.countEnergyToOperate(); + if(energyToOperate>0 && energyToOperate<=this.energy) + { + this.sendItemStack(); + this.energy-=energyToOperate; + } + else if(energyToOperate==0 && this.energy>100D) + { + this.currentStatus=0; + } + else + { + this.currentStatus=1; + } + if(this.currentStatus!=this.lastStatus) + { + NetworkHelper.updateTileEntityField(this, "currentStatus"); + this.lastStatus=this.currentStatus; + } + + } + + } + if(this.dischargeSlot.tier!=this.tier) + { + this.dischargeSlot.tier=this.tier; + } + if(this.getDemandedEnergy() > 1.0D) + { + double amount = this.dischargeSlot.discharge(this.getDemandedEnergy(), false); + this.energy += amount; + } + if(this.energy>this.maxStorage) + { + this.energy=this.maxStorage; + } + + + if(IC2.platform.isRendering() && this.startAS!=null) + { + if(this.getActive()) + { + this.startAS.play(); + } + else + { + this.startAS.stop(); + } + } + + } + + @Override + public boolean acceptsEnergyFrom(TileEntity emitter, + ForgeDirection direction) { + return true; + } + + @Override + public String getInventoryName() { + return "tdit"; + } + + public int getStored() { + return Math.round((float)this.energy); + } + + public void setStored(int value) { + this.energy=value; + } + + @Override + @SideOnly(Side.CLIENT) + public GuiScreen getGui(EntityPlayer arg0, boolean arg1) { + return new TDITGui(new TDITContainer(arg0, this)); + } + + public boolean getGui(EntityPlayer player) + { + return this instanceof IHasGui ? (IC2.platform.isSimulating() ? IC2.platform.launchGui(player, this) : true) : false; + } + + @Override + public ContainerBase getGuiContainer(EntityPlayer arg0) { + return new TDITContainer(arg0, this); + } + @Override + public void onGuiClosed(EntityPlayer arg0) {} + + public void setOverclockRates() + { + int tierUp=0; + int capacityUp=0; + int checksum=0; + for(int i=0;i= this.maxStorage) + { + return amount; + } + else + { + this.energy += amount; + return 0.0D; + } + } + + public void setTarget(int targetX2, int targetY2, int targetZ2, int dimesionID) { + this.targetSet=true; + this.targetX=targetX2; + this.targetY=targetY2; + this.targetZ=targetZ2; + this.targetDimension=dimesionID; + } + + public boolean canRecieve(List itemStackList) + { + int countEmptySlots=0; + for(int i=0;i=itemStackList.size(); + } + + public void recieveItemStack(List itemStackList) + { + this.outputSlot.add(itemStackList); + for (int i = 0; i < this.upgradeSlot.size(); ++i) + { + ItemStack stack = this.upgradeSlot.get(i); + + if (stack != null && stack.getItem() instanceof ic2.core.upgrade.IUpgradeItem && ((IUpgradeItem)stack.getItem()).onTick(stack, this)) + { + //needsInvUpdate = true; + } + } + } + + private int countEnergyToOperate() + { + int energy = 0; + for(int i=0;i itemStackList = new ArrayList(); + for(int i=0;i getUpgradableProperties() + { + Set properties = new HashSet(); + properties.add(UpgradableProperty.ItemProducing); + properties.add(UpgradableProperty.EnergyStorage); + return properties; + } + + @Override + public double getEnergy() { + return this.energy; + } + + @Override + public boolean useEnergy(double arg0) { + if(this.energy>=arg0) + { + this.energy-=arg0; + return true; + } + else + { + return false; + } + + } +} \ No newline at end of file diff --git a/src/main/java/ihl/utils/BlockItemRender.java b/src/main/java/ihl/utils/BlockItemRender.java new file mode 100644 index 0000000..34d1499 --- /dev/null +++ b/src/main/java/ihl/utils/BlockItemRender.java @@ -0,0 +1,218 @@ +package ihl.utils; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ic2.core.block.RenderBlockDefault; +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.RenderBlocks; +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; + +@SideOnly(value = Side.CLIENT) +public class BlockItemRender implements IItemRenderer{ + private ModelBase model; + private ResourceLocation tex; + private int renderFrom=0; + private int renderTo=0; + private RenderBlockDefault rbd; + private float amendment=0.0F; + private float inventoryOffset=0.0F; + private boolean renderHand; + +public BlockItemRender() +{ + rbd=new RenderBlockDefault(); +} + +public BlockItemRender(ModelBase model1, ResourceLocation texture, int renderFrom1, int renderTo1, float amendment1, float inventoryOffset1) +{ + this.model=model1; + this.tex=texture; + this.renderFrom=renderFrom1; + this.renderTo=renderTo1; + this.amendment=amendment1; + this.inventoryOffset=inventoryOffset1; + this.renderHand=false; +} + +public BlockItemRender(ModelBase model1, ResourceLocation texture, int renderFrom1, int renderTo1, float amendment1, float inventoryOffset1, boolean renderHand1) +{ + this.model=model1; + this.tex=texture; + this.renderFrom=renderFrom1; + this.renderTo=renderTo1; + this.amendment=amendment1; + this.inventoryOffset=inventoryOffset1; + this.renderHand=renderHand1; +} + +@Override +public boolean handleRenderType(ItemStack item, ItemRenderType type) { + switch (type) { + case ENTITY: + return true; + case EQUIPPED: + return true; + case EQUIPPED_FIRST_PERSON: + return true; + case INVENTORY: + return true; + default: + return false; + } +} + +@Override +public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { + return true; +} + +@Override +public void renderItem(ItemRenderType type, ItemStack item, Object... data) { + if(tex!=null) + { + Minecraft.getMinecraft().renderEngine.bindTexture(tex); + } + GL11.glPushMatrix(); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + IHLItemBlock bItem =(IHLItemBlock) item.getItem(); + Block block = bItem.getBlockContained(); + GL11.glScalef(1F, -1F+amendment, -1F); + if(item.stackTagCompound!=null && item.stackTagCompound.hasKey("colour")){ + int colour = item.stackTagCompound.getInteger("colour"); + GL11.glColor4f((colour>>>16)/255f,((colour>>>8)&255)/255f, (colour&255)/255f,1f); + } + switch (type) { + case ENTITY: + GL11.glTranslatef(0,-1.5F,0); + if(model!=null) + { + for(int i = this.renderFrom;i>>16)/255f,((colour>>>8)&255)/255f, (colour&255)/255f,1f); + } + if(model!=null) + { + for(int i = this.renderFrom;i> nameToStack = new HashMap>(); + private Map fluidToName = new HashMap(); + public FluidDictionary(){} + + public List getFluids(String fdName) + { + return nameToStack.get(fdName); + } + + public void registerFluidStack(String fdName, FluidStack fstack) + { + if(nameToStack.containsKey(fdName)) + { + nameToStack.get(fdName).add(fstack); + } + else + { + List list = new ArrayList(); + list.add(fstack); + nameToStack.put(fdName, list); + } + fluidToName.put(fstack.getFluid(), fdName); + } + + public String getFluidName(Fluid f) + { + return fluidToName.get(f); + } + +} diff --git a/src/main/java/ihl/utils/GuiMultiTextureButton.java b/src/main/java/ihl/utils/GuiMultiTextureButton.java new file mode 100644 index 0000000..009c57f --- /dev/null +++ b/src/main/java/ihl/utils/GuiMultiTextureButton.java @@ -0,0 +1,47 @@ +package ihl.utils; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.util.ResourceLocation; + +@SideOnly(value = Side.CLIENT) +public class GuiMultiTextureButton extends GuiButton { + + private ResourceLocation texture; + private int textureX; + private int textureY; + private int textureActiveX; + private int textureActiveY; + public boolean isActive=false; + + public GuiMultiTextureButton(int id1, int x, int y, int w, int h, + ResourceLocation texture1, int textureX1, int textureY1, int textureActiveX1, int textureActiveY1) { + super(id1, x, y, w, h, ""); + texture=texture1; + textureX=textureX1; + textureY=textureY1; + textureActiveX=textureActiveX1; + textureActiveY=textureActiveY1; + + } + + @Override + public void drawButton(Minecraft minecraft, int i, int j) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + minecraft.getTextureManager().bindTexture(this.texture); + if(this.isActive) + { + this.drawTexturedModalRect(this.xPosition, this.yPosition, this.textureActiveX, this.textureActiveY, this.width, this.height); + } + else + { + this.drawTexturedModalRect(this.xPosition, this.yPosition, this.textureX, this.textureY, this.width, this.height); + } + } + +} diff --git a/src/main/java/ihl/utils/IHLFluidTank.java b/src/main/java/ihl/utils/IHLFluidTank.java new file mode 100644 index 0000000..67597e1 --- /dev/null +++ b/src/main/java/ihl/utils/IHLFluidTank.java @@ -0,0 +1,322 @@ +package ihl.utils; + +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 ihl.recipes.IRecipeInputFluid; +import ihl.worldgen.ores.IHLFluid; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidTank; + +public class IHLFluidTank implements IFluidTank { + private final List fluidList = new ArrayList(); + private final int capacity; + + public IHLFluidTank(int capacity) { + this.capacity = capacity; + } + + public IHLFluidTank(int capacity, boolean isOpenVessel1) { + this.capacity = capacity; + } + + public IHLFluidTank readFromNBT(NBTTagCompound nbt) { + if (!nbt.hasKey("Empty")) { + NBTTagList fluidList1 = nbt.getTagList("fluids", 10); + for (int i = 0; i < fluidList1.tagCount(); i++) { + NBTTagCompound fluidNBT1 = fluidList1.getCompoundTagAt(i); + FluidStack fluid = FluidStack.loadFluidStackFromNBT(fluidNBT1); + if (fluid != null) { + fluidList.add(fluid); + } + } + } + return this; + } + + public NBTTagCompound writeToNBT(NBTTagCompound nbt) { + if (!fluidList.isEmpty()) { + NBTTagList fluids = new NBTTagList(); + Iterator fli = fluidList.iterator(); + while (fli.hasNext()) { + FluidStack fluid = fli.next(); + if (fluid != null) { + NBTTagCompound fluidNBT1 = new NBTTagCompound(); + fluid.writeToNBT(fluidNBT1); + fluids.appendTag(fluidNBT1); + } + } + nbt.setTag("fluids", fluids); + } else { + nbt.setString("Empty", ""); + } + return nbt; + } + + /* IFluidTank */ + @Override + public FluidStack getFluid() { + if (this.fluidList.isEmpty()) { + return null; + } + return this.fluidList.get(0); + } + + public FluidStack getLigthestFluid() { + if (this.fluidList.isEmpty()) { + return IHLUtils.getFluidStackWithSize("air", this.capacity); + } + return this.fluidList.get(this.fluidList.size() - 1); + } + + @Override + public int getFluidAmount() { + int amount = 0; + Iterator fli = fluidList.iterator(); + while (fli.hasNext()) { + FluidStack fluid = fli.next(); + if (fluid != null) { + amount += fluid.amount; + } + } + return amount; + } + + @Override + public int getCapacity() { + return capacity; + } + + @Override + public FluidTankInfo getInfo() { + return new FluidTankInfo(this); + } + + @Override + public int fill(FluidStack resource, boolean doFill) { + if (resource == null) + return 0; + int freeSpace = capacity - this.getFluidAmount(); + int amount1 = Math.min(freeSpace, resource.amount); + if (resource.getFluid() == null || amount1<=0) { + return 0; + } + if (!doFill) { + return amount1; + } + FluidStack fluid = getFluidStackWithSameFluid(resource); + if (fluid != null) { + fluid.amount += amount1; + return amount1; + } + fluid = copyWithSize(resource, amount1); + fluidList.add(fluid); + this.sortFluidsByDensity(); + return amount1; + } + + @Override + public FluidStack drain(int maxDrain, boolean doDrain) { + if (fluidList.isEmpty()) { + return null; + } + FluidStack fstack = this.getFluid().copy(); + fstack.amount = maxDrain; + return this.drain(fstack, doDrain); + } + + public FluidStack drainLightest(int maxDrain, boolean doDrain) { + if (fluidList.isEmpty()) { + return null; + } + FluidStack fstack = this.getLigthestFluid().copy(); + fstack.amount = maxDrain; + return this.drain(fstack, doDrain); + } + + public FluidStack drain(Object fluidStack, boolean doDrain) { + if (fluidList.isEmpty()) { + return null; + } + int drained = 0; + if (fluidStack instanceof FluidStack) { + drained = ((FluidStack) fluidStack).amount; + } else { + drained = ((IRecipeInputFluid) fluidStack).getAmount(); + } + FluidStack fluid = this.getFluidStackWithSameFluid(fluidStack); + if (fluid == null) { + return null; + } + if (fluid.amount < drained) { + drained = fluid.amount; + } + FluidStack stack = copyWithSize(fluid, drained); + if (doDrain) { + fluid.amount -= drained; + if (fluid.amount <= 0) { + this.fluidList.remove(fluid); + } + } + return stack; + } + + public FluidStack getFluidStackWithSameFluid(Object fluidStack) { + Iterator fli = fluidList.iterator(); + while (fli.hasNext()) { + FluidStack fluid = fli.next(); + if (fluid != null) { + if (fluidStack instanceof FluidStack) { + if (fluid.isFluidEqual((FluidStack) fluidStack)) { + return fluid; + } + } else { + if (((IRecipeInputFluid) fluidStack).matches(fluid)) { + return fluid; + } + } + } + } + return null; + } + + public int getNumberOfFluids() { + return this.fluidList.size(); + } + + public void setFluidAmount(int amount1, int index) { + if (this.fluidList.size() <= index) { + while (this.fluidList.size() <= index) { + this.fluidList.add(new FluidStack(FluidRegistry.WATER, 1)); + } + } + this.fluidList.get(index).amount = amount1; + } + + public int getFluidAmount(int index) { + if (this.fluidList.size() <= index || this.fluidList.get(index) == null) { + return 0; + } + return this.fluidList.get(index).amount; + } + + public int getFluidID(int i) { + if (this.fluidList.get(i) == null) { + return -1; + } + return this.fluidList.get(i).getFluid().getID(); + } + + public void sortFluidsByDensity() { + Map sortMap = new HashMap(); + int[] keysArray = new int[fluidList.size()]; + Iterator fli = fluidList.iterator(); + while (fli.hasNext()) { + FluidStack fluid = fli.next(); + if (fluid == null) { + return; + } + int key = Math.round(IHLFluid.getRealDensity(fluid.getFluid()) * 100F); + while (sortMap.containsKey(key)) { + key++; + } + sortMap.put(key, fluid); + keysArray[fluidList.indexOf(fluid)] = key; + } + Arrays.sort(keysArray); + ArrayList newFluidList = new ArrayList(); + for (int i = keysArray.length - 1; i >= 0; i--) { + newFluidList.add(sortMap.get(keysArray[i])); + } + this.fluidList.clear(); + this.fluidList.addAll(newFluidList); + } + + public FluidStack getFluid(int i) { + return this.fluidList.get(i); + } + + public void setTag(String string, int t1_1) { + if (this.getFluid().tag == null) { + this.getFluid().tag = new NBTTagCompound(); + } + this.getFluid().tag.setInteger(string, t1_1); + } + + public void setEmpty() { + this.fluidList.clear(); + } + + public List getFluidList() { + return this.fluidList; + } + + public void drain(List fluidInputs, boolean doDrain) { + if (fluidInputs != null && !fluidInputs.isEmpty()) { + Iterator fsi = fluidInputs.iterator(); + while (fsi.hasNext()) { + this.drain(fsi.next(), doDrain); + } + } + } + + public void fill(List fluidOutputs, boolean doFill) { + if (fluidOutputs != null && !fluidOutputs.isEmpty()) { + Iterator fsi = fluidOutputs.iterator(); + while (fsi.hasNext()) { + this.fill(fsi.next(), doFill); + } + } + } + + private FluidStack copyWithSize(FluidStack resource, int amount1) { + FluidStack fluid = resource.copy(); + fluid.amount = amount1; + if (resource.tag != null) { + fluid.tag = (NBTTagCompound) resource.tag.copy(); + } + return fluid; + } + + public FluidStack drain(IRecipeInputFluid fluidStack, int amount, boolean doDrain) { + if (fluidList.isEmpty()) { + return null; + } + int drained = amount; + FluidStack fluid = this.getFluidStackWithSameFluid(fluidStack); + if (fluid == null) { + return null; + } + if (fluid.amount < drained) { + drained = fluid.amount; + } + FluidStack stack = copyWithSize(fluid, drained); + if (doDrain) { + fluid.amount -= drained; + if (fluid.amount <= 0) { + this.fluidList.remove(fluid); + } + } + return stack; + } + + public void checkCorrectState() { + if (!this.fluidList.isEmpty()) { + Iterator fsi = this.fluidList.iterator(); + while (fsi.hasNext()) { + FluidStack fs = fsi.next(); + if (fs.amount <= 0) { + fsi.remove(); + } + } + } + } +} diff --git a/src/main/java/ihl/utils/IHLInvSlotDischarge.java b/src/main/java/ihl/utils/IHLInvSlotDischarge.java new file mode 100644 index 0000000..ffa4216 --- /dev/null +++ b/src/main/java/ihl/utils/IHLInvSlotDischarge.java @@ -0,0 +1,83 @@ +package ihl.utils; + +import ic2.api.info.Info; +import ic2.api.item.ElectricItem; +import ic2.core.block.TileEntityInventory; +import ic2.core.block.invslot.InvSlot; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; + +public class IHLInvSlotDischarge extends InvSlot +{ + public int tier; + public boolean allowRedstoneDust; + + public IHLInvSlotDischarge(TileEntityInventory base, int oldStartIndex, InvSlot.Access access, int tier) + { + this(base, oldStartIndex, access, tier, InvSlot.InvSide.ANY); + } + + public IHLInvSlotDischarge(TileEntityInventory base, int oldStartIndex, InvSlot.Access access, int tier, InvSlot.InvSide preferredSide) + { + this(base, oldStartIndex, access, tier, true, preferredSide); + } + + public IHLInvSlotDischarge(TileEntityInventory base, int oldStartIndex, InvSlot.Access access, int tier, boolean allowRedstoneDust, InvSlot.InvSide preferredSide) + { + super(base, "discharge", oldStartIndex, access, 1, preferredSide); + this.allowRedstoneDust = true; + this.tier = tier; + this.allowRedstoneDust = allowRedstoneDust; + } + + @Override + public boolean accepts(ItemStack stack) + { + return stack == null ? false : (stack.getItem() == Items.redstone && !this.allowRedstoneDust ? false : Info.itemEnergy.getEnergyValue(stack) > 0.0D || ElectricItem.manager.discharge(stack, Double.POSITIVE_INFINITY, this.tier, true, true, true) > 0.0D); + } + + public double discharge(double amount, boolean ignoreLimit) + { + if (amount <= 0.0D) + { + throw new IllegalArgumentException("Amount must be > 0."); + } + else + { + ItemStack stack = this.get(0); + + if (stack == null) + { + return 0.0D; + } + else + { + double realAmount = ElectricItem.manager.discharge(stack, amount, this.tier, ignoreLimit, true, false); + + if (realAmount <= 0.0D) + { + realAmount = Info.itemEnergy.getEnergyValue(stack); + + if (realAmount <= 0.0D) + { + return 0.0D; + } + + --stack.stackSize; + + if (stack.stackSize <= 0) + { + this.put(0, (ItemStack)null); + } + } + + return realAmount; + } + } + } + + public void setTier(int tier1) + { + this.tier = tier1; + } +} \ No newline at end of file diff --git a/src/main/java/ihl/utils/IHLItemRenderer.java b/src/main/java/ihl/utils/IHLItemRenderer.java new file mode 100644 index 0000000..0191edb --- /dev/null +++ b/src/main/java/ihl/utils/IHLItemRenderer.java @@ -0,0 +1,297 @@ +package ihl.utils; + +import java.util.Random; + +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemCloth; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.IItemRenderer.ItemRenderType; +import net.minecraftforge.client.MinecraftForgeClient; + +@SideOnly(value = Side.CLIENT) +public class IHLItemRenderer { + private Random random = new Random(); + private RenderBlocks renderBlocks = new RenderBlocks(); + private boolean noRotation=false; + + public IHLItemRenderer(){} + + public IHLItemRenderer(boolean noRotation1) + { + noRotation=noRotation1; + } + + public void doRender(RenderManager renderManager, ItemStack stack, double x, double y, double z) + { + if(stack!=null) + { + if(stack.getItem().isFull3D()) + { + ItemRenderType type = ItemRenderType.ENTITY; + IItemRenderer itemRenderer = MinecraftForgeClient.getItemRenderer(stack, type); + if(itemRenderer!=null) + { + GL11.glPushMatrix(); + GL11.glTranslatef((float)x, (float)y-0.5F, (float)z); + GL11.glScalef(0.5F, 0.5F, 0.5F); + Object[] data={null,null}; + itemRenderer.renderItem(type, stack, data); + GL11.glPopMatrix(); + } + else + { + this.doRenderNative(renderManager, stack, x, y-0.1F, z); + } + } + else + { + this.doRenderNative(renderManager, stack, x, y-0.1F, z); + } + } + } + + public void doRenderNative(RenderManager renderManager, ItemStack var10, double par2, double par4, double par6) + { + float scale=0.8F; + if (var10.getItem() != null) + { + renderManager.renderEngine.bindTexture(renderManager.renderEngine.getResourceLocation(var10.getItemSpriteNumber())); + this.random.setSeed(187L); + GL11.glPushMatrix(); + byte var13 = 1; + + if (var10.stackSize > 1) + { + var13 = 2; + } + + if (var10.stackSize > 5) + { + var13 = 3; + } + + if (var10.stackSize > 20) + { + var13 = 4; + } + + if (var10.stackSize > 40) + { + var13 = 5; + } + + GL11.glTranslatef((float)par2, (float)par4, (float)par6); + + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float var19; + float var18; + int var24; + + if (var10.getItemSpriteNumber() == 0 && var10.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.getBlockFromItem(var10.getItem()).getRenderType())) + { + Block var21 = Block.getBlockFromItem(var10.getItem()); + + float var25 = 0.25F*scale; + var24 = var21.getRenderType(); + + if (var24 == 1 || var24 == 19 || var24 == 12 || var24 == 2) + { + var25 = 0.5F*scale; + } + + if (var21.getRenderBlockPass() > 0) + { + GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + } + + GL11.glScalef(var25, var25, var25); + + for (int var26 = 0; var26 < var13; ++var26) + { + GL11.glPushMatrix(); + + if (var26 > 0) + { + var18 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.2F / var25; + var19 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.2F / var25; + float var20 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.2F / var25; + GL11.glTranslatef(var18, var19, var20); + } + + this.renderBlocks.renderBlockAsItem(var21, var10.getItemDamage(), 1.0F); + GL11.glPopMatrix(); + } + + if (var21.getRenderBlockPass() > 0) + { + GL11.glDisable(GL11.GL_BLEND); + } + } + else + { + float var17; + + if (var10.getItemSpriteNumber() == 1 && var10.getItem().requiresMultipleRenderPasses()) + { + GL11.glScalef(0.5F*scale, 0.5F*scale, 0.5F*scale); + + for (int var23 = 0; var23 <= 1; ++var23) + { + this.random.setSeed(187L); + IIcon var22 = var10.getItem().getIconFromDamageForRenderPass(var10.getItemDamage(), var23); + var24 = var10.getItem().getColorFromItemStack(var10, var23); + var17 = (var24 >> 16 & 255) / 255.0F; + var18 = (var24 >> 8 & 255) / 255.0F; + var19 = (var24 & 255) / 255.0F; + GL11.glColor4f(var17, var18, var19, 1.0F); + this.renderDroppedItem(renderManager, var10, var22, var13, var17, var18, var19); + + } + } + else + { + if (var10 != null && var10.getItem() instanceof ItemCloth) + { + GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + } + GL11.glScalef(0.5F*scale, 0.5F*scale, 0.5F*scale); + IIcon var14 = var10.getIconIndex(); + int var15 = var10.getItem().getColorFromItemStack(var10, 0); + float var16 = (var15 >> 16 & 255) / 255.0F; + var17 = (var15 >> 8 & 255) / 255.0F; + var18 = (var15 & 255) / 255.0F; + this.renderDroppedItem(renderManager, var10, var14, var13, var16, var17, var18); + if (var10 != null && var10.getItem() instanceof ItemCloth) + { + GL11.glDisable(GL11.GL_BLEND); + } + } + } + + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + GL11.glPopMatrix(); + } + } + + private void renderDroppedItem(RenderManager renderManager, ItemStack stack, IIcon par2Icon, int par3, float par5, float par6, float par7) + { + Tessellator var8 = Tessellator.instance; + + if (par2Icon == null) + { + TextureManager var9 = Minecraft.getMinecraft().getTextureManager(); + ResourceLocation var10 = var9.getResourceLocation(stack.getItemSpriteNumber()); + par2Icon = ((TextureMap)var9.getTexture(var10)).getAtlasSprite("missingno"); + } + + float var25 = par2Icon.getMinU(); + float var26 = par2Icon.getMaxU(); + float var11 = par2Icon.getMinV(); + float var12 = par2Icon.getMaxV(); + float var13 = 1.0F; + float var14 = 0.5F; + float var15 = 0.25F; + float var17; + + if (renderManager.options.fancyGraphics) + { + GL11.glPushMatrix(); + + //GL11.glRotatef((this.random .nextFloat() * 2.0F - 1.0F) * (180F / (float)Math.PI), 0.0F, 1.0F, 0.0F); + + float var16 = 0.0625F; + var17 = 0.021875F; + ItemStack var18 = stack; + int var19 = var18.stackSize; + byte var24; + + if (var19 < 2) + { + var24 = 1; + } + else if (var19 < 16) + { + var24 = 2; + } + else if (var19 < 32) + { + var24 = 3; + } + else + { + var24 = 4; + } + + GL11.glTranslatef(-var14, -var15, -((var16 + var17) * var24 / 2.0F)); + + for (int var20 = 0; var20 < var24; ++var20) + { + GL11.glTranslatef(0.0F, 0.0F, var16 + var17); + + if (var18.getItemSpriteNumber() == 0) + { + renderManager.renderEngine.bindTexture(TextureMap.locationBlocksTexture); + } + else + { + renderManager.renderEngine.bindTexture(TextureMap.locationItemsTexture); + } + + GL11.glColor4f(par5, par6, par7, 1.0F); + ItemRenderer.renderItemIn2D(var8, var26, var11, var25, var12, par2Icon.getIconWidth(), par2Icon.getIconHeight(), var16); + } + + GL11.glPopMatrix(); + } + else + { + for (int var27 = 0; var27 < par3; ++var27) + { + GL11.glPushMatrix(); + + if (var27 > 0) + { + var17 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.3F; + float var29 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.3F; + float var28 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.3F; + GL11.glTranslatef(var17, var29, var28); + } + if(!noRotation) + { + GL11.glRotatef(180.0F - renderManager.playerViewY, 0.0F, 1.0F, 0.0F); + } + GL11.glColor4f(par5, par6, par7, 1.0F); + var8.startDrawingQuads(); + var8.setNormal(0.0F, 1.0F, 0.0F); + var8.addVertexWithUV(0.0F - var14, 0.0F - var15, 0.0D, var25, var12); + var8.addVertexWithUV(var13 - var14, 0.0F - var15, 0.0D, var26, var12); + var8.addVertexWithUV(var13 - var14, 1.0F - var15, 0.0D, var26, var11); + var8.addVertexWithUV(0.0F - var14, 1.0F - var15, 0.0D, var25, var11); + var8.draw(); + GL11.glPopMatrix(); + } + } + } + +} diff --git a/src/main/java/ihl/utils/IHLMathUtils.java b/src/main/java/ihl/utils/IHLMathUtils.java new file mode 100644 index 0000000..8cab3c9 --- /dev/null +++ b/src/main/java/ihl/utils/IHLMathUtils.java @@ -0,0 +1,103 @@ +package ihl.utils; + +public class IHLMathUtils { + private final static int accuracy_level = 1024; + private final static float[] sqrt_table = new float[accuracy_level]; + + public static float sqrt(float value) { + float value1 = value; + int multiplier = 1; + while (value1 >= 1.0f) { + multiplier=multiplier<<2; + value1 = value / (multiplier * multiplier); + } + return multiplier * sqrt_table[(int) (value1 * accuracy_level)]; + } + + 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 { + for (int i = 0; i < accuracy_level; i++) { + sqrt_table[i] = (float) Math.sqrt((double) i / accuracy_level); + } + } + + public static float[] vector_return_difference(double[] v1, double[] v2) { + return new float[] { (float) (v1[0] - v2[0]), (float) (v1[1] - v2[1]), (float) (v1[2] - v2[2]) }; + } + + public static float[] vector_return_difference(float[] v1, double[] v2) { + return new float[] { (float) (v1[0] - v2[0]), (float) (v1[1] - v2[1]), (float) (v1[2] - v2[2]) }; + } + + public static float[] vector_return_difference(int[] v1, double[] v2) { + return new float[] { (float) (v1[0] - v2[0]), (float) (v1[1] - v2[1]), (float) (v1[2] - v2[2]) }; + } + + public static void multiply_vector_to_value(float[] v1, float v2) { + v1[0] *= v2; + v1[1] *= v2; + v1[2] *= v2; + } + + public static void vector_add(double[] v1, float[] v2) { + v1[0] += v2[0]; + v1[1] += v2[1]; + v1[2] += v2[2]; + } + + public static float[] get_triangle_normal(double[][] triangle1) { + float[] v1 = vector_return_difference(triangle1[1], triangle1[0]); + float[] v2 = vector_return_difference(triangle1[2], triangle1[0]); + return vector_vector_multiply(v1, v2); + } + + public static int sign(int value) { + if (value > 0) + return 1; + else if (value < 0) + return -1; + else + return 0; + } + +} diff --git a/src/main/java/ihl/utils/IHLRenderUtils.java b/src/main/java/ihl/utils/IHLRenderUtils.java new file mode 100644 index 0000000..d0d13f4 --- /dev/null +++ b/src/main/java/ihl/utils/IHLRenderUtils.java @@ -0,0 +1,819 @@ +package ihl.utils; + +import java.nio.FloatBuffer; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ic2.core.util.DrawUtil; +import ihl.IHLMod; +import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.client.renderer.GLAllocation; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.StatCollector; +import net.minecraftforge.client.event.DrawBlockHighlightEvent; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; + +@SideOnly(value = Side.CLIENT) +public class IHLRenderUtils +{ + private FloatBuffer colorBuffer; + private Map frameTooltipMap; + private int displayScaledWidth=-1; + private int displayScaledHeight=-1; + private int guiXPos=-1; + private int guiYPos=-1; + private int prevDisplayWidth=-1; + private int prevDisplayHeight=-1; + private final int guiContainerWidth = 166; + private final int guiContainerHeight = 176; + private float lastPlayerYaw; + private float lastPlayerPitch; + public double renderMinX=0d; + public double renderMaxX=1d; + public double renderMinY=0d; + public double renderMaxY=1d; + public double renderMinZ=0d; + public double renderMaxZ=1d; + public boolean renderFromInside=false; + private float rotationPointX; + private float rotationPointY; + private float rotationPointZ; + private double renderPositionX; + private double renderPositionY; + private double renderPositionZ; + private float rotationX; + private float rotationY; + private float rotationZ; + private float scale=1/16f; + public boolean swapXandZ=false; + public boolean swapXandY=false; + public boolean swapYandZ=false; + public boolean swapRenderBoundsX=false; + public boolean swapRenderBoundsY=false; + public boolean swapRenderBoundsZ=false; + public int scaleFactor=1; + public static IHLRenderUtils instance; + + public IHLRenderUtils() + { + instance=this; + colorBuffer = GLAllocation.createDirectFloatBuffer(16); + frameTooltipMap = new HashMap(); + } + + public void renderIHLFluidTank(IHLFluidTank fluidTank, int x1, int y1, int x2, int y2, float zLevel, int par1, int par2, int xOffset, int yOffset) + { + int liquidHeight = 0; + int prevLiquidHeight = 0; + int i = y2-y1; + Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture); + GL11.glEnable(GL11.GL_BLEND); + GL11.glColor4f(1f, 1f, 1f, 1f); + for(int i2 = 0;i2 fli = fluidTank.getFluidList(); + for(int i=fli.size()-1;i>=0;i--) + { + FluidStack fluidStack = fli.get(i); + fluidListNames+=StatCollector.translateToLocal(fluidStack.getUnlocalizedName())+": "+fluidStack.amount+"mB /n "; + } + drawTooltip(par1,par2,x2-x1,y2-y1,x1,y1,fluidListNames); + } + + public boolean drawTooltip(int cursorPosX, int cursorPosY, int width, int height, int xPos, int yPos, String text) + { + updateScreenSize(); + long key = xPos+yPos*1024; + Integer frame=0; + if(frameTooltipMap.containsKey(key)) + { + frame=frameTooltipMap.get(key); + } + boolean showString=true; + if(cursorPosXxPos+width|| + cursorPosYyPos+height) + { + if(frame>0) + { + frame-=20; + frameTooltipMap.put(key, frame); + } + showString=false; + } + else + { + frame+=10; + frameTooltipMap.put(key, frame); + } + if(frame>0) + { + int strokeHeight=15; + int i,x1,x2,y1,y2,tooltipWidth,tooltipHeight; + tooltipWidth=tooltipHeight=0; + String[] splittedText = text.split(" /n "); + for(i=0;itooltipWidth) + { + tooltipWidth=Math.min(frame,Minecraft.getMinecraft().fontRenderer.getStringWidth(splittedText[i])+8); + } + } + tooltipHeight=Math.min(Math.max(frame-tooltipWidth,strokeHeight),strokeHeight*splittedText.length); + x1=cursorPosX-xPos; + x2=x1+tooltipWidth; + y1=cursorPosY-guiYPos+18; + y2=y1+tooltipHeight; + GL11.glPushAttrib(16704); + GL11.glDisable(GL11.GL_DEPTH_TEST); + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + if(showString) + { + drawRectangle(Tessellator.instance, x1,y1,x2,y2,128); + GL11.glEnable(GL11.GL_TEXTURE_2D); + for(i=0;i>> 24 & 255, color >>> 16 & 255, color >>> 8 & 255, color & 255); + tessellator.addVertex(x2, y1, 300.0D); + tessellator.addVertex(x1, y1, 300.0D); + tessellator.addVertex(x1, y2, 300.0D); + tessellator.addVertex(x2, y2, 300.0D); + tessellator.draw(); + } + + public void drawThermometerTemperature(long temperature, boolean show) + { + updateScreenSize(); + long key = 0; + int frame=0; + if(frameTooltipMap.containsKey(key)) + { + frame=frameTooltipMap.get(key); + } + if(frame<=0) + { + updatePlayerView(); + } + boolean showString=true; + if(show && frame<=122) + { + frame+=1; + frameTooltipMap.put(key, frame); + } + else + { + if(frame>0) + { + frame-=2; + frameTooltipMap.put(key, frame); + } + showString=false; + } + if(frame>0) + { + int width=Math.min(frame, 122); + int height=Math.min(frame, 48); + int xShift = Math.round(displayScaledWidth/100*(lastPlayerYaw - Minecraft.getMinecraft().renderViewEntity.prevRotationYaw)); + int yShift = Math.round(displayScaledHeight/64*(lastPlayerPitch - Minecraft.getMinecraft().renderViewEntity.prevRotationPitch)); + int xPos = displayScaledWidth/2+xShift; + int yPos = displayScaledHeight/2-48+yShift; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + drawTexturedModalRect(xPos,yPos,0,0,width,height); + GL11.glDisable(GL11.GL_DEPTH_TEST); + if(showString) + { + Minecraft.getMinecraft().fontRenderer.drawStringWithShadow(temperature+"\u00B0K", xPos+35, yPos+3, 16768125); + } + GL11.glEnable(GL11.GL_DEPTH_TEST); + GL11.glDisable(GL11.GL_BLEND); + } + } + + public void drawTexturedModalRect(int x1, int y1, int u, int v, int x2, int y2) { + float f = 0.00390625F; + float f1 = 0.00390625F; + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawingQuads(); + tessellator.setColorRGBA_F(1f, 1f, 1f, 0.5f); + tessellator.addVertexWithUV(x1 + 0, y1 + y2, 300D, (u + 0) * f, (v + y2) * f1); + tessellator.addVertexWithUV(x1 + x2, y1 + y2, 300D, (u + x2) * f, (v + y2) * f1); + tessellator.addVertexWithUV(x1 + x2, y1 + 0, 300D, (u + x2) * f, (v + 0) * f1); + tessellator.addVertexWithUV(x1 + 0, y1 + 0, 300D, (u + 0) * f, (v + 0) * f1); + tessellator.draw(); + } + + + public void updateScreenSize() + { + if(prevDisplayHeight!=Minecraft.getMinecraft().displayHeight || prevDisplayWidth!=Minecraft.getMinecraft().displayWidth) + { + ScaledResolution var2 = new ScaledResolution(Minecraft.getMinecraft(), Minecraft.getMinecraft().displayWidth, Minecraft.getMinecraft().displayHeight); + displayScaledWidth = var2.getScaledWidth(); + displayScaledHeight = var2.getScaledHeight(); + scaleFactor=var2.getScaleFactor(); + guiXPos = (displayScaledWidth - guiContainerWidth)/2; + guiYPos = (displayScaledHeight - guiContainerHeight)/2; + prevDisplayWidth=Minecraft.getMinecraft().displayWidth; + prevDisplayHeight=Minecraft.getMinecraft().displayHeight; + } + } + + public void updatePlayerView() + { + lastPlayerYaw = Minecraft.getMinecraft().renderViewEntity.prevRotationYaw; + lastPlayerPitch = Minecraft.getMinecraft().renderViewEntity.prevRotationPitch; + } + + public void drawKnee(double xPos, double yPos, double zPos, ForgeDirection direction12, ForgeDirection direction22, double radius1, double radius2, IIcon icon) + { + ForgeDirection direction1=direction12; + ForgeDirection direction2=direction22; + if(this.swapRenderBoundsX) + { + if(direction1.offsetX!=0) + { + direction1=direction1.getOpposite(); + } + if(direction2.offsetX!=0) + { + direction2=direction2.getOpposite(); + } + } + if(this.swapRenderBoundsY) + { + if(direction1.offsetY!=0) + { + direction1=direction1.getOpposite(); + } + if(direction2.offsetY!=0) + { + direction2=direction2.getOpposite(); + } + } + if(this.swapRenderBoundsZ) + { + if(direction1.offsetZ!=0) + { + direction1=direction1.getOpposite(); + } + if(direction2.offsetZ!=0) + { + direction2=direction2.getOpposite(); + } + } + double[][] outervertexes1 = new double[8][3]; + double[][] innervertexes1 = new double[8][3]; + double[][] outervertexes2 = new double[8][3]; + double[][] innervertexes2 = new double[8][3]; + int i=0; + for(i=0;i<8;i++) + { + if(direction1.equals(direction2)) + { + switch(direction1) + { + case UP: + outervertexes1[i] = new double[] {0.5F+0.5F*(float)Math.cos(2D*Math.PI/8D*i), 0d, 0.5F+0.5F*(float)Math.sin(2D*Math.PI/8D*i)}; + innervertexes1[i] = new double[] {0.5F+radius1*0.5F*(float)Math.cos(2D*Math.PI/8D*i), 0d, 0.5F+0.5F*radius1*(float)Math.sin(2D*Math.PI/8D*i)}; + outervertexes2[i] = new double[] {0.5F+0.5F*radius2*(float)Math.cos(2D*Math.PI/8D*i), 1d, 0.5F+0.5F*radius2*(float)Math.sin(2D*Math.PI/8D*i)}; + innervertexes2[i] = new double[] {0.5F+radius1*radius2*0.5F*(float)Math.cos(2D*Math.PI/8D*i), 1d, 0.5F+0.5F*radius2*radius1*(float)Math.sin(2D*Math.PI/8D*i)}; + break; + case DOWN: + outervertexes1[i] = new double[] {0.5F+0.5F*radius2*(float)Math.cos(2D*Math.PI/8D*i), 0d, 0.5F+0.5F*radius2*(float)Math.sin(2D*Math.PI/8D*i)}; + innervertexes1[i] = new double[] {0.5F+radius1*radius2*0.5F*(float)Math.cos(2D*Math.PI/8D*i), 0d, 0.5F+0.5F*radius1*radius2*(float)Math.sin(2D*Math.PI/8D*i)}; + outervertexes2[i] = new double[] {0.5F+0.5F*(float)Math.cos(2D*Math.PI/8D*i), 1d, 0.5F+0.5F*(float)Math.sin(2D*Math.PI/8D*i)}; + innervertexes2[i] = new double[] {0.5F+radius1*0.5F*(float)Math.cos(2D*Math.PI/8D*i), 1d, 0.5F+0.5F*radius1*(float)Math.sin(2D*Math.PI/8D*i)}; + break; + case SOUTH: + outervertexes1[i] = new double[] {0.5F+0.5F*(float)Math.cos(2D*Math.PI/8D*i), 0.5F+0.5F*(float)Math.sin(2D*Math.PI/8D*i), 1d}; + innervertexes1[i] = new double[] {0.5F+radius1*0.5F*(float)Math.cos(2D*Math.PI/8D*i), 0.5F+0.5F*radius1*(float)Math.sin(2D*Math.PI/8D*i), 1d}; + outervertexes2[i] = new double[] {0.5F+0.5F*radius2*(float)Math.cos(2D*Math.PI/8D*i), 0.5F+0.5F*radius2*(float)Math.sin(2D*Math.PI/8D*i), 0d}; + innervertexes2[i] = new double[] {0.5F+radius1*radius2*0.5F*(float)Math.cos(2D*Math.PI/8D*i), 0.5F+0.5F*radius1*radius2*(float)Math.sin(2D*Math.PI/8D*i), 0d}; + break; + case NORTH: + outervertexes1[i] = new double[] {0.5F+0.5F*radius2*(float)Math.cos(2D*Math.PI/8D*i), 0.5F+0.5F*radius2*(float)Math.sin(2D*Math.PI/8D*i), 1d}; + innervertexes1[i] = new double[] {0.5F+radius1*radius2*0.5F*(float)Math.cos(2D*Math.PI/8D*i), 0.5F+0.5F*radius1*radius2*(float)Math.sin(2D*Math.PI/8D*i), 1d}; + outervertexes2[i] = new double[] {0.5F+0.5F*(float)Math.cos(2D*Math.PI/8D*i), 0.5F+0.5F*(float)Math.sin(2D*Math.PI/8D*i), 0d}; + innervertexes2[i] = new double[] {0.5F+radius1*0.5F*(float)Math.cos(2D*Math.PI/8D*i), 0.5F+0.5F*radius1*(float)Math.sin(2D*Math.PI/8D*i), 0d}; + break; + case EAST: + outervertexes1[i] = new double[] {0d, 0.5F+0.5F*(float)Math.sin(2D*Math.PI/8D*i), 0.5F+0.5F*(float)Math.cos(2D*Math.PI/8D*i)}; + innervertexes1[i] = new double[] {0d, 0.5F+0.5F*radius1*(float)Math.sin(2D*Math.PI/8D*i), 0.5F+radius1*0.5F*(float)Math.cos(2D*Math.PI/8D*i)}; + outervertexes2[i] = new double[] {1d, 0.5F+0.5F*radius2*(float)Math.sin(2D*Math.PI/8D*i), 0.5F+0.5F*radius2*(float)Math.cos(2D*Math.PI/8D*i)}; + innervertexes2[i] = new double[] {1d, 0.5F+0.5F*radius1*radius2*(float)Math.sin(2D*Math.PI/8D*i), 0.5F+radius1*radius2*0.5F*(float)Math.cos(2D*Math.PI/8D*i)}; + break; + case WEST: + outervertexes1[i] = new double[] {0d, 0.5F+0.5F*radius2*(float)Math.sin(2D*Math.PI/8D*i), 0.5F+0.5F*radius2*(float)Math.cos(2D*Math.PI/8D*i)}; + innervertexes1[i] = new double[] {0d, 0.5F+0.5F*radius2*radius1*(float)Math.sin(2D*Math.PI/8D*i), 0.5F+radius1*0.5F*radius2*(float)Math.cos(2D*Math.PI/8D*i)}; + outervertexes2[i] = new double[] {1d, 0.5F+0.5F*(float)Math.sin(2D*Math.PI/8D*i), 0.5F+0.5F*(float)Math.cos(2D*Math.PI/8D*i)}; + innervertexes2[i] = new double[] {1d, 0.5F+0.5F*radius1*(float)Math.sin(2D*Math.PI/8D*i), 0.5F+radius1*0.5F*(float)Math.cos(2D*Math.PI/8D*i)}; + break; + default: + outervertexes1[i] = new double[] {0.5F+0.5F*(float)Math.cos(2D*Math.PI/8D*i), 0d, 0.5F+0.5F*(float)Math.sin(2D*Math.PI/8D*i)}; + innervertexes1[i] = new double[] {0.5F+radius1*0.5F*(float)Math.cos(2D*Math.PI/8D*i), 0d, 0.5F+0.5F*radius1*(float)Math.sin(2D*Math.PI/8D*i)}; + outervertexes2[i] = new double[] {0.5F+0.5F*radius2*(float)Math.cos(2D*Math.PI/8D*i), 1d, 0.5F+0.5F*radius2*(float)Math.sin(2D*Math.PI/8D*i)}; + innervertexes2[i] = new double[] {0.5F+radius1*radius2*0.5F*(float)Math.cos(2D*Math.PI/8D*i), 1d, 0.5F+0.5F*radius2*radius1*(float)Math.sin(2D*Math.PI/8D*i)}; + break; + } + + } + else + { + switch(direction1) + { + case UP: + outervertexes1[i] = new double[] {0.5F+0.25F*radius2*(float)Math.cos(2D*Math.PI/8D*i+Math.PI), 1d, 0.5F-0.25F*radius2*(float)Math.sin(2D*Math.PI/8D*i+Math.PI)}; + innervertexes1[i] = new double[] {0.5F+radius1*radius2*0.25F*(float)Math.cos(2D*Math.PI/8D*i+Math.PI), 1d, 0.5F-0.25F*radius1*radius2*(float)Math.sin(2D*Math.PI/8D*i+Math.PI)}; + break; + case DOWN: + outervertexes1[i] = new double[] {0.5F+0.25F*(float)Math.cos(2D*Math.PI/8D*i), 0d, 0.5F+0.25F*(float)Math.sin(2D*Math.PI/8D*i)}; + innervertexes1[i] = new double[] {0.5F+radius1*0.25F*(float)Math.cos(2D*Math.PI/8D*i), 0d, 0.5F+0.25F*radius1*(float)Math.sin(2D*Math.PI/8D*i)}; + break; + case SOUTH: + outervertexes1[i] = new double[] {0.5F+0.25F*(float)Math.cos(2D*Math.PI/8D*i), 0.5F+0.25F*(float)Math.sin(2D*Math.PI/8D*i), 1d}; + innervertexes1[i] = new double[] {0.5F+radius1*0.25F*(float)Math.cos(2D*Math.PI/8D*i), 0.5F+0.25F*radius1*(float)Math.sin(2D*Math.PI/8D*i), 1d}; + break; + case NORTH: + outervertexes1[i] = new double[] {0.5F+0.25F*radius2*(float)Math.cos(2D*Math.PI/8D*i), 0.5F+0.25F*radius2*(float)Math.sin(2D*Math.PI/8D*i), 1d}; + innervertexes1[i] = new double[] {0.5F+radius1*radius2*0.25F*(float)Math.cos(2D*Math.PI/8D*i), 0.5F+0.25F*radius1*radius2*(float)Math.sin(2D*Math.PI/8D*i), 1d}; + break; + case EAST: + outervertexes1[i] = new double[] {0d, 0.5F+0.25F*(float)Math.sin(2D*Math.PI/8D*i), 0.5F+0.25F*(float)Math.cos(2D*Math.PI/8D*i)}; + innervertexes1[i] = new double[] {0d, 0.5F+0.25F*radius1*(float)Math.sin(2D*Math.PI/8D*i), 0.5F+radius1*0.25F*(float)Math.cos(2D*Math.PI/8D*i)}; + break; + case WEST: + outervertexes1[i] = new double[] {0d, 0.5F+0.25F*radius2*(float)Math.sin(2D*Math.PI/8D*i), 0.5F+0.52F*radius2*(float)Math.cos(2D*Math.PI/8D*i)}; + innervertexes1[i] = new double[] {0d, 0.5F+0.25F*radius2*radius1*(float)Math.sin(2D*Math.PI/8D*i), 0.5F+radius1*0.25F*radius2*(float)Math.cos(2D*Math.PI/8D*i)}; + break; + default: + outervertexes1[i] = new double[] {0d, 0.5F+0.25F*radius2*(float)Math.sin(2D*Math.PI/8D*i), 0.5F+0.52F*radius2*(float)Math.cos(2D*Math.PI/8D*i)}; + innervertexes1[i] = new double[] {0d, 0.5F+0.25F*radius2*radius1*(float)Math.sin(2D*Math.PI/8D*i), 0.5F+radius1*0.25F*radius2*(float)Math.cos(2D*Math.PI/8D*i)}; + break; + } + + switch(direction2) + { + case UP: + outervertexes2[i] = new double[] {0.5F+0.5F*radius2*(float)Math.cos(2D*Math.PI/8D*i), 1d, 0.5F+0.5F*radius2*(float)Math.sin(2D*Math.PI/8D*i)}; + innervertexes2[i] = new double[] {0.5F+radius1*radius2*0.5F*(float)Math.cos(2D*Math.PI/8D*i), 1d, 0.5F+0.5F*radius2*radius1*(float)Math.sin(2D*Math.PI/8D*i)}; + break; + case DOWN: + outervertexes2[i] = new double[] {0.5F+0.5F*(float)Math.cos(2D*Math.PI/8D*i), 1d, 0.5F+0.5F*(float)Math.sin(2D*Math.PI/8D*i)}; + innervertexes2[i] = new double[] {0.5F+radius1*0.5F*(float)Math.cos(2D*Math.PI/8D*i), 1d, 0.5F+0.5F*radius1*(float)Math.sin(2D*Math.PI/8D*i)}; + break; + case WEST: + outervertexes2[i] = new double[] {1d, 0.5F+0.25F*(float)Math.cos(2D*Math.PI/8D*i), 0.5F-0.25F*(float)Math.sin(2D*Math.PI/8D*i)}; + innervertexes2[i] = new double[] {1d, 0.5F+radius1*0.25F*(float)Math.cos(2D*Math.PI/8D*i), 0.5F-0.25F*radius1*(float)Math.sin(2D*Math.PI/8D*i)}; + break; + case EAST: + outervertexes2[i] = new double[] {0d, 0.5F+0.25F*(float)Math.cos(2D*Math.PI/8D*i), 0.5F+0.25F*(float)Math.sin(2D*Math.PI/8D*i)}; + innervertexes2[i] = new double[] {0d, 0.5F+radius1*0.25F*(float)Math.cos(2D*Math.PI/8D*i), 0.5F+0.25F*radius1*(float)Math.sin(2D*Math.PI/8D*i)}; + break; + case NORTH: + outervertexes2[i] = new double[] {0.5F+0.25F*(float)Math.cos(2D*Math.PI/8D*i), 1d-0.5F-0.25F*(float)Math.sin(2D*Math.PI/8D*i), 1d}; + innervertexes2[i] = new double[] {0.5F+radius1*0.25F*(float)Math.cos(2D*Math.PI/8D*i), 1d-0.5F-0.25F*radius1*(float)Math.sin(2D*Math.PI/8D*i), 1d}; + break; + case SOUTH: + outervertexes2[i] = new double[] {0.5F+0.25F*(float)Math.cos(2D*Math.PI/8D*i), 0.5F+0.25F*(float)Math.sin(2D*Math.PI/8D*i), 0d}; + innervertexes2[i] = new double[] {0.5F+radius1*0.25F*(float)Math.cos(2D*Math.PI/8D*i), 0.5F+0.25F*radius1*(float)Math.sin(2D*Math.PI/8D*i), 0d}; + break; + default: + outervertexes2[i] = new double[] {0.5F+0.5F*radius2*(float)Math.cos(2D*Math.PI/8D*i), 1d, 0.5F+0.5F*radius2*(float)Math.sin(2D*Math.PI/8D*i)}; + innervertexes2[i] = new double[] {0.5F+radius1*radius2*0.5F*(float)Math.cos(2D*Math.PI/8D*i), 1d, 0.5F+0.5F*radius2*radius1*(float)Math.sin(2D*Math.PI/8D*i)}; + break; + } + + } + } + double[][][] quadList = new double[32][4][3]; + for(i=0;i<32;i++) + { + if(i<7) + { + quadList[i]=new double[][] {outervertexes1[i],outervertexes1[i+1],innervertexes1[i+1],innervertexes1[i]}; + } + else if(i==7) + { + quadList[i]=new double[][] {outervertexes1[i],outervertexes1[0],innervertexes1[0],innervertexes1[i]}; + } + else if(i<15) + { + quadList[i]=new double[][] {innervertexes2[i-8],innervertexes2[i+1-8],outervertexes2[i+1-8],outervertexes2[i-8]}; + } + else if(i==15) + { + quadList[i]=new double[][] {innervertexes2[i-8],innervertexes2[0],outervertexes2[0],outervertexes2[i-8]}; + } + else if(i<23) + { + quadList[i]=new double[][] {outervertexes1[i-16],outervertexes2[i-16],outervertexes2[i-16+1],outervertexes1[i-16+1]}; + } + else if(i==23) + { + quadList[i]=new double[][] {outervertexes1[i-16],outervertexes2[i-16],outervertexes2[0],outervertexes1[0]}; + } + else if(i<31) + { + quadList[i]=new double[][] {innervertexes1[i-24+1],innervertexes2[i-24+1], innervertexes2[i-24], innervertexes1[i-24]}; + } + else if(i==31) + { + quadList[i]=new double[][] {innervertexes1[0],innervertexes2[0],innervertexes2[i-24],innervertexes1[i-24]}; + } + } + for(i=0;i<32;i++) + { + this.drawSquare(xPos, yPos, zPos, quadList[i], icon); + } + + + } + public void drawPipe(double xPos, double yPos, double zPos, ForgeDirection direction1, double radius1, double radius2, IIcon icon) + { + this.drawKnee(xPos, yPos, zPos, direction1, direction1, radius1, radius2, icon); + } + + public void drawSquare(double xPos, double yPos, double zPos, double[][] vertexes, IIcon icon) + { + 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); + double v1 = icon.getInterpolatedV(16.0D - this.renderMinY * 16.0D); + if (this.renderMinZ < 0.0D || this.renderMaxZ > 1.0D) + { + u1 = icon.getMinU(); + u2 = icon.getMaxU(); + } + if (this.renderMinY < 0.0D || this.renderMaxY > 1.0D) + { + 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=vertexes.length-1; + if(this.renderFromInside) + { + startFrom=vertexes.length-1; + endTo=0; + } + for(int i=startFrom;(i<=endTo&&!this.renderFromInside)||(i>=endTo&&this.renderFromInside);i+=(endTo-startFrom)/3) + { + double vX=vertexes[i][0]*xDelta+this.renderMinX; + double vY=vertexes[i][1]*yDelta+this.renderMinY; + double vZ=vertexes[i][2]*zDelta+this.renderMinZ; + double[] vYZ=null; + double[] vXZ=null; + double[] vXY=null; + if(this.rotationX!=0) + { + vYZ = this.rotateCoordinateByAngle(vY-(this.rotationPointY-8f)*scale, vZ-(this.rotationPointZ+8f)*scale, this.rotationX); + vY=vYZ[0]+(this.rotationPointY-8f)*scale; + vZ=vYZ[1]+(this.rotationPointZ+8f)*scale; + } + if(this.rotationY!=0) + { + vXZ = this.rotateCoordinateByAngle(vX-(this.rotationPointX+8f)*scale, vZ-(this.rotationPointZ+8f)*scale, this.rotationY); + vX=vXZ[0]+(this.rotationPointX+8f)*scale; + vZ=vXZ[1]-(this.rotationPointZ+8f)*scale; + } + if(this.rotationZ!=0) + { + vXY = this.rotateCoordinateByAngle(vX-(this.rotationPointX+8f)*scale, vY-(this.rotationPointY-8f)*scale, this.rotationZ); + vX=vXY[0]+(this.rotationPointX+8f)*scale; + vY=vXY[1]+(this.rotationPointY-8f)*scale; + if(swappingAxisOrBoundsAffectRotationOnAxisZ()) + { + vY-=(this.renderMaxZ-(this.rotationPointZ+8f))*scale*Math.sin(this.rotationZ); + } + } + if(this.swapXandY) + { + double var0 = vX; + vX=vY; + vY=var0; + } + if(this.swapXandZ) + { + double var0 = vX; + vX=vZ; + vZ=var0; + } + if(this.swapYandZ) + { + double var0 = vY; + vY=vZ; + vZ=var0; + } + 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) + { + if(this.swapRenderBoundsX) + { + this.renderMinX = 1-maxX; + this.renderMaxX = 1-minX; + } + else + { + this.renderMinX = minX; + this.renderMaxX = maxX; + } + if(this.swapRenderBoundsY) + { + this.renderMinY = 1-maxY; + this.renderMaxY = 1-minY; + } + else + { + this.renderMinY = minY; + this.renderMaxY = maxY; + } + if(this.swapRenderBoundsZ) + { + this.renderMinZ = 1-maxZ; + this.renderMaxZ = 1-minZ; + } + else + { + this.renderMinZ = minZ; + this.renderMaxZ = maxZ; + } + } + + public void setRotationPoint(float rX, float rY, float rZ) + { + this.rotationPointX=rX; + this.rotationPointY=rY; + this.rotationPointZ=rZ; + } + + public void setPosition(double xPos, double yPos, double zPos) + { + this.renderPositionX=xPos; + this.renderPositionY=yPos; + this.renderPositionZ=zPos; + } + + public void drawPipe(float fx,float fy,float fz, int xSize,int ySize,int zSize, float radius1, float radius2, ForgeDirection direction, IIcon icon) + { + this.setRenderBoundsFromModel(fx, fy, fz, xSize, ySize, zSize); + this.drawPipe(renderPositionX,renderPositionY, renderPositionZ, direction, radius1, radius2, icon); + } + + public void drawKnee(float fx,float fy,float fz, int xSize,int ySize,int zSize, float radius1, float radius2, ForgeDirection direction1, ForgeDirection direction2, IIcon icon) + { + this.setRenderBoundsFromModel(fx, fy, fz, xSize, ySize, zSize); + this.drawKnee(renderPositionX,renderPositionY, renderPositionZ, direction1, direction2, radius1, radius2, icon); + } + + public void drawBox(float fx,float fy,float fz, int xSize,int ySize,int zSize, Block block, int meta, RenderBlocks blockRenderer) + { + this.setRenderBoundsFromModel(fx, fy, fz, xSize, ySize, zSize); + blockRenderer.renderStandardBlock(block, (int)this.renderPositionX, (int)this.renderPositionY, (int)this.renderPositionZ); + } + + public void setRenderBoundsFromModel(float fx,float fy,float fz, int xSize,int ySize,int zSize) + { + float boundMinX=(-this.rotationPointX+8f-fx-xSize)*scale; + float boundMaxX=(-this.rotationPointX+8f-fx)*scale; + float boundMinZ=(-this.rotationPointZ+8f-fz-zSize)*scale; + float boundMaxZ=(-this.rotationPointZ+8f-fz)*scale; + float boundMinY=(this.rotationPointY-8f-fy-ySize)*scale; + float boundMaxY=(this.rotationPointY-8f-fy)*scale; + this.setRenderBounds(boundMinX, boundMinY, boundMinZ, boundMaxX, boundMaxY, boundMaxZ); + } + + public double[] rotateCoordinateByAngle(double coord1, double coord2, double angle) + { + double r = Math.sqrt(coord2*coord2+coord1*coord1); + double alpha0=Math.asin(coord2/r); + if(coord1<0d) + { + alpha0=Math.PI-Math.asin(coord2/r); + } + double alpha2=alpha0+angle; + double coord21=Math.sin(alpha2)*r; + double coord11=Math.cos(alpha2)*r; + return new double[]{coord11,coord21}; + } + + public void setRotation(float rotationX1, float rotationY1, float rotationZ1) + { + if(this.swapRenderBoundsX) + { + this.rotationX=-rotationX1; + } + else + { + this.rotationX=rotationX1; + } + if(this.swapRenderBoundsY) + { + this.rotationY=-rotationY1; + } + else + { + this.rotationY=rotationY1; + } + if(swappingAxisOrBoundsAffectRotationOnAxisZ()) + { + this.rotationZ=-rotationZ1; + } + else + { + this.rotationZ=rotationZ1; + } + } + + public void reset() + { + this.renderFromInside=false; + this.swapXandZ=false; + this.swapXandY=false; + this.swapYandZ=false; + this.swapRenderBoundsX=false; + this.swapRenderBoundsY=false; + this.swapRenderBoundsZ=false; + this.setRotation(0f, 0f, 0f); + this.setRotationPoint(0f, 0f, 0f); + } + + private boolean swappingAxisOrBoundsAffectRotationOnAxisZ() + { + return (this.swapRenderBoundsZ && !this.swapXandZ && !this.swapYandZ)|| + (this.swapRenderBoundsX && this.swapXandZ) || + (this.swapRenderBoundsY && this.swapYandZ); + } + + public List splitStringByWidth(String string, int stringWidth) + { + List output = new ArrayList(); + StringBuffer sb = new StringBuffer(); + String[] splittedBySpaces = string.split(" "); + for(String word:splittedBySpaces) + { + if(!word.contains("/n") && getStringWidth(sb)+getStringWidth(word) ihlItemStackRegistry = new HashMap(); + private static final String Digits = "(\\p{Digit}+)"; + private static final String HexDigits = "(\\p{XDigit}+)"; + private static final String Exp = "[eE][+-]?" + Digits; + private static final String fpRegex = ("[\\x00-\\x20]*" + // Optional + // leading + // "whitespace" + "[+-]?(" + // Optional sign character + "NaN|" + // "NaN" string + "Infinity|" + // "Infinity" string + "(((" + Digits + "(\\.)?(" + Digits + "?)(" + Exp + ")?)|" + "(\\.(" + Digits + ")(" + Exp + ")?)|" + "((" + + "(0[xX]" + HexDigits + "(\\.)?)|" + "(0[xX]" + HexDigits + "?(\\.)" + HexDigits + ")" + ")[pP][+-]?" + + Digits + "))" + "[fFdD]?))" + "[\\x00-\\x20]*");// Optional + // trailing + // "whitespace" + + public static void registerLocally(String name, ItemStack stack) { + ihlItemStackRegistry.put(name, stack); + } + + public static ItemStack getOreDictItemStack(String name) { + ItemStack ore = OreDictionary.getOres(name).get(0); + if (ore == null) + return null; + ItemStack orecopy = ore.copy(); + orecopy.stackSize = 1; + return orecopy; + } + + public static boolean hasOreDictionaryEntry(String name) { + return !OreDictionary.getOres(name).isEmpty(); + } + + public static Item getOreDictItem(String name) { + return OreDictionary.getOres(name).get(0).getItem(); + } + + public static Block getOreDictBlock(String name) { + return Block.getBlockFromItem(OreDictionary.getOres(name).get(0).getItem()); + } + + public static ItemStack getOreDictItemStackWithSize(String name, int size) { + ItemStack ore = OreDictionary.getOres(name).get(0); + if (ore == null) + return null; + ItemStack orecopy = ore.copy(); + orecopy.stackSize = size; + return orecopy; + } + + public static String getFirstOreDictName(ItemStack stack) { + int[] arrayIDs = OreDictionary.getOreIDs(stack); + if (arrayIDs.length > 0) { + return OreDictionary.getOreName(arrayIDs[0]); + } + return ""; + } + + public static ItemStack getThisModItemStack(String name) { + if (ihlItemStackRegistry.get(name) != null) { + return ihlItemStackRegistry.get(name).copy(); + } + if (GameRegistry.findItem("ihl", name) != null) { + return new ItemStack(GameRegistry.findItem("ihl", name)); + } else if (GameRegistry.findBlock("ihl", name) == null) { + throw new IllegalArgumentException("No such item in item registry: ihl:" + name); + } else { + return new ItemStack(GameRegistry.findBlock("ihl", name)); + } + } + + public static ItemStack getThisModItemStackWithSize(String name, int i) { + if (ihlItemStackRegistry.get(name) != null) { + ItemStack stack = ihlItemStackRegistry.get(name).copy(); + stack.stackSize = i; + return stack; + } + if (GameRegistry.findItem("ihl", name) != null) { + return new ItemStack(GameRegistry.findItem("ihl", name), i); + } else if (GameRegistry.findBlock("ihl", name) == null) { + throw new IllegalArgumentException("No such item in item registry: ihl:" + name); + } else { + return new ItemStack(GameRegistry.findBlock("ihl", name), i); + } + } + + 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), quantity, damage); + } else if (GameRegistry.findBlock(modname, name) == null) { + return null; + } else { + return new ItemStack(GameRegistry.findBlock(modname, name), quantity, damage); + } + } + + public static Item getThisModItem(String name) { + if (GameRegistry.findItem("ihl", name) != null) { + return GameRegistry.findItem("ihl", name); + } else if (GameRegistry.findBlock("ihl", name) == null) { + throw new IllegalArgumentException("No such item in item registry: ihl:" + name); + } else { + return Item.getItemFromBlock(GameRegistry.findBlock("ihl", name)); + } + } + + public static FluidStack getFluidStackWithSize(String name, int i) { + if (FluidRegistry.isFluidRegistered(name)) { + return FluidRegistry.getFluidStack(name, i); + } else { + throw new IllegalArgumentException("No such fluid: " + name); + } + } + + public static Block getThisModBlock(String name) { + if (GameRegistry.findBlock("ihl", name) == null) { + throw new IllegalArgumentException("No such block in item registry: ihl:" + name); + } else { + return GameRegistry.findBlock("ihl", name); + } + } + + public static ItemStack getThisModItemStackWithDamage(String name, int value) { + ItemStack stack = getThisModItemStack(name); + stack.setItemDamage(value); + return stack; + } + + public static boolean adjustWireLength(ItemStack stack, int adjustBy) { + int length = getWireLength(stack); + if (length <= 0) { + return true; + } else { + int newLength = Math.max(length + adjustBy, 0); + stack.stackTagCompound.setInteger(((IWire) stack.getItem()).getTag(), newLength); + stack.stackTagCompound.setInteger(((IWire) stack.getItem()).getTagSecondary(), newLength); + if (newLength == 0) { + return true; + } + return false; + } + } + + public static int getWireLength(ItemStack itemStack) { + return itemStack.stackTagCompound.getInteger(((IWire) itemStack.getItem()).getTag()); + } + + public static ItemStack getThisModWireItemStackWithLength(String name, int i) { + if (getThisModItemStack(name) != null) { + ItemStack stack = getThisModItemStack(name); + if (stack.getItem() instanceof IWire) { + stack.stackTagCompound = new NBTTagCompound(); + stack.stackTagCompound.setInteger(((IWire) stack.getItem()).getTag(), i); + stack.stackTagCompound.setInteger(((IWire) stack.getItem()).getTagSecondary(), i); + return stack; + } else { + throw new IllegalArgumentException("ihl:" + name + " is not an instance of IWire."); + } + } else { + throw new IllegalArgumentException("No such item in item registry: ihl:" + name); + } + } + + public static ItemStack getThisModWireItemStackWithLength(ItemStack stack1, int i) { + ItemStack stack = stack1.copy(); + if (stack1.getItem() instanceof IWire) { + stack.stackTagCompound = new NBTTagCompound(); + stack.stackTagCompound.setInteger(((IWire) stack.getItem()).getTag(), i); + stack.stackTagCompound.setInteger(((IWire) stack.getItem()).getTagSecondary(), i); + return stack; + } else { + throw new IllegalArgumentException(stack1.getUnlocalizedName() + " is not an instance of IWire."); + } + } + + public static boolean isItemsHaveSameOreDictionaryEntry(ItemStack is, ItemStack is1) { + int[] odids1 = OreDictionary.getOreIDs(is); + int[] odids2 = OreDictionary.getOreIDs(is1); + if (odids1 != null && odids1.length > 0 && odids2 != null && odids2.length > 0) { + for (int i1 = 0; i1 < odids1.length; i1++) { + for (int i2 = 0; i2 < odids2.length; i2++) { + if (!OreDictionary.getOreName(odids1[i1]).contains("Any") && odids1[i1] == odids2[i2]) { + return true; + } + } + } + } + return false; + } + + public static List getEntryListForOre(String name) { + ArrayList outputList = new ArrayList(); + ArrayList oreList = OreDictionary.getOres(name); + Iterator oreListIterator = oreList.iterator(); + while (oreListIterator.hasNext()) { + outputList.add(oreListIterator.next().copy()); + } + return outputList; + } + + public static ItemStack getItemStackIfExist(String name) { + if (hasOreDictionaryEntry(name)) { + return getOreDictItemStack(name); + } else { + if (ihlItemStackRegistry.get(name) != null) { + return ihlItemStackRegistry.get(name).copy(); + } + if (GameRegistry.findItem("ihl", name) != null) { + return new ItemStack(GameRegistry.findItem("ihl", name)); + } else if (GameRegistry.findBlock("ihl", name) == null) { + return null; + } else { + return new ItemStack(GameRegistry.findBlock("ihl", name)); + } + } + } + + public static FluidStack getFluidStackIfExist(String string, int meltingFluidAmount) { + if (FluidRegistry.isFluidRegistered(string)) { + return getFluidStackWithSize(string, meltingFluidAmount); + } + return null; + } + + public static boolean addItemStackToInventory(EntityPlayer player, ItemStack stack) { + ItemStack[] inv = player.inventory.mainInventory; + for (int i = 0; i <= 35; i++) { + if (inv[i] != null) { + if (inv[i].getItem() == stack.getItem()) { + if (inv[i].getItemDamage() == stack.getItemDamage() + && inv[i].stackSize < inv[i].getMaxStackSize()) { + inv[i].stackSize += stack.stackSize; + if (inv[i].stackSize > inv[i].getMaxStackSize()) { + stack.stackSize = inv[i].stackSize - inv[i].getMaxStackSize(); + } else { + return true; + } + } + } + } else { + inv[i] = stack; + return true; + } + } + return false; + } + + public static FluidStack getFluidStackWithSizeChemicallyPure(String name, int amount) { + FluidStack fstack = getFluidStackWithSize(name, amount); + fstack.tag = new NBTTagCompound(); + fstack.tag.setBoolean("chemicallyPure", true); + return fstack; + } + + public static void removeItemStackFromOreDictionaryEntry(String orename, ItemStack itemStack) { + ArrayList orelist = OreDictionary.getOres(orename); + Iterator oreListIterator = orelist.iterator(); + ItemStack odstack = null; + while (oreListIterator.hasNext()) { + odstack = oreListIterator.next(); + if (odstack.getItem() == itemStack.getItem()) { + break; + } else { + odstack = null; + } + } + if (odstack != null) { + orelist.remove(odstack); + IHLMod.log.debug("Stack " + odstack.getDisplayName() + " (" + odstack.toString() + ")" + + " removed from ore entry '" + orename + "'"); + } + } + + public static void addIC2MaceratorRecipe(String input, ItemStack output) { + if (Recipes.macerator.getOutputFor(getOreDictItemStack(input), false) == null) { + ((BasicMachineRecipeManager) Recipes.macerator).addRecipe(new RecipeInputOreDict(input), + new NBTTagCompound(), true, output); + } else { + // IHLMod.log.info("IC2 macerator recipe for "+input+" already + // exist. Skipped."); + } + } + + public static void addIC2MaceratorRecipe(String input, int stacksize, ItemStack output) { + if (Recipes.macerator.getOutputFor(getOreDictItemStackWithSize(input, stacksize), false) == null) { + ((BasicMachineRecipeManager) Recipes.macerator).addRecipe(new RecipeInputOreDict(input, stacksize), + new NBTTagCompound(), true, output); + } else { + // IHLMod.log.info("IC2 macerator recipe for "+input+" already + // exist. Skipped."); + } + } + + public static void addIC2MaceratorRecipe(ItemStack input, ItemStack output) { + if (Recipes.macerator.getOutputFor(input, false) == null) { + NBTTagCompound tag = new NBTTagCompound(); + Recipes.macerator.addRecipe(new RecipeInputItemStack(input), tag, output); + } else { + // IHLMod.log.info("IC2 macerator recipe for + // "+input.getDisplayName()+" already exist. Skipped."); + } + } + + public static void addIC2RollingRecipe(ItemStack input, ItemStack output) { + if (Recipes.metalformerRolling.getOutputFor(input, false) == null) { + NBTTagCompound tag = new NBTTagCompound(); + Recipes.metalformerRolling.addRecipe(new RecipeInputItemStack(input), tag, output); + } else { + // IHLMod.log.info("IC2 metal former (rolling) recipe for + // "+input.getDisplayName()+" already exist. Skipped."); + } + } + + public static void addIC2RollingRecipe(String input, ItemStack output) { + if (Recipes.metalformerRolling.getOutputFor(getThisModItemStack(input), false) == null) { + NBTTagCompound tag = new NBTTagCompound(); + Recipes.metalformerRolling.addRecipe(new RecipeInputOreDict(input), tag, output); + } else { + // 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) { + if (Recipes.centrifuge.getOutputFor(getOreDictItemStack(input), false) == null) { + NBTTagCompound tag = new NBTTagCompound(); + tag.setInteger("minHeat", 2000); + Recipes.centrifuge.addRecipe(new RecipeInputOreDict(input), tag, new ItemStack[] { output, output2 }); + } else { + // IHLMod.log.info("IC2 centrifuge recipe for "+input+" already + // exist. Skipped."); + } + } + + public static void damageItemViaNBTTag(ItemStack stack, int amount) { + NBTTagCompound gtTagCompound; + if (stack.stackTagCompound.hasKey("GT.ToolStats")) { + gtTagCompound = stack.stackTagCompound.getCompoundTag("GT.ToolStats"); + } else { + stack.stackSize--; + return; + } + int damage = 0; + int maxDamage = 0; + if (gtTagCompound.hasKey("MaxDamage")) { + maxDamage = gtTagCompound.getInteger("MaxDamage"); + } else { + stack.stackSize--; + return; + } + + if (gtTagCompound.hasKey("Damage")) { + damage = gtTagCompound.getInteger("Damage"); + } + if (damage < maxDamage - amount) { + damage += amount; + gtTagCompound.setInteger("Damage", damage); + gtTagCompound.setInteger("MaxDamage", maxDamage); + stack.stackTagCompound.setTag("GT.ToolStats", gtTagCompound); + } else { + stack.stackSize--; + } + } + + public static int getDamageValueViaNBTTag(ItemStack stack) { + NBTTagCompound gtTagCompound = null; + if (stack != null && stack.stackTagCompound != null && stack.stackTagCompound.hasKey("GT.ToolStats")) { + gtTagCompound = stack.stackTagCompound.getCompoundTag("GT.ToolStats"); + } else { + return 0; + } + if (gtTagCompound != null && gtTagCompound.hasKey("Damage")) { + return gtTagCompound.getInteger("Damage"); + } else { + return 0; + } + } + + public static int getMaxDamageValueViaNBTTag(ItemStack stack) { + NBTTagCompound gtTagCompound = null; + if (stack != null && stack.stackTagCompound != null && stack.stackTagCompound.hasKey("GT.ToolStats")) { + gtTagCompound = stack.stackTagCompound.getCompoundTag("GT.ToolStats"); + } else { + return 0; + } + if (gtTagCompound != null && gtTagCompound.hasKey("MaxDamage")) { + return gtTagCompound.getInteger("MaxDamage"); + } else { + return 0; + } + } + + public static boolean isItemStacksIsEqual(ItemStack stack1, ItemStack stack2, boolean useOreDictionary) { + if(stack2==null && stack1==null){ + return true; + } + else if(stack2==null || stack1==null){ + return false; + } + if (useOreDictionary && isItemsHaveSameOreDictionaryEntry(stack1, stack2)) { + return true; + } else { + if (stack1.getItemDamage() == OreDictionary.WILDCARD_VALUE + || stack2.getItemDamage() == OreDictionary.WILDCARD_VALUE) { + return stack1.getItem() == stack2.getItem(); + } else { + return stack1.getItem() == stack2.getItem() && stack1.getItemDamage() == stack2.getItemDamage(); + } + } + } + + public static boolean isItemStacksIsEqual(ItemStack stack1, String stack2name, boolean useOreDictionary) { + return isItemStacksIsEqual(stack1, getThisModItemStack(stack2name), useOreDictionary); + } + + public static boolean isIRecipeInputMatchesWithAmount(IRecipeInput input, ItemStack stack) { + if (input.matches(stack)) { + if (stack.getItem() instanceof IWire) { + return getWireLength(stack) >= input.getAmount(); + } else { + return stack.stackSize >= input.getAmount(); + } + } + return false; + } + + public static boolean reduceItemStackAmountUsingIRecipeInput(IRecipeInput input, ItemStack stack, int multiplier) { + if (stack.getItem() instanceof IWire) { + return adjustWireLength(stack, -input.getAmount()*multiplier); + } else { + stack.stackSize -= input.getAmount()*multiplier; + return stack.stackSize <= 0; + } + } + + public static String getFirstOreDictNameExcludingTagAny(ItemStack stack) { + int[] arrayIDs = OreDictionary.getOreIDs(stack); + for (int i = 0; i < arrayIDs.length; i++) { + if (!OreDictionary.getOreName(arrayIDs[i]).contains("Any")) { + return OreDictionary.getOreName(arrayIDs[i]); + } + } + return ""; + } + + public static void handleFluidSlotsBehaviour(InvSlotConsumableLiquidIHL fillInputSlot, + InvSlotConsumableLiquidIHL drainInputSlot, InvSlotOutput emptyFluidItemsSlot, IFluidTank fluidTank) { + 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(output.getValue()))) { + fluidTank.fill( + drainInputSlot.drain(null, fluidTank.getCapacity() - fluidTank.getFluidAmount(), output, false), + true); + if (output.getValue() != null) { + emptyFluidItemsSlot.add(output.getValue()); + } + } + } + if (fillInputSlot != null && !fillInputSlot.isEmpty()) { + 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(output.getValue()); + } + } + } + } + + public static double[] tracePlayerView(EntityLivingBase player) { + float f1 = player.rotationPitch; + float f2 = player.rotationYaw; + double x = player.posX; + double y = player.posY; + double z = player.posZ; + if (IC2.platform.isSimulating()) { + y += player.getEyeHeight(); + } + float f3 = MathHelper.cos(-f2 * 0.01745329F - (float) Math.PI); + float f4 = MathHelper.sin(-f2 * 0.01745329F - (float) Math.PI); + float f5 = -MathHelper.cos(-f1 * 0.01745329F); + float f6 = MathHelper.sin(-f1 * 0.01745329F); + float f7 = f4 * f5; + float f9 = f3 * f5; + double d3 = 1.0D; + return new double[] { x + f7 * d3, y + f6 * d3, z + f9 * d3 }; + } + + public static MovingObjectPosition returnMOPFromPlayer(EntityPlayer entityplayer, World world) { + float f1 = entityplayer.rotationPitch; + float f2 = entityplayer.rotationYaw; + double x = entityplayer.posX; + double y = entityplayer.posY + entityplayer.getEyeHeight(); + + if (world.isRemote) { + y -= entityplayer.getDefaultEyeHeight(); + } + + double z = entityplayer.posZ; + Vec3 vec3d = Vec3.createVectorHelper(x, y, z); + float f3 = MathHelper.cos(-f2 * 0.01745329F - (float) Math.PI); + float f4 = MathHelper.sin(-f2 * 0.01745329F - (float) Math.PI); + float f5 = -MathHelper.cos(-f1 * 0.01745329F); + float f6 = MathHelper.sin(-f1 * 0.01745329F); + float f7 = f4 * f5; + float f9 = f3 * f5; + double d3 = 5.0D; + Vec3 vec3d1 = vec3d.addVector(f7 * d3, f6 * d3, f9 * d3); + MovingObjectPosition movingobjectposition = world.rayTraceBlocks(vec3d, vec3d1, true); + + if (movingobjectposition == null) { + return null; + } + + if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { + return movingobjectposition; + } + return null; + } + + public static short getFacingFromPlayerView(EntityLivingBase player, boolean ignoreSneaking) { + int var6 = MathHelper.floor_double(player.rotationPitch * 4.0F / 360.0F + 0.5D) & 3; + int var7 = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; + { + if (var6 == 1) { + return 1; + } else if (var6 == 3) { + return 0; + } else { + if (player.isSneaking() && !ignoreSneaking) { + switch (var7) { + case 0: + return 3; + case 1: + return 4; + case 2: + return 2; + case 3: + return 5; + default: + break; + } + } else { + switch (var7) { + case 0: + return 2; + case 1: + return 5; + case 2: + return 3; + case 3: + return 4; + default: + break; + } + } + } + } + return 3; + } + + public static int getChainID(ItemStack itemStack) { + if (itemStack != null && itemStack.stackTagCompound != null && itemStack.stackTagCompound.hasKey("chainUID")) { + return itemStack.stackTagCompound.getInteger("chainUID"); + } + return -1; + } + + public static List convertRecipeInputToItemStackList(List input) { + Iterator irii = input.iterator(); + List output = new ArrayList(); + while (irii.hasNext()) { + IRecipeInput iri = irii.next(); + ItemStack stack = iri.getInputs().get(0); + stack.stackSize = iri.getAmount(); + output.add(stack); + } + return output; + } + + public static List convertRecipeInputToFluidStackList(List input) { + Iterator irii = input.iterator(); + List output = new ArrayList(); + while (irii.hasNext()) { + IRecipeInputFluid iri = irii.next(); + FluidStack stack = iri.getInputs().get(0); + stack.amount = iri.getAmount(); + output.add(stack); + } + return output; + } + + public static String trim(String str) { + int len = str.length(); + int start; + char c; + for (start = 0; start < len; ++start) { + c = str.charAt(start); + if (c > 32 && c != 65279) { + break; + } + } + int end; + for (end = len - 1; end >= start; --end) { + c = str.charAt(end); + if (c > 32 && c != 65279) { + break; + } + } + return start <= 0 && end >= len - 1 ? str : str.substring(start, end + 1); + } + + public static int getAmountOf(ItemStack is) { + if (is.getItem() instanceof IWire) { + return getWireLength(is); + } else { + return is.stackSize; + } + } + + public static ItemStack getWireItemStackCopyWithLengthMultiplied(ItemStack stack, int multiplier) { + ItemStack out = stack.copy(); + adjustWireLength(out, getWireLength(stack) * (multiplier - 1)); + return out; + } + + public static ItemStack getUninsulatedWire(String material, int length, int transverseSection) { + ItemStack is = getThisModItemStack("copperWire"); + is.stackTagCompound = new NBTTagCompound(); + is.stackTagCompound.setBoolean("firstConnection", false); + is.stackTagCompound.setInteger("fullLength", length); + is.stackTagCompound.setInteger("length", length); + is.stackTagCompound.setString("material", material); + is.stackTagCompound.setInteger("transverseSection", transverseSection); + return is; + } + + public static ItemStack getInsulatedWire(String material, int length, int transverseSection, + String insulationMaterial, int insulationThickness) { + ItemStack is = getUninsulatedWire(material, length, transverseSection); + is.stackTagCompound.setString("insulationMaterial", insulationMaterial); + is.stackTagCompound.setInteger("insulationThickness", insulationThickness); + is.stackTagCompound.setInteger("maxVoltage", getInsulationMaxVoltage(insulationMaterial, insulationThickness)); + return is; + } + + public static long getResistance(NBTTagCompound cable) { + String material = cable.getString("material"); + int transverseSection = cable.getInteger("transverseSection"); + return ElectricConductor.getResistivity(material) * 100L / transverseSection; + } + + public static int getInsulationMaxVoltage(String insulationMaterial, int insulationThickness) { + return Math.min(Insulation.getMaxVoltagePermm(insulationMaterial) * insulationThickness / 10, + Insulation.getMaxVoltageCap(insulationMaterial)); + } + + public static ItemStack getItemStackWithTag(String unLocalizedName, String tag, int tagValue) { + ItemStack stack = IHLUtils.getThisModItemStack(unLocalizedName); + if (stack.stackTagCompound == null) { + stack.stackTagCompound = new NBTTagCompound(); + } + stack.stackTagCompound.setInteger(tag, tagValue); + return stack; + } + + public static boolean isSegmentInsideAABB(AxisAlignedBB collisionBox, double posX, double posY, double posZ, + double posX2, double posY2, double posZ2) { + if (isInsideofBoundingBox(collisionBox, (float) posX, (float) posY, (float) posZ) + || isInsideofBoundingBox(collisionBox, (float) posX2, (float) posY2, (float) posZ2)) { + return true; + } else { + double minX = Math.min(posX, posX2); + double maxX = Math.max(posX, posX2); + double minY = Math.min(posY, posY2); + double maxY = Math.max(posY, posY2); + double minZ = Math.min(posZ, posZ2); + double maxZ = Math.max(posZ, posZ2); + return !(maxX < collisionBox.minX || minX > collisionBox.maxX || maxY < collisionBox.minY + || minY > collisionBox.maxY || maxZ < collisionBox.minZ || minZ > collisionBox.maxZ); + } + } + + public static boolean isInsideofBoundingBox(AxisAlignedBB bb, float xi, float yi, float zi) { + return bb.maxX > xi && bb.minX < xi && bb.maxY > yi && bb.minY < yi && bb.maxZ > zi && bb.minZ < zi; + } + + public static boolean isBlockCanBeReplaced(World world, int x, int y, int z) { + Block block = world.getBlock(x, y, z); + if (block == Blocks.air || block.isAir(world, x, y, z) || block == Blocks.vine || block == Blocks.tallgrass + || block == Blocks.deadbush || block == Blocks.snow_layer || block == Blocks.snow) { + return true; + } + return false; + } + + public static void removeChains(IEnergyNetNode te, World world) { + Set cableList = te.getCableList(); + Iterator cli = cableList.iterator(); + while (cli.hasNext()) { + IHLCable c = cli.next(); + cli.remove(); + IHLMod.enet.removeCableEntities(c); + ItemStack is = IHLUtils.getThisModItemStack("copperWire"); + is.stackTagCompound = c.toNBT(); + double[] pps = te.getPortPos(null); + EntityItem eitem = new EntityItem(world, pps[0], pps[1], pps[2], is); + world.spawnEntityInWorld(eitem); + removeChain(c, null); + } + if (te.getGridID() != -1) { + IHLMod.enet.splitGrids(te.getGridID(), te); + } + cableList.clear(); + } + + public static void removeChain(IHLCable cable, IEnergyNetNode excludeNode) { + int x = cable.connectorX1; + int y = cable.connectorY1; + int z = cable.connectorZ1; + int t2DimensionId = cable.connectorDimensionId1; + short facing2 = cable.connectorFacing1; + TileEntity t2 = MinecraftServer.getServer().worldServerForDimension(t2DimensionId).getTileEntity(x, y, z); + IEnergyNetNode te2; + if (t2 instanceof IMultiPowerCableHolder) { + te2 = ((IMultiPowerCableHolder) t2).getEnergyNetNode(facing2); + } else if (t2 instanceof IEnergyNetNode) { + te2 = (IEnergyNetNode) t2; + } else { + return; + } + if (excludeNode != te2) { + te2.remove(cable); + } + x = cable.connectorX; + y = cable.connectorY; + z = cable.connectorZ; + t2DimensionId = cable.connectorDimensionId; + facing2 = cable.connectorFacing; + t2 = MinecraftServer.getServer().worldServerForDimension(t2DimensionId).getTileEntity(x, y, z); + if (t2 instanceof IMultiPowerCableHolder) { + te2 = ((IMultiPowerCableHolder) t2).getEnergyNetNode(facing2); + } else if (t2 instanceof IEnergyNetNode) { + te2 = (IEnergyNetNode) t2; + } else { + return; + } + if (excludeNode != te2) { + te2.remove(cable); + } + } + + public static boolean isPlayerLookingAt(EntityLivingBase player, AxisAlignedBB aabb) { + double[] pView = tracePlayerView(player); + double x = player.posX; + double y = player.posY; + double z = player.posZ; + if (IC2.platform.isSimulating()) { + y += player.getEyeHeight(); + } + if (isLineSegmentInterseptRectangle(x, y, pView[0], pView[1], aabb.minX, aabb.minY, aabb.maxX, aabb.maxY) + && isLineSegmentInterseptRectangle(x, z, pView[0], pView[2], aabb.minX, aabb.minZ, aabb.maxX, aabb.maxZ) + && isLineSegmentInterseptRectangle(z, y, pView[2], pView[1], aabb.minZ, aabb.minY, aabb.maxZ, + aabb.maxY)) { + return true; + } + return false; + } + + public static boolean isLineSegmentInterseptRectangle(double sx0_1, double sy0_1, double sx1_1, double sy1_1, + double rx0_1, double ry0_1, double rx1_1, double ry1_1) { + double sx0 = sx0_1; + double sy0 = sy0_1; + double sx1 = sx1_1; + double sy1 = sy1_1; + double rx0 = rx0_1; + double ry0 = ry0_1; + double rx1 = rx1_1; + double ry1 = ry1_1; + if (sx1_1 < sx0_1) { + sx0 = sx1_1; + sy0 = sy1_1; + sx1 = sx0_1; + sy1 = sy0_1; + } + if (rx1_1 < rx0_1) { + rx0 = rx1_1; + ry0 = ry1_1; + rx1 = rx0_1; + ry1 = ry0_1; + } + double ay = (sy1 - sy0) / (sx1 - sx0); + double by = sy1 - ay * sx1; + + double ax = (sx1 - sx0) / (sy1 - sy0); + double bx = sx1 - ax * sy1; + + double maxx0 = Math.max(sx0, rx0); + double minx1 = Math.min(sx1, rx1); + double maxy0 = Math.max(sy0, ry0); + double miny1 = Math.min(sy1, ry1); + double y0 = ay * maxx0 + by; + double y1 = ay * minx1 + by; + + double x0 = ax * maxy0 + bx; + double x1 = ax * miny1 + bx; + return (ry0 <= y0 && ry1 >= y0) || (ry0 <= y1 && ry1 >= y1) || (rx0 <= x0 && rx1 >= x0) + || (rx0 <= x1 && rx1 >= x1); + } + + public static float parseFloatSafe(String string, float useSafeValue) { + if (Pattern.matches(fpRegex, string)) + return Float.valueOf(string); + 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 (block != Blocks.air) { + ++ebs.blockRefCount; + } + + 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); + } + } + + +} diff --git a/src/main/java/ihl/worldgen/IHLWorldGenerator.java b/src/main/java/ihl/worldgen/IHLWorldGenerator.java new file mode 100644 index 0000000..a6f3b6b --- /dev/null +++ b/src/main/java/ihl/worldgen/IHLWorldGenerator.java @@ -0,0 +1,101 @@ +package ihl.worldgen; + +import java.util.HashSet; +import java.util.Random; +import java.util.Set; + +import cpw.mods.fml.common.IWorldGenerator; +import ihl.IHLMod; +import ihl.utils.IHLUtils; +import ihl.worldgen.ores.IHLFluid; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.chunk.IChunkProvider; + +public class IHLWorldGenerator implements IWorldGenerator { + + private static final Block[] replaceableMinerals = new Block[] { Blocks.stone, Blocks.gravel , Blocks.gold_ore, Blocks.coal_ore, Blocks.iron_ore, Blocks.lapis_ore, Blocks.clay, Blocks.diamond_ore, Blocks.redstone_ore, Blocks.emerald_ore}; + private static final Block[] replaceableSand = new Block[] { Blocks.sand }; + private static final Block[] replaceableForOil = new Block[] { Blocks.lava, Blocks.flowing_lava, Blocks.obsidian}; + public static IHLWorldGenerator instance; + private final Set generators = new HashSet(8); + + public IHLWorldGenerator() + { + super(); + if (IHLMod.config.generateApatiteOre) + { + generators.add(new WorldGeneratorVein(IHLUtils.getOreDictBlock("oreApatite"), replaceableMinerals)); + } + if (IHLMod.config.generateSaltpeterOre) + { + generators.add(new WorldGeneratorVein(IHLUtils.getOreDictBlock("oreSaltpeter"), replaceableMinerals)); + } + if (IHLMod.config.generateGyubnera) + { + generators.add(new WorldGeneratorVein(IHLUtils.getOreDictBlock("oreGyubnera"), replaceableMinerals)); + } + if (IHLMod.config.generateCinnabar) + { + generators.add(new WorldGeneratorVein(IHLUtils.getOreDictBlock("oreCinnabar"), replaceableMinerals)); + } + if (IHLMod.config.generateRocksalt) + { + generators.add(new WorldGeneratorVein(IHLUtils.getOreDictBlock("oreRockSalt"), replaceableMinerals)); + } + if (IHLMod.config.generateLimestone) + { + generators.add(new WorldGeneratorVein(IHLUtils.getOreDictBlock("oreLimestone"), replaceableMinerals)); + } + if (IHLMod.config.generateGypsum) + { + generators.add(new WorldGeneratorVein(IHLUtils.getOreDictBlock("oreGypsum"), replaceableMinerals)); + } + if (IHLMod.config.generatePotassiumFeldspar) + { + generators.add(new WorldGeneratorVein(IHLUtils.getOreDictBlock("orePotassiumFeldspar"), replaceableMinerals)); + } + if (IHLMod.config.generateTrona) + { + generators.add(new WorldGeneratorVein(IHLUtils.getOreDictBlock("oreTrona"), replaceableMinerals)); + } + if (IHLMod.config.generateBauxite) + { + generators.add(new WorldGeneratorVein(IHLUtils.getOreDictBlock("oreBauxite"), replaceableMinerals)); + } + if (IHLMod.config.generateChromite) + { + generators.add(new WorldGeneratorVein(IHLUtils.getOreDictBlock("oreChromite"), replaceableMinerals)); + } + if (IHLMod.config.generateMuscovite) + { + generators.add(new WorldGeneratorVein(IHLUtils.getOreDictBlock("oreMica"), replaceableMinerals)); + } + if (IHLMod.config.generateOil) + { + generators.add(new WorldGeneratorUndergroundLake(IHLFluid.getBlock("oil"), Blocks.obsidian, replaceableForOil)); + } + if (IHLMod.config.generateSaltwater) + { + generators.add(new WorldGeneratorSurfaceLake(IHLFluid.getBlock("saltwater"), replaceableSand)); + } + if (IHLMod.config.generateDatolite) + { + generators.add(new WorldGeneratorVein(IHLUtils.getOreDictBlock("oreDatolite"), replaceableMinerals)); + } + if (IHLMod.config.generateBischofite) + { + generators.add(new WorldGeneratorVein(IHLUtils.getOreDictBlock("oreBischofite"), replaceableMinerals)); + } + instance=this; + } + + @Override + public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, + IChunkProvider chunkProvider) { + for (WorldGeneratorBase generator : generators) { + generator.generate(world, chunkX, chunkZ); + } + } +} diff --git a/src/main/java/ihl/worldgen/WorldGeneratorBase.java b/src/main/java/ihl/worldgen/WorldGeneratorBase.java new file mode 100644 index 0000000..dc68135 --- /dev/null +++ b/src/main/java/ihl/worldgen/WorldGeneratorBase.java @@ -0,0 +1,90 @@ +package ihl.worldgen; + +import java.util.HashSet; +import java.util.Random; +import java.util.Set; + +import ihl.utils.IHLUtils; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.storage.ExtendedBlockStorage; + +public abstract class WorldGeneratorBase { + private final Random random = new Random(); + protected final Block ore; + protected final Set replaceableBlocks = new HashSet(2); + + public WorldGeneratorBase(Block oreIn, Block... replaceableBlocksIn) { + ore = oreIn; + for (Block block : replaceableBlocksIn) { + replaceableBlocks.add(block); + } + } + + public void generate(World world, int chunkX, int chunkZ) { + int[] centralPOI = this.getPOI(world, chunkX, chunkZ, 0, 0); + int[] xz = new int[] { 0, 1, 0, -1, 0 }; + for (int i = 0; i < 4; i++) { + int[] surroundPOI = this.getPOI(world, chunkX + xz[i], chunkZ + xz[i + 1], xz[i], xz[i + 1]); + this.replaceBlocks(world, centralPOI, surroundPOI, chunkX << 4, chunkZ << 4); + } + } + + protected abstract void replaceBlocks(World world, final int[] centralPOI, final int[] surroundPOI, + final int startX, final int startZ); + + protected boolean replace(World world, int absX, int absY, int absZ, final Block block) { + if (!world.getChunkProvider().chunkExists(absX >> 4, absZ >> 4)) { + throw new IllegalStateException("quered chunk is not yet generated!"); + } + Chunk chunk = world.getChunkFromBlockCoords(absX, absZ); + ExtendedBlockStorage ebs = chunk.getBlockStorageArray()[absY >> 4]; + if (ebs != null && replaceableBlocks.contains(ebs.getBlockByExtId(absX & 15, absY & 15, absZ & 15))) { + IHLUtils.setBlockRaw(ebs, absX & 15, absY & 15, absZ & 15, block); + return true; + } + return false; + } + + protected boolean replaceAll(World world, int absX, int absY, int absZ, final Block block) { + if (!world.getChunkProvider().chunkExists(absX >> 4, absZ >> 4)) { + throw new IllegalStateException("quered chunk is not yet generated!"); + } + Chunk chunk = world.getChunkFromBlockCoords(absX, absZ); + ExtendedBlockStorage ebs = chunk.getBlockStorageArray()[absY >> 4]; + if (ebs != null) { + IHLUtils.setBlockRaw(ebs, absX & 15, absY & 15, absZ & 15, block); + return true; + } + return false; + } + + protected boolean replaceAllExceptOre(World world, int absX, int absY, int absZ, final Block block) { + if (!world.getChunkProvider().chunkExists(absX >> 4, absZ >> 4)) { + throw new IllegalStateException("quered chunk is not yet generated!"); + } + Chunk chunk = world.getChunkFromBlockCoords(absX, absZ); + ExtendedBlockStorage ebs = chunk.getBlockStorageArray()[absY >> 4]; + if (ebs != null) { + Block olblock = ebs.getBlockByExtId(absX & 15, absY & 15, absZ & 15); + if(!olblock.equals(ore) && + !olblock.equals(Blocks.bedrock) && + !olblock.equals(Blocks.netherrack) && + !olblock.equals(Blocks.stone) && + !olblock.equals(Blocks.clay)) { + IHLUtils.setBlockRaw(ebs, absX & 15, absY & 15, absZ & 15, block); + return true; + } + } + return false; + } + + private int[] getPOI(World world, int chunkX, int chunkZ, int xOffset, int zOffset) { + long seed = (long) chunkX << 16 ^ chunkZ << 8 ^ Block.getIdFromBlock(ore); + random.setSeed(seed); + return new int[] { random.nextInt(16) + xOffset * 16, random.nextInt(world.getActualHeight() / 2), + random.nextInt(16) + zOffset * 16 }; + } +} diff --git a/src/main/java/ihl/worldgen/WorldGeneratorSurfaceLake.java b/src/main/java/ihl/worldgen/WorldGeneratorSurfaceLake.java new file mode 100644 index 0000000..11abf5e --- /dev/null +++ b/src/main/java/ihl/worldgen/WorldGeneratorSurfaceLake.java @@ -0,0 +1,42 @@ +package ihl.worldgen; + +import ihl.utils.IHLMathUtils; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; + +public class WorldGeneratorSurfaceLake extends WorldGeneratorBase { + + public WorldGeneratorSurfaceLake(Block oreIn, Block[] replaceableBlocksIn) { + super(oreIn, replaceableBlocksIn); + } + + @Override + protected void replaceBlocks(World world, int[] centralPOI, int[] surroundPOI, int startX, int startZ) { + BiomeGenBase biome = world.getBiomeGenForCoords(startX, startZ); + if (biome.temperature < 1.9f || biome.rainfall != 0f) { + return; + } + int x = centralPOI[0], y = centralPOI[1], z = centralPOI[2]; + for (int ix = x; ix < 16 && ix >= 0; ix += IHLMathUtils.sign(surroundPOI[0] - x)) { + int y2 = y += IHLMathUtils.sign(surroundPOI[1] - world.getActualHeight() / 4 - y); + for (int iz = z; iz < 16 && iz >= 0; iz += IHLMathUtils.sign(surroundPOI[2] - z)) { + y2 += IHLMathUtils.sign(surroundPOI[1] - world.getActualHeight() / 4 - y2); + int dx = ix-x; + int dz = iz-z; + int d = dx*dx+dz*dz; + if (d < 64 && y2 > world.getActualHeight() * 3 / 8 + && world.getBlock(ix + startX, 63, iz + startZ) == Blocks.air) { + this.replace(world, ix + startX, 62, iz + startZ, ore); + } + if (surroundPOI[2] == z) { + break; + } + } + if (surroundPOI[0] == x) { + break; + } + } + } +} diff --git a/src/main/java/ihl/worldgen/WorldGeneratorUndergroundLake.java b/src/main/java/ihl/worldgen/WorldGeneratorUndergroundLake.java new file mode 100644 index 0000000..7abee8e --- /dev/null +++ b/src/main/java/ihl/worldgen/WorldGeneratorUndergroundLake.java @@ -0,0 +1,60 @@ +package ihl.worldgen; + +import ihl.utils.IHLMathUtils; +import ihl.utils.IHLUtils; +import net.minecraft.block.Block; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.storage.ExtendedBlockStorage; + +public class WorldGeneratorUndergroundLake extends WorldGeneratorBase { + + private final Block clayBlock; + + public WorldGeneratorUndergroundLake(Block oreIn, Block clayIn, Block[] replaceableBlocksIn) { + super(oreIn, replaceableBlocksIn); + clayBlock = clayIn; + } + + @Override + protected void replaceBlocks(World world, int[] centralPOI, int[] surroundPOI, int startX, int startZ) { + int x = centralPOI[0], y = centralPOI[1] - world.getActualHeight() / 4, z = centralPOI[2]; + for (int ix = x; ix < 16 && ix >= 0; ix += IHLMathUtils.sign(surroundPOI[0] - x)) { + int y2 = y += IHLMathUtils.sign(surroundPOI[1] - world.getActualHeight() / 4 - y); + nextZ:for (int iz = z; iz < 16 && iz >= 0; iz += IHLMathUtils.sign(surroundPOI[2] - z)) { + y2 += IHLMathUtils.sign(surroundPOI[1] - world.getActualHeight() / 4 - y2); + int dx = ix - x; + int dz = iz - z; + int d = dx * dx + dz * dz; + if (y2 > 1 && d < 64) { + for (int iy = y2; iy > 0; iy--) { + int absX = ix + startX; + int absZ = iz + startZ; + int absY = iy; + Chunk chunk = world.getChunkFromBlockCoords(absX, absZ); + ExtendedBlockStorage ebs = chunk.getBlockStorageArray()[absY >> 4]; + if (ebs != null && replaceableBlocks.contains(ebs.getBlockByExtId(absX & 15, absY & 15, absZ & 15))) { + int[] xyz = new int[] { 0, 0, -1, 0, 0, 1, 0, 0 }; + for (int i = 2; i < xyz.length; i++) { + int absX2 = absX + xyz[i - 2]; + int absZ2 = absZ + xyz[i]; + if (!world.getChunkProvider().chunkExists(absX2 >> 4, absZ2 >> 4)) { + continue nextZ; + } + this.replaceAllExceptOre(world, absX2, iy + xyz[i - 1], absZ2, clayBlock); + } + IHLUtils.setBlockRaw(ebs, absX & 15, absY & 15, absZ & 15, ore); + } + } + } + if (surroundPOI[2] == z) { + break; + } + } + if (surroundPOI[0] == x) { + break; + } + } + } + +} diff --git a/src/main/java/ihl/worldgen/WorldGeneratorVein.java b/src/main/java/ihl/worldgen/WorldGeneratorVein.java new file mode 100644 index 0000000..3be74e0 --- /dev/null +++ b/src/main/java/ihl/worldgen/WorldGeneratorVein.java @@ -0,0 +1,26 @@ +package ihl.worldgen; + +import ihl.utils.IHLMathUtils; +import net.minecraft.block.Block; +import net.minecraft.world.World; + +public class WorldGeneratorVein extends WorldGeneratorBase { + + public WorldGeneratorVein(Block oreIn, Block[] replaceableBlocksIn) { + super(oreIn, replaceableBlocksIn); + } + + @Override + protected void replaceBlocks(World world, int[] centralPOI, int[] surroundPOI, int startX, int startZ) { + int x = centralPOI[0], y = centralPOI[1], z = centralPOI[2]; + while (x < 16 && x >= 0 && y >= 0 && y < world.getActualHeight() && z >= 0 && z < 16) { + this.replace(world, x + startX, y, z + startZ, ore); + x += IHLMathUtils.sign(surroundPOI[0] - x); + y += IHLMathUtils.sign(surroundPOI[1] - y); + z += IHLMathUtils.sign(surroundPOI[2] - z); + if (IHLMathUtils.sign(surroundPOI[0] - x) == 0 && IHLMathUtils.sign(surroundPOI[1] - y) == 0 + && IHLMathUtils.sign(surroundPOI[2] - z) == 0) + break; + } + } +} diff --git a/src/main/java/ihl/worldgen/ores/BlockOre.java b/src/main/java/ihl/worldgen/ores/BlockOre.java new file mode 100644 index 0000000..00a8bcc --- /dev/null +++ b/src/main/java/ihl/worldgen/ores/BlockOre.java @@ -0,0 +1,137 @@ +package ihl.worldgen.ores; + + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ihl.IHLCreativeTab; +import ihl.IHLModInfo; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +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(); + + public BlockOre(Type type1) + { + super(Material.rock); + this.type=type1; + this.setCreativeTab(IHLCreativeTab.tab); + this.setBlockName(type.unLocalizedName); + instances.add(this); + this.setHardness(2.0F).setResistance(4.0F); + } + + public static void init() + { + Type[] var1 = Type.values(); + for(int i=0;i ii = instances.iterator(); + while(ii.hasNext()) + { + BlockOre instance = ii.next(); + GameRegistry.registerBlock(instance,instance.type.unLocalizedName); + OreDictionary.registerOre(instance.type.unLocalizedName, instance); + } + } + + @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); + if(this.type.fortuneAffectsDrops) + { + this.dropXpOnBlockBreak(world, x, y, z, MathHelper.getRandomIntegerInRange(world.rand, 1, 4)); + } + } + + @Override + public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { + ArrayList drops = new ArrayList(); + int fortmod = world.rand.nextInt(fortune + 2) - 1; + if (fortmod < 0 || !type.fortuneAffectsDrops)fortmod = 0; + ItemStack drop = null; + int amount = 1; + amount = (type.amountFrom + (type.amountTo>0?world.rand.nextInt(type.amountTo):0)) * (fortmod + 1); + drop = OreDictionary.getOres(type.oreDrop).get(0); + if (drop != null && amount > 0) + { + drop.stackSize=amount; + drops.add(drop); + } + return drops; + } + + + public enum Type + { + Bischofite("oreBischofite", "dustBischofite",1,2), + Datolite("oreDatolite", "dustDatolite",1,2), + Stibnite("oreStibnite"), + Chromite("oreChromite"), + Muscovite("oreMica"), + Bauxite("oreBauxite"), + Cinnabar("oreCinnabar"), + RockSalt("oreRockSalt", "dustRockSalt",1,2), + Limestone("oreLimestone", "dustCalcite",1,2), + Gypsum("oreGypsum"), + Gyubnera("oreGyubnera"),//(Mn,Fe)WO4 Mn:Fe 5/1 + OreTrona("oreTrona", "dustTrona",1,2), + PotassiumFeldspar("orePotassiumFeldspar"), + Apatite("oreApatite", "gemApatite",2,5), + Saltpeter("oreSaltpeter", "dustSaltpeter",1,2); + Type(String unlocalizedName1, String oreDrop1, int amountFrom1, int amountTo1 ) + { + unLocalizedName=unlocalizedName1; + oreDrop=oreDrop1; + amountFrom=amountFrom1; + amountTo=amountTo1; + } + Type(String unlocalizedName1) + { + unLocalizedName=unlocalizedName1; + oreDrop=unlocalizedName1; + amountFrom=1; + amountTo=0; + fortuneAffectsDrops=false; + } + String unLocalizedName; + String oreDrop; + int amountFrom; + int amountTo; + boolean fortuneAffectsDrops=true; + } + + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister register) + { + iconMap.put(this.type, register.registerIcon(IHLModInfo.MODID + ":"+this.type.unLocalizedName)); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int i, int j) + { + return iconMap.get(type); + } +} diff --git a/src/main/java/ihl/worldgen/ores/DebugScannerBlock.java b/src/main/java/ihl/worldgen/ores/DebugScannerBlock.java new file mode 100644 index 0000000..a934f60 --- /dev/null +++ b/src/main/java/ihl/worldgen/ores/DebugScannerBlock.java @@ -0,0 +1,46 @@ +package ihl.worldgen.ores; + +import ihl.IHLCreativeTab; +import net.minecraft.block.Block; +import net.minecraft.block.ITileEntityProvider; +import net.minecraft.block.material.Material; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + +public class DebugScannerBlock extends Block implements ITileEntityProvider{ + + public DebugScannerBlock(Material material) + { + super(material); + this.setCreativeTab(IHLCreativeTab.tab); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) { + return new DebugScannerTileEntity(); + } + + @Override + public boolean hasTileEntity(int metadata) + { + return true; + } + + @Override + public boolean onBlockActivated(World world,int x,int y,int z,EntityPlayer entityPlayer,int i,float pos_x,float pos_y,float pos_z){ + TileEntity te = world.getTileEntity(x,y,z); + if(te instanceof DebugScannerTileEntity) + { + DebugScannerTileEntity bte = (DebugScannerTileEntity)te; + if (bte == null || entityPlayer.isSneaking()) { + return false; + } + else + { + return bte.getGui(entityPlayer); + } + } + return false; + } +} diff --git a/src/main/java/ihl/worldgen/ores/DebugScannerContainer.java b/src/main/java/ihl/worldgen/ores/DebugScannerContainer.java new file mode 100644 index 0000000..1413ddb --- /dev/null +++ b/src/main/java/ihl/worldgen/ores/DebugScannerContainer.java @@ -0,0 +1,49 @@ +package ihl.worldgen.ores; + +import ic2.core.ContainerBase; +import ic2.core.slot.SlotInvSlot; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Slot; + +public class DebugScannerContainer extends ContainerBase { + + protected DebugScannerTileEntity tileEntity; + public int lastFluidAmount = -1; + public int lastFuel = -1; + public short lastProgress = -1; + public final static int height=256; + public final static int width=248; + + public DebugScannerContainer(EntityPlayer entityPlayer, DebugScannerTileEntity tileEntity1){ + super(tileEntity1); + this.tileEntity = tileEntity1; + int col,row; + + for (row = 0; row < 3; ++row) + { + for (col = 0; col < 13; ++col) + { + int slotnum = col + row * 13 + 9; + if(slotnum < entityPlayer.inventory.getSizeInventory()-4) + { + this.addSlotToContainer(new Slot(entityPlayer.inventory, slotnum, 8 + col * 18, 196 + row * 18)); + } + else + { + break; + } + } + } + for (col = 0; col < 9; ++col) + { + this.addSlotToContainer(new Slot(entityPlayer.inventory, col, 80 + col * 18, 232)); + } + this.addSlotToContainer(new SlotInvSlot(tileEntity1.itemsSlot, 0, 8, 8)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.itemsSlot, 1, 8+18, 8)); + } + + @Override + public boolean canInteractWith(EntityPlayer var1) { + return tileEntity.isUseableByPlayer(var1); + } +} diff --git a/src/main/java/ihl/worldgen/ores/DebugScannerGui.java b/src/main/java/ihl/worldgen/ores/DebugScannerGui.java new file mode 100644 index 0000000..56be263 --- /dev/null +++ b/src/main/java/ihl/worldgen/ores/DebugScannerGui.java @@ -0,0 +1,69 @@ +package ihl.worldgen.ores; + +import java.util.List; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.util.ResourceLocation; + +@SideOnly(Side.CLIENT) +public class DebugScannerGui extends GuiContainer { + private static final ResourceLocation background = new ResourceLocation("ihl", "textures/gui/GUIDebugScanner.png"); + private DebugScannerContainer container; + + public DebugScannerGui (DebugScannerContainer container1) + { + super(container1); + this.container=container1; + this.ySize=DebugScannerContainer.height; + this.xSize=DebugScannerContainer.width; + } + + @Override + protected void drawGuiContainerForegroundLayer(int par1, int par2) { + List ode = container.tileEntity.oreDictionaryEntries; + int verticalOffset = 31; + for(int i=0;i38) + { + String string1=string.substring(0,38); + String string2=string.substring(38); + fontRendererObj.drawStringWithShadow(string1, 9, i*10+verticalOffset, colorIndex); + verticalOffset+=10; + fontRendererObj.drawStringWithShadow(string2, 9, i*10+verticalOffset, colorIndex); + } + else + { + fontRendererObj.drawStringWithShadow(string, 9, i*10+verticalOffset, colorIndex); + } + } + } + + @Override + protected void drawGuiContainerBackgroundLayer(float par1, int par2, + int par3) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.renderEngine.bindTexture(background); + int x = (width - xSize) / 2; + int y = (height - ySize) / 2; + this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); + } +} \ No newline at end of file diff --git a/src/main/java/ihl/worldgen/ores/DebugScannerTileEntity.java b/src/main/java/ihl/worldgen/ores/DebugScannerTileEntity.java new file mode 100644 index 0000000..b32f3e8 --- /dev/null +++ b/src/main/java/ihl/worldgen/ores/DebugScannerTileEntity.java @@ -0,0 +1,157 @@ +package ihl.worldgen.ores; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ic2.core.ContainerBase; +import ic2.core.IC2; +import ic2.core.IHasGui; +import ic2.core.block.TileEntityInventory; +import ic2.core.block.invslot.InvSlot; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.IFluidContainerItem; +import net.minecraftforge.oredict.OreDictionary; + +public class DebugScannerTileEntity extends TileEntityInventory implements IHasGui { + public final InvSlot itemsSlot; + private ItemStack lastItem; + public List oreDictionaryEntries = new ArrayList(); + + public DebugScannerTileEntity() { + this.itemsSlot = new InvSlot(this, "drainInput", 0, InvSlot.Access.I, 2); + } + + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { + return this.getFacing() != (short) side && side != 0 && side != 1; + } + + @Override + public void updateEntityClient() { + if (IC2.platform.isRendering()) { + if (this.itemsSlot.get(0) != null && this.itemsSlot.get(0) != lastItem) { + this.oreDictionaryEntries.clear(); + int[] ids = OreDictionary.getOreIDs(this.itemsSlot.get()); + String itemNameFromIR = Item.itemRegistry.getNameForObject(this.itemsSlot.get().getItem()); + this.oreDictionaryEntries.add("ItemRegistry entry:"); + this.oreDictionaryEntries.add(" " + itemNameFromIR); + this.oreDictionaryEntries.add("Item damage: " + this.itemsSlot.get().getItemDamage()); + this.oreDictionaryEntries.add("Item class:"); + this.oreDictionaryEntries.add(" " + this.itemsSlot.get().getItem().getClass().getCanonicalName()); + if (this.itemsSlot.get().stackTagCompound != null) { + this.oreDictionaryEntries.add("NBT keys:"); + Iterator iterator = this.itemsSlot.get().stackTagCompound.func_150296_c().iterator(); + while (iterator.hasNext()) { + String entry = (String) iterator.next(); + if (this.itemsSlot.get().stackTagCompound.getTag(entry) instanceof NBTTagCompound) { + this.oreDictionaryEntries.add(" " + entry); + NBTTagCompound ct = this.itemsSlot.get().stackTagCompound.getCompoundTag(entry); + 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(); + while (stIterator.hasNext()) { + String entry2 = (String) stIterator.next(); + this.oreDictionaryEntries.add(" " + entry2 + "=" + ct.getString(entry2)); + } + } + } else { + this.oreDictionaryEntries + .add(" " + entry + "=" + this.itemsSlot.get().stackTagCompound.getString(entry)); + } + } + } + if (ids.length > 0) { + this.oreDictionaryEntries.add("Ore dict. entries:"); + for (int i = 0; i < ids.length; i++) { + this.oreDictionaryEntries.add(" " + OreDictionary.getOreName(ids[i])); + } + } + lastItem = this.itemsSlot.get(0); + } + if (this.itemsSlot.get(1) != null && this.itemsSlot.get(1) != lastItem) { + this.oreDictionaryEntries.clear(); + FluidStack fluid = null; + this.oreDictionaryEntries.add("Fluid related item type:"); + if (this.itemsSlot.get(1).getItem() instanceof IFluidContainerItem) { + this.oreDictionaryEntries.add(" IFluidContainerItem"); + fluid = ((IFluidContainerItem) this.itemsSlot.get(1).getItem()).getFluid(this.itemsSlot.get(1)); + } else if (FluidContainerRegistry.isContainer(this.itemsSlot.get(1))) { + this.oreDictionaryEntries.add(" FluidContainerRegistry entry"); + if (FluidContainerRegistry.isBucket(this.itemsSlot.get(1))) { + this.oreDictionaryEntries.add("This is bucket."); + } else { + this.oreDictionaryEntries.add("This is not a bucket."); + } + ItemStack emptyContainer = FluidContainerRegistry.drainFluidContainer(this.itemsSlot.get(1)); + if (emptyContainer != null) { + this.oreDictionaryEntries.add("This container could return empty container:"); + this.oreDictionaryEntries.add(" " + emptyContainer.getDisplayName()); + } else { + this.oreDictionaryEntries.add("This container has no empty version."); + } + fluid = FluidContainerRegistry.getFluidForFilledItem(this.itemsSlot.get(1)); + } else { + this.oreDictionaryEntries.add(" none"); + } + if (fluid != null) { + this.oreDictionaryEntries.add("Internal fluid name:"); + this.oreDictionaryEntries.add(" " + fluid.getFluid().getName()); + this.oreDictionaryEntries.add("Fluid class:"); + this.oreDictionaryEntries.add(" " + fluid.getFluid().getClass().getName()); + this.oreDictionaryEntries.add("Fluid id:"); + this.oreDictionaryEntries.add(" " + fluid.getFluid().getID()); + this.oreDictionaryEntries.add("Fluid still icon:"); + if (fluid.getFluid().getStillIcon() != null) { + this.oreDictionaryEntries.add(" " + fluid.getFluid().getStillIcon().getIconName()); + } else { + this.oreDictionaryEntries.add(" "); + } + this.oreDictionaryEntries.add("Fluid flowing icon:"); + if (fluid.getFluid().getFlowingIcon() != null) { + this.oreDictionaryEntries.add(" " + fluid.getFluid().getFlowingIcon().getIconName()); + } else { + this.oreDictionaryEntries.add(" "); + } + } + lastItem = this.itemsSlot.get(1); + } + } + } + + /** + * Returns the name of the inventory + */ + @Override + public String getInventoryName() { + return "debugScanner"; + } + + @Override + public ContainerBase getGuiContainer(EntityPlayer entityPlayer) { + return new DebugScannerContainer(entityPlayer, this); + } + + @Override + @SideOnly(Side.CLIENT) + public GuiScreen getGui(EntityPlayer entityPlayer, boolean isAdmin) { + return new DebugScannerGui(new DebugScannerContainer(entityPlayer, this)); + } + + @Override + public void onGuiClosed(EntityPlayer entityPlayer) { + } + + public boolean getGui(EntityPlayer player) { + return this instanceof IHasGui ? (IC2.platform.isSimulating() ? IC2.platform.launchGui(player, this) : true) + : false; + } +} \ No newline at end of file diff --git a/src/main/java/ihl/worldgen/ores/IHLFluid.java b/src/main/java/ihl/worldgen/ores/IHLFluid.java new file mode 100644 index 0000000..5e2e08b --- /dev/null +++ b/src/main/java/ihl/worldgen/ores/IHLFluid.java @@ -0,0 +1,333 @@ +package ihl.worldgen.ores; + +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 cpw.mods.fml.common.registry.GameRegistry; +import ic2.core.Ic2Items; +import ihl.IHLCreativeTab; +import ihl.IHLModInfo; +import ihl.items_blocks.IHLFluidBlock; +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.renderer.texture.TextureMap; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBucket; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidRegistry; +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>(); + public static final int maxGaseousStateVapoursDensity = 40; + + public IHLFluid(IHLFluidType type1) { + super(type1.fluidRegistryName); + type = type1; + this.setTemperature(type.temperature); + this.setDensity(Math.round(type.density)); + realDensityMap.put(type1.fluidRegistryName, type.density); + this.setUnlocalizedName(type.fluidRegistryName.replaceFirst("fluid", "")); + this.setGaseous(type.isGaseous); + Fluid instance = this; + if (!FluidRegistry.registerFluid(instance)) { + instance = FluidRegistry.getFluid(type.fluidRegistryName); + } + if (instance.getBlock() == null) { + 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); + GameRegistry.registerItem(bucket, "bucket_" + type.fluidName); + FluidContainerRegistry.registerFluidContainer(instance, new ItemStack(bucket), + FluidContainerRegistry.EMPTY_BUCKET); + bucket.setContainerItem(Items.bucket); + } + type.fluid = instance; + localFluidRegistry.put(type1.fluidRegistryName, type); + fluidInstances.add(this); + } + + public static void init() { + IHLFluidType[] var1 = IHLFluidType.values(); + for (int i = 0; i < var1.length; i++) { + new IHLFluid(var1[i]); + } + condensationMap.put("steam", "ic2distilledwater"); + condensationMap.put("ic2steam", "ic2distilledwater"); + condensationMap.put("ic2superheatedsteam", "ic2distilledwater"); + condensationMap.put("vapour.sulfuricacid", "sulfuricacid"); + solutionMap.put("water", Arrays.asList( + new String[] { "aquaregia", "sulfuricacid", "solution.nickelsulfate", "solution.bluevitriol" })); + solutionMap.put("ic2distilledwater", Arrays.asList( + new String[] { "aquaregia", "sulfuricacid", "solution.nickelsulfate", "solution.bluevitriol" })); + } + + public static void registerIcons(TextureMap iconRegistry) { + Iterator ii = fluidInstances.iterator(); + while (ii.hasNext()) { + Fluid instance = ii.next(); + IHLFluidType instanceType = localFluidRegistry.get(instance.getName()); + instance.setIcons(iconRegistry.registerIcon(IHLModInfo.MODID + ":" + instanceType.textureName + "Still"), + iconRegistry.registerIcon(IHLModInfo.MODID + ":" + instanceType.textureName + "Flowing")); + } + } + + public static ItemStack getCell(String fluidname1) { + ItemStack filledCell = FluidContainerRegistry.fillFluidContainer( + new FluidStack(FluidRegistry.getFluid(fluidname1), FluidContainerRegistry.BUCKET_VOLUME), + Ic2Items.cell.copy()); + return filledCell; + } + + public static Block getBlock(String fluidname) { + return localFluidRegistry.get(fluidname).fluid.getBlock(); + } + + public static int getMeltingPoint(Fluid fluid) { + if (localFluidRegistry.get(fluid.getName()) != null) { + IHLFluidType type = localFluidRegistry.get(fluid.getName()); + return type.meltingPoint; + } else { + if (fluid.isGaseous()) { + return fluid.getTemperature() > 100 ? fluid.getTemperature() - 100 : 0; + } else { + return fluid.getTemperature(); + } + } + } + + public static int getBoilingPoint(Fluid fluid) { + if (localFluidRegistry.containsKey(fluid.getName())) { + IHLFluidType type = localFluidRegistry.get(fluid.getName()); + return type.boilingPoint; + } else { + return 373; + } + } + + public enum IHLFluidType { + // Methane("Methane","fluidAcetylene",10047, 293, 249, 373, 1150, + // "methane", Material.water, false, false, false, false), + NitroGlyceryl("NitroGlycerin", 10052, 293, 291, 583, 1595, "nitroglycerin", Material.water, true, false, true), + Ammonia("Ammonia", 10051, 273, 273 - 78, 273 + - 33, 0.772F, "ammonia", new MaterialLiquid(MapColor.airColor), true, 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), + MoltenTarPitch("MoltenTarPitch", "fluidOil", 10043, 373, 373, 800, 1250, "molten.tarpitch", Material.lava, false, false, false), + CrackingGas("CrackingGas", "fluidAcetylene", 10042, 293, 135, 273, 2.27f, "crackinggas", new MaterialLiquid( + MapColor.blackColor), false, false, false), + Trichlorosilane("Trichlorosilane", "fluidHydrogenChloride", 10041, 293, 147, 305, 1342, "trichlorosilane", new MaterialLiquid( + MapColor.greenColor), true, false, false), + SiliconTetrachloride("SiliconTetrachloride", "fluidChlorine", 10040, 293, 204, 330, 584, "silicontetrachloride", new MaterialLiquid( + MapColor.cyanColor), true, false, false), + Chlorine("Chlorine", 10039, 293, 172, 238, 3.21F), + BoricAcid("BoricAcid", 10038, 373, 249, 373, 1275, "boricacid", Material.water, false, false, false), + MicaPulp("PulpMica", 10037, 293, 249, 373, 1150, "pulp.mica", Material.water, false, false, false), + CellulosePulp("PulpCellulose", 10036, 293, 249, 373, 1075, "pulp.cellulose", Material.water, false, false, false), + 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", "fluidOil", 10032, 293, 284, 773, 850f, "oil", Material.water, true, false, true), + 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", "fluidSaltWater", 10028, 293, 253, 373, 1360f, "saltwater", Material.water, true, 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), + Air("Air", 293, 55, 93, 1.292F, Ic2Items.airCell), + Nitrogen("Nitrogen", 10024, 92, 56, 92, 1.251F, "nitrogen", new MaterialLiquid( + MapColor.airColor), true, false, true), + Acetylene("Acetylene", 10023, 293, 17, 190, 1.173F, "acetylene", Material.water, true, false, true), + Oxygen("Oxygen", 10022, 93, 55, 93, 1.429F, "oxygen", new MaterialLiquid(MapColor.airColor), true, false, true), + NatriumHydroxide("NatriumHydroxideDissolvedInWater", 10021, 293, 249, 373, 1525, "solution.natriumhydroxide", Material.water, true, false, false), + LiquidGlass("LiquidGlass", 10020, 293, 253, 373, 2400), + fluidRubberTreeSap("fluidRubberTreeSap", "fluidRubberTreeSap", 10019, 293, 273, 393, 1200f, "fluidrubbertreesap", Material.water, true, true, false), + SpruceResin("SpruceResin","fluidSpruceResin", 10018, 293, 273, 533, 1080, "spruceresin", Material.water, true, true, true), + CablingColophony("CablingColophony", 10017, 363, 363, 533, 1070, "cablingcolophony", Material.water, true, false, true), + Glycerol("Glycerol", 10016, 293, 291, 583, 1261, "glycerol", Material.water, true, false, true), + SeedOil("SeedOil", 10015, 293, 256, 583, 920, "seedoil", Material.water, true, false, true), + AquaRegia("AquaRegia", 10014, 293, 231, 356, 1060), + SodiumPeroxide("SodiumPeroxide", 10013, 950, 950, 2223, 1800), + OsmiumTetroxide("OsmiumTetroxide", 10012, 313, 313, 403, 9), + OleicAcid("OleicAcid", 10011, 293, 288, 633, 895, "oleicacid", Material.water, true, false, true), + Limemilk("Limemilk", 10010, 293, 250, 373, 1020), + 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), + 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), + 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), + MoltenMagnesium("MoltenMagnesium", "fluidMolten", 10006, 923, 923, 1623, 1584, "molten.magnesium", Material.lava, false, false, false), + MoltenSteel("MoltenSteel", "fluidMolten", 10006, 1800, 1800, 3134, 6980, "molten.steel", Material.lava, false, false, false), + MoltenCopper("MoltenCopper", "fluidMolten", 10048, 1356, 1356, 2840, 8920, "molten.copper", Material.lava, false, false, false), + MoltenBronze("MoltenBronze", 10005, 940, 940, 2840, 8000, "molten.bronze", Material.lava, false, false, false), + MoltenGold("MoltenGold", 10005, 1337, 1337, 3129, 17310, "molten.gold", Material.lava, false, false, false), + SulfuricAcid("SulfuricAcid", 10002, 293, 283, 610, 1836), + NitricAcid("NitricAcid", 10001, 293, 231, 356, 1100); + + IHLFluidType(String fluidName1, int celldamage, int temperature1, int meltingPoint1, int boilingPoint1, + float density1) { + fluidName = fluidName1; + fluidRegistryName = fluidName.toLowerCase(); + textureName = "fluid" + fluidName.replaceFirst("fluid", ""); + temperature = temperature1; + density = density1; + cellName = "itemCell" + fluidName; + haveBucket = false; + isGaseous = density1 < maxGaseousStateVapoursDensity; + boilingPoint = boilingPoint1; + meltingPoint = meltingPoint1; + damage = celldamage; + } + + IHLFluidType(String fluidName1, int temperature1, int meltingPoint1, int boilingPoint1, float density1, + ItemStack cell1) { + fluidName = fluidName1; + fluidRegistryName = fluidName.toLowerCase(); + textureName = "fluid" + fluidName.replaceFirst("fluid", ""); + temperature = temperature1; + density = density1; + cellName = "itemCell" + fluidName; + haveBucket = false; + isGaseous = density1 < maxGaseousStateVapoursDensity; + boilingPoint = boilingPoint1; + meltingPoint = meltingPoint1; + damage = 99999; + hasCell = false; + cell = cell1; + } + + IHLFluidType(String fluidName1, int celldamage, int temperature1, int meltingPoint1, int boilingPoint1, + float density1, String fluidRegistryName1, Material blockMaterial1, boolean hasCell1, + boolean haveBucket1, boolean flammable1) { + fluidName = fluidName1; + fluidRegistryName = fluidRegistryName1; + textureName = "fluid" + fluidName.replaceFirst("fluid", ""); + temperature = temperature1; + density = density1; + cellName = "itemCell" + fluidName; + haveBucket = haveBucket1; + flammable = flammable1; + isGaseous = density1 < maxGaseousStateVapoursDensity; + blockMaterial = blockMaterial1; + boilingPoint = boilingPoint1; + meltingPoint = meltingPoint1; + hasCell = hasCell1; + damage = celldamage; + } + + IHLFluidType(String fluidName1, String textureName1, int celldamage, int temperature1, int meltingPoint1, + int boilingPoint1, float density1, String fluidRegistryName1, Material blockMaterial1, boolean hasCell1, + boolean haveBucket1, boolean flammable1) { + fluidName = fluidName1; + fluidRegistryName = fluidRegistryName1; + textureName = textureName1; + temperature = temperature1; + density = density1; + cellName = "itemCell" + fluidName; + haveBucket = haveBucket1; + flammable = flammable1; + isGaseous = density1 < maxGaseousStateVapoursDensity; + blockMaterial = blockMaterial1; + boilingPoint = boilingPoint1; + meltingPoint = meltingPoint1; + hasCell = hasCell1; + damage = celldamage; + } + + public String fluidName; + public String fluidRegistryName; + public String cellName; + public String textureName; + int temperature; + float density; + boolean isGaseous; + boolean flammable = false; + boolean haveBucket; + Material blockMaterial = Material.water; + int meltingPoint; + int boilingPoint; + public boolean hasCell = true; + public ItemStack cell; + public Fluid fluid; + public final int damage; + } + + @SuppressWarnings("deprecation") + public static FluidStack getCondensationResult(FluidStack condensatedGas) { + String fluidname = condensationMap.get(condensatedGas.getFluid().getName()); + Fluid fluid = FluidRegistry.getFluid(fluidname); + if (fluid != null) { + int quantity = Math.round(condensatedGas.amount * getCondensationConversionRate(condensatedGas.getFluid())); + if (quantity > 0) { + return new FluidStack(fluid.getID(), quantity); + } + } + return null; + } + + public static float getCondensationConversionRate(Fluid gas) { + String fluidname = condensationMap.get(gas.getName()); + Fluid fluid = FluidRegistry.getFluid(fluidname); + if (fluid != null) { + float rate = (float) gas.getDensity() / (float) fluid.getDensity(); + if (gas.getDensity() < 0) { + // IC2 steam density -800, 100 mb steam from 1 mb water + rate = (-8000F / gas.getDensity()) / fluid.getDensity(); + } + return rate; + } + return 0F; + } + + public static boolean canBeDissolvedIn(FluidStack solvent, String impurity) { + return solutionMap.get(solvent.getFluid().getName()).contains(impurity); + } + + public static float getRealDensity(Fluid gas) { + if (realDensityMap.containsKey(gas.getName())) { + return realDensityMap.get(gas.getName()); + } else { + float density = gas.getDensity(); + if (gas.getDensity() < 0) { + // IC2 steam density -800, 100 mb steam from 1 mb water + density = -8000F / gas.getDensity(); + } + return density; + } + } + +} diff --git a/src/main/resources/META-INF/ihl_at.cfg b/src/main/resources/META-INF/ihl_at.cfg new file mode 100644 index 0000000..a327a0a --- /dev/null +++ b/src/main/resources/META-INF/ihl_at.cfg @@ -0,0 +1,5 @@ +public net.minecraft.client.renderer.EntityRenderer func_78479_a(FI)V # setupCameraTransform +public net.minecraft.world.chunk.storage.ExtendedBlockStorage field_76680_d # blockLSBArray +public net.minecraft.world.chunk.storage.ExtendedBlockStorage field_76681_e # blockMSBArray +public net.minecraft.world.chunk.storage.ExtendedBlockStorage field_76682_b # blockRefCount +public net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher ()V diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info new file mode 100644 index 0000000..2cc4fbc --- /dev/null +++ b/src/main/resources/mcmod.info @@ -0,0 +1,16 @@ +[ +{ + "modid": "IHL", + "name": "IHL Tools & Machines", + "description": "IC2 addon", + "version": "${version}", + "mcversion": "1.7.10", + "credits": "Thank to Player, Spwnx, GregoriousT, Chocohead and other IC2 forum members for help and moral support. Thank to Ldog, wormzjl and Chocohead for betatesting. Especially Chocohead and wormzjl. Chocohead made a lot of work and wormzjl is really concerned by this mod.", + "authorList": ["Foghrye4"], + "logoFile": "", + "url": "http://forum.industrial-craft.net/index.php?page=Thread&postID=152495", + "updateUrl": "", + "parent": "", + "screenshots": [] +} +] -- cgit v1.2.3